diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 469827e5e3f8..b1cbf797b28b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,3 +14,4 @@ /google-auth-library-java/ @googleapis/cloud-sdk-auth-team @googleapis/cloud-sdk-java-team @googleapis/aion-team /java-storage/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team /java-storage-nio/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team +/java-bigtable/ @googleapis/bigtable-team @googleapis/cloud-sdk-java-team diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08784a7158ed..8beedd2b25cc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,8 +36,8 @@ jobs: with: filters: | src: - - '!(java-bigquery|java-bigquerystorage|java-datastore|java-logging-logback|java-logging|java-spanner|java-storage|google-auth-library-java)/**/*.java' - - '!(java-bigquery|java-bigquerystorage|java-datastore|java-logging-logback|java-logging|java-spanner|java-storage|google-auth-library-java)/**/pom.xml' + - '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-logging|java-logging-logback|java-spanner|java-storage)/**/*.java' + - '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-logging|java-logging-logback|java-spanner|java-storage)/**/pom.xml' - 'pom.xml' ci: - '.github/workflows/ci.yaml' @@ -171,6 +171,13 @@ jobs: - 'sdk-platform-java/**/*.java' - 'sdk-platform-java/java-shared-dependencies/**/pom.xml' - 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml' + java-bigtable: + - 'java-bigtable/**' + - 'google-auth-library-java/**/*.java' + - 'google-auth-library-java/**/pom.xml' + - 'sdk-platform-java/**/*.java' + - 'sdk-platform-java/java-shared-dependencies/**/pom.xml' + - 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml' split-units: runs-on: ubuntu-latest needs: changes diff --git a/.github/workflows/java-bigtable-ci.yaml b/.github/workflows/java-bigtable-ci.yaml new file mode 100644 index 000000000000..ef6db6e93a0d --- /dev/null +++ b/.github/workflows/java-bigtable-ci.yaml @@ -0,0 +1,156 @@ +# 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. +on: + push: + branches: + - main + pull_request: +name: java-bigtable ci +env: + BUILD_SUBDIR: java-bigtable +jobs: + filter: + runs-on: ubuntu-latest + outputs: + library: ${{ steps.filter.outputs.library }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + library: + - 'java-bigtable/**' + units: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [11, 17, 21, 25] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + units-java8: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: windows-latest + steps: + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + dependencies: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + javadoc: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc + lint: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + clirr: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr + BUILD_SUBDIR: java-bigtable diff --git a/.github/workflows/java-bigtable-conformance.yaml b/.github/workflows/java-bigtable-conformance.yaml new file mode 100644 index 000000000000..621e4ac6784e --- /dev/null +++ b/.github/workflows/java-bigtable-conformance.yaml @@ -0,0 +1,57 @@ +# Copyright 2023 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. +on: + push: + branches: + - main + pull_request: +name: java-bigtable conformance +env: + BUILD_SUBDIR: java-bigtable +jobs: + filter: + runs-on: ubuntu-latest + outputs: + library: ${{ steps.filter.outputs.library }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + library: + - 'java-bigtable/**' + conformance: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: googleapis/cloud-bigtable-clients-test + ref: main + path: cloud-bigtable-clients-test + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + - uses: actions/setup-go@v5 + with: + go-version: '>=1.20.2' + - run: java -version + - run: go version + - run: .kokoro/bigtable-conformance.sh diff --git a/.kokoro/bigtable-conformance.sh b/.kokoro/bigtable-conformance.sh new file mode 100755 index 000000000000..02a4628c0eb5 --- /dev/null +++ b/.kokoro/bigtable-conformance.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +echo "Pre-installing SDK Platform toolchain and submodules..." +pushd sdk-platform-java +retry_with_backoff 3 10 mvn install -B -ntp -DskipTests=true -Dclirr.skip=true -Denforcer.skip=true -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -T 1C +popd + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -pl java-bigtable,java-bigtable/google-cloud-bigtable-bom,java-bigtable/google-cloud-bigtable-deps-bom,java-monitoring/google-cloud-monitoring-bom -am -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +RETURN_CODE=0 +set +e + +# Build the proxy +pushd . +cd java-bigtable/test-proxy +mvn clean install -DskipTests +popd + +declare -a configs=("default" "enable_all") +for config in "${configs[@]}" +do + # Start the proxy in a separate process + nohup java -Dport=9999 -jar java-bigtable/test-proxy/target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar & + proxyPID=$! + + # Run the conformance test + if [[ ${config} = "enable_all" ]] + then + echo "Testing the client with all optional features enabled..." + configFlag="--enable_features_all" + else + echo "Testing the client with default settings for optional features..." + # skipping routing cookie and retry info tests. When the feature is disabled, these + # tests are expected to fail + configFlag="-skip _Retry_WithRoutingCookie\|_Retry_WithRetryInfo" + fi + + pushd . + cd cloud-bigtable-clients-test/tests + eval "go test -v -proxy_addr=:9999 ${configFlag} -skip '`cat ../../java-bigtable/test-proxy/known_failures.txt`'" + returnCode=$? + popd + + # Stop the proxy + kill ${proxyPID} && sleep 5 + + if [[ ${returnCode} -gt 0 ]] + then + echo "Conformance test failed for config: ${config}" + RETURN_CODE=${returnCode} + else + echo "Conformance test passed for config: ${config}" + fi +done + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +exit ${RETURN_CODE} diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 3691dd9a0a3f..b439241bbdb6 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -263,6 +263,7 @@ case ${JOB_TYPE} in [[ "$(basename "${dir}")" != "dependency-analyzer" ]] && \ [[ "$(basename "${dir}")" != "dependency-convergence-check" ]] && \ [[ "$(basename "${dir}")" != "unmanaged-dependency-check" ]] && \ + [[ "$(basename "${dir}")" != *"test-proxy"* ]] && \ [[ "$(basename "${dir}")" != "google-cloud-jar-parent" ]]; then changed_modules+=("${dir}") diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 7926a7786b46..31a7b833497d 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -36,6 +36,7 @@ excluded_modules=( 'google-auth-library-java/oauth2_http' 'java-storage' 'java-storage-nio' + 'java-bigtable' ) function retry_with_backoff { @@ -406,6 +407,7 @@ function install_modules() { printf "Installing submodules:\n%s\n" "$all_submodules" always_install_deps_list=( + 'java-monitoring/google-cloud-monitoring-bom' 'google-auth-library-java/appengine' 'google-auth-library-java/bom' 'google-auth-library-java/cab-token-generator' diff --git a/.kokoro/presubmit/bigtable-graalvm-native-presubmit.cfg b/.kokoro/presubmit/bigtable-graalvm-native-presubmit.cfg new file mode 100644 index 000000000000..1761836525f4 --- /dev/null +++ b/.kokoro/presubmit/bigtable-graalvm-native-presubmit.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.61.0" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm-single" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} +env_vars: { + key: "BUILD_SUBDIR" + value: "java-bigtable" +} diff --git a/.kokoro/presubmit/bigtable-integration-dp.cfg b/.kokoro/presubmit/bigtable-integration-dp.cfg new file mode 100644 index 000000000000..a9d32aa6b83b --- /dev/null +++ b/.kokoro/presubmit/bigtable-integration-dp.cfg @@ -0,0 +1,43 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "-P bigtable-directpath-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration-single" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "BUILD_SUBDIR" + value: "java-bigtable" +} diff --git a/.kokoro/presubmit/bigtable-integration.cfg b/.kokoro/presubmit/bigtable-integration.cfg new file mode 100644 index 000000000000..e056914485b9 --- /dev/null +++ b/.kokoro/presubmit/bigtable-integration.cfg @@ -0,0 +1,43 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "-P bigtable-emulator-it,bigtable-prod-it,bigtable-prod-batch-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests -Dbigtable.kms_key_name=projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key -Dbigtable.wait-for-cmek-key-status=true" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration-single" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "BUILD_SUBDIR" + value: "java-bigtable" +} diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 122a2d31a79c..911c8f77d4da 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -294,6 +294,20 @@ pom import + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + com.google.cloud google-cloud-billing-bom diff --git a/generation/check_non_release_please_versions.sh b/generation/check_non_release_please_versions.sh index a32af46bb725..0a9ce943b8b1 100755 --- a/generation/check_non_release_please_versions.sh +++ b/generation/check_non_release_please_versions.sh @@ -21,6 +21,7 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do [[ "${pomFile}" =~ .*google-auth-library-java.* ]] || \ [[ "${pomFile}" =~ .*java-storage.* ]] || \ [[ "${pomFile}" =~ .*java-storage-nio.* ]] || \ + [[ "${pomFile}" =~ .*java-bigtable.* ]] || \ [[ "${pomFile}" =~ .*java-vertexai.* ]] || \ [[ "${pomFile}" =~ .*java-compute.* ]] || \ [[ "${pomFile}" =~ .*.github*. ]]; then diff --git a/generation_config.yaml b/generation_config.yaml index b5c231a71a29..dc2b134012e2 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -3096,3 +3096,21 @@ libraries: - proto_path: google/iam/v2beta - proto_path: google/iam/v3 - proto_path: google/iam/v3beta +- api_shortname: bigtable + api_description: API for reading and writing the contents of Bigtables associated + with a cloud project. + name_pretty: Cloud Bigtable + product_documentation: https://cloud.google.com/bigtable + client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history + issue_tracker: https://issuetracker.google.com/savedsearches/559777 + release_level: stable + distribution_name: com.google.cloud:google-cloud-bigtable + codeowner_team: '@googleapis/bigtable-team' + api_id: bigtable.googleapis.com + library_type: GAPIC_COMBO + extra_versioned_modules: google-cloud-bigtable-emulator,google-cloud-bigtable-emulator-core + excluded_poms: google-cloud-bigtable-bom + recommended_package: com.google.cloud.bigtable + GAPICs: + - proto_path: google/bigtable/v2 + - proto_path: google/bigtable/admin/v2 diff --git a/java-bigtable/.OwlBot-hermetic.yaml b/java-bigtable/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..489564ca9101 --- /dev/null +++ b/java-bigtable/.OwlBot-hermetic.yaml @@ -0,0 +1,33 @@ +# 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 +# +# 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. + +deep-remove-regex: +- /java-bigtable/grpc-google-.*/src +- /java-bigtable/proto-google-.*/src +deep-preserve-regex: +- /java-bigtable/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java +- /java-bigtable/google-.*/src/main/java/com/google/cloud/.*/v.*/stub/Version.java +deep-copy-regex: +- source: /google/bigtable/(v\d)/.*-java/proto-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/proto-google-cloud-bigtable-$1/src +- source: /google/bigtable/(v\d)/.*-java/grpc-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/grpc-google-cloud-bigtable-$1/src +- source: /google/bigtable/(v\d)/.*-java/gapic-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/google-cloud-bigtable/src +- source: /google/bigtable/admin/(v\d)/.*-java/proto-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/proto-google-cloud-bigtable-admin-$1/src +- source: /google/bigtable/admin/(v\d)/.*-java/grpc-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/grpc-google-cloud-bigtable-admin-$1/src +- source: /google/bigtable/admin/(v\d)/.*-java/gapic-google-.*/src + dest: /owl-bot-staging/java-bigtable/$1/google-cloud-bigtable/src diff --git a/java-bigtable/.cloudbuild/samples_build.yaml b/java-bigtable/.cloudbuild/samples_build.yaml new file mode 100644 index 000000000000..06f87c837e58 --- /dev/null +++ b/java-bigtable/.cloudbuild/samples_build.yaml @@ -0,0 +1,33 @@ +steps: +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: ls + args: [ + '-alt', + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: curl + args: [ + '--header', + 'Metadata-Flavor: Google', + 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email' + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: pwd +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: bash + args: [ + '.kokoro/build.sh' + ] + env: + - 'JOB_TYPE=samples' + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-sample' + - 'BIGTABLE_TESTING_INSTANCE=instance' + - 'KOKORO_GITHUB_PULL_REQUEST_NUMBER=$_PR_NUMBER' +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: echo + args: [ + 'Sample job succeeded', + ] +timeout: 3600s +options: + defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET diff --git a/java-bigtable/.readme-partials.yml b/java-bigtable/.readme-partials.yml new file mode 100644 index 000000000000..1dc60bd7a729 --- /dev/null +++ b/java-bigtable/.readme-partials.yml @@ -0,0 +1,239 @@ +custom_content: | + ## About Cloud Bigtable + + [Cloud Bigtable][product-docs] is Google's NoSQL Big Data database service. It's + the same database that powers many core Google services, including Search, Analytics, Maps, and + Gmail. + + Be sure to activate the Cloud Bigtable API and the Cloud Bigtable Admin API under APIs & Services in the GCP Console to use Cloud Bigtable from your project. + + See the Bigtable client library documentation ([Admin API](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/package-summary.html) and [Data API](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/package-summary.html)) to learn how to + interact with Cloud Bigtable using this Client Library. + + ## Concepts + + Cloud Bigtable is composed of instances, clusters, nodes and tables. + + ### Instances + Instances are containers for clusters. + + ### Clusters + Clusters represent the actual Cloud Bigtable service. Each cluster belongs to a single Cloud Bigtable instance, and an instance can have up to 4 clusters. When your application + sends requests to a Cloud Bigtable instance, those requests are actually handled by one of the clusters in the instance. + + ### Nodes + Each cluster in a production instance has 3 or more nodes, which are compute resources that Cloud Bigtable uses to manage your data. + + ### Tables + Tables contain the actual data and are replicated across all of the clusters in an instance. + + + ## Clients + The Cloud Bigtable API consists of: + + ### Data API + Allows callers to persist and query data in a table. It's exposed by [BigtableDataClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/BigtableDataClient.html). + + ### Admin API + Allows callers to create and manage instances, clusters, tables, and access permissions. This API is exposed by: [BigtableInstanceAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.html) for Instance and Cluster level resources. + + See [BigtableTableAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.html) for table management. + + See [BigtableDataClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/BigtableDataClient.html) for the data client. + + See [BigtableInstanceAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.html) for the instance admin client. + + See [BigtableTableAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.html) for the table admin client. + + #### Calling Cloud Bigtable + + The Cloud Bigtable API is split into 3 parts: Data API, Instance Admin API and Table Admin API. + + Here is a code snippet showing simple usage of the Data API. Add the following imports + at the top of your file: + + ```java + import com.google.cloud.bigtable.data.v2.BigtableDataClient; + import com.google.cloud.bigtable.data.v2.models.Query; + import com.google.cloud.bigtable.data.v2.models.Row; + + ``` + + Then, to make a query to Bigtable, use the following code: + ```java + // Instantiates a client + String projectId = "my-project"; + String instanceId = "my-instance"; + String tableId = "my-table"; + + // Create the client. + // Please note that creating the client is a very expensive operation + // and should only be done once and shared in an application. + BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId); + + try { + // Query a table + Query query = Query.create(tableId) + .range("a", "z") + .limit(26); + + for (Row row : dataClient.readRows(query)) { + System.out.println(row.getKey()); + } + } finally { + dataClient.close(); + } + ``` + + The Admin APIs are similar. Here is a code snippet showing how to create a table. Add the following + imports at the top of your file: + + ```java + import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; + import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; + import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; + import com.google.cloud.bigtable.admin.v2.models.Table; + ``` + + Then, to create a table, use the following code: + ```java + String projectId = "my-instance"; + String instanceId = "my-database"; + + BigtableTableAdminClient tableAdminClient = BigtableTableAdminClient + .create(projectId, instanceId); + + try { + tableAdminClient.createTable( + CreateTableRequest.of("my-table") + .addFamily("my-family") + ); + } finally { + tableAdminClient.close(); + } + ``` + + TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). + + ## Client side metrics + + Cloud Bigtable client supports publishing client side metrics to + [Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the + `bigtable.googleapis.com/client` namespace. + + This feature is available once you upgrade to version 2.16.0 and above. + Follow the guide on https://cloud.google.com/bigtable/docs/client-side-metrics-setup to enable. + + Since version 2.38.0, [client side metrics](https://cloud.google.com/bigtable/docs/client-side-metrics) + is enabled by default. This feature collects useful telemetry data in the client and is recommended to + use in conjunction with server-side metrics to get a complete, actionable view of your Bigtable + performance. There is no additional cost to publish and view client-side metrics + in Cloud Monitoring. + + ### Opt-out client side metrics + + You can opt-out client side metrics with the following settings: + + ```java + BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); + ``` + + ### Use a custom OpenTelemetry instance + + If your application already has OpenTelemetry integration, you can register client side metrics on + your OpenTelemetry instance. You can refer to + [CustomOpenTelemetryMetricsProvider](https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java) + on how to set it up. + + ### Disable Bigtbale traces + + If your application already has tracing integration and you want to disable Bigtable + traces, you can do the following: + + ```java + public static class MySampler extends Sampler { + + private final Sampler childSampler; + + MySampler(Sampler child) { + this.childSampler = child; + } + + @Override + public boolean shouldSample(@Nullable SpanContext parentContext, + @Nullable Boolean hasRemoteParent, + TraceId traceId, + SpanId spanId, + String name, + List parentLinks) { + if (name.contains("Bigtable")) { + return false; + } + return childSampler.shouldSample(parentContext, hasRemoteParent, traceId, spanId, name, parentLinks); + } + + @Override + public String getDescription() { + return "from my sampler"; + } + } + ``` + + And use this sampler in your trace config: + ```java + Tracing.getTraceConfig().updateActiveTraceParams( + Tracing.getTraceConfig().getActiveTraceParams().toBuilder() + .setSampler(new MySampler(Samplers.probabilitySampler(0.1))) + .build() + ); + ``` + + ## Version Conflicts + + google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought + in by other libraries, for example Apache Beam. This happens because internal dependencies + between gRPC libraries are pinned to an exact version of grpc-core + (see [here](https://github.com/grpc/grpc-java/commit/90db93b990305aa5a8428cf391b55498c7993b6e)). + If both google-cloud-bigtable and the other library bring in two gRPC libraries that depend + on the different versions of grpc-core, then dependency resolution will fail. + The easiest way to fix this is to depend on the gRPC bom, which will force all the gRPC + transitive libraries to use the same version. + + Add the following to your project's pom.xml. + + ``` + + + + io.grpc + grpc-bom + 1.28.0 + pom + import + + + + ``` + + ## Container Deployment + + While deploying this client in [Google Kubernetes Engine(GKE)](https://cloud.google.com/kubernetes-engine) with [CoS](https://cloud.google.com/container-optimized-os/docs/). Please make sure to provide CPU configuration in your deployment file. With default configuration JVM detects only 1 CPU, which affects the number of channels with the client, resulting in performance repercussion. + + Also, The number of `grpc-nio-worker-ELG-1-#` thread is same as number of CPUs. These are managed by a single `grpc-default-executor-#` thread, which is shared among multiple client instances. + + For example: + ```yaml + appVersion: v1 + ... + spec: + ... + container: + resources: + requests: + cpu: "1" # Here 1 represents 100% of single node CPUs whereas other than 1 represents the number of CPU it would use from a node. + ``` + see [Assign CPU Resources to Containers](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#specify-a-cpu-request-and-a-cpu-limit) for more information. diff --git a/java-bigtable/.repo-metadata.json b/java-bigtable/.repo-metadata.json new file mode 100644 index 000000000000..63ab08a3ad2c --- /dev/null +++ b/java-bigtable/.repo-metadata.json @@ -0,0 +1,21 @@ +{ + "api_shortname": "bigtable", + "name_pretty": "Cloud Bigtable", + "product_documentation": "https://cloud.google.com/bigtable", + "api_description": "API for reading and writing the contents of Bigtables associated with a cloud project.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history", + "release_level": "stable", + "transport": "grpc", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-bigtable", + "distribution_name": "com.google.cloud:google-cloud-bigtable", + "api_id": "bigtable.googleapis.com", + "library_type": "GAPIC_COMBO", + "requires_billing": true, + "codeowner_team": "@googleapis/bigtable-team", + "excluded_poms": "google-cloud-bigtable-bom", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", + "extra_versioned_modules": "google-cloud-bigtable-emulator,google-cloud-bigtable-emulator-core", + "recommended_package": "com.google.cloud.bigtable" +} \ No newline at end of file diff --git a/java-bigtable/CHANGELOG.md b/java-bigtable/CHANGELOG.md new file mode 100644 index 000000000000..98834d30edf2 --- /dev/null +++ b/java-bigtable/CHANGELOG.md @@ -0,0 +1,2538 @@ +# Changelog + +## [2.77.1](https://github.com/googleapis/java-bigtable/compare/v2.77.0...v2.77.1) (2026-04-13) + + +### Bug Fixes + +* Bump reported admin versions ([#2876](https://github.com/googleapis/java-bigtable/issues/2876)) ([cb56060](https://github.com/googleapis/java-bigtable/commit/cb5606071e083642946ddbd87e914c5e8ec896ea)) +* Fix translate exception in compat layer ([#2879](https://github.com/googleapis/java-bigtable/issues/2879)) ([2742460](https://github.com/googleapis/java-bigtable/commit/274246016802bf92ac372d1f9c866b487f5900e2)) + +## [2.77.0](https://github.com/googleapis/java-bigtable/compare/v2.76.0...v2.77.0) (2026-04-09) + + +### Features + +* Add new session based protocol stack ([#2862](https://github.com/googleapis/java-bigtable/issues/2862)) ([d5565b5](https://github.com/googleapis/java-bigtable/commit/d5565b5a3e7bfe56d799b9db3f1d90821694fc67)) + +## [2.76.0](https://github.com/googleapis/java-bigtable/compare/v2.75.1...v2.76.0) (2026-04-09) + + +### Features + +* Add locations field to AutomatedBackupPolicy ([9345b35](https://github.com/googleapis/java-bigtable/commit/9345b359a1ee2e6f03cc26d50358bf0937b113a4)) +* **bigtable:** Classic direct access checker and it's implementation ([#2840](https://github.com/googleapis/java-bigtable/issues/2840)) ([c2ccda1](https://github.com/googleapis/java-bigtable/commit/c2ccda188e5ec5ec3004d0535efbc45a804f24f0)) +* **bigtable:** Enable direct access by default ([#2857](https://github.com/googleapis/java-bigtable/issues/2857)) ([bffd892](https://github.com/googleapis/java-bigtable/commit/bffd892185fba3f4cf59077201288796f620e389)) + + +### Bug Fixes + +* Check alts if we return permission denied for pingandwarm ([#2860](https://github.com/googleapis/java-bigtable/issues/2860)) ([3926275](https://github.com/googleapis/java-bigtable/commit/3926275d4eb84aeb07459abd1b6e70dd65f6beb8)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.68.0 ([9345b35](https://github.com/googleapis/java-bigtable/commit/9345b359a1ee2e6f03cc26d50358bf0937b113a4)) +* Logic to suppress failed metric export during client shutdown ([#2858](https://github.com/googleapis/java-bigtable/issues/2858)) ([ae0f0ef](https://github.com/googleapis/java-bigtable/commit/ae0f0efb483d04f56d456366a4d21ba5a949993c)) + + +### Dependencies + +* Manually update dependency com.google.cloud:sdk-platform-java-config to v3.59.0 ([#2865](https://github.com/googleapis/java-bigtable/issues/2865)) ([21c1833](https://github.com/googleapis/java-bigtable/commit/21c183368e3287472f5d3d755d6f1ce73a4d6e32)) + +## [2.75.1](https://github.com/googleapis/java-bigtable/compare/v2.75.0...v2.75.1) (2026-03-26) + + +### Bug Fixes + +* Ensure that EnvInfo stays constant between metric exports ([#2853](https://github.com/googleapis/java-bigtable/issues/2853)) ([cfc616d](https://github.com/googleapis/java-bigtable/commit/cfc616d708e1ca7714598535aa56585480414479)) + +## [2.75.0](https://github.com/googleapis/java-bigtable/compare/v2.74.0...v2.75.0) (2026-03-24) + +### WARNING: This release contains a known bug with clientside metrics which was fixed in v2.75.1 + +### Features + +* Expose generated GAPIC instance admin client ([#2828](https://github.com/googleapis/java-bigtable/issues/2828)) ([7c42799](https://github.com/googleapis/java-bigtable/commit/7c42799d45dbefb172c567ab6242f2a6f27a1eba)) + + +### Bug Fixes + +* **bigtable:** Add gauge handling ([#2830](https://github.com/googleapis/java-bigtable/issues/2830)) ([915733b](https://github.com/googleapis/java-bigtable/commit/915733bbaf21626c87bb868070087c382ba0932e)) +* **bigtable:** Plumb transport type correctly ([#2824](https://github.com/googleapis/java-bigtable/issues/2824)) ([d25f39c](https://github.com/googleapis/java-bigtable/commit/d25f39c1f46263bd635731aa37ba71374c64c31c)) +* Fix automated backup ([#2844](https://github.com/googleapis/java-bigtable/issues/2844)) ([5dc6829](https://github.com/googleapis/java-bigtable/commit/5dc68297dc1f002cb527a710443d5c208d712bc1)) +* Fix race in emulator controller ([#2836](https://github.com/googleapis/java-bigtable/issues/2836)) ([17707be](https://github.com/googleapis/java-bigtable/commit/17707be3f4bfede9e4541d00350c400de937e3b6)) +* Use all known headers to detect connectivity errors ([#2841](https://github.com/googleapis/java-bigtable/issues/2841)) ([6466166](https://github.com/googleapis/java-bigtable/commit/6466166b417c9a5052c512f38047a7fac19b5d75)) + + +### Dependencies + +* Update shared dependencies ([#2850](https://github.com/googleapis/java-bigtable/issues/2850)) ([fb437e0](https://github.com/googleapis/java-bigtable/commit/fb437e074ee328d57c00807d4afcaf26dd78aea7)) + + +### Documentation + +* **bigtable:** Expose Admin API Stubs in Javadoc ([#2835](https://github.com/googleapis/java-bigtable/issues/2835)) ([b7a0232](https://github.com/googleapis/java-bigtable/commit/b7a0232b1cf9639f5c529240482a99c94d950931)) +* **bigtable:** Expose Base Admin Clients in Javadoc ([#2833](https://github.com/googleapis/java-bigtable/issues/2833)) ([2933ef6](https://github.com/googleapis/java-bigtable/commit/2933ef6419ec6ec6e3220a6bab03bb0c2cf7cd0d)) + +## [2.74.0](https://github.com/googleapis/java-bigtable/compare/v2.73.1...v2.74.0) (2026-03-02) + +### WARNING: This release contains a known bug with clientside metrics which was fixed in v2.75.1 + +### Features + +* Add awaitOptimizeRestoredTable helper for Bigtable Admin ([#2781](https://github.com/googleapis/java-bigtable/issues/2781)) ([cf15d45](https://github.com/googleapis/java-bigtable/commit/cf15d45a8f4c0ee385d3e53a0bae153ee1064999)) +* Add TieredStorageConfig to table admin api ([f05a1a3](https://github.com/googleapis/java-bigtable/commit/f05a1a3b0bb730e62c349dc8a7a1a82b0cf00fa7)) +* **Bigtable:** Add support for creating instances with tags ([#2733](https://github.com/googleapis/java-bigtable/issues/2733)) ([bc46174](https://github.com/googleapis/java-bigtable/commit/bc461749a0aa702f65c26774dd4696d47ef88eae)) +* Expose generated GAPIC admin client and freeze legacy surface ([#2806](https://github.com/googleapis/java-bigtable/issues/2806)) ([c620710](https://github.com/googleapis/java-bigtable/commit/c62071092d67f8ccfebe3166ca826fb001c76e28)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.67.0 ([f05a1a3](https://github.com/googleapis/java-bigtable/commit/f05a1a3b0bb730e62c349dc8a7a1a82b0cf00fa7)) +* Ensure that per attempt metrics tracer is below the retries ([#2793](https://github.com/googleapis/java-bigtable/issues/2793)) ([1f39032](https://github.com/googleapis/java-bigtable/commit/1f390328b23855ee39e2c3dacf8a0eed8d962b08)) + + +### Dependencies + +* Update shared dependencies ([#2814](https://github.com/googleapis/java-bigtable/issues/2814)) ([dde68fe](https://github.com/googleapis/java-bigtable/commit/dde68fe0ee5c5a491a5ae5382babea57e901605c)) + +## [2.73.1](https://github.com/googleapis/java-bigtable/compare/v2.73.0...v2.73.1) (2026-02-17) + + +### Bug Fixes + +* **bigtable:** Drop redudant fields from internal otel metrics which are already in monitored resource ([#2783](https://github.com/googleapis/java-bigtable/issues/2783)) ([f45bb0e](https://github.com/googleapis/java-bigtable/commit/f45bb0e30343f08a90b1c7e30107ba7e0ae8e23a)) +* Fix skip large row ([#2785](https://github.com/googleapis/java-bigtable/issues/2785)) ([504bb51](https://github.com/googleapis/java-bigtable/commit/504bb512ff6d7c0ab6dd86785f0b255a2d910dbd)) +* Test proxy doesn't return "http2 excpetion" for long errors ([#2775](https://github.com/googleapis/java-bigtable/issues/2775)) ([dafe647](https://github.com/googleapis/java-bigtable/commit/dafe647ab7877f65b5d73e2a6519f71e6eb03f77)) +* Use StatusProto.fromThrowable for ApiException in test-proxy ([#2778](https://github.com/googleapis/java-bigtable/issues/2778)) ([de1669e](https://github.com/googleapis/java-bigtable/commit/de1669e882b814ff1708d2b74e62540f5bcd3dbf)) + +## [2.73.0](https://github.com/googleapis/java-bigtable/compare/v2.72.0...v2.73.0) (2026-02-06) + + +### Features + +* Add methods to wait for consistency with a token ([#2762](https://github.com/googleapis/java-bigtable/issues/2762)) ([b4a90b2](https://github.com/googleapis/java-bigtable/commit/b4a90b2d0fa2db34067577c2b56d815163dc7282)) + + +### Dependencies + +* Update shared dependencies ([#2773](https://github.com/googleapis/java-bigtable/issues/2773)) ([33a6d8a](https://github.com/googleapis/java-bigtable/commit/33a6d8ad8a0051550998724f5833a1e803315b47)) + +## [2.72.0](https://github.com/googleapis/java-bigtable/compare/v2.71.0...v2.72.0) (2026-01-30) + + +### Features + +* Add GcRuleBuilder for safe GC rule construction ([#2758](https://github.com/googleapis/java-bigtable/issues/2758)) ([4a99a8c](https://github.com/googleapis/java-bigtable/commit/4a99a8ccad8469933b63aa63205bc2c800a24fef)) +* Handle StatusRuntimeException in CbtTestProxy, increase inbound message / metadata size ([#2763](https://github.com/googleapis/java-bigtable/issues/2763)) ([3e27d28](https://github.com/googleapis/java-bigtable/commit/3e27d2895816685743ee59d566cd8870447c02f1)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.66.0 ([ca24007](https://github.com/googleapis/java-bigtable/commit/ca240078ea4400cd071d796259ed4b8c9501a6f6)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.56.0 ([#2765](https://github.com/googleapis/java-bigtable/issues/2765)) ([d1020a1](https://github.com/googleapis/java-bigtable/commit/d1020a1ea1e296273408262a33a09427a20d8156)) + +## [2.71.0](https://github.com/googleapis/java-bigtable/compare/v2.70.1...v2.71.0) (2026-01-15) + + +### Features + +* Add CSM for batch write flow control ([#2685](https://github.com/googleapis/java-bigtable/issues/2685)) ([62ffd1b](https://github.com/googleapis/java-bigtable/commit/62ffd1babb910bc9ef2e83482de9500e3e1a1b4f)) + + +### Bug Fixes + +* **bigtable:** Add handling for gauge metrics ([#2719](https://github.com/googleapis/java-bigtable/issues/2719)) ([87aa4d5](https://github.com/googleapis/java-bigtable/commit/87aa4d54c047d2de1e92d75a4ff69e6d02689bdb)) +* Create stub with BigtableClientContext so otels are closed ([#2747](https://github.com/googleapis/java-bigtable/issues/2747)) ([3d0a6d9](https://github.com/googleapis/java-bigtable/commit/3d0a6d9d52bd8a97adafe04ac7d6142b42139e51)) +* Update BigtableChannelPool to use the background executor ([#2753](https://github.com/googleapis/java-bigtable/issues/2753)) ([8f6e2df](https://github.com/googleapis/java-bigtable/commit/8f6e2df7bba6fee4e3999dd77b8b18cd85580eff)) +* Use the same background executor in otel reader and monitoring c… ([#2746](https://github.com/googleapis/java-bigtable/issues/2746)) ([3a58f9b](https://github.com/googleapis/java-bigtable/commit/3a58f9bebe416186aa8bffee8e024aef135f52c6)) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.76.0 ([#2754](https://github.com/googleapis/java-bigtable/issues/2754)) ([be54ef6](https://github.com/googleapis/java-bigtable/commit/be54ef69a2c2d506fc84d08a202e1eb3dafaa849)) +* Update shared dependencies ([#2752](https://github.com/googleapis/java-bigtable/issues/2752)) ([fe1074c](https://github.com/googleapis/java-bigtable/commit/fe1074cb7631746b5bacee2fb4bbd37e4a96416a)) + +## [2.70.1](https://github.com/googleapis/java-bigtable/compare/v2.70.0...v2.70.1) (2025-12-12) + + +### Dependencies + +* Update shared dependencies ([#2734](https://github.com/googleapis/java-bigtable/issues/2734)) ([2823705](https://github.com/googleapis/java-bigtable/commit/28237059edaa20028ea35a1903bdee8c02885260)) + +## [2.70.0](https://github.com/googleapis/java-bigtable/compare/v2.69.0...v2.70.0) (2025-11-18) + + +### Features + +* Add PeerInfo proto in Bigtable API ([0736694](https://github.com/googleapis/java-bigtable/commit/0736694c74099a98ab9f36ecb011a31458c6d8c6)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.64.1 ([0736694](https://github.com/googleapis/java-bigtable/commit/0736694c74099a98ab9f36ecb011a31458c6d8c6)) + + +### Dependencies + +* Update shared dependencies ([#2704](https://github.com/googleapis/java-bigtable/issues/2704)) ([97a8a0e](https://github.com/googleapis/java-bigtable/commit/97a8a0e36281c3154e03e2ba74aed9af00c9a22b)) + + +### Documentation + +* Update javadoc sample for BigtableTableAdminClient.listTables ([#2308](https://github.com/googleapis/java-bigtable/issues/2308)) ([56237d7](https://github.com/googleapis/java-bigtable/commit/56237d7a8d420f526237e11c868fd85e9f256831)) + +## [2.69.0](https://github.com/googleapis/java-bigtable/compare/v2.68.0...v2.69.0) (2025-11-17) + + +### Features + +* **bigtable:** Add internal grpc subconnections metric and add outstanding rpcs to INTERNAL_VIEW ([#2700](https://github.com/googleapis/java-bigtable/issues/2700)) ([e3e6e99](https://github.com/googleapis/java-bigtable/commit/e3e6e993ee197f897c166fb8959755db0cb9c3fc)) +* **bigtable:** Expose a metric to track the number of outstanding rpcs (unary , streaming) in channel pool ([#2696](https://github.com/googleapis/java-bigtable/issues/2696)) ([140a1ad](https://github.com/googleapis/java-bigtable/commit/140a1ad81947da26c1539632ff04748dc3498d69)) +* **bigtable:** Populate alts field in channel entry ([#2702](https://github.com/googleapis/java-bigtable/issues/2702)) ([1bfb763](https://github.com/googleapis/java-bigtable/commit/1bfb763e6e4fb6fe8c808abe5dbd4221d3a632c3)) +* Enable ALTS hard bound token in Bigtable w/ direct access ([#2695](https://github.com/googleapis/java-bigtable/issues/2695)) ([d12b37d](https://github.com/googleapis/java-bigtable/commit/d12b37dacf8712d30be05175828999af74159819)) + +## [2.68.0](https://github.com/googleapis/java-bigtable/compare/v2.67.1...v2.68.0) (2025-10-22) + + +### Features + +* Add Type API updates needed to support structured keys in materialized views ([469290e](https://github.com/googleapis/java-bigtable/commit/469290eb188ce7155abc81d4fec9dd8319851cd9)) + + +### Bug Fixes + +* Add ReadRows/SampleRowKeys bindings for materialized views ([469290e](https://github.com/googleapis/java-bigtable/commit/469290eb188ce7155abc81d4fec9dd8319851cd9)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.62.3 ([469290e](https://github.com/googleapis/java-bigtable/commit/469290eb188ce7155abc81d4fec9dd8319851cd9)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.63.0 ([ed6c03f](https://github.com/googleapis/java-bigtable/commit/ed6c03ff50f42a06472f5be781b68937f48228d1)) +* Don't use String.format in Preconditions messages ([#2691](https://github.com/googleapis/java-bigtable/issues/2691)) ([62a1812](https://github.com/googleapis/java-bigtable/commit/62a18128d8ec65484509dde6cd0c2b0322890cc9)) +* Fixed the bigtableadmin API name for snippet region tags and possibly other GAPIC attributes ([469290e](https://github.com/googleapis/java-bigtable/commit/469290eb188ce7155abc81d4fec9dd8319851cd9)) + + +### Dependencies + +* Update shared dependencies ([#2697](https://github.com/googleapis/java-bigtable/issues/2697)) ([611ad20](https://github.com/googleapis/java-bigtable/commit/611ad208359e3c1f2e675d5e4e8c8ade3616b02b)) + +## [2.67.1](https://github.com/googleapis/java-bigtable/compare/v2.67.0...v2.67.1) (2025-10-08) + + +### Dependencies + +* Update shared dependencies ([#2686](https://github.com/googleapis/java-bigtable/issues/2686)) ([d7eaa02](https://github.com/googleapis/java-bigtable/commit/d7eaa02d89a63d9f9197d26e430267eff200b126)) + +## [2.67.0](https://github.com/googleapis/java-bigtable/compare/v2.66.0...v2.67.0) (2025-09-24) + + +### Features + +* Idle channel eviction ([#2651](https://github.com/googleapis/java-bigtable/issues/2651)) ([70c05c9](https://github.com/googleapis/java-bigtable/commit/70c05c9c09a63c53818384d2a66c622c9b95e00e)) +* Load balancing options for BigtableChannelPool ([#2667](https://github.com/googleapis/java-bigtable/issues/2667)) ([5adaa84](https://github.com/googleapis/java-bigtable/commit/5adaa84d80df08779da7c36a50de4632049cfe96)) + + +### Bug Fixes + +* Add missing break; to PROTO and ENUM value type check ([#2672](https://github.com/googleapis/java-bigtable/issues/2672)) ([337e432](https://github.com/googleapis/java-bigtable/commit/337e4325f6cb5d11309ec5f33550d47d97cbe3c3)) +* Remove beta api annotation for query paginator ([#2660](https://github.com/googleapis/java-bigtable/issues/2660)) ([f68a1fa](https://github.com/googleapis/java-bigtable/commit/f68a1fae49b701d1fb9942e2af2fa84a1e5b508a)) + + +### Dependencies + +* Update shared dependencies ([#2679](https://github.com/googleapis/java-bigtable/issues/2679)) ([a5b8260](https://github.com/googleapis/java-bigtable/commit/a5b82609c365ae4792ed822e59039c1a046ef3ff)) + +## [2.66.0](https://github.com/googleapis/java-bigtable/compare/v2.65.1...v2.66.0) (2025-09-10) + + +### Features + +* Add support for Proto and Enum types ([#2662](https://github.com/googleapis/java-bigtable/issues/2662)) ([da3065d](https://github.com/googleapis/java-bigtable/commit/da3065db331be191fdf9e06be71e45c7832574ea)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.1 ([#2668](https://github.com/googleapis/java-bigtable/issues/2668)) ([06ac93e](https://github.com/googleapis/java-bigtable/commit/06ac93e810830f9c04920b488d9a10af8995a6f3)) + +## [2.65.1](https://github.com/googleapis/java-bigtable/compare/v2.65.0...v2.65.1) (2025-08-27) + + +### Dependencies + +* Update shared dependencies ([#2664](https://github.com/googleapis/java-bigtable/issues/2664)) ([841318b](https://github.com/googleapis/java-bigtable/commit/841318b2248dcda89d8482bc2e84c838bd8be8d0)) + +## [2.65.0](https://github.com/googleapis/java-bigtable/compare/v2.64.0...v2.65.0) (2025-08-12) + + +### Features + +* **bigtable:** Lower the value for max rpc channels as channel resize is slow (1m, 2 channel) ([#2656](https://github.com/googleapis/java-bigtable/issues/2656)) ([d8055c1](https://github.com/googleapis/java-bigtable/commit/d8055c1fb75a616cda1503b92d7cddb9da47d42b)) + +## [2.64.0](https://github.com/googleapis/java-bigtable/compare/v2.63.0...v2.64.0) (2025-08-08) + + +### Features + +* Add tags field to Instance proto (stable branch) ([089d527](https://github.com/googleapis/java-bigtable/commit/089d52700c225015fabfaa763163c5874b96d830)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.61.0 ([089d527](https://github.com/googleapis/java-bigtable/commit/089d52700c225015fabfaa763163c5874b96d830)) + + +### Dependencies + +* Update shared dependencies ([#2654](https://github.com/googleapis/java-bigtable/issues/2654)) ([4b706f4](https://github.com/googleapis/java-bigtable/commit/4b706f4f76a8152556aa99656b440adb30f37a4c)) + +## [2.63.0](https://github.com/googleapis/java-bigtable/compare/v2.62.0...v2.63.0) (2025-07-30) + + +### Features + +* Add Idempotency to Cloud Bigtable MutateRowsRequest API ([bc58b4f](https://github.com/googleapis/java-bigtable/commit/bc58b4f31ef457bd322f270b044735e4b62d298f)) +* Add port as a parameter for the bigtable emulator ([#2645](https://github.com/googleapis/java-bigtable/issues/2645)) ([5acd3dc](https://github.com/googleapis/java-bigtable/commit/5acd3dc01c36072bd28248d560c5d923c34b1817)) +* Add type support for Proto and Enum ([bc58b4f](https://github.com/googleapis/java-bigtable/commit/bc58b4f31ef457bd322f270b044735e4b62d298f)) +* Publish Proto and Enum types to CBT data API ([ace12d5](https://github.com/googleapis/java-bigtable/commit/ace12d53fe9f4d3779b2b1a2aed69ceeedd11600)) +* Selective GAPIC autogeneration for Python Bigtable Admin ([e219c38](https://github.com/googleapis/java-bigtable/commit/e219c387487673869fb8bb55a5060bdc9d37bbcb)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.60.2 ([e219c38](https://github.com/googleapis/java-bigtable/commit/e219c387487673869fb8bb55a5060bdc9d37bbcb)) +* Update routing_parameters.path_template ([e219c38](https://github.com/googleapis/java-bigtable/commit/e219c387487673869fb8bb55a5060bdc9d37bbcb)) + + +### Dependencies + +* Update sdk-platorm-java-config to 3.50.2 ([#2646](https://github.com/googleapis/java-bigtable/issues/2646)) ([03e6961](https://github.com/googleapis/java-bigtable/commit/03e6961e758a9a0c39cb168c73c853328c14bfd1)) + + +### Documentation + +* Sync generated comments from the API Protos ([bc58b4f](https://github.com/googleapis/java-bigtable/commit/bc58b4f31ef457bd322f270b044735e4b62d298f)) + +## [2.62.0](https://github.com/googleapis/java-bigtable/compare/v2.61.0...v2.62.0) (2025-07-15) + + +### Features + +* Add Idempotency to Cloud Bigtable MutateRowRequest API ([b5acca6](https://github.com/googleapis/java-bigtable/commit/b5acca6ac4f1eec420adb27bc77aa1bda0ec2dca)) +* Add SchemaBundles API ([b5acca6](https://github.com/googleapis/java-bigtable/commit/b5acca6ac4f1eec420adb27bc77aa1bda0ec2dca)) +* **bigtable:** Add schema bundle support ([#2619](https://github.com/googleapis/java-bigtable/issues/2619)) ([7d7b9a9](https://github.com/googleapis/java-bigtable/commit/7d7b9a966d3ef7b7a0ef3f82038ab73f4d791427)) +* Next release from main branch is 2.62.0 ([#2621](https://github.com/googleapis/java-bigtable/issues/2621)) ([202b211](https://github.com/googleapis/java-bigtable/commit/202b21102e71da71ff56f19a12d8a00a59cd8107)) + + +### Dependencies + +* Minor cleanup ([#2623](https://github.com/googleapis/java-bigtable/issues/2623)) ([7b230e8](https://github.com/googleapis/java-bigtable/commit/7b230e86902b5733c06e45fad90da76653ee1096)) +* Update shared dependencies ([#2616](https://github.com/googleapis/java-bigtable/issues/2616)) ([eb7cfd5](https://github.com/googleapis/java-bigtable/commit/eb7cfd526aa999c614b7b8285d32759e2739ff9a)) + +## [2.61.0](https://github.com/googleapis/java-bigtable/compare/v2.60.0...v2.61.0) (2025-06-27) + + +### Features + +* Add getter for universe domain in JwtCredentialsWithAudience ([#2598](https://github.com/googleapis/java-bigtable/issues/2598)) ([9ad66b1](https://github.com/googleapis/java-bigtable/commit/9ad66b129923500cdeb794fc2e4570ad8b1d92fd)) + + +### Bug Fixes + +* Add name elements for the POM.xml files ([a873719](https://github.com/googleapis/java-bigtable/commit/a873719e7e32a0cd21dc259911a193520f20797e)) +* Populate table id for materialized view ([#2610](https://github.com/googleapis/java-bigtable/issues/2610)) ([50c3fe2](https://github.com/googleapis/java-bigtable/commit/50c3fe2ffe66acaba8cb408dc3b1a4d13a4a2556)) + + +### Dependencies + +* Update shared dependencies ([#2605](https://github.com/googleapis/java-bigtable/issues/2605)) ([4cc7246](https://github.com/googleapis/java-bigtable/commit/4cc7246ff8e2e0e26d2edc0aee8866a32ec1c8ab)) + +## [2.60.0](https://github.com/googleapis/java-bigtable/compare/v2.59.0...v2.60.0) (2025-06-06) + + +### Features + +* Improve error message on malformed struct ([#2592](https://github.com/googleapis/java-bigtable/issues/2592)) ([7f5fdf0](https://github.com/googleapis/java-bigtable/commit/7f5fdf094c5fe140807ce6abcea0b891462ba809)) +* Run ExecuteQuery conformance tests ([#2557](https://github.com/googleapis/java-bigtable/issues/2557)) ([0bbc083](https://github.com/googleapis/java-bigtable/commit/0bbc083b9e798e5b557f3ffe7090b45e66c9ada5)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.59.0 ([65782aa](https://github.com/googleapis/java-bigtable/commit/65782aaf89ad78aafd7f5928e81e513c3016b471)) +* Ensure that multiple instances of a client in the same process dont clobber each other ([#2590](https://github.com/googleapis/java-bigtable/issues/2590)) ([8d3dca4](https://github.com/googleapis/java-bigtable/commit/8d3dca43224179829829bcf91972610c666b130b)) + + +### Dependencies + +* Update shared dependencies ([#2587](https://github.com/googleapis/java-bigtable/issues/2587)) ([8ec0339](https://github.com/googleapis/java-bigtable/commit/8ec033994f20b2b3aea0dfcdaffbdd1c6d19fdad)) + +## [2.59.0](https://github.com/googleapis/java-bigtable/compare/v2.58.2...v2.59.0) (2025-05-16) + + +### Features + +* **bigtable:** Add DeletionProtection support for Logical Views ([#2539](https://github.com/googleapis/java-bigtable/issues/2539)) ([d9ba32b](https://github.com/googleapis/java-bigtable/commit/d9ba32b8e5792ceed054f67c58f5622e153e87d6)) + + +### Dependencies + +* Update googleapis/sdk-platform-java action to v2.58.0 ([#2581](https://github.com/googleapis/java-bigtable/issues/2581)) ([c9b0289](https://github.com/googleapis/java-bigtable/commit/c9b028902dc8aae9552181d65c9743be09d45ecf)) +* Update shared dependencies ([#2584](https://github.com/googleapis/java-bigtable/issues/2584)) ([ba82675](https://github.com/googleapis/java-bigtable/commit/ba82675c25dbe12443ac5ef48464dcb3f8c8894c)) + +## [2.58.2](https://github.com/googleapis/java-bigtable/compare/v2.58.1...v2.58.2) (2025-05-08) + + +### Bug Fixes + +* Use service name as the default audience ([#2579](https://github.com/googleapis/java-bigtable/issues/2579)) ([af6d7bd](https://github.com/googleapis/java-bigtable/commit/af6d7bd28d9d7a4ebb90825a9b4b8a73d63172f6)) + + +### Dependencies + +* Update shared dependencies ([#2565](https://github.com/googleapis/java-bigtable/issues/2565)) ([043f11b](https://github.com/googleapis/java-bigtable/commit/043f11b16948c338096d9407de1e99f02656169e)) + +## [2.58.1](https://github.com/googleapis/java-bigtable/compare/v2.58.0...v2.58.1) (2025-04-28) + + +### Bug Fixes + +* Close otel instance ([#2571](https://github.com/googleapis/java-bigtable/issues/2571)) ([422fe26](https://github.com/googleapis/java-bigtable/commit/422fe26f3aae30fe74de80fad3848707452d6646)) + +## [2.58.0](https://github.com/googleapis/java-bigtable/compare/v2.57.3...v2.58.0) (2025-04-28) + + +### Features + +* Add deletion_protection support for LVs ([43c97a3](https://github.com/googleapis/java-bigtable/commit/43c97a3f430ee4ee90d46b3685ae50f13949831c)) +* **bigtable:** Add integration tests for Materialized/Logical Views ([#2518](https://github.com/googleapis/java-bigtable/issues/2518)) ([4d3a7e6](https://github.com/googleapis/java-bigtable/commit/4d3a7e675b60ba6a3225a45b7463edff279f9bc4)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.56.2 ([43c97a3](https://github.com/googleapis/java-bigtable/commit/43c97a3f430ee4ee90d46b3685ae50f13949831c)) +* Fix retry info algorithm setting ([#2562](https://github.com/googleapis/java-bigtable/issues/2562)) ([c424ccb](https://github.com/googleapis/java-bigtable/commit/c424ccba72a191609dc726ed67d03f0d330015fc)) +* Use universe domain when creating the monitoring client ([#2570](https://github.com/googleapis/java-bigtable/issues/2570)) ([3b51e12](https://github.com/googleapis/java-bigtable/commit/3b51e1206a4f83078625705ed8d8a899839af1a9)) + +## [2.57.3](https://github.com/googleapis/java-bigtable/compare/v2.57.2...v2.57.3) (2025-04-01) + + +### Bug Fixes + +* Remove debug messages ([#2552](https://github.com/googleapis/java-bigtable/issues/2552)) ([6359834](https://github.com/googleapis/java-bigtable/commit/63598346ca39767d59d254fce2c718d1258e27d5)) + +## [2.57.2](https://github.com/googleapis/java-bigtable/compare/v2.57.1...v2.57.2) (2025-03-31) + + +### Bug Fixes + +* Library should released as 2.57.2 ([#2549](https://github.com/googleapis/java-bigtable/issues/2549)) ([58d0bbd](https://github.com/googleapis/java-bigtable/commit/58d0bbdcb983e3b5ee403edf45c4e98a6eb8dc16)) + +## [2.57.1](https://github.com/googleapis/java-bigtable/compare/v2.57.0...v2.57.1) (2025-03-24) + + +### Bug Fixes + +* Handling of totalTimeout on sql plan refresh ([#2541](https://github.com/googleapis/java-bigtable/issues/2541)) ([bf49cf9](https://github.com/googleapis/java-bigtable/commit/bf49cf93f9a3b9cbdb155bb6cbb7a9f763b6f738)) + +## [2.57.0](https://github.com/googleapis/java-bigtable/compare/v2.56.0...v2.57.0) (2025-03-24) + + +### Features + +* Add PreparedStatement and update ExecuteQuery API to use it ([#2534](https://github.com/googleapis/java-bigtable/issues/2534)) ([49d4d09](https://github.com/googleapis/java-bigtable/commit/49d4d09fd16a1eb4eb566227a049bca2aaaa61e3)) + +## [2.56.0](https://github.com/googleapis/java-bigtable/compare/v2.55.0...v2.56.0) (2025-03-18) + + +### Features + +* **bigtable:** Add support for Logical Views in Admin API ([#2519](https://github.com/googleapis/java-bigtable/issues/2519)) ([6dac3fd](https://github.com/googleapis/java-bigtable/commit/6dac3fd6443e94674af88a1dc97bedd9b3b0c834)) +* **bigtable:** Add support for Materialized Views in Admin API ([#2511](https://github.com/googleapis/java-bigtable/issues/2511)) ([55cd719](https://github.com/googleapis/java-bigtable/commit/55cd719df277a2ae1988c7cd53286558ad86835b)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.55.1 ([7992af0](https://github.com/googleapis/java-bigtable/commit/7992af08b4eb2f408ecb739a73fbdc36ca7af2b5)) + + +### Dependencies + +* Sdk-platform-java-config 3.45.1 ([#2517](https://github.com/googleapis/java-bigtable/issues/2517)) ([b2af258](https://github.com/googleapis/java-bigtable/commit/b2af258ed72d29644c8bd1079b1d0f223206d75b)) + +## [2.55.0](https://github.com/googleapis/java-bigtable/compare/v2.54.0...v2.55.0) (2025-03-11) + + +### Features + +* Add MaterializedViewName to ReadRows and SampleRowKeys ([1763c6e](https://github.com/googleapis/java-bigtable/commit/1763c6e9304010ed4034e1ddd03fdb94bca615dc)) +* Add MaterializedViews and LogicalViews APIs ([1763c6e](https://github.com/googleapis/java-bigtable/commit/1763c6e9304010ed4034e1ddd03fdb94bca615dc)) +* Add MaterializedViews and LogicalViews APIs ([7340527](https://github.com/googleapis/java-bigtable/commit/73405272c3fc77ca81c1df7cce1b8d889d4a96c4)) +* Add PrepareQuery api and update ExecuteQuery to support it ([1763c6e](https://github.com/googleapis/java-bigtable/commit/1763c6e9304010ed4034e1ddd03fdb94bca615dc)) +* **bigtable:** Add support for data APIs for materialized views ([#2508](https://github.com/googleapis/java-bigtable/issues/2508)) ([6310a63](https://github.com/googleapis/java-bigtable/commit/6310a631be3345f97d73b50f3b458fe40b071286)) +* **large-row-skip:** Added large-row-skip-callable with configurable rowadapter ([#2509](https://github.com/googleapis/java-bigtable/issues/2509)) ([ba193ef](https://github.com/googleapis/java-bigtable/commit/ba193ef771f913e6e6a1aca630fe52d0921ee077)) +* Next release from main branch is 2.55.0 ([#2506](https://github.com/googleapis/java-bigtable/issues/2506)) ([4e45837](https://github.com/googleapis/java-bigtable/commit/4e458378cc25a4dc5ac3fd1362626d89f0138186)) +* Publish row_key_schema fields in table proto and relevant admin APIs to setup a table with a row_key_schema ([7340527](https://github.com/googleapis/java-bigtable/commit/73405272c3fc77ca81c1df7cce1b8d889d4a96c4)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.54.0 ([91e4369](https://github.com/googleapis/java-bigtable/commit/91e4369d280c09fd2d1b4b5dd88809b6da01b0f8)) + + +### Documentation + +* Fixed formatting of resource path strings ([7340527](https://github.com/googleapis/java-bigtable/commit/73405272c3fc77ca81c1df7cce1b8d889d4a96c4)) + +## [2.54.0](https://github.com/googleapis/java-bigtable/compare/v2.53.0...v2.54.0) (2025-02-28) + + +### Features + +* Next release from main branch is 2.54.0 ([#2498](https://github.com/googleapis/java-bigtable/issues/2498)) ([f967ded](https://github.com/googleapis/java-bigtable/commit/f967deda8b68091dcc417b6c51f451abd36696f1)) + + +### Dependencies + +* Update shared dependencies ([#2493](https://github.com/googleapis/java-bigtable/issues/2493)) ([e1d09e7](https://github.com/googleapis/java-bigtable/commit/e1d09e7d03365d844e957d043e21d71948f98d04)) + +## [2.53.0](https://github.com/googleapis/java-bigtable/compare/v2.52.0...v2.53.0) (2025-02-21) + + +### Features + +* Skip large rows ([#2482](https://github.com/googleapis/java-bigtable/issues/2482)) ([cd7f82e](https://github.com/googleapis/java-bigtable/commit/cd7f82e4b66dc3c34262c73b26afc2fdfd1deed7)) + +## [2.52.0](https://github.com/googleapis/java-bigtable/compare/v2.51.2...v2.52.0) (2025-02-14) + + +### Features + +* Automated backups are supported in the admin client ([#2472](https://github.com/googleapis/java-bigtable/issues/2472)) ([48633e6](https://github.com/googleapis/java-bigtable/commit/48633e6160593c84f42a02f348ec18c3d1521ef0)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.53.0 ([47ca299](https://github.com/googleapis/java-bigtable/commit/47ca29931699cae87d640185ad31e4b61c0bb212)) +* Extend timeouts for check consistency ([47ca299](https://github.com/googleapis/java-bigtable/commit/47ca29931699cae87d640185ad31e4b61c0bb212)) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.52.0 ([#2490](https://github.com/googleapis/java-bigtable/issues/2490)) ([ca25d4e](https://github.com/googleapis/java-bigtable/commit/ca25d4eb6c7333d1a77d2c99b1bb95c2a2f710c1)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.43.0 ([#2481](https://github.com/googleapis/java-bigtable/issues/2481)) ([deb1f79](https://github.com/googleapis/java-bigtable/commit/deb1f79c6efa223f6c2f780724ec9386f44f018a)) + +## [2.51.2](https://github.com/googleapis/java-bigtable/compare/v2.51.1...v2.51.2) (2025-02-03) + + +### Bug Fixes + +* Add known conformance test failures ([#2474](https://github.com/googleapis/java-bigtable/issues/2474)) ([15488fe](https://github.com/googleapis/java-bigtable/commit/15488fe6cfe05e84c4b6d65565150ee7277a60e7)) + + +### Dependencies + +* Update shared dependencies ([#2473](https://github.com/googleapis/java-bigtable/issues/2473)) ([4d6d419](https://github.com/googleapis/java-bigtable/commit/4d6d41988c8e4b92b01851ab7ab52183254e8798)) + +## [2.51.1](https://github.com/googleapis/java-bigtable/compare/v2.51.0...v2.51.1) (2025-01-10) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.50.0 ([#2464](https://github.com/googleapis/java-bigtable/issues/2464)) ([d63dd43](https://github.com/googleapis/java-bigtable/commit/d63dd4333e94f8ad32f260315e44b622db157002)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.41.1 ([#2461](https://github.com/googleapis/java-bigtable/issues/2461)) ([ed24b4c](https://github.com/googleapis/java-bigtable/commit/ed24b4c0aebc2666850f103f551128f02c2ba2ae)) +* Update googleapis/sdk-platform-java action to v2.51.1 ([#2460](https://github.com/googleapis/java-bigtable/issues/2460)) ([35c979f](https://github.com/googleapis/java-bigtable/commit/35c979fff1d1194cc241f90057245de78cd5f010)) + +## [2.51.0](https://github.com/googleapis/java-bigtable/compare/v2.50.0...v2.51.0) (2024-12-17) + + +### Features + +* Introduce `java.time` ([#2415](https://github.com/googleapis/java-bigtable/issues/2415)) ([bb96c3e](https://github.com/googleapis/java-bigtable/commit/bb96c3e395793ba324cf658bb4c985d4315cf781)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([a5444a5](https://github.com/googleapis/java-bigtable/commit/a5444a545ec61a1520716dfafb6f62b7e39df1c7)) +* Move resource detection to the first export to avoid slow start ([#2450](https://github.com/googleapis/java-bigtable/issues/2450)) ([cec010a](https://github.com/googleapis/java-bigtable/commit/cec010aa64f2b190f8e742915be41baae2ad2083)) + + +### Dependencies + +* Update sdk-platform-java dependencies ([#2448](https://github.com/googleapis/java-bigtable/issues/2448)) ([825e717](https://github.com/googleapis/java-bigtable/commit/825e717e9d8ae3853d7509d0849b58f2c47c9803)) + +## [2.50.0](https://github.com/googleapis/java-bigtable/compare/v2.49.0...v2.50.0) (2024-12-06) + + +### Features + +* Add support for Row Affinity app profiles ([#2341](https://github.com/googleapis/java-bigtable/issues/2341)) ([cb4d60e](https://github.com/googleapis/java-bigtable/commit/cb4d60e8ce2079a270739ad91efb05cbb1ff74f8)) + +## [2.49.0](https://github.com/googleapis/java-bigtable/compare/v2.48.0...v2.49.0) (2024-12-03) + + +### Features + +* Add support for table deletion protection ([#2430](https://github.com/googleapis/java-bigtable/issues/2430)) ([687b6df](https://github.com/googleapis/java-bigtable/commit/687b6df14b743358e8207cda26022dfc75338d55)) + + +### Bug Fixes + +* Allow factory to export to different projects ([#2374](https://github.com/googleapis/java-bigtable/issues/2374)) ([06b912c](https://github.com/googleapis/java-bigtable/commit/06b912cc5d63436757008e79edfa8286b2ccac18)) +* Send priming requests on the channel directly ([#2435](https://github.com/googleapis/java-bigtable/issues/2435)) ([b76698d](https://github.com/googleapis/java-bigtable/commit/b76698dfb2c8552185f34e01e924ecc80798ba4f)) + +## [2.48.0](https://github.com/googleapis/java-bigtable/compare/v2.47.0...v2.48.0) (2024-11-19) + + +### Features + +* Enable trailer optimization by default ([#2421](https://github.com/googleapis/java-bigtable/issues/2421)) ([7b2c4e4](https://github.com/googleapis/java-bigtable/commit/7b2c4e45dce828f506dac16ffc2b71995564a477)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.50.0 ([6b35b47](https://github.com/googleapis/java-bigtable/commit/6b35b478e10efce77d95bffcd7a64e84e1bcc5b0)) +* Make client side metrics tag in sync with server ([#2401](https://github.com/googleapis/java-bigtable/issues/2401)) ([bba4183](https://github.com/googleapis/java-bigtable/commit/bba41837febc10e9507afc7117e2e4ec2d15fb11)) + + +### Dependencies + +* Revert downgrade grpc to 1.67.1 [#2366](https://github.com/googleapis/java-bigtable/issues/2366) ([#2414](https://github.com/googleapis/java-bigtable/issues/2414)) ([710fa52](https://github.com/googleapis/java-bigtable/commit/710fa52a05ce4fc81ee8e980d87e0ca86676219f)) +* Update dependency com.google.cloud:gapic-libraries-bom to v1.48.0 ([#2422](https://github.com/googleapis/java-bigtable/issues/2422)) ([2088a39](https://github.com/googleapis/java-bigtable/commit/2088a399bd8b71e98035cc475637f41d5873082d)) +* Update sdk-platform-java dependencies ([#2418](https://github.com/googleapis/java-bigtable/issues/2418)) ([c12bb01](https://github.com/googleapis/java-bigtable/commit/c12bb01a6c5be0a72285db0505407f3e1c2534fb)) + +## [2.47.0](https://github.com/googleapis/java-bigtable/compare/v2.46.0...v2.47.0) (2024-11-13) + + +### Features + +* Add an experimental feature to skip waiting for trailers for unary ops ([#2404](https://github.com/googleapis/java-bigtable/issues/2404)) ([cf58f26](https://github.com/googleapis/java-bigtable/commit/cf58f260fd7d3cb0dee4fee8e2d43367db6eadb1)) +* Add internal "deadline remaining" client side metric [#2341](https://github.com/googleapis/java-bigtable/issues/2341) ([#2370](https://github.com/googleapis/java-bigtable/issues/2370)) ([75d4105](https://github.com/googleapis/java-bigtable/commit/75d4105e0376dbe5810d6b96d71daa74b85e68ce)) + + +### Bug Fixes + +* Simplify remaining deadline metric impl ([#2410](https://github.com/googleapis/java-bigtable/issues/2410)) ([9796d57](https://github.com/googleapis/java-bigtable/commit/9796d57b60d928d3390e4ad311d5704dcbe808ec)) + +## [2.46.0](https://github.com/googleapis/java-bigtable/compare/v2.45.1...v2.46.0) (2024-10-29) + + +### Features + +* Test proxy support SSL backend ([#2381](https://github.com/googleapis/java-bigtable/issues/2381)) ([3cbf4ab](https://github.com/googleapis/java-bigtable/commit/3cbf4abe79d61daba0704abfccfb5558b026e6b7)) + + +### Bug Fixes + +* Fix client blocking latency ([#2346](https://github.com/googleapis/java-bigtable/issues/2346)) ([3801961](https://github.com/googleapis/java-bigtable/commit/380196174fb9b8cd97beb79d4faf49b30561be7f)) +* Fix first response latencies ([#2382](https://github.com/googleapis/java-bigtable/issues/2382)) ([8b2953e](https://github.com/googleapis/java-bigtable/commit/8b2953ed9c69c23b3e0c5c35d0538dc83f9dad80)) + + +### Dependencies + +* Update sdk-platform-java dependencies ([#2384](https://github.com/googleapis/java-bigtable/issues/2384)) ([81d7215](https://github.com/googleapis/java-bigtable/commit/81d72150b60d29e4e2ac17c6cb1fbdc89be0e16e)) + +## [2.45.1](https://github.com/googleapis/java-bigtable/compare/v2.45.0...v2.45.1) (2024-10-14) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.47.0 ([cdc2cc7](https://github.com/googleapis/java-bigtable/commit/cdc2cc7e085af42a2078373098b5f8ef8c752ea7)) + + +### Dependencies + +* Update sdk-platform-java dependencies ([#2378](https://github.com/googleapis/java-bigtable/issues/2378)) ([2499a3c](https://github.com/googleapis/java-bigtable/commit/2499a3cd5e0d0404666c7f9cf0c74f9edb90d894)) + +## [2.45.0](https://github.com/googleapis/java-bigtable/compare/v2.44.1...v2.45.0) (2024-10-03) + + +### Features + +* Add support for Cloud Bigtable Node Scaling Factor for CBT Clusters ([caf879c](https://github.com/googleapis/java-bigtable/commit/caf879cb4086d74bd4571662510014b27e6113a7)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.46.1 ([caf879c](https://github.com/googleapis/java-bigtable/commit/caf879cb4086d74bd4571662510014b27e6113a7)) +* Support override monitoring endpoint ([#2364](https://github.com/googleapis/java-bigtable/issues/2364)) ([a341eb8](https://github.com/googleapis/java-bigtable/commit/a341eb8530d959edabac0282c52c3e928abf733d)) + + +### Dependencies + +* Downgrade grpc to 1.67.1 ([#2366](https://github.com/googleapis/java-bigtable/issues/2366)) ([1baecb3](https://github.com/googleapis/java-bigtable/commit/1baecb3f6cd34a1daab632c322a1fb415efb9895)) +* Update dependency com.google.cloud:gapic-libraries-bom to v1.45.0 ([#2363](https://github.com/googleapis/java-bigtable/issues/2363)) ([9d24c45](https://github.com/googleapis/java-bigtable/commit/9d24c45b389f2edef0b02f6a8c3badbca2fd3946)) + +## [2.44.1](https://github.com/googleapis/java-bigtable/compare/v2.44.0...v2.44.1) (2024-09-26) + + +### Bug Fixes + +* Add RetryCallable to the callable chain ([#2348](https://github.com/googleapis/java-bigtable/issues/2348)) ([0330d77](https://github.com/googleapis/java-bigtable/commit/0330d77ac29d47e8610ddd23c324a55d1f9912cb)) +* Pass deadline through ExecuteQuery RetrySettings ([#2355](https://github.com/googleapis/java-bigtable/issues/2355)) ([6bc9820](https://github.com/googleapis/java-bigtable/commit/6bc98202897cebe09be8a4a78316cf5463106866)) +* Time based flakiness in execute query deadline test ([#2358](https://github.com/googleapis/java-bigtable/issues/2358)) ([b474173](https://github.com/googleapis/java-bigtable/commit/b474173a778cba273d2713e667000c5633de75bd)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.1 ([#2351](https://github.com/googleapis/java-bigtable/issues/2351)) ([40c428e](https://github.com/googleapis/java-bigtable/commit/40c428ec8e8cccb4dc3bb10d6674c94e9527e797)) + +## [2.44.0](https://github.com/googleapis/java-bigtable/compare/v2.43.0...v2.44.0) (2024-09-16) + + +### Features + +* Add APIs to enable hot backups ([#2313](https://github.com/googleapis/java-bigtable/issues/2313)) ([6d004cd](https://github.com/googleapis/java-bigtable/commit/6d004cd0809d02eeff05d5e90faf5e145f13d11e)) +* Add support for awaiting Data Boost ([#2329](https://github.com/googleapis/java-bigtable/issues/2329)) ([8556574](https://github.com/googleapis/java-bigtable/commit/85565742645537d1b55a1a52521d2ccf44b4d00c)) + + +### Dependencies + +* Update shared dependencies ([#2337](https://github.com/googleapis/java-bigtable/issues/2337)) ([dc65bd5](https://github.com/googleapis/java-bigtable/commit/dc65bd5a39cfe0c25a6b955f9f4d9367df334211)) + +## [2.43.0](https://github.com/googleapis/java-bigtable/compare/v2.42.0...v2.43.0) (2024-08-22) + + +### Features + +* Add fields and the BackupType proto for Hot Backups ([#2300](https://github.com/googleapis/java-bigtable/issues/2300)) ([acaa3ff](https://github.com/googleapis/java-bigtable/commit/acaa3ff26ab0d317362e2be65ac5edcf803b13a1)) +* Allow non default service account in DirectPath ([#2312](https://github.com/googleapis/java-bigtable/issues/2312)) ([09d0f23](https://github.com/googleapis/java-bigtable/commit/09d0f23032488dfa55c7a4c1c571a4f36bd94728)) +* **bigtable:** Remove deprecated Bytes from BigEndianBytesEncoding ([#2309](https://github.com/googleapis/java-bigtable/issues/2309)) ([32f244f](https://github.com/googleapis/java-bigtable/commit/32f244f13d0c8571654d314310a4756fe275d609)) +* Enable hermetic library generation ([#2234](https://github.com/googleapis/java-bigtable/issues/2234)) ([169aea5](https://github.com/googleapis/java-bigtable/commit/169aea5c43485a8d13ed53f57495609c142944df)) + + +### Bug Fixes + +* Add missing call to EqualsTester#testEquals ([#2307](https://github.com/googleapis/java-bigtable/issues/2307)) ([8b49f9c](https://github.com/googleapis/java-bigtable/commit/8b49f9ce84871f0f423f5837785604c3119ccd88)) + + +### Dependencies + +* Update shared dependencies ([#2314](https://github.com/googleapis/java-bigtable/issues/2314)) ([ab392ee](https://github.com/googleapis/java-bigtable/commit/ab392ee8d0c4535b5d3f31b3e111cbc41b399dd9)) + +## [2.42.0](https://github.com/googleapis/java-bigtable/compare/v2.41.0...v2.42.0) (2024-08-06) + + +### Features + +* Support float32, float64, and array type query params ([#2297](https://github.com/googleapis/java-bigtable/issues/2297)) ([a65640e](https://github.com/googleapis/java-bigtable/commit/a65640e285950d02136544bac913b2852cfe0274)) + + +### Bug Fixes + +* Adapt toString tests to introduction of java.time in gax ([93f66a7](https://github.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) + + +### Dependencies + +* Update shared dependencies ([93f66a7](https://github.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) + +## [2.41.0](https://github.com/googleapis/java-bigtable/compare/v2.40.0...v2.41.0) (2024-07-24) + + +### Features + +* Add MergeToCell to Mutation APIs ([#2279](https://github.com/googleapis/java-bigtable/issues/2279)) ([0ce8a2a](https://github.com/googleapis/java-bigtable/commit/0ce8a2a38703233da58208655f41f6e81e03576e)) +* Add support for MergeToCell API ([#2258](https://github.com/googleapis/java-bigtable/issues/2258)) ([191d15c](https://github.com/googleapis/java-bigtable/commit/191d15c5284dbb702e11669931272877bf05f44e)) +* Add support for new functions ([#2287](https://github.com/googleapis/java-bigtable/issues/2287)) ([dd6583a](https://github.com/googleapis/java-bigtable/commit/dd6583a22504385b7a1f7dc91b3bc3d2500ea0c5)) +* Create new environment variable to toggle directpath scoped to cloud bigtable. ([#2261](https://github.com/googleapis/java-bigtable/issues/2261)) ([9062944](https://github.com/googleapis/java-bigtable/commit/9062944610277eb7ae77f395dc79ce94239c5bee)) +* Implement ExecuteQuery API for SQL support ([#2280](https://github.com/googleapis/java-bigtable/issues/2280)) ([25218e8](https://github.com/googleapis/java-bigtable/commit/25218e8cc46f9a51d4b6515afdb8931e574b0bb1)) + + +### Dependencies + +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.4.4 ([#2282](https://github.com/googleapis/java-bigtable/issues/2282)) ([d00a9e0](https://github.com/googleapis/java-bigtable/commit/d00a9e01b2b329f3bae50f48a15692d87ad0f3bf)) + +## [2.40.0](https://github.com/googleapis/java-bigtable/compare/v2.39.5...v2.40.0) (2024-06-28) + + +### Features + +* Add String type with Utf8Raw encoding to Bigtable API ([#2191](https://github.com/googleapis/java-bigtable/issues/2191)) ([e7f03fc](https://github.com/googleapis/java-bigtable/commit/e7f03fc7d252a7ff6c76a8e6e0a9e6ad3dcbd9d5)) + + +### Bug Fixes + +* Add getServiceName() to EnhancedBigTableStubSettings ([#2256](https://github.com/googleapis/java-bigtable/issues/2256)) ([da703db](https://github.com/googleapis/java-bigtable/commit/da703db25f6702b263dbd8ded0cb0fd3422efe31)) +* Remove grpclb ([#2033](https://github.com/googleapis/java-bigtable/issues/2033)) ([7355375](https://github.com/googleapis/java-bigtable/commit/735537571a147bfdd2a986664ff7905c8f5dc3db)) + + +### Dependencies + +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.4.3 ([#2268](https://github.com/googleapis/java-bigtable/issues/2268)) ([4573220](https://github.com/googleapis/java-bigtable/commit/45732201880a13eeced3d0332bd172aae0f73dbe)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.3 ([#2269](https://github.com/googleapis/java-bigtable/issues/2269)) ([69fef96](https://github.com/googleapis/java-bigtable/commit/69fef968937f4d2e4cc479279a09d7b0bed6c5a2)) +* Update shared dependencies ([#2265](https://github.com/googleapis/java-bigtable/issues/2265)) ([61014ca](https://github.com/googleapis/java-bigtable/commit/61014ca89318743cf0cc0bae97a7f875bc5243ab)) + +## [2.39.5](https://github.com/googleapis/java-bigtable/compare/v2.39.4...v2.39.5) (2024-06-10) + + +### Bug Fixes + +* Make change stream unknown mod error more actionable ([#1938](https://github.com/googleapis/java-bigtable/issues/1938)) ([e7ba045](https://github.com/googleapis/java-bigtable/commit/e7ba045967e837129adcf979ac13cd9097fab56c)) +* Rate limiting should be ineffective when RateLimitInfo is not present ([#2243](https://github.com/googleapis/java-bigtable/issues/2243)) ([a0ec901](https://github.com/googleapis/java-bigtable/commit/a0ec901a84d8d5a2729772d165e2b305d4663824)) + + +### Dependencies + +* Update shared dependencies ([#2252](https://github.com/googleapis/java-bigtable/issues/2252)) ([0131eb3](https://github.com/googleapis/java-bigtable/commit/0131eb33d09f0c4cb7b4984efed257f6d72b0100)) + +## [2.39.4](https://github.com/googleapis/java-bigtable/compare/v2.39.3...v2.39.4) (2024-05-28) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.2 ([#2236](https://github.com/googleapis/java-bigtable/issues/2236)) ([2609103](https://github.com/googleapis/java-bigtable/commit/26091035ed42cfd2945092d0c909dbf9bb6fae28)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.2 ([#2237](https://github.com/googleapis/java-bigtable/issues/2237)) ([6728931](https://github.com/googleapis/java-bigtable/commit/6728931ca904e2a2fb53f7b9e9115a9c3edd38df)) +* Update shared dependencies ([#2235](https://github.com/googleapis/java-bigtable/issues/2235)) ([8d38150](https://github.com/googleapis/java-bigtable/commit/8d3815023f7fa1c8103cb8ab02d8f71cd8a7a85e)) + +## [2.39.3](https://github.com/googleapis/java-bigtable/compare/v2.39.2...v2.39.3) (2024-05-21) + + +### Bug Fixes + +* Retry INTERNAL retriable auth errors ([#2239](https://github.com/googleapis/java-bigtable/issues/2239)) ([4cdb6da](https://github.com/googleapis/java-bigtable/commit/4cdb6da8920cd3346a9d79d67432cef588d93bb0)) + +## [2.39.2](https://github.com/googleapis/java-bigtable/compare/v2.39.1...v2.39.2) (2024-05-09) + + +### Dependencies + +* Update shared dependencies ([#2221](https://github.com/googleapis/java-bigtable/issues/2221)) ([17f7a9a](https://github.com/googleapis/java-bigtable/commit/17f7a9af3991c4744256bbfb0533d9390cada23d)) + +## [2.39.1](https://github.com/googleapis/java-bigtable/compare/v2.39.0...v2.39.1) (2024-05-08) + + +### Bug Fixes + +* Batch time series data when exporting client-side metric ([#2222](https://github.com/googleapis/java-bigtable/issues/2222)) ([1f9f169](https://github.com/googleapis/java-bigtable/commit/1f9f1698339ae470d821963e1037e0132016d216)) +* Remove stale module from bom ([#2218](https://github.com/googleapis/java-bigtable/issues/2218)) ([7145864](https://github.com/googleapis/java-bigtable/commit/7145864868b3f7df69f9b2db7a822f9faf903f33)) + +## [2.39.0](https://github.com/googleapis/java-bigtable/compare/v2.38.0...v2.39.0) (2024-04-29) + + +### Features + +* Admin API changes for databoost ([#2181](https://github.com/googleapis/java-bigtable/issues/2181)) ([3b1886b](https://github.com/googleapis/java-bigtable/commit/3b1886bea79525505e41124b41985f37c490c97e)) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.36.0 ([#2215](https://github.com/googleapis/java-bigtable/issues/2215)) ([5a9259e](https://github.com/googleapis/java-bigtable/commit/5a9259e3c861f1ed13c84e0bb024ddda3e1dc147)) +* Update shared dependencies ([#2190](https://github.com/googleapis/java-bigtable/issues/2190)) ([3f37d8d](https://github.com/googleapis/java-bigtable/commit/3f37d8da8b51a3fea56d1c462b9500ee2c244973)) + +## [2.38.0](https://github.com/googleapis/java-bigtable/compare/v2.37.0...v2.38.0) (2024-04-15) + + +### Features + +* Add Data Boost configurations to admin API ([f29c5bb](https://github.com/googleapis/java-bigtable/commit/f29c5bba08daffe2721454db1714f6ea6f47fc66)) +* Add feature flag for client side metrics ([#2179](https://github.com/googleapis/java-bigtable/issues/2179)) ([f29c5bb](https://github.com/googleapis/java-bigtable/commit/f29c5bba08daffe2721454db1714f6ea6f47fc66)) +* Migrate to OTEL and enable metrics by default ([#2166](https://github.com/googleapis/java-bigtable/issues/2166)) ([1682939](https://github.com/googleapis/java-bigtable/commit/168293937cc7f438a3ec2dee46805aa8e12089c4)) + + +### Bug Fixes + +* Add more error handling ([#2203](https://github.com/googleapis/java-bigtable/issues/2203)) ([c2a63f7](https://github.com/googleapis/java-bigtable/commit/c2a63f7627f2aa6e2e51ec3e185abfa5234ad3e4)) +* Fix export to log detect resource errors ([#2197](https://github.com/googleapis/java-bigtable/issues/2197)) ([d32fbb7](https://github.com/googleapis/java-bigtable/commit/d32fbb78bbde2ad04103ab7b2c1176a6df72d0a3)) + +## [2.37.0](https://github.com/googleapis/java-bigtable/compare/v2.36.0...v2.37.0) (2024-03-27) + + +### Features + +* Add admin APIs for AuthorizedView ([#2175](https://github.com/googleapis/java-bigtable/issues/2175)) ([13d1df3](https://github.com/googleapis/java-bigtable/commit/13d1df3910e3041b57485a09317f717932b21727)) +* Support AuthorizedView in bigtable data client ([#2177](https://github.com/googleapis/java-bigtable/issues/2177)) ([4b255d0](https://github.com/googleapis/java-bigtable/commit/4b255d0160b0ea30a4ab6453ccae278f40d32ee2)) + + +### Bug Fixes + +* Update the accounting of partial batch mutations ([#2149](https://github.com/googleapis/java-bigtable/issues/2149)) ([4158094](https://github.com/googleapis/java-bigtable/commit/4158094c34c85b1540197256f98e8880962fb13d)) + + +### Dependencies + +* Update shared dependencies ([#2174](https://github.com/googleapis/java-bigtable/issues/2174)) ([f313f14](https://github.com/googleapis/java-bigtable/commit/f313f1410f28df15438d83acaa74b715c752abdd)) + +## [2.36.0](https://github.com/googleapis/java-bigtable/compare/v2.35.1...v2.36.0) (2024-03-13) + + +### Features + +* Add models for type APIs ([#2160](https://github.com/googleapis/java-bigtable/issues/2160)) ([8277ea8](https://github.com/googleapis/java-bigtable/commit/8277ea828491d39b9c3c2e67c1a03927e2a744d9)) +* Publish new bigtable APIs for types and aggregates ([#2158](https://github.com/googleapis/java-bigtable/issues/2158)) ([430dffe](https://github.com/googleapis/java-bigtable/commit/430dffe0ff5916d9c3d7cfd7d35ca13514fd8934)) + +## [2.35.1](https://github.com/googleapis/java-bigtable/compare/v2.35.0...v2.35.1) (2024-03-07) + + +### Dependencies + +* Update shared dependencies ([#2140](https://github.com/googleapis/java-bigtable/issues/2140)) ([a6c9f9b](https://github.com/googleapis/java-bigtable/commit/a6c9f9bc7781535d80c4a44cb350052d6771b2e0)) + +## [2.35.0](https://github.com/googleapis/java-bigtable/compare/v2.34.0...v2.35.0) (2024-03-05) + + +### Features + +* Add authorized view bindings to Cloud Bigtable data APIs and messages ([#2144](https://github.com/googleapis/java-bigtable/issues/2144)) ([ae89709](https://github.com/googleapis/java-bigtable/commit/ae89709514921f7f362b7bf6057ec2f01e50046d)) + + +### Bug Fixes + +* Per-connection metrics issue when using a different Bigtable project ([#2143](https://github.com/googleapis/java-bigtable/issues/2143)) ([8dbd680](https://github.com/googleapis/java-bigtable/commit/8dbd680abc1ad13ad33981c67f8349f63432b7ea)) + +## [2.34.0](https://github.com/googleapis/java-bigtable/compare/v2.33.0...v2.34.0) (2024-02-21) + + +### Features + +* Add the export logic for per-connection error rate metric ([#2121](https://github.com/googleapis/java-bigtable/issues/2121)) ([d053f2d](https://github.com/googleapis/java-bigtable/commit/d053f2dc98eb8576f33471d728c6fbf32d537ece)) +* Create the backbone of counting errors per connection each minute. ([#2094](https://github.com/googleapis/java-bigtable/issues/2094)) ([7d27816](https://github.com/googleapis/java-bigtable/commit/7d27816b959a06412f59f49023611f0bca8e3536)) + + +### Dependencies + +* Update actions/setup-java action to v4 ([#2106](https://github.com/googleapis/java-bigtable/issues/2106)) ([a694296](https://github.com/googleapis/java-bigtable/commit/a694296a76faefe31585aabc9dce0adcf4a342bf)) +* Update dependency com.google.cloud:gapic-libraries-bom to v1.30.0 ([#2126](https://github.com/googleapis/java-bigtable/issues/2126)) ([f613bd0](https://github.com/googleapis/java-bigtable/commit/f613bd0dd449d218a0d8b6d20344155f9762cfb1)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.25.0 ([#2113](https://github.com/googleapis/java-bigtable/issues/2113)) ([ba1973e](https://github.com/googleapis/java-bigtable/commit/ba1973e20c4cbb9be778840cc202eb7e4daf04f4)) +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.4.1 ([#2119](https://github.com/googleapis/java-bigtable/issues/2119)) ([0a7ad66](https://github.com/googleapis/java-bigtable/commit/0a7ad66fa9e2c1858f51c25d1ea01b26da0b944f)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.1 ([#2122](https://github.com/googleapis/java-bigtable/issues/2122)) ([99ec284](https://github.com/googleapis/java-bigtable/commit/99ec28425c2caac6a992cb7edd83f2029cce92ec)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.1 ([#2123](https://github.com/googleapis/java-bigtable/issues/2123)) ([12d961a](https://github.com/googleapis/java-bigtable/commit/12d961aad5d15feb27a7996de8b9a626fcdfbc5b)) + +## [2.33.0](https://github.com/googleapis/java-bigtable/compare/v2.32.0...v2.33.0) (2024-02-12) + + +### Features + +* Define the metrics for collecting per connection error count. ([#2088](https://github.com/googleapis/java-bigtable/issues/2088)) ([b212bbf](https://github.com/googleapis/java-bigtable/commit/b212bbfcfb2d8c2e2fdc2fc3609976c8a462f677)) + + +### Bug Fixes + +* Deflake Backup integration tests due to deleteBackup timeouts ([#2105](https://github.com/googleapis/java-bigtable/issues/2105)) ([0948da7](https://github.com/googleapis/java-bigtable/commit/0948da7885958556c85ce333cf13b36896ddc154)) +* Extend timeouts for deleting snapshots, backups and tables ([#2108](https://github.com/googleapis/java-bigtable/issues/2108)) ([df1d307](https://github.com/googleapis/java-bigtable/commit/df1d307255abbe77050c2c24f934b13bb82eb212)) + + +### Dependencies + +* **autogen:** Set packed = false on field_behavior extension ([#2101](https://github.com/googleapis/java-bigtable/issues/2101)) ([7c438c6](https://github.com/googleapis/java-bigtable/commit/7c438c603f3893946f73b2d69f2e0901ac9b044a)) +* Update actions/setup-java action to v4 ([#2099](https://github.com/googleapis/java-bigtable/issues/2099)) ([a6c7c77](https://github.com/googleapis/java-bigtable/commit/a6c7c779df39b151202d765728c853a7bdcd3d18)) +* Update dependency com.google.cloud:gapic-libraries-bom to v1.29.0 ([#2109](https://github.com/googleapis/java-bigtable/issues/2109)) ([ef88519](https://github.com/googleapis/java-bigtable/commit/ef8851976898f595f53bbc239d4f1731893d924b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.24.0 ([#2085](https://github.com/googleapis/java-bigtable/issues/2085)) ([3851a5e](https://github.com/googleapis/java-bigtable/commit/3851a5e7db5ae3d3c1d29e6f97fc37815c8b70d1)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.0 ([#2091](https://github.com/googleapis/java-bigtable/issues/2091)) ([2516a09](https://github.com/googleapis/java-bigtable/commit/2516a095c8305a4193bbadf6c08395f6d718e1d0)) +* Update protobuf to 25.2 in WORKSPACE ([#2086](https://github.com/googleapis/java-bigtable/issues/2086)) ([3eafcee](https://github.com/googleapis/java-bigtable/commit/3eafcee16f7a5e357fc8617120ee875d32fc415d)) + +## [2.32.0](https://github.com/googleapis/java-bigtable/compare/v2.31.0...v2.32.0) (2024-01-25) + + +### Features + +* Append version to the client name in client-side metrics. ([#2062](https://github.com/googleapis/java-bigtable/issues/2062)) ([9a0cdc8](https://github.com/googleapis/java-bigtable/commit/9a0cdc8cb8e2c52fde403eb316d28bf99c55a1e7)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.32.0 ([#2060](https://github.com/googleapis/java-bigtable/issues/2060)) ([c218ac3](https://github.com/googleapis/java-bigtable/commit/c218ac3571360c85171dac71b915ad6776d97589)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 ([#2076](https://github.com/googleapis/java-bigtable/issues/2076)) ([5d1079c](https://github.com/googleapis/java-bigtable/commit/5d1079c2d1ced39b656773ff17743cb4e08a6126)) +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.3.0 ([#2058](https://github.com/googleapis/java-bigtable/issues/2058)) ([1622a9f](https://github.com/googleapis/java-bigtable/commit/1622a9f34d6818952eb283eba01992dc48a9df25)) +* Update shared dependencies ([#2056](https://github.com/googleapis/java-bigtable/issues/2056)) ([f73ba40](https://github.com/googleapis/java-bigtable/commit/f73ba4099b497a78f82a1ad61b91035380955c21)) + +## [2.31.0](https://github.com/googleapis/java-bigtable/compare/v2.30.0...v2.31.0) (2024-01-12) + + +### Features + +* Add a flag to add / remove routing cookie from callable chain ([#2032](https://github.com/googleapis/java-bigtable/issues/2032)) ([201e631](https://github.com/googleapis/java-bigtable/commit/201e631f893b1edacdd5760c1d180b212dc9e38a)) +* Adding feature flags for routing cookie and retry info ([#2031](https://github.com/googleapis/java-bigtable/issues/2031)) ([08c5bf1](https://github.com/googleapis/java-bigtable/commit/08c5bf1fd76258387135c8c3abe75f13bcdcc1f6)) +* Count row merging errors as internal errors ([#2045](https://github.com/googleapis/java-bigtable/issues/2045)) ([fc7845b](https://github.com/googleapis/java-bigtable/commit/fc7845bd4cefca05bccc4dc3a9f727fd20f5adf6)) +* Enable feature flag when setting is enabled ([#2043](https://github.com/googleapis/java-bigtable/issues/2043)) ([e0d90db](https://github.com/googleapis/java-bigtable/commit/e0d90db67b3ea52d833f7d6bcd78e3f7e91ff301)) +* Handle retry info so client respect the delay server sets ([#2026](https://github.com/googleapis/java-bigtable/issues/2026)) ([f1b7fc7](https://github.com/googleapis/java-bigtable/commit/f1b7fc79ad3fd9006e430e48430331b360bb22e3)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#2044](https://github.com/googleapis/java-bigtable/issues/2044)) ([d9042a5](https://github.com/googleapis/java-bigtable/commit/d9042a567f284424efb4af69f757883c9781dce3)) +* Fix RetryInfo algorithm and tests ([#2041](https://github.com/googleapis/java-bigtable/issues/2041)) ([dad7517](https://github.com/googleapis/java-bigtable/commit/dad751736112323c578b3c90d9587fc182105747)) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.27.0 ([#2030](https://github.com/googleapis/java-bigtable/issues/2030)) ([a492d02](https://github.com/googleapis/java-bigtable/commit/a492d02bdc52cb81d8804a4d7cd363b5807bdd47)) +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.2.0 ([#2035](https://github.com/googleapis/java-bigtable/issues/2035)) ([46e1e03](https://github.com/googleapis/java-bigtable/commit/46e1e0335f9969fa1b60acdf17e9b8abbc312ca2)) + +## [2.30.0](https://github.com/googleapis/java-bigtable/compare/v2.29.1...v2.30.0) (2023-12-05) + + +### Features + +* Client sends routing cookie back to server ([#1888](https://github.com/googleapis/java-bigtable/issues/1888)) ([4c73abd](https://github.com/googleapis/java-bigtable/commit/4c73abd2f4a07808b591dd9178e87715d2f3008d)) + + +### Dependencies + +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.1 ([#1990](https://github.com/googleapis/java-bigtable/issues/1990)) ([7ad70e3](https://github.com/googleapis/java-bigtable/commit/7ad70e3abc1af7dfab715386978bf14f02b34e5d)) +* Update shared dependencies ([#2016](https://github.com/googleapis/java-bigtable/issues/2016)) ([4e49dff](https://github.com/googleapis/java-bigtable/commit/4e49dffa72db8dd04e75ca86178d875fab6f566b)) + +## [2.29.1](https://github.com/googleapis/java-bigtable/compare/v2.29.0...v2.29.1) (2023-11-07) + + +### Bug Fixes + +* Add getPageSize() to QueryPaginator ([42a7e36](https://github.com/googleapis/java-bigtable/commit/42a7e36ae5902c08ed3a1b553bec645291f1778a)) + + +### Dependencies + +* Update shared dependencies ([#1985](https://github.com/googleapis/java-bigtable/issues/1985)) ([0d1f620](https://github.com/googleapis/java-bigtable/commit/0d1f6203dd2317fa877e31c113bdca1e8174a492)) + +## [2.29.0](https://github.com/googleapis/java-bigtable/compare/v2.28.0...v2.29.0) (2023-10-26) + + +### Features + +* Add APIs to enable request priorities ([#1959](https://github.com/googleapis/java-bigtable/issues/1959)) ([befd140](https://github.com/googleapis/java-bigtable/commit/befd1402a0f324b365b72e3b237d33d2f3fe8bbc)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#1966](https://github.com/googleapis/java-bigtable/issues/1966)) ([8fb09e5](https://github.com/googleapis/java-bigtable/commit/8fb09e53a3d85273578ba26c522931047b249333)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 ([#1967](https://github.com/googleapis/java-bigtable/issues/1967)) ([117e0ec](https://github.com/googleapis/java-bigtable/commit/117e0ec546343798cbc69eb23fef539de0b8bb8d)) +* Update shared dependencies ([#1964](https://github.com/googleapis/java-bigtable/issues/1964)) ([bf5a9b7](https://github.com/googleapis/java-bigtable/commit/bf5a9b774f79005ee9980a12931597ddc1ec5bb3)) + +## [2.28.0](https://github.com/googleapis/java-bigtable/compare/v2.27.4...v2.28.0) (2023-10-12) + + +### Features + +* Add support for Cloud Bigtable Request Priorities in App Profiles ([#1954](https://github.com/googleapis/java-bigtable/issues/1954)) ([8822571](https://github.com/googleapis/java-bigtable/commit/88225717b870032b8892123262d2529ba1dbd481)) +* Add test profile to push metrics to test environment ([#1921](https://github.com/googleapis/java-bigtable/issues/1921)) ([2104315](https://github.com/googleapis/java-bigtable/commit/210431523ce54029db846a0d6777d5e417e039dd)) + + +### Dependencies + +* Update shared dependencies ([#1955](https://github.com/googleapis/java-bigtable/issues/1955)) ([f29717e](https://github.com/googleapis/java-bigtable/commit/f29717e3f1af03a78ce9468cdafa8c09dfb1b216)) + +## [2.27.4](https://github.com/googleapis/java-bigtable/compare/v2.27.3...v2.27.4) (2023-09-29) + + +### Dependencies + +* Update dependency com.google.cloud:gapic-libraries-bom to v1.21.0 ([#1942](https://github.com/googleapis/java-bigtable/issues/1942)) ([f8d533f](https://github.com/googleapis/java-bigtable/commit/f8d533f4dcfd60a3eac9656bdc7339ac25f06fad)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.16.1 ([#1933](https://github.com/googleapis/java-bigtable/issues/1933)) ([159636a](https://github.com/googleapis/java-bigtable/commit/159636ac82e7bb19b425075a006ee98a39af1d57)) + +## [2.27.3](https://github.com/googleapis/java-bigtable/compare/v2.27.2...v2.27.3) (2023-09-29) + + +### Bug Fixes + +* A rare race condition in the row merger ([#1939](https://github.com/googleapis/java-bigtable/issues/1939)) ([fccd710](https://github.com/googleapis/java-bigtable/commit/fccd7100578da3e2ee2a315c6e956c06dbf41668)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.27 ([#1919](https://github.com/googleapis/java-bigtable/issues/1919)) ([56d6b40](https://github.com/googleapis/java-bigtable/commit/56d6b40b9f874ec4ad78618c1cf0d365ddc9276b)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.27 ([#1920](https://github.com/googleapis/java-bigtable/issues/1920)) ([ca1dd5b](https://github.com/googleapis/java-bigtable/commit/ca1dd5b258c7fa5cfd90811dc8b9492c19d1f104)) +* Update gapic-generator-java to 2.26.0 ([#1936](https://github.com/googleapis/java-bigtable/issues/1936)) ([15cd486](https://github.com/googleapis/java-bigtable/commit/15cd4868ff807513914095a3758134eaa14f0ea3)) + +## [2.27.2](https://github.com/googleapis/java-bigtable/compare/v2.27.1...v2.27.2) (2023-09-13) + + +### Bug Fixes + +* Check that all bulk mutation entries are accounted for ([#1907](https://github.com/googleapis/java-bigtable/issues/1907)) ([9ad8a00](https://github.com/googleapis/java-bigtable/commit/9ad8a00ec4f10a75952fa566a7effc980936dee1)) +* Set wait timeout on watchdog ([#1913](https://github.com/googleapis/java-bigtable/issues/1913)) ([f8ba6fe](https://github.com/googleapis/java-bigtable/commit/f8ba6fe554dd02bb99fb03859cc5c8b04561b0c3)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.26 ([#1896](https://github.com/googleapis/java-bigtable/issues/1896)) ([dfc4231](https://github.com/googleapis/java-bigtable/commit/dfc4231af9b74a4d5db3beaf26dd611a27cc6a67)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.26 ([#1897](https://github.com/googleapis/java-bigtable/issues/1897)) ([d446856](https://github.com/googleapis/java-bigtable/commit/d4468560db62f2102c404b3907cd5ae76d1e08b6)) +* Update shared dependencies ([#1901](https://github.com/googleapis/java-bigtable/issues/1901)) ([96f2690](https://github.com/googleapis/java-bigtable/commit/96f2690e219714e497208e8be5e46b7f38340625)) + +## [2.27.1](https://github.com/googleapis/java-bigtable/compare/v2.27.0...v2.27.1) (2023-09-12) + + +### Bug Fixes + +* Aggregate batching throttling latency per attempt and reset it between ([#1905](https://github.com/googleapis/java-bigtable/issues/1905)) ([e6cc5f6](https://github.com/googleapis/java-bigtable/commit/e6cc5f615630d15b717df1056ceed98f21f2297b)) +* Make sure to propagate the response when throttling is enabled ([#1908](https://github.com/googleapis/java-bigtable/issues/1908)) ([f743187](https://github.com/googleapis/java-bigtable/commit/f7431871ba4ea64351fc5710089f8308e91d7978)) + + +### Dependencies + +* Update the Java code generator (gapic-generator-java) to 2.25.0 ([#1902](https://github.com/googleapis/java-bigtable/issues/1902)) ([f4fe6a0](https://github.com/googleapis/java-bigtable/commit/f4fe6a054194f68da1d7a548dec7a1cec68c1a2c)) + +## [2.27.0](https://github.com/googleapis/java-bigtable/compare/v2.26.0...v2.27.0) (2023-08-17) + + +### Features + +* Copy backup API support ([#1398](https://github.com/googleapis/java-bigtable/issues/1398)) ([558a408](https://github.com/googleapis/java-bigtable/commit/558a408f5fa0566652df923799cf9f7bc03f7194)) +* Publish CopyBackup protos to external customers ([#1883](https://github.com/googleapis/java-bigtable/issues/1883)) ([d6e934f](https://github.com/googleapis/java-bigtable/commit/d6e934fc71e1c1dd4e13492d2f6c4688b6b0d59d)) + +## [2.26.0](https://github.com/googleapis/java-bigtable/compare/v2.25.1...v2.26.0) (2023-08-09) + + +### Features + +* Add last_scanned_row_key feature ([#1856](https://github.com/googleapis/java-bigtable/issues/1856)) ([ef30dde](https://github.com/googleapis/java-bigtable/commit/ef30dde4bdbedb8f04feb0604d66c95309468a2e)) +* Enable last_scanned_row_responses feature flag ([#1862](https://github.com/googleapis/java-bigtable/issues/1862)) ([c2288c9](https://github.com/googleapis/java-bigtable/commit/c2288c9f1f97571b7b12394a4697ebf5abfc5cfc)) +* Setup 2.25.x lts branch ([#1866](https://github.com/googleapis/java-bigtable/issues/1866)) ([220cf4b](https://github.com/googleapis/java-bigtable/commit/220cf4b142adeb63802e27fb5effdb343f832563)) + + +### Bug Fixes + +* Fix batcher metric labels ([#1829](https://github.com/googleapis/java-bigtable/issues/1829)) ([6245c12](https://github.com/googleapis/java-bigtable/commit/6245c12b37d8c1398cdfd497129a6fc1ef767508)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.24.0 ([#1878](https://github.com/googleapis/java-bigtable/issues/1878)) ([0de458d](https://github.com/googleapis/java-bigtable/commit/0de458d919cdef4284da98b830c26027b9ae8941)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 ([#1873](https://github.com/googleapis/java-bigtable/issues/1873)) ([bb83064](https://github.com/googleapis/java-bigtable/commit/bb830647358e66bddc392e0cffbe7e63a7036ce6)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 ([#1876](https://github.com/googleapis/java-bigtable/issues/1876)) ([d397c33](https://github.com/googleapis/java-bigtable/commit/d397c337ab17d000a331bade8fca8b49f5f2355e)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 ([#1877](https://github.com/googleapis/java-bigtable/issues/1877)) ([1a8be60](https://github.com/googleapis/java-bigtable/commit/1a8be60a20498d6fa321841fa561ab7c3d9fe9a2)) + +## [2.25.1](https://github.com/googleapis/java-bigtable/compare/v2.25.0...v2.25.1) (2023-07-25) + + +### Bug Fixes + +* Update the readRow attempt timeouts to be inline with unary rpcs instead of scans ([#1834](https://github.com/googleapis/java-bigtable/issues/1834)) ([168c33e](https://github.com/googleapis/java-bigtable/commit/168c33e3135755cc5a1105f18bf93ade5e1219dc)) + + +### Dependencies + +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#1847](https://github.com/googleapis/java-bigtable/issues/1847)) ([825faaa](https://github.com/googleapis/java-bigtable/commit/825faaad93a5062e6f34ff699cc02701b69e56ab)) +* Update shared dependencies ([#1845](https://github.com/googleapis/java-bigtable/issues/1845)) ([88e1892](https://github.com/googleapis/java-bigtable/commit/88e18922b4e1da398c51441aff014bca5f3bb746)) +* Update the Java code generator (gapic-generator-java) to 2.23.1 ([#1846](https://github.com/googleapis/java-bigtable/issues/1846)) ([78fd837](https://github.com/googleapis/java-bigtable/commit/78fd837987780c62137354fbbe41e71050948405)) + +## [2.25.0](https://github.com/googleapis/java-bigtable/compare/v2.24.1...v2.25.0) (2023-07-14) + + +### Features + +* Change stream retention to create and update table ([#1823](https://github.com/googleapis/java-bigtable/issues/1823)) ([05fca58](https://github.com/googleapis/java-bigtable/commit/05fca581d4225769cc581e26e679e6bca105055b)) + + +### Bug Fixes + +* Fix batch mutation limit ([#1808](https://github.com/googleapis/java-bigtable/issues/1808)) ([ed24d4f](https://github.com/googleapis/java-bigtable/commit/ed24d4fdc67c6d0af66ea055ba1ad7f7c037a361)) +* Update default sample row key attempt timeout to 5 min ([#1827](https://github.com/googleapis/java-bigtable/issues/1827)) ([2f363ef](https://github.com/googleapis/java-bigtable/commit/2f363ef3636c2810c322bb5978cc586f8aec2ef2)) + + +### Documentation + +* Fix formatting for reversed order field example ([#1836](https://github.com/googleapis/java-bigtable/issues/1836)) ([10a0426](https://github.com/googleapis/java-bigtable/commit/10a0426f580b86b26541b95a778bb8b7f6562383)) +* Increase the maximum retention period for a Cloud Bigtable backup from 30 days to 90 days ([#1826](https://github.com/googleapis/java-bigtable/issues/1826)) ([159fe38](https://github.com/googleapis/java-bigtable/commit/159fe3857735c9061672fc951388215edb0a324c)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.22.0 ([#1838](https://github.com/googleapis/java-bigtable/issues/1838)) ([fba2c49](https://github.com/googleapis/java-bigtable/commit/fba2c49e9e71209289497f53868aa561c0fba7a3)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#1833](https://github.com/googleapis/java-bigtable/issues/1833)) ([cb160af](https://github.com/googleapis/java-bigtable/commit/cb160af8e66ec6693ed0d3286c654a93094b68a3)) + +## [2.24.1](https://github.com/googleapis/java-bigtable/compare/v2.24.0...v2.24.1) (2023-06-27) + + +### Bug Fixes + +* Remove javadoc external link configuration ([#1815](https://github.com/googleapis/java-bigtable/issues/1815)) ([9c71a93](https://github.com/googleapis/java-bigtable/commit/9c71a934f8354477b0e229b83047c8203d4ab978)) + +## [2.24.0](https://github.com/googleapis/java-bigtable/compare/v2.23.3...v2.24.0) (2023-06-27) + + +### Features + +* Add experimental reverse scan for public preview ([#1809](https://github.com/googleapis/java-bigtable/issues/1809)) ([f4f2e2e](https://github.com/googleapis/java-bigtable/commit/f4f2e2ebac535372ebfb8ebd60ca78f0f7ca010b)) +* Reverse scans public preview ([#1711](https://github.com/googleapis/java-bigtable/issues/1711)) ([176360f](https://github.com/googleapis/java-bigtable/commit/176360f2689966dccbe95c401cf2bfe9ca64f274)) + + +### Dependencies + +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.1.5 ([#1801](https://github.com/googleapis/java-bigtable/issues/1801)) ([a8961e8](https://github.com/googleapis/java-bigtable/commit/a8961e8f45f5cb2812c185a68a8892bed958ae6a)) +* Update dependency kr.motd.maven:os-maven-plugin to v1.7.1 ([#1792](https://github.com/googleapis/java-bigtable/issues/1792)) ([80acca0](https://github.com/googleapis/java-bigtable/commit/80acca0922060e932dedd31e8079f432b7de9785)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 ([#1800](https://github.com/googleapis/java-bigtable/issues/1800)) ([a9172c4](https://github.com/googleapis/java-bigtable/commit/a9172c4570a053d28ab90232b98ab716cc8b6f80)) +* Update shared dependencies to 3.12.0, monitoring to 3.21.0, update renovate config ([#1807](https://github.com/googleapis/java-bigtable/issues/1807)) ([12fc8cd](https://github.com/googleapis/java-bigtable/commit/12fc8cded38d64c9e4d997d83ff8cdbffe373120)) + +## [2.23.3](https://github.com/googleapis/java-bigtable/compare/v2.23.2...v2.23.3) (2023-06-08) + + +### Bug Fixes + +* Set wait timeout and update default attempt timeout to 30 minutes ([#1779](https://github.com/googleapis/java-bigtable/issues/1779)) ([11019b8](https://github.com/googleapis/java-bigtable/commit/11019b87fe32b5b9c9f2d947ffd9191b56120381)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.20.0 ([#1785](https://github.com/googleapis/java-bigtable/issues/1785)) ([8ddd370](https://github.com/googleapis/java-bigtable/commit/8ddd370bf747bcc7ad7ccb6f00cc5ef188fa3511)) +* Update gapic-generator-java to 2.21.0 ([#1760](https://github.com/googleapis/java-bigtable/issues/1760)) ([05545f8](https://github.com/googleapis/java-bigtable/commit/05545f87692c05c22d17e431551b4a5f91475286)) +* Update shared dependencies to 3.11.0 ([#1783](https://github.com/googleapis/java-bigtable/issues/1783)) ([96aaa2a](https://github.com/googleapis/java-bigtable/commit/96aaa2a5a5a70feeb8ff0fd20b9dfc4a8a464bb7)) + +## [2.23.2](https://github.com/googleapis/java-bigtable/compare/v2.23.1...v2.23.2) (2023-05-30) + + +### Documentation + +* **samples:** Add bigtable filter snippet ([#1762](https://github.com/googleapis/java-bigtable/issues/1762)) ([48a6ed0](https://github.com/googleapis/java-bigtable/commit/48a6ed028a56302d6dc6554b2ecdabc8fbdb68cf)) +* **samples:** Remove client initialization as the snippets are not used standalone ([#1768](https://github.com/googleapis/java-bigtable/issues/1768)) ([a6ac97c](https://github.com/googleapis/java-bigtable/commit/a6ac97c08a851977a76e82fddb16690cff17a1fe)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.19.0 ([#1769](https://github.com/googleapis/java-bigtable/issues/1769)) ([956c851](https://github.com/googleapis/java-bigtable/commit/956c851b5d7dadb44c589a3f982e603d0a768105)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.10.1 ([#1767](https://github.com/googleapis/java-bigtable/issues/1767)) ([901b88f](https://github.com/googleapis/java-bigtable/commit/901b88f56c7b97bc08826604ed80120f07f04a64)) +* Update dependency com.google.truth.extensions:truth-proto-extension to v1.1.4 ([#1770](https://github.com/googleapis/java-bigtable/issues/1770)) ([a94a522](https://github.com/googleapis/java-bigtable/commit/a94a522a1fa4c67245f1827d8f8137cbfdbd5a45)) +* Update doclet version to v1.9.0 ([#1761](https://github.com/googleapis/java-bigtable/issues/1761)) ([a5d4215](https://github.com/googleapis/java-bigtable/commit/a5d42159643c652a9625fee620fe5ee8dee7fa2e)) + +## [2.23.1](https://github.com/googleapis/java-bigtable/compare/v2.23.0...v2.23.1) (2023-05-11) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.18.0 ([#1749](https://github.com/googleapis/java-bigtable/issues/1749)) ([1d7d391](https://github.com/googleapis/java-bigtable/commit/1d7d39145eefc5cbf6d015fd60a4d49441f88d1f)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 ([#1744](https://github.com/googleapis/java-bigtable/issues/1744)) ([60df07f](https://github.com/googleapis/java-bigtable/commit/60df07fcfa653291d9e5882cf3386f13813e2883)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.22 ([#1746](https://github.com/googleapis/java-bigtable/issues/1746)) ([86ea9db](https://github.com/googleapis/java-bigtable/commit/86ea9db830f6d5f7dc0b08886bce084b4650d281)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.22 ([#1747](https://github.com/googleapis/java-bigtable/issues/1747)) ([caa4462](https://github.com/googleapis/java-bigtable/commit/caa44627d6a124d1a58d85a510962c8a7caee69b)) + +## [2.23.0](https://github.com/googleapis/java-bigtable/compare/v2.22.0...v2.23.0) (2023-05-09) + + +### Features + +* Resizing channel pool size based on the work load ([#1271](https://github.com/googleapis/java-bigtable/issues/1271)) ([7fb1a09](https://github.com/googleapis/java-bigtable/commit/7fb1a09224e1ea05cfec6eb35deaba670d1d82d2)) + + +### Documentation + +* Clean up BetaApi annotations from built in metrics API ([#1741](https://github.com/googleapis/java-bigtable/issues/1741)) ([c2fbd04](https://github.com/googleapis/java-bigtable/commit/c2fbd04eb64ddcfe7ea0f234f22d0691094646a4)) + +## [2.22.0](https://github.com/googleapis/java-bigtable/compare/v2.21.0...v2.22.0) (2023-05-02) + + +### Features + +* Add APIs to enable batch write flow control ([#1730](https://github.com/googleapis/java-bigtable/issues/1730)) ([b518d68](https://github.com/googleapis/java-bigtable/commit/b518d6851429db640e80ab78b3f827bb334f5409)) +* Add rate limiting callable ([#1729](https://github.com/googleapis/java-bigtable/issues/1729)) ([ee0da11](https://github.com/googleapis/java-bigtable/commit/ee0da11664d978e808d1088a419cdbd2270da147)) +* Send feature flag when flow control is enabled ([#1731](https://github.com/googleapis/java-bigtable/issues/1731)) ([ba147c3](https://github.com/googleapis/java-bigtable/commit/ba147c3520be27f4f3e622f3ef69fab716895dbe)) + + +### Bug Fixes + +* Add feature flag proto to BUILD file ([#1726](https://github.com/googleapis/java-bigtable/issues/1726)) ([7e5c646](https://github.com/googleapis/java-bigtable/commit/7e5c646031de22c42bb3dd81774ccd6762bd91ed)) + +## [2.21.0](https://github.com/googleapis/java-bigtable/compare/v2.20.4...v2.21.0) (2023-04-27) + + +### Features + +* Track the latency a request is queued on the grpc channel ([#1604](https://github.com/googleapis/java-bigtable/issues/1604)) ([bf3e7dd](https://github.com/googleapis/java-bigtable/commit/bf3e7dd58170bd058cedba8eea69b8c412ae68d3)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.17.0 ([#1722](https://github.com/googleapis/java-bigtable/issues/1722)) ([c6f7767](https://github.com/googleapis/java-bigtable/commit/c6f776730bd1d78489be69d09744782e8b46c9b0)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 ([#1720](https://github.com/googleapis/java-bigtable/issues/1720)) ([aa230b5](https://github.com/googleapis/java-bigtable/commit/aa230b5be4e282ccaa506d360ce95fdbe58ed4bb)) + +## [2.20.4](https://github.com/googleapis/java-bigtable/compare/v2.20.3...v2.20.4) (2023-04-17) + + +### Documentation + +* Make delete examples consistent with other languages ([#1710](https://github.com/googleapis/java-bigtable/issues/1710)) ([2d80188](https://github.com/googleapis/java-bigtable/commit/2d80188c65f454e037b758426b8747b5992db0de)) + + +### Dependencies + +* Update actions/setup-go action to v4 ([#1700](https://github.com/googleapis/java-bigtable/issues/1700)) ([1fd13ba](https://github.com/googleapis/java-bigtable/commit/1fd13ba9fdfa0322ee419f405c92ebe3979d85c7)) +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.16.0 ([#1712](https://github.com/googleapis/java-bigtable/issues/1712)) ([f3bb088](https://github.com/googleapis/java-bigtable/commit/f3bb088cd670805e5c6975e7154ee7e1e320acc6)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 ([#1704](https://github.com/googleapis/java-bigtable/issues/1704)) ([d60c946](https://github.com/googleapis/java-bigtable/commit/d60c94630f60d01241eecf9e3061ed197435b55e)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 ([#1705](https://github.com/googleapis/java-bigtable/issues/1705)) ([8f3d69d](https://github.com/googleapis/java-bigtable/commit/8f3d69d2498a7c0b5f760a40054e17d07502764d)) +* Update shared dependencies ([#1703](https://github.com/googleapis/java-bigtable/issues/1703)) ([076b411](https://github.com/googleapis/java-bigtable/commit/076b411b3c834c4ed1b98551f08befab78743c8f)) +* Upgrade maven-enforcer-plugin to 3.3.0, remove duplicate entry in pom ([#1702](https://github.com/googleapis/java-bigtable/issues/1702)) ([392fc69](https://github.com/googleapis/java-bigtable/commit/392fc697b9b75d172ba5bfd98ead45a6074c47f7)) + +## [2.20.3](https://github.com/googleapis/java-bigtable/compare/v2.20.2...v2.20.3) (2023-04-03) + + +### Dependencies + +* Upgrade shared dependencies to 3.6.0 and monitoring to 3.15.0 ([#1688](https://github.com/googleapis/java-bigtable/issues/1688)) ([c0bad0d](https://github.com/googleapis/java-bigtable/commit/c0bad0d637179e0e8ed80e9716203ae8f11e5cb4)) + +## [2.20.2](https://github.com/googleapis/java-bigtable/compare/v2.20.1...v2.20.2) (2023-03-29) + + +### Bug Fixes + +* Higher application blocking latency precision ([#1676](https://github.com/googleapis/java-bigtable/issues/1676)) ([45ce93b](https://github.com/googleapis/java-bigtable/commit/45ce93bb52112391b9c3a90f10f51279839bea1b)) +* Make ChangeStreamRecord interface serializable ([#1685](https://github.com/googleapis/java-bigtable/issues/1685)) ([b97badb](https://github.com/googleapis/java-bigtable/commit/b97badbaa30588c578bfacc8183e77baaa656bd9)) +* Mark readRow requests as unary operations ([#1679](https://github.com/googleapis/java-bigtable/issues/1679)) ([f88bb67](https://github.com/googleapis/java-bigtable/commit/f88bb67a7a63450b8cd29f01660cf677ddfe436c)) + +## [2.20.1](https://github.com/googleapis/java-bigtable/compare/v2.20.0...v2.20.1) (2023-03-21) + + +### Bug Fixes + +* If new_partitions is size 0, do not enforce size check ([#1673](https://github.com/googleapis/java-bigtable/issues/1673)) ([07bcfd9](https://github.com/googleapis/java-bigtable/commit/07bcfd9a0967f781fb8e5e0d764654dbf7bcda91)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.14.0 ([#1668](https://github.com/googleapis/java-bigtable/issues/1668)) ([06f9615](https://github.com/googleapis/java-bigtable/commit/06f96156705a2a7897a31d11dad864afe94de693)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([#1670](https://github.com/googleapis/java-bigtable/issues/1670)) ([74cebf3](https://github.com/googleapis/java-bigtable/commit/74cebf3a5ab58f3fd3ae95583ba2421b733deda8)) + +## [2.20.0](https://github.com/googleapis/java-bigtable/compare/v2.19.2...v2.20.0) (2023-03-02) + + +### Features + +* Add getNewPartitions method to CloseStream for Bigtable ChangeStream ([#1655](https://github.com/googleapis/java-bigtable/issues/1655)) ([8847fed](https://github.com/googleapis/java-bigtable/commit/8847fed7f77ce4715c197ca1cfcc3108e0fa1004)) +* Add new_partitions field for CloseStream for Cloud Bigtable ChangeStream ([#1654](https://github.com/googleapis/java-bigtable/issues/1654)) ([0e283bf](https://github.com/googleapis/java-bigtable/commit/0e283bff0a12f5e4da8b0975d4bd747229c3780c)) + + +### Bug Fixes + +* Fix StackOverflow in ChangeStreamStateMachine due to excessive mods ([#1648](https://github.com/googleapis/java-bigtable/issues/1648)) ([9e11106](https://github.com/googleapis/java-bigtable/commit/9e1110600dc64defcd9143753f45b5b8226aa339)) +* Use org.threeten.bp.Duration for ReadChangeStreamQuery::heartbeatDura… ([#1652](https://github.com/googleapis/java-bigtable/issues/1652)) ([87261a9](https://github.com/googleapis/java-bigtable/commit/87261a977d6fc7877d7d253c67ea34c264f63f7c)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.13.0 ([#1656](https://github.com/googleapis/java-bigtable/issues/1656)) ([1c632ec](https://github.com/googleapis/java-bigtable/commit/1c632ec63987958e469e2b5861c29724c5cb8970)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 ([#1657](https://github.com/googleapis/java-bigtable/issues/1657)) ([c7a3e29](https://github.com/googleapis/java-bigtable/commit/c7a3e29dc717e2fa3d9b15f1ae9fb9f795d6f78a)) + +## [2.19.2](https://github.com/googleapis/java-bigtable/compare/v2.19.1...v2.19.2) (2023-02-21) + + +### Bug Fixes + +* Change types for Cloud Bigtable Changestream methods ([#1639](https://github.com/googleapis/java-bigtable/issues/1639)) ([908d70f](https://github.com/googleapis/java-bigtable/commit/908d70fdfa22e563031e2d8780b574ee7350cadc)) + + +### Dependencies + +* Update shared deps to 3.3.0 and monitoring to 3.12.0 ([#1643](https://github.com/googleapis/java-bigtable/issues/1643)) ([1a54fbf](https://github.com/googleapis/java-bigtable/commit/1a54fbf22490e5a83df0b0d73dc4b30472175102)) + +## [2.19.1](https://github.com/googleapis/java-bigtable/compare/v2.19.0...v2.19.1) (2023-02-16) + + +### Bug Fixes + +* Change the return type of Heartbeat::getEstimatedLowWatermark to long ([#1631](https://github.com/googleapis/java-bigtable/issues/1631)) ([a101494](https://github.com/googleapis/java-bigtable/commit/a101494909226114fd951c94348878bf38453793)) +* Fix connectivity error count calculation ([#1632](https://github.com/googleapis/java-bigtable/issues/1632)) ([0803785](https://github.com/googleapis/java-bigtable/commit/0803785694874001a6ffbfe3245e84a23cb905ae)) +* **test:** Fix flaky test ([#1633](https://github.com/googleapis/java-bigtable/issues/1633)) ([fc29cd3](https://github.com/googleapis/java-bigtable/commit/fc29cd35101fd6a6262aea8648bc06bd20ce3d10)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#1626](https://github.com/googleapis/java-bigtable/issues/1626)) ([0865023](https://github.com/googleapis/java-bigtable/commit/08650238a806367c94072b51029010272c966148)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#1627](https://github.com/googleapis/java-bigtable/issues/1627)) ([782e81f](https://github.com/googleapis/java-bigtable/commit/782e81f6e64c1d8015fddf2219d590c77217584d)) + +## [2.19.0](https://github.com/googleapis/java-bigtable/compare/v2.18.4...v2.19.0) (2023-02-10) + + +### Features + +* Support Cloud Bigtable Changestream ([#1569](https://github.com/googleapis/java-bigtable/issues/1569)) ([c7b4fdf](https://github.com/googleapis/java-bigtable/commit/c7b4fdf70f02b89f178a130d7fdcfcf8b2a6b790)) + + +### Bug Fixes + +* Modify ConvertExceptionCallable to retry on Goaway ([#1588](https://github.com/googleapis/java-bigtable/issues/1588)) ([cf752ea](https://github.com/googleapis/java-bigtable/commit/cf752eaf3b5fb2cddb11a2fbb5acb5a72c9862c2)) + + +### Documentation + +* Fix javadoc code example for awaitOptimizeRestoredTableAsync ([#1617](https://github.com/googleapis/java-bigtable/issues/1617)) ([8b23bb9](https://github.com/googleapis/java-bigtable/commit/8b23bb93d40dbfd9591c7d7546216e2543f9f418)) + +## [2.18.4](https://github.com/googleapis/java-bigtable/compare/v2.18.3...v2.18.4) (2023-02-06) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.11.0 ([#1609](https://github.com/googleapis/java-bigtable/issues/1609)) ([88be13e](https://github.com/googleapis/java-bigtable/commit/88be13e2db9635e124ed169850a18fc968895f2b)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#1610](https://github.com/googleapis/java-bigtable/issues/1610)) ([15db117](https://github.com/googleapis/java-bigtable/commit/15db11712956410636fffcc827c971181fcad2ee)) + +## [2.18.3](https://github.com/googleapis/java-bigtable/compare/v2.18.2...v2.18.3) (2023-01-24) + + +### Bug Fixes + +* Make channel priming work with batch endpoint ([#1600](https://github.com/googleapis/java-bigtable/issues/1600)) ([133c7e5](https://github.com/googleapis/java-bigtable/commit/133c7e50a5a84e880f23cfc7ed88ea2250a2994d)) + +## [2.18.2](https://github.com/googleapis/java-bigtable/compare/v2.18.1...v2.18.2) (2023-01-24) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.10.0 ([#1597](https://github.com/googleapis/java-bigtable/issues/1597)) ([1724d4e](https://github.com/googleapis/java-bigtable/commit/1724d4ee6b63085b035082bd299668ceadd8bd01)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.2 ([#1595](https://github.com/googleapis/java-bigtable/issues/1595)) ([e466191](https://github.com/googleapis/java-bigtable/commit/e466191ef8562b767218dcd4811a271ec6e98257)) + +## [2.18.1](https://github.com/googleapis/java-bigtable/compare/v2.18.0...v2.18.1) (2023-01-17) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.9.0 ([#1579](https://github.com/googleapis/java-bigtable/issues/1579)) ([70c0500](https://github.com/googleapis/java-bigtable/commit/70c050001379214d5577a896e280d04101891a08)) + +## [2.18.0](https://github.com/googleapis/java-bigtable/compare/v2.17.1...v2.18.0) (2023-01-12) + + +### Features + +* Enable channel priming by default ([#1555](https://github.com/googleapis/java-bigtable/issues/1555)) ([303959c](https://github.com/googleapis/java-bigtable/commit/303959cc88e8cf164a45026d79de67e3f58d09fe)) + + +### Bug Fixes + +* Call attemptStarted method with the request ([#1562](https://github.com/googleapis/java-bigtable/issues/1562)) ([325f09c](https://github.com/googleapis/java-bigtable/commit/325f09c9e257d53871a9071e6bfcbb0887298641)) +* Defer instance admin api errors to RPC time rather then client construction time ([#1576](https://github.com/googleapis/java-bigtable/issues/1576)) ([06a0ced](https://github.com/googleapis/java-bigtable/commit/06a0ced03dbac91145bac6d5d01f327c3ff4a83f)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 ([#1572](https://github.com/googleapis/java-bigtable/issues/1572)) ([a68fb80](https://github.com/googleapis/java-bigtable/commit/a68fb8028a338b937b4baf8c50fad1080e137849)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.2 ([#1573](https://github.com/googleapis/java-bigtable/issues/1573)) ([e1362aa](https://github.com/googleapis/java-bigtable/commit/e1362aa4e47b2da089b21a8cfd124d7e935af8de)) + +## [2.17.1](https://github.com/googleapis/java-bigtable/compare/v2.17.0...v2.17.1) (2022-12-13) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.8.0 ([#1548](https://github.com/googleapis/java-bigtable/issues/1548)) ([48f136d](https://github.com/googleapis/java-bigtable/commit/48f136dc1422d601d5470a33763e37514cf620de)) + +## [2.17.0](https://github.com/googleapis/java-bigtable/compare/v2.16.0...v2.17.0) (2022-12-07) + + +### Features + +* Add a query paginator ([#1530](https://github.com/googleapis/java-bigtable/issues/1530)) ([5c8e1f6](https://github.com/googleapis/java-bigtable/commit/5c8e1f656b15177ecef4709b9e502cef58cca479)) +* Add test proxy to java-bigtable client ([#1498](https://github.com/googleapis/java-bigtable/issues/1498)) ([132b4e4](https://github.com/googleapis/java-bigtable/commit/132b4e4fe340ca316de8eef2e2133b6dabd9dec3)) +* Implement cross-project table restore ([#1536](https://github.com/googleapis/java-bigtable/issues/1536)) ([335977c](https://github.com/googleapis/java-bigtable/commit/335977c499b1776c8fa861d13195ffc49e468e0a)) +* Next release from main branch is 2.17.0 ([#1514](https://github.com/googleapis/java-bigtable/issues/1514)) ([4fc6a93](https://github.com/googleapis/java-bigtable/commit/4fc6a93a25362df7bc107d48f94e1c00b6bd608d)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom … ([#1531](https://github.com/googleapis/java-bigtable/issues/1531)) ([ee98338](https://github.com/googleapis/java-bigtable/commit/ee9833835a84cee202b142950b28704db682ac0c)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#1539](https://github.com/googleapis/java-bigtable/issues/1539)) ([3244cef](https://github.com/googleapis/java-bigtable/commit/3244cefd4d77a44bab6ccaa8f5c03e3d31575625)) +* Update dependency kr.motd.maven:os-maven-plugin to v1.7.1 ([#1518](https://github.com/googleapis/java-bigtable/issues/1518)) ([8309681](https://github.com/googleapis/java-bigtable/commit/830968109a3754a12bd0bc92674fe42ae529b924)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#1537](https://github.com/googleapis/java-bigtable/issues/1537)) ([7f7c478](https://github.com/googleapis/java-bigtable/commit/7f7c478a2163c46d10ed39ea3c1b046f971d4569)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#1538](https://github.com/googleapis/java-bigtable/issues/1538)) ([9d3df57](https://github.com/googleapis/java-bigtable/commit/9d3df57d7bfeafd9cbcf56ecd58b52cc1b14ba7b)) + +## [2.16.0](https://github.com/googleapis/java-bigtable/compare/v2.15.1...v2.16.0) (2022-11-11) + + +### Features + +* Remove proto ReadEfficiencyStats ([#1455](https://github.com/googleapis/java-bigtable/issues/1455)) ([f6b243d](https://github.com/googleapis/java-bigtable/commit/f6b243db39c0370f0d9a4e47e553cfe62493b240)) + + +### Bug Fixes + +* Fix metric client settings ([#1509](https://github.com/googleapis/java-bigtable/issues/1509)) ([38ac115](https://github.com/googleapis/java-bigtable/commit/38ac115af07432e9c178064b59729a0b358105cd)) + +## [2.15.1](https://github.com/googleapis/java-bigtable/compare/v2.15.0...v2.15.1) (2022-11-08) + + +### Bug Fixes + +* Call record attempt compeletion on permanent failures ([#1502](https://github.com/googleapis/java-bigtable/issues/1502)) ([f409c47](https://github.com/googleapis/java-bigtable/commit/f409c4769b526b38590671178c007a9c57f9c182)) +* Fix the connectivity error count caculation ([#1401](https://github.com/googleapis/java-bigtable/issues/1401)) ([1f8cfd7](https://github.com/googleapis/java-bigtable/commit/1f8cfd722c749a8d3e30572fbdda6a2e3594d7a6)) +* Only record retry count when it's > 0 ([#1488](https://github.com/googleapis/java-bigtable/issues/1488)) ([445a667](https://github.com/googleapis/java-bigtable/commit/445a66737b45835444b26261b6f017f7fc278f45)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#1501](https://github.com/googleapis/java-bigtable/issues/1501)) ([8f61c64](https://github.com/googleapis/java-bigtable/commit/8f61c64aba815a942daae17ccb024d325c03df8a)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.17 ([#1495](https://github.com/googleapis/java-bigtable/issues/1495)) ([1b7c21a](https://github.com/googleapis/java-bigtable/commit/1b7c21abc793db0e4706f119e934eecdcfce9994)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.17 ([#1496](https://github.com/googleapis/java-bigtable/issues/1496)) ([74779e3](https://github.com/googleapis/java-bigtable/commit/74779e3621c9893bf3a84dc68ddcb624785c8d71)) + +## [2.15.0](https://github.com/googleapis/java-bigtable/compare/v2.14.1...v2.15.0) (2022-10-26) + + +### Features + +* Add apis for Mutation and RowMutationEntry ([#1454](https://github.com/googleapis/java-bigtable/issues/1454)) ([a86934f](https://github.com/googleapis/java-bigtable/commit/a86934f4f70e1998e7368688df8695a4bac7006e)) + + +### Bug Fixes + +* Catch all throwables so version mismatch won't hang the client ([#1402](https://github.com/googleapis/java-bigtable/issues/1402)) ([c03b8a4](https://github.com/googleapis/java-bigtable/commit/c03b8a4245beab7258b8ed8ec76153e6a0275211)) +* Fix attempt status tag for metrics ([#1477](https://github.com/googleapis/java-bigtable/issues/1477)) ([e54cf7d](https://github.com/googleapis/java-bigtable/commit/e54cf7d61128049cea2817b409a8524636b4a6cf)) +* Rename metric names to match the external name ([#1479](https://github.com/googleapis/java-bigtable/issues/1479)) ([28ca7c3](https://github.com/googleapis/java-bigtable/commit/28ca7c310d9a157529555ab6865f89802161443b)) +* Set a longer timeout to wait for callbacks to be executed ([#1478](https://github.com/googleapis/java-bigtable/issues/1478)) ([0d9ff6a](https://github.com/googleapis/java-bigtable/commit/0d9ff6ab3bd5bf853f1d371312036b14c924ae5e)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.5.0 ([#1464](https://github.com/googleapis/java-bigtable/issues/1464)) ([d8e58a5](https://github.com/googleapis/java-bigtable/commit/d8e58a5d88de7ea249d7bc141f1ac65592088da6)) +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.6.0 ([#1476](https://github.com/googleapis/java-bigtable/issues/1476)) ([331dcfb](https://github.com/googleapis/java-bigtable/commit/331dcfbd06ab578cfe9673ca70cab1f6abd5ddcd)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#1470](https://github.com/googleapis/java-bigtable/issues/1470)) ([557a4fb](https://github.com/googleapis/java-bigtable/commit/557a4fbed77157c3ccfc3e84a0c952b647844f9b)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.15 ([#1462](https://github.com/googleapis/java-bigtable/issues/1462)) ([69540cb](https://github.com/googleapis/java-bigtable/commit/69540cb2df25d5fb716e81e7513930b01c310b72)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 ([#1467](https://github.com/googleapis/java-bigtable/issues/1467)) ([53599ca](https://github.com/googleapis/java-bigtable/commit/53599caa0f92bad1365adbc4b58a1dcb1e8a393e)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#1463](https://github.com/googleapis/java-bigtable/issues/1463)) ([a6612f9](https://github.com/googleapis/java-bigtable/commit/a6612f90cd4a0ec9589ca797ff3a42d23478a6e6)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#1468](https://github.com/googleapis/java-bigtable/issues/1468)) ([fe0ddb1](https://github.com/googleapis/java-bigtable/commit/fe0ddb1b183cfdf368c2387a645a613bbfd52a69)) + +## [2.14.1](https://github.com/googleapis/java-bigtable/compare/v2.14.0...v2.14.1) (2022-10-05) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.6 ([#1450](https://github.com/googleapis/java-bigtable/issues/1450)) ([96b1e80](https://github.com/googleapis/java-bigtable/commit/96b1e80af5e17689a84318e9a797195cde3dab45)) + +## [2.14.0](https://github.com/googleapis/java-bigtable/compare/v2.13.0...v2.14.0) (2022-10-03) + + +### Features + +* Publish the RequestStats proto ([#1400](https://github.com/googleapis/java-bigtable/issues/1400)) ([e989200](https://github.com/googleapis/java-bigtable/commit/e989200980510b14d602925df7430e01bc2f8db7)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#1446](https://github.com/googleapis/java-bigtable/issues/1446)) ([81034c5](https://github.com/googleapis/java-bigtable/commit/81034c51722d973cf5545feb33665b4e08265303)) + +## [2.13.0](https://github.com/googleapis/java-bigtable/compare/v2.12.0...v2.13.0) (2022-09-27) + + +### Features + +* Add gRPC RLS dependency ([#1248](https://github.com/googleapis/java-bigtable/issues/1248)) ([e829b92](https://github.com/googleapis/java-bigtable/commit/e829b923d97a00dcb55a14b0877bec2c8cf5ece2)) + + +### Bug Fixes + +* Add a UUID in the task value ([#1430](https://github.com/googleapis/java-bigtable/issues/1430)) ([3bfc7bc](https://github.com/googleapis/java-bigtable/commit/3bfc7bc246488a37b4470e3a75ffdd34f6761804)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.5 ([#1406](https://github.com/googleapis/java-bigtable/issues/1406)) ([d906729](https://github.com/googleapis/java-bigtable/commit/d906729a4bb9a51907bf4879e8d063d5103565ac)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.14 ([#1411](https://github.com/googleapis/java-bigtable/issues/1411)) ([ef7d741](https://github.com/googleapis/java-bigtable/commit/ef7d7419293f9f046dcf941148a86da713feae17)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 ([#1412](https://github.com/googleapis/java-bigtable/issues/1412)) ([dcae319](https://github.com/googleapis/java-bigtable/commit/dcae3195871b78aa6e102c4bc570b18c303c7760)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 ([#1409](https://github.com/googleapis/java-bigtable/issues/1409)) ([c1e195d](https://github.com/googleapis/java-bigtable/commit/c1e195d4e0470b30d97231c44b09fcb5c4881514)) + +## [2.12.0](https://github.com/googleapis/java-bigtable/compare/v2.11.2...v2.12.0) (2022-09-15) + + +### Features + +* **generated:** Publish CBT deletion_protection field in Table, UpdateTableRequest, and UpdateTable API ([f1f3f05](https://github.com/googleapis/java-bigtable/commit/f1f3f05ae2dc84a8dc853eb5467fbd157b7293c3)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.3 ([#1386](https://github.com/googleapis/java-bigtable/issues/1386)) ([f460373](https://github.com/googleapis/java-bigtable/commit/f460373eb74776fae1787b74392b508643e6139f)) +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.3 ([#1387](https://github.com/googleapis/java-bigtable/issues/1387)) ([e339cb1](https://github.com/googleapis/java-bigtable/commit/e339cb186289fa53a0d65c3d77fb7edbae737882)) +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.4 ([#1395](https://github.com/googleapis/java-bigtable/issues/1395)) ([a2db183](https://github.com/googleapis/java-bigtable/commit/a2db183dea46cd83ea70bb89848e0579b9c61fac)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1384](https://github.com/googleapis/java-bigtable/issues/1384)) ([ee3b256](https://github.com/googleapis/java-bigtable/commit/ee3b256a62c2665e2c4230d9acfc14c3d5c2aebf)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1393](https://github.com/googleapis/java-bigtable/issues/1393)) ([df6c6c7](https://github.com/googleapis/java-bigtable/commit/df6c6c79715ecc7b99e026ce8dfa8645765fc9d5)) + +## [2.11.2](https://github.com/googleapis/java-bigtable/compare/v2.11.1...v2.11.2) (2022-09-07) + + +### Bug Fixes + +* Make cloud-monitoring a runtime dependency ([#1371](https://github.com/googleapis/java-bigtable/issues/1371)) ([930d043](https://github.com/googleapis/java-bigtable/commit/930d0439086d2b43735f9583175adf0626952c9b)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.2 ([#1373](https://github.com/googleapis/java-bigtable/issues/1373)) ([43b8052](https://github.com/googleapis/java-bigtable/commit/43b80523cc00932a414702ad96cfd86984c0f649)) +* Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.2 ([#1374](https://github.com/googleapis/java-bigtable/issues/1374)) ([4174f0d](https://github.com/googleapis/java-bigtable/commit/4174f0dc1b61f954ccd1c2fcf88066179a4d430b)) + +## [2.11.1](https://github.com/googleapis/java-bigtable/compare/v2.11.0...v2.11.1) (2022-08-26) + + +### Bug Fixes + +* reset a measure map everytime the stats are recorded ([#1364](https://github.com/googleapis/java-bigtable/issues/1364)) ([1683365](https://github.com/googleapis/java-bigtable/commit/1683365938178bb61b1e9c871f1971449ee942c2)) + +## [2.11.0](https://github.com/googleapis/java-bigtable/compare/v2.10.3...v2.11.0) (2022-08-17) + + +### Features + +* add stackdriver exporter ([#1247](https://github.com/googleapis/java-bigtable/issues/1247)) ([7ce915e](https://github.com/googleapis/java-bigtable/commit/7ce915e34c1ccce30bee78bda9e024a620cde737)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.1 ([#1352](https://github.com/googleapis/java-bigtable/issues/1352)) ([f8d97e5](https://github.com/googleapis/java-bigtable/commit/f8d97e557318eab214f3d916c029bfa153cf7455)) + +## [2.10.3](https://github.com/googleapis/java-bigtable/compare/v2.10.2...v2.10.3) (2022-08-08) + + +### Bug Fixes + +* declaring 2 http libraries as runtime ([#1341](https://github.com/googleapis/java-bigtable/issues/1341)) ([8071de6](https://github.com/googleapis/java-bigtable/commit/8071de6235a6c1aa5873902ca55beaa2a8d64276)) + +## [2.10.2](https://github.com/googleapis/java-bigtable/compare/v2.10.1...v2.10.2) (2022-08-03) + + +### Bug Fixes + +* add a ReadFirstRow callable to set future in onComplete ([#1326](https://github.com/googleapis/java-bigtable/issues/1326)) ([cb539b5](https://github.com/googleapis/java-bigtable/commit/cb539b50d98ec2a8538ce4691b2639426ca95464)) +* The metadata could be returned in trailer or header depends on i… ([#1337](https://github.com/googleapis/java-bigtable/issues/1337)) ([c4b8c03](https://github.com/googleapis/java-bigtable/commit/c4b8c03ece7b3f6ec2cea42ff0ca5ac617528060)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1328](https://github.com/googleapis/java-bigtable/issues/1328)) ([bee0ca0](https://github.com/googleapis/java-bigtable/commit/bee0ca036ab6e711f6069159364f6d3b691e6bfd)) +* upgrade shared config to 1.5.3, exclude google-http-client and google-http-client-gson from gax in google-cloud-bigtable-stats ([#1336](https://github.com/googleapis/java-bigtable/issues/1336)) ([98b3349](https://github.com/googleapis/java-bigtable/commit/98b33498d85325d22737fb4bd66826519e96755a)) + +## [2.10.1](https://github.com/googleapis/java-bigtable/compare/v2.10.0...v2.10.1) (2022-08-01) + + +### Bug Fixes + +* retry rst stream in mutations ([#1327](https://github.com/googleapis/java-bigtable/issues/1327)) ([1a5b3a2](https://github.com/googleapis/java-bigtable/commit/1a5b3a215b5388678241cadec26a962a512157ac)) + + +### Dependencies + +* update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#1323](https://github.com/googleapis/java-bigtable/issues/1323)) ([7655747](https://github.com/googleapis/java-bigtable/commit/76557476744a6404b9df30c97c59f0a7e38a1ed8)) + +## [2.10.0](https://github.com/googleapis/java-bigtable/compare/v2.9.0...v2.10.0) (2022-07-26) + + +### Features + +* add response protos ([#1246](https://github.com/googleapis/java-bigtable/issues/1246)) ([52d59ce](https://github.com/googleapis/java-bigtable/commit/52d59ce18fb5536a17a5cb59da39e563e4afede4)) +* add response_params proto to clients ([#1303](https://github.com/googleapis/java-bigtable/issues/1303)) ([93edfe1](https://github.com/googleapis/java-bigtable/commit/93edfe1e43dcfefda6bba3e9ee53ed80eaf2e5c2)) +* add storage utilization gib per node for autoscaling ([#1317](https://github.com/googleapis/java-bigtable/issues/1317)) ([5282589](https://github.com/googleapis/java-bigtable/commit/52825891af0e4ec2dd76c0c6fa1379a98a77a08f)) +* use PingAndWarm request for channel priming ([#1179](https://github.com/googleapis/java-bigtable/issues/1179)) ([6629821](https://github.com/googleapis/java-bigtable/commit/6629821ea3200d3a5b93c9d45aab6d57485fcebf)) + + +### Bug Fixes + +* enable integration test for google-cloud-bigtable-stats ([#1311](https://github.com/googleapis/java-bigtable/issues/1311)) ([7c77879](https://github.com/googleapis/java-bigtable/commit/7c7787998b164ceb55472c0d06c083a835e5d000)) +* fix race condition in BuiltinMetricsTracer ([#1320](https://github.com/googleapis/java-bigtable/issues/1320)) ([644454a](https://github.com/googleapis/java-bigtable/commit/644454a9723da359677052b7a4b9201e91e9a78a)) +* ignore repackaged files to fix clirr ([#1300](https://github.com/googleapis/java-bigtable/issues/1300)) ([99b67ba](https://github.com/googleapis/java-bigtable/commit/99b67ba5b1625686ac7802a6e40dafc2edceade0)) + + +### Dependencies + +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#1306](https://github.com/googleapis/java-bigtable/issues/1306)) ([ddae354](https://github.com/googleapis/java-bigtable/commit/ddae3540fd68e8f79d94d49c96c5685e1bad2f66)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#1307](https://github.com/googleapis/java-bigtable/issues/1307)) ([c0740fe](https://github.com/googleapis/java-bigtable/commit/c0740fe30c5cd2bdf6dedf901e2fdb9a84ce64a1)) + +## [2.9.0](https://github.com/googleapis/java-bigtable/compare/v2.8.0...v2.9.0) (2022-06-30) + + +### Features + +* add built-in metric constants ([#1243](https://github.com/googleapis/java-bigtable/issues/1243)) ([b1fc00a](https://github.com/googleapis/java-bigtable/commit/b1fc00aa09129185b4e4db8edb9c4af2dbfd1ec8)) +* **generated:** Add storage_utilization_gib_per_node to Autoscaling target ([a4c6621](https://github.com/googleapis/java-bigtable/commit/a4c662153c98f8043059a068a66d784761b7c2cb)) +* **generated:** Cloud Bigtable Undelete Table service and message proto files ([a4c6621](https://github.com/googleapis/java-bigtable/commit/a4c662153c98f8043059a068a66d784761b7c2cb)) +* update tracers to use built in metrics ([#1244](https://github.com/googleapis/java-bigtable/issues/1244)) ([df77560](https://github.com/googleapis/java-bigtable/commit/df77560debadec8b3aecc08e95a58558c418df86)) + + +### Bug Fixes + +* fix flaky test ([#1293](https://github.com/googleapis/java-bigtable/issues/1293)) ([146c824](https://github.com/googleapis/java-bigtable/commit/146c824962b48b2023ddb93d92e4a61297722f0f)) +* remove the shaded profile from root pom ([#1274](https://github.com/googleapis/java-bigtable/issues/1274)) ([5eafcc3](https://github.com/googleapis/java-bigtable/commit/5eafcc3be3986692e64c95dcfc0d675208f2218c)) +* rename HeaderTracer callables to BigtableTracer callables ([#1276](https://github.com/googleapis/java-bigtable/issues/1276)) ([e0bd6c9](https://github.com/googleapis/java-bigtable/commit/e0bd6c922ed2adfc8d6dddeced84cb87fc9f2e91)) +* rename response observer and callbacks ([#1291](https://github.com/googleapis/java-bigtable/issues/1291)) ([2705a47](https://github.com/googleapis/java-bigtable/commit/2705a477f70247f16401901be9e0cd38733bdd2f)) + + +### Documentation + +* **sample:** update README for native image sample ([#1281](https://github.com/googleapis/java-bigtable/issues/1281)) ([4a3a2c9](https://github.com/googleapis/java-bigtable/commit/4a3a2c947642678c3011db616ebe7cbaed677f96)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#1285](https://github.com/googleapis/java-bigtable/issues/1285)) ([1dc7787](https://github.com/googleapis/java-bigtable/commit/1dc77879ea51fd397b75020a16728adec72f1b9b)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#1283](https://github.com/googleapis/java-bigtable/issues/1283)) ([ba7844a](https://github.com/googleapis/java-bigtable/commit/ba7844acb6a4a3c47f1fc12b426f517b7fe3e55e)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#1284](https://github.com/googleapis/java-bigtable/issues/1284)) ([75d0066](https://github.com/googleapis/java-bigtable/commit/75d006601e51263786f38b445a9cc6f08cbee403)) + +## [2.8.0](https://github.com/googleapis/java-bigtable/compare/v2.7.0...v2.8.0) (2022-05-27) + + +### Features + +* split emulator into core without deps and a higher level wrapper with grpc helpers ([#1264](https://github.com/googleapis/java-bigtable/issues/1264)) ([6fdc2c1](https://github.com/googleapis/java-bigtable/commit/6fdc2c1a33e140466734debed22d50a7be726d87)) + + +### Bug Fixes + +* **java:** enable skipped tests for Native Image testing ([#1234](https://github.com/googleapis/java-bigtable/issues/1234)) ([560a501](https://github.com/googleapis/java-bigtable/commit/560a5018087c6cdc46e2c6150e6ed41075007177)) + +## [2.7.0](https://github.com/googleapis/java-bigtable/compare/v2.6.2...v2.7.0) (2022-05-20) + + +### Features + +* (generated) Add ListHotTablets API method and protobufs ([f127f1a](https://github.com/googleapis/java-bigtable/commit/f127f1a05647c8fb2c9becf07753c302957bd571)) +* (generated) AuditConfig for IAM v1 ([f127f1a](https://github.com/googleapis/java-bigtable/commit/f127f1a05647c8fb2c9becf07753c302957bd571)) +* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-bigtable/issues/1440)) ([#1255](https://github.com/googleapis/java-bigtable/issues/1255)) ([2e0bf19](https://github.com/googleapis/java-bigtable/commit/2e0bf193e3abaf2cfdc6208c41e7d8b928e92dc7)) +* next release from main branch is v2.7.0 ([22acfc4](https://github.com/googleapis/java-bigtable/commit/22acfc405e23ccfeeeedcce6992f887d48d22bd5)) + + +### Documentation + +* Remove the limitation of all clusters in a CMEK instance must use the same key ([f127f1a](https://github.com/googleapis/java-bigtable/commit/f127f1a05647c8fb2c9becf07753c302957bd571)) +* **sample:** remove unused native-image-support dependency ([#1237](https://github.com/googleapis/java-bigtable/issues/1237)) ([520670e](https://github.com/googleapis/java-bigtable/commit/520670ee1456f83368cc9843d594ad7af2117e76)) +* Update `cpu_utilization_percent` limit ([f127f1a](https://github.com/googleapis/java-bigtable/commit/f127f1a05647c8fb2c9becf07753c302957bd571)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-gcloud-maven-plugin to v0.1.5 ([#1249](https://github.com/googleapis/java-bigtable/issues/1249)) ([9fb02d6](https://github.com/googleapis/java-bigtable/commit/9fb02d6c3ab7d3d5d8b168418e47a65114b7deb1)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.11.0 ([#1253](https://github.com/googleapis/java-bigtable/issues/1253)) ([86a1e0e](https://github.com/googleapis/java-bigtable/commit/86a1e0e14b18101717143b0a01e4025a6540dbc2)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#1256](https://github.com/googleapis/java-bigtable/issues/1256)) ([d4b05a4](https://github.com/googleapis/java-bigtable/commit/d4b05a4992dd016c389fc10c0ba509497e201d21)) + +### [2.6.2](https://github.com/googleapis/java-bigtable/compare/v2.6.1...v2.6.2) (2022-04-15) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#1221](https://github.com/googleapis/java-bigtable/issues/1221)) ([acdaa33](https://github.com/googleapis/java-bigtable/commit/acdaa33dbfd91fdf892673ad164016a35e88d695)) +* update dependency com.google.cloud:native-image-support to v0.13.1 ([#1222](https://github.com/googleapis/java-bigtable/issues/1222)) ([a14de82](https://github.com/googleapis/java-bigtable/commit/a14de8249d81f01355a87a8bc351bd6bc949c04b)) + +### [2.6.1](https://github.com/googleapis/java-bigtable/compare/v2.6.0...v2.6.1) (2022-03-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#1212](https://github.com/googleapis/java-bigtable/issues/1212)) ([e38841c](https://github.com/googleapis/java-bigtable/commit/e38841c17c2a03e3b4dee73bd452c46c622736c1)) +* update dependency com.google.cloud:native-image-support to v0.12.10 ([#1203](https://github.com/googleapis/java-bigtable/issues/1203)) ([a62a104](https://github.com/googleapis/java-bigtable/commit/a62a1048f0f2e9090405fc6311ca706762d1534e)) +* update dependency com.google.cloud:native-image-support to v0.12.11 ([#1210](https://github.com/googleapis/java-bigtable/issues/1210)) ([2c5090c](https://github.com/googleapis/java-bigtable/commit/2c5090cf1ad19b966dc2819be2e724dc991149b9)) +* update dependency com.google.cloud:native-image-support to v0.12.7 ([#1196](https://github.com/googleapis/java-bigtable/issues/1196)) ([476da07](https://github.com/googleapis/java-bigtable/commit/476da07ecead27c3f260b4e312bbb4eb035b4d3e)) +* update dependency com.google.cloud:native-image-support to v0.12.8 ([#1201](https://github.com/googleapis/java-bigtable/issues/1201)) ([d9fd936](https://github.com/googleapis/java-bigtable/commit/d9fd936e97ca362c5868b6aeca2617c2688bc009)) +* update dependency com.google.cloud:native-image-support to v0.12.9 ([#1202](https://github.com/googleapis/java-bigtable/issues/1202)) ([29c6005](https://github.com/googleapis/java-bigtable/commit/29c60059b7e231b014f0f8862d48dd0b071fbf8a)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.11 ([#1207](https://github.com/googleapis/java-bigtable/issues/1207)) ([f2a01dc](https://github.com/googleapis/java-bigtable/commit/f2a01dc30c67ae6ae41e7f9733281ed182b6e836)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.11 ([#1208](https://github.com/googleapis/java-bigtable/issues/1208)) ([9f93af3](https://github.com/googleapis/java-bigtable/commit/9f93af3eb1463427dc4cc57a860bf7a76ab3f2de)) + +## [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) + + +### Bug Fixes + +* integration tests ([#1161](https://github.com/googleapis/java-bigtable/issues/1161)) ([8b00b5f](https://github.com/googleapis/java-bigtable/commit/8b00b5fb5b4e3a1ada514b0bdc60fd744833bd01)) + +### [2.5.2](https://github.com/googleapis/java-bigtable/compare/v2.5.1...v2.5.2) (2022-01-31) + + +### Bug Fixes + +* UpdateAppProfileRequest equals and hashcode should build proto ([#1142](https://github.com/googleapis/java-bigtable/issues/1142)) ([c9f1ed8](https://github.com/googleapis/java-bigtable/commit/c9f1ed8a5fdf44487a8c56388b35067ecfc4daea)) + + +### Dependencies + +* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-bigtable/issues/1339)) ([#1147](https://github.com/googleapis/java-bigtable/issues/1147)) ([9bfcccf](https://github.com/googleapis/java-bigtable/commit/9bfcccfd76d2a03412cf9fe8c115874f15a95c57)) +* update actions/github-script action to v5 ([#1146](https://github.com/googleapis/java-bigtable/issues/1146)) ([9b2c918](https://github.com/googleapis/java-bigtable/commit/9b2c918c3fad38d3b26d141b53f6dc037a23bed7)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#1150](https://github.com/googleapis/java-bigtable/issues/1150)) ([744e483](https://github.com/googleapis/java-bigtable/commit/744e4830238b6ebe7bab6115ff26600b0c150b62)) + +### [2.5.1](https://www.github.com/googleapis/java-bigtable/compare/v2.5.0...v2.5.1) (2022-01-07) + + +### Bug Fixes + +* Revert "fix: remove stats from javadoc" ([#1118](https://www.github.com/googleapis/java-bigtable/issues/1118)) ([ba8f344](https://www.github.com/googleapis/java-bigtable/commit/ba8f344d19163627553a0a268742af2a1a792db5)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#1124](https://www.github.com/googleapis/java-bigtable/issues/1124)) ([55ebf69](https://www.github.com/googleapis/java-bigtable/commit/55ebf6932bbe93e8b7635a7550320099eb4fbe93)) + +## [2.5.0](https://www.github.com/googleapis/java-bigtable/compare/v2.4.0...v2.5.0) (2022-01-05) + + +### Features + +* add batch throttled ms metric ([#888](https://www.github.com/googleapis/java-bigtable/issues/888)) ([0d197a5](https://www.github.com/googleapis/java-bigtable/commit/0d197a5ab9b7ccd20091c1c6c4a794586d6a51dc)) +* ARM support for gcloud bigtable emulator ([#1094](https://www.github.com/googleapis/java-bigtable/issues/1094)) ([d3cb4a4](https://www.github.com/googleapis/java-bigtable/commit/d3cb4a4e03ae0f7e065bfee06ac8e3b86b447a4a)) + + +### Bug Fixes + +* align ip version preference for the wrapped emulator ([#1052](https://www.github.com/googleapis/java-bigtable/issues/1052)) ([9dc93c5](https://www.github.com/googleapis/java-bigtable/commit/9dc93c5c9372f1501006e2d3a3a7affecd65fb8e)) +* remove stats from javadoc ([#1108](https://www.github.com/googleapis/java-bigtable/issues/1108)) ([33fe7fe](https://www.github.com/googleapis/java-bigtable/commit/33fe7fe162cf84339e1887b052e446ef0aaf19d6)) +* remove tracking latency from channel priming requests ([#1082](https://www.github.com/googleapis/java-bigtable/issues/1082)) ([bd873bc](https://www.github.com/googleapis/java-bigtable/commit/bd873bc82f0b210312fd442678c801758291935e)) + +## [2.4.0](https://www.github.com/googleapis/java-bigtable/compare/v2.3.1...v2.4.0) (2021-12-07) + + +### Features + +* cluster autoscaling ([#1092](https://www.github.com/googleapis/java-bigtable/issues/1092)) ([fa4fe14](https://www.github.com/googleapis/java-bigtable/commit/fa4fe149a6a59600afe75f805f2503d3b45e5032)) + +### [2.3.1](https://www.github.com/googleapis/java-bigtable/compare/v2.3.0...v2.3.1) (2021-12-03) + + +### Bug Fixes + +* add placeholder class for bigtable-stats ([#1075](https://www.github.com/googleapis/java-bigtable/issues/1075)) ([9d9f575](https://www.github.com/googleapis/java-bigtable/commit/9d9f57556216becfeb302bfaf5a4f35a9b73b611)) +* add status label to gfe metrics ([#1077](https://www.github.com/googleapis/java-bigtable/issues/1077)) ([777549e](https://www.github.com/googleapis/java-bigtable/commit/777549e6ac64a03c9bd67d6b5a5cf4819ba8656f)) +* make placeholder class public ([#1085](https://www.github.com/googleapis/java-bigtable/issues/1085)) ([879377a](https://www.github.com/googleapis/java-bigtable/commit/879377a03b86aa9a1f1035245c290ec78501b2cd)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#1087](https://www.github.com/googleapis/java-bigtable/issues/1087)) ([f290ce7](https://www.github.com/googleapis/java-bigtable/commit/f290ce74f6b803b8c5786e8b4c69b9efa6995c59)) + +## [2.3.0](https://www.github.com/googleapis/java-bigtable/compare/v2.2.0...v2.3.0) (2021-11-16) + + +### Features + +* configure branch 2.2.x as a release branch ([#1044](https://www.github.com/googleapis/java-bigtable/issues/1044)) ([68e8790](https://www.github.com/googleapis/java-bigtable/commit/68e8790f61b90ce2b5e7479b3d23e2f964199d3e)) +* send attempt and timestamp in headers ([#935](https://www.github.com/googleapis/java-bigtable/issues/935)) ([de3b476](https://www.github.com/googleapis/java-bigtable/commit/de3b476d4acd644d1e5bc782dc697ce5b145992e)) + + +### Bug Fixes + +* **java:** java 17 dependency arguments ([#1046](https://www.github.com/googleapis/java-bigtable/issues/1046)) ([422efa0](https://www.github.com/googleapis/java-bigtable/commit/422efa0289b232118b446224c5e084fe3bc19491)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#1064](https://www.github.com/googleapis/java-bigtable/issues/1064)) ([5b72aa9](https://www.github.com/googleapis/java-bigtable/commit/5b72aa96bab018f4b5b1b565a6487dbb45ccd323)) + +## [2.2.0](https://www.github.com/googleapis/java-bigtable/compare/v2.1.4...v2.2.0) (2021-10-20) + + +### Features + +* app profile multi cluster routing support with specified cluster ids ([#961](https://www.github.com/googleapis/java-bigtable/issues/961)) ([f4c5c32](https://www.github.com/googleapis/java-bigtable/commit/f4c5c32c05d244a9ce7c3a4386ba9396c65f227e)) + + +### Bug Fixes + +* fix typo in rst stream message ([#1029](https://www.github.com/googleapis/java-bigtable/issues/1029)) ([50e6860](https://www.github.com/googleapis/java-bigtable/commit/50e686094c316560864c30a0295b3ed3f655c765)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#1038](https://www.github.com/googleapis/java-bigtable/issues/1038)) ([d3efb29](https://www.github.com/googleapis/java-bigtable/commit/d3efb29df8461caddd3917fc42afa50961723a7d)) + +### [2.1.4](https://www.github.com/googleapis/java-bigtable/compare/v2.1.3...v2.1.4) (2021-09-22) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#1020](https://www.github.com/googleapis/java-bigtable/issues/1020)) ([272f044](https://www.github.com/googleapis/java-bigtable/commit/272f0443501c502abf1b061414fb2435a9ad7952)) + +### [2.1.3](https://www.github.com/googleapis/java-bigtable/compare/v2.1.2...v2.1.3) (2021-09-21) + + +### Dependencies + +* migrate to mockito-core 3.12.4 ([#1008](https://www.github.com/googleapis/java-bigtable/issues/1008)) ([d9f19db](https://www.github.com/googleapis/java-bigtable/commit/d9f19db82f82615e4476462f9c34da7841169838)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#1010](https://www.github.com/googleapis/java-bigtable/issues/1010)) ([a54a021](https://www.github.com/googleapis/java-bigtable/commit/a54a02135f30e3337812938f5794b293ee6535c6)) + +### [2.1.2](https://www.github.com/googleapis/java-bigtable/compare/v2.1.1...v2.1.2) (2021-09-13) + + +### Bug Fixes + +* parallel execution and verbose grpc logs ([#1004](https://www.github.com/googleapis/java-bigtable/issues/1004)) ([dd5164d](https://www.github.com/googleapis/java-bigtable/commit/dd5164dc9de7f060bb0dab79820cb43ac434d703)) + + +### Reverts + +* temporary workaround for maven wildcard excludes ([#989](https://www.github.com/googleapis/java-bigtable/issues/989)) ([148a928](https://www.github.com/googleapis/java-bigtable/commit/148a928e3f8f6d1e2ee1d1b119ca820d676802fd)) + +### [2.1.1](https://www.github.com/googleapis/java-bigtable/compare/v2.1.0...v2.1.1) (2021-09-01) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.2.0 ([#971](https://www.github.com/googleapis/java-bigtable/issues/971)) ([5c614d5](https://www.github.com/googleapis/java-bigtable/commit/5c614d58dd527a7fd36d32f201138a35e95a0577)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#975](https://www.github.com/googleapis/java-bigtable/issues/975)) ([e5bb52e](https://www.github.com/googleapis/java-bigtable/commit/e5bb52eead42e8b351a7469529837d8b509b8332)) + +## [2.1.0](https://www.github.com/googleapis/java-bigtable/compare/v2.0.1...v2.1.0) (2021-08-25) + + +### Features + +* publish new fields to support cluster group routing ([#958](https://www.github.com/googleapis/java-bigtable/issues/958)) ([09b31bd](https://www.github.com/googleapis/java-bigtable/commit/09b31bd9032dc36071cb8d32fc5cb6d4d85878e1)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#962](https://www.github.com/googleapis/java-bigtable/issues/962)) ([a013e77](https://www.github.com/googleapis/java-bigtable/commit/a013e777af0fb2945099c178832fccd14b33398f)) + +### [2.0.1](https://www.github.com/googleapis/java-bigtable/compare/v2.0.0...v2.0.1) (2021-08-11) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#948](https://www.github.com/googleapis/java-bigtable/issues/948)) ([31a7cb6](https://www.github.com/googleapis/java-bigtable/commit/31a7cb60321429497ca29f02119e7a2c1b0d614f)) + +## [2.0.0](https://www.github.com/googleapis/java-bigtable/compare/v1.27.3...v2.0.0) (2021-08-09) + + +### ⚠ BREAKING CHANGES + +* release gapic-generator-java v2.0.0 (#938) +* update java compile to 1.8 (update google-cloud-shared-config … (#939) + +### Features + +* gapic-generator-java v1.0.12, mtls support ([#871](https://www.github.com/googleapis/java-bigtable/issues/871)) ([3ec05d4](https://www.github.com/googleapis/java-bigtable/commit/3ec05d4dff8ee3799dd799ecf659610de031564a)) +* release gapic-generator-java v2.0.0 ([#938](https://www.github.com/googleapis/java-bigtable/issues/938)) ([d2456e4](https://www.github.com/googleapis/java-bigtable/commit/d2456e4b014f714c87ff5ad414b5fabd0631e912)) +* update java compile to 1.8 (update google-cloud-shared-config … ([#939](https://www.github.com/googleapis/java-bigtable/issues/939)) ([57cddee](https://www.github.com/googleapis/java-bigtable/commit/57cddee445dec91a8bb96127ee7db947a1e13a7d)) + + +### Dependencies + +* fix UpperBoundsDep check for checker-qual ([#941](https://www.github.com/googleapis/java-bigtable/issues/941)) ([1d7c224](https://www.github.com/googleapis/java-bigtable/commit/1d7c224bd46f8ab576645e5d722ac595ab875406)) + +### [1.27.3](https://www.github.com/googleapis/java-bigtable/compare/v1.27.2...v1.27.3) (2021-07-19) + + +### Bug Fixes + +* client.close() should wait until the channels are terminated before shutting down the executor ([#916](https://www.github.com/googleapis/java-bigtable/issues/916)) ([914f0cc](https://www.github.com/googleapis/java-bigtable/commit/914f0cc4a928974e14b2ab49b848f757862ad140)) + +### [1.27.2](https://www.github.com/googleapis/java-bigtable/compare/v1.27.1...v1.27.2) (2021-07-01) + + +### Bug Fixes + +* jwt authentication on batch-bigtable.googleapis.com ([#892](https://www.github.com/googleapis/java-bigtable/issues/892)) ([d2ca9c6](https://www.github.com/googleapis/java-bigtable/commit/d2ca9c62f3fcb9c79c97ef8a73bad3a0e7555afc)) + +### [1.27.1](https://www.github.com/googleapis/java-bigtable/compare/v1.27.0...v1.27.1) (2021-06-30) + + +### Bug Fixes + +* Add `shopt -s nullglob` to dependencies script ([#884](https://www.github.com/googleapis/java-bigtable/issues/884)) ([8b971a2](https://www.github.com/googleapis/java-bigtable/commit/8b971a2510685be336b0dd19fc048905b56906e3)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#889](https://www.github.com/googleapis/java-bigtable/issues/889)) ([8b6754f](https://www.github.com/googleapis/java-bigtable/commit/8b6754fb1fbdca43a327e3f253be076eb0c2cd2f)) + +## [1.27.0](https://www.github.com/googleapis/java-bigtable/compare/v1.26.1...v1.27.0) (2021-06-22) + + +### Features + +* all setting timeouts for batchers + fix handling of timeouts for point reads ([#861](https://www.github.com/googleapis/java-bigtable/issues/861)) ([c145ceb](https://www.github.com/googleapis/java-bigtable/commit/c145ceb592f04f94a09be815feff87e0c64e8e7d)) +* call setting timeouts for batchers ([#877](https://www.github.com/googleapis/java-bigtable/issues/877)) ([0f3654d](https://www.github.com/googleapis/java-bigtable/commit/0f3654d726dbb45b4a12ef98f872612e49b9a263)) + + +### Bug Fixes + +* Update dependencies.sh to not break on mac ([#873](https://www.github.com/googleapis/java-bigtable/issues/873)) ([9e6b85d](https://www.github.com/googleapis/java-bigtable/commit/9e6b85deffff15961d12eb8b656210b5e12d8162)) + + +### Reverts + +* Revert "feat: promote stream wait timeouts to deadlines for point reads" ([#876](https://www.github.com/googleapis/java-bigtable/issues/876)) ([4614912](https://www.github.com/googleapis/java-bigtable/commit/4614912b6ea76c9057b1a4cbf869eb3145bce18f)) + + +### Documentation + +* fix connection pool size for samples ([#880](https://www.github.com/googleapis/java-bigtable/issues/880)) ([d0d1aa3](https://www.github.com/googleapis/java-bigtable/commit/d0d1aa3195c0d63242254eece3e92e9ad078069b)) + +### [1.26.1](https://www.github.com/googleapis/java-bigtable/compare/v1.26.0...v1.26.1) (2021-06-07) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#857](https://www.github.com/googleapis/java-bigtable/issues/857)) ([fd2bf65](https://www.github.com/googleapis/java-bigtable/commit/fd2bf656629e21e01e9a877c00eaed018889cc37)) +* update truth-proto-extension to 1.1.3 and exclude protobuf-java from its dependencies ([#854](https://www.github.com/googleapis/java-bigtable/issues/854)) ([e7773ee](https://www.github.com/googleapis/java-bigtable/commit/e7773eed9f34ab4d104df5c09aefb5a302ab4186)) + +## [1.26.0](https://www.github.com/googleapis/java-bigtable/compare/v1.25.0...v1.26.0) (2021-06-03) + + +### Features + +* promote stream wait timeouts to deadlines for point reads ([#848](https://www.github.com/googleapis/java-bigtable/issues/848)) ([9b3c601](https://www.github.com/googleapis/java-bigtable/commit/9b3c6013fef396fcc923e53c13f73a03a48c9c02)) + + +### Bug Fixes + +* add back in extraFiles and fix file path ([#833](https://www.github.com/googleapis/java-bigtable/issues/833)) ([f914954](https://www.github.com/googleapis/java-bigtable/commit/f91495474cb34e1f178d9362ab0251d364079f6d)) +* exclude protobuf from conformance-tests ([#845](https://www.github.com/googleapis/java-bigtable/issues/845)) ([1d89191](https://www.github.com/googleapis/java-bigtable/commit/1d89191a2453b5565aafe72367329eddb36ea90a)) +* Fix the race condition in decay average ([#850](https://www.github.com/googleapis/java-bigtable/issues/850)) ([66a9c9e](https://www.github.com/googleapis/java-bigtable/commit/66a9c9ebc520dd20c336a5cf4040912138137be6)) +* revert conformance test version ([#846](https://www.github.com/googleapis/java-bigtable/issues/846)) ([b23b0d7](https://www.github.com/googleapis/java-bigtable/commit/b23b0d7a7d8a2b9bed1cdabce420cb6568cf82ef)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.1.1 ([#852](https://www.github.com/googleapis/java-bigtable/issues/852)) ([e1c951c](https://www.github.com/googleapis/java-bigtable/commit/e1c951c549bf455cdd6e997756d9464a1e06dad2)) + +## [1.25.0](https://www.github.com/googleapis/java-bigtable/compare/v1.24.1...v1.25.0) (2021-05-19) + + +### Features + +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#815](https://www.github.com/googleapis/java-bigtable/issues/815)) ([ea558b0](https://www.github.com/googleapis/java-bigtable/commit/ea558b05b369c6131f94e471e5652866a037b948)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#814](https://www.github.com/googleapis/java-bigtable/issues/814)) ([1299d72](https://www.github.com/googleapis/java-bigtable/commit/1299d727066e0aa24319b99d438503ea0cf60d86)) + +### [1.24.1](https://www.github.com/googleapis/java-bigtable/compare/v1.24.0...v1.24.1) (2021-05-11) + + +### Bug Fixes + +* filter limit constant ([#787](https://www.github.com/googleapis/java-bigtable/issues/787)) ([04f8ad4](https://www.github.com/googleapis/java-bigtable/commit/04f8ad463d1fa9efe0ab941ee5f3d0794baed814)) +* fix flaky test ([#798](https://www.github.com/googleapis/java-bigtable/issues/798)) ([83e0e8c](https://www.github.com/googleapis/java-bigtable/commit/83e0e8cf2cdbc143c10ce0f8b053096d61d5686f)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#805](https://www.github.com/googleapis/java-bigtable/issues/805)) ([a498687](https://www.github.com/googleapis/java-bigtable/commit/a498687d15dd9af35c57b0df6d08c87ef36833da)) + + +### Documentation + +* update the comments in Cloud Bigtable RestoreTable API to reflect the new API capability ([#804](https://www.github.com/googleapis/java-bigtable/issues/804)) ([f5e5d5a](https://www.github.com/googleapis/java-bigtable/commit/f5e5d5ac196529d5b070ef5fd8118038fec2e2de)) + +## [1.24.0](https://www.github.com/googleapis/java-bigtable/compare/v1.23.2...v1.24.0) (2021-04-30) + + +### Features + +* allow restore backup to different instance ([#515](https://www.github.com/googleapis/java-bigtable/issues/515)) ([8a5e60e](https://www.github.com/googleapis/java-bigtable/commit/8a5e60e8ed116d36810cc4059539228768726912)), closes [#789](https://www.github.com/googleapis/java-bigtable/issues/789) + +### [1.23.2](https://www.github.com/googleapis/java-bigtable/compare/v1.23.1...v1.23.2) (2021-04-23) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#781](https://www.github.com/googleapis/java-bigtable/issues/781)) ([dbf856f](https://www.github.com/googleapis/java-bigtable/commit/dbf856f93942cbec48433821da8e5a96e61a9d7e)) + +### [1.23.1](https://www.github.com/googleapis/java-bigtable/compare/v1.23.0...v1.23.1) (2021-04-20) + + +### Bug Fixes + +* **docs:** correct docs for CUSTOMER_MANAGED_ENCRYPTION ([#737](https://www.github.com/googleapis/java-bigtable/issues/737)) ([b3bb7f7](https://www.github.com/googleapis/java-bigtable/commit/b3bb7f77610e48e849766a6e9dbacb98fc3f9811)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#741](https://www.github.com/googleapis/java-bigtable/issues/741)) ([cfdd0cd](https://www.github.com/googleapis/java-bigtable/commit/cfdd0cd760f9273e644cddc492d9c4d5327498e7)) + +## [1.23.0](https://www.github.com/googleapis/java-bigtable/compare/v1.22.0...v1.23.0) (2021-04-13) + + +### Features + +* dynamic flow control ([#721](https://www.github.com/googleapis/java-bigtable/issues/721)) ([b61c5ce](https://www.github.com/googleapis/java-bigtable/commit/b61c5ce5de9cbe2a93a4ea95bad03585069b85bb)) + + +### Bug Fixes + +* change clusterId in Cmek test ([#716](https://www.github.com/googleapis/java-bigtable/issues/716)) ([67ef155](https://www.github.com/googleapis/java-bigtable/commit/67ef15591d49d51728c769eb54a1167b15524aa1)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#717](https://www.github.com/googleapis/java-bigtable/issues/717)) ([dfc2efd](https://www.github.com/googleapis/java-bigtable/commit/dfc2efda536bb5db209b7c50114b417edd7af5cd)) + +## [1.22.0](https://www.github.com/googleapis/java-bigtable/compare/v1.21.3...v1.22.0) (2021-04-06) + + +### Features + +* add CMEK Support ([#656](https://www.github.com/googleapis/java-bigtable/issues/656)) ([2821902](https://www.github.com/googleapis/java-bigtable/commit/2821902b34ae04596771a9fc5e2b62d5c24a7253)) + + +### Dependencies + +* update autovalue.version to v1.8 ([#703](https://www.github.com/googleapis/java-bigtable/issues/703)) ([13e7796](https://www.github.com/googleapis/java-bigtable/commit/13e7796d96222fe0181771d160d12a3da7f0a7a7)) +* update dependency com.google.truth.extensions:truth-proto-extension to v1.1.2 ([#704](https://www.github.com/googleapis/java-bigtable/issues/704)) ([3fa8b00](https://www.github.com/googleapis/java-bigtable/commit/3fa8b0069d58a5705f11fac481ddcd4ad7d447f4)) + +### [1.21.3](https://www.github.com/googleapis/java-bigtable/compare/v1.21.2...v1.21.3) (2021-04-01) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.6.0 ([#693](https://www.github.com/googleapis/java-bigtable/issues/693)) ([831d044](https://www.github.com/googleapis/java-bigtable/commit/831d044f31c7643b34df4f23765d521e8f68035d)) + +### [1.21.2](https://www.github.com/googleapis/java-bigtable/compare/v1.21.1...v1.21.2) (2021-03-22) + + +### Dependencies + +* update autovalue.version to v1.7.5 ([#684](https://www.github.com/googleapis/java-bigtable/issues/684)) ([75baa79](https://www.github.com/googleapis/java-bigtable/commit/75baa79e94c31e1694c3e29ea2f1ed42dbc60eb8)) + +### [1.21.1](https://www.github.com/googleapis/java-bigtable/compare/v1.21.0...v1.21.1) (2021-03-15) + + +### Bug Fixes + +* **retry:** restore grpc_service_config for CreateBackup and {Restore,Snapshot}Table ([#667](https://www.github.com/googleapis/java-bigtable/issues/667)) ([121f071](https://www.github.com/googleapis/java-bigtable/commit/121f07159c2715368cb53753ba39d70d1d25efb8)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#671](https://www.github.com/googleapis/java-bigtable/issues/671)) ([6ba3bf3](https://www.github.com/googleapis/java-bigtable/commit/6ba3bf3a642bd5b7ecf2a86a821ede0f2bae084f)) + +## [1.21.0](https://www.github.com/googleapis/java-bigtable/compare/v1.20.1...v1.21.0) (2021-03-02) + + +### Features + +* **generator:** update protoc to v3.15.3 ([#654](https://www.github.com/googleapis/java-bigtable/issues/654)) ([4b0c59a](https://www.github.com/googleapis/java-bigtable/commit/4b0c59a17d668e724fb79369ad7a6f7fbbb31d89)) +* migrate to java microgenerator ([#629](https://www.github.com/googleapis/java-bigtable/issues/629)) ([60d17dc](https://www.github.com/googleapis/java-bigtable/commit/60d17dc1d0a0a568a8bdd3bcc1e7491c17142af3)) +* publish new fields for CMEK support ([#646](https://www.github.com/googleapis/java-bigtable/issues/646)) ([e039386](https://www.github.com/googleapis/java-bigtable/commit/e039386898b82f7b03f5a4064c5dcca0fdd3f330)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-gcloud-maven-plugin to v0.1.2 ([#652](https://www.github.com/googleapis/java-bigtable/issues/652)) ([71a8fd7](https://www.github.com/googleapis/java-bigtable/commit/71a8fd7fe55bd40ad32963ffdfc06999be2ff7fc)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#653](https://www.github.com/googleapis/java-bigtable/issues/653)) ([c5049c1](https://www.github.com/googleapis/java-bigtable/commit/c5049c1f988e0f4465d9d805fd092087bfa69fdc)) + +### [1.20.1](https://www.github.com/googleapis/java-bigtable/compare/v1.20.0...v1.20.1) (2021-02-22) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#640](https://www.github.com/googleapis/java-bigtable/issues/640)) ([bf1f49f](https://www.github.com/googleapis/java-bigtable/commit/bf1f49fbff344510501b9b836771d9cfab4defcd)) + +## [1.20.0](https://www.github.com/googleapis/java-bigtable/compare/v1.19.2...v1.20.0) (2021-02-05) + + +### Features + +* Surface the server-timing metric ([#535](https://www.github.com/googleapis/java-bigtable/issues/535)) ([8240779](https://www.github.com/googleapis/java-bigtable/commit/8240779434a602dc8b2bf90dbe539c5d7470d850)) + + +### Bug Fixes + +* fix MetricTracerTest to rebase on head ([#581](https://www.github.com/googleapis/java-bigtable/issues/581)) ([23e97cb](https://www.github.com/googleapis/java-bigtable/commit/23e97cb308403b35fbe972b08048d0e59423e694)) +* fix MutateRowsAttemptCallable to avoid NPE in MetricTracer ([#557](https://www.github.com/googleapis/java-bigtable/issues/557)) ([8d71020](https://www.github.com/googleapis/java-bigtable/commit/8d7102003b54757b64fd598290301d3b24fd9c29)) +* Retry "received rst stream" ([#586](https://www.github.com/googleapis/java-bigtable/issues/586)) ([b09a21c](https://www.github.com/googleapis/java-bigtable/commit/b09a21c1dd1a05b68bfd3a0134089ba32dca1774)) +* update repo name ([#615](https://www.github.com/googleapis/java-bigtable/issues/615)) ([bb3ed6d](https://www.github.com/googleapis/java-bigtable/commit/bb3ed6dcbadbd70dbd9c68152c8d93c4cefd4dcb)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.1 ([#590](https://www.github.com/googleapis/java-bigtable/issues/590)) ([5035ad0](https://www.github.com/googleapis/java-bigtable/commit/5035ad0db01a9247634137050698c30da29722a6)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#592](https://www.github.com/googleapis/java-bigtable/issues/592)) ([c58b73a](https://www.github.com/googleapis/java-bigtable/commit/c58b73a7d70c8da1581ac06d77b5e362648a0868)) +* update dependency com.google.errorprone:error_prone_annotations to v2.5.0 ([#591](https://www.github.com/googleapis/java-bigtable/issues/591)) ([dfa4da7](https://www.github.com/googleapis/java-bigtable/commit/dfa4da75e5ac81cc941177462326f7c38f18bacd)) +* update dependency com.google.errorprone:error_prone_annotations to v2.5.1 ([#594](https://www.github.com/googleapis/java-bigtable/issues/594)) ([ea599a1](https://www.github.com/googleapis/java-bigtable/commit/ea599a10e2e4fdbaf56c45b74fbb1ea5a708a7f2)) + + +### Documentation + +* Expand hello world snippet to show how to access specific cells ([#516](https://www.github.com/googleapis/java-bigtable/issues/516)) ([a9001a8](https://www.github.com/googleapis/java-bigtable/commit/a9001a88f338fc2acf6bc48927765f29819124ee)) +* Update stackdriver examples for tracing and stats ([#613](https://www.github.com/googleapis/java-bigtable/issues/613)) ([3e8af74](https://www.github.com/googleapis/java-bigtable/commit/3e8af747b329f6656a410160e8da14fd8227c8fc)) +* use autogenerated readme functionality and regenerate ([#568](https://www.github.com/googleapis/java-bigtable/issues/568)) ([844e5be](https://www.github.com/googleapis/java-bigtable/commit/844e5beb6230df6ca220935056aae7f6e73d2bc0)) + +### [1.19.2](https://www.github.com/googleapis/java-bigtable/compare/v1.19.1...v1.19.2) (2020-12-15) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#566](https://www.github.com/googleapis/java-bigtable/issues/566)) ([7c8e32b](https://www.github.com/googleapis/java-bigtable/commit/7c8e32b33c701cdf701384ad60986bc96ec4684a)) + +### [1.19.1](https://www.github.com/googleapis/java-bigtable/compare/v1.19.0...v1.19.1) (2020-12-14) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([1c4ceda](https://www.github.com/googleapis/java-bigtable/commit/1c4ceda740157569fb95f7eeb9ddc0cf780cd038)) + +## [1.19.0](https://www.github.com/googleapis/java-bigtable/compare/v1.18.1...v1.19.0) (2020-12-03) + + +### Features + +* attempt DirectPath by default ([#544](https://www.github.com/googleapis/java-bigtable/issues/544)) ([2043063](https://www.github.com/googleapis/java-bigtable/commit/20430636f10445e32834f44b902dd506b0bdadf8)) + +### [1.18.1](https://www.github.com/googleapis/java-bigtable/compare/v1.18.0...v1.18.1) (2020-12-02) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#546](https://www.github.com/googleapis/java-bigtable/issues/546)) ([070bda2](https://www.github.com/googleapis/java-bigtable/commit/070bda21b9ec93bb187626eeb46e7212951a9ebf)) + +## [1.18.0](https://www.github.com/googleapis/java-bigtable/compare/v1.17.3...v1.18.0) (2020-11-13) + + +### Features + +* **autogenerated:** Update BigtableTableAdmin GetIamPolicy to include the additional binding for Backup, Change DeleteAppProfileRequest.ignore_warnings to REQUIRED. ([#530](https://www.github.com/googleapis/java-bigtable/issues/530)) ([8c16fa4](https://www.github.com/googleapis/java-bigtable/commit/8c16fa4c5290f67c43392953095bd759c2505bdb)) + + +### Bug Fixes + +* make keepalive params a bit conservative ([#528](https://www.github.com/googleapis/java-bigtable/issues/528)) ([f5f66c9](https://www.github.com/googleapis/java-bigtable/commit/f5f66c9ce019a6a24ddfe1efc0141835f5a02f34)) + +### [1.17.3](https://www.github.com/googleapis/java-bigtable/compare/v1.17.2...v1.17.3) (2020-11-11) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.15.0 ([#521](https://www.github.com/googleapis/java-bigtable/issues/521)) ([ed300d0](https://www.github.com/googleapis/java-bigtable/commit/ed300d09c6fffb012981789256f13c4893ce02b1)) + +### [1.17.2](https://www.github.com/googleapis/java-bigtable/compare/v1.17.1...v1.17.2) (2020-11-10) + + +### Bug Fixes + +* readRowSettings use manual readRows settings instead of gapics ([#494](https://www.github.com/googleapis/java-bigtable/issues/494)) ([0ef7c5d](https://www.github.com/googleapis/java-bigtable/commit/0ef7c5d4aacacd2030a52efc148ead457719a927)) + + +### Reverts + +* Revert "feat: attemp DirectPath by default (#467)" (#520) ([b33b0fc](https://www.github.com/googleapis/java-bigtable/commit/b33b0fc1b5478934298db317c1168c1e9dc20599)), closes [#467](https://www.github.com/googleapis/java-bigtable/issues/467) [#520](https://www.github.com/googleapis/java-bigtable/issues/520) + +### [1.17.1](https://www.github.com/googleapis/java-bigtable/compare/v1.17.0...v1.17.1) (2020-10-31) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.14.1 ([#505](https://www.github.com/googleapis/java-bigtable/issues/505)) ([ab6284d](https://www.github.com/googleapis/java-bigtable/commit/ab6284d16f24f8197d90c43f1e37416c53287b4c)) + +## [1.17.0](https://www.github.com/googleapis/java-bigtable/compare/v1.16.2...v1.17.0) (2020-10-23) + + +### Features + +* attemp DirectPath by default ([#467](https://www.github.com/googleapis/java-bigtable/issues/467)) ([89c622d](https://www.github.com/googleapis/java-bigtable/commit/89c622da6038067892687af3edafae743465eda7)) +* backup level IAM ([#450](https://www.github.com/googleapis/java-bigtable/issues/450)) ([f38a8ec](https://www.github.com/googleapis/java-bigtable/commit/f38a8ecdc6164d081ef96f748ea37bd62b29b419)) +* Implement toString for Bigtable*Settings ([#488](https://www.github.com/googleapis/java-bigtable/issues/488)) ([4d821f8](https://www.github.com/googleapis/java-bigtable/commit/4d821f85ceb237c8e449243ff8c80fb94e22ad51)) + + +### Bug Fixes + +* Make refreshing channel compatible with BigtableDataClientFactory ([#474](https://www.github.com/googleapis/java-bigtable/issues/474)) ([fc74164](https://www.github.com/googleapis/java-bigtable/commit/fc741645536e01fac772136bc8346f73ff95e600)) + + +### Documentation + +* fix formatting ([#476](https://www.github.com/googleapis/java-bigtable/issues/476)) ([eb24569](https://www.github.com/googleapis/java-bigtable/commit/eb24569e53f9d2b7fde50748c840c2c11f3f3c80)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.12.1 ([#475](https://www.github.com/googleapis/java-bigtable/issues/475)) ([9e56edf](https://www.github.com/googleapis/java-bigtable/commit/9e56edfa7b0a78f14518a99130a7b319c5873be4)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([#484](https://www.github.com/googleapis/java-bigtable/issues/484)) ([aad648f](https://www.github.com/googleapis/java-bigtable/commit/aad648fec16b122092d394350822da742a2d7aa0)) +* update dependency com.google.truth:truth to v1.1 ([#483](https://www.github.com/googleapis/java-bigtable/issues/483)) ([cca1e0e](https://www.github.com/googleapis/java-bigtable/commit/cca1e0e16f2ec0cc887d81c1844f5395ce08b6ea)) + +### [1.16.2](https://www.github.com/googleapis/java-bigtable/compare/v1.16.1...v1.16.2) (2020-10-14) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.13 ([#459](https://www.github.com/googleapis/java-bigtable/issues/459)) ([a7824ea](https://www.github.com/googleapis/java-bigtable/commit/a7824ea99abe2ea0f1336662db5addd60632598a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.11.0 ([#460](https://www.github.com/googleapis/java-bigtable/issues/460)) ([d2d806c](https://www.github.com/googleapis/java-bigtable/commit/d2d806c615f819bbaf575bfadcce26b2473bb77d)) + +### [1.16.1](https://www.github.com/googleapis/java-bigtable/compare/v1.16.0...v1.16.1) (2020-10-08) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.2 ([#452](https://www.github.com/googleapis/java-bigtable/issues/452)) ([c211c1c](https://www.github.com/googleapis/java-bigtable/commit/c211c1c988cc4805d3fe68853836ec3acb495578)) + +## [1.16.0](https://www.github.com/googleapis/java-bigtable/compare/v1.15.0...v1.16.0) (2020-10-06) + + +### Features + +* add keepalive changes in java client library ([#409](https://www.github.com/googleapis/java-bigtable/issues/409)) ([edbcde1](https://www.github.com/googleapis/java-bigtable/commit/edbcde1a5b22317319803cb57401252aac6d580d)) +* include User agent ([#404](https://www.github.com/googleapis/java-bigtable/issues/404)) ([0cd71b5](https://www.github.com/googleapis/java-bigtable/commit/0cd71b59305cd7a336c223faff68402a8bee4639)) + + +### Bug Fixes + +* **test:** Clean up tests ([#439](https://www.github.com/googleapis/java-bigtable/issues/439)) ([c5c881b](https://www.github.com/googleapis/java-bigtable/commit/c5c881bb956860a393c2a7f34d0d790a23d270af)) +* Add documentation to bulkReadRows that each batch will process t… ([#410](https://www.github.com/googleapis/java-bigtable/issues/410)) ([71dc8e3](https://www.github.com/googleapis/java-bigtable/commit/71dc8e3419fbb49d48bb7a3fd984d24e24661c81)) +* Filters should be serializable ([#397](https://www.github.com/googleapis/java-bigtable/issues/397)) ([57edfde](https://www.github.com/googleapis/java-bigtable/commit/57edfde5eace28d50ec777e14589c9747616f0a8)) +* RowCells are not actually serializeable ([#407](https://www.github.com/googleapis/java-bigtable/issues/407)) ([39e17cc](https://www.github.com/googleapis/java-bigtable/commit/39e17cc17c438f2d665875f9ff2b2cdf984e37b7)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.12 ([#415](https://www.github.com/googleapis/java-bigtable/issues/415)) ([7b3713a](https://www.github.com/googleapis/java-bigtable/commit/7b3713a8935b2f0b1ca57d189e9e0363506b28a1)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#428](https://www.github.com/googleapis/java-bigtable/issues/428)) ([373032e](https://www.github.com/googleapis/java-bigtable/commit/373032e93b838cbc0ccab7dc45cd61b3b973542a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.1 ([#443](https://www.github.com/googleapis/java-bigtable/issues/443)) ([939fefa](https://www.github.com/googleapis/java-bigtable/commit/939fefa819d09885489d9faeedadc74ee2b0e1b9)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.1 ([#427](https://www.github.com/googleapis/java-bigtable/issues/427)) ([5175e28](https://www.github.com/googleapis/java-bigtable/commit/5175e28f5ce69f6fb3ed14131c1cfd26dbc47bb9)) + +## [1.15.0](https://www.github.com/googleapis/java-bigtable/compare/v1.14.0...v1.15.0) (2020-09-01) + + +### Features + +* extend channel priming logic to also send fake requests ([#398](https://www.github.com/googleapis/java-bigtable/issues/398)) ([6f1ead2](https://www.github.com/googleapis/java-bigtable/commit/6f1ead2097150a87cb9712bcf35c6eaa9d57440c)) +* **deps:** adopt flatten plugin and google-cloud-shared-dependencies ([#350](https://www.github.com/googleapis/java-bigtable/issues/350)) ([2298596](https://www.github.com/googleapis/java-bigtable/commit/2298596dab8a1ef87c0f48d3abe8bc3955417eb1)) + + +### Bug Fixes + +* temporarily disable reporting to unblock releases ([#395](https://www.github.com/googleapis/java-bigtable/issues/395)) ([a56a0f8](https://www.github.com/googleapis/java-bigtable/commit/a56a0f8c9caf675b68d02587b042e1feeb261ccb)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.6 ([#377](https://www.github.com/googleapis/java-bigtable/issues/377)) ([bdae336](https://www.github.com/googleapis/java-bigtable/commit/bdae336074d80815dcaaf8c71befafc0ed66c079)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.0 ([#402](https://www.github.com/googleapis/java-bigtable/issues/402)) ([08f7d84](https://www.github.com/googleapis/java-bigtable/commit/08f7d84333c6a74bf03e0a57707b878a29400dd4)) + +## [1.14.0](https://www.github.com/googleapis/java-bigtable/compare/v1.13.1...v1.14.0) (2020-07-20) + + +### Features + +* Cloud Bigtable Managed Backup Implementation ([#305](https://www.github.com/googleapis/java-bigtable/issues/305)) ([9e3307a](https://www.github.com/googleapis/java-bigtable/commit/9e3307a4872d3bae3c04e7857a9eb4859151965e)) + +### [1.13.1](https://www.github.com/googleapis/java-bigtable/compare/v1.13.0...v1.13.1) (2020-07-10) + + +### Reverts + +* Revert "fix: change app_profile_id to the correct header app_profile (#318)" (#335) ([200cfac](https://www.github.com/googleapis/java-bigtable/commit/200cfac9b68be9882943765b06de7c0644daf53d)), closes [#318](https://www.github.com/googleapis/java-bigtable/issues/318) [#335](https://www.github.com/googleapis/java-bigtable/issues/335) + + +### Dependencies + +* update autovalue.version to v1.7.3 ([#341](https://www.github.com/googleapis/java-bigtable/issues/341)) ([071d0fe](https://www.github.com/googleapis/java-bigtable/commit/071d0feac03b5077b088a09244fe863aa111c231)) +* update autovalue.version to v1.7.4 ([#365](https://www.github.com/googleapis/java-bigtable/issues/365)) ([18ba73d](https://www.github.com/googleapis/java-bigtable/commit/18ba73da3e6f1035699dc885109f90ffb160cb4e)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.6.0 ([#325](https://www.github.com/googleapis/java-bigtable/issues/325)) ([6fc5b7b](https://www.github.com/googleapis/java-bigtable/commit/6fc5b7b1f13c5326001cc7bcecbf4918a8505d26)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.7.0 ([#326](https://www.github.com/googleapis/java-bigtable/issues/326)) ([2aab7a8](https://www.github.com/googleapis/java-bigtable/commit/2aab7a8ec8775ab67e0277fd1785ee4735e1521d)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.1 ([#343](https://www.github.com/googleapis/java-bigtable/issues/343)) ([f0314a1](https://www.github.com/googleapis/java-bigtable/commit/f0314a13841cff495cc3424805a0aaf19bcc71d0)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.2 ([#362](https://www.github.com/googleapis/java-bigtable/issues/362)) ([1c37f5d](https://www.github.com/googleapis/java-bigtable/commit/1c37f5df35e4a317ac339e5d5b3cd50acf8e8c5a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.3 ([#366](https://www.github.com/googleapis/java-bigtable/issues/366)) ([ade8b36](https://www.github.com/googleapis/java-bigtable/commit/ade8b362d66378e6b1ba75c6c04558e4437080a9)) +* update dependency com.google.errorprone:error_prone_annotations to v2.4.0 ([#328](https://www.github.com/googleapis/java-bigtable/issues/328)) ([b9e5e83](https://www.github.com/googleapis/java-bigtable/commit/b9e5e832791b728d5931e1fe4546d01ffb4903d1)) +* update protobuf.version to v3.12.2 ([#320](https://www.github.com/googleapis/java-bigtable/issues/320)) ([d5cf1d4](https://www.github.com/googleapis/java-bigtable/commit/d5cf1d4a62f9782c18a2d7ebb48d137426f84d5b)) +* use google-cloud-shared-dependencies in bigtable deps bom ([#324](https://www.github.com/googleapis/java-bigtable/issues/324)) ([8f76fc8](https://www.github.com/googleapis/java-bigtable/commit/8f76fc8e7d326ed7837070cf496a2f20d4c7485e)) + +## [1.13.0](https://www.github.com/googleapis/java-bigtable/compare/v1.12.2...v1.13.0) (2020-05-27) + + +### Features + +* adding utility to transform protobuf into model object ([#299](https://www.github.com/googleapis/java-bigtable/issues/299)) ([00f6d2d](https://www.github.com/googleapis/java-bigtable/commit/00f6d2da4179eb3f4f55a1fe1da04047697c5999)) +* expose new API with ReadRowsRequest in EnhancedBigtableStub ([#276](https://www.github.com/googleapis/java-bigtable/issues/276)) ([394efe4](https://www.github.com/googleapis/java-bigtable/commit/394efe459ebe34030bf1d09116eebb4ec4f311e9)) +* Update opencensus metrics to include bigtable resource ids and rpc level metrics ([#214](https://www.github.com/googleapis/java-bigtable/issues/214)) ([7214ef6](https://www.github.com/googleapis/java-bigtable/commit/7214ef6853fc6892401b55bd1beeccbe896e4f33)) + + +### Bug Fixes + +* bigtable v2 retry config settings to disable streaming RPC retries ([#315](https://www.github.com/googleapis/java-bigtable/issues/315)) ([a7e43f0](https://www.github.com/googleapis/java-bigtable/commit/a7e43f07dc0b93c6702992d45444e815200bf202)) +* change app_profile_id to the correct header app_profile ([#318](https://www.github.com/googleapis/java-bigtable/issues/318)) ([237b15d](https://www.github.com/googleapis/java-bigtable/commit/237b15d14b420005d32f227e1a76e7d308db0a42)) + + +### Dependencies + +* update autovalue.version to v1.7.2 ([#306](https://www.github.com/googleapis/java-bigtable/issues/306)) ([bc215c5](https://www.github.com/googleapis/java-bigtable/commit/bc215c5883b16727c28893b4a13b3387f0a04ac9)) +* update dependency com.google.api:api-common to v1.9.1 ([#316](https://www.github.com/googleapis/java-bigtable/issues/316)) ([482603a](https://www.github.com/googleapis/java-bigtable/commit/482603acd4c3db461b0e5f489a8c55213b9f3326)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.11 ([#307](https://www.github.com/googleapis/java-bigtable/issues/307)) ([50a19a6](https://www.github.com/googleapis/java-bigtable/commit/50a19a6aded1b313390ff78b52d9ffc4f4cc7fdd)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.93.5 ([#317](https://www.github.com/googleapis/java-bigtable/issues/317)) ([7f61f90](https://www.github.com/googleapis/java-bigtable/commit/7f61f903abc16554c88850061faf03e6b8beb3b9)) +* update protobuf.version to v3.12.1 ([#308](https://www.github.com/googleapis/java-bigtable/issues/308)) ([99e3a95](https://www.github.com/googleapis/java-bigtable/commit/99e3a95d456bb79841720e8ecbdcb0d47017535e)) + + +### Documentation + +* **fix:** update client documentation link ([#312](https://www.github.com/googleapis/java-bigtable/issues/312)) ([7e04c7a](https://www.github.com/googleapis/java-bigtable/commit/7e04c7a69a80d71303ce62b4320153facd3cfad8)) + +### [1.12.2](https://www.github.com/googleapis/java-bigtable/compare/v1.12.1...v1.12.2) (2020-05-11) + + +### Bug Fixes + +* set x-goog-api-client as internal header ([#293](https://www.github.com/googleapis/java-bigtable/issues/293)) ([3b58a4f](https://www.github.com/googleapis/java-bigtable/commit/3b58a4fa82e7a1e003bf119ce3b8b52b6eb52e47)) + +### [1.12.1](https://www.github.com/googleapis/java-bigtable/compare/v1.12.0...v1.12.1) (2020-05-08) + + +### Bug Fixes + +* add missing api-client header ([#290](https://www.github.com/googleapis/java-bigtable/issues/290)) ([656684b](https://www.github.com/googleapis/java-bigtable/commit/656684b7f0fff003bb582977beb828f83da9a135)) + +## [1.12.0](https://www.github.com/googleapis/java-bigtable/compare/v1.11.0...v1.12.0) (2020-05-06) + + +### Features + +* add more context to row merging errors ([#281](https://www.github.com/googleapis/java-bigtable/issues/281)) ([d88547c](https://www.github.com/googleapis/java-bigtable/commit/d88547cb55e9e2df09471df62074165266847c6d)) + + +### Bug Fixes + +* **build:** fix version update flag in samples pom.xml ([#285](https://www.github.com/googleapis/java-bigtable/issues/285)) ([6a1f970](https://www.github.com/googleapis/java-bigtable/commit/6a1f9701574fcdd41bc8300115e21ebe31b6f426)) + + +### Dependencies + +* update autovalue.version to v1.7.1 ([#278](https://www.github.com/googleapis/java-bigtable/issues/278)) ([e2f4e9e](https://www.github.com/googleapis/java-bigtable/commit/e2f4e9e84277dd242bf2fc454ab3243ff557f1ca)) +* update core dependencies ([#215](https://www.github.com/googleapis/java-bigtable/issues/215)) ([ad7aab4](https://www.github.com/googleapis/java-bigtable/commit/ad7aab435aa31541535e4e202f01a79484f007a5)) +* update core dependencies for google-cloud-core and gax ([#240](https://www.github.com/googleapis/java-bigtable/issues/240)) ([8f384f4](https://www.github.com/googleapis/java-bigtable/commit/8f384f48e984c69b10a515d15324227b40130d83)) +* update dependency com.google.api:api-common to v1.9.0 ([#231](https://www.github.com/googleapis/java-bigtable/issues/231)) ([9a0f983](https://www.github.com/googleapis/java-bigtable/commit/9a0f9838c9a96ae1108da36f79bf1a4cdf4b5749)) +* update dependency com.google.api:gax-bom to v1.55.0 ([#234](https://www.github.com/googleapis/java-bigtable/issues/234)) ([f910a32](https://www.github.com/googleapis/java-bigtable/commit/f910a32abef5b24a093c1ecef71d47811c458b41)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.10 ([#271](https://www.github.com/googleapis/java-bigtable/issues/271)) ([2bf6195](https://www.github.com/googleapis/java-bigtable/commit/2bf6195e8c215b8a6a72b66711fb24e98f3ab5a2)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.8 ([#216](https://www.github.com/googleapis/java-bigtable/issues/216)) ([423cb6b](https://www.github.com/googleapis/java-bigtable/commit/423cb6b395aa67986993f7d6c9dbd588e93faca6)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.9 ([#230](https://www.github.com/googleapis/java-bigtable/issues/230)) ([a84c689](https://www.github.com/googleapis/java-bigtable/commit/a84c689150990fe39ccc8055941ffb237cd499f5)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.93.3 ([#219](https://www.github.com/googleapis/java-bigtable/issues/219)) ([92f2755](https://www.github.com/googleapis/java-bigtable/commit/92f2755ca3b5218daa286556ce2c8b2f5b79fad6)) +* update dependency com.google.cloud.samples:shared-configuration to v1.0.15 ([#246](https://www.github.com/googleapis/java-bigtable/issues/246)) ([3348210](https://www.github.com/googleapis/java-bigtable/commit/33482104496856dc849fe9858c429266a6caf4da)) +* update dependency com.google.guava:guava-bom to v29 ([#244](https://www.github.com/googleapis/java-bigtable/issues/244)) ([0f7bd45](https://www.github.com/googleapis/java-bigtable/commit/0f7bd45bf15ebe25e2b5dd75134885e43b2604f0)) +* update dependency com.google.http-client:google-http-client-bom to v1.35.0 ([#272](https://www.github.com/googleapis/java-bigtable/issues/272)) ([af0874b](https://www.github.com/googleapis/java-bigtable/commit/af0874bcbab22366514b89d8e567cbeeed4789f8)) +* update dependency io.grpc:grpc-bom to v1.28.1 ([#236](https://www.github.com/googleapis/java-bigtable/issues/236)) ([4a72205](https://www.github.com/googleapis/java-bigtable/commit/4a72205018b39d71cfa54466fe44630c0e4202aa)) +* update dependency io.grpc:grpc-bom to v1.29.0 ([#267](https://www.github.com/googleapis/java-bigtable/issues/267)) ([2e6393b](https://www.github.com/googleapis/java-bigtable/commit/2e6393b2bf4899ab603dfc6de9128df76d4ecb2d)) +* update dependency org.threeten:threetenbp to v1.4.2 ([#225](https://www.github.com/googleapis/java-bigtable/issues/225)) ([5b94b02](https://www.github.com/googleapis/java-bigtable/commit/5b94b02ddc53c98d4a59e5457bdecc949d177c84)) +* update dependency org.threeten:threetenbp to v1.4.3 ([#237](https://www.github.com/googleapis/java-bigtable/issues/237)) ([86fab5c](https://www.github.com/googleapis/java-bigtable/commit/86fab5cb90b1ca83c494f6787ca9d10d930ca1ff)) +* update dependency org.threeten:threetenbp to v1.4.4 ([#270](https://www.github.com/googleapis/java-bigtable/issues/270)) ([6eba2af](https://www.github.com/googleapis/java-bigtable/commit/6eba2aff251fd3930a971d6270f297d449f21320)) +* update google.common-protos.version to v1.18.0 ([#279](https://www.github.com/googleapis/java-bigtable/issues/279)) ([1571dd9](https://www.github.com/googleapis/java-bigtable/commit/1571dd939c24484309b8f484f73f29e602fce27c)) +* update opencensus.version to v0.26.0 ([#223](https://www.github.com/googleapis/java-bigtable/issues/223)) ([1a00982](https://www.github.com/googleapis/java-bigtable/commit/1a00982eead27d3e3b13bc0c3942459618408e53)) + +## [1.11.0](https://www.github.com/googleapis/java-bigtable/compare/v1.10.0...v1.11.0) (2020-03-03) + + +### Features + +* add row exists api ([#190](https://www.github.com/googleapis/java-bigtable/issues/190)) ([d141c3d](https://www.github.com/googleapis/java-bigtable/commit/d141c3d597cbd682050b78bb3828fd4d8c96a7c3)) + + +### Dependencies + +* update core dependencies ([#183](https://www.github.com/googleapis/java-bigtable/issues/183)) ([674bb73](https://www.github.com/googleapis/java-bigtable/commit/674bb73fa8a37233ba8f8d336e6e4be72a91f3a0)) +* update dependency com.google.api:gax-bom to v1.54.0 ([#208](https://www.github.com/googleapis/java-bigtable/issues/208)) ([16cb625](https://www.github.com/googleapis/java-bigtable/commit/16cb62576058cb4124b98445f90b1afed012fd86)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.5 ([#180](https://www.github.com/googleapis/java-bigtable/issues/180)) ([687335b](https://www.github.com/googleapis/java-bigtable/commit/687335b97c1db121a5aa2681bbddd9c0b733d9c4)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.6 ([#207](https://www.github.com/googleapis/java-bigtable/issues/207)) ([6e803e9](https://www.github.com/googleapis/java-bigtable/commit/6e803e9ffdf70ace27d31caf3ba428a9017c1799)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.7 ([#210](https://www.github.com/googleapis/java-bigtable/issues/210)) ([9988811](https://www.github.com/googleapis/java-bigtable/commit/9988811e32eecee357c81beecab4199708b700fa)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.92.3 ([#179](https://www.github.com/googleapis/java-bigtable/issues/179)) ([7b896dd](https://www.github.com/googleapis/java-bigtable/commit/7b896dd60eb44e14d862789e9f8a15c113a235c8)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.92.5 ([279b64c](https://www.github.com/googleapis/java-bigtable/commit/279b64ca03da9e3f42e1468ea4f2b0a28f4ac939)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.93.0 ([#209](https://www.github.com/googleapis/java-bigtable/issues/209)) ([86905bf](https://www.github.com/googleapis/java-bigtable/commit/86905bfe12e7ea251c3eafafe328f87d7687bf4e)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.93.1 ([#211](https://www.github.com/googleapis/java-bigtable/issues/211)) ([a4596b5](https://www.github.com/googleapis/java-bigtable/commit/a4596b5db8d79bd86dfa33c7ae280a7227928398)) +* update dependency com.google.http-client:google-http-client-bom to v1.34.1 ([#175](https://www.github.com/googleapis/java-bigtable/issues/175)) ([c25e8aa](https://www.github.com/googleapis/java-bigtable/commit/c25e8aa509796c33af4c53ffb68d7e40e6dbc237)) +* update dependency com.google.http-client:google-http-client-bom to v1.34.2 ([#201](https://www.github.com/googleapis/java-bigtable/issues/201)) ([72c6d52](https://www.github.com/googleapis/java-bigtable/commit/72c6d527ce52d3fcc4f8340dcb2ded6035993260)) +* update dependency io.grpc:grpc-bom to v1.27.0 ([#177](https://www.github.com/googleapis/java-bigtable/issues/177)) ([c8ab8a6](https://www.github.com/googleapis/java-bigtable/commit/c8ab8a6f94d7017f0ab0c7e2d23b99ba4388afd4)) +* update dependency io.grpc:grpc-bom to v1.27.1 ([#200](https://www.github.com/googleapis/java-bigtable/issues/200)) ([c622be3](https://www.github.com/googleapis/java-bigtable/commit/c622be3fb3e2034b3834c38881015b04f01c2859)) +* update dependency io.grpc:grpc-bom to v1.27.2 ([#206](https://www.github.com/googleapis/java-bigtable/issues/206)) ([33a609a](https://www.github.com/googleapis/java-bigtable/commit/33a609a0cdc32cdcbf42b04597a476b144849bce)) +* update opencensus.version to v0.25.0 ([#198](https://www.github.com/googleapis/java-bigtable/issues/198)) ([1a36da2](https://www.github.com/googleapis/java-bigtable/commit/1a36da2c7e397650e6cac3172b9a9fcc953796ff)) +* update protobuf.version to v3.11.3 ([#187](https://www.github.com/googleapis/java-bigtable/issues/187)) ([f38e3e3](https://www.github.com/googleapis/java-bigtable/commit/f38e3e37a51121b55faf91737bbb3cee36baa23a)) +* update protobuf.version to v3.11.4 ([#202](https://www.github.com/googleapis/java-bigtable/issues/202)) ([f9b4438](https://www.github.com/googleapis/java-bigtable/commit/f9b44388cdb32af12314a00ab420278e29969d76)) + + +### Documentation + +* **regen:** update sample code to set total timeout, add API client header test ([f3be131](https://www.github.com/googleapis/java-bigtable/commit/f3be131923a86359be541b53627b15bda8ed407e)) +* readme note for gke deployment configuration ([#185](https://www.github.com/googleapis/java-bigtable/issues/185)) ([0afa13a](https://www.github.com/googleapis/java-bigtable/commit/0afa13ae8df95119acc482ec79e204abd1bc333e)) + +## [1.10.0](https://www.github.com/googleapis/java-bigtable/compare/v1.9.1...v1.10.0) (2020-01-27) + + +### Features + +* introducing bulk read API through Batcher ([#99](https://www.github.com/googleapis/java-bigtable/issues/99)) ([e87179e](https://www.github.com/googleapis/java-bigtable/commit/e87179ebe1e53b7962a940a9aba761da8047e7e4)) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v0.20.0 ([#168](https://www.github.com/googleapis/java-bigtable/issues/168)) ([8d69936](https://www.github.com/googleapis/java-bigtable/commit/8d69936e0d3cdba0085b363852e85fcb9eeb9dab)) +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.4 ([#157](https://www.github.com/googleapis/java-bigtable/issues/157)) ([abbc6c8](https://www.github.com/googleapis/java-bigtable/commit/abbc6c8c0ffbe1dcf88c14b1e70fe3150c61c582)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.92.2 ([#147](https://www.github.com/googleapis/java-bigtable/issues/147)) ([f3462b1](https://www.github.com/googleapis/java-bigtable/commit/f3462b119aa154f116e55f95e25171c482e08f8a)) +* update dependency com.google.truth:truth to v1.0.1 ([#156](https://www.github.com/googleapis/java-bigtable/issues/156)) ([f767feb](https://www.github.com/googleapis/java-bigtable/commit/f767febcd3bf913bbb2e5421fa716a13a7b4a33b)) +* update dependency org.threeten:threetenbp to v1.4.1 ([#153](https://www.github.com/googleapis/java-bigtable/issues/153)) ([f92da32](https://www.github.com/googleapis/java-bigtable/commit/f92da32e4834fe44148000f127b2962ecb94a67a)) + + +### Documentation + +* synth updates to javadoc and kokoro build configs ([d6275a7](https://www.github.com/googleapis/java-bigtable/commit/d6275a7877d98f5794ec7d400c10b2dce89167f0)) + +### [1.9.1](https://www.github.com/googleapis/java-bigtable/compare/v1.9.0...v1.9.1) (2020-01-09) + + +### Dependencies + +* upgrade gax to 1.53.0 ([#145](https://www.github.com/googleapis/java-bigtable/issues/145)) ([c3fc40d](https://www.github.com/googleapis/java-bigtable/commit/c3fc40df4358bd68cddcfc6f0a3fedb74dcdf465)) + +## [1.9.0](https://www.github.com/googleapis/java-bigtable/compare/v1.8.0...v1.9.0) (2020-01-06) + + +### Features + +* add BigtableDataClientFactory to create lightweight data clients ([#112](https://www.github.com/googleapis/java-bigtable/issues/112)) ([d6bfd30](https://www.github.com/googleapis/java-bigtable/commit/d6bfd30ea9484b7433a048bdaad66153ffaa6a79)) +* introduce google-cloud-bigtable-deps-bom ([#130](https://www.github.com/googleapis/java-bigtable/issues/130)) ([9289a13](https://www.github.com/googleapis/java-bigtable/commit/9289a13203b009930507c858ed14326768174c28)) + + +### Dependencies + +* update core dependencies to v1.92.1 ([#132](https://www.github.com/googleapis/java-bigtable/issues/132)) ([da1e6c6](https://www.github.com/googleapis/java-bigtable/commit/da1e6c61770c934644588f8a9933f6f68bd35ad1)) +* update dependency com.google.guava:guava-bom to v28.2-android ([2905528](https://www.github.com/googleapis/java-bigtable/commit/2905528eac8f39e2aa39ca5bca13c6aba33f178b)) +* update dependency io.grpc:grpc-bom to v1.26.0 ([#121](https://www.github.com/googleapis/java-bigtable/issues/121)) ([82a5094](https://www.github.com/googleapis/java-bigtable/commit/82a50943e454a3e8a23f002128d842eb98458b51)) +* update dependency junit:junit to v4.13 ([#131](https://www.github.com/googleapis/java-bigtable/issues/131)) ([d4f46fd](https://www.github.com/googleapis/java-bigtable/commit/d4f46fd7118f2037a58bae2c467ff11449ee4dfc)) + + +### Documentation + +* update README to include CI Status ([#125](https://www.github.com/googleapis/java-bigtable/issues/125)) ([1e4987b](https://www.github.com/googleapis/java-bigtable/commit/1e4987b8baaa7e0dfd3905e6acf643788d5c722c)) + +## [1.8.0](https://www.github.com/googleapis/java-bigtable/compare/v1.7.1...v1.8.0) (2019-12-17) + + +### Features + +* add implementation of ChannelPrimer to establish connection to GFE and integrate into bigtable client ([#115](https://www.github.com/googleapis/java-bigtable/issues/115)) ([276f942](https://www.github.com/googleapis/java-bigtable/commit/276f942dd2e668600347a59496525a589d7560da)) +* update filter to accept an exact timestamp for better accessibility ([#92](https://www.github.com/googleapis/java-bigtable/issues/92)) ([e25758b](https://www.github.com/googleapis/java-bigtable/commit/e25758b3164618ac16d57fffe6ba0e4175229960)) + + +### Dependencies + +* update gax.version to v1.51.0 ([#105](https://www.github.com/googleapis/java-bigtable/issues/105)) ([dcdd0c3](https://www.github.com/googleapis/java-bigtable/commit/dcdd0c347f10802be57c4f7267c2b82c59ea2278)) +* upgrade gax to 1.52.0, google-cloud-core to 1.92.0 ([#118](https://www.github.com/googleapis/java-bigtable/issues/118)) ([c106497](https://www.github.com/googleapis/java-bigtable/commit/c1064977eff3889e4f8b6ba8ab44a08f6f96ae1f)) + +### [1.7.1](https://www.github.com/googleapis/java-bigtable/compare/v1.7.0...v1.7.1) (2019-11-13) + + +### Dependencies + +* update gax.version to v1.50.1 ([#72](https://www.github.com/googleapis/java-bigtable/issues/72)) ([eb44a19](https://www.github.com/googleapis/java-bigtable/commit/eb44a19ccaed342b84dec80048802641dfd6609e)) + +## [1.7.0](https://www.github.com/googleapis/java-bigtable/compare/v1.6.0...v1.7.0) (2019-11-07) + + +### Features + +* add bom ([#50](https://www.github.com/googleapis/java-bigtable/issues/50)) ([f4dd552](https://www.github.com/googleapis/java-bigtable/commit/f4dd552ea00044babe1273e322b8a330f093b2b0)) + + +### Bug Fixes + +* align version numbers for proto and grpc versions ([#52](https://www.github.com/googleapis/java-bigtable/issues/52)) ([dbfa73a](https://www.github.com/googleapis/java-bigtable/commit/dbfa73a1a336d0afb03e7755d17786216199a851)) +* fix maven test configs to make sure admin tests don't clobber data tests ([#47](https://www.github.com/googleapis/java-bigtable/issues/47)) ([18576f5](https://www.github.com/googleapis/java-bigtable/commit/18576f55c34dbdc4c0ac79639dbc1dbf1ce7affe)) +* fix regression in batch#close silently ignoring entry failures by upgrading to gax to 1.50.0 ([#67](https://www.github.com/googleapis/java-bigtable/issues/67)) ([5aa8769](https://www.github.com/googleapis/java-bigtable/commit/5aa87697a5e8860993a14f4ac42d675c66b3d0ff)) +* handle recovery failures during stream reframing failure ([#46](https://www.github.com/googleapis/java-bigtable/issues/46)) ([a16cb88](https://www.github.com/googleapis/java-bigtable/commit/a16cb8864c0c8be26d34e71dbf261dbfc5e09bac)) +* Prevent integration tests from different profiles from trampling each other ([#69](https://www.github.com/googleapis/java-bigtable/issues/69)) ([638615a](https://www.github.com/googleapis/java-bigtable/commit/638615ae09ec2d311e82d89ea7a78137911f4eb4)) +* use proper scope for DirectPath transitive dependencies ([#59](https://www.github.com/googleapis/java-bigtable/issues/59)) ([1d1c4de](https://www.github.com/googleapis/java-bigtable/commit/1d1c4deb34a85836da2aed7b07359ff923b09835)) + + +### Documentation + +* cleanup links to java-bigtable and javadoc ([#56](https://www.github.com/googleapis/java-bigtable/issues/56)) ([846a44f](https://www.github.com/googleapis/java-bigtable/commit/846a44fbf9ebd5691a431e79a09a049aea5fd4f0)) + +## [1.6.0](https://www.github.com/googleapis/java-bigtable/compare/1.5.0...v1.6.0) (2019-10-24) + + +### Features + +* Add Experimental DirectPath support ([#8](https://www.github.com/googleapis/java-bigtable/issues/8)) ([2dd5105](https://www.github.com/googleapis/java-bigtable/commit/2dd5105559f6f61f9780b11e44bccbd2c08d68ae)) + + +### Dependencies + +* update gax.version to v1.49.1 ([a138a0f](https://www.github.com/googleapis/java-bigtable/commit/a138a0f8f42ede72d5cd30536cef4e78e5de5843)) +* upgrade threeten to 1.4 ([#33](https://www.github.com/googleapis/java-bigtable/issues/33)) ([554170b](https://www.github.com/googleapis/java-bigtable/commit/554170b929ec63155d0e840039e75b323dad1709)) diff --git a/java-bigtable/README.md b/java-bigtable/README.md new file mode 100644 index 000000000000..404aee2eeba2 --- /dev/null +++ b/java-bigtable/README.md @@ -0,0 +1,476 @@ +# Google Cloud Bigtable Client for Java + +Java idiomatic client for [Cloud Bigtable][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.69.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-bigtable + 2.67.0 + + +``` + +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.80.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.77.1' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.77.1" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Bigtable APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Bigtable API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Bigtable [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Bigtable. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-bigtable` library. See the [Quickstart](#quickstart) section +to add `google-cloud-bigtable` as a dependency in your code. + +## About Cloud Bigtable + + +[Cloud Bigtable][product-docs] API for reading and writing the contents of Bigtables associated with a cloud project. + +See the [Cloud Bigtable client library docs][javadocs] to learn how to +use this Cloud Bigtable Client Library. + + +## About Cloud Bigtable + +[Cloud Bigtable][product-docs] is Google's NoSQL Big Data database service. It's +the same database that powers many core Google services, including Search, Analytics, Maps, and +Gmail. + +Be sure to activate the Cloud Bigtable API and the Cloud Bigtable Admin API under APIs & Services in the GCP Console to use Cloud Bigtable from your project. + +See the Bigtable client library documentation ([Admin API](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/package-summary.html) and [Data API](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/package-summary.html)) to learn how to +interact with Cloud Bigtable using this Client Library. + +## Concepts + +Cloud Bigtable is composed of instances, clusters, nodes and tables. + +### Instances +Instances are containers for clusters. + +### Clusters +Clusters represent the actual Cloud Bigtable service. Each cluster belongs to a single Cloud Bigtable instance, and an instance can have up to 4 clusters. When your application +sends requests to a Cloud Bigtable instance, those requests are actually handled by one of the clusters in the instance. + +### Nodes +Each cluster in a production instance has 3 or more nodes, which are compute resources that Cloud Bigtable uses to manage your data. + +### Tables +Tables contain the actual data and are replicated across all of the clusters in an instance. + + +## Clients +The Cloud Bigtable API consists of: + +### Data API +Allows callers to persist and query data in a table. It's exposed by [BigtableDataClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/BigtableDataClient.html). + +### Admin API +Allows callers to create and manage instances, clusters, tables, and access permissions. This API is exposed by: [BigtableInstanceAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.html) for Instance and Cluster level resources. + +See [BigtableTableAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.html) for table management. + +See [BigtableDataClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/BigtableDataClient.html) for the data client. + +See [BigtableInstanceAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.html) for the instance admin client. + +See [BigtableTableAdminClient](https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.html) for the table admin client. + +#### Calling Cloud Bigtable + +The Cloud Bigtable API is split into 3 parts: Data API, Instance Admin API and Table Admin API. + +Here is a code snippet showing simple usage of the Data API. Add the following imports +at the top of your file: + +```java +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; + +``` + +Then, to make a query to Bigtable, use the following code: +```java +// Instantiates a client +String projectId = "my-project"; +String instanceId = "my-instance"; +String tableId = "my-table"; + +// Create the client. +// Please note that creating the client is a very expensive operation +// and should only be done once and shared in an application. +BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId); + +try { + // Query a table + Query query = Query.create(tableId) + .range("a", "z") + .limit(26); + + for (Row row : dataClient.readRows(query)) { + System.out.println(row.getKey()); + } +} finally { + dataClient.close(); +} +``` + +The Admin APIs are similar. Here is a code snippet showing how to create a table. Add the following +imports at the top of your file: + +```java +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Table; +``` + +Then, to create a table, use the following code: +```java +String projectId = "my-instance"; +String instanceId = "my-database"; + +BigtableTableAdminClient tableAdminClient = BigtableTableAdminClient + .create(projectId, instanceId); + +try { + tableAdminClient.createTable( + CreateTableRequest.of("my-table") + .addFamily("my-family") + ); +} finally { + tableAdminClient.close(); +} +``` + +TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). + +## Client side metrics + +Cloud Bigtable client supports publishing client side metrics to +[Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the +`bigtable.googleapis.com/client` namespace. + +This feature is available once you upgrade to version 2.16.0 and above. +Follow the guide on https://cloud.google.com/bigtable/docs/client-side-metrics-setup to enable. + +Since version 2.38.0, [client side metrics](https://cloud.google.com/bigtable/docs/client-side-metrics) +is enabled by default. This feature collects useful telemetry data in the client and is recommended to +use in conjunction with server-side metrics to get a complete, actionable view of your Bigtable +performance. There is no additional cost to publish and view client-side metrics +in Cloud Monitoring. + +### Opt-out client side metrics + +You can opt-out client side metrics with the following settings: + +```java +BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); +``` + +### Use a custom OpenTelemetry instance + +If your application already has OpenTelemetry integration, you can register client side metrics on +your OpenTelemetry instance. You can refer to +[CustomOpenTelemetryMetricsProvider](https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java) +on how to set it up. + +### Disable Bigtbale traces + +If your application already has tracing integration and you want to disable Bigtable +traces, you can do the following: + +```java +public static class MySampler extends Sampler { + + private final Sampler childSampler; + + MySampler(Sampler child) { + this.childSampler = child; + } + + @Override + public boolean shouldSample(@Nullable SpanContext parentContext, + @Nullable Boolean hasRemoteParent, + TraceId traceId, + SpanId spanId, + String name, + List parentLinks) { + if (name.contains("Bigtable")) { + return false; + } + return childSampler.shouldSample(parentContext, hasRemoteParent, traceId, spanId, name, parentLinks); + } + + @Override + public String getDescription() { + return "from my sampler"; + } +} +``` + +And use this sampler in your trace config: +```java +Tracing.getTraceConfig().updateActiveTraceParams( + Tracing.getTraceConfig().getActiveTraceParams().toBuilder() + .setSampler(new MySampler(Samplers.probabilitySampler(0.1))) + .build() +); +``` + +## Version Conflicts + +google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought +in by other libraries, for example Apache Beam. This happens because internal dependencies +between gRPC libraries are pinned to an exact version of grpc-core +(see [here](https://github.com/grpc/grpc-java/commit/90db93b990305aa5a8428cf391b55498c7993b6e)). +If both google-cloud-bigtable and the other library bring in two gRPC libraries that depend +on the different versions of grpc-core, then dependency resolution will fail. +The easiest way to fix this is to depend on the gRPC bom, which will force all the gRPC +transitive libraries to use the same version. + +Add the following to your project's pom.xml. + +``` + + + + io.grpc + grpc-bom + 1.28.0 + pom + import + + + +``` + +## Container Deployment + +While deploying this client in [Google Kubernetes Engine(GKE)](https://cloud.google.com/kubernetes-engine) with [CoS](https://cloud.google.com/container-optimized-os/docs/). Please make sure to provide CPU configuration in your deployment file. With default configuration JVM detects only 1 CPU, which affects the number of channels with the client, resulting in performance repercussion. + +Also, The number of `grpc-nio-worker-ELG-1-#` thread is same as number of CPUs. These are managed by a single `grpc-default-executor-#` thread, which is shared among multiple client instances. + +For example: +```yaml +appVersion: v1 +... +spec: + ... + container: + resources: + requests: + cpu: "1" # Here 1 represents 100% of single node CPUs whereas other than 1 represents the number of CPU it would use from a node. +``` +see [Assign CPU Resources to Containers](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#specify-a-cpu-request-and-a-cpu-limit) for more information. + + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-java/tree/main/samples) directory. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Authorized View Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java) | +| Configure Connection Pool | [source code](https://github.com/googleapis/google-cloud-java/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/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java) | +| Filters | [source code](https://github.com/googleapis/google-cloud-java/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/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Filters.java) | +| Hello World | [source code](https://github.com/googleapis/google-cloud-java/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/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java) | +| Instance Admin Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java) | +| Key Salting | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/KeySalting.java) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Quickstart.java) | +| Reads | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/Reads.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Reads.java) | +| Schema Bundle Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java) | +| Table Admin Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java) | +| Write Aggregate | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java) | +| Write Batch | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java) | +| Write Conditionally | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java) | +| Write Increment | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java) | +| Write Simple | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java) | +| Batch Delete Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java) | +| Conditional Delete Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java) | +| Delete Column Family Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java) | +| Delete From Column Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java) | +| Delete From Column Family Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java) | +| Delete From Row Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java) | +| Delete Table Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java) | +| Drop Row Range Example | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java) | + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Bigtable uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/bigtable +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history +[stability-image]: https://img.shields.io/badge/stability-stable-green +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.77.1 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigtable.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-bigtable/google-cloud-bigtable-bom/pom.xml b/java-bigtable/google-cloud-bigtable-bom/pom.xml new file mode 100644 index 000000000000..f1eea72995bc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-bom/pom.xml @@ -0,0 +1,121 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.86.0 + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud Bigtable BOM + https://github.com/googleapis/google-cloud-java + + BOM for Google Cloud Bigtable + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + igorberstein + Igor Bernstein + igorbernstein@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/google-cloud-java.git + scm:git:git@github.com:googleapis/google-cloud-java.git + https://github.com/googleapis/google-cloud-java + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-bigtable + 2.77.2-SNAPSHOT + + + com.google.cloud + google-cloud-bigtable-emulator + 0.214.2-SNAPSHOT + + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.214.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + org.apache.maven.plugins + maven-site-plugin + + + false + + + + + diff --git a/java-bigtable/google-cloud-bigtable-deps-bom/README.md b/java-bigtable/google-cloud-bigtable-deps-bom/README.md new file mode 100644 index 000000000000..6889c82d1537 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-deps-bom/README.md @@ -0,0 +1,44 @@ +# Dependency BOM for Google Cloud Bigtable Client + +This module contains a BOM that lists all of Cloud Bigtable's dependency versions. Please note that +this BOM is complementary to google-cloud-bigtable-bom. This BOM only contains transitive dependencies, +while google-cloud-bigtable-bom contains versions for direct google-cloud-bigtable artifacts. + +This BOM is primarily intended to be used by java-bigtable-hbase to keep the dependencies in sync. + +Example usage: + +[//]: # ({x-version-update-start:google-cloud-bigtable:released}) +```xml + + + + + com.google.cloud + google-cloud-bigtable-bom + 1.8.0 + pom + import + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 1.8.0 + pom + import + + + + + + + + com.google.cloud + google-cloud-bigtable + + + +``` +[//]: # ({x-version-update-end}) diff --git a/java-bigtable/google-cloud-bigtable-deps-bom/pom.xml b/java-bigtable/google-cloud-bigtable-deps-bom/pom.xml new file mode 100644 index 000000000000..0467b637181e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-deps-bom/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + + com.google.cloud + google-cloud-pom-parent + 1.86.0 + ../../google-cloud-pom-parent/pom.xml + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + + pom + Google Cloud Bigtable Dependency BOM + + A BOM that describes all of the dependencies used by google-cloud-bigtable. It's + mainly intended to be used by java-bigtable-hbase to align dependencies + + + + Google LLC + + + + + igorberstein + Igor Bernstein + igorbernstein@google.com + Google LLC + + Developer + + + + kolea2 + Kristen O'Leary + kaoleary@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/google-cloud-java.git + scm:git:git@github.com:googleapis/google-cloud-java.git + https://github.com/googleapis/google-cloud-java + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-monitoring-bom + 3.93.0 + pom + import + + + com.google.cloud + google-cloud-shared-dependencies + 3.62.0 + pom + import + + + io.opencensus + opencensus-contrib-resource-util + 0.31.1 + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + org.apache.maven.plugins + maven-site-plugin + + + false + + + + + diff --git a/java-bigtable/google-cloud-bigtable-emulator-core/pom.xml b/java-bigtable/google-cloud-bigtable-emulator-core/pom.xml new file mode 100644 index 000000000000..dfc32ede2e1a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator-core/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + + google-cloud-bigtable-parent + com.google.cloud + 2.77.2-SNAPSHOT + + Google Cloud Java - Bigtable Emulator Core + + google-cloud-bigtable-emulator-core + 0.214.2-SNAPSHOT + + + A Java wrapper for the Cloud Bigtable emulator. + + + https://github.com/googleapis/java-bigtable + + scm:git:git@github.com:googleapis/java-bigtable.git + scm:git:git@github.com:googleapis/java-bigtable.git + https://github.com/googleapis/java-bigtable + HEAD + + + + igorberstein + Igor Bernstein + igorbernstein@google.com + Google + + Developer + + + + + + 8 + 8 + + + + + + + com.google.cloud + google-cloud-gcloud-maven-plugin + 0.1.5 + + + + gen-sources + generate-resources + + download + + + + bigtable-darwin-arm + bigtable-darwin-x86_64 + bigtable-linux-arm + bigtable-linux-x86 + bigtable-linux-x86_64 + bigtable-windows-x86 + bigtable-windows-x86_64 + + + + + + + + diff --git a/java-bigtable/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java b/java-bigtable/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java new file mode 100644 index 000000000000..c1d55c4dd821 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java @@ -0,0 +1,283 @@ +/* + * 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.google.cloud.bigtable.emulator.core; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.UnknownHostException; +import java.nio.file.Path; +import java.util.Locale; +import java.util.Optional; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Wraps the Bigtable emulator in a java api. + * + *

This class will use the golang binaries embedded in this jar to launch the emulator as an + * external process and redirect its output to a {@link Logger}. + */ +public class EmulatorController { + private static final Logger LOGGER = Logger.getLogger(EmulatorController.class.getName()); + + private final Path executable; + private Process process; + private Thread stdoutThread; + private Thread stderrThread; + private boolean isStopped = true; + private Thread shutdownHook; + + private int port; + + public static EmulatorController createFromPath(Path path) { + return new EmulatorController(path); + } + + /** + * Create a new instance of emulator. The emulator will use the bundled binaries in this jar. + * Please note that the emulator is created in a stopped state, please use {@link #start()} after + * creating it. + */ + public static EmulatorController createBundled() throws IOException { + String resourcePath = getBundledResourcePath(); + + File tmpEmulator = File.createTempFile("cbtemulator", ""); + tmpEmulator.deleteOnExit(); + + try (InputStream is = EmulatorController.class.getResourceAsStream(resourcePath); + FileOutputStream os = new FileOutputStream(tmpEmulator)) { + + if (is == null) { + throw new FileNotFoundException( + "Failed to find the bundled emulator binary: " + resourcePath); + } + + byte[] buff = new byte[2048]; + int length; + + while ((length = is.read(buff)) != -1) { + os.write(buff, 0, length); + } + } + tmpEmulator.setExecutable(true); + + return new EmulatorController(tmpEmulator.toPath()); + } + + private EmulatorController(Path executable) { + this.executable = executable; + } + + public synchronized boolean isRunning() { + return !isStopped; + } + + /** Starts the emulator process and waits for it to be ready. */ + public synchronized void start(int port) + throws IOException, TimeoutException, InterruptedException { + if (!isStopped) { + throw new IllegalStateException("Emulator is already started"); + } + + this.port = port; + + // Try to align the localhost address across java & golang emulator + // This should fix issues on systems that default to ipv4 but the jvm is started with + // -Djava.net.preferIPv6Addresses=true + Optional localhostAddress = Optional.empty(); + try { + localhostAddress = Optional.of(InetAddress.getByName(null).getHostAddress()); + } catch (UnknownHostException e) { + } + + // Workaround https://bugs.openjdk.java.net/browse/JDK-8068370 + for (int attemptsLeft = 3; process == null; attemptsLeft--) { + try { + String cmd = executable.toString(); + if (localhostAddress.isPresent()) { + cmd += String.format(" -host [%s]", localhostAddress.get()); + } + cmd += String.format(" -port %d", port); + process = Runtime.getRuntime().exec(cmd); + } catch (IOException e) { + if (attemptsLeft > 0) { + Thread.sleep(1000); + continue; + } + throw e; + } + } + stdoutThread = pipeStreamToLog(process.getInputStream(), Level.INFO); + stderrThread = pipeStreamToLog(process.getErrorStream(), Level.WARNING); + isStopped = false; + + shutdownHook = + new Thread( + () -> { + synchronized (EmulatorController.this) { + if (!isStopped) { + isStopped = true; + } + } + process.destroy(); + }); + + Runtime.getRuntime().addShutdownHook(shutdownHook); + + waitForPort(port); + } + + /** Starts the emulator process and waits for it to be ready. */ + public synchronized void start() throws IOException, TimeoutException, InterruptedException { + start(getAvailablePort()); + } + + /** Stops the emulator process. */ + public synchronized void stop() { + if (isStopped) { + throw new IllegalStateException("Emulator already stopped"); + } + + try { + Runtime.getRuntime().removeShutdownHook(shutdownHook); + shutdownHook = null; + } finally { + isStopped = true; + process.destroy(); + + try { + process.waitFor(); + if (stdoutThread != null) { + stdoutThread.join(); + } + if (stderrThread != null) { + stderrThread.join(); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOGGER.log(Level.WARNING, "Interrupted while waiting for emulator to stop", e); + } finally { + stdoutThread = null; + stderrThread = null; + process = null; + } + } + } + + public synchronized int getPort() { + if (isStopped) { + throw new IllegalStateException("Emulator is not running"); + } + return port; + } + + // + + /** Gets the current platform, which will be used to select the appropriate emulator binary. */ + private static String getBundledResourcePath() { + String unformattedOs = System.getProperty("os.name", "unknown").toLowerCase(Locale.ENGLISH); + String os; + String suffix = ""; + + if (unformattedOs.contains("mac") || unformattedOs.contains("darwin")) { + os = "darwin"; + } else if (unformattedOs.contains("win")) { + os = "windows"; + suffix = ".exe"; + } else if (unformattedOs.contains("linux")) { + os = "linux"; + } else { + throw new UnsupportedOperationException( + "Emulator is not supported on your platform: " + unformattedOs); + } + + String unformattedArch = System.getProperty("os.arch"); + String arch; + + switch (unformattedArch) { + case "x86": + arch = "x86"; + break; + case "x86_64": + case "amd64": + arch = "x86_64"; + break; + case "aarch64": + arch = "arm"; + break; + default: + throw new UnsupportedOperationException("Unsupported architecture: " + unformattedArch); + } + + return String.format( + "/gcloud/bigtable-%s-%s/platform/bigtable-emulator/cbtemulator%s", os, arch, suffix); + } + + /** Gets a random open port number. */ + private static int getAvailablePort() { + try (ServerSocket serverSocket = new ServerSocket(0)) { + return serverSocket.getLocalPort(); + } catch (IOException e) { + throw new RuntimeException("Failed to find open port"); + } + } + + /** Waits for a port to open. It's used to wait for the emulator's gRPC server to be ready. */ + private static void waitForPort(int port) throws InterruptedException, TimeoutException { + for (int i = 0; i < 100; i++) { + try (Socket ignored = new Socket("localhost", port)) { + return; + } catch (IOException e) { + Thread.sleep(200); + } + } + + throw new TimeoutException("Timed out waiting for server to start"); + } + + /** Creates a thread that will pipe an {@link InputStream} to this class' Logger. */ + private static Thread pipeStreamToLog(final InputStream stream, final Level level) { + final BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); + + Thread thread = + new Thread( + () -> { + try { + String line; + while ((line = reader.readLine()) != null) { + LOGGER.log(level, line); + } + } catch (IOException e) { + if (!"Stream closed".equals(e.getMessage())) { + LOGGER.log(Level.WARNING, "Failed to read process stream", e); + } + } + }); + thread.setDaemon(true); + thread.start(); + return thread; + } + // +} diff --git a/java-bigtable/google-cloud-bigtable-emulator/README.md b/java-bigtable/google-cloud-bigtable-emulator/README.md new file mode 100644 index 000000000000..74596ccfd154 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/README.md @@ -0,0 +1,117 @@ +# Google Cloud Java Emulator for Bigtable + +A Java wrapper for the [Cloud Bigtable][cloud-bigtable] emulator. This +wrapper bundles the native Bigtable emulator and exposes a simple Java +interface to ease writing tests. Please note that this wrapper is under +heavy development and APIs may change in the future. + +## Quickstart + +If you are using Maven, add this to your pom.xml file +```xml + + + + com.google.cloud + google-cloud-bom + + 0.116.0-alpha + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable + + + + com.google.cloud + google-cloud-bigtable-emulator + test + + + + junit + junit + 4.12 + test + + +``` + + +## Getting Started + +Here is a code snippet showing a simple JUnit test. Add the following imports +at the top of your file: + +```java +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.emulator.v2.BigtableEmulatorRule; +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +``` + +Then, to make a query to Bigtable, use the following code: +```java +@RunWith(JUnit4.class) +public class ExampleTest { + // Initialize the emulator Rule + @Rule + public final BigtableEmulatorRule bigtableEmulator = BigtableEmulatorRule.create(); + + // Clients that will be connected to the emulator + private BigtableTableAdminClient tableAdminClient; + private BigtableDataClient dataClient; + + @Before + public void setUp() throws IOException { + // Initialize the clients to connect to the emulator + BigtableTableAdminSettings.Builder tableAdminSettings = BigtableTableAdminSettings.newBuilderForEmulator(bigtableEmulator.getPort()); + tableAdminClient = BigtableTableAdminClient.create(tableAdminSettings.build()); + + BigtableDataSettings.Builder dataSettings = BigtableDataSettings.newBuilderForEmulator(bigtableEmulator.getPort()); + dataClient = BigtableDataClient.create(dataSettings.build()); + + // Create a test table that can be used in tests + tableAdminClient.createTable( + CreateTableRequest.of("fake-table") + .addFamily("cf") + ); + } + + @Test + public void testWriteRead() throws ExecutionException, InterruptedException { + ApiFuture mutateFuture = dataClient.mutateRowAsync( + RowMutation.create("fake-table", "fake-key") + .setCell("cf", "col", "value") + ); + + mutateFuture.get(); + + ApiFuture rowFuture = dataClient.readRowAsync("fake-table", "fake-key"); + + Assert.assertEquals("value", rowFuture.get().getCells().get(0).getValue().toStringUtf8()); + } +} +``` diff --git a/java-bigtable/google-cloud-bigtable-emulator/pom.xml b/java-bigtable/google-cloud-bigtable-emulator/pom.xml new file mode 100644 index 000000000000..b7f747f5eab5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/pom.xml @@ -0,0 +1,177 @@ + + + 4.0.0 + + google-cloud-bigtable-emulator + 0.214.2-SNAPSHOT + Google Cloud Java - Bigtable Emulator + https://github.com/googleapis/java-bigtable + + A Java wrapper for the Cloud Bigtable emulator. + + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + scm:git:git@github.com:googleapis/java-bigtable.git + scm:git:git@github.com:googleapis/java-bigtable.git + https://github.com/googleapis/java-bigtable + HEAD + + + + + igorberstein + Igor Bernstein + igorbernstein@google.com + Google + + Developer + + + + + + + + + com.google.cloud + google-cloud-gcloud-maven-plugin + 0.1.5 + + + + gen-sources + generate-resources + + download + + + + bigtable-darwin-arm + bigtable-darwin-x86_64 + bigtable-linux-arm + bigtable-linux-x86 + bigtable-linux-x86_64 + bigtable-windows-x86 + bigtable-windows-x86_64 + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + com.google.api:gax-grpc + + + + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.214.2-SNAPSHOT + + + + com.google.api + api-common + + + + com.google.guava + guava + + + io.grpc + grpc-api + + + + com.google.api + gax-grpc + + + + junit + junit + + compile + true + + + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + test + + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + test + + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + test + + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + test + + + + com.google.protobuf + protobuf-java + test + + + + com.google.truth + truth + test + + + + + org.checkerframework + checker-qual + + + + + diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRule.java b/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRule.java new file mode 100644 index 000000000000..12be2a65a356 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRule.java @@ -0,0 +1,87 @@ +/* + * Copyright 2018 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.cloud.bigtable.emulator.v2; + +import com.google.api.core.BetaApi; +import io.grpc.ManagedChannel; +import org.junit.rules.ExternalResource; + +/** + * The BigtableEmulatorRule manages the lifecycle of the Bigtable {@link Emulator}. Before the start + * of a test, the emulator will be started on a random port and will be shutdown after the test + * finishes. + * + *

Example usage: {@code + * {@literal @RunWith(JUnit4.class)} + * public class MyTest { + * {@literal @Rule} + * public final BigtableEmulatorRule bigtableEmulator = BigtableEmulatorRule.create(); + * + * {@literal @Test} + * public void testUsingEmulator() { + * ManagedChannel adminChannel = bigtableEmulator.getAdminChannel(); + * // Do something with channel + * } + * } + * } + */ +@BetaApi("Surface for Bigtable emulator is not yet stable") +public class BigtableEmulatorRule extends ExternalResource { + private Emulator emulator; + + public static BigtableEmulatorRule create() { + return new BigtableEmulatorRule(); + } + + private BigtableEmulatorRule() {} + + /** Initializes the Bigtable emulator before a test runs. */ + @Override + protected void before() throws Throwable { + emulator = Emulator.createBundled(); + emulator.start(); + } + + /** Stops the Bigtable emulator after a test finishes. */ + @Override + protected void after() { + emulator.stop(); + emulator = null; + } + + /** + * Gets a {@link ManagedChannel} connected to the Emulator. The channel is configured for data + * operations. + */ + public ManagedChannel getDataChannel() { + return emulator.getDataChannel(); + } + + /** + * Gets a {@link ManagedChannel} connected to the Emulator. This channel should be used for admin + * operations. + */ + public ManagedChannel getAdminChannel() { + return emulator.getAdminChannel(); + } + + /** + * Gets the port of the emulator, allowing the caller to create their own {@link ManagedChannel}. + */ + public int getPort() { + return emulator.getPort(); + } +} diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java b/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java new file mode 100644 index 000000000000..32f028f1f020 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java @@ -0,0 +1,135 @@ +/* + * Copyright 2018 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.cloud.bigtable.emulator.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigtable.emulator.core.EmulatorController; +import com.google.common.base.Preconditions; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Logger; + +/** + * Wraps the Bigtable emulator in a java api and decorates it with grpc channel builders. + * + *

This class will use the golang binaries embedded in this jar to launch the emulator as an + * external process and redirect its output to a {@link Logger}. + */ +@BetaApi("Surface for Bigtable emulator is not yet stable") +public class Emulator { + private static final Logger LOGGER = Logger.getLogger(Emulator.class.getName()); + + private final EmulatorController controller; + private ManagedChannel dataChannel; + private ManagedChannel adminChannel; + + public static Emulator createFromPath(Path path) { + return new Emulator(EmulatorController.createFromPath(path)); + } + + /** + * Create a new instance of emulator. The emulator will use the bundled binaries in this jar. + * Please note that the emulator is created in a stopped state, please use {@link #start()} after + * creating it. + */ + public static Emulator createBundled() throws IOException { + return new Emulator(EmulatorController.createBundled()); + } + + private Emulator(EmulatorController controller) { + this.controller = controller; + } + + /** Starts the emulator process and waits for it to be ready. */ + public synchronized void start() throws IOException, TimeoutException, InterruptedException { + controller.start(); + } + + public synchronized void start(int port) + throws IOException, TimeoutException, InterruptedException { + controller.start(port); + } + + /** Stops the emulator process. */ + public synchronized void stop() { + controller.stop(); + + try { + // Shutdown channels in parallel + if (dataChannel != null) { + dataChannel.shutdownNow(); + } + if (adminChannel != null) { + adminChannel.shutdownNow(); + } + + // Then wait for actual shutdown + if (dataChannel != null) { + dataChannel.awaitTermination(1, TimeUnit.MINUTES); + dataChannel = null; + } + if (adminChannel != null) { + adminChannel.awaitTermination(1, TimeUnit.MINUTES); + adminChannel = null; + } + } catch (InterruptedException e) { + LOGGER.warning("Interrupted while waiting for client channels to close"); + Thread.currentThread().interrupt(); + } + } + + public synchronized int getPort() { + return controller.getPort(); + } + + public synchronized ManagedChannel getDataChannel() { + Preconditions.checkState(controller.isRunning(), "Emulator is not running"); + + if (dataChannel == null) { + dataChannel = + newChannelBuilder(controller.getPort()) + .maxInboundMessageSize(256 * 1024 * 1024) + .keepAliveTimeout(10, TimeUnit.SECONDS) + .keepAliveTime(10, TimeUnit.SECONDS) + .keepAliveWithoutCalls(true) + .build(); + } + return dataChannel; + } + + public synchronized ManagedChannel getAdminChannel() { + Preconditions.checkState(controller.isRunning(), "Emulator is not running"); + + if (adminChannel == null) { + adminChannel = newChannelBuilder(controller.getPort()).build(); + } + return adminChannel; + } + + // + + /** Creates a {@link io.grpc.ManagedChannelBuilder} preconfigured for the emulator's port. */ + private static ManagedChannelBuilder newChannelBuilder(int port) { + // NOTE: usePlaintext is currently @ExperimentalAPI. + // See https://github.com/grpc/grpc-java/issues/1772 for discussion + return ManagedChannelBuilder.forAddress("localhost", port).usePlaintext(); + } + // +} diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/resource-config.json b/java-bigtable/google-cloud-bigtable-emulator/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/resource-config.json new file mode 100644 index 000000000000..aa986d630d0f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/resource-config.json @@ -0,0 +1,21 @@ +{ + "resources":{ + "includes":[ + { + "pattern":"\\Qgcloud/bigtable-linux-x86_64/platform/bigtable-emulator/cbtemulator\\E" + }, + { + "pattern":"\\Qgcloud/bigtable-darwin-x86_64/platform/bigtable-emulator/cbtemulator\\E" + }, + { + "pattern":"\\Qgcloud/bigtable-linux-x86/platform/bigtable-emulator/cbtemulator\\E" + }, + { + "pattern": "\\Qgcloud/bigtable-windows-x86_64/platform/bigtable-emulator/cbtemulator.exe\\E" + }, + { + "pattern":"\\Qgcloud/bigtable-linux-arm/platform/bigtable-emulator/cbtemulator\\E" + } + ]}, + "bundles":[] +} \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/EmulatorTest.java b/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/EmulatorTest.java new file mode 100644 index 000000000000..b37c3273cf3b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/EmulatorTest.java @@ -0,0 +1,107 @@ +/* + * Copyright 2018 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.cloud.bigtable.emulator.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.BigtableTableAdminGrpc; +import com.google.bigtable.admin.v2.BigtableTableAdminGrpc.BigtableTableAdminBlockingStub; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.Mutation.SetCell; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.protobuf.ByteString; +import java.util.Iterator; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class EmulatorTest { + + private Emulator emulator; + private BigtableTableAdminBlockingStub tableAdminStub; + private BigtableBlockingStub dataStub; + + @Before + public void setUp() throws Exception { + emulator = Emulator.createBundled(); + emulator.start(); + tableAdminStub = BigtableTableAdminGrpc.newBlockingStub(emulator.getAdminChannel()); + dataStub = BigtableGrpc.newBlockingStub(emulator.getDataChannel()); + } + + @After + public void tearDown() { + emulator.stop(); + emulator = null; + } + + @Test + public void testTableAdminClient() { + Table table = + tableAdminStub.createTable( + CreateTableRequest.newBuilder() + .setParent("projects/fake-project/instances/fake-instance") + .setTableId("fake-table") + .setTable( + Table.newBuilder().putColumnFamilies("cf", ColumnFamily.getDefaultInstance())) + .build()); + + assertThat(table.getName()) + .isEqualTo("projects/fake-project/instances/fake-instance/tables/fake-table"); + } + + @Test + public void testDataClient() { + tableAdminStub.createTable( + CreateTableRequest.newBuilder() + .setParent("projects/fake-project/instances/fake-instance") + .setTableId("fake-table") + .setTable(Table.newBuilder().putColumnFamilies("cf", ColumnFamily.getDefaultInstance())) + .build()); + + dataStub.mutateRow( + MutateRowRequest.newBuilder() + .setTableName("projects/fake-project/instances/fake-instance/tables/fake-table") + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addMutations( + Mutation.newBuilder() + .setSetCell( + SetCell.newBuilder() + .setFamilyName("cf") + .setColumnQualifier(ByteString.EMPTY) + .setValue(ByteString.copyFromUtf8("value")))) + .build()); + + Iterator results = + dataStub.readRows( + ReadRowsRequest.newBuilder() + .setTableName("projects/fake-project/instances/fake-instance/tables/fake-table") + .build()); + + ReadRowsResponse row = results.next(); + assertThat(row.getChunks(0).getValue()).isEqualTo(ByteString.copyFromUtf8("value")); + } +} diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java b/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java new file mode 100644 index 000000000000..00e2969f809a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 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.cloud.bigtable.emulator.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.BigtableTableAdminGrpc; +import com.google.bigtable.admin.v2.BigtableTableAdminGrpc.BigtableTableAdminBlockingStub; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.Mutation.SetCell; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.protobuf.ByteString; +import java.util.Iterator; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ITBigtableEmulatorRuleTest { + @Rule public BigtableEmulatorRule bigtableRule = BigtableEmulatorRule.create(); + private BigtableTableAdminBlockingStub tableAdminStub; + private BigtableBlockingStub dataStub; + + @Before + public void setUp() { + tableAdminStub = BigtableTableAdminGrpc.newBlockingStub(bigtableRule.getAdminChannel()); + dataStub = BigtableGrpc.newBlockingStub(bigtableRule.getDataChannel()); + } + + @Test + public void testTableAdminClient() { + Table table = + tableAdminStub.createTable( + CreateTableRequest.newBuilder() + .setParent("projects/fake-project/instances/fake-instance") + .setTableId("fake-table") + .setTable( + Table.newBuilder().putColumnFamilies("cf", ColumnFamily.getDefaultInstance())) + .build()); + + assertThat(table.getName()) + .isEqualTo("projects/fake-project/instances/fake-instance/tables/fake-table"); + } + + @Test + public void testDataClient() throws Exception { + tableAdminStub.createTable( + CreateTableRequest.newBuilder() + .setParent("projects/fake-project/instances/fake-instance") + .setTableId("fake-table") + .setTable(Table.newBuilder().putColumnFamilies("cf", ColumnFamily.getDefaultInstance())) + .build()); + + dataStub.mutateRow( + MutateRowRequest.newBuilder() + .setTableName("projects/fake-project/instances/fake-instance/tables/fake-table") + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addMutations( + Mutation.newBuilder() + .setSetCell( + SetCell.newBuilder() + .setFamilyName("cf") + .setColumnQualifier(ByteString.EMPTY) + .setValue(ByteString.copyFromUtf8("value")))) + .build()); + + Iterator results = + dataStub.readRows( + ReadRowsRequest.newBuilder() + .setTableName("projects/fake-project/instances/fake-instance/tables/fake-table") + .build()); + + ReadRowsResponse row = results.next(); + assertThat(row.getChunks(0).getValue()).isEqualTo(ByteString.copyFromUtf8("value")); + } +} diff --git a/java-bigtable/google-cloud-bigtable-emulator/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/native-image.properties b/java-bigtable/google-cloud-bigtable-emulator/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/native-image.properties new file mode 100644 index 000000000000..0c5258dc2c10 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable-emulator/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/native-image.properties @@ -0,0 +1,3 @@ +Args=--initialize-at-build-time=org.junit.runners.model.FrameworkField \ +--initialize-at-build-time=org.junit.runner.RunWith \ +--initialize-at-build-time=java.lang.annotation.Annotation diff --git a/java-bigtable/google-cloud-bigtable/EnableAutoValue.txt b/java-bigtable/google-cloud-bigtable/EnableAutoValue.txt new file mode 100644 index 000000000000..e940c28979d0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/EnableAutoValue.txt @@ -0,0 +1,2 @@ +This is a marker file to trigger auto-value injection into the annotation processor path +https://github.com/googleapis/java-shared-config/blob/51c9f68ff1736761b21c921f078ab2c8675ff268/pom.xml#L758 diff --git a/java-bigtable/google-cloud-bigtable/clirr-ignored-differences.xml b/java-bigtable/google-cloud-bigtable/clirr-ignored-differences.xml new file mode 100644 index 000000000000..383f60a7c115 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/clirr-ignored-differences.xml @@ -0,0 +1,514 @@ + + + + + 7005 + com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient* + *snapshot* + *snapshot* + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/MeasuredMutateRowsCallable* + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/MeasuredReadRowsCallable* + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/MeasuredUnaryCallable* + + + 8001 + com/google/cloud/bigtable/gaxx/tracing/WrappedTracerFactory* + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/readrows/PointReadTimeoutCallable + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub + * + + + + 7005 + com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub + * + * + + + + 7002 + com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub + * + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerFactory + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer$Builder + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable + * + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable + + + 5001 + com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver + com/google/api/gax/rpc/StateCheckingResponseObserver + + + + 7006 + com/google/cloud/bigtable/data/v2/models/Heartbeat + *getEstimatedLowWatermark* + org.threeten.bp.Instant + + + + 7006 + com/google/cloud/bigtable/data/v2/models/CloseStream + *getStatus* + com.google.cloud.bigtable.common.Status + + + + 7013 + com/google/cloud/bigtable/data/v2/models/CloseStream + *getNewPartitions* + + + + 7006 + com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation + *getCommitTimestamp* + org.threeten.bp.Instant + + + + 7006 + com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation + *getEstimatedLowWatermark* + org.threeten.bp.Instant + + + + 7005 + com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter$ChangeStreamRecordBuilder + * + * + + + + 7005 + com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery + * + * + + + + 7005 + com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor + * + * + + + + 7002 + com/google/cloud/bigtable/data/v2/internal/RowSetUtil + * + + + 7004 + com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger + * + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerBatchedUnaryCallable + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory + * + + + + 6001 + com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable + * + + + + 7004 + com/google/cloud/bigtable/data/v2/models/MutateRowsException + * + + + + 7009 + com/google/cloud/bigtable/data/v2/models/MutateRowsException + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker + * + + + 7012 + com/google/cloud/bigtable/data/v2/models/MutationApi + * + + + + 7012 + com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter$ChangeStreamRecordBuilder + * + + + + 2000 + com/google/cloud/bigtable/admin/v2/models/Type + + + 2000 + com/google/cloud/bigtable/admin/v2/models/Type$SumAggregateInput + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$SumAggregateInput + com/google/cloud/bigtable/admin/v2/models/Type + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$Aggregate + com/google/cloud/bigtable/admin/v2/models/Type + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$Bytes + com/google/cloud/bigtable/admin/v2/models/Type + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$Int64 + com/google/cloud/bigtable/admin/v2/models/Type + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$Int64 + com/google/cloud/bigtable/admin/v2/models/Type$SumAggregateInput + + + 5001 + com/google/cloud/bigtable/admin/v2/models/Type$Raw + com/google/cloud/bigtable/admin/v2/models/Type + + + 7004 + com/google/cloud/bigtable/admin/v2/models/Type$Int64$Encoding$BigEndianBytes + * + + + 7002 + com/google/cloud/bigtable/admin/v2/models/Type$Int64$Encoding$BigEndianBytes + * + + + + 7004 + com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub + * + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter + * + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider + * + + + + 7006 + com/google/cloud/bigtable/data/v2/internal/* + *getTimestamp(*) + java.time.Instant + + + + 7013 + com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation + *get*Time() + + + + 7013 + com/google/cloud/bigtable/data/v2/models/Heartbeat + *getEstimatedLowWatermarkTime() + + + + 7012 + com/google/cloud/bigtable/data/v2/models/TargetId + *scopedForMaterializedView() + + + + 7009 + com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter + * + + + + 7005 + com/google/cloud/bigtable/data/v2/BigtableDataClient + *executeQuery* + * + + + + 8001 + com/google/cloud/bigtable/data/v2/models/sql/Statement + * + + + + 8001 + com/google/cloud/bigtable/data/v2/models/sql/Statement$Builder + * + + + + 8001 + com/google/cloud/bigtable/data/v2/models/sql/Statement$Builder + * + + + + 7012 + com/google/cloud/bigtable/data/v2/models/sql/StructReader + *getProtoMessage(*) + + + + 7012 + com/google/cloud/bigtable/data/v2/models/sql/StructReader + *getProtoEnum(*) + + + + 7012 + com/google/cloud/bigtable/data/v2/models/sql/SqlType + *protoOf(*) + + + 7004 + com/google/cloud/bigtable/common/Type$SchemalessProto + * + + + 7004 + com/google/cloud/bigtable/common/Type$SchemalessEnum + * + + + 7013 + com/google/cloud/bigtable/common/Type$SchemalessProto + * + + + 7013 + com/google/cloud/bigtable/common/Type$SchemalessEnum + * + + + + 7012 + com/google/cloud/bigtable/data/v2/models/sql/SqlType + *enumOf(*) + + + + 7012 + com/google/cloud/bigtable/data/v2/models/sql/SqlType + *getUnqualifiedName* + + + + 7004 + com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext + *ExecuteQueryCallContext* + + + + 7009 + com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext + *ExecuteQueryCallContext* + + + + 7005 + com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext + *create* + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable + *ExecuteQueryCallable* + * + + + + 7005 + com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable + *call* + * + + + + 8001 + com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallable + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger + * + * + + + + 7004 + com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool + *create* + * + + + + 7004 + com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider + *create* + * + + + 4001 + com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer + com/google/api/gax/grpc/ChannelPrimer + + + 4001 + com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer + com/google/api/gax/grpc/ChannelPrimer + + + 7005 + com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool + *create* + * + + + + 7005 + com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider + *create* + * + + + + 7006 + com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer + *sendPrimeRequestsAsync* + com.google.api.core.ApiFuture + + + + 7013 + com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings + com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings$LoadBalancingStrategy getLoadBalancingStrategy() + + + + 7013 + com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings$Builder + com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings$Builder setLoadBalancingStrategy(com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings$LoadBalancingStrategy) + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings$InternalMetricsProvider + * + + + + 7004 + com/google/cloud/bigtable/data/v2/stub/metrics/Util + * + + diff --git a/java-bigtable/google-cloud-bigtable/pom.xml b/java-bigtable/google-cloud-bigtable/pom.xml new file mode 100644 index 000000000000..ca56187dc472 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/pom.xml @@ -0,0 +1,848 @@ + + + 4.0.0 + google-cloud-bigtable + 2.77.2-SNAPSHOT + jar + Google Cloud Bigtable + https://github.com/googleapis/java-bigtable + + Java idiomatic client for Google Cloud Bigtable. + + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + + 2.77.2-SNAPSHOT + + google-cloud-bigtable + + + false + ${skipTests} + ${skipTests} + + src/test/resources/logging.properties + + + + + + + + + + + batch-bigtable.googleapis.com:443 + + + 1.76.3 + 4.33.2 + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + + + com.google.api + api-common + + + com.google.api + gax-grpc + + + com.google.api + gax + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.auth + google-auth-library-credentials + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.auto.value + auto-value-annotations + + + com.google.cloud + google-cloud-core + + + com.google.code.findbugs + jsr305 + + + com.google.guava + guava + + + com.google.protobuf + protobuf-java + + + com.google.protobuf + protobuf-java-util + + + io.opencensus + opencensus-api + + + io.grpc + grpc-alts + + + org.checkerframework + checker-qual + + + + com.google.http-client + google-http-client + runtime + + + com.google.http-client + google-http-client-gson + runtime + + + io.grpc + grpc-stub + + + io.grpc + grpc-api + + + io.grpc + grpc-auth + + + io.grpc + grpc-util + + + io.grpc + grpc-core + + + io.grpc + grpc-googleapis + runtime + + + io.grpc + grpc-rls + runtime + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-opentelemetry + + + + + io.opentelemetry + opentelemetry-api + + + + + org.threeten + threetenbp + + + + + io.opentelemetry + opentelemetry-api + + + io.opentelemetry + opentelemetry-context + + + io.opentelemetry + opentelemetry-sdk + + + io.opentelemetry + opentelemetry-sdk-metrics + + + io.opentelemetry + opentelemetry-sdk-common + + + com.google.cloud.opentelemetry + detector-resources-support + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + com.google.cloud + google-cloud-monitoring + + + com.google.api.grpc + proto-google-cloud-monitoring-v3 + + + + + com.google.cloud.opentelemetry + exporter-metrics + + + + + com.google.api.grpc + grpc-google-cloud-monitoring-v3 + test + + + com.google.api + gax + testlib + test + + + + com.google.api + gax-grpc + testlib + test + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + test + + + com.google.cloud + google-cloud-bigtable-emulator + test + + + com.google.cloud + google-cloud-conformance-tests + test + + + + * + * + + + + + com.google.truth + truth + test + + + com.google.truth.extensions + truth-proto-extension + test + + + io.grpc + grpc-testing + test + + + io.opencensus + opencensus-impl + test + + + junit + junit + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + com.google.guava + guava-testlib + test + + + + + + enable-enforcer-rules + + + + !performRelease + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.2 + + + + enforce-valid-profile + + + + + + + enforce + + + + + + + org.codehaus.mojo + extra-enforcer-rules + 1.8.0 + + + org.apache.maven.shared + maven-dependency-tree + 3.3.0 + + + + + + + + error-prone + + + [17,) + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + true + + + -XDcompilePolicy=simple + --should-stop=ifError=FLOW + -Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:MissingSummary:OFF -Xep:InlineMeSuggester:OFF -Xep:AutoValueImmutableFields:OFF -Xep:ObjectEqualsForPrimitives:OFF -Xep:JavaDurationGetSecondsToToSeconds:OFF + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.errorprone + error_prone_core + ${error-prone.version} + + + + + + + + + + enable-verbose-grpc-logs + + true + src/test/resources/logging-verbose.properties + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + 1 + none + true + + + + + + + bigtable-emulator-it + + true + + + + + + maven-failsafe-plugin + + + emulator-it + + integration-test + verify + + + false + + + emulator + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/emulator-it + + + com.google.cloud.bigtable.**.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-emulator-it.xml + ${project.build.directory}/failsafe-reports/emulator-it + + + + + + + + + + bigtable-prod-it + + + + maven-failsafe-plugin + + + prod-it + + integration-test + verify + + + false + + + cloud + ${bigtable.cfe-data-endpoint} + ${bigtable.cfe-admin-endpoint} + ${bigtable.cfe-jwt-audience} + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/prod-it + + + com.google.cloud.bigtable.**.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-prod-it.xml + ${project.build.directory}/failsafe-reports/prod-it + + + + + + + + + + + internal-bigtable-prod-batch-it-prop-helper + + + bigtable.cfe-data-endpoint + + + + batch-${bigtable.cfe-data-endpoint} + + + + + bigtable-prod-batch-it + + + + maven-failsafe-plugin + + + prod-batch-it + + integration-test + verify + + + false + + + cloud + ${bigtable.cfe-data-batch-endpoint} + ${bigtable.cfe-admin-endpoint} + ${bigtable.cfe-jwt-audience} + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/prod-batch-it + + + com.google.cloud.bigtable.data.v2.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-prod-batch-it.xml + ${project.build.directory}/failsafe-reports/prod-batch-it + + + + + + + + + + bigtable-directpath-it + + + + maven-failsafe-plugin + + + directpath-it + + integration-test + verify + + + false + + cloud + ${bigtable.directpath-data-endpoint} + ${bigtable.directpath-admin-endpoint} + ${bigtable.directpath-jwt-audience} + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/directpath-it + REQUIRE_DIRECT_PATH + + + true + + + + com.google.cloud.bigtable.data.v2.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-directpath-it.xml + ${project.build.directory}/failsafe-reports/directpath-it + + + + + + + + + + bigtable-cfe-it + + + + maven-failsafe-plugin + + + cfe-it + + integration-test + verify + + + false + + + cloud + ${bigtable.cfe-data-endpoint} + ${bigtable.cfe-admin-endpoint} + ${bigtable.cfe-jwt-audience} + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/cfe-it + REQUIRE_CFE + + + com.google.cloud.bigtable.**.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-cfe-it.xml + ${project.build.directory}/failsafe-reports/cfe-it + + + + + + + + + + + bigtable-directpath-ipv4only-it + + + + maven-failsafe-plugin + + + directpath-it + + integration-test + verify + + + false + + + cloud + ${bigtable.directpath-data-endpoint} + ${bigtable.directpath-admin-endpoint} + ${bigtable.directpath-jwt-audience} + ${bigtable.enable-grpc-logs} + ${project.build.directory}/test-grpc-logs/directpath-ipv4only-it + REQUIRE_DIRECT_PATH_IPV4 + + + true + + + + com.google.cloud.bigtable.data.v2.it.*IT + + ${project.build.directory}/failsafe-reports/failsafe-summary-directpath-ipv4only-it.xml + ${project.build.directory}/failsafe-reports/directpath-ipv4only-it + + + + + + + + + + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + + + test-compile + test-compile-custom + + + + + + com.google.protobuf:protoc:${test-protoc.version}:exe:${os.detected.classifier} + + grpc-java + + io.grpc:protoc-gen-grpc-java:${test-protoc-grpc.version}:exe:${os.detected.classifier} + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/java/ + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + io.opencensus:opencensus-impl-core + + + + + + maven-failsafe-plugin + + + true + + + + 4 + false + + + false + + ${java-log-config} + + + + + + maven-surefire-plugin + + + + ${skipUnitTests} + + + classes + 10 + + false + + + src/test/resources/logging.properties + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java new file mode 100644 index 000000000000..80c9eec1b45a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -0,0 +1,25 @@ +/* + * 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.cloud.bigtable; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +public final class Version { + // {x-version-update-start:google-cloud-bigtable:current} + public static String VERSION = "2.77.2-SNAPSHOT"; + // {x-version-update-end} +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java new file mode 100644 index 000000000000..b23c08d2655f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -0,0 +1,5594 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.AppProfileName; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.ClusterName; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterMetadata; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewMetadata; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.HotTablet; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.LogicalViewName; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.MaterializedViewName; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.ProjectName; +import com.google.bigtable.admin.v2.UpdateAppProfileMetadata; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStub; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for creating, configuring, and deleting Cloud Bigtable Instances and + * Clusters. Provides access to the Instance and Cluster schemas only, not the tables' metadata or + * data stored in those tables. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ *     BaseBigtableInstanceAdminClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ *   Instance response = baseBigtableInstanceAdminClient.getInstance(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the BaseBigtableInstanceAdminClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateInstance

Create an instance within a project. + *

Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createInstanceAsync(CreateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createInstanceAsync(ProjectName parent, String instanceId, Instance instance, Map<String, Cluster> clusters) + *

  • createInstanceAsync(String parent, String instanceId, Instance instance, Map<String, Cluster> clusters) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createInstanceOperationCallable() + *

  • createInstanceCallable() + *

+ *

GetInstance

Gets information about an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getInstance(GetInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getInstance(InstanceName name) + *

  • getInstance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getInstanceCallable() + *

+ *

ListInstances

Lists information about instances in a project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listInstances(ListInstancesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listInstances(ProjectName parent) + *

  • listInstances(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listInstancesCallable() + *

+ *

UpdateInstance

Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateInstance(Instance request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateInstanceCallable() + *

+ *

PartialUpdateInstance

Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • partialUpdateInstanceAsync(PartialUpdateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • partialUpdateInstanceAsync(Instance instance, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • partialUpdateInstanceOperationCallable() + *

  • partialUpdateInstanceCallable() + *

+ *

DeleteInstance

Delete an instance from a project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteInstance(DeleteInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteInstance(InstanceName name) + *

  • deleteInstance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteInstanceCallable() + *

+ *

CreateCluster

Creates a cluster within an instance. + *

Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createClusterAsync(CreateClusterRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createClusterAsync(InstanceName parent, String clusterId, Cluster cluster) + *

  • createClusterAsync(String parent, String clusterId, Cluster cluster) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createClusterOperationCallable() + *

  • createClusterCallable() + *

+ *

GetCluster

Gets information about a cluster.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getCluster(GetClusterRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getCluster(ClusterName name) + *

  • getCluster(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getClusterCallable() + *

+ *

ListClusters

Lists information about clusters in an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listClusters(ListClustersRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listClusters(InstanceName parent) + *

  • listClusters(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listClustersCallable() + *

+ *

UpdateCluster

Updates a cluster within an instance. + *

Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateClusterAsync(Cluster request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateClusterOperationCallable() + *

  • updateClusterCallable() + *

+ *

PartialUpdateCluster

Partially updates a cluster within a project. This method is the preferred way to update a Cluster. + *

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. + *

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • partialUpdateClusterAsync(PartialUpdateClusterRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • partialUpdateClusterAsync(Cluster cluster, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • partialUpdateClusterOperationCallable() + *

  • partialUpdateClusterCallable() + *

+ *

DeleteCluster

Deletes a cluster from an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteCluster(DeleteClusterRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteCluster(ClusterName name) + *

  • deleteCluster(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteClusterCallable() + *

+ *

CreateAppProfile

Creates an app profile within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createAppProfile(CreateAppProfileRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createAppProfile(InstanceName parent, String appProfileId, AppProfile appProfile) + *

  • createAppProfile(String parent, String appProfileId, AppProfile appProfile) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createAppProfileCallable() + *

+ *

GetAppProfile

Gets information about an app profile.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getAppProfile(GetAppProfileRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getAppProfile(AppProfileName name) + *

  • getAppProfile(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getAppProfileCallable() + *

+ *

ListAppProfiles

Lists information about app profiles in an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listAppProfiles(ListAppProfilesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listAppProfiles(InstanceName parent) + *

  • listAppProfiles(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listAppProfilesPagedCallable() + *

  • listAppProfilesCallable() + *

+ *

UpdateAppProfile

Updates an app profile within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateAppProfileAsync(UpdateAppProfileRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateAppProfileAsync(AppProfile appProfile, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateAppProfileOperationCallable() + *

  • updateAppProfileCallable() + *

+ *

DeleteAppProfile

Deletes an app profile from an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteAppProfile(DeleteAppProfileRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteAppProfile(AppProfileName name) + *

  • deleteAppProfile(String name) + *

  • deleteAppProfile(AppProfileName name, boolean ignoreWarnings) + *

  • deleteAppProfile(String name, boolean ignoreWarnings) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteAppProfileCallable() + *

+ *

GetIamPolicy

Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getIamPolicy(ResourceName resource) + *

  • getIamPolicy(String resource) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

SetIamPolicy

Sets the access control policy on an instance resource. Replaces any existing policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • setIamPolicy(ResourceName resource, Policy policy) + *

  • setIamPolicy(String resource, Policy policy) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that the caller has on the specified instance resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • testIamPermissions(ResourceName resource, List<String> permissions) + *

  • testIamPermissions(String resource, List<String> permissions) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *

ListHotTablets

Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listHotTablets(ListHotTabletsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listHotTablets(ClusterName parent) + *

  • listHotTablets(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listHotTabletsPagedCallable() + *

  • listHotTabletsCallable() + *

+ *

CreateLogicalView

Creates a logical view within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createLogicalViewAsync(CreateLogicalViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createLogicalViewAsync(InstanceName parent, LogicalView logicalView, String logicalViewId) + *

  • createLogicalViewAsync(String parent, LogicalView logicalView, String logicalViewId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createLogicalViewOperationCallable() + *

  • createLogicalViewCallable() + *

+ *

GetLogicalView

Gets information about a logical view.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLogicalView(GetLogicalViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getLogicalView(LogicalViewName name) + *

  • getLogicalView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLogicalViewCallable() + *

+ *

ListLogicalViews

Lists information about logical views in an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLogicalViews(ListLogicalViewsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listLogicalViews(InstanceName parent) + *

  • listLogicalViews(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLogicalViewsPagedCallable() + *

  • listLogicalViewsCallable() + *

+ *

UpdateLogicalView

Updates a logical view within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateLogicalViewAsync(UpdateLogicalViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateLogicalViewAsync(LogicalView logicalView, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateLogicalViewOperationCallable() + *

  • updateLogicalViewCallable() + *

+ *

DeleteLogicalView

Deletes a logical view from an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteLogicalView(DeleteLogicalViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteLogicalView(LogicalViewName name) + *

  • deleteLogicalView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteLogicalViewCallable() + *

+ *

CreateMaterializedView

Creates a materialized view within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createMaterializedViewAsync(CreateMaterializedViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createMaterializedViewAsync(InstanceName parent, MaterializedView materializedView, String materializedViewId) + *

  • createMaterializedViewAsync(String parent, MaterializedView materializedView, String materializedViewId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createMaterializedViewOperationCallable() + *

  • createMaterializedViewCallable() + *

+ *

GetMaterializedView

Gets information about a materialized view.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getMaterializedView(GetMaterializedViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getMaterializedView(MaterializedViewName name) + *

  • getMaterializedView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getMaterializedViewCallable() + *

+ *

ListMaterializedViews

Lists information about materialized views in an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listMaterializedViews(ListMaterializedViewsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listMaterializedViews(InstanceName parent) + *

  • listMaterializedViews(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listMaterializedViewsPagedCallable() + *

  • listMaterializedViewsCallable() + *

+ *

UpdateMaterializedView

Updates a materialized view within an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateMaterializedViewAsync(UpdateMaterializedViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateMaterializedViewAsync(MaterializedView materializedView, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateMaterializedViewOperationCallable() + *

  • updateMaterializedViewCallable() + *

+ *

DeleteMaterializedView

Deletes a materialized view from an instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteMaterializedView(DeleteMaterializedViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteMaterializedView(MaterializedViewName name) + *

  • deleteMaterializedView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteMaterializedViewCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * BaseBigtableInstanceAdminSettings to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings =
+ *     BaseBigtableInstanceAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ *     BaseBigtableInstanceAdminClient.create(baseBigtableInstanceAdminSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings =
+ *     BaseBigtableInstanceAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ *     BaseBigtableInstanceAdminClient.create(baseBigtableInstanceAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class BaseBigtableInstanceAdminClient implements BackgroundResource { + private final BaseBigtableInstanceAdminSettings settings; + private final BigtableInstanceAdminStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of BaseBigtableInstanceAdminClient with default settings. */ + protected static BaseBigtableInstanceAdminClient create() throws IOException { + return create(BaseBigtableInstanceAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BaseBigtableInstanceAdminClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + protected static BaseBigtableInstanceAdminClient create( + BaseBigtableInstanceAdminSettings settings) throws IOException { + return new BaseBigtableInstanceAdminClient(settings); + } + + /** + * Constructs an instance of BaseBigtableInstanceAdminClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(BaseBigtableInstanceAdminSettings). + */ + protected static BaseBigtableInstanceAdminClient create(BigtableInstanceAdminStub stub) { + return new BaseBigtableInstanceAdminClient(stub); + } + + /** + * Constructs an instance of BaseBigtableInstanceAdminClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected BaseBigtableInstanceAdminClient(BaseBigtableInstanceAdminSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((BigtableInstanceAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected BaseBigtableInstanceAdminClient(BigtableInstanceAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final BaseBigtableInstanceAdminSettings getSettings() { + return settings; + } + + public BigtableInstanceAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an instance within a project. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String instanceId = "instanceId902024336";
+   *   Instance instance = Instance.newBuilder().build();
+   *   Map clusters = new HashMap<>();
+   *   Instance response =
+   *       baseBigtableInstanceAdminClient
+   *           .createInstanceAsync(parent, instanceId, instance, clusters)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the project in which to create the new instance. + * Values are of the form `projects/{project}`. + * @param instanceId Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than `projects/myproject/instances/myinstance`. + * @param instance Required. The instance to create. Fields marked `OutputOnly` must be left + * blank. + * @param clusters Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. Fields marked `OutputOnly` + * must be left blank. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + ProjectName parent, String instanceId, Instance instance, Map clusters) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstanceId(instanceId) + .setInstance(instance) + .putAllClusters(clusters) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an instance within a project. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String instanceId = "instanceId902024336";
+   *   Instance instance = Instance.newBuilder().build();
+   *   Map clusters = new HashMap<>();
+   *   Instance response =
+   *       baseBigtableInstanceAdminClient
+   *           .createInstanceAsync(parent, instanceId, instance, clusters)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the project in which to create the new instance. + * Values are of the form `projects/{project}`. + * @param instanceId Required. The ID to be used when referring to the new instance within its + * project, e.g., just `myinstance` rather than `projects/myproject/instances/myinstance`. + * @param instance Required. The instance to create. Fields marked `OutputOnly` must be left + * blank. + * @param clusters Required. The clusters to be created within the instance, mapped by desired + * cluster ID, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. Fields marked `OutputOnly` + * must be left blank. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, String instanceId, Instance instance, Map clusters) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstanceId(instanceId) + .setInstance(instance) + .putAllClusters(clusters) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an instance within a project. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .putAllClusters(new HashMap())
+   *           .build();
+   *   Instance response = baseBigtableInstanceAdminClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an instance within a project. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .putAllClusters(new HashMap())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create an instance within a project. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .putAllClusters(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   Instance response = baseBigtableInstanceAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   Instance response = baseBigtableInstanceAdminClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested instance. Values are of the form + * `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .build();
+   *   Instance response = baseBigtableInstanceAdminClient.getInstance(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about instances in a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(parent);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesResponse listInstances(ProjectName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about instances in a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(parent);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the project for which a list of instances is + * requested. Values are of the form `projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about instances in a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ListInstancesResponse response = baseBigtableInstanceAdminClient.listInstances(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesResponse listInstances(ListInstancesRequest request) { + return listInstancesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about instances in a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listInstancesCallable().futureCall(request);
+   *   // Do something.
+   *   ListInstancesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an instance within a project. This method updates only the display name and type for an + * Instance. To update other Instance properties, such as labels, use PartialUpdateInstance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Instance request =
+   *       Instance.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setDisplayName("displayName1714148973")
+   *           .putAllLabels(new HashMap())
+   *           .setCreateTime(Timestamp.newBuilder().build())
+   *           .setSatisfiesPzs(true)
+   *           .setSatisfiesPzi(true)
+   *           .putAllTags(new HashMap())
+   *           .build();
+   *   Instance response = baseBigtableInstanceAdminClient.updateInstance(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance updateInstance(Instance request) { + return updateInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an instance within a project. This method updates only the display name and type for an + * Instance. To update other Instance properties, such as labels, use PartialUpdateInstance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Instance request =
+   *       Instance.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setDisplayName("displayName1714148973")
+   *           .putAllLabels(new HashMap())
+   *           .setCreateTime(Timestamp.newBuilder().build())
+   *           .setSatisfiesPzs(true)
+   *           .setSatisfiesPzi(true)
+   *           .putAllTags(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.updateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates an instance within a project. This method can modify all fields of an + * Instance and is the preferred way to update an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response =
+   *       baseBigtableInstanceAdminClient.partialUpdateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The Instance which will (partially) replace the current value. + * @param updateMask Required. The subset of Instance fields which should be replaced. Must be + * explicitly set. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture partialUpdateInstanceAsync( + Instance instance, FieldMask updateMask) { + PartialUpdateInstanceRequest request = + PartialUpdateInstanceRequest.newBuilder() + .setInstance(instance) + .setUpdateMask(updateMask) + .build(); + return partialUpdateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates an instance within a project. This method can modify all fields of an + * Instance and is the preferred way to update an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateInstanceRequest request =
+   *       PartialUpdateInstanceRequest.newBuilder()
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Instance response = baseBigtableInstanceAdminClient.partialUpdateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture partialUpdateInstanceAsync( + PartialUpdateInstanceRequest request) { + return partialUpdateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates an instance within a project. This method can modify all fields of an + * Instance and is the preferred way to update an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateInstanceRequest request =
+   *       PartialUpdateInstanceRequest.newBuilder()
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient
+   *           .partialUpdateInstanceOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + partialUpdateInstanceOperationCallable() { + return stub.partialUpdateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates an instance within a project. This method can modify all fields of an + * Instance and is the preferred way to update an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateInstanceRequest request =
+   *       PartialUpdateInstanceRequest.newBuilder()
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.partialUpdateInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + partialUpdateInstanceCallable() { + return stub.partialUpdateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an instance from a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   baseBigtableInstanceAdminClient.deleteInstance(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the instance to be deleted. Values are of the form + * `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteInstance(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an instance from a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   baseBigtableInstanceAdminClient.deleteInstance(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the instance to be deleted. Values are of the form + * `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteInstance(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + deleteInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an instance from a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .build();
+   *   baseBigtableInstanceAdminClient.deleteInstance(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteInstance(DeleteInstanceRequest request) { + deleteInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete an instance from a project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster within an instance. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String clusterId = "clusterId561939637";
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   Cluster response =
+   *       baseBigtableInstanceAdminClient.createClusterAsync(parent, clusterId, cluster).get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the new cluster. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param clusterId Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * @param cluster Required. The cluster to be created. Fields marked `OutputOnly` must be left + * blank. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + InstanceName parent, String clusterId, Cluster cluster) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setClusterId(clusterId) + .setCluster(cluster) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster within an instance. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   Cluster response =
+   *       baseBigtableInstanceAdminClient.createClusterAsync(parent, clusterId, cluster).get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the new cluster. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param clusterId Required. The ID to be used when referring to the new cluster within its + * instance, e.g., just `mycluster` rather than + * `projects/myproject/instances/myinstance/clusters/mycluster`. + * @param cluster Required. The cluster to be created. Fields marked `OutputOnly` must be left + * blank. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + String parent, String clusterId, Cluster cluster) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent) + .setClusterId(clusterId) + .setCluster(cluster) + .build(); + return createClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster within an instance. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .build();
+   *   Cluster response = baseBigtableInstanceAdminClient.createClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClusterAsync( + CreateClusterRequest request) { + return createClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster within an instance. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a cluster within an instance. + * + *

Note that exactly one of Cluster.serve_nodes and + * Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to + * non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is + * non-empty, then autoscaling is enabled. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   Cluster response = baseBigtableInstanceAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(ClusterName name) { + GetClusterRequest request = + GetClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   Cluster response = baseBigtableInstanceAdminClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(String name) { + GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build(); + return getCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = baseBigtableInstanceAdminClient.getCluster(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Cluster getCluster(GetClusterRequest request) { + return getClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about clusters in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(parent);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form `projects/{project}/instances/{instance}`. Use + * `{instance} = '-'` to list Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersResponse listClusters(InstanceName parent) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about clusters in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(parent);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which a list of clusters is + * requested. Values are of the form `projects/{project}/instances/{instance}`. Use + * `{instance} = '-'` to list Clusters for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersResponse listClusters(String parent) { + ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); + return listClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about clusters in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ListClustersResponse response = baseBigtableInstanceAdminClient.listClusters(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClustersResponse listClusters(ListClustersRequest request) { + return listClustersCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about clusters in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listClustersCallable().futureCall(request);
+   *   // Do something.
+   *   ListClustersResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listClustersCallable() { + return stub.listClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a cluster within an instance. + * + *

Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. + * In order to update it, you must use PartialUpdateCluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Cluster request =
+   *       Cluster.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServeNodes(-1288838783)
+   *           .setDefaultStorageType(StorageType.forNumber(0))
+   *           .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build())
+   *           .build();
+   *   Cluster response = baseBigtableInstanceAdminClient.updateClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClusterAsync(Cluster request) { + return updateClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a cluster within an instance. + * + *

Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. + * In order to update it, you must use PartialUpdateCluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Cluster request =
+   *       Cluster.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServeNodes(-1288838783)
+   *           .setDefaultStorageType(StorageType.forNumber(0))
+   *           .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a cluster within an instance. + * + *

Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. + * In order to update it, you must use PartialUpdateCluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Cluster request =
+   *       Cluster.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServeNodes(-1288838783)
+   *           .setDefaultStorageType(StorageType.forNumber(0))
+   *           .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a cluster within a project. This method is the preferred way to update a + * Cluster. + * + *

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When + * autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to + * it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and + * cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the + * update_mask. + * + *

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set + * a serve_node count via the update_mask. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response =
+   *       baseBigtableInstanceAdminClient.partialUpdateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. The Cluster which contains the partial updates to be applied, subject + * to the update_mask. + * @param updateMask Required. The subset of Cluster fields which should be replaced. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture partialUpdateClusterAsync( + Cluster cluster, FieldMask updateMask) { + PartialUpdateClusterRequest request = + PartialUpdateClusterRequest.newBuilder() + .setCluster(cluster) + .setUpdateMask(updateMask) + .build(); + return partialUpdateClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a cluster within a project. This method is the preferred way to update a + * Cluster. + * + *

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When + * autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to + * it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and + * cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the + * update_mask. + * + *

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set + * a serve_node count via the update_mask. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateClusterRequest request =
+   *       PartialUpdateClusterRequest.newBuilder()
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Cluster response = baseBigtableInstanceAdminClient.partialUpdateClusterAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture partialUpdateClusterAsync( + PartialUpdateClusterRequest request) { + return partialUpdateClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a cluster within a project. This method is the preferred way to update a + * Cluster. + * + *

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When + * autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to + * it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and + * cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the + * update_mask. + * + *

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set + * a serve_node count via the update_mask. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateClusterRequest request =
+   *       PartialUpdateClusterRequest.newBuilder()
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient
+   *           .partialUpdateClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + partialUpdateClusterOperationCallable() { + return stub.partialUpdateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Partially updates a cluster within a project. This method is the preferred way to update a + * Cluster. + * + *

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When + * autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to + * it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and + * cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the + * update_mask. + * + *

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set + * a serve_node count via the update_mask. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   PartialUpdateClusterRequest request =
+   *       PartialUpdateClusterRequest.newBuilder()
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.partialUpdateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + partialUpdateClusterCallable() { + return stub.partialUpdateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a cluster from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   baseBigtableInstanceAdminClient.deleteCluster(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the cluster to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCluster(ClusterName name) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a cluster from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   baseBigtableInstanceAdminClient.deleteCluster(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the cluster to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCluster(String name) { + DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); + deleteCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a cluster from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .build();
+   *   baseBigtableInstanceAdminClient.deleteCluster(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCluster(DeleteClusterRequest request) { + deleteClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a cluster from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String appProfileId = "appProfileId704923523";
+   *   AppProfile appProfile = AppProfile.newBuilder().build();
+   *   AppProfile response =
+   *       baseBigtableInstanceAdminClient.createAppProfile(parent, appProfileId, appProfile);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the new app profile. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param appProfileId Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * @param appProfile Required. The app profile to be created. Fields marked `OutputOnly` will be + * ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile createAppProfile( + InstanceName parent, String appProfileId, AppProfile appProfile) { + CreateAppProfileRequest request = + CreateAppProfileRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAppProfileId(appProfileId) + .setAppProfile(appProfile) + .build(); + return createAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   String appProfileId = "appProfileId704923523";
+   *   AppProfile appProfile = AppProfile.newBuilder().build();
+   *   AppProfile response =
+   *       baseBigtableInstanceAdminClient.createAppProfile(parent, appProfileId, appProfile);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the new app profile. + * Values are of the form `projects/{project}/instances/{instance}`. + * @param appProfileId Required. The ID to be used when referring to the new app profile within + * its instance, e.g., just `myprofile` rather than + * `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * @param appProfile Required. The app profile to be created. Fields marked `OutputOnly` will be + * ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile createAppProfile( + String parent, String appProfileId, AppProfile appProfile) { + CreateAppProfileRequest request = + CreateAppProfileRequest.newBuilder() + .setParent(parent) + .setAppProfileId(appProfileId) + .setAppProfile(appProfile) + .build(); + return createAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateAppProfileRequest request =
+   *       CreateAppProfileRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setAppProfileId("appProfileId704923523")
+   *           .setAppProfile(AppProfile.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   AppProfile response = baseBigtableInstanceAdminClient.createAppProfile(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile createAppProfile(CreateAppProfileRequest request) { + return createAppProfileCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateAppProfileRequest request =
+   *       CreateAppProfileRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setAppProfileId("appProfileId704923523")
+   *           .setAppProfile(AppProfile.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.createAppProfileCallable().futureCall(request);
+   *   // Do something.
+   *   AppProfile response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAppProfileCallable() { + return stub.createAppProfileCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an app profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile getAppProfile(AppProfileName name) { + GetAppProfileRequest request = + GetAppProfileRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an app profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested app profile. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile getAppProfile(String name) { + GetAppProfileRequest request = GetAppProfileRequest.newBuilder().setName(name).build(); + return getAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an app profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetAppProfileRequest request =
+   *       GetAppProfileRequest.newBuilder()
+   *           .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .build();
+   *   AppProfile response = baseBigtableInstanceAdminClient.getAppProfile(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppProfile getAppProfile(GetAppProfileRequest request) { + return getAppProfileCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about an app profile. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetAppProfileRequest request =
+   *       GetAppProfileRequest.newBuilder()
+   *           .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getAppProfileCallable().futureCall(request);
+   *   // Do something.
+   *   AppProfile response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAppProfileCallable() { + return stub.getAppProfileCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about app profiles in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (AppProfile element :
+   *       baseBigtableInstanceAdminClient.listAppProfiles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which a list of app profiles is + * requested. Values are of the form `projects/{project}/instances/{instance}`. Use + * `{instance} = '-'` to list AppProfiles for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppProfilesPagedResponse listAppProfiles(InstanceName parent) { + ListAppProfilesRequest request = + ListAppProfilesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAppProfiles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about app profiles in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   for (AppProfile element :
+   *       baseBigtableInstanceAdminClient.listAppProfiles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which a list of app profiles is + * requested. Values are of the form `projects/{project}/instances/{instance}`. Use + * `{instance} = '-'` to list AppProfiles for all Instances in a project, e.g., + * `projects/myproject/instances/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppProfilesPagedResponse listAppProfiles(String parent) { + ListAppProfilesRequest request = ListAppProfilesRequest.newBuilder().setParent(parent).build(); + return listAppProfiles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about app profiles in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListAppProfilesRequest request =
+   *       ListAppProfilesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AppProfile element :
+   *       baseBigtableInstanceAdminClient.listAppProfiles(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest request) { + return listAppProfilesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about app profiles in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListAppProfilesRequest request =
+   *       ListAppProfilesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listAppProfilesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AppProfile element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppProfilesPagedCallable() { + return stub.listAppProfilesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about app profiles in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListAppProfilesRequest request =
+   *       ListAppProfilesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAppProfilesResponse response =
+   *         baseBigtableInstanceAdminClient.listAppProfilesCallable().call(request);
+   *     for (AppProfile element : response.getAppProfilesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppProfilesCallable() { + return stub.listAppProfilesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   AppProfile appProfile = AppProfile.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AppProfile response =
+   *       baseBigtableInstanceAdminClient.updateAppProfileAsync(appProfile, updateMask).get();
+   * }
+   * }
+ * + * @param appProfile Required. The app profile which will (partially) replace the current value. + * @param updateMask Required. The subset of app profile fields which should be replaced. If + * unset, all fields will be replaced. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateAppProfileAsync( + AppProfile appProfile, FieldMask updateMask) { + UpdateAppProfileRequest request = + UpdateAppProfileRequest.newBuilder() + .setAppProfile(appProfile) + .setUpdateMask(updateMask) + .build(); + return updateAppProfileAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateAppProfileRequest request =
+   *       UpdateAppProfileRequest.newBuilder()
+   *           .setAppProfile(AppProfile.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   AppProfile response = baseBigtableInstanceAdminClient.updateAppProfileAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateAppProfileAsync( + UpdateAppProfileRequest request) { + return updateAppProfileOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateAppProfileRequest request =
+   *       UpdateAppProfileRequest.newBuilder()
+   *           .setAppProfile(AppProfile.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.updateAppProfileOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AppProfile response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateAppProfileOperationCallable() { + return stub.updateAppProfileOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an app profile within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateAppProfileRequest request =
+   *       UpdateAppProfileRequest.newBuilder()
+   *           .setAppProfile(AppProfile.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.updateAppProfileCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateAppProfileCallable() { + return stub.updateAppProfileCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   baseBigtableInstanceAdminClient.deleteAppProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the app profile to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAppProfile(AppProfileName name) { + DeleteAppProfileRequest request = + DeleteAppProfileRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   baseBigtableInstanceAdminClient.deleteAppProfile(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the app profile to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAppProfile(String name) { + DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder().setName(name).build(); + deleteAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   boolean ignoreWarnings = true;
+   *   baseBigtableInstanceAdminClient.deleteAppProfile(name, ignoreWarnings);
+   * }
+   * }
+ * + * @param name Required. The unique name of the app profile to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @param ignoreWarnings Required. If true, ignore safety checks when deleting the app profile. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAppProfile(AppProfileName name, boolean ignoreWarnings) { + DeleteAppProfileRequest request = + DeleteAppProfileRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setIgnoreWarnings(ignoreWarnings) + .build(); + deleteAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   boolean ignoreWarnings = true;
+   *   baseBigtableInstanceAdminClient.deleteAppProfile(name, ignoreWarnings);
+   * }
+   * }
+ * + * @param name Required. The unique name of the app profile to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * @param ignoreWarnings Required. If true, ignore safety checks when deleting the app profile. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAppProfile(String name, boolean ignoreWarnings) { + DeleteAppProfileRequest request = + DeleteAppProfileRequest.newBuilder() + .setName(name) + .setIgnoreWarnings(ignoreWarnings) + .build(); + deleteAppProfile(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteAppProfileRequest request =
+   *       DeleteAppProfileRequest.newBuilder()
+   *           .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   baseBigtableInstanceAdminClient.deleteAppProfile(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAppProfile(DeleteAppProfileRequest request) { + deleteAppProfileCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an app profile from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteAppProfileRequest request =
+   *       DeleteAppProfileRequest.newBuilder()
+   *           .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.deleteAppProfileCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAppProfileCallable() { + return stub.deleteAppProfileCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for an instance resource. Returns an empty policy if an instance + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for an instance resource. Returns an empty policy if an instance + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for an instance resource. Returns an empty policy if an instance + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for an instance resource. Returns an empty policy if an instance + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on an instance resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on an instance resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on an instance resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on an instance resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified instance resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableInstanceAdminClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified instance resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableInstanceAdminClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified instance resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableInstanceAdminClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified instance resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based + * on CPU usage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   for (HotTablet element :
+   *       baseBigtableInstanceAdminClient.listHotTablets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The cluster name to list hot tablets. Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHotTabletsPagedResponse listHotTablets(ClusterName parent) { + ListHotTabletsRequest request = + ListHotTabletsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listHotTablets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based + * on CPU usage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   for (HotTablet element :
+   *       baseBigtableInstanceAdminClient.listHotTablets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The cluster name to list hot tablets. Value is in the following form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHotTabletsPagedResponse listHotTablets(String parent) { + ListHotTabletsRequest request = ListHotTabletsRequest.newBuilder().setParent(parent).build(); + return listHotTablets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based + * on CPU usage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListHotTabletsRequest request =
+   *       ListHotTabletsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setStartTime(Timestamp.newBuilder().build())
+   *           .setEndTime(Timestamp.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (HotTablet element :
+   *       baseBigtableInstanceAdminClient.listHotTablets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListHotTabletsPagedResponse listHotTablets(ListHotTabletsRequest request) { + return listHotTabletsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based + * on CPU usage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListHotTabletsRequest request =
+   *       ListHotTabletsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setStartTime(Timestamp.newBuilder().build())
+   *           .setEndTime(Timestamp.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listHotTabletsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (HotTablet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listHotTabletsPagedCallable() { + return stub.listHotTabletsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based + * on CPU usage. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListHotTabletsRequest request =
+   *       ListHotTabletsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setStartTime(Timestamp.newBuilder().build())
+   *           .setEndTime(Timestamp.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListHotTabletsResponse response =
+   *         baseBigtableInstanceAdminClient.listHotTabletsCallable().call(request);
+   *     for (HotTablet element : response.getHotTabletsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listHotTabletsCallable() { + return stub.listHotTabletsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   LogicalView logicalView = LogicalView.newBuilder().build();
+   *   String logicalViewId = "logicalViewId-1408054263";
+   *   LogicalView response =
+   *       baseBigtableInstanceAdminClient
+   *           .createLogicalViewAsync(parent, logicalView, logicalViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent instance where this logical view will be created. Format: + * `projects/{project}/instances/{instance}`. + * @param logicalView Required. The logical view to create. + * @param logicalViewId Required. The ID to use for the logical view, which will become the final + * component of the logical view's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLogicalViewAsync( + InstanceName parent, LogicalView logicalView, String logicalViewId) { + CreateLogicalViewRequest request = + CreateLogicalViewRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setLogicalView(logicalView) + .setLogicalViewId(logicalViewId) + .build(); + return createLogicalViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   LogicalView logicalView = LogicalView.newBuilder().build();
+   *   String logicalViewId = "logicalViewId-1408054263";
+   *   LogicalView response =
+   *       baseBigtableInstanceAdminClient
+   *           .createLogicalViewAsync(parent, logicalView, logicalViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent instance where this logical view will be created. Format: + * `projects/{project}/instances/{instance}`. + * @param logicalView Required. The logical view to create. + * @param logicalViewId Required. The ID to use for the logical view, which will become the final + * component of the logical view's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLogicalViewAsync( + String parent, LogicalView logicalView, String logicalViewId) { + CreateLogicalViewRequest request = + CreateLogicalViewRequest.newBuilder() + .setParent(parent) + .setLogicalView(logicalView) + .setLogicalViewId(logicalViewId) + .build(); + return createLogicalViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateLogicalViewRequest request =
+   *       CreateLogicalViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setLogicalViewId("logicalViewId-1408054263")
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .build();
+   *   LogicalView response = baseBigtableInstanceAdminClient.createLogicalViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLogicalViewAsync( + CreateLogicalViewRequest request) { + return createLogicalViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateLogicalViewRequest request =
+   *       CreateLogicalViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setLogicalViewId("logicalViewId-1408054263")
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.createLogicalViewOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LogicalView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createLogicalViewOperationCallable() { + return stub.createLogicalViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateLogicalViewRequest request =
+   *       CreateLogicalViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setLogicalViewId("logicalViewId-1408054263")
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.createLogicalViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createLogicalViewCallable() { + return stub.createLogicalViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a logical view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]");
+   *   LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested logical view. Values are of the form + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogicalView getLogicalView(LogicalViewName name) { + GetLogicalViewRequest request = + GetLogicalViewRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getLogicalView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a logical view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString();
+   *   LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested logical view. Values are of the form + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogicalView getLogicalView(String name) { + GetLogicalViewRequest request = GetLogicalViewRequest.newBuilder().setName(name).build(); + return getLogicalView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a logical view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetLogicalViewRequest request =
+   *       GetLogicalViewRequest.newBuilder()
+   *           .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+   *           .build();
+   *   LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogicalView getLogicalView(GetLogicalViewRequest request) { + return getLogicalViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a logical view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetLogicalViewRequest request =
+   *       GetLogicalViewRequest.newBuilder()
+   *           .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getLogicalViewCallable().futureCall(request);
+   *   // Do something.
+   *   LogicalView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLogicalViewCallable() { + return stub.getLogicalViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about logical views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (LogicalView element :
+   *       baseBigtableInstanceAdminClient.listLogicalViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which the list of logical views is + * requested. Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogicalViewsPagedResponse listLogicalViews(InstanceName parent) { + ListLogicalViewsRequest request = + ListLogicalViewsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listLogicalViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about logical views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   for (LogicalView element :
+   *       baseBigtableInstanceAdminClient.listLogicalViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which the list of logical views is + * requested. Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogicalViewsPagedResponse listLogicalViews(String parent) { + ListLogicalViewsRequest request = + ListLogicalViewsRequest.newBuilder().setParent(parent).build(); + return listLogicalViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about logical views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListLogicalViewsRequest request =
+   *       ListLogicalViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (LogicalView element :
+   *       baseBigtableInstanceAdminClient.listLogicalViews(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogicalViewsPagedResponse listLogicalViews(ListLogicalViewsRequest request) { + return listLogicalViewsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about logical views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListLogicalViewsRequest request =
+   *       ListLogicalViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listLogicalViewsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogicalView element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogicalViewsPagedCallable() { + return stub.listLogicalViewsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about logical views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListLogicalViewsRequest request =
+   *       ListLogicalViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLogicalViewsResponse response =
+   *         baseBigtableInstanceAdminClient.listLogicalViewsCallable().call(request);
+   *     for (LogicalView element : response.getLogicalViewsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogicalViewsCallable() { + return stub.listLogicalViewsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   LogicalView logicalView = LogicalView.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogicalView response =
+   *       baseBigtableInstanceAdminClient.updateLogicalViewAsync(logicalView, updateMask).get();
+   * }
+   * }
+ * + * @param logicalView Required. The logical view to update. + *

The logical view's `name` field is used to identify the view to update. Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateLogicalViewAsync( + LogicalView logicalView, FieldMask updateMask) { + UpdateLogicalViewRequest request = + UpdateLogicalViewRequest.newBuilder() + .setLogicalView(logicalView) + .setUpdateMask(updateMask) + .build(); + return updateLogicalViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateLogicalViewRequest request =
+   *       UpdateLogicalViewRequest.newBuilder()
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogicalView response = baseBigtableInstanceAdminClient.updateLogicalViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateLogicalViewAsync( + UpdateLogicalViewRequest request) { + return updateLogicalViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateLogicalViewRequest request =
+   *       UpdateLogicalViewRequest.newBuilder()
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient.updateLogicalViewOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LogicalView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateLogicalViewOperationCallable() { + return stub.updateLogicalViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a logical view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateLogicalViewRequest request =
+   *       UpdateLogicalViewRequest.newBuilder()
+   *           .setLogicalView(LogicalView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.updateLogicalViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateLogicalViewCallable() { + return stub.updateLogicalViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logical view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]");
+   *   baseBigtableInstanceAdminClient.deleteLogicalView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the logical view to be deleted. Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogicalView(LogicalViewName name) { + DeleteLogicalViewRequest request = + DeleteLogicalViewRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteLogicalView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logical view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString();
+   *   baseBigtableInstanceAdminClient.deleteLogicalView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the logical view to be deleted. Format: + * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogicalView(String name) { + DeleteLogicalViewRequest request = DeleteLogicalViewRequest.newBuilder().setName(name).build(); + deleteLogicalView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logical view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteLogicalViewRequest request =
+   *       DeleteLogicalViewRequest.newBuilder()
+   *           .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   baseBigtableInstanceAdminClient.deleteLogicalView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogicalView(DeleteLogicalViewRequest request) { + deleteLogicalViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logical view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteLogicalViewRequest request =
+   *       DeleteLogicalViewRequest.newBuilder()
+   *           .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.deleteLogicalViewCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteLogicalViewCallable() { + return stub.deleteLogicalViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   MaterializedView materializedView = MaterializedView.newBuilder().build();
+   *   String materializedViewId = "materializedViewId682270903";
+   *   MaterializedView response =
+   *       baseBigtableInstanceAdminClient
+   *           .createMaterializedViewAsync(parent, materializedView, materializedViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent instance where this materialized view will be created. + * Format: `projects/{project}/instances/{instance}`. + * @param materializedView Required. The materialized view to create. + * @param materializedViewId Required. The ID to use for the materialized view, which will become + * the final component of the materialized view's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createMaterializedViewAsync( + InstanceName parent, MaterializedView materializedView, String materializedViewId) { + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMaterializedView(materializedView) + .setMaterializedViewId(materializedViewId) + .build(); + return createMaterializedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   MaterializedView materializedView = MaterializedView.newBuilder().build();
+   *   String materializedViewId = "materializedViewId682270903";
+   *   MaterializedView response =
+   *       baseBigtableInstanceAdminClient
+   *           .createMaterializedViewAsync(parent, materializedView, materializedViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent instance where this materialized view will be created. + * Format: `projects/{project}/instances/{instance}`. + * @param materializedView Required. The materialized view to create. + * @param materializedViewId Required. The ID to use for the materialized view, which will become + * the final component of the materialized view's resource name. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createMaterializedViewAsync( + String parent, MaterializedView materializedView, String materializedViewId) { + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.newBuilder() + .setParent(parent) + .setMaterializedView(materializedView) + .setMaterializedViewId(materializedViewId) + .build(); + return createMaterializedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateMaterializedViewRequest request =
+   *       CreateMaterializedViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setMaterializedViewId("materializedViewId682270903")
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .build();
+   *   MaterializedView response =
+   *       baseBigtableInstanceAdminClient.createMaterializedViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createMaterializedViewAsync(CreateMaterializedViewRequest request) { + return createMaterializedViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateMaterializedViewRequest request =
+   *       CreateMaterializedViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setMaterializedViewId("materializedViewId682270903")
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient
+   *           .createMaterializedViewOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   MaterializedView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationCallable() { + return stub.createMaterializedViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   CreateMaterializedViewRequest request =
+   *       CreateMaterializedViewRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setMaterializedViewId("materializedViewId682270903")
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.createMaterializedViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createMaterializedViewCallable() { + return stub.createMaterializedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a materialized view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   MaterializedViewName name =
+   *       MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]");
+   *   MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested materialized view. Values are of the + * form `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MaterializedView getMaterializedView(MaterializedViewName name) { + GetMaterializedViewRequest request = + GetMaterializedViewRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getMaterializedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a materialized view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name =
+   *       MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]").toString();
+   *   MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested materialized view. Values are of the + * form `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MaterializedView getMaterializedView(String name) { + GetMaterializedViewRequest request = + GetMaterializedViewRequest.newBuilder().setName(name).build(); + return getMaterializedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a materialized view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetMaterializedViewRequest request =
+   *       GetMaterializedViewRequest.newBuilder()
+   *           .setName(
+   *               MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+   *                   .toString())
+   *           .build();
+   *   MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final MaterializedView getMaterializedView(GetMaterializedViewRequest request) { + return getMaterializedViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a materialized view. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   GetMaterializedViewRequest request =
+   *       GetMaterializedViewRequest.newBuilder()
+   *           .setName(
+   *               MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.getMaterializedViewCallable().futureCall(request);
+   *   // Do something.
+   *   MaterializedView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getMaterializedViewCallable() { + return stub.getMaterializedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about materialized views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (MaterializedView element :
+   *       baseBigtableInstanceAdminClient.listMaterializedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which the list of materialized + * views is requested. Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMaterializedViewsPagedResponse listMaterializedViews(InstanceName parent) { + ListMaterializedViewsRequest request = + ListMaterializedViewsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listMaterializedViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about materialized views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   for (MaterializedView element :
+   *       baseBigtableInstanceAdminClient.listMaterializedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which the list of materialized + * views is requested. Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMaterializedViewsPagedResponse listMaterializedViews(String parent) { + ListMaterializedViewsRequest request = + ListMaterializedViewsRequest.newBuilder().setParent(parent).build(); + return listMaterializedViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about materialized views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListMaterializedViewsRequest request =
+   *       ListMaterializedViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (MaterializedView element :
+   *       baseBigtableInstanceAdminClient.listMaterializedViews(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMaterializedViewsPagedResponse listMaterializedViews( + ListMaterializedViewsRequest request) { + return listMaterializedViewsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about materialized views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListMaterializedViewsRequest request =
+   *       ListMaterializedViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.listMaterializedViewsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MaterializedView element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listMaterializedViewsPagedCallable() { + return stub.listMaterializedViewsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about materialized views in an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListMaterializedViewsRequest request =
+   *       ListMaterializedViewsRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListMaterializedViewsResponse response =
+   *         baseBigtableInstanceAdminClient.listMaterializedViewsCallable().call(request);
+   *     for (MaterializedView element : response.getMaterializedViewsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listMaterializedViewsCallable() { + return stub.listMaterializedViewsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   MaterializedView materializedView = MaterializedView.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   MaterializedView response =
+   *       baseBigtableInstanceAdminClient
+   *           .updateMaterializedViewAsync(materializedView, updateMask)
+   *           .get();
+   * }
+   * }
+ * + * @param materializedView Required. The materialized view to update. + *

The materialized view's `name` field is used to identify the view to update. Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateMaterializedViewAsync(MaterializedView materializedView, FieldMask updateMask) { + UpdateMaterializedViewRequest request = + UpdateMaterializedViewRequest.newBuilder() + .setMaterializedView(materializedView) + .setUpdateMask(updateMask) + .build(); + return updateMaterializedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateMaterializedViewRequest request =
+   *       UpdateMaterializedViewRequest.newBuilder()
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   MaterializedView response =
+   *       baseBigtableInstanceAdminClient.updateMaterializedViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateMaterializedViewAsync(UpdateMaterializedViewRequest request) { + return updateMaterializedViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateMaterializedViewRequest request =
+   *       UpdateMaterializedViewRequest.newBuilder()
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableInstanceAdminClient
+   *           .updateMaterializedViewOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   MaterializedView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationCallable() { + return stub.updateMaterializedViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a materialized view within an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   UpdateMaterializedViewRequest request =
+   *       UpdateMaterializedViewRequest.newBuilder()
+   *           .setMaterializedView(MaterializedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.updateMaterializedViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateMaterializedViewCallable() { + return stub.updateMaterializedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a materialized view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   MaterializedViewName name =
+   *       MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]");
+   *   baseBigtableInstanceAdminClient.deleteMaterializedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the materialized view to be deleted. Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMaterializedView(MaterializedViewName name) { + DeleteMaterializedViewRequest request = + DeleteMaterializedViewRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteMaterializedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a materialized view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   String name =
+   *       MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]").toString();
+   *   baseBigtableInstanceAdminClient.deleteMaterializedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the materialized view to be deleted. Format: + * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMaterializedView(String name) { + DeleteMaterializedViewRequest request = + DeleteMaterializedViewRequest.newBuilder().setName(name).build(); + deleteMaterializedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a materialized view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteMaterializedViewRequest request =
+   *       DeleteMaterializedViewRequest.newBuilder()
+   *           .setName(
+   *               MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   baseBigtableInstanceAdminClient.deleteMaterializedView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteMaterializedView(DeleteMaterializedViewRequest request) { + deleteMaterializedViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a materialized view from an instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   DeleteMaterializedViewRequest request =
+   *       DeleteMaterializedViewRequest.newBuilder()
+   *           .setName(
+   *               MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableInstanceAdminClient.deleteMaterializedViewCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteMaterializedViewCallable() { + return stub.deleteMaterializedViewCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListAppProfilesPagedResponse + extends AbstractPagedListResponse< + ListAppProfilesRequest, + ListAppProfilesResponse, + AppProfile, + ListAppProfilesPage, + ListAppProfilesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAppProfilesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAppProfilesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAppProfilesPagedResponse(ListAppProfilesPage page) { + super(page, ListAppProfilesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAppProfilesPage + extends AbstractPage< + ListAppProfilesRequest, ListAppProfilesResponse, AppProfile, ListAppProfilesPage> { + + private ListAppProfilesPage( + PageContext context, + ListAppProfilesResponse response) { + super(context, response); + } + + private static ListAppProfilesPage createEmptyPage() { + return new ListAppProfilesPage(null, null); + } + + @Override + protected ListAppProfilesPage createPage( + PageContext context, + ListAppProfilesResponse response) { + return new ListAppProfilesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAppProfilesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAppProfilesRequest, + ListAppProfilesResponse, + AppProfile, + ListAppProfilesPage, + ListAppProfilesFixedSizeCollection> { + + private ListAppProfilesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAppProfilesFixedSizeCollection createEmptyCollection() { + return new ListAppProfilesFixedSizeCollection(null, 0); + } + + @Override + protected ListAppProfilesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAppProfilesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListHotTabletsPagedResponse + extends AbstractPagedListResponse< + ListHotTabletsRequest, + ListHotTabletsResponse, + HotTablet, + ListHotTabletsPage, + ListHotTabletsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHotTabletsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListHotTabletsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListHotTabletsPagedResponse(ListHotTabletsPage page) { + super(page, ListHotTabletsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListHotTabletsPage + extends AbstractPage< + ListHotTabletsRequest, ListHotTabletsResponse, HotTablet, ListHotTabletsPage> { + + private ListHotTabletsPage( + PageContext context, + ListHotTabletsResponse response) { + super(context, response); + } + + private static ListHotTabletsPage createEmptyPage() { + return new ListHotTabletsPage(null, null); + } + + @Override + protected ListHotTabletsPage createPage( + PageContext context, + ListHotTabletsResponse response) { + return new ListHotTabletsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListHotTabletsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHotTabletsRequest, + ListHotTabletsResponse, + HotTablet, + ListHotTabletsPage, + ListHotTabletsFixedSizeCollection> { + + private ListHotTabletsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHotTabletsFixedSizeCollection createEmptyCollection() { + return new ListHotTabletsFixedSizeCollection(null, 0); + } + + @Override + protected ListHotTabletsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHotTabletsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLogicalViewsPagedResponse + extends AbstractPagedListResponse< + ListLogicalViewsRequest, + ListLogicalViewsResponse, + LogicalView, + ListLogicalViewsPage, + ListLogicalViewsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogicalViewsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLogicalViewsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLogicalViewsPagedResponse(ListLogicalViewsPage page) { + super(page, ListLogicalViewsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogicalViewsPage + extends AbstractPage< + ListLogicalViewsRequest, ListLogicalViewsResponse, LogicalView, ListLogicalViewsPage> { + + private ListLogicalViewsPage( + PageContext context, + ListLogicalViewsResponse response) { + super(context, response); + } + + private static ListLogicalViewsPage createEmptyPage() { + return new ListLogicalViewsPage(null, null); + } + + @Override + protected ListLogicalViewsPage createPage( + PageContext context, + ListLogicalViewsResponse response) { + return new ListLogicalViewsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogicalViewsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogicalViewsRequest, + ListLogicalViewsResponse, + LogicalView, + ListLogicalViewsPage, + ListLogicalViewsFixedSizeCollection> { + + private ListLogicalViewsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogicalViewsFixedSizeCollection createEmptyCollection() { + return new ListLogicalViewsFixedSizeCollection(null, 0); + } + + @Override + protected ListLogicalViewsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogicalViewsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListMaterializedViewsPagedResponse + extends AbstractPagedListResponse< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + MaterializedView, + ListMaterializedViewsPage, + ListMaterializedViewsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMaterializedViewsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMaterializedViewsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMaterializedViewsPagedResponse(ListMaterializedViewsPage page) { + super(page, ListMaterializedViewsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMaterializedViewsPage + extends AbstractPage< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + MaterializedView, + ListMaterializedViewsPage> { + + private ListMaterializedViewsPage( + PageContext + context, + ListMaterializedViewsResponse response) { + super(context, response); + } + + private static ListMaterializedViewsPage createEmptyPage() { + return new ListMaterializedViewsPage(null, null); + } + + @Override + protected ListMaterializedViewsPage createPage( + PageContext + context, + ListMaterializedViewsResponse response) { + return new ListMaterializedViewsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMaterializedViewsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + MaterializedView, + ListMaterializedViewsPage, + ListMaterializedViewsFixedSizeCollection> { + + private ListMaterializedViewsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMaterializedViewsFixedSizeCollection createEmptyCollection() { + return new ListMaterializedViewsFixedSizeCollection(null, 0); + } + + @Override + protected ListMaterializedViewsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMaterializedViewsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java new file mode 100644 index 000000000000..87fa4df55f89 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java @@ -0,0 +1,762 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterMetadata; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewMetadata; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.UpdateAppProfileMetadata; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BaseBigtableInstanceAdminClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigtableadmin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableInstanceAdminSettings.Builder baseBigtableInstanceAdminSettingsBuilder =
+ *     BaseBigtableInstanceAdminSettings.newBuilder();
+ * baseBigtableInstanceAdminSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         baseBigtableInstanceAdminSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * BaseBigtableInstanceAdminSettings baseBigtableInstanceAdminSettings =
+ *     baseBigtableInstanceAdminSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableInstanceAdminSettings.Builder baseBigtableInstanceAdminSettingsBuilder =
+ *     BaseBigtableInstanceAdminSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableInstanceAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class BaseBigtableInstanceAdminSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to listInstances. */ + public UnaryCallSettings listInstancesSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to partialUpdateInstance. */ + public UnaryCallSettings + partialUpdateInstanceSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).partialUpdateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to partialUpdateInstance. */ + public OperationCallSettings + partialUpdateInstanceOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .partialUpdateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to listClusters. */ + public UnaryCallSettings listClustersSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to partialUpdateCluster. */ + public UnaryCallSettings partialUpdateClusterSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).partialUpdateClusterSettings(); + } + + /** Returns the object with the settings used for calls to partialUpdateCluster. */ + public OperationCallSettings + partialUpdateClusterOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .partialUpdateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to createAppProfile. */ + public UnaryCallSettings createAppProfileSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createAppProfileSettings(); + } + + /** Returns the object with the settings used for calls to getAppProfile. */ + public UnaryCallSettings getAppProfileSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getAppProfileSettings(); + } + + /** Returns the object with the settings used for calls to listAppProfiles. */ + public PagedCallSettings< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listAppProfilesSettings(); + } + + /** Returns the object with the settings used for calls to updateAppProfile. */ + public UnaryCallSettings updateAppProfileSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateAppProfileSettings(); + } + + /** Returns the object with the settings used for calls to updateAppProfile. */ + public OperationCallSettings + updateAppProfileOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .updateAppProfileOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAppProfile. */ + public UnaryCallSettings deleteAppProfileSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).deleteAppProfileSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to listHotTablets. */ + public PagedCallSettings< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listHotTabletsSettings(); + } + + /** Returns the object with the settings used for calls to createLogicalView. */ + public UnaryCallSettings createLogicalViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createLogicalViewSettings(); + } + + /** Returns the object with the settings used for calls to createLogicalView. */ + public OperationCallSettings + createLogicalViewOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .createLogicalViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to getLogicalView. */ + public UnaryCallSettings getLogicalViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getLogicalViewSettings(); + } + + /** Returns the object with the settings used for calls to listLogicalViews. */ + public PagedCallSettings< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listLogicalViewsSettings(); + } + + /** Returns the object with the settings used for calls to updateLogicalView. */ + public UnaryCallSettings updateLogicalViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateLogicalViewSettings(); + } + + /** Returns the object with the settings used for calls to updateLogicalView. */ + public OperationCallSettings + updateLogicalViewOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .updateLogicalViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteLogicalView. */ + public UnaryCallSettings deleteLogicalViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).deleteLogicalViewSettings(); + } + + /** Returns the object with the settings used for calls to createMaterializedView. */ + public UnaryCallSettings + createMaterializedViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).createMaterializedViewSettings(); + } + + /** Returns the object with the settings used for calls to createMaterializedView. */ + public OperationCallSettings< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .createMaterializedViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to getMaterializedView. */ + public UnaryCallSettings + getMaterializedViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).getMaterializedViewSettings(); + } + + /** Returns the object with the settings used for calls to listMaterializedViews. */ + public PagedCallSettings< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).listMaterializedViewsSettings(); + } + + /** Returns the object with the settings used for calls to updateMaterializedView. */ + public UnaryCallSettings + updateMaterializedViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).updateMaterializedViewSettings(); + } + + /** Returns the object with the settings used for calls to updateMaterializedView. */ + public OperationCallSettings< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()) + .updateMaterializedViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteMaterializedView. */ + public UnaryCallSettings deleteMaterializedViewSettings() { + return ((BigtableInstanceAdminStubSettings) getStubSettings()).deleteMaterializedViewSettings(); + } + + public static final BaseBigtableInstanceAdminSettings create( + BigtableInstanceAdminStubSettings stub) throws IOException { + return new BaseBigtableInstanceAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BigtableInstanceAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return BigtableInstanceAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return BigtableInstanceAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BigtableInstanceAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return BigtableInstanceAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BigtableInstanceAdminStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BigtableInstanceAdminStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BaseBigtableInstanceAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for BaseBigtableInstanceAdminSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(BigtableInstanceAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(BaseBigtableInstanceAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BigtableInstanceAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(BigtableInstanceAdminStubSettings.newBuilder()); + } + + public BigtableInstanceAdminStubSettings.Builder getStubSettingsBuilder() { + return ((BigtableInstanceAdminStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public UnaryCallSettings.Builder + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to partialUpdateInstance. */ + public UnaryCallSettings.Builder + partialUpdateInstanceSettings() { + return getStubSettingsBuilder().partialUpdateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to partialUpdateInstance. */ + public OperationCallSettings.Builder< + PartialUpdateInstanceRequest, Instance, UpdateInstanceMetadata> + partialUpdateInstanceOperationSettings() { + return getStubSettingsBuilder().partialUpdateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return getStubSettingsBuilder().createClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public OperationCallSettings.Builder + createClusterOperationSettings() { + return getStubSettingsBuilder().createClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getStubSettingsBuilder().getClusterSettings(); + } + + /** Returns the builder for the settings used for calls to listClusters. */ + public UnaryCallSettings.Builder + listClustersSettings() { + return getStubSettingsBuilder().listClustersSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return getStubSettingsBuilder().updateClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return getStubSettingsBuilder().updateClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to partialUpdateCluster. */ + public UnaryCallSettings.Builder + partialUpdateClusterSettings() { + return getStubSettingsBuilder().partialUpdateClusterSettings(); + } + + /** Returns the builder for the settings used for calls to partialUpdateCluster. */ + public OperationCallSettings.Builder< + PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> + partialUpdateClusterOperationSettings() { + return getStubSettingsBuilder().partialUpdateClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return getStubSettingsBuilder().deleteClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createAppProfile. */ + public UnaryCallSettings.Builder + createAppProfileSettings() { + return getStubSettingsBuilder().createAppProfileSettings(); + } + + /** Returns the builder for the settings used for calls to getAppProfile. */ + public UnaryCallSettings.Builder getAppProfileSettings() { + return getStubSettingsBuilder().getAppProfileSettings(); + } + + /** Returns the builder for the settings used for calls to listAppProfiles. */ + public PagedCallSettings.Builder< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings() { + return getStubSettingsBuilder().listAppProfilesSettings(); + } + + /** Returns the builder for the settings used for calls to updateAppProfile. */ + public UnaryCallSettings.Builder + updateAppProfileSettings() { + return getStubSettingsBuilder().updateAppProfileSettings(); + } + + /** Returns the builder for the settings used for calls to updateAppProfile. */ + public OperationCallSettings.Builder< + UpdateAppProfileRequest, AppProfile, UpdateAppProfileMetadata> + updateAppProfileOperationSettings() { + return getStubSettingsBuilder().updateAppProfileOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAppProfile. */ + public UnaryCallSettings.Builder deleteAppProfileSettings() { + return getStubSettingsBuilder().deleteAppProfileSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to listHotTablets. */ + public PagedCallSettings.Builder< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings() { + return getStubSettingsBuilder().listHotTabletsSettings(); + } + + /** Returns the builder for the settings used for calls to createLogicalView. */ + public UnaryCallSettings.Builder + createLogicalViewSettings() { + return getStubSettingsBuilder().createLogicalViewSettings(); + } + + /** Returns the builder for the settings used for calls to createLogicalView. */ + public OperationCallSettings.Builder< + CreateLogicalViewRequest, LogicalView, CreateLogicalViewMetadata> + createLogicalViewOperationSettings() { + return getStubSettingsBuilder().createLogicalViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getLogicalView. */ + public UnaryCallSettings.Builder getLogicalViewSettings() { + return getStubSettingsBuilder().getLogicalViewSettings(); + } + + /** Returns the builder for the settings used for calls to listLogicalViews. */ + public PagedCallSettings.Builder< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings() { + return getStubSettingsBuilder().listLogicalViewsSettings(); + } + + /** Returns the builder for the settings used for calls to updateLogicalView. */ + public UnaryCallSettings.Builder + updateLogicalViewSettings() { + return getStubSettingsBuilder().updateLogicalViewSettings(); + } + + /** Returns the builder for the settings used for calls to updateLogicalView. */ + public OperationCallSettings.Builder< + UpdateLogicalViewRequest, LogicalView, UpdateLogicalViewMetadata> + updateLogicalViewOperationSettings() { + return getStubSettingsBuilder().updateLogicalViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteLogicalView. */ + public UnaryCallSettings.Builder deleteLogicalViewSettings() { + return getStubSettingsBuilder().deleteLogicalViewSettings(); + } + + /** Returns the builder for the settings used for calls to createMaterializedView. */ + public UnaryCallSettings.Builder + createMaterializedViewSettings() { + return getStubSettingsBuilder().createMaterializedViewSettings(); + } + + /** Returns the builder for the settings used for calls to createMaterializedView. */ + public OperationCallSettings.Builder< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings() { + return getStubSettingsBuilder().createMaterializedViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getMaterializedView. */ + public UnaryCallSettings.Builder + getMaterializedViewSettings() { + return getStubSettingsBuilder().getMaterializedViewSettings(); + } + + /** Returns the builder for the settings used for calls to listMaterializedViews. */ + public PagedCallSettings.Builder< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings() { + return getStubSettingsBuilder().listMaterializedViewsSettings(); + } + + /** Returns the builder for the settings used for calls to updateMaterializedView. */ + public UnaryCallSettings.Builder + updateMaterializedViewSettings() { + return getStubSettingsBuilder().updateMaterializedViewSettings(); + } + + /** Returns the builder for the settings used for calls to updateMaterializedView. */ + public OperationCallSettings.Builder< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings() { + return getStubSettingsBuilder().updateMaterializedViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteMaterializedView. */ + public UnaryCallSettings.Builder + deleteMaterializedViewSettings() { + return getStubSettingsBuilder().deleteMaterializedViewSettings(); + } + + @Override + public BaseBigtableInstanceAdminSettings build() throws IOException { + return new BaseBigtableInstanceAdminSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java new file mode 100644 index 000000000000..9a3758b373c4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java @@ -0,0 +1,6831 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.AuthorizedViewName; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.BackupName; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.ClusterName; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.SchemaBundleName; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotName; +import com.google.bigtable.admin.v2.SnapshotTableMetadata; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.TableName; +import com.google.bigtable.admin.v2.UndeleteTableMetadata; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStub; +import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for creating, configuring, and deleting Cloud Bigtable tables. + * + *

Provides access to the table schemas only, not the data stored within the tables. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+ *     BaseBigtableTableAdminClient.create()) {
+ *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ *   String tableId = "tableId-1552905847";
+ *   Table table = Table.newBuilder().build();
+ *   Table response = baseBigtableTableAdminClient.createTable(parent, tableId, table);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the BaseBigtableTableAdminClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateTable

Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createTable(CreateTableRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createTable(InstanceName parent, String tableId, Table table) + *

  • createTable(String parent, String tableId, Table table) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createTableCallable() + *

+ *

CreateTableFromSnapshot

Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance. + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createTableFromSnapshotAsync(CreateTableFromSnapshotRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createTableFromSnapshotAsync(InstanceName parent, String tableId, SnapshotName sourceSnapshot) + *

  • createTableFromSnapshotAsync(InstanceName parent, String tableId, String sourceSnapshot) + *

  • createTableFromSnapshotAsync(String parent, String tableId, SnapshotName sourceSnapshot) + *

  • createTableFromSnapshotAsync(String parent, String tableId, String sourceSnapshot) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createTableFromSnapshotOperationCallable() + *

  • createTableFromSnapshotCallable() + *

+ *

ListTables

Lists all tables served from a specified instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listTables(ListTablesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listTables(InstanceName parent) + *

  • listTables(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listTablesPagedCallable() + *

  • listTablesCallable() + *

+ *

GetTable

Gets metadata information about the specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getTable(GetTableRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getTable(TableName name) + *

  • getTable(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getTableCallable() + *

+ *

UpdateTable

Updates a specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateTableAsync(UpdateTableRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateTableAsync(Table table, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateTableOperationCallable() + *

  • updateTableCallable() + *

+ *

DeleteTable

Permanently deletes a specified table and all of its data.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteTable(DeleteTableRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteTable(TableName name) + *

  • deleteTable(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteTableCallable() + *

+ *

UndeleteTable

Restores a specified table which was accidentally deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • undeleteTableAsync(UndeleteTableRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • undeleteTableAsync(TableName name) + *

  • undeleteTableAsync(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • undeleteTableOperationCallable() + *

  • undeleteTableCallable() + *

+ *

CreateAuthorizedView

Creates a new AuthorizedView in a table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createAuthorizedViewAsync(CreateAuthorizedViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createAuthorizedViewAsync(TableName parent, AuthorizedView authorizedView, String authorizedViewId) + *

  • createAuthorizedViewAsync(String parent, AuthorizedView authorizedView, String authorizedViewId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createAuthorizedViewOperationCallable() + *

  • createAuthorizedViewCallable() + *

+ *

ListAuthorizedViews

Lists all AuthorizedViews from a specific table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listAuthorizedViews(ListAuthorizedViewsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listAuthorizedViews(TableName parent) + *

  • listAuthorizedViews(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listAuthorizedViewsPagedCallable() + *

  • listAuthorizedViewsCallable() + *

+ *

GetAuthorizedView

Gets information from a specified AuthorizedView.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getAuthorizedView(GetAuthorizedViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getAuthorizedView(AuthorizedViewName name) + *

  • getAuthorizedView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getAuthorizedViewCallable() + *

+ *

UpdateAuthorizedView

Updates an AuthorizedView in a table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateAuthorizedViewAsync(UpdateAuthorizedViewRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateAuthorizedViewAsync(AuthorizedView authorizedView, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateAuthorizedViewOperationCallable() + *

  • updateAuthorizedViewCallable() + *

+ *

DeleteAuthorizedView

Permanently deletes a specified AuthorizedView.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteAuthorizedView(DeleteAuthorizedViewRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteAuthorizedView(AuthorizedViewName name) + *

  • deleteAuthorizedView(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteAuthorizedViewCallable() + *

+ *

ModifyColumnFamilies

Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • modifyColumnFamilies(ModifyColumnFamiliesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • modifyColumnFamilies(TableName name, List<ModifyColumnFamiliesRequest.Modification> modifications) + *

  • modifyColumnFamilies(String name, List<ModifyColumnFamiliesRequest.Modification> modifications) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • modifyColumnFamiliesCallable() + *

+ *

DropRowRange

Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • dropRowRange(DropRowRangeRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • dropRowRangeCallable() + *

+ *

GenerateConsistencyToken

Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • generateConsistencyToken(GenerateConsistencyTokenRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • generateConsistencyToken(TableName name) + *

  • generateConsistencyToken(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • generateConsistencyTokenCallable() + *

+ *

CheckConsistency

Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • checkConsistency(CheckConsistencyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • checkConsistency(TableName name, String consistencyToken) + *

  • checkConsistency(String name, String consistencyToken) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • checkConsistencyCallable() + *

+ *

SnapshotTable

Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance. + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • snapshotTableAsync(SnapshotTableRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • snapshotTableAsync(TableName name, ClusterName cluster, String snapshotId, String description) + *

  • snapshotTableAsync(TableName name, String cluster, String snapshotId, String description) + *

  • snapshotTableAsync(String name, ClusterName cluster, String snapshotId, String description) + *

  • snapshotTableAsync(String name, String cluster, String snapshotId, String description) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • snapshotTableOperationCallable() + *

  • snapshotTableCallable() + *

+ *

GetSnapshot

Gets metadata information about the specified snapshot. + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSnapshot(GetSnapshotRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSnapshot(SnapshotName name) + *

  • getSnapshot(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSnapshotCallable() + *

+ *

ListSnapshots

Lists all snapshots associated with the specified cluster. + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSnapshots(ListSnapshotsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSnapshots(ClusterName parent) + *

  • listSnapshots(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSnapshotsPagedCallable() + *

  • listSnapshotsCallable() + *

+ *

DeleteSnapshot

Permanently deletes the specified snapshot. + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSnapshot(DeleteSnapshotRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSnapshot(SnapshotName name) + *

  • deleteSnapshot(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSnapshotCallable() + *

+ *

CreateBackup

Starts creating a new Cloud Bigtable Backup. The returned backup [long-running operation][google.longrunning.Operation] can be used to track creation of the backup. The [metadata][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation will stop the creation and delete the backup.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createBackupAsync(CreateBackupRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createBackupAsync(ClusterName parent, String backupId, Backup backup) + *

  • createBackupAsync(String parent, String backupId, Backup backup) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createBackupOperationCallable() + *

  • createBackupCallable() + *

+ *

GetBackup

Gets metadata on a pending or completed Cloud Bigtable Backup.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getBackup(GetBackupRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getBackup(BackupName name) + *

  • getBackup(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getBackupCallable() + *

+ *

UpdateBackup

Updates a pending or completed Cloud Bigtable Backup.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateBackup(UpdateBackupRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateBackup(Backup backup, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateBackupCallable() + *

+ *

DeleteBackup

Deletes a pending or completed Cloud Bigtable backup.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteBackup(DeleteBackupRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteBackup(BackupName name) + *

  • deleteBackup(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteBackupCallable() + *

+ *

ListBackups

Lists Cloud Bigtable backups. Returns both completed and pending backups.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listBackups(ListBackupsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listBackups(ClusterName parent) + *

  • listBackups(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listBackupsPagedCallable() + *

  • listBackupsCallable() + *

+ *

RestoreTable

Create a new table by restoring from a completed backup. The returned table [long-running operation][google.longrunning.Operation] can be used to track the progress of the operation, and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The [response][google.longrunning.Operation.response] type is [Table][google.bigtable.admin.v2.Table], if successful.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • restoreTableAsync(RestoreTableRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • restoreTableOperationCallable() + *

  • restoreTableCallable() + *

+ *

CopyBackup

Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • copyBackupAsync(CopyBackupRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • copyBackupAsync(ClusterName parent, String backupId, BackupName sourceBackup, Timestamp expireTime) + *

  • copyBackupAsync(ClusterName parent, String backupId, String sourceBackup, Timestamp expireTime) + *

  • copyBackupAsync(String parent, String backupId, BackupName sourceBackup, Timestamp expireTime) + *

  • copyBackupAsync(String parent, String backupId, String sourceBackup, Timestamp expireTime) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • copyBackupOperationCallable() + *

  • copyBackupCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource exists but does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getIamPolicy(ResourceName resource) + *

  • getIamPolicy(String resource) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

SetIamPolicy

Sets the access control policy on a Bigtable resource. Replaces any existing policy.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • setIamPolicy(ResourceName resource, Policy policy) + *

  • setIamPolicy(String resource, Policy policy) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that the caller has on the specified Bigtable resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • testIamPermissions(ResourceName resource, List<String> permissions) + *

  • testIamPermissions(String resource, List<String> permissions) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *

CreateSchemaBundle

Creates a new schema bundle in the specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSchemaBundleAsync(CreateSchemaBundleRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createSchemaBundleAsync(TableName parent, String schemaBundleId, SchemaBundle schemaBundle) + *

  • createSchemaBundleAsync(String parent, String schemaBundleId, SchemaBundle schemaBundle) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSchemaBundleOperationCallable() + *

  • createSchemaBundleCallable() + *

+ *

UpdateSchemaBundle

Updates a schema bundle in the specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSchemaBundleAsync(UpdateSchemaBundleRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateSchemaBundleAsync(SchemaBundle schemaBundle, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSchemaBundleOperationCallable() + *

  • updateSchemaBundleCallable() + *

+ *

GetSchemaBundle

Gets metadata information about the specified schema bundle.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSchemaBundle(GetSchemaBundleRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSchemaBundle(SchemaBundleName name) + *

  • getSchemaBundle(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSchemaBundleCallable() + *

+ *

ListSchemaBundles

Lists all schema bundles associated with the specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSchemaBundles(ListSchemaBundlesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSchemaBundles(TableName parent) + *

  • listSchemaBundles(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSchemaBundlesPagedCallable() + *

  • listSchemaBundlesCallable() + *

+ *

DeleteSchemaBundle

Deletes a schema bundle in the specified table.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSchemaBundle(DeleteSchemaBundleRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSchemaBundle(SchemaBundleName name) + *

  • deleteSchemaBundle(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSchemaBundleCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of BaseBigtableTableAdminSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableTableAdminSettings baseBigtableTableAdminSettings =
+ *     BaseBigtableTableAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+ *     BaseBigtableTableAdminClient.create(baseBigtableTableAdminSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableTableAdminSettings baseBigtableTableAdminSettings =
+ *     BaseBigtableTableAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+ *     BaseBigtableTableAdminClient.create(baseBigtableTableAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class BaseBigtableTableAdminClient implements BackgroundResource { + private final BaseBigtableTableAdminSettings settings; + private final BigtableTableAdminStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of BaseBigtableTableAdminClient with default settings. */ + protected static BaseBigtableTableAdminClient create() throws IOException { + return create(BaseBigtableTableAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of BaseBigtableTableAdminClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + protected static BaseBigtableTableAdminClient create(BaseBigtableTableAdminSettings settings) + throws IOException { + return new BaseBigtableTableAdminClient(settings); + } + + /** + * Constructs an instance of BaseBigtableTableAdminClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(BaseBigtableTableAdminSettings). + */ + protected static BaseBigtableTableAdminClient create(BigtableTableAdminStub stub) { + return new BaseBigtableTableAdminClient(stub); + } + + /** + * Constructs an instance of BaseBigtableTableAdminClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected BaseBigtableTableAdminClient(BaseBigtableTableAdminSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((BigtableTableAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected BaseBigtableTableAdminClient(BigtableTableAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final BaseBigtableTableAdminSettings getSettings() { + return settings; + } + + public BigtableTableAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table in the specified instance. The table can be created with a full set of + * initial column families, specified in the request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String tableId = "tableId-1552905847";
+   *   Table table = Table.newBuilder().build();
+   *   Table response = baseBigtableTableAdminClient.createTable(parent, tableId, table);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. Maximum 50 + * characters. + * @param table Required. The Table to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table createTable(InstanceName parent, String tableId, Table table) { + CreateTableRequest request = + CreateTableRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTableId(tableId) + .setTable(table) + .build(); + return createTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table in the specified instance. The table can be created with a full set of + * initial column families, specified in the request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   String tableId = "tableId-1552905847";
+   *   Table table = Table.newBuilder().build();
+   *   Table response = baseBigtableTableAdminClient.createTable(parent, tableId, table);
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. Maximum 50 + * characters. + * @param table Required. The Table to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table createTable(String parent, String tableId, Table table) { + CreateTableRequest request = + CreateTableRequest.newBuilder() + .setParent(parent) + .setTableId(tableId) + .setTable(table) + .build(); + return createTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table in the specified instance. The table can be created with a full set of + * initial column families, specified in the request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateTableRequest request =
+   *       CreateTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .setTable(Table.newBuilder().build())
+   *           .addAllInitialSplits(new ArrayList())
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.createTable(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table createTable(CreateTableRequest request) { + return createTableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table in the specified instance. The table can be created with a full set of + * initial column families, specified in the request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateTableRequest request =
+   *       CreateTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .setTable(Table.newBuilder().build())
+   *           .addAllInitialSplits(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createTableCallable().futureCall(request);
+   *   // Do something.
+   *   Table response = future.get();
+   * }
+   * }
+   */
+  public final UnaryCallable createTableCallable() {
+    return stub.createTableCallable();
+  }
+
+  // AUTO-GENERATED DOCUMENTATION AND METHOD.
+  /**
+   * Creates a new table from the specified snapshot. The target table must not exist. The snapshot
+   * and the table must be in the same instance.
+   *
+   * 

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String tableId = "tableId-1552905847";
+   *   SnapshotName sourceSnapshot =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
+   *   Table response =
+   *       baseBigtableTableAdminClient
+   *           .createTableFromSnapshotAsync(parent, tableId, sourceSnapshot)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param sourceSnapshot Required. The unique name of the snapshot from which to restore the + * table. The snapshot and the table must be in the same instance. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTableFromSnapshotAsync( + InstanceName parent, String tableId, SnapshotName sourceSnapshot) { + CreateTableFromSnapshotRequest request = + CreateTableFromSnapshotRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTableId(tableId) + .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString()) + .build(); + return createTableFromSnapshotAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   String tableId = "tableId-1552905847";
+   *   String sourceSnapshot =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
+   *   Table response =
+   *       baseBigtableTableAdminClient
+   *           .createTableFromSnapshotAsync(parent, tableId, sourceSnapshot)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param sourceSnapshot Required. The unique name of the snapshot from which to restore the + * table. The snapshot and the table must be in the same instance. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTableFromSnapshotAsync( + InstanceName parent, String tableId, String sourceSnapshot) { + CreateTableFromSnapshotRequest request = + CreateTableFromSnapshotRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTableId(tableId) + .setSourceSnapshot(sourceSnapshot) + .build(); + return createTableFromSnapshotAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   String tableId = "tableId-1552905847";
+   *   SnapshotName sourceSnapshot =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
+   *   Table response =
+   *       baseBigtableTableAdminClient
+   *           .createTableFromSnapshotAsync(parent, tableId, sourceSnapshot)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param sourceSnapshot Required. The unique name of the snapshot from which to restore the + * table. The snapshot and the table must be in the same instance. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTableFromSnapshotAsync( + String parent, String tableId, SnapshotName sourceSnapshot) { + CreateTableFromSnapshotRequest request = + CreateTableFromSnapshotRequest.newBuilder() + .setParent(parent) + .setTableId(tableId) + .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString()) + .build(); + return createTableFromSnapshotAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   String tableId = "tableId-1552905847";
+   *   String sourceSnapshot =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
+   *   Table response =
+   *       baseBigtableTableAdminClient
+   *           .createTableFromSnapshotAsync(parent, tableId, sourceSnapshot)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance in which to create the table. Values + * are of the form `projects/{project}/instances/{instance}`. + * @param tableId Required. The name by which the new table should be referred to within the + * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + * @param sourceSnapshot Required. The unique name of the snapshot from which to restore the + * table. The snapshot and the table must be in the same instance. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTableFromSnapshotAsync( + String parent, String tableId, String sourceSnapshot) { + CreateTableFromSnapshotRequest request = + CreateTableFromSnapshotRequest.newBuilder() + .setParent(parent) + .setTableId(tableId) + .setSourceSnapshot(sourceSnapshot) + .build(); + return createTableFromSnapshotAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateTableFromSnapshotRequest request =
+   *       CreateTableFromSnapshotRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .setSourceSnapshot(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.createTableFromSnapshotAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTableFromSnapshotAsync( + CreateTableFromSnapshotRequest request) { + return createTableFromSnapshotOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateTableFromSnapshotRequest request =
+   *       CreateTableFromSnapshotRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .setSourceSnapshot(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient
+   *           .createTableFromSnapshotOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Table response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationCallable() { + return stub.createTableFromSnapshotOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new table from the specified snapshot. The target table must not exist. The snapshot + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateTableFromSnapshotRequest request =
+   *       CreateTableFromSnapshotRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .setSourceSnapshot(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createTableFromSnapshotCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createTableFromSnapshotCallable() { + return stub.createTableFromSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all tables served from a specified instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+   *   for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which tables should be listed. + * Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTablesPagedResponse listTables(InstanceName parent) { + ListTablesRequest request = + ListTablesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listTables(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all tables served from a specified instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+   *   for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the instance for which tables should be listed. + * Values are of the form `projects/{project}/instances/{instance}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTablesPagedResponse listTables(String parent) { + ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build(); + return listTables(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all tables served from a specified instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListTablesRequest request =
+   *       ListTablesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Table element : baseBigtableTableAdminClient.listTables(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTablesPagedResponse listTables(ListTablesRequest request) { + return listTablesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all tables served from a specified instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListTablesRequest request =
+   *       ListTablesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture
future = + * baseBigtableTableAdminClient.listTablesPagedCallable().futureCall(request); + * // Do something. + * for (Table element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + */ + public final UnaryCallable listTablesPagedCallable() { + return stub.listTablesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all tables served from a specified instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListTablesRequest request =
+   *       ListTablesRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTablesResponse response =
+   *         baseBigtableTableAdminClient.listTablesCallable().call(request);
+   *     for (Table element : response.getTablesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTablesCallable() { + return stub.listTablesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   Table response = baseBigtableTableAdminClient.getTable(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested table. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table getTable(TableName name) { + GetTableRequest request = + GetTableRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   Table response = baseBigtableTableAdminClient.getTable(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested table. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table getTable(String name) { + GetTableRequest request = GetTableRequest.newBuilder().setName(name).build(); + return getTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetTableRequest request =
+   *       GetTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.getTable(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table getTable(GetTableRequest request) { + return getTableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetTableRequest request =
+   *       GetTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture
future = baseBigtableTableAdminClient.getTableCallable().futureCall(request); + * // Do something. + * Table response = future.get(); + * } + * } + */ + public final UnaryCallable getTableCallable() { + return stub.getTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   Table table = Table.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Table response = baseBigtableTableAdminClient.updateTableAsync(table, updateMask).get();
+   * }
+   * }
+ * + * @param table Required. The table to update. The table's `name` field is used to identify the + * table to update. + * @param updateMask Required. The list of fields to update. A mask specifying which fields (e.g. + * `change_stream_config`) in the `table` field should be updated. This mask is relative to + * the `table` field, not to the request message. The wildcard (*) path is currently not + * supported. Currently UpdateTable is only supported for the following fields: + *
    + *
  • `change_stream_config` + *
  • `change_stream_config.retention_period` + *
  • `deletion_protection` + *
  • `row_key_schema` + *
+ *

If `column_families` is set in `update_mask`, it will return an UNIMPLEMENTED error. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTableAsync( + Table table, FieldMask updateMask) { + UpdateTableRequest request = + UpdateTableRequest.newBuilder().setTable(table).setUpdateMask(updateMask).build(); + return updateTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateTableRequest request =
+   *       UpdateTableRequest.newBuilder()
+   *           .setTable(Table.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.updateTableAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTableAsync( + UpdateTableRequest request) { + return updateTableOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateTableRequest request =
+   *       UpdateTableRequest.newBuilder()
+   *           .setTable(Table.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.updateTableOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Table response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateTableOperationCallable() { + return stub.updateTableOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateTableRequest request =
+   *       UpdateTableRequest.newBuilder()
+   *           .setTable(Table.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.updateTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateTableCallable() { + return stub.updateTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified table and all of its data. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   baseBigtableTableAdminClient.deleteTable(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTable(TableName name) { + DeleteTableRequest request = + DeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified table and all of its data. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   baseBigtableTableAdminClient.deleteTable(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTable(String name) { + DeleteTableRequest request = DeleteTableRequest.newBuilder().setName(name).build(); + deleteTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified table and all of its data. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteTableRequest request =
+   *       DeleteTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   baseBigtableTableAdminClient.deleteTable(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTable(DeleteTableRequest request) { + deleteTableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified table and all of its data. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteTableRequest request =
+   *       DeleteTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteTableCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteTableCallable() { + return stub.deleteTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a specified table which was accidentally deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to be restored. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteTableAsync(TableName name) { + UndeleteTableRequest request = + UndeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeleteTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a specified table which was accidentally deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to be restored. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteTableAsync(String name) { + UndeleteTableRequest request = UndeleteTableRequest.newBuilder().setName(name).build(); + return undeleteTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a specified table which was accidentally deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.undeleteTableAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteTableAsync( + UndeleteTableRequest request) { + return undeleteTableOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a specified table which was accidentally deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.undeleteTableOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Table response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + undeleteTableOperationCallable() { + return stub.undeleteTableOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restores a specified table which was accidentally deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.undeleteTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable undeleteTableCallable() { + return stub.undeleteTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   AuthorizedView authorizedView = AuthorizedView.newBuilder().build();
+   *   String authorizedViewId = "authorizedViewId-2074136549";
+   *   AuthorizedView response =
+   *       baseBigtableTableAdminClient
+   *           .createAuthorizedViewAsync(parent, authorizedView, authorizedViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. This is the name of the table the AuthorizedView belongs to. Values are + * of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param authorizedView Required. The AuthorizedView to create. + * @param authorizedViewId Required. The id of the AuthorizedView to create. This AuthorizedView + * must not already exist. The `authorized_view_id` appended to `parent` forms the full + * AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAuthorizedViewAsync( + TableName parent, AuthorizedView authorizedView, String authorizedViewId) { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAuthorizedView(authorizedView) + .setAuthorizedViewId(authorizedViewId) + .build(); + return createAuthorizedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   AuthorizedView authorizedView = AuthorizedView.newBuilder().build();
+   *   String authorizedViewId = "authorizedViewId-2074136549";
+   *   AuthorizedView response =
+   *       baseBigtableTableAdminClient
+   *           .createAuthorizedViewAsync(parent, authorizedView, authorizedViewId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. This is the name of the table the AuthorizedView belongs to. Values are + * of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param authorizedView Required. The AuthorizedView to create. + * @param authorizedViewId Required. The id of the AuthorizedView to create. This AuthorizedView + * must not already exist. The `authorized_view_id` appended to `parent` forms the full + * AuthorizedView name of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAuthorizedViewAsync( + String parent, AuthorizedView authorizedView, String authorizedViewId) { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.newBuilder() + .setParent(parent) + .setAuthorizedView(authorizedView) + .setAuthorizedViewId(authorizedViewId) + .build(); + return createAuthorizedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateAuthorizedViewRequest request =
+   *       CreateAuthorizedViewRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setAuthorizedViewId("authorizedViewId-2074136549")
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .build();
+   *   AuthorizedView response =
+   *       baseBigtableTableAdminClient.createAuthorizedViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAuthorizedViewAsync(CreateAuthorizedViewRequest request) { + return createAuthorizedViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateAuthorizedViewRequest request =
+   *       CreateAuthorizedViewRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setAuthorizedViewId("authorizedViewId-2074136549")
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.createAuthorizedViewOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizedView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationCallable() { + return stub.createAuthorizedViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateAuthorizedViewRequest request =
+   *       CreateAuthorizedViewRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setAuthorizedViewId("authorizedViewId-2074136549")
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createAuthorizedViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createAuthorizedViewCallable() { + return stub.createAuthorizedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all AuthorizedViews from a specific table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   for (AuthorizedView element :
+   *       baseBigtableTableAdminClient.listAuthorizedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAuthorizedViewsPagedResponse listAuthorizedViews(TableName parent) { + ListAuthorizedViewsRequest request = + ListAuthorizedViewsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAuthorizedViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all AuthorizedViews from a specific table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   for (AuthorizedView element :
+   *       baseBigtableTableAdminClient.listAuthorizedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the table for which AuthorizedViews should be + * listed. Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAuthorizedViewsPagedResponse listAuthorizedViews(String parent) { + ListAuthorizedViewsRequest request = + ListAuthorizedViewsRequest.newBuilder().setParent(parent).build(); + return listAuthorizedViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all AuthorizedViews from a specific table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListAuthorizedViewsRequest request =
+   *       ListAuthorizedViewsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AuthorizedView element :
+   *       baseBigtableTableAdminClient.listAuthorizedViews(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAuthorizedViewsPagedResponse listAuthorizedViews( + ListAuthorizedViewsRequest request) { + return listAuthorizedViewsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all AuthorizedViews from a specific table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListAuthorizedViewsRequest request =
+   *       ListAuthorizedViewsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listAuthorizedViewsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AuthorizedView element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAuthorizedViewsPagedCallable() { + return stub.listAuthorizedViewsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all AuthorizedViews from a specific table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListAuthorizedViewsRequest request =
+   *       ListAuthorizedViewsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAuthorizedViewsResponse response =
+   *         baseBigtableTableAdminClient.listAuthorizedViewsCallable().call(request);
+   *     for (AuthorizedView element : response.getAuthorizedViewsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAuthorizedViewsCallable() { + return stub.listAuthorizedViewsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information from a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   AuthorizedViewName name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested AuthorizedView. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AuthorizedView getAuthorizedView(AuthorizedViewName name) { + GetAuthorizedViewRequest request = + GetAuthorizedViewRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAuthorizedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information from a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *           .toString();
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested AuthorizedView. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AuthorizedView getAuthorizedView(String name) { + GetAuthorizedViewRequest request = GetAuthorizedViewRequest.newBuilder().setName(name).build(); + return getAuthorizedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information from a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetAuthorizedViewRequest request =
+   *       GetAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .build();
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AuthorizedView getAuthorizedView(GetAuthorizedViewRequest request) { + return getAuthorizedViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information from a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetAuthorizedViewRequest request =
+   *       GetAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getAuthorizedViewCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizedView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAuthorizedViewCallable() { + return stub.getAuthorizedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   AuthorizedView authorizedView = AuthorizedView.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AuthorizedView response =
+   *       baseBigtableTableAdminClient.updateAuthorizedViewAsync(authorizedView, updateMask).get();
+   * }
+   * }
+ * + * @param authorizedView Required. The AuthorizedView to update. The `name` in `authorized_view` + * is used to identify the AuthorizedView. AuthorizedView name must in this format: + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @param updateMask Optional. The list of fields to update. A mask specifying which fields in the + * AuthorizedView resource should be updated. This mask is relative to the AuthorizedView + * resource, not to the request message. A field will be overwritten if it is in the mask. If + * empty, all fields set in the request will be overwritten. A special value `*` means to + * overwrite all fields (including fields not set in the request). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateAuthorizedViewAsync(AuthorizedView authorizedView, FieldMask updateMask) { + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView(authorizedView) + .setUpdateMask(updateMask) + .build(); + return updateAuthorizedViewAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateAuthorizedViewRequest request =
+   *       UpdateAuthorizedViewRequest.newBuilder()
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   AuthorizedView response =
+   *       baseBigtableTableAdminClient.updateAuthorizedViewAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateAuthorizedViewAsync(UpdateAuthorizedViewRequest request) { + return updateAuthorizedViewOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateAuthorizedViewRequest request =
+   *       UpdateAuthorizedViewRequest.newBuilder()
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.updateAuthorizedViewOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizedView response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationCallable() { + return stub.updateAuthorizedViewOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an AuthorizedView in a table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateAuthorizedViewRequest request =
+   *       UpdateAuthorizedViewRequest.newBuilder()
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.updateAuthorizedViewCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateAuthorizedViewCallable() { + return stub.updateAuthorizedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   AuthorizedViewName name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   baseBigtableTableAdminClient.deleteAuthorizedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the AuthorizedView to be deleted. Values are of the + * form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAuthorizedView(AuthorizedViewName name) { + DeleteAuthorizedViewRequest request = + DeleteAuthorizedViewRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAuthorizedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *           .toString();
+   *   baseBigtableTableAdminClient.deleteAuthorizedView(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the AuthorizedView to be deleted. Values are of the + * form + * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAuthorizedView(String name) { + DeleteAuthorizedViewRequest request = + DeleteAuthorizedViewRequest.newBuilder().setName(name).build(); + deleteAuthorizedView(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteAuthorizedViewRequest request =
+   *       DeleteAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   baseBigtableTableAdminClient.deleteAuthorizedView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAuthorizedView(DeleteAuthorizedViewRequest request) { + deleteAuthorizedViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified AuthorizedView. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteAuthorizedViewRequest request =
+   *       DeleteAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteAuthorizedViewCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAuthorizedViewCallable() { + return stub.deleteAuthorizedViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a series of column family modifications on the specified table. Either all or none of + * the modifications will occur before this method returns, but data requests received prior to + * that point may see a table where only some modifications have taken effect. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   List modifications = new ArrayList<>();
+   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name, modifications);
+   * }
+   * }
+ * + * @param name Required. The unique name of the table whose families should be modified. Values + * are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param modifications Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications can be masked by + * later ones (in the case of repeated updates to the same family, for example). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table modifyColumnFamilies( + TableName name, List modifications) { + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .addAllModifications(modifications) + .build(); + return modifyColumnFamilies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a series of column family modifications on the specified table. Either all or none of + * the modifications will occur before this method returns, but data requests received prior to + * that point may see a table where only some modifications have taken effect. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   List modifications = new ArrayList<>();
+   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name, modifications);
+   * }
+   * }
+ * + * @param name Required. The unique name of the table whose families should be modified. Values + * are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param modifications Required. Modifications to be atomically applied to the specified table's + * families. Entries are applied in order, meaning that earlier modifications can be masked by + * later ones (in the case of repeated updates to the same family, for example). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table modifyColumnFamilies( + String name, List modifications) { + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(name) + .addAllModifications(modifications) + .build(); + return modifyColumnFamilies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a series of column family modifications on the specified table. Either all or none of + * the modifications will occur before this method returns, but data requests received prior to + * that point may see a table where only some modifications have taken effect. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ModifyColumnFamiliesRequest request =
+   *       ModifyColumnFamiliesRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .addAllModifications(new ArrayList())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Table modifyColumnFamilies(ModifyColumnFamiliesRequest request) { + return modifyColumnFamiliesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs a series of column family modifications on the specified table. Either all or none of + * the modifications will occur before this method returns, but data requests received prior to + * that point may see a table where only some modifications have taken effect. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ModifyColumnFamiliesRequest request =
+   *       ModifyColumnFamiliesRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .addAllModifications(new ArrayList())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture
future = + * baseBigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request); + * // Do something. + * Table response = future.get(); + * } + * } + */ + public final UnaryCallable modifyColumnFamiliesCallable() { + return stub.modifyColumnFamiliesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently drop/delete a row range from a specified table. The request can specify whether to + * delete all rows in a table, or only those that match a particular prefix. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DropRowRangeRequest request =
+   *       DropRowRangeRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   baseBigtableTableAdminClient.dropRowRange(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void dropRowRange(DropRowRangeRequest request) { + dropRowRangeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently drop/delete a row range from a specified table. The request can specify whether to + * delete all rows in a table, or only those that match a particular prefix. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DropRowRangeRequest request =
+   *       DropRowRangeRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.dropRowRangeCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable dropRowRangeCallable() { + return stub.dropRowRangeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a consistency token for a Table, which can be used in CheckConsistency to check + * whether mutations to the table that finished before this call started have been replicated. The + * tokens will be available for 90 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   GenerateConsistencyTokenResponse response =
+   *       baseBigtableTableAdminClient.generateConsistencyToken(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the Table for which to create a consistency token. + * Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateConsistencyTokenResponse generateConsistencyToken(TableName name) { + GenerateConsistencyTokenRequest request = + GenerateConsistencyTokenRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return generateConsistencyToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a consistency token for a Table, which can be used in CheckConsistency to check + * whether mutations to the table that finished before this call started have been replicated. The + * tokens will be available for 90 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   GenerateConsistencyTokenResponse response =
+   *       baseBigtableTableAdminClient.generateConsistencyToken(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the Table for which to create a consistency token. + * Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateConsistencyTokenResponse generateConsistencyToken(String name) { + GenerateConsistencyTokenRequest request = + GenerateConsistencyTokenRequest.newBuilder().setName(name).build(); + return generateConsistencyToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a consistency token for a Table, which can be used in CheckConsistency to check + * whether mutations to the table that finished before this call started have been replicated. The + * tokens will be available for 90 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GenerateConsistencyTokenRequest request =
+   *       GenerateConsistencyTokenRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   GenerateConsistencyTokenResponse response =
+   *       baseBigtableTableAdminClient.generateConsistencyToken(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateConsistencyTokenResponse generateConsistencyToken( + GenerateConsistencyTokenRequest request) { + return generateConsistencyTokenCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generates a consistency token for a Table, which can be used in CheckConsistency to check + * whether mutations to the table that finished before this call started have been replicated. The + * tokens will be available for 90 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GenerateConsistencyTokenRequest request =
+   *       GenerateConsistencyTokenRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.generateConsistencyTokenCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateConsistencyTokenResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateConsistencyTokenCallable() { + return stub.generateConsistencyTokenCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks replication consistency based on a consistency token, that is, if replication has caught + * up based on the conditions specified in the token and the check request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   String consistencyToken = "consistencyToken-1985152319";
+   *   CheckConsistencyResponse response =
+   *       baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
+   * }
+   * }
+ * + * @param name Required. The unique name of the Table for which to check replication consistency. + * Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param consistencyToken Required. The token created using GenerateConsistencyToken for the + * Table. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CheckConsistencyResponse checkConsistency(TableName name, String consistencyToken) { + CheckConsistencyRequest request = + CheckConsistencyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setConsistencyToken(consistencyToken) + .build(); + return checkConsistency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks replication consistency based on a consistency token, that is, if replication has caught + * up based on the conditions specified in the token and the check request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String consistencyToken = "consistencyToken-1985152319";
+   *   CheckConsistencyResponse response =
+   *       baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
+   * }
+   * }
+ * + * @param name Required. The unique name of the Table for which to check replication consistency. + * Values are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param consistencyToken Required. The token created using GenerateConsistencyToken for the + * Table. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CheckConsistencyResponse checkConsistency(String name, String consistencyToken) { + CheckConsistencyRequest request = + CheckConsistencyRequest.newBuilder() + .setName(name) + .setConsistencyToken(consistencyToken) + .build(); + return checkConsistency(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks replication consistency based on a consistency token, that is, if replication has caught + * up based on the conditions specified in the token and the check request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CheckConsistencyRequest request =
+   *       CheckConsistencyRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setConsistencyToken("consistencyToken-1985152319")
+   *           .build();
+   *   CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CheckConsistencyResponse checkConsistency(CheckConsistencyRequest request) { + return checkConsistencyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Checks replication consistency based on a consistency token, that is, if replication has caught + * up based on the conditions specified in the token and the check request. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CheckConsistencyRequest request =
+   *       CheckConsistencyRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setConsistencyToken("consistencyToken-1985152319")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.checkConsistencyCallable().futureCall(request);
+   *   // Do something.
+   *   CheckConsistencyResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + checkConsistencyCallable() { + return stub.checkConsistencyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   String snapshotId = "snapshotId-1113817601";
+   *   String description = "description-1724546052";
+   *   Snapshot response =
+   *       baseBigtableTableAdminClient
+   *           .snapshotTableAsync(name, cluster, snapshotId, description)
+   *           .get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to have the snapshot taken. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param cluster Required. The name of the cluster where the snapshot will be created in. Values + * are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param snapshotId Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather + * than `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param description Description of the snapshot. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture snapshotTableAsync( + TableName name, ClusterName cluster, String snapshotId, String description) { + SnapshotTableRequest request = + SnapshotTableRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setCluster(cluster == null ? null : cluster.toString()) + .setSnapshotId(snapshotId) + .setDescription(description) + .build(); + return snapshotTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   String cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   String snapshotId = "snapshotId-1113817601";
+   *   String description = "description-1724546052";
+   *   Snapshot response =
+   *       baseBigtableTableAdminClient
+   *           .snapshotTableAsync(name, cluster, snapshotId, description)
+   *           .get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to have the snapshot taken. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param cluster Required. The name of the cluster where the snapshot will be created in. Values + * are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param snapshotId Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather + * than `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param description Description of the snapshot. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture snapshotTableAsync( + TableName name, String cluster, String snapshotId, String description) { + SnapshotTableRequest request = + SnapshotTableRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setCluster(cluster) + .setSnapshotId(snapshotId) + .setDescription(description) + .build(); + return snapshotTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   String snapshotId = "snapshotId-1113817601";
+   *   String description = "description-1724546052";
+   *   Snapshot response =
+   *       baseBigtableTableAdminClient
+   *           .snapshotTableAsync(name, cluster, snapshotId, description)
+   *           .get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to have the snapshot taken. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param cluster Required. The name of the cluster where the snapshot will be created in. Values + * are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param snapshotId Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather + * than `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param description Description of the snapshot. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture snapshotTableAsync( + String name, ClusterName cluster, String snapshotId, String description) { + SnapshotTableRequest request = + SnapshotTableRequest.newBuilder() + .setName(name) + .setCluster(cluster == null ? null : cluster.toString()) + .setSnapshotId(snapshotId) + .setDescription(description) + .build(); + return snapshotTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   String snapshotId = "snapshotId-1113817601";
+   *   String description = "description-1724546052";
+   *   Snapshot response =
+   *       baseBigtableTableAdminClient
+   *           .snapshotTableAsync(name, cluster, snapshotId, description)
+   *           .get();
+   * }
+   * }
+ * + * @param name Required. The unique name of the table to have the snapshot taken. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param cluster Required. The name of the cluster where the snapshot will be created in. Values + * are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param snapshotId Required. The ID by which the new snapshot should be referred to within the + * parent cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather + * than `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + * @param description Description of the snapshot. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture snapshotTableAsync( + String name, String cluster, String snapshotId, String description) { + SnapshotTableRequest request = + SnapshotTableRequest.newBuilder() + .setName(name) + .setCluster(cluster) + .setSnapshotId(snapshotId) + .setDescription(description) + .build(); + return snapshotTableAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SnapshotTableRequest request =
+   *       SnapshotTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setCluster(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setSnapshotId("snapshotId-1113817601")
+   *           .setTtl(Duration.newBuilder().build())
+   *           .setDescription("description-1724546052")
+   *           .build();
+   *   Snapshot response = baseBigtableTableAdminClient.snapshotTableAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture snapshotTableAsync( + SnapshotTableRequest request) { + return snapshotTableOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SnapshotTableRequest request =
+   *       SnapshotTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setCluster(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setSnapshotId("snapshotId-1113817601")
+   *           .setTtl(Duration.newBuilder().build())
+   *           .setDescription("description-1724546052")
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.snapshotTableOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Snapshot response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + snapshotTableOperationCallable() { + return stub.snapshotTableOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new snapshot in the specified cluster from the specified source table. The cluster + * and the table must be in the same instance. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SnapshotTableRequest request =
+   *       SnapshotTableRequest.newBuilder()
+   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setCluster(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setSnapshotId("snapshotId-1113817601")
+   *           .setTtl(Duration.newBuilder().build())
+   *           .setDescription("description-1724546052")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.snapshotTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable snapshotTableCallable() { + return stub.snapshotTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
+   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested snapshot. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Snapshot getSnapshot(SnapshotName name) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
+   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the requested snapshot. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Snapshot getSnapshot(String name) { + GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setName(name).build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetSnapshotRequest request =
+   *       GetSnapshotRequest.newBuilder()
+   *           .setName(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Snapshot getSnapshot(GetSnapshotRequest request) { + return getSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetSnapshotRequest request =
+   *       GetSnapshotRequest.newBuilder()
+   *           .setName(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getSnapshotCallable().futureCall(request);
+   *   // Do something.
+   *   Snapshot response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSnapshotCallable() { + return stub.getSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all snapshots associated with the specified cluster. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the cluster for which snapshots should be listed. + * Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Use + * `{cluster} = '-'` to list snapshots for all clusters in an instance, e.g., + * `projects/{project}/instances/{instance}/clusters/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSnapshotsPagedResponse listSnapshots(ClusterName parent) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all snapshots associated with the specified cluster. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The unique name of the cluster for which snapshots should be listed. + * Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Use + * `{cluster} = '-'` to list snapshots for all clusters in an instance, e.g., + * `projects/{project}/instances/{instance}/clusters/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSnapshotsPagedResponse listSnapshots(String parent) { + ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setParent(parent).build(); + return listSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all snapshots associated with the specified cluster. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSnapshotsRequest request =
+   *       ListSnapshotsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest request) { + return listSnapshotsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all snapshots associated with the specified cluster. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSnapshotsRequest request =
+   *       ListSnapshotsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listSnapshotsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Snapshot element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSnapshotsPagedCallable() { + return stub.listSnapshotsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all snapshots associated with the specified cluster. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSnapshotsRequest request =
+   *       ListSnapshotsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSnapshotsResponse response =
+   *         baseBigtableTableAdminClient.listSnapshotsCallable().call(request);
+   *     for (Snapshot element : response.getSnapshotsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSnapshotsCallable() { + return stub.listSnapshotsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
+   *   baseBigtableTableAdminClient.deleteSnapshot(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the snapshot to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSnapshot(SnapshotName name) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
+   *   baseBigtableTableAdminClient.deleteSnapshot(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the snapshot to be deleted. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSnapshot(String name) { + DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name).build(); + deleteSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteSnapshotRequest request =
+   *       DeleteSnapshotRequest.newBuilder()
+   *           .setName(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   baseBigtableTableAdminClient.deleteSnapshot(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSnapshot(DeleteSnapshotRequest request) { + deleteSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes the specified snapshot. + * + *

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not + * currently available to most Cloud Bigtable customers. This feature might be changed in + * backward-incompatible ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteSnapshotRequest request =
+   *       DeleteSnapshotRequest.newBuilder()
+   *           .setName(
+   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteSnapshotCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSnapshotCallable() { + return stub.deleteSnapshotCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup [long-running + * operation][google.longrunning.Operation] can be used to track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation + * will stop the creation and delete the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   String backupId = "backupId2121930365";
+   *   Backup backup = Backup.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient.createBackupAsync(parent, backupId, backup).get();
+   * }
+   * }
+ * + * @param parent Required. This must be one of the clusters in the instance in which this table is + * located. The backup will be stored in this cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the backup to be created. The `backup_id` along with the + * parent `parent` are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param backup Required. The backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + ClusterName parent, String backupId, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackupId(backupId) + .setBackup(backup) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup [long-running + * operation][google.longrunning.Operation] can be used to track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation + * will stop the creation and delete the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   String backupId = "backupId2121930365";
+   *   Backup backup = Backup.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient.createBackupAsync(parent, backupId, backup).get();
+   * }
+   * }
+ * + * @param parent Required. This must be one of the clusters in the instance in which this table is + * located. The backup will be stored in this cluster. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the backup to be created. The `backup_id` along with the + * parent `parent` are combined as {parent}/backups/{backup_id} to create the full backup + * name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param backup Required. The backup to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + String parent, String backupId, Backup backup) { + CreateBackupRequest request = + CreateBackupRequest.newBuilder() + .setParent(parent) + .setBackupId(backupId) + .setBackup(backup) + .build(); + return createBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup [long-running + * operation][google.longrunning.Operation] can be used to track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation + * will stop the creation and delete the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   Backup response = baseBigtableTableAdminClient.createBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBackupAsync( + CreateBackupRequest request) { + return createBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup [long-running + * operation][google.longrunning.Operation] can be used to track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation + * will stop the creation and delete the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.createBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBackupOperationCallable() { + return stub.createBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts creating a new Cloud Bigtable Backup. The returned backup [long-running + * operation][google.longrunning.Operation] can be used to track creation of the backup. The + * [metadata][google.longrunning.Operation.metadata] field type is + * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + * [response][google.longrunning.Operation.response] field type is + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation + * will stop the creation and delete the backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateBackupRequest request =
+   *       CreateBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setBackup(Backup.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
+   *   Backup response = baseBigtableTableAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(BackupName name) { + GetBackupRequest request = + GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   Backup response = baseBigtableTableAdminClient.getBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(String name) { + GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); + return getBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .build();
+   *   Backup response = baseBigtableTableAdminClient.getBackup(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup getBackup(GetBackupRequest request) { + return getBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata on a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetBackupRequest request =
+   *       GetBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBackupCallable() { + return stub.getBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   Backup backup = Backup.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Backup response = baseBigtableTableAdminClient.updateBackup(backup, updateMask);
+   * }
+   * }
+ * + * @param backup Required. The backup to update. `backup.name`, and the fields to be updated as + * specified by `update_mask` are required. Other fields are ignored. Update is only supported + * for the following fields: + *

* `backup.expire_time`. + * @param updateMask Required. A mask specifying which fields (e.g. `expire_time`) in the Backup + * resource should be updated. This mask is relative to the Backup resource, not to the + * request message. The field mask must always be specified; this prevents any future fields + * from being erased accidentally by clients that do not know about them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup updateBackup(Backup backup, FieldMask updateMask) { + UpdateBackupRequest request = + UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); + return updateBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Backup response = baseBigtableTableAdminClient.updateBackup(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Backup updateBackup(UpdateBackupRequest request) { + return updateBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a pending or completed Cloud Bigtable Backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateBackupRequest request =
+   *       UpdateBackupRequest.newBuilder()
+   *           .setBackup(Backup.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.updateBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBackupCallable() { + return stub.updateBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
+   *   baseBigtableTableAdminClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to delete. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(BackupName name) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   baseBigtableTableAdminClient.deleteBackup(name);
+   * }
+   * }
+ * + * @param name Required. Name of the backup to delete. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + deleteBackup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .build();
+   *   baseBigtableTableAdminClient.deleteBackup(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBackup(DeleteBackupRequest request) { + deleteBackupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a pending or completed Cloud Bigtable backup. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteBackupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The cluster to list backups from. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Use `{cluster} = '-'` to list + * backups for all clusters in an instance, e.g., + * `projects/{project}/instances/{instance}/clusters/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ClusterName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The cluster to list backups from. Values are of the form + * `projects/{project}/instances/{instance}/clusters/{cluster}`. Use `{cluster} = '-'` to list + * backups for all clusters in an instance, e.g., + * `projects/{project}/instances/{instance}/clusters/-`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { + return listBackupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Backup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListBackupsResponse response =
+   *         baseBigtableTableAdminClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new table by restoring from a completed backup. The returned table [long-running + * operation][google.longrunning.Operation] can be used to track the progress of the operation, + * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is + * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Table][google.bigtable.admin.v2.Table], if successful. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   RestoreTableRequest request =
+   *       RestoreTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.restoreTableAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture restoreTableAsync( + RestoreTableRequest request) { + return restoreTableOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new table by restoring from a completed backup. The returned table [long-running + * operation][google.longrunning.Operation] can be used to track the progress of the operation, + * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is + * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Table][google.bigtable.admin.v2.Table], if successful. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   RestoreTableRequest request =
+   *       RestoreTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.restoreTableOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Table response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + restoreTableOperationCallable() { + return stub.restoreTableOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new table by restoring from a completed backup. The returned table [long-running + * operation][google.longrunning.Operation] can be used to track the progress of the operation, + * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is + * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + * [response][google.longrunning.Operation.response] type is + * [Table][google.bigtable.admin.v2.Table], if successful. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   RestoreTableRequest request =
+   *       RestoreTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.restoreTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable restoreTableCallable() { + return stub.restoreTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   String backupId = "backupId2121930365";
+   *   BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The name of the destination cluster that will contain the backup copy. + * The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the new backup. The `backup_id` along with `parent` are + * combined as {parent}/backups/{backup_id} to create the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param sourceBackup Required. The source backup to be copied from. The source backup needs to + * be in READY state for it to be copied. Copying a copied backup is not allowed. Once + * CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration + * until CopyBackup is finished. Values are of the form: + * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`. + * @param expireTime Required. Required. The expiration time of the copied backup with microsecond + * granularity that must be at least 6 hours and at most 30 days from the time the request is + * received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free + * the resources used by the backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyBackupAsync( + ClusterName parent, String backupId, BackupName sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackupId(backupId) + .setSourceBackup(sourceBackup == null ? null : sourceBackup.toString()) + .setExpireTime(expireTime) + .build(); + return copyBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+   *   String backupId = "backupId2121930365";
+   *   String sourceBackup =
+   *       BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The name of the destination cluster that will contain the backup copy. + * The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the new backup. The `backup_id` along with `parent` are + * combined as {parent}/backups/{backup_id} to create the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param sourceBackup Required. The source backup to be copied from. The source backup needs to + * be in READY state for it to be copied. Copying a copied backup is not allowed. Once + * CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration + * until CopyBackup is finished. Values are of the form: + * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`. + * @param expireTime Required. Required. The expiration time of the copied backup with microsecond + * granularity that must be at least 6 hours and at most 30 days from the time the request is + * received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free + * the resources used by the backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyBackupAsync( + ClusterName parent, String backupId, String sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBackupId(backupId) + .setSourceBackup(sourceBackup) + .setExpireTime(expireTime) + .build(); + return copyBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   String backupId = "backupId2121930365";
+   *   BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The name of the destination cluster that will contain the backup copy. + * The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the new backup. The `backup_id` along with `parent` are + * combined as {parent}/backups/{backup_id} to create the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param sourceBackup Required. The source backup to be copied from. The source backup needs to + * be in READY state for it to be copied. Copying a copied backup is not allowed. Once + * CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration + * until CopyBackup is finished. Values are of the form: + * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`. + * @param expireTime Required. Required. The expiration time of the copied backup with microsecond + * granularity that must be at least 6 hours and at most 30 days from the time the request is + * received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free + * the resources used by the backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyBackupAsync( + String parent, String backupId, BackupName sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() + .setParent(parent) + .setBackupId(backupId) + .setSourceBackup(sourceBackup == null ? null : sourceBackup.toString()) + .setExpireTime(expireTime) + .build(); + return copyBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
+   *   String backupId = "backupId2121930365";
+   *   String sourceBackup =
+   *       BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
+   *   Backup response =
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The name of the destination cluster that will contain the backup copy. + * The cluster must already exist. Values are of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}`. + * @param backupId Required. The id of the new backup. The `backup_id` along with `parent` are + * combined as {parent}/backups/{backup_id} to create the full backup name, of the form: + * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. This + * string must be between 1 and 50 characters in length and match the regex + * [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + * @param sourceBackup Required. The source backup to be copied from. The source backup needs to + * be in READY state for it to be copied. Copying a copied backup is not allowed. Once + * CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration + * until CopyBackup is finished. Values are of the form: + * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`. + * @param expireTime Required. Required. The expiration time of the copied backup with microsecond + * granularity that must be at least 6 hours and at most 30 days from the time the request is + * received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free + * the resources used by the backup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyBackupAsync( + String parent, String backupId, String sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() + .setParent(parent) + .setBackupId(backupId) + .setSourceBackup(sourceBackup) + .setExpireTime(expireTime) + .build(); + return copyBackupAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   Backup response = baseBigtableTableAdminClient.copyBackupAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyBackupAsync( + CopyBackupRequest request) { + return copyBackupOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.copyBackupOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Backup response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + copyBackupOperationCallable() { + return stub.copyBackupOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the + * destination instance and project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setBackupId("backupId2121930365")
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.copyBackupCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable copyBackupCallable() { + return stub.copyBackupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ResourceName resource =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a Bigtable resource. Returns an empty policy if the resource + * exists but does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on a Bigtable resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ResourceName resource =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on a Bigtable resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on a Bigtable resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on a Bigtable resource. Replaces any existing policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified Bigtable resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ResourceName resource =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified Bigtable resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified Bigtable resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableTableAdminClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that the caller has on the specified Bigtable resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   String schemaBundleId = "schemaBundleId2039843326";
+   *   SchemaBundle schemaBundle = SchemaBundle.newBuilder().build();
+   *   SchemaBundle response =
+   *       baseBigtableTableAdminClient
+   *           .createSchemaBundleAsync(parent, schemaBundleId, schemaBundle)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this schema bundle will be created. Values + * are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param schemaBundleId Required. The unique ID to use for the schema bundle, which will become + * the final component of the schema bundle's resource name. + * @param schemaBundle Required. The schema bundle to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSchemaBundleAsync( + TableName parent, String schemaBundleId, SchemaBundle schemaBundle) { + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSchemaBundleId(schemaBundleId) + .setSchemaBundle(schemaBundle) + .build(); + return createSchemaBundleAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String schemaBundleId = "schemaBundleId2039843326";
+   *   SchemaBundle schemaBundle = SchemaBundle.newBuilder().build();
+   *   SchemaBundle response =
+   *       baseBigtableTableAdminClient
+   *           .createSchemaBundleAsync(parent, schemaBundleId, schemaBundle)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this schema bundle will be created. Values + * are of the form `projects/{project}/instances/{instance}/tables/{table}`. + * @param schemaBundleId Required. The unique ID to use for the schema bundle, which will become + * the final component of the schema bundle's resource name. + * @param schemaBundle Required. The schema bundle to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSchemaBundleAsync( + String parent, String schemaBundleId, SchemaBundle schemaBundle) { + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.newBuilder() + .setParent(parent) + .setSchemaBundleId(schemaBundleId) + .setSchemaBundle(schemaBundle) + .build(); + return createSchemaBundleAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateSchemaBundleRequest request =
+   *       CreateSchemaBundleRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setSchemaBundleId("schemaBundleId2039843326")
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .build();
+   *   SchemaBundle response = baseBigtableTableAdminClient.createSchemaBundleAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSchemaBundleAsync( + CreateSchemaBundleRequest request) { + return createSchemaBundleOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateSchemaBundleRequest request =
+   *       CreateSchemaBundleRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setSchemaBundleId("schemaBundleId2039843326")
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.createSchemaBundleOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SchemaBundle response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationCallable() { + return stub.createSchemaBundleOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   CreateSchemaBundleRequest request =
+   *       CreateSchemaBundleRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setSchemaBundleId("schemaBundleId2039843326")
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createSchemaBundleCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSchemaBundleCallable() { + return stub.createSchemaBundleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SchemaBundle schemaBundle = SchemaBundle.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   SchemaBundle response =
+   *       baseBigtableTableAdminClient.updateSchemaBundleAsync(schemaBundle, updateMask).get();
+   * }
+   * }
+ * + * @param schemaBundle Required. The schema bundle to update. + *

The schema bundle's `name` field is used to identify the schema bundle to update. Values + * are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSchemaBundleAsync( + SchemaBundle schemaBundle, FieldMask updateMask) { + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.newBuilder() + .setSchemaBundle(schemaBundle) + .setUpdateMask(updateMask) + .build(); + return updateSchemaBundleAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateSchemaBundleRequest request =
+   *       UpdateSchemaBundleRequest.newBuilder()
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   SchemaBundle response = baseBigtableTableAdminClient.updateSchemaBundleAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSchemaBundleAsync( + UpdateSchemaBundleRequest request) { + return updateSchemaBundleOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateSchemaBundleRequest request =
+   *       UpdateSchemaBundleRequest.newBuilder()
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.updateSchemaBundleOperationCallable().futureCall(request);
+   *   // Do something.
+   *   SchemaBundle response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationCallable() { + return stub.updateSchemaBundleOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   UpdateSchemaBundleRequest request =
+   *       UpdateSchemaBundleRequest.newBuilder()
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.updateSchemaBundleCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSchemaBundleCallable() { + return stub.updateSchemaBundleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified schema bundle. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SchemaBundleName name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]");
+   *   SchemaBundle response = baseBigtableTableAdminClient.getSchemaBundle(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the schema bundle to retrieve. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SchemaBundle getSchemaBundle(SchemaBundleName name) { + GetSchemaBundleRequest request = + GetSchemaBundleRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSchemaBundle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified schema bundle. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]").toString();
+   *   SchemaBundle response = baseBigtableTableAdminClient.getSchemaBundle(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the schema bundle to retrieve. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SchemaBundle getSchemaBundle(String name) { + GetSchemaBundleRequest request = GetSchemaBundleRequest.newBuilder().setName(name).build(); + return getSchemaBundle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified schema bundle. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetSchemaBundleRequest request =
+   *       GetSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .build();
+   *   SchemaBundle response = baseBigtableTableAdminClient.getSchemaBundle(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SchemaBundle getSchemaBundle(GetSchemaBundleRequest request) { + return getSchemaBundleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets metadata information about the specified schema bundle. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   GetSchemaBundleRequest request =
+   *       GetSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getSchemaBundleCallable().futureCall(request);
+   *   // Do something.
+   *   SchemaBundle response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSchemaBundleCallable() { + return stub.getSchemaBundleCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema bundles associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   for (SchemaBundle element :
+   *       baseBigtableTableAdminClient.listSchemaBundles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of schema bundles. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemaBundlesPagedResponse listSchemaBundles(TableName parent) { + ListSchemaBundlesRequest request = + ListSchemaBundlesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSchemaBundles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema bundles associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   for (SchemaBundle element :
+   *       baseBigtableTableAdminClient.listSchemaBundles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of schema bundles. Values are of + * the form `projects/{project}/instances/{instance}/tables/{table}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemaBundlesPagedResponse listSchemaBundles(String parent) { + ListSchemaBundlesRequest request = + ListSchemaBundlesRequest.newBuilder().setParent(parent).build(); + return listSchemaBundles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema bundles associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSchemaBundlesRequest request =
+   *       ListSchemaBundlesRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SchemaBundle element :
+   *       baseBigtableTableAdminClient.listSchemaBundles(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemaBundlesPagedResponse listSchemaBundles(ListSchemaBundlesRequest request) { + return listSchemaBundlesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema bundles associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSchemaBundlesRequest request =
+   *       ListSchemaBundlesRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listSchemaBundlesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SchemaBundle element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSchemaBundlesPagedCallable() { + return stub.listSchemaBundlesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema bundles associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   ListSchemaBundlesRequest request =
+   *       ListSchemaBundlesRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSchemaBundlesResponse response =
+   *         baseBigtableTableAdminClient.listSchemaBundlesCallable().call(request);
+   *     for (SchemaBundle element : response.getSchemaBundlesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSchemaBundlesCallable() { + return stub.listSchemaBundlesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   SchemaBundleName name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]");
+   *   baseBigtableTableAdminClient.deleteSchemaBundle(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the schema bundle to delete. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSchemaBundle(SchemaBundleName name) { + DeleteSchemaBundleRequest request = + DeleteSchemaBundleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteSchemaBundle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   String name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]").toString();
+   *   baseBigtableTableAdminClient.deleteSchemaBundle(name);
+   * }
+   * }
+ * + * @param name Required. The unique name of the schema bundle to delete. Values are of the form + * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSchemaBundle(String name) { + DeleteSchemaBundleRequest request = + DeleteSchemaBundleRequest.newBuilder().setName(name).build(); + deleteSchemaBundle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteSchemaBundleRequest request =
+   *       DeleteSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   baseBigtableTableAdminClient.deleteSchemaBundle(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSchemaBundle(DeleteSchemaBundleRequest request) { + deleteSchemaBundleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a schema bundle in the specified table. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
+   *     BaseBigtableTableAdminClient.create()) {
+   *   DeleteSchemaBundleRequest request =
+   *       DeleteSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteSchemaBundleCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSchemaBundleCallable() { + return stub.deleteSchemaBundleCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTablesPagedResponse + extends AbstractPagedListResponse< + ListTablesRequest, + ListTablesResponse, + Table, + ListTablesPage, + ListTablesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTablesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTablesPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTablesPagedResponse(ListTablesPage page) { + super(page, ListTablesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTablesPage + extends AbstractPage { + + private ListTablesPage( + PageContext context, + ListTablesResponse response) { + super(context, response); + } + + private static ListTablesPage createEmptyPage() { + return new ListTablesPage(null, null); + } + + @Override + protected ListTablesPage createPage( + PageContext context, + ListTablesResponse response) { + return new ListTablesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTablesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTablesRequest, + ListTablesResponse, + Table, + ListTablesPage, + ListTablesFixedSizeCollection> { + + private ListTablesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTablesFixedSizeCollection createEmptyCollection() { + return new ListTablesFixedSizeCollection(null, 0); + } + + @Override + protected ListTablesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTablesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAuthorizedViewsPagedResponse + extends AbstractPagedListResponse< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + AuthorizedView, + ListAuthorizedViewsPage, + ListAuthorizedViewsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAuthorizedViewsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAuthorizedViewsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAuthorizedViewsPagedResponse(ListAuthorizedViewsPage page) { + super(page, ListAuthorizedViewsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAuthorizedViewsPage + extends AbstractPage< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + AuthorizedView, + ListAuthorizedViewsPage> { + + private ListAuthorizedViewsPage( + PageContext + context, + ListAuthorizedViewsResponse response) { + super(context, response); + } + + private static ListAuthorizedViewsPage createEmptyPage() { + return new ListAuthorizedViewsPage(null, null); + } + + @Override + protected ListAuthorizedViewsPage createPage( + PageContext + context, + ListAuthorizedViewsResponse response) { + return new ListAuthorizedViewsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAuthorizedViewsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + AuthorizedView, + ListAuthorizedViewsPage, + ListAuthorizedViewsFixedSizeCollection> { + + private ListAuthorizedViewsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAuthorizedViewsFixedSizeCollection createEmptyCollection() { + return new ListAuthorizedViewsFixedSizeCollection(null, 0); + } + + @Override + protected ListAuthorizedViewsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAuthorizedViewsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSnapshotsPagedResponse + extends AbstractPagedListResponse< + ListSnapshotsRequest, + ListSnapshotsResponse, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSnapshotsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSnapshotsPagedResponse(ListSnapshotsPage page) { + super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSnapshotsPage + extends AbstractPage< + ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> { + + private ListSnapshotsPage( + PageContext context, + ListSnapshotsResponse response) { + super(context, response); + } + + private static ListSnapshotsPage createEmptyPage() { + return new ListSnapshotsPage(null, null); + } + + @Override + protected ListSnapshotsPage createPage( + PageContext context, + ListSnapshotsResponse response) { + return new ListSnapshotsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSnapshotsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSnapshotsRequest, + ListSnapshotsResponse, + Snapshot, + ListSnapshotsPage, + ListSnapshotsFixedSizeCollection> { + + private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSnapshotsFixedSizeCollection createEmptyCollection() { + return new ListSnapshotsFixedSizeCollection(null, 0); + } + + @Override + protected ListSnapshotsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSnapshotsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBackupsPagedResponse + extends AbstractPagedListResponse< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBackupsPagedResponse(ListBackupsPage page) { + super(page, ListBackupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBackupsPage + extends AbstractPage { + + private ListBackupsPage( + PageContext context, + ListBackupsResponse response) { + super(context, response); + } + + private static ListBackupsPage createEmptyPage() { + return new ListBackupsPage(null, null); + } + + @Override + protected ListBackupsPage createPage( + PageContext context, + ListBackupsResponse response) { + return new ListBackupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBackupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBackupsRequest, + ListBackupsResponse, + Backup, + ListBackupsPage, + ListBackupsFixedSizeCollection> { + + private ListBackupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBackupsFixedSizeCollection createEmptyCollection() { + return new ListBackupsFixedSizeCollection(null, 0); + } + + @Override + protected ListBackupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBackupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSchemaBundlesPagedResponse + extends AbstractPagedListResponse< + ListSchemaBundlesRequest, + ListSchemaBundlesResponse, + SchemaBundle, + ListSchemaBundlesPage, + ListSchemaBundlesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSchemaBundlesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSchemaBundlesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSchemaBundlesPagedResponse(ListSchemaBundlesPage page) { + super(page, ListSchemaBundlesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSchemaBundlesPage + extends AbstractPage< + ListSchemaBundlesRequest, + ListSchemaBundlesResponse, + SchemaBundle, + ListSchemaBundlesPage> { + + private ListSchemaBundlesPage( + PageContext context, + ListSchemaBundlesResponse response) { + super(context, response); + } + + private static ListSchemaBundlesPage createEmptyPage() { + return new ListSchemaBundlesPage(null, null); + } + + @Override + protected ListSchemaBundlesPage createPage( + PageContext context, + ListSchemaBundlesResponse response) { + return new ListSchemaBundlesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSchemaBundlesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSchemaBundlesRequest, + ListSchemaBundlesResponse, + SchemaBundle, + ListSchemaBundlesPage, + ListSchemaBundlesFixedSizeCollection> { + + private ListSchemaBundlesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSchemaBundlesFixedSizeCollection createEmptyCollection() { + return new ListSchemaBundlesFixedSizeCollection(null, 0); + } + + @Override + protected ListSchemaBundlesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSchemaBundlesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java new file mode 100644 index 000000000000..19cc61a49011 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java @@ -0,0 +1,816 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotTableMetadata; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.UndeleteTableMetadata; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BaseBigtableTableAdminClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigtableadmin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTable: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableTableAdminSettings.Builder baseBigtableTableAdminSettingsBuilder =
+ *     BaseBigtableTableAdminSettings.newBuilder();
+ * baseBigtableTableAdminSettingsBuilder
+ *     .createTableSettings()
+ *     .setRetrySettings(
+ *         baseBigtableTableAdminSettingsBuilder
+ *             .createTableSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * BaseBigtableTableAdminSettings baseBigtableTableAdminSettings =
+ *     baseBigtableTableAdminSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createTableFromSnapshot: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BaseBigtableTableAdminSettings.Builder baseBigtableTableAdminSettingsBuilder =
+ *     BaseBigtableTableAdminSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableTableAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class BaseBigtableTableAdminSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createTable. */ + public UnaryCallSettings createTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createTableSettings(); + } + + /** Returns the object with the settings used for calls to createTableFromSnapshot. */ + public UnaryCallSettings + createTableFromSnapshotSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createTableFromSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to createTableFromSnapshot. */ + public OperationCallSettings< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()) + .createTableFromSnapshotOperationSettings(); + } + + /** Returns the object with the settings used for calls to listTables. */ + public PagedCallSettings + listTablesSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).listTablesSettings(); + } + + /** Returns the object with the settings used for calls to getTable. */ + public UnaryCallSettings getTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getTableSettings(); + } + + /** Returns the object with the settings used for calls to updateTable. */ + public UnaryCallSettings updateTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).updateTableSettings(); + } + + /** Returns the object with the settings used for calls to updateTable. */ + public OperationCallSettings + updateTableOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).updateTableOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteTable. */ + public UnaryCallSettings deleteTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).deleteTableSettings(); + } + + /** Returns the object with the settings used for calls to undeleteTable. */ + public UnaryCallSettings undeleteTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).undeleteTableSettings(); + } + + /** Returns the object with the settings used for calls to undeleteTable. */ + public OperationCallSettings + undeleteTableOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).undeleteTableOperationSettings(); + } + + /** Returns the object with the settings used for calls to createAuthorizedView. */ + public UnaryCallSettings createAuthorizedViewSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createAuthorizedViewSettings(); + } + + /** Returns the object with the settings used for calls to createAuthorizedView. */ + public OperationCallSettings< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()) + .createAuthorizedViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to listAuthorizedViews. */ + public PagedCallSettings< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).listAuthorizedViewsSettings(); + } + + /** Returns the object with the settings used for calls to getAuthorizedView. */ + public UnaryCallSettings getAuthorizedViewSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getAuthorizedViewSettings(); + } + + /** Returns the object with the settings used for calls to updateAuthorizedView. */ + public UnaryCallSettings updateAuthorizedViewSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).updateAuthorizedViewSettings(); + } + + /** Returns the object with the settings used for calls to updateAuthorizedView. */ + public OperationCallSettings< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()) + .updateAuthorizedViewOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAuthorizedView. */ + public UnaryCallSettings deleteAuthorizedViewSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).deleteAuthorizedViewSettings(); + } + + /** Returns the object with the settings used for calls to modifyColumnFamilies. */ + public UnaryCallSettings modifyColumnFamiliesSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).modifyColumnFamiliesSettings(); + } + + /** Returns the object with the settings used for calls to dropRowRange. */ + public UnaryCallSettings dropRowRangeSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).dropRowRangeSettings(); + } + + /** Returns the object with the settings used for calls to generateConsistencyToken. */ + public UnaryCallSettings + generateConsistencyTokenSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).generateConsistencyTokenSettings(); + } + + /** Returns the object with the settings used for calls to checkConsistency. */ + public UnaryCallSettings + checkConsistencySettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).checkConsistencySettings(); + } + + /** Returns the object with the settings used for calls to snapshotTable. */ + public UnaryCallSettings snapshotTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).snapshotTableSettings(); + } + + /** Returns the object with the settings used for calls to snapshotTable. */ + public OperationCallSettings + snapshotTableOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).snapshotTableOperationSettings(); + } + + /** Returns the object with the settings used for calls to getSnapshot. */ + public UnaryCallSettings getSnapshotSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to listSnapshots. */ + public PagedCallSettings + listSnapshotsSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).listSnapshotsSettings(); + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings deleteSnapshotSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).deleteSnapshotSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createBackupSettings(); + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getBackupSettings(); + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).updateBackupSettings(); + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).deleteBackupSettings(); + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).listBackupsSettings(); + } + + /** Returns the object with the settings used for calls to restoreTable. */ + public UnaryCallSettings restoreTableSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).restoreTableSettings(); + } + + /** Returns the object with the settings used for calls to restoreTable. */ + public OperationCallSettings + restoreTableOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).restoreTableOperationSettings(); + } + + /** Returns the object with the settings used for calls to copyBackup. */ + public UnaryCallSettings copyBackupSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).copyBackupSettings(); + } + + /** Returns the object with the settings used for calls to copyBackup. */ + public OperationCallSettings + copyBackupOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).copyBackupOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to createSchemaBundle. */ + public UnaryCallSettings createSchemaBundleSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).createSchemaBundleSettings(); + } + + /** Returns the object with the settings used for calls to createSchemaBundle. */ + public OperationCallSettings + createSchemaBundleOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()) + .createSchemaBundleOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateSchemaBundle. */ + public UnaryCallSettings updateSchemaBundleSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).updateSchemaBundleSettings(); + } + + /** Returns the object with the settings used for calls to updateSchemaBundle. */ + public OperationCallSettings + updateSchemaBundleOperationSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()) + .updateSchemaBundleOperationSettings(); + } + + /** Returns the object with the settings used for calls to getSchemaBundle. */ + public UnaryCallSettings getSchemaBundleSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).getSchemaBundleSettings(); + } + + /** Returns the object with the settings used for calls to listSchemaBundles. */ + public PagedCallSettings< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).listSchemaBundlesSettings(); + } + + /** Returns the object with the settings used for calls to deleteSchemaBundle. */ + public UnaryCallSettings deleteSchemaBundleSettings() { + return ((BigtableTableAdminStubSettings) getStubSettings()).deleteSchemaBundleSettings(); + } + + public static final BaseBigtableTableAdminSettings create(BigtableTableAdminStubSettings stub) + throws IOException { + return new BaseBigtableTableAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return BigtableTableAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return BigtableTableAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return BigtableTableAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BigtableTableAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return BigtableTableAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return BigtableTableAdminStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return BigtableTableAdminStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BaseBigtableTableAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for BaseBigtableTableAdminSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(BigtableTableAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(BaseBigtableTableAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(BigtableTableAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(BigtableTableAdminStubSettings.newBuilder()); + } + + public BigtableTableAdminStubSettings.Builder getStubSettingsBuilder() { + return ((BigtableTableAdminStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createTable. */ + public UnaryCallSettings.Builder createTableSettings() { + return getStubSettingsBuilder().createTableSettings(); + } + + /** Returns the builder for the settings used for calls to createTableFromSnapshot. */ + public UnaryCallSettings.Builder + createTableFromSnapshotSettings() { + return getStubSettingsBuilder().createTableFromSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to createTableFromSnapshot. */ + public OperationCallSettings.Builder< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings() { + return getStubSettingsBuilder().createTableFromSnapshotOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listTables. */ + public PagedCallSettings.Builder + listTablesSettings() { + return getStubSettingsBuilder().listTablesSettings(); + } + + /** Returns the builder for the settings used for calls to getTable. */ + public UnaryCallSettings.Builder getTableSettings() { + return getStubSettingsBuilder().getTableSettings(); + } + + /** Returns the builder for the settings used for calls to updateTable. */ + public UnaryCallSettings.Builder updateTableSettings() { + return getStubSettingsBuilder().updateTableSettings(); + } + + /** Returns the builder for the settings used for calls to updateTable. */ + public OperationCallSettings.Builder + updateTableOperationSettings() { + return getStubSettingsBuilder().updateTableOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTable. */ + public UnaryCallSettings.Builder deleteTableSettings() { + return getStubSettingsBuilder().deleteTableSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteTable. */ + public UnaryCallSettings.Builder undeleteTableSettings() { + return getStubSettingsBuilder().undeleteTableSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteTable. */ + public OperationCallSettings.Builder + undeleteTableOperationSettings() { + return getStubSettingsBuilder().undeleteTableOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createAuthorizedView. */ + public UnaryCallSettings.Builder + createAuthorizedViewSettings() { + return getStubSettingsBuilder().createAuthorizedViewSettings(); + } + + /** Returns the builder for the settings used for calls to createAuthorizedView. */ + public OperationCallSettings.Builder< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings() { + return getStubSettingsBuilder().createAuthorizedViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listAuthorizedViews. */ + public PagedCallSettings.Builder< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings() { + return getStubSettingsBuilder().listAuthorizedViewsSettings(); + } + + /** Returns the builder for the settings used for calls to getAuthorizedView. */ + public UnaryCallSettings.Builder + getAuthorizedViewSettings() { + return getStubSettingsBuilder().getAuthorizedViewSettings(); + } + + /** Returns the builder for the settings used for calls to updateAuthorizedView. */ + public UnaryCallSettings.Builder + updateAuthorizedViewSettings() { + return getStubSettingsBuilder().updateAuthorizedViewSettings(); + } + + /** Returns the builder for the settings used for calls to updateAuthorizedView. */ + public OperationCallSettings.Builder< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings() { + return getStubSettingsBuilder().updateAuthorizedViewOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAuthorizedView. */ + public UnaryCallSettings.Builder + deleteAuthorizedViewSettings() { + return getStubSettingsBuilder().deleteAuthorizedViewSettings(); + } + + /** Returns the builder for the settings used for calls to modifyColumnFamilies. */ + public UnaryCallSettings.Builder + modifyColumnFamiliesSettings() { + return getStubSettingsBuilder().modifyColumnFamiliesSettings(); + } + + /** Returns the builder for the settings used for calls to dropRowRange. */ + public UnaryCallSettings.Builder dropRowRangeSettings() { + return getStubSettingsBuilder().dropRowRangeSettings(); + } + + /** Returns the builder for the settings used for calls to generateConsistencyToken. */ + public UnaryCallSettings.Builder< + GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse> + generateConsistencyTokenSettings() { + return getStubSettingsBuilder().generateConsistencyTokenSettings(); + } + + /** Returns the builder for the settings used for calls to checkConsistency. */ + public UnaryCallSettings.Builder + checkConsistencySettings() { + return getStubSettingsBuilder().checkConsistencySettings(); + } + + /** Returns the builder for the settings used for calls to snapshotTable. */ + public UnaryCallSettings.Builder snapshotTableSettings() { + return getStubSettingsBuilder().snapshotTableSettings(); + } + + /** Returns the builder for the settings used for calls to snapshotTable. */ + public OperationCallSettings.Builder + snapshotTableOperationSettings() { + return getStubSettingsBuilder().snapshotTableOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getSnapshot. */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getStubSettingsBuilder().getSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings() { + return getStubSettingsBuilder().listSnapshotsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return getStubSettingsBuilder().deleteSnapshotSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return getStubSettingsBuilder().createBackupSettings(); + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return getStubSettingsBuilder().createBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getStubSettingsBuilder().getBackupSettings(); + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return getStubSettingsBuilder().updateBackupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return getStubSettingsBuilder().deleteBackupSettings(); + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return getStubSettingsBuilder().listBackupsSettings(); + } + + /** Returns the builder for the settings used for calls to restoreTable. */ + public UnaryCallSettings.Builder restoreTableSettings() { + return getStubSettingsBuilder().restoreTableSettings(); + } + + /** Returns the builder for the settings used for calls to restoreTable. */ + public OperationCallSettings.Builder + restoreTableOperationSettings() { + return getStubSettingsBuilder().restoreTableOperationSettings(); + } + + /** Returns the builder for the settings used for calls to copyBackup. */ + public UnaryCallSettings.Builder copyBackupSettings() { + return getStubSettingsBuilder().copyBackupSettings(); + } + + /** Returns the builder for the settings used for calls to copyBackup. */ + public OperationCallSettings.Builder + copyBackupOperationSettings() { + return getStubSettingsBuilder().copyBackupOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to createSchemaBundle. */ + public UnaryCallSettings.Builder + createSchemaBundleSettings() { + return getStubSettingsBuilder().createSchemaBundleSettings(); + } + + /** Returns the builder for the settings used for calls to createSchemaBundle. */ + public OperationCallSettings.Builder< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationSettings() { + return getStubSettingsBuilder().createSchemaBundleOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateSchemaBundle. */ + public UnaryCallSettings.Builder + updateSchemaBundleSettings() { + return getStubSettingsBuilder().updateSchemaBundleSettings(); + } + + /** Returns the builder for the settings used for calls to updateSchemaBundle. */ + public OperationCallSettings.Builder< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationSettings() { + return getStubSettingsBuilder().updateSchemaBundleOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getSchemaBundle. */ + public UnaryCallSettings.Builder + getSchemaBundleSettings() { + return getStubSettingsBuilder().getSchemaBundleSettings(); + } + + /** Returns the builder for the settings used for calls to listSchemaBundles. */ + public PagedCallSettings.Builder< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings() { + return getStubSettingsBuilder().listSchemaBundlesSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSchemaBundle. */ + public UnaryCallSettings.Builder + deleteSchemaBundleSettings() { + return getStubSettingsBuilder().deleteSchemaBundleSettings(); + } + + @Override + public BaseBigtableTableAdminSettings build() throws IOException { + return new BaseBigtableTableAdminSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java new file mode 100644 index 000000000000..0e5a9155a01d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java @@ -0,0 +1,2282 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import com.google.api.core.ApiAsyncFunction; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.NotFoundException; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.cloud.Policy; +import com.google.cloud.Policy.DefaultMarshaller; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.admin.v2.models.ClusterAutoscalingConfig; +import com.google.cloud.bigtable.admin.v2.models.CreateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateClusterRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.Instance; +import com.google.cloud.bigtable.admin.v2.models.LogicalView; +import com.google.cloud.bigtable.admin.v2.models.MaterializedView; +import com.google.cloud.bigtable.admin.v2.models.PartialListClustersException; +import com.google.cloud.bigtable.admin.v2.models.PartialListInstancesException; +import com.google.cloud.bigtable.admin.v2.models.UpdateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStub; +import com.google.common.base.Verify; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.util.FieldMaskUtil; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * Client for creating, configuring and deleting Cloud Bigtable instances, app profiles, and + * clusters. + * + *

See the individual methods for example code. + * + *

{@code
+ * // One instance per application.
+ * BigtableInstanceAdminClient client =  BigtableInstanceAdminClient.create("my-project");
+ * CreateInstanceRequest request = CreateInstanceRequest.of("my-instance")
+ *   .addCluster("my-cluster", "us-east1-c", 3, StorageType.SSD);
+ *
+ * Instance instance = client.createInstance(request);
+ *
+ * // Cleanup during application shutdown.
+ * client.close();
+ * }
+ * + *

Creating a new client is a very expensive operation and should only be done once and shared in + * an application. However, close() needs to be called on the client object to clean up resources + * such as threads during application shutdown. + * + *

This class can be customized by passing in a custom instance of BigtableInstanceAdminSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * BigtableInstanceAdminSettings settings = BigtableInstanceAdminSettings.newBuilder()
+ *   .setProjectId("my-project")
+ *   .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *   .build();
+ *
+ * BigtableInstanceAdminClient client = BigtableInstanceAdminClient.create(settings);
+ * }
+ * + * To customize the endpoint: + * + *
{@code
+ * BigtableInstanceAdminSettings.Builder settingsBuilder = BigtableInstanceAdminSettings.newBuilder()
+ *   .setProjectId("my-project");
+ *
+ * settingsBuilder.stubSettings()
+ *   .setEndpoint(myEndpoint);
+ *
+ * BigtableInstanceAdminClient client = BigtableInstanceAdminClient.create(settingsBuilder.build());
+ * }
+ */ +public final class BigtableInstanceAdminClient implements AutoCloseable { + private final String projectId; + private final BigtableInstanceAdminStub stub; + private final BaseBigtableInstanceAdminClient baseClient; + + /** Constructs an instance of BigtableInstanceAdminClient with the given project ID. */ + public static BigtableInstanceAdminClient create(@Nonnull String projectId) throws IOException { + return create(BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build()); + } + + /** Constructs an instance of BigtableInstanceAdminClient with the given settings. */ + public static BigtableInstanceAdminClient create(@Nonnull BigtableInstanceAdminSettings settings) + throws IOException { + return create(settings.getProjectId(), settings.getStubSettings().createStub()); + } + + /** Constructs an instance of BigtableInstanceAdminClient with the given project ID and stub. */ + public static BigtableInstanceAdminClient create( + @Nonnull String projectId, @Nonnull BigtableInstanceAdminStub stub) { + return new BigtableInstanceAdminClient(projectId, stub); + } + + private BigtableInstanceAdminClient( + @Nonnull String projectId, @Nonnull BigtableInstanceAdminStub stub) { + this.projectId = projectId; + this.stub = stub; + this.baseClient = BaseBigtableInstanceAdminClient.create(stub); + } + + /** Gets the project ID this client is associated with. */ + public String getProjectId() { + return projectId; + } + + /** + * Returns the modern autogenerated client. This provides access to the newest features and + * proto-based methods. + */ + public BaseBigtableInstanceAdminClient getBaseClient() { + return baseClient; + } + + /** Closes the client and frees all resources associated with it (like thread pools). */ + @Override + public void close() { + stub.close(); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createInstanceAsync(com.google.bigtable.admin.v2.CreateInstanceRequest)}. + * + *

Creates a new instance and returns its representation. + * + *

Sample code: + * + *

{@code
+   * Instance instance = client.createInstance(
+   *   CreateInstanceRequest.of("my-instance")
+   *     .addCluster("my-cluster", "us-east1-c", 3, StorageType.SSD)
+   * );
+   * }
+ * + * @see CreateInstanceRequest for details. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Instance createInstance(CreateInstanceRequest request) { + return ApiExceptions.callAndTranslateApiException(createInstanceAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createInstanceAsync(com.google.bigtable.admin.v2.CreateInstanceRequest)}. + * + *

Asynchronously creates a new instance and returns its representation wrapped in a future. + * + *

Sample code: + * + *

{@code
+   * ApiFuture instanceFuture = client.createInstanceAsync(
+   *   CreateInstanceRequest.of("my-instance")
+   *     .addCluster("my-cluster", "us-east1-c", 3, StorageType.SSD)
+   * );
+   *
+   * Instance instance = instanceFuture.get();
+   * }
+ * + * @see CreateInstanceRequest for details. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createInstanceAsync(CreateInstanceRequest request) { + return ApiFutures.transform( + stub.createInstanceOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public Instance apply(com.google.bigtable.admin.v2.Instance proto) { + return Instance.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateInstanceAsync(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest)}. + * + *

Updates a new instance and returns its representation. + * + *

Sample code: + * + *

{@code
+   * Instance instance = client.updateInstance(
+   *   UpdateInstanceRequest.of("my-instance")
+   *     .setProductionType()
+   * );
+   * }
+ * + * @see UpdateInstanceRequest for details. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Instance updateInstance(UpdateInstanceRequest request) { + return ApiExceptions.callAndTranslateApiException(updateInstanceAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateInstanceAsync(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest)}. + * + *

Asynchronously updates a new instance and returns its representation wrapped in a future. + * + *

Sample code: + * + *

{@code
+   * ApiFuture instanceFuture = client.updateInstanceAsync(
+   *   UpdateInstanceRequest.of("my-instance")
+   *     .setProductionType()
+   * );
+   *
+   * Instance instance = instanceFuture.get();
+   * }
+ * + * @see UpdateInstanceRequest for details. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateInstanceAsync(UpdateInstanceRequest request) { + return ApiFutures.transform( + stub.partialUpdateInstanceOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public Instance apply(com.google.bigtable.admin.v2.Instance proto) { + return Instance.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getInstance(com.google.bigtable.admin.v2.GetInstanceRequest)}. + * + *

Get the instance representation by ID. + * + *

Sample code: + * + *

{@code
+   * Instance instance = client.getInstance("my-instance");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Instance getInstance(String id) { + return ApiExceptions.callAndTranslateApiException(getInstanceAsync(id)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getInstance(com.google.bigtable.admin.v2.GetInstanceRequest)}. + * + *

Asynchronously gets the instance representation by ID wrapped in a future. + * + *

Sample code: + * + *

{@code
+   * ApiFuture instanceFuture = client.getInstanceAsync("my-instance");
+   * Instance instance = instanceFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getInstanceAsync(String instanceId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + + com.google.bigtable.admin.v2.GetInstanceRequest request = + com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.getInstanceCallable().futureCall(request), + new ApiFunction() { + @Override + public Instance apply(com.google.bigtable.admin.v2.Instance proto) { + return Instance.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listInstances(com.google.bigtable.admin.v2.ListInstancesRequest)}. + * + *

Lists all of the instances in the current project. + * + *

This method will throw a {@link PartialListInstancesException} when any zone is unavailable. + * If a partial list is OK, the exception can be caught and inspected. + * + *

Sample code: + * + *

{@code
+   * try {
+   *   List instances = client.listInstances();
+   * } catch (PartialListInstancesException e) {
+   *   System.out.println("The following zones are unavailable: " + e.getUnavailableZones());
+   *   System.out.println("But the following instances are reachable: " + e.getInstances());
+   * }
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listInstances() { + return ApiExceptions.callAndTranslateApiException(listInstancesAsync()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listInstances(com.google.bigtable.admin.v2.ListInstancesRequest)}. + * + *

Asynchronously lists all of the instances in the current project. + * + *

This method will throw a {@link PartialListInstancesException} when any zone is unavailable. + * If a partial list is OK, the exception can be caught and inspected. + * + *

Sample code: + * + *

{@code
+   * ApiFuture instancesFuture = client.listInstancesAsync();
+   *
+   * ApiFutures.addCallback(instancesFuture, new ApiFutureCallback>() {
+   *   public void onFailure(Throwable t) {
+   *     if (t instanceof PartialListInstancesException) {
+   *       PartialListInstancesException partialError = (PartialListInstancesException)t;
+   *       System.out.println("The following zones are unavailable: " + partialError.getUnavailableZones());
+   *       System.out.println("But the following instances are reachable: " + partialError.getInstances());
+   *     } else {
+   *       t.printStackTrace();
+   *     }
+   *   }
+   *
+   *   public void onSuccess(List result) {
+   *     System.out.println("Found a complete set of instances: " + result);
+   *   }
+   * }, MoreExecutors.directExecutor());
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listInstancesAsync() { + com.google.bigtable.admin.v2.ListInstancesRequest request = + com.google.bigtable.admin.v2.ListInstancesRequest.newBuilder() + .setParent(NameUtil.formatProjectName(projectId)) + .build(); + + ApiFuture responseFuture = + stub.listInstancesCallable().futureCall(request); + + return ApiFutures.transform( + responseFuture, + new ApiFunction>() { + @Override + public List apply(com.google.bigtable.admin.v2.ListInstancesResponse proto) { + // NOTE: Pagination is intentionally ignored. The server does not implement it and never + // will. + Verify.verify( + proto.getNextPageToken().isEmpty(), + "Server returned an unexpected paginated response"); + + ImmutableList.Builder instances = ImmutableList.builder(); + + for (com.google.bigtable.admin.v2.Instance protoInstance : proto.getInstancesList()) { + instances.add(Instance.fromProto(protoInstance)); + } + + ImmutableList.Builder failedZones = ImmutableList.builder(); + for (String locationStr : proto.getFailedLocationsList()) { + failedZones.add(NameUtil.extractZoneIdFromLocationName(locationStr)); + } + + if (!failedZones.build().isEmpty()) { + throw new PartialListInstancesException(failedZones.build(), instances.build()); + } + + return instances.build(); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteInstance(com.google.bigtable.admin.v2.DeleteInstanceRequest)}. + * + *

Deletes the specified instance. + * + *

Sample code: + * + *

{@code
+   * client.deleteInstance("my-instance");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteInstance(String instanceId) { + ApiExceptions.callAndTranslateApiException(deleteInstanceAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteInstance(com.google.bigtable.admin.v2.DeleteInstanceRequest)}. + * + *

Asynchronously deletes the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture deleteFuture = client.deleteInstanceAsync("my-instance");
+   * deleteFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteInstanceAsync(String instanceId) { + String instanceName = NameUtil.formatInstanceName(projectId, instanceId); + + com.google.bigtable.admin.v2.DeleteInstanceRequest request = + com.google.bigtable.admin.v2.DeleteInstanceRequest.newBuilder() + .setName(instanceName) + .build(); + + return ApiFutures.transform( + stub.deleteInstanceCallable().futureCall(request), + new ApiFunction() { + @Override + public Void apply(Empty input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getInstance(com.google.bigtable.admin.v2.GetInstanceRequest)}. + * + *

Checks if the instance specified by the instance ID exists. + * + *

Sample code: + * + *

{@code
+   * if(client.exists("my-instance")) {
+   *   System.out.println("Instance exists");
+   * }
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public boolean exists(String instanceId) { + return ApiExceptions.callAndTranslateApiException(existsAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getInstance(com.google.bigtable.admin.v2.GetInstanceRequest)}. + * + *

Asynchronously checks if the instance specified by the instance ID exists. + * + *

Sample code: + * + *

{@code
+   * ApiFuture found = client.existsAsync("my-instance");
+   *
+   * ApiFutures.addCallback(
+   *  found,
+   *  new ApiFutureCallback() {
+   *    public void onSuccess(Boolean found) {
+   *      if (found) {
+   *        System.out.println("Instance exists");
+   *      } else {
+   *        System.out.println("Instance not found");
+   *      }
+   *    }
+   *
+   *    public void onFailure(Throwable t) {
+   *      t.printStackTrace();
+   *    }
+   *  },
+   *  MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture existsAsync(String instanceId) { + ApiFuture protoFuture = getInstanceAsync(instanceId); + + ApiFuture existsFuture = + ApiFutures.transform( + protoFuture, + new ApiFunction() { + @Override + public Boolean apply(Instance ignored) { + return true; + } + }, + MoreExecutors.directExecutor()); + + return ApiFutures.catching( + existsFuture, + NotFoundException.class, + new ApiFunction() { + @Override + public Boolean apply(NotFoundException ignored) { + return false; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createClusterAsync(com.google.bigtable.admin.v2.CreateClusterRequest)}. + * + *

Creates a new cluster in the specified instance. + * + *

Sample code: + * + *

{@code
+   * Cluster cluster = client.createCluster(
+   *   CreateClusterRequest.of("my-instance", "my-new-cluster")
+   *     .setZone("us-east1-c")
+   *     .setServeNodes(3)
+   *     .setStorageType(StorageType.SSD)
+   * );
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Cluster createCluster(CreateClusterRequest request) { + return ApiExceptions.callAndTranslateApiException(createClusterAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createClusterAsync(com.google.bigtable.admin.v2.CreateClusterRequest)}. + * + *

Asynchronously creates a new cluster in the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture clusterFuture = client.createClusterAsync(
+   *   CreateClusterRequest.of("my-instance", "my-new-cluster")
+   *     .setZone("us-east1-c")
+   *     .setServeNodes(3)
+   *     .setStorageType(StorageType.SSD)
+   * );
+   *
+   * Cluster cluster = clusterFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createClusterAsync(CreateClusterRequest request) { + return ApiFutures.transform( + stub.createClusterOperationCallable().futureCall(request.toProto(projectId)), + Cluster::fromProto, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getCluster(com.google.bigtable.admin.v2.GetClusterRequest)}. + * + *

Gets the cluster representation by ID. + * + *

Sample code: + * + *

{@code
+   * Cluster cluster = client.getCluster("my-instance", "my-cluster");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Cluster getCluster(String instanceId, String clusterId) { + return ApiExceptions.callAndTranslateApiException(getClusterAsync(instanceId, clusterId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getCluster(com.google.bigtable.admin.v2.GetClusterRequest)}. + * + *

Asynchronously gets the cluster representation by ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture clusterFuture = client.getClusterAsync("my-instance", "my-cluster");
+   * Cluster cluster = clusterFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getClusterAsync(String instanceId, String clusterId) { + String name = NameUtil.formatClusterName(projectId, instanceId, clusterId); + + com.google.bigtable.admin.v2.GetClusterRequest request = + com.google.bigtable.admin.v2.GetClusterRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.getClusterCallable().futureCall(request), + new ApiFunction() { + @Override + public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { + return Cluster.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listClusters(com.google.bigtable.admin.v2.ListClustersRequest)}. + * + *

Lists all clusters in the specified instance. + * + *

This method will throw a {@link PartialListClustersException} when any zone is unavailable. + * If a partial list is OK, the exception can be caught and inspected. + * + *

Sample code: + * + *

{@code
+   * try {
+   *   List clusters = client.listClusters("my-instance");
+   * } catch (PartialListClustersException e) {
+   *   System.out.println("The following zones are unavailable: " + e.getUnavailableZones());
+   *   System.out.println("But the following clusters are reachable: " + e.getClusters())
+   * }
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listClusters(String instanceId) { + return ApiExceptions.callAndTranslateApiException(listClustersAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listClusters(com.google.bigtable.admin.v2.ListClustersRequest)}. + * + *

Asynchronously lists all clusters in the specified instance. + * + *

This method will throw a {@link PartialListClustersException} when any zone is unavailable. + * If a partial list is OK, the exception can be caught and inspected. + * + *

Sample code: + * + *

{@code
+   * ApiFuture clustersFuture = client.listClustersAsync("my-instance");
+   *
+   * ApiFutures.addCallback(clustersFuture, new ApiFutureCallback>() {
+   *   public void onFailure(Throwable t) {
+   *     if (t instanceof PartialListClustersException) {
+   *       PartialListClustersException partialError = (PartialListClustersException)t;
+   *       System.out.println("The following zones are unavailable: " + partialError.getUnavailableZones());
+   *       System.out.println("But the following clusters are reachable: " + partialError.getClusters());
+   *     } else {
+   *       t.printStackTrace();
+   *     }
+   *   }
+   *
+   *   public void onSuccess(List result) {
+   *     System.out.println("Found a complete set of instances: " + result);
+   *   }
+   * }, MoreExecutors.directExecutor());
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listClustersAsync(String instanceId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + com.google.bigtable.admin.v2.ListClustersRequest request = + com.google.bigtable.admin.v2.ListClustersRequest.newBuilder().setParent(name).build(); + + return ApiFutures.transform( + stub.listClustersCallable().futureCall(request), + new ApiFunction>() { + @Override + public List apply(com.google.bigtable.admin.v2.ListClustersResponse proto) { + // NOTE: Server-side pagination is not and will not be implemented, so remaining pages + // are not fetched. However, if that assumption turns out to be wrong, fail fast to + // avoid returning partial data. + Verify.verify( + proto.getNextPageToken().isEmpty(), + "Server returned an unexpected paginated response"); + + ImmutableList.Builder clusters = ImmutableList.builder(); + for (com.google.bigtable.admin.v2.Cluster cluster : proto.getClustersList()) { + clusters.add(Cluster.fromProto(cluster)); + } + + ImmutableList.Builder failedZones = ImmutableList.builder(); + for (String locationStr : proto.getFailedLocationsList()) { + failedZones.add(NameUtil.extractZoneIdFromLocationName(locationStr)); + } + + if (!failedZones.build().isEmpty()) { + throw new PartialListClustersException(failedZones.build(), clusters.build()); + } + + return clusters.build(); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Modifies the cluster's node count for manual scaling. If autoscaling is already enabled, + * manual scaling will be silently ignored. If you wish to disable autoscaling and enable manual + * scaling, please use {@link BigtableInstanceAdminClient#disableClusterAutoscaling(String, + * String, int)} instead. Please note that only clusters that belong to a production instance can + * be resized. + * + *

Sample code: + * + *

{@code
+   * Cluster cluster = client.resizeCluster("my-instance", "my-cluster", 30);
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Cluster resizeCluster(String instanceId, String clusterId, int numServeNodes) { + return ApiExceptions.callAndTranslateApiException( + resizeClusterAsync(instanceId, clusterId, numServeNodes)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Asynchronously modifies the cluster's node count for manual scaling. If autoscaling is + * already enabled, manual scaling will be silently ignored. If you wish to disable autoscaling + * and enable manual scaling, please use {@link + * BigtableInstanceAdminClient#disableClusterAutoscaling(String, String, int)} instead. Please + * note that only clusters that belong to a production instance can be resized. + * + *

{@code
+   * ApiFuture clusterFuture = client.resizeCluster("my-instance", "my-cluster", 30);
+   * Cluster cluster = clusterFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture resizeClusterAsync( + String instanceId, String clusterId, int numServeNodes) { + + String name = NameUtil.formatClusterName(projectId, instanceId, clusterId); + + com.google.bigtable.admin.v2.Cluster request = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(name) + .setServeNodes(numServeNodes) + .build(); + + return ApiFutures.transform( + stub.updateClusterOperationCallable().futureCall(request), + new ApiFunction() { + @Override + public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { + return Cluster.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Modifies the cluster's autoscaling config. This will enable autoscaling and disable manual + * scaling if the cluster is manually scaled. Please note that only clusters that belong to a + * production instance can enable autoscaling. + * + *

Sample code: + * + *

{@code
+   * ClusterAutoscalingConfig clusterAutoscalingConfig =
+   *      ClusterAutoscalingConfig.of("my-instance", "my-cluster")
+   *          .setMinNodes(1)
+   *          .setMaxNodes(4)
+   *          .setCpuUtilizationTargetPercent(40);
+   * Cluster cluster = client.updateClusterAutoscalingConfig(clusterAutoscalingConfig);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Cluster updateClusterAutoscalingConfig( + @Nonnull ClusterAutoscalingConfig clusterAutoscalingConfig) { + return ApiExceptions.callAndTranslateApiException( + updateClusterAutoscalingConfigAsync(clusterAutoscalingConfig)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Asynchronously modifies the cluster's autoscaling config. This will enable autoscaling and + * disable manual scaling if the cluster is manually scaled. Please note that only clusters that + * belong to a production instance can enable autoscaling. + * + *

Sample code: + * + *

{@code
+   * ClusterAutoscalingConfig clusterAutoscalingConfig =
+   *      ClusterAutoscalingConfig.of(targetInstanceId, targetClusterId)
+   *          .setMinNodes(1)
+   *          .setMaxNodes(4)
+   *          .setCpuUtilizationTargetPercent(40);
+   *
+   *  ApiFuture clusterApiFuture = client.updateClusterAutoscalingConfigAsync(clusterAutoscalingConfig);
+   *  Cluster cluster = clusterApiFuture.get();
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateClusterAutoscalingConfigAsync( + @Nonnull ClusterAutoscalingConfig clusterAutoscalingConfig) { + PartialUpdateClusterRequest proto = clusterAutoscalingConfig.toProto(projectId); + + return ApiFutures.transform( + stub.partialUpdateClusterOperationCallable().futureCall(proto), + Cluster::fromProto, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Disables autoscaling and enables manual scaling by setting a static node count for the + * cluster. Please note that only clusters that belong to a production instance can be resized. + * + *

Sample code: + * + *

{@code
+   * Cluster cluster = client.disableClusterAutoscaling("my-instance", "my-cluster", 3);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Cluster disableClusterAutoscaling(String instanceId, String clusterId, int staticSize) { + return ApiExceptions.callAndTranslateApiException( + disableClusterAutoscalingAsync(instanceId, clusterId, staticSize)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#partialUpdateClusterAsync(com.google.bigtable.admin.v2.PartialUpdateClusterRequest)}. + * + *

Asynchronously disables autoscaling and enables manual scaling by setting a static node + * count for the cluster. Please note that only clusters that belong to a production instance can + * be resized. + * + *

Sample code: + * + *

{@code
+   * ApiFuture clusterApiFuture = client.disableClusterAutoscalingAsync("my-instance", "my-cluster", 3);
+   * Cluster cluster = clusterApiFuture.get();
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture disableClusterAutoscalingAsync( + String instanceId, String clusterId, int staticSize) { + String name = NameUtil.formatClusterName(projectId, instanceId, clusterId); + + com.google.bigtable.admin.v2.Cluster request = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(name) + .setServeNodes(staticSize) + .setClusterConfig( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance()) + .build(); + + PartialUpdateClusterRequest partialUpdateClusterRequest = + PartialUpdateClusterRequest.newBuilder() + .setUpdateMask( + FieldMaskUtil.fromStringList( + com.google.bigtable.admin.v2.Cluster.class, + Lists.newArrayList("cluster_config.cluster_autoscaling_config", "serve_nodes"))) + .setCluster(request) + .build(); + return ApiFutures.transform( + stub.partialUpdateClusterOperationCallable().futureCall(partialUpdateClusterRequest), + Cluster::fromProto, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteCluster(com.google.bigtable.admin.v2.DeleteClusterRequest)}. + * + *

Deletes the specified cluster. Please note that an instance must have at least 1 cluster. To + * remove the last cluster, please use {@link BigtableInstanceAdminClient#deleteInstance(String)}. + * + *

Sample code: + * + *

{@code
+   * client.deleteCluster("my-instance", "my-cluster");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteCluster(String instanceId, String clusterId) { + ApiExceptions.callAndTranslateApiException(deleteClusterAsync(instanceId, clusterId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteCluster(com.google.bigtable.admin.v2.DeleteClusterRequest)}. + * + *

Asynchronously deletes the specified cluster. Please note that an instance must have at + * least 1 cluster. To remove the last cluster, please use {@link + * BigtableInstanceAdminClient#deleteInstanceAsync(String)}. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.deleteClusterAsync("my-instance", "my-cluster");
+   * future.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteClusterAsync(String instanceId, String clusterId) { + String name = NameUtil.formatClusterName(projectId, instanceId, clusterId); + + com.google.bigtable.admin.v2.DeleteClusterRequest request = + com.google.bigtable.admin.v2.DeleteClusterRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.deleteClusterCallable().futureCall(request), + new ApiFunction() { + @Override + public Void apply(Empty input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createAppProfile(com.google.bigtable.admin.v2.CreateAppProfileRequest)}. + * + *

Creates a new app profile. + * + *

Sample code: + * + *

{@code
+   * AppProfile appProfile = client.createAppProfile(
+   *   CreateAppProfileRequest.of("my-instance", "my-new-app-profile")
+   *     .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster"))
+   * );
+   * }
+ * + * @see CreateAppProfileRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AppProfile createAppProfile(CreateAppProfileRequest request) { + return ApiExceptions.callAndTranslateApiException(createAppProfileAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createAppProfile(com.google.bigtable.admin.v2.CreateAppProfileRequest)}. + * + *

Asynchronously creates a new app profile. + * + *

Sample code: + * + *

{@code
+   * ApiFuture appProfileFuture = client.createAppProfileAsync(
+   *   CreateAppProfileRequest.of("my-instance", "my-new-app-profile")
+   *     .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster"))
+   * );
+   *
+   * AppProfile appProfile = appProfileFuture.get();
+   * }
+ * + * @see CreateAppProfileRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createAppProfileAsync(CreateAppProfileRequest request) { + return ApiFutures.transform( + stub.createAppProfileCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { + return AppProfile.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getAppProfile(com.google.bigtable.admin.v2.GetAppProfileRequest)}. + * + *

Gets the app profile by ID. + * + *

Sample code: + * + *

{@code
+   * AppProfile appProfile = client.getAppProfile("my-instance", "my-app-profile");
+   * }
+ * + * @see AppProfile + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AppProfile getAppProfile(String instanceId, String appProfileId) { + return ApiExceptions.callAndTranslateApiException(getAppProfileAsync(instanceId, appProfileId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getAppProfile(com.google.bigtable.admin.v2.GetAppProfileRequest)}. + * + *

Asynchronously gets the app profile by ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture appProfileFuture = client.getAppProfileAsync("my-instance", "my-app-profile");
+   *
+   * AppProfile appProfile = appProfileFuture.get();
+   * }
+ * + * @see AppProfile + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getAppProfileAsync(String instanceId, String appProfileId) { + String name = NameUtil.formatAppProfileName(projectId, instanceId, appProfileId); + + GetAppProfileRequest request = GetAppProfileRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.getAppProfileCallable().futureCall(request), + new ApiFunction() { + @Override + public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { + return AppProfile.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listAppProfiles(com.google.bigtable.admin.v2.ListAppProfilesRequest)}. + * + *

Lists all app profiles of the specified instance. + * + *

Sample code: + * + *

{@code
+   * List appProfiles = client.listAppProfiles("my-instance");
+   * }
+ * + * @see AppProfile + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listAppProfiles(String instanceId) { + return ApiExceptions.callAndTranslateApiException(listAppProfilesAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listAppProfiles(com.google.bigtable.admin.v2.ListAppProfilesRequest)}. + * + *

Asynchronously lists all app profiles of the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> appProfilesFuture = client.listAppProfilesAsync("my-instance");
+   *
+   * List appProfiles = appProfileFuture.get();
+   * }
+ * + * @see AppProfile + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listAppProfilesAsync(String instanceId) { + String instanceName = NameUtil.formatInstanceName(projectId, instanceId); + + ListAppProfilesRequest request = + ListAppProfilesRequest.newBuilder().setParent(instanceName).build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listAppProfilesPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListAppProfilesPage apply(ListAppProfilesPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction< + ListAppProfilesPage, List>() { + List responseAccumulator = + Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListAppProfilesPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List input) { + List results = Lists.newArrayListWithCapacity(input.size()); + for (com.google.bigtable.admin.v2.AppProfile appProfile : input) { + results.add(AppProfile.fromProto(appProfile)); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateAppProfile(com.google.bigtable.admin.v2.UpdateAppProfileRequest)}. + * + *

Updates an existing app profile. + * + *

Sample code: + * + *

{@code
+   * AppProfile existingAppProfile = client.getAppProfile("my-instance", "my-app-profile");
+   *
+   * AppProfile updatedAppProfile = client.updateAppProfile(
+   *   UpdateAppProfileRequest.of(existingAppProfile)
+   *     .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster"))
+   * );
+   * }
+ * + * @see UpdateAppProfileRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AppProfile updateAppProfile(UpdateAppProfileRequest request) { + return ApiExceptions.callAndTranslateApiException(updateAppProfileAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateAppProfile(com.google.bigtable.admin.v2.UpdateAppProfileRequest)}. + * + *

Asynchronously updates an existing app profile. + * + *

Sample code: + * + *

{@code
+   * ApiFuture existingAppProfileFuture = client.getAppProfileAsync("my-instance", "my-app-profile");
+   *
+   * ApiFuture updatedAppProfileFuture = ApiFutures.transformAsync(
+   *   existingAppProfileFuture,
+   *   new ApiAsyncFunction() {
+   *     public ApiFuture apply(AppProfile existingAppProfile) {
+   *       return client.updateAppProfileAsync(
+   *         UpdateAppProfileRequest.of(existingAppProfile)
+   *           .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-other-cluster"))
+   *       );
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   *
+   * ApiFuture appProfile = updatedAppProfileFuture.get();
+   * }
+ * + * @see UpdateAppProfileRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateAppProfileAsync(UpdateAppProfileRequest request) { + return ApiFutures.transform( + stub.updateAppProfileOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { + return AppProfile.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest)}. + * + *

Deletes the specified app profile. + * + *

Sample code: + * + *

{@code
+   * client.deleteAppProfile("my-instance", "my-app-profile");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteAppProfile(String instanceId, String appProfileId) { + ApiExceptions.callAndTranslateApiException( + deleteAppProfileAsync(instanceId, appProfileId, false)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest)}. + * + *

Asynchronously deletes the specified app profile. + * + *

Sample code: + * + *

{@code
+   * ApiFuture deleteFuture = client.deleteAppProfileAsync("my-instance", "my-app-profile");
+   *
+   * deleteFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteAppProfileAsync(String instanceId, String appProfileId) { + return deleteAppProfileAsync(instanceId, appProfileId, false); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest)}. + * + *

Deletes the specified app profile with an option to force deletion. + * + *

Sample code: + * + *

{@code
+   * client.deleteAppProfile("my-instance", "my-app-profile", true);
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteAppProfile(String instanceId, String appProfileId, boolean forceDelete) { + ApiExceptions.callAndTranslateApiException( + deleteAppProfileAsync(instanceId, appProfileId, forceDelete)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest)}. + * + *

Asynchronously deletes the specified app profile with an option to force deletion. + * + *

Sample code: + * + *

{@code
+   * ApiFuture deleteFuture = client.deleteAppProfileAsync("my-instance", "my-app-profile", true);
+   *
+   * deleteFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteAppProfileAsync( + String instanceId, String appProfileId, boolean forceDelete) { + String name = NameUtil.formatAppProfileName(projectId, instanceId, appProfileId); + DeleteAppProfileRequest request = + DeleteAppProfileRequest.newBuilder().setName(name).setIgnoreWarnings(forceDelete).build(); + + return ApiFutures.transform( + stub.deleteAppProfileCallable().futureCall(request), + new ApiFunction() { + @Override + public Void apply(Empty input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getIamPolicy(com.google.iam.v1.GetIamPolicyRequest)}. + * + *

Gets the IAM access control policy for the specified instance. + * + *

Sample code: + * + *

{@code
+   * Policy policy = client.getIamPolicy("my-instance");
+   * for(Map.Entry> entry : policy.getBindings().entrySet()) {
+   *   System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   * }
+   * }
+ * + * @see Instance-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy getIamPolicy(String instanceId) { + return ApiExceptions.callAndTranslateApiException(getIamPolicyAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getIamPolicy(com.google.iam.v1.GetIamPolicyRequest)}. + * + *

Asynchronously gets the IAM access control policy for the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture policyFuture = client.getIamPolicyAsync("my-instance");
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Instance-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getIamPolicyAsync(String instanceId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(name).build(); + + final IamPolicyMarshaller marshaller = new IamPolicyMarshaller(); + + return ApiFutures.transform( + stub.getIamPolicyCallable().futureCall(request), + new ApiFunction() { + @Override + public Policy apply(com.google.iam.v1.Policy proto) { + return marshaller.fromPb(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#setIamPolicy(com.google.iam.v1.SetIamPolicyRequest)}. + * + *

Replaces the IAM policy associated with the specified instance. + * + *

Sample code: + * + *

{@code
+   * Policy newPolicy = client.setIamPolicy("my-instance",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   * }
+ * + * @see Instance-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy setIamPolicy(String instanceId, Policy policy) { + return ApiExceptions.callAndTranslateApiException(setIamPolicyAsync(instanceId, policy)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#setIamPolicy(com.google.iam.v1.SetIamPolicyRequest)}. + * + *

Asynchronously replaces the IAM policy associated with the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture newPolicyFuture = client.setIamPolicyAsync("my-instance",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Instance-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture setIamPolicyAsync(String instanceId, Policy policy) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + final IamPolicyMarshaller marshaller = new IamPolicyMarshaller(); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(name) + .setPolicy(marshaller.toPb(policy)) + .build(); + + return ApiFutures.transform( + stub.setIamPolicyCallable().futureCall(request), + new ApiFunction() { + @Override + public Policy apply(com.google.iam.v1.Policy proto) { + return marshaller.fromPb(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest)}. + * + *

Tests whether the caller has the given permissions for the specified instance. Returns a + * subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * List grantedPermissions = client.testIamPermission("my-instance",
+   *   "bigtable.tables.readRows", "bigtable.tables.mutateRows");
+   * }
+ * + * System.out.println("Has read access: " + + * grantedPermissions.contains("bigtable.tables.readRows")); System.out.println("Has write access: + * " + grantedPermissions.contains("bigtable.tables.mutateRows")); + * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List testIamPermission(String instanceId, String... permissions) { + return ApiExceptions.callAndTranslateApiException( + testIamPermissionAsync(instanceId, permissions)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest)}. + * + *

Asynchronously tests whether the caller has the given permissions for the specified + * instance. Returns a subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> grantedPermissionsFuture = client.testIamPermissionAsync("my-instance",
+   *   "bigtable.tables.readRows", "bigtable.tables.mutateRows");
+   *
+   * ApiFutures.addCallback(grantedPermissionsFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List grantedPermissions) {
+   *       System.out.println("Has read access: " + grantedPermissions.contains("bigtable.tables.readRows"));
+   *       System.out.println("Has write access: " + grantedPermissions.contains("bigtable.tables.mutateRows"));
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> testIamPermissionAsync(String instanceId, String... permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(NameUtil.formatInstanceName(projectId, instanceId)) + .addAllPermissions(Arrays.asList(permissions)) + .build(); + + return ApiFutures.transform( + stub.testIamPermissionsCallable().futureCall(request), + new ApiFunction>() { + @Override + public List apply(TestIamPermissionsResponse input) { + return input.getPermissionsList(); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createMaterializedViewAsync(com.google.bigtable.admin.v2.CreateMaterializedViewRequest)}. + * + *

Creates a new materialized view. + * + *

Sample code: + * + *

{@code
+   * MaterializedView materializedView = client.createMaterializedView(
+   *   CreateMaterializedViewRequest.of("my-instance", "my-new-materialized-view")
+   *     .setQuery(query)
+   * );
+   * }
+ * + * @see CreateMaterializedViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public MaterializedView createMaterializedView(CreateMaterializedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(createMaterializedViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createMaterializedViewAsync(com.google.bigtable.admin.v2.CreateMaterializedViewRequest)}. + * + *

Asynchronously creates a new materialized view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture materializedViewFuture = client.createMaterializedViewAsync(
+   *   CreateMaterializedViewRequest.of("my-instance", "my-new-materialized-view")
+   *     .setQuery(query)
+   * );
+   *
+   * MaterializedView materializedView = materializedViewFuture.get();
+   * }
+ * + * @see CreateMaterializedViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createMaterializedViewAsync( + CreateMaterializedViewRequest request) { + return ApiFutures.transform( + stub.createMaterializedViewOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public MaterializedView apply(com.google.bigtable.admin.v2.MaterializedView proto) { + return MaterializedView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getMaterializedView(com.google.bigtable.admin.v2.GetMaterializedViewRequest)}. + * + *

Gets the materialized view by ID. + * + *

Sample code: + * + *

{@code
+   * MaterializedView materializedView = client.getMaterializedView("my-instance", "my-materialized-view");
+   * }
+ * + * @see MaterializedView + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public MaterializedView getMaterializedView(String instanceId, String materializedViewId) { + return ApiExceptions.callAndTranslateApiException( + getMaterializedViewAsync(instanceId, materializedViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getMaterializedView(com.google.bigtable.admin.v2.GetMaterializedViewRequest)}. + * + *

Asynchronously gets the materialized view by ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture materializedViewFuture = client.getMaterializedViewAsync("my-instance", "my-materialized-view");
+   *
+   * MaterializedView materializedView = materializedViewFuture.get();
+   * }
+ * + * @see MaterializedView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getMaterializedViewAsync( + String instanceId, String materializedViewId) { + String name = NameUtil.formatMaterializedViewName(projectId, instanceId, materializedViewId); + + GetMaterializedViewRequest request = + GetMaterializedViewRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.getMaterializedViewCallable().futureCall(request), + new ApiFunction() { + @Override + public MaterializedView apply(com.google.bigtable.admin.v2.MaterializedView proto) { + return MaterializedView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listMaterializedViews(com.google.bigtable.admin.v2.ListMaterializedViewsRequest)}. + * + *

Lists all materialized views of the specified instance. + * + *

Sample code: + * + *

{@code
+   * List materializedViews = client.listMaterializedViews("my-instance");
+   * }
+ * + * @see MaterializedView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listMaterializedViews(String instanceId) { + return ApiExceptions.callAndTranslateApiException(listMaterializedViewsAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listMaterializedViews(com.google.bigtable.admin.v2.ListMaterializedViewsRequest)}. + * + *

Asynchronously lists all materialized views of the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> materializedViewsFuture = client.listMaterializedViewsAsync("my-instance");
+   *
+   * List materializedViews = materializedViewFuture.get();
+   * }
+ * + * @see MaterializedView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listMaterializedViewsAsync(String instanceId) { + String instanceName = NameUtil.formatInstanceName(projectId, instanceId); + + ListMaterializedViewsRequest request = + ListMaterializedViewsRequest.newBuilder().setParent(instanceName).build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listMaterializedViewsPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListMaterializedViewsPage apply(ListMaterializedViewsPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction< + ListMaterializedViewsPage, List>() { + List responseAccumulator = + Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListMaterializedViewsPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction< + List, List>() { + @Override + public List apply( + List input) { + List results = Lists.newArrayListWithCapacity(input.size()); + for (com.google.bigtable.admin.v2.MaterializedView materializedView : input) { + results.add(MaterializedView.fromProto(materializedView)); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateMaterializedView(com.google.bigtable.admin.v2.UpdateMaterializedViewRequest)}. + * + *

Updates an existing materialized view. + * + *

Sample code: + * + *

{@code
+   * MaterializedView existingMaterializedView = client.getMaterializedView("my-instance", "my-materialized-view");
+   *
+   * MaterializedView updatedMaterializedView = client.updateMaterializedView(
+   *   UpdateMaterializedViewRequest.of(existingMaterializedView)
+   *     .setDeletionProtection(false)
+   * );
+   * }
+ * + * @see UpdateMaterializedViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public MaterializedView updateMaterializedView(UpdateMaterializedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(updateMaterializedViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateMaterializedView(com.google.bigtable.admin.v2.UpdateMaterializedViewRequest)}. + * + *

Asynchronously updates an existing materialized view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture existingMaterializedViewFuture = client.getMaterializedViewAsync("my-instance", "my-materialized-view");
+   *
+   * ApiFuture updatedMaterializedViewFuture = ApiFutures.transformAsync(
+   *   existingMaterializedViewFuture,
+   *   new ApiAsyncFunction() {
+   *     public ApiFuture apply(MaterializedView existingMaterializedView) {
+   *       return client.updateMaterializedViewAsync(
+   *         UpdateMaterializedViewRequest.of(existingMaterializedView)
+   *           .setDeletionProtection(false)
+   *       );
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   *
+   * ApiFuture materializedView = updatedMaterializedViewFuture.get();
+   * }
+ * + * @see UpdateMaterializedViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateMaterializedViewAsync( + UpdateMaterializedViewRequest request) { + return ApiFutures.transform( + stub.updateMaterializedViewOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public MaterializedView apply(com.google.bigtable.admin.v2.MaterializedView proto) { + return MaterializedView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteMaterializedView(com.google.bigtable.admin.v2.DeleteMaterializedViewRequest)}. + * + *

Deletes the specified materialized view. + * + *

Sample code: + * + *

{@code
+   * client.deleteMaterializedView("my-instance", "my-materialized-view");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteMaterializedView(String instanceId, String materializedViewId) { + ApiExceptions.callAndTranslateApiException( + deleteMaterializedViewAsync(instanceId, materializedViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteMaterializedView(com.google.bigtable.admin.v2.DeleteMaterializedViewRequest)}. + * + *

Asynchronously deletes the specified materialized view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture deleteFuture = client.deleteMaterializedViewAsync("my-instance", "my-materialized-view");
+   *
+   * deleteFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteMaterializedViewAsync(String instanceId, String materializedViewId) { + + String name = NameUtil.formatMaterializedViewName(projectId, instanceId, materializedViewId); + DeleteMaterializedViewRequest request = + DeleteMaterializedViewRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.deleteMaterializedViewCallable().futureCall(request), + new ApiFunction() { + @Override + public Void apply(Empty input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createLogicalViewAsync(com.google.bigtable.admin.v2.CreateLogicalViewRequest)}. + * + *

Creates a new logical view. + * + *

Sample code: + * + *

{@code
+   * LogicalView logicalView = client.createLogicalView(
+   *   CreateLogicalViewRequest.of("my-instance", "my-new-logical-view")
+   *     .setQuery(query)
+   * );
+   * }
+ * + * @see CreateLogicalViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public LogicalView createLogicalView(CreateLogicalViewRequest request) { + return ApiExceptions.callAndTranslateApiException(createLogicalViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#createLogicalViewAsync(com.google.bigtable.admin.v2.CreateLogicalViewRequest)}. + * + *

Asynchronously creates a new logical view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture logicalViewFuture = client.createLogicalViewAsync(
+   *   CreateLogicalViewRequest.of("my-instance", "my-new-logical-view")
+   *     .setQuery(query)
+   * );
+   *
+   * LogicalView logicalView = logicalViewFuture.get();
+   * }
+ * + * @see CreateLogicalViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createLogicalViewAsync(CreateLogicalViewRequest request) { + return ApiFutures.transform( + stub.createLogicalViewOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public LogicalView apply(com.google.bigtable.admin.v2.LogicalView proto) { + return LogicalView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getLogicalView(com.google.bigtable.admin.v2.GetLogicalViewRequest)}. + * + *

Gets the logical view by ID. + * + *

Sample code: + * + *

{@code
+   * LogicalView logicalView = client.getLogicalView("my-instance", "my-logical-view");
+   * }
+ * + * @see LogicalView + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public LogicalView getLogicalView(String instanceId, String logicalViewId) { + return ApiExceptions.callAndTranslateApiException( + getLogicalViewAsync(instanceId, logicalViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#getLogicalView(com.google.bigtable.admin.v2.GetLogicalViewRequest)}. + * + *

Asynchronously gets the logical view by ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture logicalViewFuture = client.getLogicalViewAsync("my-instance", "my-logical-view");
+   *
+   * LogicalView logicalView = logicalViewFuture.get();
+   * }
+ * + * @see LogicalView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getLogicalViewAsync(String instanceId, String logicalViewId) { + String name = NameUtil.formatLogicalViewName(projectId, instanceId, logicalViewId); + + GetLogicalViewRequest request = GetLogicalViewRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.getLogicalViewCallable().futureCall(request), + new ApiFunction() { + @Override + public LogicalView apply(com.google.bigtable.admin.v2.LogicalView proto) { + return LogicalView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listLogicalViews(com.google.bigtable.admin.v2.ListLogicalViewsRequest)}. + * + *

Lists all logical views of the specified instance. + * + *

Sample code: + * + *

{@code
+   * List logicalViews = client.listLogicalViews("my-instance");
+   * }
+ * + * @see LogicalView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listLogicalViews(String instanceId) { + return ApiExceptions.callAndTranslateApiException(listLogicalViewsAsync(instanceId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#listLogicalViews(com.google.bigtable.admin.v2.ListLogicalViewsRequest)}. + * + *

Asynchronously lists all logical views of the specified instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> logicalViewsFuture = client.listLogicalViewsAsync("my-instance");
+   *
+   * List logicalViews = logicalViewFuture.get();
+   * }
+ * + * @see LogicalView + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listLogicalViewsAsync(String instanceId) { + String instanceName = NameUtil.formatInstanceName(projectId, instanceId); + + ListLogicalViewsRequest request = + ListLogicalViewsRequest.newBuilder().setParent(instanceName).build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listLogicalViewsPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListLogicalViewsPage apply(ListLogicalViewsPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction< + ListLogicalViewsPage, List>() { + List responseAccumulator = + Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListLogicalViewsPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List input) { + List results = Lists.newArrayListWithCapacity(input.size()); + for (com.google.bigtable.admin.v2.LogicalView logicalView : input) { + results.add(LogicalView.fromProto(logicalView)); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateLogicalView(com.google.bigtable.admin.v2.UpdateLogicalViewRequest)}. + * + *

Updates an existing logical view. + * + *

Sample code: + * + *

{@code
+   * LogicalView existingLogicalView = client.getLogicalView("my-instance", "my-logical-view");
+   *
+   * LogicalView updatedLogicalView = client.updateLogicalView(
+   *   UpdateLogicalViewRequest.of(existingLogicalView)
+   *     .setQuery(query)
+   * );
+   * }
+ * + * @see UpdateLogicalViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public LogicalView updateLogicalView(UpdateLogicalViewRequest request) { + return ApiExceptions.callAndTranslateApiException(updateLogicalViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#updateLogicalView(com.google.bigtable.admin.v2.UpdateLogicalViewRequest)}. + * + *

Asynchronously updates an existing logical view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture existingLogicalViewFuture = client.getLogicalViewAsync("my-instance", "my-logical-view");
+   *
+   * ApiFuture updatedLogicalViewFuture = ApiFutures.transformAsync(
+   *   existingLogicalViewFuture,
+   *   new ApiAsyncFunction() {
+   *     public ApiFuture apply(LogicalView existingLogicalView) {
+   *       return client.updateLogicalViewAsync(
+   *         UpdateLogicalViewRequest.of(existingLogicalView)
+   *           .setQuery(query)
+   *       );
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   *
+   * ApiFuture logicalView = updatedLogicalViewFuture.get();
+   * }
+ * + * @see UpdateLogicalViewRequest + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateLogicalViewAsync(UpdateLogicalViewRequest request) { + return ApiFutures.transform( + stub.updateLogicalViewOperationCallable().futureCall(request.toProto(projectId)), + new ApiFunction() { + @Override + public LogicalView apply(com.google.bigtable.admin.v2.LogicalView proto) { + return LogicalView.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteLogicalView(com.google.bigtable.admin.v2.DeleteLogicalViewRequest)}. + * + *

Deletes the specified logical view. + * + *

Sample code: + * + *

{@code
+   * client.deleteLogicalView("my-instance", "my-logical-view");
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteLogicalView(String instanceId, String logicalViewId) { + ApiExceptions.callAndTranslateApiException(deleteLogicalViewAsync(instanceId, logicalViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient#deleteLogicalView(com.google.bigtable.admin.v2.DeleteLogicalViewRequest)}. + * + *

Asynchronously deletes the specified logical view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture deleteFuture = client.deleteLogicalViewAsync("my-instance", "my-logical-view");
+   *
+   * deleteFuture.get();
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteLogicalViewAsync(String instanceId, String logicalViewId) { + + String name = NameUtil.formatLogicalViewName(projectId, instanceId, logicalViewId); + DeleteLogicalViewRequest request = DeleteLogicalViewRequest.newBuilder().setName(name).build(); + + return ApiFutures.transform( + stub.deleteLogicalViewCallable().futureCall(request), + new ApiFunction() { + @Override + public Void apply(Empty input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * Simple adapter to expose {@link DefaultMarshaller} to this class. It enables this client to + * convert to/from IAM wrappers and protobufs. + */ + private static class IamPolicyMarshaller extends DefaultMarshaller { + @Override + public Policy fromPb(com.google.iam.v1.Policy policyPb) { + return super.fromPb(policyPb); + } + + @Override + public com.google.iam.v1.Policy toPb(Policy policy) { + return super.toPb(policy); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java new file mode 100644 index 000000000000..974317a9d18e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java @@ -0,0 +1,234 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import static com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings.BIGTABLE_EMULATOR_HOST_ENV_VAR; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStubSettings; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import com.google.common.base.Verify; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Settings class to configure an instance of {@link BigtableInstanceAdminClient}. + * + *

It must be configured with a project ID and can be used to change default RPC settings. + * + *

Example usage: + * + *

{@code
+ * BigtableInstanceAdminSettings.Builder settingsBuilder = BigtableInstanceAdminSettings.newBuilder()
+ *  .setProjectId("my-project");
+ *
+ * settingsBuilder.stubSettings().createInstanceSettings()
+ *   .setRetrySettings(
+ *     RetrySettings.newBuilder()
+ *       .setTotalTimeout(Duration.ofMinutes(15))
+ *       .build());
+ *
+ * BigtableInstanceAdminSettings settings = settingsBuilder.build();
+ * }
+ */ +public final class BigtableInstanceAdminSettings { + private static final Logger LOGGER = + Logger.getLogger(BigtableInstanceAdminSettings.class.getName()); + + private final String projectId; + private final BigtableInstanceAdminStubSettings stubSettings; + + private BigtableInstanceAdminSettings(Builder builder) throws IOException { + Preconditions.checkNotNull(builder.projectId, "Project ID must be set"); + Verify.verifyNotNull(builder.stubSettings, "stubSettings should never be null"); + + this.projectId = builder.projectId; + this.stubSettings = builder.stubSettings.build(); + } + + /** Gets the ID of the project whose instances the client will manage. */ + @Nonnull + public String getProjectId() { + return projectId; + } + + /** Gets the credentials provider to use for getting the credentials to make calls with. */ + public CredentialsProvider getCredentialsProvider() { + return stubSettings.getCredentialsProvider(); + } + + /** Gets the underlying RPC settings. */ + @Nonnull + public BigtableInstanceAdminStubSettings getStubSettings() { + return stubSettings; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("projectId", projectId) + .add("createInstanceSettings", stubSettings.createInstanceSettings()) + .add("createInstanceOperationSettings", stubSettings.createInstanceOperationSettings()) + .add("getInstanceSettings", stubSettings.getInstanceSettings()) + .add("listInstancesSettings", stubSettings.listInstancesSettings()) + .add("partialUpdateInstanceSettings", stubSettings.partialUpdateInstanceSettings()) + .add( + "partialUpdateInstanceOperationSettings", + stubSettings.partialUpdateInstanceOperationSettings()) + .add("deleteInstanceSettings", stubSettings.deleteInstanceSettings()) + .add("createClusterSettings", stubSettings.createClusterSettings()) + .add("createClusterOperationSettings", stubSettings.createClusterOperationSettings()) + .add("getClusterSettings", stubSettings.getClusterSettings()) + .add("listClustersSettings", stubSettings.listClustersSettings()) + .add("updateClusterSettings", stubSettings.updateClusterSettings()) + .add("updateClusterOperationSettings", stubSettings.updateClusterOperationSettings()) + .add("deleteClusterSettings", stubSettings.deleteClusterSettings()) + .add("createAppProfileSettings", stubSettings.createAppProfileSettings()) + .add("getAppProfileSettings", stubSettings.getAppProfileSettings()) + .add("listAppProfilesSettings", stubSettings.listAppProfilesSettings()) + .add("updateAppProfileSettings", stubSettings.updateAppProfileSettings()) + .add("updateAppProfileOperationSettings", stubSettings.updateAppProfileOperationSettings()) + .add("deleteAppProfileSettings", stubSettings.deleteAppProfileSettings()) + .add("getIamPolicySettings", stubSettings.getIamPolicySettings()) + .add("setIamPolicySettings", stubSettings.setIamPolicySettings()) + .add("testIamPermissionsSettings", stubSettings.testIamPermissionsSettings()) + .add("createMaterializedViewSettings", stubSettings.createMaterializedViewSettings()) + .add("getMaterializedViewSettings", stubSettings.getMaterializedViewSettings()) + .add("listMaterializedViewsSettings", stubSettings.listMaterializedViewsSettings()) + .add("updateMaterializedViewSettings", stubSettings.updateMaterializedViewSettings()) + .add("deleteMaterializedViewSettings", stubSettings.deleteMaterializedViewSettings()) + .add("createLogicalViewSettings", stubSettings.createLogicalViewSettings()) + .add("getLogicalViewSettings", stubSettings.getLogicalViewSettings()) + .add("listLogicalViewsSettings", stubSettings.listLogicalViewsSettings()) + .add("updateLogicalViewSettings", stubSettings.updateLogicalViewSettings()) + .add("deleteLogicalViewSettings", stubSettings.deleteLogicalViewSettings()) + .add("stubSettings", stubSettings) + .toString(); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + String hostAndPort = System.getenv(BIGTABLE_EMULATOR_HOST_ENV_VAR); + if (!Strings.isNullOrEmpty(hostAndPort)) { + int port; + try { + port = Integer.parseInt(hostAndPort.substring(hostAndPort.lastIndexOf(":") + 1)); + return newBuilderForEmulator(hostAndPort.substring(0, hostAndPort.lastIndexOf(":")), port); + } catch (NumberFormatException | IndexOutOfBoundsException ex) { + throw new RuntimeException( + "Invalid host/port in " + + BIGTABLE_EMULATOR_HOST_ENV_VAR + + " environment variable: " + + hostAndPort); + } + } + return new Builder(); + } + + /** Create a new builder preconfigured to connect to the Bigtable emulator with port number. */ + public static Builder newBuilderForEmulator(int port) { + return newBuilderForEmulator("localhost", port); + } + + /** + * Creates a new builder preconfigured to connect to the Bigtable emulator with host name and port + * number. + */ + public static Builder newBuilderForEmulator(String hostname, int port) { + Builder builder = new Builder(); + + builder + .stubSettings() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(hostname + ":" + port) + .setTransportChannelProvider( + InstantiatingGrpcChannelProvider.newBuilder() + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + + LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port); + return builder; + } + + /** Builder for BigtableInstanceAdminSettings. */ + public static final class Builder { + @Nullable private String projectId; + private final BigtableInstanceAdminStubSettings.Builder stubSettings; + + private Builder() { + stubSettings = BigtableInstanceAdminStubSettings.newBuilder(); + } + + private Builder(BigtableInstanceAdminSettings settings) { + this.projectId = settings.projectId; + this.stubSettings = settings.stubSettings.toBuilder(); + } + + /** Sets the ID of the project whose instances the client will manage. */ + public Builder setProjectId(@Nonnull String projectId) { + Preconditions.checkNotNull(projectId); + this.projectId = projectId; + return this; + } + + /** Gets the ID of the project whose instances the client will manage. */ + @Nullable + public String getProjectId() { + return projectId; + } + + /** Sets the CredentialsProvider to use for getting the credentials to make calls with. */ + public Builder setCredentialsProvider(CredentialsProvider credentialsProvider) { + stubSettings.setCredentialsProvider(credentialsProvider); + + return this; + } + + /** Gets the CredentialsProvider to use for getting the credentials to make calls with. */ + public CredentialsProvider getCredentialsProvider() { + return stubSettings.getCredentialsProvider(); + } + + /** + * Returns the builder for the settings used for all RPCs. + * + *

This is meant for advanced usage. The default RPC settings are set to their recommended + * values. + */ + public BigtableInstanceAdminStubSettings.Builder stubSettings() { + return stubSettings; + } + + /** Builds an instance of the settings. */ + public BigtableInstanceAdminSettings build() throws IOException { + return new BigtableInstanceAdminSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java new file mode 100644 index 000000000000..3cd7fef840ab --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java @@ -0,0 +1,3168 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import com.google.api.core.ApiAsyncFunction; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.NotFoundException; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.Table.ClusterState; +import com.google.bigtable.admin.v2.Table.View; +import com.google.cloud.Policy; +import com.google.cloud.Policy.DefaultMarshaller; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.Backup; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.admin.v2.models.CopyBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.EncryptionInfo; +import com.google.cloud.bigtable.admin.v2.models.GCRules; +import com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest; +import com.google.cloud.bigtable.admin.v2.models.OptimizeRestoredTableOperationToken; +import com.google.cloud.bigtable.admin.v2.models.RestoreTableRequest; +import com.google.cloud.bigtable.admin.v2.models.RestoredTableResult; +import com.google.cloud.bigtable.admin.v2.models.SchemaBundle; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateTableRequest; +import com.google.cloud.bigtable.admin.v2.stub.EnhancedBigtableTableAdminStub; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import javax.annotation.Nonnull; + +/** + * Client for creating, configuring, and deleting Cloud Bigtable tables + * + *

Provides access to the table schemas only, not the data stored within the tables. + * + *

See the individual methods for example code. + * + *

Sample code to get started: + * + *

{@code
+ * // One instance per application.
+ * BigtableTableAdminClient client =  BigtableTableAdminClient.create("[PROJECT]", "[INSTANCE]");
+ *
+ * com.google.bigtable.admin.v2.CreateTableRequest request =
+ *   com.google.bigtable.admin.v2.CreateTableRequest.newBuilder()
+ *     .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ *     .setTableId("my-table")
+ *     .setTable(
+ *       com.google.bigtable.admin.v2.Table.newBuilder()
+ *         .putColumnFamilies("cf1", com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance())
+ *         .putColumnFamilies(
+ *           "cf2",
+ *           com.google.bigtable.admin.v2.ColumnFamily.newBuilder()
+ *             .setGcRule(GcRuleBuilder.maxVersions(10))
+ *             .build())
+ *         .build())
+ *     .addInitialSplits(
+ *       com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder()
+ *         .setKey(ByteString.copyFromUtf8("b"))
+ *         .build())
+ *     .addInitialSplits(
+ *       com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder()
+ *         .setKey(ByteString.copyFromUtf8("q"))
+ *         .build())
+ *     .build();
+ *
+ * client.getBaseClient().createTable(request);
+ *
+ * // Cleanup during application shutdown.
+ * client.close();
+ * }
+ * + *

Creating a new client is a very expensive operation and should only be done once and shared in + * an application. However, close() needs to be called on the client object to clean up resources + * such as threads during application shutdown. + * + *

This class can be customized by passing in a custom instance of BigtableTableAdminSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * BigtableTableAdminSettings settings = BigtableTableAdminSettings.newBuilder()
+ *   .setProjectId("[PROJECT]")
+ *   .setInstanceId("[INSTANCE]")
+ *   .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *   .build();
+ *
+ * BigtableTableAdminClient client = BigtableTableAdminClient.create(settings);
+ * }
+ * + * To customize the endpoint: + * + *
{@code
+ * BigtableTableAdminSettings.Builder settingsBuilder = BigtableTableAdminSettings.newBuilder()
+ *   .setProjectId("[PROJECT]")
+ *   .setInstanceId("[INSTANCE]");
+ *
+ * settingsBuilder.stubSettings()
+ *   .setEndpoint(myEndpoint).build();
+ *
+ * BigtableTableAdminClient client = BigtableTableAdminClient.create(settingsBuilder.build());
+ * }
+ */ +public final class BigtableTableAdminClient implements AutoCloseable { + private final EnhancedBigtableTableAdminStub stub; + private final String projectId; + private final String instanceId; + private final BaseBigtableTableAdminClient baseClient; + + /** Constructs an instance of BigtableTableAdminClient with the given project and instance IDs. */ + public static BigtableTableAdminClient create( + @Nonnull String projectId, @Nonnull String instanceId) throws IOException { + return create( + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build()); + } + + /** Constructs an instance of BigtableTableAdminClient with the given settings. */ + public static BigtableTableAdminClient create(@Nonnull BigtableTableAdminSettings settings) + throws IOException { + TableAdminRequestContext requestContext = + TableAdminRequestContext.create(settings.getProjectId(), settings.getInstanceId()); + EnhancedBigtableTableAdminStub stub = + EnhancedBigtableTableAdminStub.createEnhanced(settings.getStubSettings(), requestContext); + return create(settings.getProjectId(), settings.getInstanceId(), stub); + } + + /** Constructs an instance of BigtableTableAdminClient with the given instance name and stub. */ + public static BigtableTableAdminClient create( + @Nonnull String projectId, + @Nonnull String instanceId, + @Nonnull EnhancedBigtableTableAdminStub stub) { + return new BigtableTableAdminClient(projectId, instanceId, stub); + } + + private BigtableTableAdminClient( + @Nonnull String projectId, + @Nonnull String instanceId, + @Nonnull EnhancedBigtableTableAdminStub stub) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + Preconditions.checkNotNull(stub); + this.projectId = projectId; + this.instanceId = instanceId; + this.stub = stub; + this.baseClient = BaseBigtableTableAdminClient.create(stub); + } + + /** Gets the project ID of the instance whose tables this client manages. */ + public String getProjectId() { + return projectId; + } + + /** Gets the ID of the instance whose tables this client manages. */ + public String getInstanceId() { + return instanceId; + } + + /** + * Returns the modern autogenerated client. This provides access to the newest features and + * proto-based methods. + */ + public BaseBigtableTableAdminClient getBaseClient() { + return baseClient; + } + + @Override + public void close() { + stub.close(); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createTable(com.google.bigtable.admin.v2.CreateTableRequest)}. + * + *

Creates a new table with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * // A table with a single column family, which retains only the latest value.
+   * Table table = client.createTable(
+   *   CreateTableRequest.of("my-table")
+   *     .addFamily("cf2", GCRULES.maxVersions(1))
+   * );
+   *
+   * // Another table with more complex garbage collection rules.
+   * Table table = client.createTable(
+   *   CreateTableRequest.of("my-table")
+   *     .addFamily("cf2", GCRULES.union()
+   *       .rule(GCRULES.maxAge(Duration.ofDays(30)))
+   *       .rule(GCRULES.maxVersions(5))
+   *     )
+   * );
+   * }
+ * + * @see CreateTableRequest for available options. + * @see GCRules for the documentation on available garbage collection rules. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Table createTable(CreateTableRequest request) { + return ApiExceptions.callAndTranslateApiException(createTableAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createTableCallable()}. + * + *

Asynchronously creates a new table with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * // A table with a single column family, which retains values up to 7 days.
+   * ApiFuture
tableFuture = client.createTableAsync( + * CreateTableRequest.of("my-table") + * .addFamily("cf", GCRULES.maxAge(Duration.ofDays(7))) + * ); + * + * // Another table with more complex garbage collection rules. + * ApiFuture
tableFuture = client.createTableAsync( + * CreateTableRequest.of("my-table") + * .addFamily("cf", GCRULES.intersection() + * .rule(GCRULES.maxAge(120, TimeUnit.HOURS)) + * .rule(GCRULES.maxVersions(10)) + * ) + * ); + * + * ApiFutures.addCallback( + * tableFuture, + * new ApiFutureCallback
() { + * public void onSuccess(Table table) { + * System.out.println("Created table: " + table.getTableName()); + * } + * + * public void onFailure(Throwable t) { + * t.printStackTrace(); + * } + * }, + * MoreExecutors.directExecutor() + * ); + * } + * + * @see CreateTableRequest for available options. + * @see GCRules for the documentation on available garbage collection rules. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture
createTableAsync(CreateTableRequest request) { + return transformToTableResponse( + this.stub.createTableCallable().futureCall(request.toProto(projectId, instanceId))); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateTable(com.google.bigtable.admin.v2.UpdateTableRequest)}. + * + *

Update a table with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * // Alter change stream retention period.
+   * Table table = client.updateTable(
+   *   UpdateTableRequest.of("my-table")
+   *     .addChangeStreamRetention(Duration.ofHours(24))
+   * );
+   *
+   * // Disable change stream
+   * Table table = client.updateTable(
+   *   UpdateTableRequest.of("my-table")
+   *     .disableChangeStream()
+   * );
+   * }
+ * + * @see UpdateTableRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Table updateTable(UpdateTableRequest request) { + return ApiExceptions.callAndTranslateApiException(updateTableAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateTableOperationCallable()}. + * + *

Asynchronously update a table with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * // Update table to 1 day change stream retention.
+   * ApiFuture
tableFuture = client.createTableAsync( + * UpdateTableRequest.of("my-table") + * .addChangeStreamRetention(Duration.ofHours(24)) + * ); + * + * ApiFutures.addCallback( + * tableFuture, + * new ApiFutureCallback
() { + * public void onSuccess(Table table) { + * System.out.println("Updated table: " + table.getTableName()); + * } + * + * public void onFailure(Throwable t) { + * t.printStackTrace(); + * } + * }, + * MoreExecutors.directExecutor() + * ); + * } + * + * @see UpdateTableRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture
updateTableAsync(UpdateTableRequest request) { + return ApiFutures.transform( + stub.updateTableOperationCallable().futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public Table apply(com.google.bigtable.admin.v2.Table tableProto) { + return Table.fromProto(tableProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#modifyColumnFamilies(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest)}. + * + *

Creates, updates and drops column families as specified in the request. + * + *

Sample code: + * + *

{@code
+   * Table modifiedTable = client.modifyFamilies(
+   *   ModifyColumnFamiliesRequest.of(tableId)
+   *     .addFamily("cf1")
+   *     .addFamily("cf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000)))
+   *     .updateFamily(
+   *       "cf3",
+   *       GCRULES.union()
+   *         .rule(GCRULES.maxAge(Duration.ofSeconds(100)))
+   *         .rule(GCRULES.maxVersions(1))
+   *       )
+   *     .addFamily(
+   *       "cf4",
+   *       GCRULES.intersection()
+   *         .rule(GCRULES.maxAge(Duration.ofSeconds(2000)))
+   *         .rule(GCRULES.maxVersions(10))
+   *     )
+   *     .dropFamily("cf5")
+   * );
+   *
+   * System.out.println("Resulting families:");
+   *
+   * for (ColumnFamily cf : modifiedTable.getColumnFamilies()) {
+   *   System.out.println(cf.getId());
+   * }
+   * }
+ * + * @see ModifyColumnFamiliesRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Table modifyFamilies(ModifyColumnFamiliesRequest request) { + return ApiExceptions.callAndTranslateApiException(modifyFamiliesAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#modifyColumnFamiliesCallable()}. + * + *

Asynchronously creates, updates, and drops column families as specified in the request. + * + *

Sample code: + * + *

{@code
+   * ApiFuture
modifiedTableFuture = client.modifyFamiliesAsync( + * ModifyColumnFamiliesRequest.of(tableId) + * .addFamily("cf1") + * .addFamily("cf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) + * .updateFamily( + * "cf3", + * GCRULES.union() + * .rule(GCRULES.maxAge(Duration.ofSeconds(100))) + * .rule(GCRULES.maxVersions(1)) + * ) + * .addFamily( + * "cf4", + * GCRULES.intersection() + * .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) + * .rule(GCRULES.maxVersions(10)) + * ) + * .dropFamily("cf5") + * ); + * + * ApiFutures.addCallback( + * modifiedTableFuture, + * new ApiFutureCallback
() { + * public void onSuccess(Table table) { + * System.out.println("Modified table: " + table.getTableName()); + * System.out.println("Resulting families:"); + * + * for (ColumnFamily cf : modifiedTable.getColumnFamilies()) { + * System.out.println(cf.getId()); + * } + * } + * + * public void onFailure(Throwable t) { + * t.printStackTrace(); + * } + * }, + * MoreExecutors.directExecutor() + * ); + * } + * + * @see ModifyColumnFamiliesRequest for available options. + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture
modifyFamiliesAsync(ModifyColumnFamiliesRequest request) { + return transformToTableResponse( + this.stub + .modifyColumnFamiliesCallable() + .futureCall(request.toProto(projectId, instanceId))); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest)}. + * + *

Deletes the table specified by the table ID. + * + *

Sample code: + * + *

{@code
+   * client.deleteTable("my-table");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteTable(String tableId) { + ApiExceptions.callAndTranslateApiException(deleteTableAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteTableCallable()}. + * + *

Asynchronously deletes the table specified by the table ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.deleteTableAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void ignored) {
+   *       System.out.println("Successfully deleted the table");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteTableAsync(String tableId) { + DeleteTableRequest request = + DeleteTableRequest.newBuilder().setName(getTableName(tableId)).build(); + + return transformToVoid(this.stub.deleteTableCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTable(com.google.bigtable.admin.v2.GetTableRequest)}. + * + *

Checks if the table specified by the table ID exists. + * + *

Sample code: + * + *

{@code
+   * if(client.exists("my-table")) {
+   *   System.out.println("Table exists");
+   * }
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public boolean exists(String tableId) { + return ApiExceptions.callAndTranslateApiException(existsAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTableCallable()}. + * + *

Asynchronously checks if the table specified by the table ID exists. + * + *

Sample code: + * + *

{@code
+   * ApiFuture found = client.existsAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *  found,
+   *  new ApiFutureCallback() {
+   *    public void onSuccess(Boolean found) {
+   *      if (found) {
+   *        System.out.println("Table exists");
+   *      } else {
+   *        System.out.println("Table not found");
+   *      }
+   *    }
+   *
+   *    public void onFailure(Throwable t) {
+   *      t.printStackTrace();
+   *    }
+   *  },
+   *  MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture existsAsync(String tableId) { + + ApiFuture
protoFuture = + getTableAsync(tableId, com.google.bigtable.admin.v2.Table.View.NAME_ONLY); + + ApiFuture existsFuture = + ApiFutures.transform( + protoFuture, + new ApiFunction() { + @Override + public Boolean apply(Table ignored) { + return true; + } + }, + MoreExecutors.directExecutor()); + + return ApiFutures.catching( + existsFuture, + NotFoundException.class, + new ApiFunction() { + @Override + public Boolean apply(NotFoundException ignored) { + return false; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTable(com.google.bigtable.admin.v2.GetTableRequest)}. + * + *

Gets the table metadata by table ID. + * + *

Sample code: + * + *

{@code
+   * Table table = client.getTable("my-table");
+   *
+   * System.out.println("Got metadata for table: " + table.getId());
+   * System.out.println("Column families:");
+   *
+   * for (ColumnFamily cf : table.getColumnFamilies()) {
+   *   System.out.println(cf.getId());
+   * }
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Table getTable(String tableId) { + return ApiExceptions.callAndTranslateApiException(getTableAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTableCallable()}. + * + *

Asynchronously gets the table metadata by table ID. + * + *

Sample code: + * + *

{@code
+   * ApiFuture
tableFuture = client.getTableAsync("my-table"); + * + * ApiFutures.addCallback( + * tableFuture, + * new ApiFutureCallback
() { + * public void onSuccess(Table table) { + * System.out.println("Got metadata for table: " + table.getId()); + * System.out.println("Column families:"); + * for (ColumnFamily cf : table.getColumnFamilies()) { + * System.out.println(cf.getId()); + * } + * } + * + * public void onFailure(Throwable t) { + * t.printStackTrace(); + * } + * }, + * MoreExecutors.directExecutor() + * ); + * } + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture
getTableAsync(String tableId) { + return getTableAsync(tableId, com.google.bigtable.admin.v2.Table.View.SCHEMA_VIEW); + } + + private ApiFuture
getTableAsync( + String tableId, com.google.bigtable.admin.v2.Table.View view) { + GetTableRequest request = + GetTableRequest.newBuilder().setName(getTableName(tableId)).setView(view).build(); + + return transformToTableResponse(this.stub.getTableCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTable(com.google.bigtable.admin.v2.GetTableRequest)}. + * + *

Gets the current encryption info for the table across all of the clusters. + * + *

The returned Map will be keyed by cluster id and contain a status for all of the keys in + * use. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Map> getEncryptionInfo(String tableId) { + return ApiExceptions.callAndTranslateApiException(getEncryptionInfoAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getTableCallable()}. + * + *

Asynchronously gets the current encryption info for the table across all of the clusters. + * + *

The returned Map will be keyed by cluster id and contain a status for all of the keys in + * use. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture>> getEncryptionInfoAsync(String tableId) { + GetTableRequest request = + GetTableRequest.newBuilder() + .setName(getTableName(tableId)) + .setView(View.ENCRYPTION_VIEW) + .build(); + return ApiFutures.transform( + this.stub.getTableCallable().futureCall(request), + new ApiFunction>>() { + @Override + public Map> apply(com.google.bigtable.admin.v2.Table table) { + ImmutableMap.Builder> result = ImmutableMap.builder(); + + for (Map.Entry entry : table.getClusterStatesMap().entrySet()) { + ImmutableList.Builder infos = ImmutableList.builder(); + + for (com.google.bigtable.admin.v2.EncryptionInfo infoProto : + entry.getValue().getEncryptionInfoList()) { + infos.add(EncryptionInfo.fromProto(infoProto)); + } + + result.put(entry.getKey(), infos.build()); + } + + return result.build(); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listTables(com.google.bigtable.admin.v2.ListTablesRequest)}. + * + *

Lists all table IDs in the instance. + * + *

Sample code: + * + *

{@code
+   * List tableIds = client.listTables();
+   * System.out.println("Got list of tables:");
+   * for(String tableId: tableIds) {
+   *   System.out.println(tableId);
+   * }
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listTables() { + return ApiExceptions.callAndTranslateApiException(listTablesAsync()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listTablesPagedCallable()}. + * + *

Asynchronously lists all table IDs in the instance. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> listFuture = client.listTables();
+   *
+   * ApiFutures.addCallback(
+   *   listFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List tableIds) {
+   *       System.out.println("Got list of tables:");
+   *       for (String tableId : tableIds) {
+   *         System.out.println(tableId);
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listTablesAsync() { + ListTablesRequest request = + ListTablesRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(projectId, instanceId)) + .build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listTablesPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListTablesPage apply(ListTablesPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction>() { + List responseAccumulator = Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListTablesPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List protos) { + List results = Lists.newArrayListWithCapacity(protos.size()); + for (com.google.bigtable.admin.v2.Table proto : protos) { + results.add(NameUtil.extractTableIdFromTableName(proto.getName())); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest)}. + * + *

Drops rows by the specified row key prefix and table ID. + * + *

Please note that this method is considered part of the admin API and is rate limited. + * + *

Sample code: + * + *

{@code
+   * client.dropRowRange("my-table", "prefix");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void dropRowRange(String tableId, String rowKeyPrefix) { + ApiExceptions.callAndTranslateApiException(dropRowRangeAsync(tableId, rowKeyPrefix)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRangeCallable()}. + * + *

Asynchronously drops rows by the specified row key prefix and table ID. + * + *

Please note that this method is considered part of the admin API and is rate limited. + * + *

Sample code: + * + *

{@code
+   * ApiFuture dropFuture = client.dropRowRangeAsync("my-table", "prefix");
+   *
+   * ApiFutures.addCallback(
+   *   dropFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void tableNames) {
+   *       System.out.println("Successfully dropped row range.");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture dropRowRangeAsync(String tableId, String rowKeyPrefix) { + return dropRowRangeAsync(tableId, ByteString.copyFromUtf8(rowKeyPrefix)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest)}. + * + *

Drops rows by the specified row key prefix and table ID. + * + *

Please note that this method is considered part of the admin API and is rate limited. + * + *

Sample code: + * + *

{@code
+   * client.dropRowRange("my-table", ByteString.copyFromUtf8("prefix"));
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void dropRowRange(String tableId, ByteString rowKeyPrefix) { + ApiExceptions.callAndTranslateApiException(dropRowRangeAsync(tableId, rowKeyPrefix)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRangeCallable()}. + * + *

Asynchronously drops rows by the specified row key prefix and table ID. + * + *

Please note that this method is considered part of the admin API and is rate limited. + * + *

Sample code: + * + *

{@code
+   * ApiFuture dropFuture = client.dropRowRangeAsync("my-table", ByteString.copyFromUtf8("prefix"));
+   *
+   * ApiFutures.addCallback(
+   *   dropFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void tableNames) {
+   *       System.out.println("Successfully dropped row range.");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture dropRowRangeAsync(String tableId, ByteString rowKeyPrefix) { + DropRowRangeRequest request = + DropRowRangeRequest.newBuilder() + .setName(getTableName(tableId)) + .setRowKeyPrefix(rowKeyPrefix) + .build(); + + return transformToVoid(this.stub.dropRowRangeCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest)}. + * + *

Drops all data in the table. + * + *

Sample code: + * + *

{@code
+   * client.dropAllRows("my-table");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void dropAllRows(String tableId) { + ApiExceptions.callAndTranslateApiException(dropAllRowsAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#dropRowRangeCallable()}. + * + *

Asynchronously drops all data in the table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture dropFuture = client.dropAllRowsAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *   dropFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void tableNames) {
+   *       System.out.println("Successfully dropped all data");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture dropAllRowsAsync(String tableId) { + DropRowRangeRequest request = + DropRowRangeRequest.newBuilder() + .setName(getTableName(tableId)) + .setDeleteAllDataFromTable(true) + .build(); + + return transformToVoid(this.stub.dropRowRangeCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#checkConsistency(com.google.bigtable.admin.v2.CheckConsistencyRequest)}. + * + *

Blocks the current thread until replication has caught up to the point when this method was + * called. This allows callers to make sure that their mutations have been replicated across all + * of their clusters. + * + *

Sample code + * + *

{@code
+   * client.awaitReplication("my-table");
+   * }
+ * + * @throws com.google.api.gax.retrying.PollException when polling exceeds the total timeout + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + @Deprecated + public void awaitReplication(String tableId) { + // TODO(igorbernstein2): remove usage of typesafe names + com.google.bigtable.admin.v2.TableName tableName = + com.google.bigtable.admin.v2.TableName.of(projectId, instanceId, tableId); + + ApiExceptions.callAndTranslateApiException( + stub.awaitReplicationCallable().futureCall(tableName)); + } + + public void awaitConsistency(ConsistencyRequest consistencyRequest) { + ApiExceptions.callAndTranslateApiException( + stub.awaitConsistencyCallable().futureCall(consistencyRequest)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createBackup(com.google.bigtable.admin.v2.CreateBackupRequest)}. + * + *

Creates a backup with the specified configuration. + * + *

Sample code + * + *

{@code
+   * CreateBackupRequest request =
+   *         CreateBackupRequest.of(clusterId, backupId)
+   *             .setSourceTableId(tableId)
+   *             .setExpireTime(expireTime);
+   * Backup response = client.createBackup(request);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Backup createBackup(CreateBackupRequest request) { + return ApiExceptions.callAndTranslateApiException(createBackupAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createBackupOperationCallable()}. + * + *

Creates a backup with the specified configuration asynchronously. + * + *

Sample code + * + *

{@code
+   * CreateBackupRequest request =
+   *         CreateBackupRequest.of(clusterId, backupId)
+   *             .setSourceTableId(tableId)
+   *             .setExpireTime(expireTime);
+   * ApiFuture future = client.createBackupAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Backup backup) {
+   *       System.out.println("Successfully create the backup " + backup.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createBackupAsync(CreateBackupRequest request) { + return ApiFutures.transform( + stub.createBackupOperationCallable().futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public Backup apply(com.google.bigtable.admin.v2.Backup backupProto) { + return Backup.fromProto(backupProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getBackup(com.google.bigtable.admin.v2.GetBackupRequest)}. + * + *

Gets a backup with the specified backup ID in the specified cluster. + * + *

Sample code + * + *

{@code
+   * Backup backup = client.getBackup(clusterId, backupId);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Backup getBackup(String clusterId, String backupId) { + return ApiExceptions.callAndTranslateApiException(getBackupAsync(clusterId, backupId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getBackupCallable()}. + * + *

Gets a backup with the specified backup ID in the specified cluster asynchronously. + * + *

Sample code + * + *

{@code
+   * ApiFuture future = client.getBackupAsync(clusterId, backupId);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Backup backup) {
+   *       System.out.println("Successfully get the backup " + backup.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getBackupAsync(String clusterId, String backupId) { + GetBackupRequest request = + GetBackupRequest.newBuilder() + .setName(NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId)) + .build(); + return ApiFutures.transform( + this.stub.getBackupCallable().futureCall(request), + new ApiFunction() { + @Override + public Backup apply(com.google.bigtable.admin.v2.Backup backup) { + return Backup.fromProto(backup); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listBackups(com.google.bigtable.admin.v2.ListBackupsRequest)}. + * + *

Lists backups in the specified cluster. + * + *

Sample code + * + *

{@code
+   * List backups = client.listBackups(clusterId);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listBackups(String clusterId) { + return ApiExceptions.callAndTranslateApiException(listBackupsAsync(clusterId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listBackupsPagedCallable()}. + * + *

Lists backups in the specified cluster asynchronously. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> listFuture = client.listBackupsAsync(clusterId);
+   *
+   * ApiFutures.addCallback(
+   *   listFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List backupIds) {
+   *       System.out.println("Got list of backups:");
+   *       for (String backupId : backupIds) {
+   *         System.out.println(backupId);
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listBackupsAsync(String clusterId) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() + .setParent(NameUtil.formatClusterName(projectId, instanceId, clusterId)) + .build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listBackupsPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListBackupsPage apply(ListBackupsPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction>() { + List responseAccumulator = Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListBackupsPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List protos) { + List results = Lists.newArrayListWithCapacity(protos.size()); + for (com.google.bigtable.admin.v2.Backup proto : protos) { + results.add(NameUtil.extractBackupIdFromBackupName(proto.getName())); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteBackup(com.google.bigtable.admin.v2.DeleteBackupRequest)}. + * + *

Deletes a backup with the specified backup ID in the specified cluster. + * + *

Sample code + * + *

{@code
+   * client.deleteBackup(clusterId, backupId);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteBackup(String clusterId, String backupId) { + ApiExceptions.callAndTranslateApiException(deleteBackupAsync(clusterId, backupId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteBackupCallable()}. + * + *

Deletes a backup with the specified backup ID in the specified cluster asynchronously. + * + *

Sample code + * + *

{@code
+   * ApiFuture future = client.deleteBackupAsync(clusterId, backupId);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void unused) {
+   *       System.out.println("Successfully delete the backup.");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteBackupAsync(String clusterId, String backupId) { + DeleteBackupRequest request = + DeleteBackupRequest.newBuilder() + .setName(NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId)) + .build(); + + return transformToVoid(this.stub.deleteBackupCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateBackup(com.google.bigtable.admin.v2.UpdateBackupRequest)}. + * + *

Updates a backup with the specified configuration. + * + *

Sample code + * + *

{@code
+   * Backup backup = client.updateBackup(clusterId, backupId);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Backup updateBackup(UpdateBackupRequest request) { + return ApiExceptions.callAndTranslateApiException(updateBackupAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateBackupCallable()}. + * + *

Updates a backup with the specified configuration asynchronously. + * + *

Sample code + * + *

{@code
+   * ApiFuture future = client.updateBackupAsync(clusterId, backupId);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Backup backup) {
+   *       System.out.println("Successfully update the backup " + backup.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateBackupAsync(UpdateBackupRequest request) { + return ApiFutures.transform( + stub.updateBackupCallable().futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public Backup apply(com.google.bigtable.admin.v2.Backup proto) { + return Backup.fromProto(proto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTable(com.google.bigtable.admin.v2.RestoreTableRequest)}. + * + *

Restores a backup to a new table with the specified configuration. + * + *

Sample code + * + *

{@code
+   * RestoredTableResult result =
+   *     client.restoreTable(RestoreTableRequest.of(clusterId, backupId).setTableId(tableId));
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public RestoredTableResult restoreTable(RestoreTableRequest request) + throws ExecutionException, InterruptedException { + return ApiExceptions.callAndTranslateApiException(restoreTableAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}. + * + *

Restores a backup to a new table with the specified configuration asynchronously. + * + *

Sample code + * + *

{@code
+   * ApiFuture future = client.restoreTableAsync(
+   *     RestoreTableRequest.of(clusterId, backupId).setTableId(tableId));
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(RestoredTableResult result) {
+   *       System.out.println("Successfully restore the table.");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture restoreTableAsync(RestoreTableRequest request) { + final OperationFuture future = + this.stub + .restoreTableOperationCallable() + .futureCall(request.toProto(projectId, instanceId)); + return ApiFutures.transformAsync( + future, + new ApiAsyncFunction() { + @Override + public ApiFuture apply(com.google.bigtable.admin.v2.Table table) + throws Exception { + return ApiFutures.immediateFuture( + // When apply is called, the future should have been resolved and it's safe to + // pull the metadata. + new RestoredTableResult( + Table.fromProto(table), + future.getMetadata().get().getOptimizeTableOperationName())); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * Awaits the completion of the "Optimize Restored Table" operation. + * + *

This method blocks until the restore operation is complete, extracts the optimization token, + * and returns an ApiFuture for the optimization phase. + * + * @param restoreFuture The future returned by restoreTableAsync(). + * @return An ApiFuture that tracks the optimization progress. + */ + public ApiFuture awaitOptimizeRestoredTable(ApiFuture restoreFuture) { + // 1. Block and wait for the restore operation to complete + RestoredTableResult result; + try { + result = restoreFuture.get(); + } catch (Exception e) { + throw new RuntimeException("Restore operation failed", e); + } + + // 2. Extract the operation token from the result + // (RestoredTableResult already wraps the OptimizeRestoredTableOperationToken) + OptimizeRestoredTableOperationToken token = result.getOptimizeRestoredTableOperationToken(); + + if (token == null || Strings.isNullOrEmpty(token.getOperationName())) { + // If there is no optimization operation, return immediate success. + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + + // 3. Return the future for the optimization operation + return stub.awaitOptimizeRestoredTableCallable().resumeFutureCall(token.getOperationName()); + } + + /** + * Awaits a restored table is fully optimized. + * + *

Sample code + * + *

{@code
+   * RestoredTableResult result =
+   *     client.restoreTable(RestoreTableRequest.of(clusterId, backupId).setTableId(tableId));
+   * client.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken());
+   * }
+ */ + public void awaitOptimizeRestoredTable(OptimizeRestoredTableOperationToken token) + throws ExecutionException, InterruptedException { + awaitOptimizeRestoredTableAsync(token).get(); + } + + /** + * Awaits a restored table is fully optimized asynchronously. + * + *

Sample code + * + *

{@code
+   * RestoredTableResult result =
+   *     client.restoreTable(RestoreTableRequest.of(clusterId, backupId).setTableId(tableId));
+   * ApiFuture future = client.awaitOptimizeRestoredTableAsync(
+   *     result.getOptimizeRestoredTableOperationToken());
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void unused) {
+   *       System.out.println("The optimization of the restored table is done.");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + public ApiFuture awaitOptimizeRestoredTableAsync( + OptimizeRestoredTableOperationToken token) { + return transformToVoid( + stub.awaitOptimizeRestoredTableCallable().resumeFutureCall(token.getOperationName())); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#copyBackup(com.google.bigtable.admin.v2.CopyBackupRequest)}. + * + *

Copy an existing backup to a new backup in a Cloud Bigtable cluster with the specified + * configuration. + * + *

Sample code Note: You want to create the client with project and instance where you want the + * new backup to be copied to. + * + *

{@code
+   * BigtableTableAdminClient client =  BigtableTableAdminClient.create("[PROJECT]", "[INSTANCE]");
+   * CopyBackupRequest request =
+   *         CopyBackupRequest.of(sourceClusterId, sourceBackupId)
+   *             .setDestination(clusterId, backupId)
+   *             .setExpireTime(expireTime);
+   * Backup response = client.copyBackup(request);
+   * }
+ * + * If the source backup is located in a different instance + * + *
{@code
+   * CopyBackupRequest request =
+   *         CopyBackupRequest.of(sourceClusterId, sourceBackupId)
+   *             .setSourceInstance(sourceInstanceId)
+   *             .setDestination(clusterId, backupId)
+   *             .setExpireTime(expireTime);
+   * Backup response = client.copyBackup(request);
+   * }
+ * + * If the source backup is located in a different project + * + *
{@code
+   * CopyBackupRequest request =
+   *         CopyBackupRequest.of(sourceClusterId, sourceBackupId)
+   *             .setSourceInstance(sourceProjectId, sourceInstanceId)
+   *             .setDestination(clusterId, backupId)
+   *             .setExpireTime(expireTime);
+   * Backup response = client.copyBackup(request);
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Backup copyBackup(CopyBackupRequest request) { + return ApiExceptions.callAndTranslateApiException(copyBackupAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#copyBackupOperationCallable()}. + * + *

Creates a copy of a backup from an existing backup in a Cloud Bigtable cluster with the + * specified configuration asynchronously. + * + *

Sample code + * + *

{@code
+   * CopyBackupRequest request =
+   *         CopyBackupRequest.of(sourceClusterId, sourceBackupId)
+   *             .setDestination(clusterId, backupId)
+   *             .setExpireTime(expireTime);
+   * ApiFuture future = client.copyBackupAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Backup backup) {
+   *       System.out.println("Successfully create the backup " + backup.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture copyBackupAsync(CopyBackupRequest request) { + return ApiFutures.transform( + stub.copyBackupOperationCallable().futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public Backup apply(com.google.bigtable.admin.v2.Backup backupProto) { + return Backup.fromProto(backupProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#generateConsistencyTokenCallable()}. + * + *

Returns a future that is resolved when replication has caught up to the point when this + * method was called. This allows callers to make sure that their mutations have been replicated + * across all of their clusters. + * + *

Sample code: + * + *

{@code
+   * ApiFuture replicationFuture = client.awaitReplicationAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *   replicationFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Table table) {
+   *       System.out.println("All clusters are now consistent");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   *
+   * }
+ */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + @Deprecated + public ApiFuture awaitReplicationAsync(final String tableId) { + // TODO(igorbernstein2): remove usage of typesafe names + com.google.bigtable.admin.v2.TableName tableName = + com.google.bigtable.admin.v2.TableName.of(projectId, instanceId, tableId); + return stub.awaitReplicationCallable().futureCall(tableName); + } + + /** + * Polls an existing consistency token until table replication is consistent across all clusters. + * Useful for checking consistency of a token generated in a separate process. Blocks until + * completion. + * + * @param tableId The table to check. + * @param consistencyToken The token to poll. + */ + public void waitForConsistency(String tableId, String consistencyToken) { + ApiExceptions.callAndTranslateApiException(waitForConsistencyAsync(tableId, consistencyToken)); + } + + /** + * Asynchronously polls the consistency token. Returns a future that completes when table + * replication is consistent across all clusters. + * + * @param tableId The table to check. + * @param consistencyToken The token to poll. + */ + public ApiFuture waitForConsistencyAsync(String tableId, String consistencyToken) { + return stub.awaitConsistencyCallable() + .futureCall(ConsistencyRequest.forReplication(tableId, consistencyToken)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createAuthorizedView(com.google.bigtable.admin.v2.CreateAuthorizedViewRequest)}. + * + *

Creates a new authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateAuthorizedViewRequest request =
+   *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+   *         .setDeletionProtection(true)
+   *         .setAuthorizedViewType(
+   *             SubsetView.create()
+   *                 .addRowPrefix("row#")
+   *                 .addFamilySubsets(
+   *                     "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * AuthorizedView response = client.createAuthorizedView(request);
+   * }
+ * + * @see CreateAuthorizedViewRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AuthorizedView createAuthorizedView(CreateAuthorizedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(createAuthorizedViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createAuthorizedViewOperationCallable()}. + * + *

Asynchronously creates a new authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateAuthorizedViewRequest request =
+   *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+   *         .setDeletionProtection(true)
+   *         .setAuthorizedViewType(
+   *             SubsetView.create()
+   *                 .addRowPrefix("row#")
+   *                 .addFamilySubsets(
+   *                     "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * ApiFuture future = client.createAuthorizedViewAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(AuthorizedView authorizedView) {
+   *       System.out.println("Successfully created the authorized view: " + authorizedView.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ * + * @see CreateAuthorizedViewRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createAuthorizedViewAsync(CreateAuthorizedViewRequest request) { + return ApiFutures.transform( + stub.createAuthorizedViewOperationCallable() + .futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public AuthorizedView apply( + com.google.bigtable.admin.v2.AuthorizedView authorizedViewProto) { + return AuthorizedView.fromProto(authorizedViewProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateAuthorizedView(com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest)}. + * + *

Updates an existing authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * AuthorizedView existingAuthorizedView = client.getAuthorizedView("my-table", "my-authorized-view");
+   *
+   * UpdateAuthorizedViewRequest request =
+   *     UpdateAuthorizedViewRequest.of(existingAuthorizedView).setDeletionProtection(true);
+   *
+   * AuthorizedView response = client.updateAuthorizedView(request);
+   * }
+ * + * @see UpdateAuthorizedViewRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AuthorizedView updateAuthorizedView(UpdateAuthorizedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(updateAuthorizedViewAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateAuthorizedViewOperationCallable()}. + * + *

Asynchronously updates an existing authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * AuthorizedView existingAuthorizedView = client.getAuthorizedView("my-table", "my-authorized-view");
+   *
+   * UpdateAuthorizedViewRequest request =
+   *     UpdateAuthorizedViewRequest.of(existingAuthorizedView).setDeletionProtection(true);
+   *
+   * ApiFuture future = client.updateAuthorizedViewAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(AuthorizedView authorizedView) {
+   *       System.out.println("Successfully updated the authorized view: " + authorizedView.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ * + * @see UpdateAuthorizedViewRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateAuthorizedViewAsync(UpdateAuthorizedViewRequest request) { + return ApiFutures.transform( + stub.updateAuthorizedViewOperationCallable() + .futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public AuthorizedView apply( + com.google.bigtable.admin.v2.AuthorizedView authorizedViewProto) { + return AuthorizedView.fromProto(authorizedViewProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getAuthorizedView(com.google.bigtable.admin.v2.GetAuthorizedViewRequest)}. + * + *

Gets an authorized view with the specified authorized view ID in the specified table. + * + *

Sample code: + * + *

{@code
+   * AuthorizedView authorizedView = client.getAuthorizedView("my-table", "my-authorized-view");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AuthorizedView getAuthorizedView(String tableId, String authorizedViewId) { + return ApiExceptions.callAndTranslateApiException( + getAuthorizedViewAsync(tableId, authorizedViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getAuthorizedViewCallable()}. + * + *

Asynchronously gets an authorized view with the specified authorized view ID in the + * specified table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.getAuthorizedViewAsync("my-table", "my-authorized-view");
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(AuthorizedView authorizedView) {
+   *       System.out.println("Successfully get the authorized view: " + authorizedView.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getAuthorizedViewAsync(String tableId, String authorizedViewId) { + GetAuthorizedViewRequest request = + GetAuthorizedViewRequest.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId)) + .build(); + return ApiFutures.transform( + stub.getAuthorizedViewCallable().futureCall(request), + new ApiFunction() { + @Override + public AuthorizedView apply( + com.google.bigtable.admin.v2.AuthorizedView authorizedViewProto) { + return AuthorizedView.fromProto(authorizedViewProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listAuthorizedViews(com.google.bigtable.admin.v2.ListAuthorizedViewsRequest)}. + * + *

Lists all authorized view IDs in the specified table. + * + *

Sample code: + * + *

{@code
+   * List authorizedViews = client.listAuthorizedViews("my-table");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listAuthorizedViews(String tableId) { + return ApiExceptions.callAndTranslateApiException(listAuthorizedViewsAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listAuthorizedViewsPagedCallable()}. + * + *

Asynchronously lists all authorized view IDs in the specified table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> future = client.listAuthorizedViewsAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List authorizedViewIds) {
+   *       System.out.println("Successfully get list of authorized views:");
+   *       for (AuthorizedView authorizedViewId : authorizedViewIds) {
+   *         System.out.println(authorizedViewId);
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listAuthorizedViewsAsync(String tableId) { + ListAuthorizedViewsRequest request = + ListAuthorizedViewsRequest.newBuilder() + .setParent(NameUtil.formatTableName(projectId, instanceId, tableId)) + .build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listAuthorizedViewsPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListAuthorizedViewsPage apply(ListAuthorizedViewsPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction< + ListAuthorizedViewsPage, List>() { + List responseAccumulator = + Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListAuthorizedViewsPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List protos) { + List results = Lists.newArrayListWithCapacity(protos.size()); + for (com.google.bigtable.admin.v2.AuthorizedView proto : protos) { + results.add(NameUtil.extractAuthorizedViewIdFromAuthorizedViewName(proto.getName())); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteAuthorizedView(com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest)}. + * + *

Deletes an authorized view with the specified authorized view ID in the specified table. + * Note that the deletion is prohibited if the authorized view has deletion_protection field set + * to true. + * + *

Sample code: + * + *

{@code
+   * client.deleteAuthorizedView("my-table", "my-authorized-view");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteAuthorizedView(String tableId, String authorizedViewId) { + ApiExceptions.callAndTranslateApiException( + deleteAuthorizedViewAsync(tableId, authorizedViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteAuthorizedViewCallable()}. + * + *

Asynchronously deletes an authorized view with the specified authorized view ID in the + * specified table. Note that the deletion is prohibited if the authorized view has + * deletion_protection field set to true. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.deleteAuthorizedViewAsync("my-table", "my-authorized-view");
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void ignored) {
+   *       System.out.println("Successfully deleted the authorized view");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteAuthorizedViewAsync(String tableId, String authorizedViewId) { + DeleteAuthorizedViewRequest request = + DeleteAuthorizedViewRequest.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId)) + .build(); + + return transformToVoid(this.stub.deleteAuthorizedViewCallable().futureCall(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createSchemaBundle(com.google.bigtable.admin.v2.CreateSchemaBundleRequest)}. + * + *

Creates a new schema bundle with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateSchemaBundleRequest request = CreateSchemaBundleRequest.of("my-table", "my-new-schema-bundle")
+   *     .setDeletionProtection(true)
+   *     .setSchemaBundleType(
+   *         SubsetView.create()
+   *             .addRowPrefix("row#")
+   *             .addFamilySubsets(
+   *                 "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * SchemaBundle response = client.createSchemaBundle(request);
+   * }
+ * + * @see CreateSchemaBundleRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public SchemaBundle createSchemaBundle(CreateSchemaBundleRequest request) { + return ApiExceptions.callAndTranslateApiException(createSchemaBundleAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#createSchemaBundleOperationCallable()}. + * + *

Asynchronously creates a new schema bundle with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateSchemaBundleRequest request = CreateSchemaBundleRequest.of("my-table", "my-new-schema-bundle")
+   *     .setDeletionProtection(true)
+   *     .setSchemaBundleType(
+   *         SubsetView.create()
+   *             .addRowPrefix("row#")
+   *             .addFamilySubsets(
+   *                 "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * ApiFuture future = client.createSchemaBundleAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *     future,
+   *     new ApiFutureCallback() {
+   *       public void onSuccess(SchemaBundle schemaBundle) {
+   *         System.out.println("Successfully created the schema bundle: " + schemaBundle.getId());
+   *       }
+   *
+   *       public void onFailure(Throwable t) {
+   *         t.printStackTrace();
+   *       }
+   *     },
+   *     MoreExecutors.directExecutor());
+   * }
+ * + * @see CreateSchemaBundleRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture createSchemaBundleAsync(CreateSchemaBundleRequest request) { + return ApiFutures.transform( + stub.createSchemaBundleOperationCallable() + .futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public SchemaBundle apply(com.google.bigtable.admin.v2.SchemaBundle schemaBundleProto) { + return SchemaBundle.fromProto(schemaBundleProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateSchemaBundle(com.google.bigtable.admin.v2.UpdateSchemaBundleRequest)}. + * + *

Updates an existing schema bundle with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * SchemaBundle existingSchemaBundle = client.getSchemaBundle("my-table", "my-schema-bundle");
+   *
+   * UpdateSchemaBundleRequest request = UpdateSchemaBundleRequest.of(existingSchemaBundle).setDeletionProtection(true);
+   *
+   * SchemaBundle response = client.updateSchemaBundle(request);
+   * }
+ * + * @see UpdateSchemaBundleRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public SchemaBundle updateSchemaBundle(UpdateSchemaBundleRequest request) { + return ApiExceptions.callAndTranslateApiException(updateSchemaBundleAsync(request)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#updateSchemaBundleOperationCallable()}. + * + *

Asynchronously updates an existing schema bundle with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * SchemaBundle existingSchemaBundle = client.getSchemaBundle("my-table", "my-schema-bundle");
+   *
+   * UpdateSchemaBundleRequest request = UpdateSchemaBundleRequest.of(existingSchemaBundle).setDeletionProtection(true);
+   *
+   * ApiFuture future = client.updateSchemaBundleAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *     future,
+   *     new ApiFutureCallback() {
+   *       public void onSuccess(SchemaBundle schemaBundle) {
+   *         System.out.println("Successfully updated the schema bundle: " + schemaBundle.getId());
+   *       }
+   *
+   *       public void onFailure(Throwable t) {
+   *         t.printStackTrace();
+   *       }
+   *     },
+   *     MoreExecutors.directExecutor());
+   * }
+ * + * @see UpdateSchemaBundleRequest for available options. + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture updateSchemaBundleAsync(UpdateSchemaBundleRequest request) { + return ApiFutures.transform( + stub.updateSchemaBundleOperationCallable() + .futureCall(request.toProto(projectId, instanceId)), + new ApiFunction() { + @Override + public SchemaBundle apply(com.google.bigtable.admin.v2.SchemaBundle schemaBundleProto) { + return SchemaBundle.fromProto(schemaBundleProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getSchemaBundle(com.google.bigtable.admin.v2.GetSchemaBundleRequest)}. + * + *

Gets an schema bundle with the specified schema bundle ID in the specified table. + * + *

Sample code: + * + *

{@code
+   * SchemaBundle schemaBundle = client.getSchemaBundle("my-table", "my-schema-bundle");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public SchemaBundle getSchemaBundle(String tableId, String schemaBundleId) { + return ApiExceptions.callAndTranslateApiException( + getSchemaBundleAsync(tableId, schemaBundleId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getSchemaBundleCallable()}. + * + *

Asynchronously gets an schema bundle with the specified schema bundle ID in the specified + * table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.getSchemaBundleAsync("my-table", "my-schema-bundle");
+   *
+   * ApiFutures.addCallback(
+   *     future,
+   *     new ApiFutureCallback() {
+   *       public void onSuccess(SchemaBundle schemaBundle) {
+   *         System.out.println("Successfully get the schema bundle: " + schemaBundle.getId());
+   *       }
+   *
+   *       public void onFailure(Throwable t) {
+   *         t.printStackTrace();
+   *       }
+   *     },
+   *     MoreExecutors.directExecutor());
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getSchemaBundleAsync(String tableId, String schemaBundleId) { + GetSchemaBundleRequest request = + GetSchemaBundleRequest.newBuilder() + .setName( + NameUtil.formatSchemaBundleName(projectId, instanceId, tableId, schemaBundleId)) + .build(); + return ApiFutures.transform( + stub.getSchemaBundleCallable().futureCall(request), + new ApiFunction() { + @Override + public SchemaBundle apply(com.google.bigtable.admin.v2.SchemaBundle schemaBundleProto) { + return SchemaBundle.fromProto(schemaBundleProto); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listSchemaBundles(com.google.bigtable.admin.v2.ListSchemaBundlesRequest)}. + * + *

Lists all schema bundle IDs in the specified table. + * + *

Sample code: + * + *

{@code
+   * List schemaBundles = client.listSchemaBundles("my-table");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List listSchemaBundles(String tableId) { + return ApiExceptions.callAndTranslateApiException(listSchemaBundlesAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#listSchemaBundlesPagedCallable()}. + * + *

Asynchronously lists all schema bundle IDs in the specified table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> future = client.listSchemaBundlesAsync("my-table");
+   *
+   * ApiFutures.addCallback(
+   *     future,
+   *     new ApiFutureCallback>() {
+   *       public void onSuccess(List schemaBundleIds) {
+   *         System.out.println("Successfully get list of schema bundles:");
+   *         for (SchemaBundle schemaBundleId : schemaBundleIds) {
+   *           System.out.println(schemaBundleId);
+   *         }
+   *       }
+   *
+   *       public void onFailure(Throwable t) {
+   *         t.printStackTrace();
+   *       }
+   *     },
+   *     MoreExecutors.directExecutor());
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> listSchemaBundlesAsync(String tableId) { + ListSchemaBundlesRequest request = + ListSchemaBundlesRequest.newBuilder() + .setParent(NameUtil.formatTableName(projectId, instanceId, tableId)) + .build(); + + // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way + // to expose the + // paginated responses while maintaining the wrapper facade. + + // Fetches the first page. + ApiFuture firstPageFuture = + ApiFutures.transform( + stub.listSchemaBundlesPagedCallable().futureCall(request), + new ApiFunction() { + @Override + public ListSchemaBundlesPage apply(ListSchemaBundlesPagedResponse response) { + return response.getPage(); + } + }, + MoreExecutors.directExecutor()); + + // Fetches the rest of the pages by chaining the futures. + ApiFuture> allProtos = + ApiFutures.transformAsync( + firstPageFuture, + new ApiAsyncFunction< + ListSchemaBundlesPage, List>() { + List responseAccumulator = + Lists.newArrayList(); + + @Override + public ApiFuture> apply( + ListSchemaBundlesPage page) { + // Add all entries from the page + responseAccumulator.addAll(Lists.newArrayList(page.getValues())); + + // If this is the last page, just return the accumulated responses. + if (!page.hasNextPage()) { + return ApiFutures.immediateFuture(responseAccumulator); + } + + // Otherwise fetch the next page. + return ApiFutures.transformAsync( + page.getNextPageAsync(), this, MoreExecutors.directExecutor()); + } + }, + MoreExecutors.directExecutor()); + + // Wraps all of the accumulated protos. + return ApiFutures.transform( + allProtos, + new ApiFunction, List>() { + @Override + public List apply(List protos) { + List results = Lists.newArrayListWithCapacity(protos.size()); + for (com.google.bigtable.admin.v2.SchemaBundle proto : protos) { + results.add(NameUtil.extractSchemaBundleIdFromSchemaBundleName(proto.getName())); + } + return results; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteSchemaBundle(com.google.bigtable.admin.v2.DeleteSchemaBundleRequest)}. + * + *

Deletes an schema bundle with the specified schema bundle ID in the specified table. + * + *

Sample code: + * + *

{@code
+   * client.deleteSchemaBundle("my-table", "my-schema-bundle");
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public void deleteSchemaBundle(String tableId, String schemaBundleId) { + ApiExceptions.callAndTranslateApiException(deleteSchemaBundleAsync(tableId, schemaBundleId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#deleteSchemaBundleCallable()}. + * + *

Asynchronously deletes an schema bundle with the specified schema bundle ID in the specified + * table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture future = client.deleteSchemaBundleAsync("my-table", "my-schema-bundle");
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Void ignored) {
+   *       System.out.println("Successfully deleted the schema bundle");
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture deleteSchemaBundleAsync(String tableId, String schemaBundleId) { + DeleteSchemaBundleRequest request = + DeleteSchemaBundleRequest.newBuilder() + .setName( + NameUtil.formatSchemaBundleName(projectId, instanceId, tableId, schemaBundleId)) + .build(); + + return transformToVoid(this.stub.deleteSchemaBundleCallable().futureCall(request)); + } + + /** + * Helper method to construct the table name in format: + * projects/{project}/instances/{instance}/tables/{tableId} + */ + private String getTableName(String tableId) { + return NameUtil.formatTableName(projectId, instanceId, tableId); + } + + // TODO(igorbernstein): rename methods to make clear that they deal with futures. + + /** + * Helper method to transform ApiFuture to ApiFuture
+ */ + private static ApiFuture
transformToTableResponse( + ApiFuture future) { + return ApiFutures.transform( + future, + new ApiFunction() { + @Override + public Table apply(com.google.bigtable.admin.v2.Table table) { + return Table.fromProto(table); + } + }, + MoreExecutors.directExecutor()); + } + + /** Helper method to transform ApiFuture to ApiFuture */ + private static ApiFuture transformToVoid(ApiFuture future) { + return ApiFutures.transform( + future, + new ApiFunction() { + @Override + public Void apply(Empty empty) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicy(com.google.iam.v1.GetIamPolicyRequest)}. + * + *

Gets the IAM access control policy for the specified table. + * + *

Sample code: + * + *

{@code
+   * Policy policy = client.getIamPolicy("my-table");
+   * for(Map.Entry> entry : policy.getBindings().entrySet()) {
+   *   System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   * }
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy getIamPolicy(String tableId) { + return ApiExceptions.callAndTranslateApiException(getIamPolicyAsync(tableId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicyCallable()}. + * + *

Asynchronously gets the IAM access control policy for the specified table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture policyFuture = client.getIamPolicyAsync("my-table");
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getIamPolicyAsync(String tableId) { + String tableName = NameUtil.formatTableName(projectId, instanceId, tableId); + return getResourceIamPolicy(tableName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicy(com.google.iam.v1.SetIamPolicyRequest)}. + * + *

Replaces the IAM policy associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * Policy newPolicy = client.setIamPolicy("my-table",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy setIamPolicy(String tableId, Policy policy) { + return ApiExceptions.callAndTranslateApiException(setIamPolicyAsync(tableId, policy)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicyCallable()}. + * + *

Asynchronously replaces the IAM policy associated with the specified table. + * + *

Sample code: + * + *

{@code
+   * ApiFuture newPolicyFuture = client.setIamPolicyAsync("my-table",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture setIamPolicyAsync(String tableId, Policy policy) { + String tableName = NameUtil.formatTableName(projectId, instanceId, tableId); + return setResourceIamPolicy(policy, tableName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest)}. + * + *

Tests whether the caller has the given permissions for the specified table. Returns a subset + * of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * List grantedPermissions = client.testIamPermission("my-table",
+   *   "bigtable.tables.readRows", "bigtable.tables.mutateRows");
+   * }
+ * + * System.out.println("Has read access: " + + * grantedPermissions.contains("bigtable.tables.readRows")); System.out.println("Has write access: + * " + grantedPermissions.contains("bigtable.tables.mutateRows")); + * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List testIamPermission(String tableId, String... permissions) { + return ApiExceptions.callAndTranslateApiException(testIamPermissionAsync(tableId, permissions)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissionsCallable()}. + * + *

Asynchronously tests whether the caller has the given permissions for the specified table. + * Returns a subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> grantedPermissionsFuture = client.testIamPermissionAsync("my-table",
+   *   "bigtable.tables.readRows", "bigtable.tables.mutateRows");
+   *
+   * ApiFutures.addCallback(grantedPermissionsFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List grantedPermissions) {
+   *       System.out.println("Has read access: " + grantedPermissions.contains("bigtable.tables.readRows"));
+   *       System.out.println("Has write access: " + grantedPermissions.contains("bigtable.tables.mutateRows"));
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> testIamPermissionAsync(String tableId, String... permissions) { + String tableName = NameUtil.formatTableName(projectId, instanceId, tableId); + return testResourceIamPermissions(tableName, permissions); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicy(com.google.iam.v1.GetIamPolicyRequest)}. + * + *

Gets the IAM access control policy for the specified backup. + * + *

Sample code: + * + *

{@code
+   * Policy policy = client.getBackupIamPolicy("my-cluster-id", "my-backup-id");
+   * for(Map.Entry> entry : policy.getBindings().entrySet()) {
+   *   System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   * }
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy getBackupIamPolicy(String clusterId, String backupId) { + return ApiExceptions.callAndTranslateApiException(getBackupIamPolicyAsync(clusterId, backupId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicyCallable()}. + * + *

Asynchronously gets the IAM access control policy for the specified backup. + * + *

Sample code: + * + *

{@code
+   * ApiFuture policyFuture = client.getBackupIamPolicyAsync("my-cluster-id", "my-backup-id");
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getBackupIamPolicyAsync(String clusterId, String backupId) { + String backupName = NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId); + return getResourceIamPolicy(backupName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicy(com.google.iam.v1.SetIamPolicyRequest)}. + * + *

Replaces the IAM policy associated with the specified backup. + * + *

Sample code: + * + *

{@code
+   * Policy newPolicy = client.setBackupIamPolicy("my-cluster-id", "my-backup-id",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy setBackupIamPolicy(String clusterId, String backupId, Policy policy) { + return ApiExceptions.callAndTranslateApiException( + setBackupIamPolicyAsync(clusterId, backupId, policy)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicyCallable()}. + * + *

Asynchronously replaces the IAM policy associated with the specified backup. + * + *

Sample code: + * + *

{@code
+   * ApiFuture newPolicyFuture = client.setBackupIamPolicyAsync("my-cluster-id", "my-backup-id",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   *
+   * ApiFutures.addCallback(newPolicyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture setBackupIamPolicyAsync( + String clusterId, String backupId, Policy policy) { + String backupName = NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId); + return setResourceIamPolicy(policy, backupName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest)}. + * + *

Tests whether the caller has the given permissions for the specified backup. Returns a + * subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * List grantedPermissions = client.testBackupIamPermission("my-cluster-id", "my-backup-id",
+   *   "bigtable.backups.restore", "bigtable.backups.delete");
+   * }
+ * + * System.out.println("Has restore access: " + + * grantedPermissions.contains("bigtable.backups.restore")); + * + *

System.out.println("Has delete access: " + + * grantedPermissions.contains("bigtable.backups.delete")); + * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List testBackupIamPermission( + String clusterId, String backupId, String... permissions) { + return ApiExceptions.callAndTranslateApiException( + testBackupIamPermissionAsync(clusterId, backupId, permissions)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissionsCallable()}. + * + *

Asynchronously tests whether the caller has the given permissions for the specified backup. + * Returns a subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> grantedPermissionsFuture = client.testBackupIamPermissionAsync("my-cluster-id", "my-backup-id",
+   *   "bigtable.backups.restore", "bigtable.backups.delete");
+   *
+   * ApiFutures.addCallback(grantedPermissionsFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List grantedPermissions) {
+   *       System.out.println("Has restore access: " + grantedPermissions.contains("bigtable.backups.restore"));
+   *       System.out.println("Has delete access: " + grantedPermissions.contains("bigtable.backups.delete"));
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> testBackupIamPermissionAsync( + String clusterId, String backupId, String... permissions) { + String backupName = NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId); + return testResourceIamPermissions(backupName, permissions); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicy(com.google.iam.v1.GetIamPolicyRequest)}. + * + *

Gets the IAM access control policy for the specified authorized view. + * + *

Sample code: + * + *

{@code
+   * Policy policy = client.getAuthorizedViewIamPolicy("my-table-id", "my-authorized-view-id");
+   * for(Map.Entry> entry : policy.getBindings().entrySet()) {
+   *   System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   * }
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy getAuthorizedViewIamPolicy(String tableId, String authorizedViewId) { + return ApiExceptions.callAndTranslateApiException( + getAuthorizedViewIamPolicyAsync(tableId, authorizedViewId)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#getIamPolicyCallable()}. + * + *

Asynchronously gets the IAM access control policy for the specified authorized view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture policyFuture = client.getAuthorizedViewIamPolicyAsync("my-table-id", "my-authorized-view-id");
+   *
+   * ApiFutures.addCallback(policyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture getAuthorizedViewIamPolicyAsync( + String tableId, String authorizedViewId) { + String authorizedViewName = + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId); + return getResourceIamPolicy(authorizedViewName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicy(com.google.iam.v1.SetIamPolicyRequest)}. + * + *

Replaces the IAM policy associated with the specified authorized view. + * + *

Sample code: + * + *

{@code
+   * Policy newPolicy = client.setAuthorizedViewIamPolicy("my-table-id", "my-authorized-view-id",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public Policy setAuthorizedViewIamPolicy(String tableId, String authorizedViewId, Policy policy) { + return ApiExceptions.callAndTranslateApiException( + setAuthorizedViewIamPolicyAsync(tableId, authorizedViewId, policy)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#setIamPolicyCallable()}. + * + *

Asynchronously replaces the IAM policy associated with the specified authorized view. + * + *

Sample code: + * + *

{@code
+   * ApiFuture newPolicyFuture = client.setAuthorizedViewIamPolicyAsync("my-table-id", "my-authorized-view-id",
+   *   Policy.newBuilder()
+   *     .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
+   *     .addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"))
+   *     .build());
+   *
+   * ApiFutures.addCallback(newPolicyFuture,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(Policy policy) {
+   *       for (Entry> entry : policy.getBindings().entrySet()) {
+   *         System.out.printf("Role: %s Identities: %s\n", entry.getKey(), entry.getValue());
+   *       }
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Table-level + * IAM management + */ + @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture setAuthorizedViewIamPolicyAsync( + String tableId, String authorizedViewId, Policy policy) { + String authorizedViewName = + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId); + return setResourceIamPolicy(policy, authorizedViewName); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest)}. + * + *

Tests whether the caller has the given permissions for the specified authorized view. + * Returns a subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * List grantedPermissions = client.testAuthorizedViewIamPermission("my-table-id", "my-authorized-view-id",
+   *   "bigtable.authorizedViews.get", "bigtable.authorizedViews.delete");
+   * }
+ * + * System.out.println("Has get access: " + + * grantedPermissions.contains("bigtable.authorizedViews.get")); + * + *

System.out.println("Has delete access: " + + * grantedPermissions.contains("bigtable.authorizedViews.delete")); + * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public List testAuthorizedViewIamPermission( + String tableId, String authorizedViewId, String... permissions) { + return ApiExceptions.callAndTranslateApiException( + testAuthorizedViewIamPermissionAsync(tableId, authorizedViewId, permissions)); + } + + /** + * This method is obsolete. For the recommended proto-based approach, please see {@link + * com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#testIamPermissionsCallable()}. + * + *

Asynchronously tests whether the caller has the given permissions for the specified + * authorized view. Returns a subset of the specified permissions that the caller has. + * + *

Sample code: + * + *

{@code
+   * ApiFuture> grantedPermissionsFuture = client.testAuthorizedViewIamPermissionAsync("my-table-id",
+   *   "my-authorized-view-id", "bigtable.authorizedViews.get", "bigtable.authorizedViews.delete");
+   *
+   * ApiFutures.addCallback(grantedPermissionsFuture,
+   *   new ApiFutureCallback>() {
+   *     public void onSuccess(List grantedPermissions) {
+   *       System.out.println("Has get access: " + grantedPermissions.contains("bigtable.authorizedViews.get"));
+   *       System.out.println("Has delete access: " + grantedPermissions.contains("bigtable.authorizedViews.delete"));
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor());
+   * }
+ * + * @see Cloud Bigtable + * permissions + */ + @SuppressWarnings({"WeakerAccess"}) + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public ApiFuture> testAuthorizedViewIamPermissionAsync( + String tableId, String authorizedViewId, String... permissions) { + String authorizedViewName = + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId); + return testResourceIamPermissions(authorizedViewName, permissions); + } + + private ApiFuture getResourceIamPolicy(String name) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(name).build(); + + final IamPolicyMarshaller marshaller = new IamPolicyMarshaller(); + + return ApiFutures.transform( + stub.getIamPolicyCallable().futureCall(request), + new ApiFunction() { + @Override + public Policy apply(com.google.iam.v1.Policy proto) { + return marshaller.fromPb(proto); + } + }, + MoreExecutors.directExecutor()); + } + + private ApiFuture setResourceIamPolicy(Policy policy, String name) { + final IamPolicyMarshaller marshaller = new IamPolicyMarshaller(); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(name) + .setPolicy(marshaller.toPb(policy)) + .build(); + + return ApiFutures.transform( + stub.setIamPolicyCallable().futureCall(request), + new ApiFunction() { + @Override + public Policy apply(com.google.iam.v1.Policy proto) { + return marshaller.fromPb(proto); + } + }, + MoreExecutors.directExecutor()); + } + + private ApiFuture> testResourceIamPermissions( + String resourceName, String[] permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resourceName) + .addAllPermissions(Arrays.asList(permissions)) + .build(); + + return ApiFutures.transform( + stub.testIamPermissionsCallable().futureCall(request), + new ApiFunction>() { + @Override + public List apply(TestIamPermissionsResponse input) { + return input.getPermissionsList(); + } + }, + MoreExecutors.directExecutor()); + } + + /** + * Simple adapter to expose {@link DefaultMarshaller} to this class. It enables this client to + * convert to/from IAM wrappers and protobufs. + */ + private static class IamPolicyMarshaller extends DefaultMarshaller { + @Override + public Policy fromPb(com.google.iam.v1.Policy policyPb) { + return super.fromPb(policyPb); + } + + @Override + public com.google.iam.v1.Policy toPb(Policy policy) { + return super.toPb(policy); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java new file mode 100644 index 000000000000..a9a8acead989 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java @@ -0,0 +1,277 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import com.google.common.base.Verify; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Settings class to configure an instance of {@link BigtableTableAdminClient}. + * + *

It must be configured with a project ID and instance ID. + * + *

Example usage: + * + *

{@code
+ * BigtableTableAdminSettings.Builder tableAdminSettingsBuilder = BigtableTableAdminSettings.newBuilder()
+ *   .setProjectId("my-project")
+ *   .setInstanceId("my-instance");
+ *
+ * tableAdminSettingsBuilder.stubSettings().createTableSettings()
+ *   .setRetrySettings(
+ *     RetrySettings.newBuilder()
+ *       .setTotalTimeout(Duration.ofMinutes(15))
+ *       .build());
+ *
+ * BigtableTableAdminSettings tableAdminSettings = tableAdminSettingsBuilder.build();
+ * }
+ */ +public final class BigtableTableAdminSettings { + + private static final Logger LOGGER = Logger.getLogger(BigtableTableAdminSettings.class.getName()); + static final String BIGTABLE_EMULATOR_HOST_ENV_VAR = "BIGTABLE_EMULATOR_HOST"; + + private final String projectId; + private final String instanceId; + private final BigtableTableAdminStubSettings stubSettings; + + private BigtableTableAdminSettings(Builder builder) throws IOException { + this.projectId = Preconditions.checkNotNull(builder.projectId, "Project ID must be set"); + this.instanceId = Preconditions.checkNotNull(builder.instanceId, "Instance ID must be set"); + this.stubSettings = + Verify.verifyNotNull(builder.stubSettings, "stubSettings should never be null").build(); + } + + /** Gets the project ID of instance whose tables the client will manage. */ + public String getProjectId() { + return projectId; + } + + /** Gets the instance ID whose tables the client will manage. */ + public String getInstanceId() { + return instanceId; + } + + /** Gets the credentials provider to use for getting the credentials to make calls with. */ + public CredentialsProvider getCredentialsProvider() { + return stubSettings.getCredentialsProvider(); + } + + /** Gets the underlying RPC settings. */ + public BigtableTableAdminStubSettings getStubSettings() { + return stubSettings; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("projectId", projectId) + .add("instanceId", instanceId) + .add("createTableSettings", stubSettings.createTableSettings()) + .add("createTableFromSnapshotSettings", stubSettings.createTableFromSnapshotSettings()) + .add( + "createTableFromSnapshotOperationSettings", + stubSettings.createTableFromSnapshotOperationSettings()) + .add("listTablesSettings", stubSettings.listTablesSettings()) + .add("getTableSettings", stubSettings.getTableSettings()) + .add("deleteTableSettings", stubSettings.deleteTableSettings()) + .add("modifyColumnFamiliesSettings", stubSettings.modifyColumnFamiliesSettings()) + .add("dropRowRangeSettings", stubSettings.dropRowRangeSettings()) + .add("generateConsistencyTokenSettings", stubSettings.generateConsistencyTokenSettings()) + .add("checkConsistencySettings", stubSettings.checkConsistencySettings()) + .add("getIamPolicySettings", stubSettings.getIamPolicySettings()) + .add("setIamPolicySettings", stubSettings.setIamPolicySettings()) + .add("testIamPermissionsSettings", stubSettings.testIamPermissionsSettings()) + .add("snapshotTableSettings", stubSettings.snapshotTableSettings()) + .add("snapshotTableOperationSettings", stubSettings.snapshotTableOperationSettings()) + .add("getSnapshotSettings", stubSettings.getSnapshotSettings()) + .add("listSnapshotsSettings", stubSettings.listSnapshotsSettings()) + .add("deleteSnapshotSettings", stubSettings.deleteSnapshotSettings()) + .add("copyBackupSettings", stubSettings.copyBackupSettings()) + .add("copyBackupOperationSettings", stubSettings.copyBackupOperationSettings()) + .add("createBackupSettings", stubSettings.createBackupSettings()) + .add("createBackupOperationSettings", stubSettings.createBackupOperationSettings()) + .add("getBackupSettings", stubSettings.getBackupSettings()) + .add("listBackupsSettings", stubSettings.listBackupsSettings()) + .add("updateBackupSettings", stubSettings.updateBackupSettings()) + .add("deleteBackupSettings", stubSettings.deleteBackupSettings()) + .add("restoreTableSettings", stubSettings.restoreTableSettings()) + .add("restoreTableOperationSettings", stubSettings.restoreTableOperationSettings()) + .add("stubSettings", stubSettings) + .add("undeleteTableSettings", stubSettings.undeleteTableSettings()) + .add("undeleteTableOperationSettings", stubSettings.undeleteTableOperationSettings()) + .add("updateTableSettings", stubSettings.updateTableSettings()) + .add("updateTableOperationSettings", stubSettings.updateTableOperationSettings()) + .add("copyBackupSettings", stubSettings.copyBackupSettings()) + .add("copyBackupOperationSettings", stubSettings.copyBackupOperationSettings()) + .add("createAuthorizedViewSettings", stubSettings.createAuthorizedViewSettings()) + .add( + "createAuthorizedViewOperationSettings", + stubSettings.createAuthorizedViewOperationSettings()) + .add("updateAuthorizedViewSettings", stubSettings.updateAuthorizedViewSettings()) + .add( + "updateAuthorizedViewOperationSettings", + stubSettings.updateAuthorizedViewOperationSettings()) + .add("deleteAuthorizedViewSettings", stubSettings.deleteAuthorizedViewSettings()) + .add("listAuthorizedViewsSettings", stubSettings.listAuthorizedViewsSettings()) + .add("getAuthorizedViewSettings", stubSettings.getAuthorizedViewSettings()) + .add("createSchemaBundleSettings", stubSettings.createSchemaBundleSettings()) + .add("createSchemaBundleOperationSettings", stubSettings.createBackupOperationSettings()) + .add("updateSchemaBundleSettings", stubSettings.updateSchemaBundleSettings()) + .add( + "updateSchemaBundleOperationSettings", + stubSettings.updateSchemaBundleOperationSettings()) + .add("getSchemaBundleSettings", stubSettings.getSchemaBundleSettings()) + .add("listSchemaBundlesSettings", stubSettings.listSchemaBundlesSettings()) + .add("deleteSchemaBundleSettings", stubSettings.deleteSchemaBundleSettings()) + .toString(); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Returns a new builder for this class. + * + *

If emulator configuration provided in BIGTABLE_EMULATOR_HOST environment variable then it + * creates a builder preconfigured to connect to Bigtable using emulator hostname and port number. + */ + public static Builder newBuilder() { + String hostAndPort = System.getenv(BIGTABLE_EMULATOR_HOST_ENV_VAR); + if (!Strings.isNullOrEmpty(hostAndPort)) { + int port; + try { + port = Integer.parseInt(hostAndPort.substring(hostAndPort.lastIndexOf(":") + 1)); + return newBuilderForEmulator(hostAndPort.substring(0, hostAndPort.lastIndexOf(":")), port); + } catch (NumberFormatException | IndexOutOfBoundsException ex) { + throw new RuntimeException( + "Invalid host/port in " + + BIGTABLE_EMULATOR_HOST_ENV_VAR + + " environment variable: " + + hostAndPort); + } + } + return new Builder(); + } + + /** Create a new builder preconfigured to connect to the Bigtable emulator with port number. */ + public static Builder newBuilderForEmulator(int port) { + return newBuilderForEmulator("localhost", port); + } + + /** + * Creates a new builder preconfigured to connect to the Bigtable emulator with host name and port + * number. + */ + public static Builder newBuilderForEmulator(String hostname, int port) { + Builder builder = new Builder(); + + builder + .stubSettings() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(hostname + ":" + port) + .setTransportChannelProvider( + InstantiatingGrpcChannelProvider.newBuilder() + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + + LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port); + return builder; + } + + /** Builder for BigtableTableAdminSettings. */ + public static final class Builder { + @Nullable private String projectId; + @Nullable private String instanceId; + private final BigtableTableAdminStubSettings.Builder stubSettings; + + private Builder() { + stubSettings = BigtableTableAdminStubSettings.newBuilder(); + } + + private Builder(BigtableTableAdminSettings settings) { + this.projectId = settings.projectId; + this.instanceId = settings.instanceId; + this.stubSettings = settings.stubSettings.toBuilder(); + } + + /** Sets the project ID of the instance whose tables the client will manage. */ + public Builder setProjectId(@Nullable String projectId) { + Preconditions.checkNotNull(projectId); + this.projectId = projectId; + return this; + } + + /** Gets the project ID of the instance whose tables the client will manage. */ + @Nullable + public String getProjectId() { + return projectId; + } + + /** Sets the instance ID of the instance whose tables the client will manage. */ + public Builder setInstanceId(@Nullable String instanceId) { + Preconditions.checkNotNull(instanceId); + this.instanceId = instanceId; + return this; + } + + /** Gets the instance ID of the instance whose tables the client will manage. */ + @Nullable + public String getInstanceId() { + return instanceId; + } + + /** Sets the credentials provider to use for getting the credentials to make calls with. */ + public Builder setCredentialsProvider(CredentialsProvider credentialsProvider) { + stubSettings.setCredentialsProvider(credentialsProvider); + return this; + } + + /** Gets the credentials provider to use for getting the credentials to make calls with. */ + public CredentialsProvider getCredentialsProvider() { + return stubSettings.getCredentialsProvider(); + } + + /** + * Returns the builder for the settings used for all RPCs. + * + *

This is meant for advanced usage. The default RPC settings are set to their recommended + * values. + */ + public BigtableTableAdminStubSettings.Builder stubSettings() { + return stubSettings; + } + + /** Builds an instance of the settings. */ + public BigtableTableAdminSettings build() throws IOException { + return new BigtableTableAdminSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json new file mode 100644 index 000000000000..8ad0f454cc90 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json @@ -0,0 +1,225 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.bigtable.admin.v2", + "libraryPackage": "com.google.cloud.bigtable.admin.v2", + "services": { + "BigtableInstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableInstanceAdminClient", + "rpcs": { + "CreateAppProfile": { + "methods": ["createAppProfile", "createAppProfile", "createAppProfile", "createAppProfileCallable"] + }, + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "CreateLogicalView": { + "methods": ["createLogicalViewAsync", "createLogicalViewAsync", "createLogicalViewAsync", "createLogicalViewOperationCallable", "createLogicalViewCallable"] + }, + "CreateMaterializedView": { + "methods": ["createMaterializedViewAsync", "createMaterializedViewAsync", "createMaterializedViewAsync", "createMaterializedViewOperationCallable", "createMaterializedViewCallable"] + }, + "DeleteAppProfile": { + "methods": ["deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfileCallable"] + }, + "DeleteCluster": { + "methods": ["deleteCluster", "deleteCluster", "deleteCluster", "deleteClusterCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstance", "deleteInstance", "deleteInstance", "deleteInstanceCallable"] + }, + "DeleteLogicalView": { + "methods": ["deleteLogicalView", "deleteLogicalView", "deleteLogicalView", "deleteLogicalViewCallable"] + }, + "DeleteMaterializedView": { + "methods": ["deleteMaterializedView", "deleteMaterializedView", "deleteMaterializedView", "deleteMaterializedViewCallable"] + }, + "GetAppProfile": { + "methods": ["getAppProfile", "getAppProfile", "getAppProfile", "getAppProfileCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLogicalView": { + "methods": ["getLogicalView", "getLogicalView", "getLogicalView", "getLogicalViewCallable"] + }, + "GetMaterializedView": { + "methods": ["getMaterializedView", "getMaterializedView", "getMaterializedView", "getMaterializedViewCallable"] + }, + "ListAppProfiles": { + "methods": ["listAppProfiles", "listAppProfiles", "listAppProfiles", "listAppProfilesPagedCallable", "listAppProfilesCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersCallable"] + }, + "ListHotTablets": { + "methods": ["listHotTablets", "listHotTablets", "listHotTablets", "listHotTabletsPagedCallable", "listHotTabletsCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesCallable"] + }, + "ListLogicalViews": { + "methods": ["listLogicalViews", "listLogicalViews", "listLogicalViews", "listLogicalViewsPagedCallable", "listLogicalViewsCallable"] + }, + "ListMaterializedViews": { + "methods": ["listMaterializedViews", "listMaterializedViews", "listMaterializedViews", "listMaterializedViewsPagedCallable", "listMaterializedViewsCallable"] + }, + "PartialUpdateCluster": { + "methods": ["partialUpdateClusterAsync", "partialUpdateClusterAsync", "partialUpdateClusterOperationCallable", "partialUpdateClusterCallable"] + }, + "PartialUpdateInstance": { + "methods": ["partialUpdateInstanceAsync", "partialUpdateInstanceAsync", "partialUpdateInstanceOperationCallable", "partialUpdateInstanceCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateAppProfile": { + "methods": ["updateAppProfileAsync", "updateAppProfileAsync", "updateAppProfileOperationCallable", "updateAppProfileCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstance", "updateInstanceCallable"] + }, + "UpdateLogicalView": { + "methods": ["updateLogicalViewAsync", "updateLogicalViewAsync", "updateLogicalViewOperationCallable", "updateLogicalViewCallable"] + }, + "UpdateMaterializedView": { + "methods": ["updateMaterializedViewAsync", "updateMaterializedViewAsync", "updateMaterializedViewOperationCallable", "updateMaterializedViewCallable"] + } + } + } + } + }, + "BigtableTableAdmin": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableTableAdminClient", + "rpcs": { + "CheckConsistency": { + "methods": ["checkConsistency", "checkConsistency", "checkConsistency", "checkConsistencyCallable"] + }, + "CopyBackup": { + "methods": ["copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupOperationCallable", "copyBackupCallable"] + }, + "CreateAuthorizedView": { + "methods": ["createAuthorizedViewAsync", "createAuthorizedViewAsync", "createAuthorizedViewAsync", "createAuthorizedViewOperationCallable", "createAuthorizedViewCallable"] + }, + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateSchemaBundle": { + "methods": ["createSchemaBundleAsync", "createSchemaBundleAsync", "createSchemaBundleAsync", "createSchemaBundleOperationCallable", "createSchemaBundleCallable"] + }, + "CreateTable": { + "methods": ["createTable", "createTable", "createTable", "createTableCallable"] + }, + "CreateTableFromSnapshot": { + "methods": ["createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotOperationCallable", "createTableFromSnapshotCallable"] + }, + "DeleteAuthorizedView": { + "methods": ["deleteAuthorizedView", "deleteAuthorizedView", "deleteAuthorizedView", "deleteAuthorizedViewCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] + }, + "DeleteSchemaBundle": { + "methods": ["deleteSchemaBundle", "deleteSchemaBundle", "deleteSchemaBundle", "deleteSchemaBundleCallable"] + }, + "DeleteSnapshot": { + "methods": ["deleteSnapshot", "deleteSnapshot", "deleteSnapshot", "deleteSnapshotCallable"] + }, + "DeleteTable": { + "methods": ["deleteTable", "deleteTable", "deleteTable", "deleteTableCallable"] + }, + "DropRowRange": { + "methods": ["dropRowRange", "dropRowRangeCallable"] + }, + "GenerateConsistencyToken": { + "methods": ["generateConsistencyToken", "generateConsistencyToken", "generateConsistencyToken", "generateConsistencyTokenCallable"] + }, + "GetAuthorizedView": { + "methods": ["getAuthorizedView", "getAuthorizedView", "getAuthorizedView", "getAuthorizedViewCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetSchemaBundle": { + "methods": ["getSchemaBundle", "getSchemaBundle", "getSchemaBundle", "getSchemaBundleCallable"] + }, + "GetSnapshot": { + "methods": ["getSnapshot", "getSnapshot", "getSnapshot", "getSnapshotCallable"] + }, + "GetTable": { + "methods": ["getTable", "getTable", "getTable", "getTableCallable"] + }, + "ListAuthorizedViews": { + "methods": ["listAuthorizedViews", "listAuthorizedViews", "listAuthorizedViews", "listAuthorizedViewsPagedCallable", "listAuthorizedViewsCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListSchemaBundles": { + "methods": ["listSchemaBundles", "listSchemaBundles", "listSchemaBundles", "listSchemaBundlesPagedCallable", "listSchemaBundlesCallable"] + }, + "ListSnapshots": { + "methods": ["listSnapshots", "listSnapshots", "listSnapshots", "listSnapshotsPagedCallable", "listSnapshotsCallable"] + }, + "ListTables": { + "methods": ["listTables", "listTables", "listTables", "listTablesPagedCallable", "listTablesCallable"] + }, + "ModifyColumnFamilies": { + "methods": ["modifyColumnFamilies", "modifyColumnFamilies", "modifyColumnFamilies", "modifyColumnFamiliesCallable"] + }, + "RestoreTable": { + "methods": ["restoreTableAsync", "restoreTableOperationCallable", "restoreTableCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "SnapshotTable": { + "methods": ["snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableOperationCallable", "snapshotTableCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UndeleteTable": { + "methods": ["undeleteTableAsync", "undeleteTableAsync", "undeleteTableAsync", "undeleteTableOperationCallable", "undeleteTableCallable"] + }, + "UpdateAuthorizedView": { + "methods": ["updateAuthorizedViewAsync", "updateAuthorizedViewAsync", "updateAuthorizedViewOperationCallable", "updateAuthorizedViewCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] + }, + "UpdateSchemaBundle": { + "methods": ["updateSchemaBundleAsync", "updateSchemaBundleAsync", "updateSchemaBundleOperationCallable", "updateSchemaBundleCallable"] + }, + "UpdateTable": { + "methods": ["updateTableAsync", "updateTableAsync", "updateTableOperationCallable", "updateTableCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java new file mode 100644 index 000000000000..a0fef3c0fcb1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java @@ -0,0 +1,139 @@ +/* + * Copyright 2019 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.cloud.bigtable.admin.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.annotation.Nonnull; + +/** + * Internal helper to compose full resource names. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class NameUtil { + private static final Pattern TABLE_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)"); + private static final Pattern LOCATION_PATTERN = + Pattern.compile("projects/([^/]+)/locations/([^/]+)"); + private static final Pattern BACKUP_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/clusters/([^/]+)/backups/([^/]+)"); + + private static final Pattern AUTHORIZED_VIEW_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)/authorizedViews/([^/]+)"); + + private static final Pattern SCHEMA_BUNDLE_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)/schemaBundles/([^/]+)"); + + public static String formatProjectName(String projectId) { + return "projects/" + projectId; + } + + public static String formatInstanceName(String projectId, String instanceId) { + return formatProjectName(projectId) + "/instances/" + instanceId; + } + + public static String formatTableName(String projectId, String instanceId, String tableId) { + return formatInstanceName(projectId, instanceId) + "/tables/" + tableId; + } + + public static String formatTableName(String projectId, String instanceId, TableId tableId) { + return formatInstanceName(projectId, instanceId) + "/tables/" + tableId.getTableId(); + } + + public static String formatMaterializedViewName( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) { + return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId; + } + + public static String formatLogicalViewName( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String logicalViewId) { + return formatInstanceName(projectId, instanceId) + "/logicalViews/" + logicalViewId; + } + + public static String formatLocationName(String projectId, String zone) { + return formatProjectName(projectId) + "/locations/" + zone; + } + + public static String formatBackupName( + String projectId, String instanceId, String clusterId, String backupId) { + return formatClusterName(projectId, instanceId, clusterId) + "/backups/" + backupId; + } + + public static String formatAuthorizedViewName( + String projectId, String instanceId, String tableId, String viewId) { + return formatTableName(projectId, instanceId, tableId) + "/authorizedViews/" + viewId; + } + + public static String formatSchemaBundleName( + String projectId, String instanceId, String tableId, String bundleId) { + return formatTableName(projectId, instanceId, tableId) + "/schemaBundles/" + bundleId; + } + + public static String extractTableIdFromTableName(String fullTableName) { + Matcher matcher = TABLE_PATTERN.matcher(fullTableName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid table name: " + fullTableName); + } + return matcher.group(3); + } + + public static String extractBackupIdFromBackupName(String fullBackupName) { + Matcher matcher = BACKUP_PATTERN.matcher(fullBackupName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid backup name: " + fullBackupName); + } + return matcher.group(4); + } + + public static String extractAuthorizedViewIdFromAuthorizedViewName( + String fullAuthorizedViewName) { + Matcher matcher = AUTHORIZED_VIEW_PATTERN.matcher(fullAuthorizedViewName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid authorized view name: " + fullAuthorizedViewName); + } + return matcher.group(4); + } + + public static String extractSchemaBundleIdFromSchemaBundleName(String fullSchemaBundleName) { + Matcher matcher = SCHEMA_BUNDLE_PATTERN.matcher(fullSchemaBundleName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid schema bundle name: " + fullSchemaBundleName); + } + return matcher.group(4); + } + + public static String extractZoneIdFromLocationName(String fullLocationName) { + Matcher matcher = LOCATION_PATTERN.matcher(fullLocationName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid location name: " + fullLocationName); + } + return matcher.group(2); + } + + public static String formatClusterName(String projectId, String instanceId, String clusterId) { + return formatInstanceName(projectId, instanceId) + "/clusters/" + clusterId; + } + + public static String formatAppProfileName( + String projectId, String instanceId, String appProfileId) { + return formatInstanceName(projectId, instanceId) + "/appProfiles/" + appProfileId; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java new file mode 100644 index 000000000000..247d2fc2b8e8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java @@ -0,0 +1,551 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; +import com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; +import com.google.bigtable.admin.v2.AppProfile.StandardIsolation; +import com.google.bigtable.admin.v2.AppProfileName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import com.google.common.base.VerifyException; +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import javax.annotation.Nonnull; + +/** + * An application profile, or app profile, stores settings that tell your Cloud Bigtable instance + * how to handle incoming requests from an application. When one of your applications connects to a + * Cloud Bigtable instance, it can specify an app profile, and Cloud Bigtable uses that app profile + * for any requests that the application sends over that connection. + * + *

App profiles affect how your applications communicate with an instance that uses replication. + * As a result, app profiles are especially useful for instances that have 2 clusters. Even if your + * instance has only 1 cluster, you can use a unique app profile for each application that you run, + * or for different components within a single application. + * + * @see For more details. + */ +public final class AppProfile { + private final com.google.bigtable.admin.v2.AppProfile proto; + + /** + * Wraps a protobuf response. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public static AppProfile fromProto(@Nonnull com.google.bigtable.admin.v2.AppProfile proto) { + return new AppProfile(proto); + } + + private AppProfile(@Nonnull com.google.bigtable.admin.v2.AppProfile proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument( + proto.hasSingleClusterRouting() || proto.hasMultiClusterRoutingUseAny(), + "AppProfile must have a routing policy"); + Preconditions.checkArgument(!proto.getName().isEmpty(), "AppProfile must have a name"); + this.proto = proto; + } + + /** Gets the routing policy for all read/write requests which use this app profile. */ + @SuppressWarnings("WeakerAccess") + public RoutingPolicy getPolicy() { + if (proto.hasMultiClusterRoutingUseAny()) { + if (proto.getMultiClusterRoutingUseAny().hasRowAffinity()) { + return MultiClusterRoutingPolicy.withRowAffinity( + ImmutableSet.copyOf(proto.getMultiClusterRoutingUseAny().getClusterIdsList())); + } + return MultiClusterRoutingPolicy.of( + ImmutableSet.copyOf(proto.getMultiClusterRoutingUseAny().getClusterIdsList())); + } else if (proto.hasSingleClusterRouting()) { + return new SingleClusterRoutingPolicy(proto.getSingleClusterRouting()); + } else { + // Should never happen because the constructor verifies that one must exist. + throw new VerifyException(); + } + } + + public IsolationPolicy getIsolationPolicy() { + if (proto.hasStandardIsolation()) { + return new StandardIsolationPolicy(proto.getStandardIsolation()); + } else if (proto.hasDataBoostIsolationReadOnly()) { + return new DataBoostIsolationReadOnlyPolicy(proto.getDataBoostIsolationReadOnly()); + } else { + // Should never happen because the constructor verifies that one must exist. + throw new IllegalStateException(); + } + } + + /** Gets the id of this AppProfile. */ + @SuppressWarnings("WeakerAccess") + public String getId() { + AppProfileName fullName = + Verify.verifyNotNull(AppProfileName.parse(proto.getName()), "Name can never be null"); + + //noinspection ConstantConditions + return fullName.getAppProfile(); + } + + /** Gets the id of the instance that owns this AppProfile. */ + @SuppressWarnings("WeakerAccess") + public String getInstanceId() { + AppProfileName fullName = + Verify.verifyNotNull(AppProfileName.parse(proto.getName()), "Name can never be null"); + + //noinspection ConstantConditions + return fullName.getInstance(); + } + + /** Gets long form description of the use case for this AppProfile. */ + @SuppressWarnings("WeakerAccess") + public String getDescription() { + return proto.getDescription(); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + com.google.bigtable.admin.v2.AppProfile toProto() { + return proto; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppProfile that = (AppProfile) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + + /** + * Represents the routing for read/write requests. Please check the implementations of this + * interface for more details. + */ + @SuppressWarnings("WeakerAccess") + public interface RoutingPolicy {} + + /** A {@link RoutingPolicy} that routes all requests to a specific cluster. */ + @SuppressWarnings("WeakerAccess") + public static class SingleClusterRoutingPolicy implements RoutingPolicy { + private final com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting proto; + + /** + * Wraps a protobuf response. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public static SingleClusterRoutingPolicy fromProto( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting proto) { + return new SingleClusterRoutingPolicy(proto); + } + + /** + * Builds a new instance of the routing policy that will send all requests to the specified + * cluster. + * + *

Please note that atomic row transactions will be disabled. + */ + public static SingleClusterRoutingPolicy of(String clusterId) { + return of(clusterId, false); + } + + /** + * Builds a new instance of the routing policy that will send all requests to the specified + * cluster. This variant enables the ability to re-enable single row transactions at the cost of + * consistency. + * + *

Please see the online + * documentation for more details. + */ + public static SingleClusterRoutingPolicy of(String clusterId, boolean allowTransactionWrites) { + return fromProto( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.newBuilder() + .setClusterId(clusterId) + .setAllowTransactionalWrites(allowTransactionWrites) + .build()); + } + + private SingleClusterRoutingPolicy( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting proto) { + this.proto = proto; + } + + /** Gets the target cluster of this policy. */ + @SuppressWarnings("WeakerAccess") + public String getClusterId() { + return proto.getClusterId(); + } + + /** Checks if transactional writes are enabled. */ + @SuppressWarnings("WeakerAccess") + public boolean getAllowTransactionalWrites() { + return proto.getAllowTransactionalWrites(); + } + + /** + * Wraps a protobuf response. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting toProto() { + return proto; + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SingleClusterRoutingPolicy that = (SingleClusterRoutingPolicy) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + } + + /** + * A {@link RoutingPolicy} that tells Cloud Bigtable that it can route each request to any + * available cluster. + */ + public static class MultiClusterRoutingPolicy implements RoutingPolicy { + private final MultiClusterRoutingUseAny proto; + + /** Creates a new instance of {@link MultiClusterRoutingPolicy}. */ + public static MultiClusterRoutingPolicy of() { + return new MultiClusterRoutingPolicy(MultiClusterRoutingUseAny.getDefaultInstance()); + } + + /** + * Creates a new instance of {@link MultiClusterRoutingPolicy} with specified cluster ids to + * route to. + */ + public static MultiClusterRoutingPolicy of(String... clusterIds) { + return of(ImmutableSet.copyOf(clusterIds)); + } + + /** + * Creates a new instance of {@link MultiClusterRoutingPolicy} with specified cluster ids to + * route to. + */ + public static MultiClusterRoutingPolicy of(Set clusterIds) { + return new MultiClusterRoutingPolicy( + MultiClusterRoutingUseAny.newBuilder().addAllClusterIds(clusterIds).build()); + } + + /** Creates a new instance of {@link MultiClusterRoutingPolicy}. */ + public static MultiClusterRoutingPolicy withRowAffinity() { + return new MultiClusterRoutingPolicy( + MultiClusterRoutingUseAny.newBuilder() + .setRowAffinity(MultiClusterRoutingUseAny.RowAffinity.newBuilder().build()) + .build()); + } + + /** + * Creates a new instance of {@link MultiClusterRoutingPolicy} with row affinity enabled and + * specified cluster ids to route to. + */ + public static MultiClusterRoutingPolicy withRowAffinity(String... clusterIds) { + return withRowAffinity(ImmutableSet.copyOf(clusterIds)); + } + + /** + * Creates a new instance of {@link MultiClusterRoutingPolicy} with specified cluster ids to + * route to. + */ + public static MultiClusterRoutingPolicy withRowAffinity(Set clusterIds) { + return new MultiClusterRoutingPolicy( + MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(clusterIds) + .setRowAffinity(MultiClusterRoutingUseAny.RowAffinity.newBuilder().build()) + .build()); + } + + /* + * Returns the set of clusters to route to. The order is ignored; clusters will be + * tried in order of distance. If empty, all clusters are eligible. + */ + public Set getClusterIds() { + return ImmutableSet.copyOf(proto.getClusterIdsList()); + } + + private MultiClusterRoutingPolicy( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + MultiClusterRoutingUseAny toProto() { + return proto; + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MultiClusterRoutingPolicy that = (MultiClusterRoutingPolicy) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + } + + /** Represents the options for isolating this app profile's traffic from other use cases. */ + @SuppressWarnings("WeakerAccess") + public interface IsolationPolicy {} + + /** + * The possible priorities for an app profile. Note that higher priority writes can sometimes + * queue behind lower priority writes to the same tablet, as writes must be strictly sequenced in + * the durability log. + */ + public static enum Priority { + LOW(com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_LOW), + MEDIUM(com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM), + HIGH(com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_HIGH); + + private final com.google.bigtable.admin.v2.AppProfile.Priority proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static Priority fromProto(com.google.bigtable.admin.v2.AppProfile.Priority proto) { + Preconditions.checkNotNull(proto); + + for (Priority priority : values()) { + if (priority.proto.equals(proto)) { + return priority; + } + } + + throw new IllegalArgumentException("Unknown priority: " + proto); + } + + Priority(com.google.bigtable.admin.v2.AppProfile.Priority proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.AppProfile.Priority toProto() { + return proto; + } + } + + /** + * A standard {@link IsolationPolicy} for isolating this app profile's traffic from other use + * cases. This accomplished by assigning different priorities to app profiles. A request that uses + * an app profile with a StandardIsolationPolicy with a HIGH priority will likely run before a + * request with a LOW priority. + */ + public static class StandardIsolationPolicy implements IsolationPolicy { + private final StandardIsolation proto; + + /** Creates a new instance of {@link StandardIsolationPolicy}. */ + public static StandardIsolationPolicy of() { + return new StandardIsolationPolicy(StandardIsolation.getDefaultInstance()); + } + + /** Creates a new instance of {@link StandardIsolationPolicy} with the specified priority. */ + public static StandardIsolationPolicy of(Priority priority) { + return new StandardIsolationPolicy( + StandardIsolation.newBuilder().setPriority(priority.toProto()).build()); + } + + /* + * Returns the priority for this app profile. + */ + public Priority getPriority() { + return Priority.fromProto(proto.getPriority()); + } + + private StandardIsolationPolicy( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + com.google.bigtable.admin.v2.AppProfile.StandardIsolation toProto() { + return proto; + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StandardIsolationPolicy that = (StandardIsolationPolicy) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + } + + /** Compute Billing Owner specifies how usage should be accounted when using Data Boost. */ + public static enum ComputeBillingOwner { + UNSPECIFIED(DataBoostIsolationReadOnly.ComputeBillingOwner.COMPUTE_BILLING_OWNER_UNSPECIFIED), + HOST_PAYS(DataBoostIsolationReadOnly.ComputeBillingOwner.HOST_PAYS), + UNRECOGNIZED(DataBoostIsolationReadOnly.ComputeBillingOwner.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .ComputeBillingOwner + proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static ComputeBillingOwner fromProto( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + proto) { + Preconditions.checkNotNull(proto); + + for (ComputeBillingOwner owner : values()) { + if (owner.proto.equals(proto)) { + return owner; + } + } + + return UNRECOGNIZED; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public DataBoostIsolationReadOnly.ComputeBillingOwner toProto() { + return proto; + } + + ComputeBillingOwner(DataBoostIsolationReadOnly.ComputeBillingOwner proto) { + this.proto = proto; + } + } + + /** + * A Data Boost Read Only {@link IsolationPolicy} for running high-throughput read traffic on your + * Bigtable data without affecting application traffic. Data Boost App Profile needs to be created + * with a ComputeBillingOwner which specifies how usage should be accounted when using Data Boost. + */ + public static class DataBoostIsolationReadOnlyPolicy implements IsolationPolicy { + private final DataBoostIsolationReadOnly proto; + + DataBoostIsolationReadOnlyPolicy(DataBoostIsolationReadOnly proto) { + this.proto = proto; + } + + /** + * Creates a new instance of {@link DataBoostIsolationReadOnlyPolicy} with specified {@link + * ComputeBillingOwner}. + */ + public static DataBoostIsolationReadOnlyPolicy of(ComputeBillingOwner billingOwner) { + return new DataBoostIsolationReadOnlyPolicy( + DataBoostIsolationReadOnly.newBuilder() + .setComputeBillingOwner(billingOwner.toProto()) + .build()); + } + + /** + * Gets the {@link ComputeBillingOwner} on the current {@link DataBoostIsolationReadOnlyPolicy} + * instance. + */ + public ComputeBillingOwner getComputeBillingOwner() { + return ComputeBillingOwner.fromProto(proto.getComputeBillingOwner()); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public DataBoostIsolationReadOnly toProto() { + return proto; + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataBoostIsolationReadOnlyPolicy that = (DataBoostIsolationReadOnlyPolicy) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java new file mode 100644 index 000000000000..33e40f64582d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java @@ -0,0 +1,124 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.bigtable.admin.v2.AuthorizedViewName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * A class that wraps the {@link com.google.bigtable.admin.v2.AuthorizedView} protocol buffer + * object. + * + *

An AuthorizedView represents subsets of a particular table based on rules. The access to each + * AuthorizedView can be configured separately from the Table. + * + *

Users can perform read/write operation on an AuthorizedView by providing an authorizedView id + * besides a table id, in which case the semantics remain identical as reading/writing on a Table + * except that visibility is restricted to the subset of the Table that the AuthorizedView + * represents. + */ +public final class AuthorizedView { + private final com.google.bigtable.admin.v2.AuthorizedView proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static AuthorizedView fromProto( + @Nonnull com.google.bigtable.admin.v2.AuthorizedView proto) { + return new AuthorizedView(proto); + } + + private AuthorizedView(@Nonnull com.google.bigtable.admin.v2.AuthorizedView proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "AuthorizedView must have a name"); + Preconditions.checkArgument( + proto.hasSubsetView(), "AuthorizedView must have a subset_view field"); + this.proto = proto; + } + + /** Gets the authorized view's id. */ + public String getId() { + // Constructor ensures that name is not null. + AuthorizedViewName fullName = AuthorizedViewName.parse(proto.getName()); + + //noinspection ConstantConditions + return fullName.getAuthorizedView(); + } + + /** Gets the id of the table that owns this authorized view. */ + public String getTableId() { + // Constructor ensures that name is not null. + AuthorizedViewName fullName = AuthorizedViewName.parse(proto.getName()); + + //noinspection ConstantConditions + return fullName.getTable(); + } + + /** Returns whether this authorized view is deletion protected. */ + public boolean isDeletionProtected() { + return proto.getDeletionProtection(); + } + + /** Gets the type of this authorized view, which currently can only be a subset view. */ + public AuthorizedViewType getAuthorizedViewType() { + if (proto.hasSubsetView()) { + return SubsetView.fromProto(proto.getSubsetView()); + } else { + // Should never happen because the constructor verifies that one must exist. + throw new IllegalStateException("This AuthorizedView doesn't have a valid type specified"); + } + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.AuthorizedView toProto() { + return proto; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizedView that = (AuthorizedView) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + + /** + * Represents a subset of a Table. Please check the implementations of this interface for more + * details. + */ + @InternalExtensionOnly + public interface AuthorizedViewType {} +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java new file mode 100644 index 000000000000..f57d6fded043 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java @@ -0,0 +1,243 @@ +/* + * 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. + */ + +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.BackupName; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.util.Timestamps; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.threeten.bp.Instant; + +/** + * A backup lets you save a copy of a table's schema and data and restore the backup to a new table + * at a later time. + */ +public class Backup { + public enum State { + /** Not specified. */ + STATE_UNSPECIFIED(com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED), + + /** + * The pending backup is still being created. Operations on the backup may fail with + * `FAILED_PRECONDITION` in this state. + */ + CREATING(com.google.bigtable.admin.v2.Backup.State.CREATING), + /** The backup is complete and ready for use. */ + READY(com.google.bigtable.admin.v2.Backup.State.READY), + + /** The state of the backup is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Backup.State.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Backup.State proto; + + State(com.google.bigtable.admin.v2.Backup.State proto) { + this.proto = proto; + } + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static Backup.State fromProto(com.google.bigtable.admin.v2.Backup.State proto) { + for (Backup.State state : values()) { + if (state.proto.equals(proto)) { + return state; + } + } + return STATE_UNSPECIFIED; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Backup.State toProto() { + return proto; + } + } + + public enum BackupType { + /** Not specified. */ + BACKUP_TYPE_UNSPECIFIED(com.google.bigtable.admin.v2.Backup.BackupType.BACKUP_TYPE_UNSPECIFIED), + + /** + * The default type for Cloud Bigtable managed backups. Supported for backups created in both + * HDD and SSD instances. Requires optimization when restored to a table in an SSD instance. + */ + STANDARD(com.google.bigtable.admin.v2.Backup.BackupType.STANDARD), + /** + * A backup type with faster restore to SSD performance. Only supported for backups created in + * SSD instances. A new SSD table restored from a hot backup reaches production performance more + * quickly than a standard backup. + */ + HOT(com.google.bigtable.admin.v2.Backup.BackupType.HOT), + + /** The backup type of the backup is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Backup.BackupType.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Backup.BackupType proto; + + BackupType(com.google.bigtable.admin.v2.Backup.BackupType proto) { + this.proto = proto; + } + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static Backup.BackupType fromProto( + com.google.bigtable.admin.v2.Backup.BackupType proto) { + for (Backup.BackupType backupType : values()) { + if (backupType.proto.equals(proto)) { + return backupType; + } + } + return BACKUP_TYPE_UNSPECIFIED; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Backup.BackupType toProto() { + return proto; + } + } + + @Nonnull private final com.google.bigtable.admin.v2.Backup proto; + @Nonnull private final String id; + @Nonnull private final String instanceId; + + @InternalApi + public static Backup fromProto(@Nonnull com.google.bigtable.admin.v2.Backup proto) { + return new Backup(proto); + } + + private Backup(@Nonnull com.google.bigtable.admin.v2.Backup proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "Name must be set"); + Preconditions.checkArgument(!proto.getSourceTable().isEmpty(), "Source table must be set"); + + BackupName name = BackupName.parse(proto.getName()); + this.id = name.getBackup(); + this.instanceId = name.getInstance(); + this.proto = proto; + } + + /** Get the ID of this backup. */ + public String getId() { + return id; + } + + /** Get the source table ID from which the backup is created. */ + public String getSourceTableId() { + return NameUtil.extractTableIdFromTableName(proto.getSourceTable()); + } + + /** Get the source backup ID from which the backup is copied. */ + public String getSourceBackupId() { + return NameUtil.extractBackupIdFromBackupName(proto.getSourceBackup()); + } + + /** Get the instance ID where this backup is located. */ + public String getInstanceId() { + return instanceId; + } + + /** Get the expire time of this backup. */ + public Instant getExpireTime() { + return Instant.ofEpochMilli(Timestamps.toMillis(proto.getExpireTime())); + } + + /** Get the start time when this backup is taken. */ + public @Nullable Instant getStartTime() { + if (proto.hasStartTime()) { + return Instant.ofEpochMilli(Timestamps.toMillis(proto.getStartTime())); + } + return null; + } + + /** Get the end time when the creation of this backup has completed. */ + public @Nullable Instant getEndTime() { + if (proto.hasEndTime()) { + return Instant.ofEpochMilli(Timestamps.toMillis(proto.getEndTime())); + } + return null; + } + + /** Get the size of this backup. */ + public long getSizeBytes() { + return proto.getSizeBytes(); + } + + /** Get the state of this backup. */ + public State getState() { + return State.fromProto(proto.getState()); + } + + /** Get the backup type of this backup. */ + public BackupType getBackupType() { + return BackupType.fromProto(proto.getBackupType()); + } + + /** Get the time at which this backup will be converted from a hot backup to a standard backup. */ + @Nullable + public Instant getHotToStandardTime() { + if (proto.hasHotToStandardTime()) { + return Instant.ofEpochMilli(Timestamps.toMillis(proto.getHotToStandardTime())); + } + return null; + } + + /** + * Get the encryption information for the backup. + * + *

If encryption_type is CUSTOMER_MANAGED_ENCRYPTION, kms_key_version will be filled in with + * status UNKNOWN. + * + *

If encryption_type is GOOGLE_DEFAULT_ENCRYPTION, all other fields will have default value. + */ + public EncryptionInfo getEncryptionInfo() { + return EncryptionInfo.fromProto(proto.getEncryptionInfo()); + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Backup backup = (Backup) o; + return Objects.equal(proto, backup.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java new file mode 100644 index 000000000000..fb6af29f55ad --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java @@ -0,0 +1,234 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ClusterName; +import com.google.bigtable.admin.v2.LocationName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import javax.annotation.Nonnull; + +/** + * A cluster represents the actual Cloud Bigtable service. Each cluster belongs to a single Cloud + * Bigtable instance, and an instance can have up to 2 clusters. When your application sends + * requests to a Cloud Bigtable instance, those requests are actually handled by one of the clusters + * in the instance. + */ +public class Cluster { + + public enum State { + /** The state of the cluster could not be determined. */ + NOT_KNOWN(com.google.bigtable.admin.v2.Cluster.State.STATE_NOT_KNOWN), + /** The cluster has been successfully created and is ready to serve requests. */ + READY(com.google.bigtable.admin.v2.Cluster.State.READY), + /** + * The cluster is currently being created, and may be destroyed if the creation process + * encounters an error. A cluster may not be able to serve requests while being created. + */ + CREATING(com.google.bigtable.admin.v2.Cluster.State.CREATING), + /** + * The cluster is currently being resized, and may revert to its previous node count if the + * process encounters an error. A cluster is still capable of serving requests while being + * resized, but may exhibit performance as if its number of allocated nodes is between the + * starting and requested states. + */ + RESIZING(com.google.bigtable.admin.v2.Cluster.State.RESIZING), + /** + * The cluster has no backing nodes. The data (tables) still exist, but no operations can be + * performed on the cluster. + */ + DISABLED(com.google.bigtable.admin.v2.Cluster.State.DISABLED), + /** The state of the cluster is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Cluster.State.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Cluster.State proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static State fromProto(com.google.bigtable.admin.v2.Cluster.State proto) { + for (State state : values()) { + if (state.proto.equals(proto)) { + return state; + } + } + return UNRECOGNIZED; + } + + State(com.google.bigtable.admin.v2.Cluster.State proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Cluster.State toProto() { + return proto; + } + } + + @Nonnull private final com.google.bigtable.admin.v2.Cluster stateProto; + + /** + * Wraps a protobuf response. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public static Cluster fromProto(com.google.bigtable.admin.v2.Cluster proto) { + return new Cluster(proto); + } + + private Cluster(@Nonnull com.google.bigtable.admin.v2.Cluster proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "Name must be set"); + this.stateProto = proto; + } + + /** Gets the cluster's id. */ + @SuppressWarnings("WeakerAccess") + public String getId() { + // Constructor ensures that name is not null + ClusterName fullName = + Verify.verifyNotNull(ClusterName.parse(stateProto.getName()), "Name can never be null"); + //noinspection ConstantConditions + return fullName.getCluster(); + } + + /** Gets the instance id. */ + @SuppressWarnings("WeakerAccess") + public String getInstanceId() { + // Constructor ensures that name is not null + ClusterName fullName = + Verify.verifyNotNull(ClusterName.parse(stateProto.getName()), "Name can never be null"); + //noinspection ConstantConditions + return fullName.getInstance(); + } + + /** Get the zone where this cluster is located. */ + @SuppressWarnings("WeakerAccess") + public String getZone() { + LocationName location = Verify.verifyNotNull(LocationName.parse(stateProto.getLocation())); + //noinspection ConstantConditions + return location.getLocation(); + } + + /** Gets the current state of the cluster */ + @SuppressWarnings("WeakerAccess") + public State getState() { + return State.fromProto(stateProto.getState()); + } + + /** + * Get the number of nodes allocated to this cluster. More nodes enable higher throughput and more + * consistent performance. + */ + @SuppressWarnings("WeakerAccess") + public int getServeNodes() { + return stateProto.getServeNodes(); + } + + /** Get the minimum number of nodes to scale down to. */ + public int getAutoscalingMinServeNodes() { + return stateProto + .getClusterConfig() + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMinServeNodes(); + } + + /** Get the maximum number of nodes to scale up to. */ + public int getAutoscalingMaxServeNodes() { + return stateProto + .getClusterConfig() + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMaxServeNodes(); + } + + /** + * Get the cpu utilization that the Autoscaler should be trying to achieve. This number is on a + * scale from 0 (no utilization) to 100 (total utilization). + */ + public int getAutoscalingCpuPercentageTarget() { + return stateProto + .getClusterConfig() + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getCpuUtilizationPercent(); + } + + /** + * Get the storage utilization that the Autoscaler should be trying to achieve. This number is + * limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD cluster and between 8192 (8TiB) and + * 16384 (16TiB) for an HDD cluster; otherwise it will return INVALID_ARGUMENT error. If this + * value is set to 0, it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + */ + public int getStorageUtilizationGibPerNode() { + return stateProto + .getClusterConfig() + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode(); + } + + /** + * The type of storage used by this cluster to serve its parent instance's tables, unless + * explicitly overridden. + */ + @SuppressWarnings("WeakerAccess") + public StorageType getStorageType() { + return StorageType.fromProto(stateProto.getDefaultStorageType()); + } + + /** + * Google Cloud Key Management Service (KMS) settings for a CMEK-protected Bigtable cluster. This + * returns the full resource name of the Cloud KMS key in the format + * `projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}` + */ + public String getKmsKeyName() { + if (stateProto.hasEncryptionConfig()) { + return stateProto.getEncryptionConfig().getKmsKeyName(); + } + return null; + } + + @SuppressWarnings("EqualsGetClass") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cluster cluster = (Cluster) o; + return Objects.equal(stateProto, cluster.stateProto); + } + + @Override + public int hashCode() { + return Objects.hashCode(stateProto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java new file mode 100644 index 000000000000..fe83273cf874 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java @@ -0,0 +1,252 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.Cluster; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.util.FieldMaskUtil; +import javax.annotation.Nonnull; + +/** + * Model class to create an autoscaling config for creating or updating a cluster. When creating + * this config, min nodes, max nodes, and CPU utilization must all be set. + */ +public class ClusterAutoscalingConfig { + private final String clusterId; + private final String instanceId; + private final com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder builder = + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.newBuilder(); + private final com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder clusterConfigBuilder = + com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder(); + + public static ClusterAutoscalingConfig of(@Nonnull String instanceId, @Nonnull String clusterId) { + return new ClusterAutoscalingConfig(instanceId, clusterId); + } + + private ClusterAutoscalingConfig(@Nonnull String instanceId, @Nonnull String clusterId) { + Preconditions.checkNotNull(instanceId, "instanceId can't be null"); + Preconditions.checkNotNull(clusterId, "clusterId can't be null"); + this.instanceId = instanceId; + this.clusterId = clusterId; + } + + /** The cluster id to set autoscaling on */ + public String getClusterId() { + return clusterId; + } + + /** The instance id of the cluster to set autoscaling on */ + public String getInstanceId() { + return instanceId; + } + + /** Set the minimum number of nodes to scale down to. */ + public ClusterAutoscalingConfig setMinNodes(int minNodes) { + builder.setUpdateMask( + FieldMaskUtil.union( + builder.getUpdateMask(), + FieldMaskUtil.fromString( + Cluster.class, + "cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes"))); + clusterConfigBuilder + .getClusterAutoscalingConfigBuilder() + .getAutoscalingLimitsBuilder() + .setMinServeNodes(minNodes); + return this; + } + + /** Set the maximum number of nodes to scale up to. */ + public ClusterAutoscalingConfig setMaxNodes(int maxNodes) { + builder.setUpdateMask( + FieldMaskUtil.union( + builder.getUpdateMask(), + FieldMaskUtil.fromString( + Cluster.class, + "cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes"))); + clusterConfigBuilder + .getClusterAutoscalingConfigBuilder() + .getAutoscalingLimitsBuilder() + .setMaxServeNodes(maxNodes); + return this; + } + + /** + * Set the CPU utilization that the Autoscaler should be trying to achieve. This number is on a + * scale from 0 (no utilization) to 100 (total utilization). + */ + public ClusterAutoscalingConfig setCpuUtilizationTargetPercent(int cpuUtilizationTargetPercent) { + builder.setUpdateMask( + FieldMaskUtil.union( + builder.getUpdateMask(), + FieldMaskUtil.fromString( + Cluster.class, + "cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent"))); + clusterConfigBuilder + .getClusterAutoscalingConfigBuilder() + .getAutoscalingTargetsBuilder() + .setCpuUtilizationPercent(cpuUtilizationTargetPercent); + return this; + } + + public ClusterAutoscalingConfig setStorageUtilizationGibPerNode( + int storageUtilizationGibPerNode) { + builder.setUpdateMask( + FieldMaskUtil.union( + builder.getUpdateMask(), + FieldMaskUtil.fromString( + Cluster.class, + "cluster_config.cluster_autoscaling_config.autoscaling_targets.storage_utilization_gib_per_node"))); + clusterConfigBuilder + .getClusterAutoscalingConfigBuilder() + .getAutoscalingTargetsBuilder() + .setStorageUtilizationGibPerNode(storageUtilizationGibPerNode); + return this; + } + + /** Get the minimum number of nodes to scale down to. */ + public int getMinNodes() { + return clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMinServeNodes(); + } + + /** Get the maximum number of nodes to scale up to. */ + public int getMaxNodes() { + return clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMaxServeNodes(); + } + + /** + * Get the CPU utilization that the Autoscaler should be trying to achieve. This number is on a + * scale from 0 (no utilization) to 100 (total utilization). + */ + public int getCpuUtilizationTargetPercent() { + return clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getCpuUtilizationPercent(); + } + + /** + * Get the storage utilization that the Autoscaler should be trying to achieve. This number is + * limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD cluster and between 8192 (8TiB) and + * 16384 (16TiB) for an HDD cluster; otherwise it will return INVALID_ARGUMENT error. If this + * value is set to 0, it will be treated as if it were set to the default value: 2560 for SSD, + * 8192 for HDD. + */ + public int getStorageUtilizationGibPerNode() { + return clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode(); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest toProto(String projectId) { + // Empty field mask implies full resource replacement, which would clear all fields in an empty + // update request. + + this.builder + .getClusterBuilder() + .setName(NameUtil.formatClusterName(projectId, instanceId, clusterId)) + .setClusterConfig(clusterConfigBuilder.build()); + + return this.builder.build(); + } + + @SuppressWarnings({"EqualsGetClass", "ObjectEqualsForPrimitives"}) + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClusterAutoscalingConfig that = (ClusterAutoscalingConfig) o; + return Objects.equal( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMaxServeNodes(), + that.clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMaxServeNodes()) + && Objects.equal( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMinServeNodes(), + that.clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMinServeNodes()) + && Objects.equal( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getCpuUtilizationPercent(), + that.clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getCpuUtilizationPercent()) + && Objects.equal( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode(), + that.clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode()) + && Objects.equal(clusterId, that.clusterId) + && Objects.equal(instanceId, that.instanceId); + } + + @Override + public int hashCode() { + return Objects.hashCode( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMaxServeNodes(), + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingLimits() + .getMinServeNodes(), + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getCpuUtilizationPercent(), + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode(), + clusterId, + instanceId); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java new file mode 100644 index 000000000000..7203eb274b81 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java @@ -0,0 +1,95 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.GcRule.RuleCase; +import com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; + +/** Wrapper for {@link ColumnFamily} protocol buffer object */ +public final class ColumnFamily { + private final String id; + private final GCRule rule; + private final Type valueType; + + @InternalApi + public static ColumnFamily fromProto(String id, com.google.bigtable.admin.v2.ColumnFamily proto) { + return new ColumnFamily( + id, GCRULES.fromProto(proto.getGcRule()), Type.fromProto(proto.getValueType())); + } + + private ColumnFamily(String id, GCRule rule, Type type) { + this.id = id; + this.rule = rule; + this.valueType = type; + } + + /** Gets the column family's id. */ + public String getId() { + return id; + } + + /** Gets the GCRule configured for the column family. */ + public GCRule getGCRule() { + return rule; + } + + /* Gets the valueType configured for the column family. */ + public Type getValueType() { + return valueType; + } + + /** Returns true if a GCRule has been configured for the family. */ + public boolean hasGCRule() { + return !RuleCase.RULE_NOT_SET.equals(rule.toProto().getRuleCase()); + } + + public boolean hasValueType() { + return valueType.getClass() != Type.Raw.class; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ColumnFamily that = (ColumnFamily) o; + return Objects.equal(id, that.id) + && Objects.equal(rule, that.rule) + && Objects.equal(valueType, that.valueType); + } + + @Override + public int hashCode() { + return Objects.hashCode(id, rule, valueType); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("id", id) + .add("GCRule", rule) + .add("valueType", valueType) + .toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java new file mode 100644 index 000000000000..ef6a3d762a8a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java @@ -0,0 +1,170 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.DataBoostReadLocalWrites; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.StandardReadRemoteWrites; +import com.google.bigtable.admin.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ConsistencyRequest { + @Nonnull + protected abstract String getTableId(); + + @Nonnull + protected abstract CheckConsistencyRequest.ModeCase getMode(); + + /** + * Internal accessor for the consistency token. Must be public to be accessible from the stub + * package. + */ + @InternalApi + @Nullable + public abstract String getConsistencyToken(); + + protected abstract boolean isFullyQualified(); + + public static ConsistencyRequest forReplication(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES, null, false); + } + + /** + * Creates a request to check consistency using an existing token. + * + * @param tableId The table ID. + * @param consistencyToken The token to check. Must not be null. + * @throws NullPointerException if consistencyToken is null. + */ + public static ConsistencyRequest forReplication(String tableId, String consistencyToken) { + Preconditions.checkNotNull(consistencyToken, "consistencyToken must not be null"); + + return new AutoValue_ConsistencyRequest( + tableId, + CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES, + consistencyToken, + false); + } + + public static ConsistencyRequest forDataBoost(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.DATA_BOOST_READ_LOCAL_WRITES, null, false); + } + + @InternalApi + public static ConsistencyRequest forReplicationFromTableName(String tableName) { + Preconditions.checkArgument( + TableName.isParsableFrom(tableName), "tableName must be a fully qualified table name"); + return new AutoValue_ConsistencyRequest( + tableName, CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES, null, true); + } + + @InternalApi + public static ConsistencyRequest forReplicationFromTableName( + String tableName, String consistencyToken) { + Preconditions.checkArgument( + TableName.isParsableFrom(tableName), "tableName must be a fully qualified table name"); + Preconditions.checkNotNull(consistencyToken, "consistencyToken must not be null"); + + return new AutoValue_ConsistencyRequest( + tableName, + CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES, + consistencyToken, + true); + } + + private CheckConsistencyRequest.Builder buildBaseRequest(String name, String token) { + CheckConsistencyRequest.Builder builder = CheckConsistencyRequest.newBuilder(); + + if (getMode().equals(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES)) { + builder.setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()); + } else { + builder.setDataBoostReadLocalWrites(DataBoostReadLocalWrites.newBuilder().build()); + } + + return builder.setName(name).setConsistencyToken(token); + } + + /** + * Creates a CheckConsistencyRequest proto. This variant is used when the ConsistencyRequest was + * initialized with a short table ID, relying on the TableAdminRequestContext to construct the + * fully qualified table name. + */ + @InternalApi + public CheckConsistencyRequest toCheckConsistencyProto( + TableAdminRequestContext requestContext, String token) { + Preconditions.checkState( + !isFullyQualified(), + "Use toCheckConsistencyProto(String token) for fully qualified table names."); + TableName tableName = + TableName.of(requestContext.getProjectId(), requestContext.getInstanceId(), getTableId()); + + return buildBaseRequest(tableName.toString(), token).build(); + } + + /** + * Creates a CheckConsistencyRequest proto. This variant is used when the ConsistencyRequest was + * initialized with a fully qualified table name, eliminating the need for a request context. + */ + @InternalApi + public CheckConsistencyRequest toCheckConsistencyProto(String token) { + Preconditions.checkState( + isFullyQualified(), + "Use toCheckConsistencyProto(TableAdminRequestContext, String) for non-qualified table" + + " names."); + + return buildBaseRequest(getTableId(), token).build(); + } + + /** + * Creates a GenerateConsistencyTokenRequest proto. This variant is used when the + * ConsistencyRequest was initialized with a short table ID, relying on the + * TableAdminRequestContext to construct the fully qualified table name. + */ + @InternalApi + public GenerateConsistencyTokenRequest toGenerateTokenProto( + TableAdminRequestContext requestContext) { + Preconditions.checkState( + !isFullyQualified(), "Use toGenerateTokenProto() for fully qualified table names."); + GenerateConsistencyTokenRequest.Builder builder = GenerateConsistencyTokenRequest.newBuilder(); + TableName tableName = + TableName.of(requestContext.getProjectId(), requestContext.getInstanceId(), getTableId()); + + return builder.setName(tableName.toString()).build(); + } + + /** + * Creates a GenerateConsistencyTokenRequest proto. This variant is used when the + * ConsistencyRequest was initialized with a fully qualified table name, eliminating the need for + * a request context. + */ + @InternalApi + public GenerateConsistencyTokenRequest toGenerateTokenProto() { + Preconditions.checkState( + isFullyQualified(), + "Use toGenerateTokenProto(TableAdminRequestContext) for non-qualified table names."); + GenerateConsistencyTokenRequest.Builder builder = GenerateConsistencyTokenRequest.newBuilder(); + return builder.setName(getTableId()).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequest.java new file mode 100644 index 000000000000..88b50376be04 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequest.java @@ -0,0 +1,126 @@ +/* + * 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.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.util.Timestamps; +import javax.annotation.Nonnull; +import org.threeten.bp.Instant; + +/** Build CopyBackupRequest for {@link com.google.bigtable.admin.v2.CopyBackupRequest}. */ +public final class CopyBackupRequest { + private final com.google.bigtable.admin.v2.CopyBackupRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.CopyBackupRequest.newBuilder(); + private final String sourceBackupId; + private final String sourceClusterId; + private String sourceInstanceId; + private String sourceProjectId; + + private String destClusterId; + + /** + * Create a {@link CopyBackupRequest} object. It assumes the source backup is located in the same + * instance and project as the destination backup, which is where the BigtableTableAdminClient is + * created in. use setSourceInstance("[INSTANCE]") if the source backup is located in a different + * instance. use setSourceInstance("[PROJECT]", "[INSTANCE]") if the source backup is located in a + * different project. + */ + public static CopyBackupRequest of(String sourceClusterId, String sourceBackupId) { + CopyBackupRequest request = new CopyBackupRequest(sourceClusterId, sourceBackupId); + return request; + } + + private CopyBackupRequest(@Nonnull String sourceClusterId, @Nonnull String sourceBackupId) { + Preconditions.checkNotNull(sourceClusterId); + Preconditions.checkNotNull(sourceBackupId); + this.sourceClusterId = sourceClusterId; + this.sourceBackupId = sourceBackupId; + } + + public CopyBackupRequest setSourceInstance(String instanceId) { + Preconditions.checkNotNull(instanceId); + this.sourceInstanceId = instanceId; + return this; + } + + public CopyBackupRequest setSourceInstance(String projectId, String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + this.sourceProjectId = projectId; + this.sourceInstanceId = instanceId; + return this; + } + + public CopyBackupRequest setDestination(String clusterId, String backupId) { + Preconditions.checkNotNull(backupId); + Preconditions.checkNotNull(clusterId); + requestBuilder.setBackupId(backupId); + this.destClusterId = clusterId; + return this; + } + + public CopyBackupRequest setExpireTime(Instant expireTime) { + Preconditions.checkNotNull(expireTime); + requestBuilder.setExpireTime(Timestamps.fromMillis(expireTime.toEpochMilli())); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CopyBackupRequest that = (CopyBackupRequest) o; + return Objects.equal(requestBuilder.getBackupId(), that.requestBuilder.getBackupId()) + && Objects.equal(sourceBackupId, that.sourceBackupId) + && Objects.equal(sourceClusterId, that.sourceClusterId) + && Objects.equal(sourceInstanceId, that.sourceInstanceId) + && Objects.equal(sourceProjectId, that.sourceProjectId); + } + + @Override + public int hashCode() { + return Objects.hashCode( + requestBuilder.getBackupId(), + sourceBackupId, + sourceClusterId, + sourceInstanceId, + sourceProjectId); + } + + @InternalApi + public com.google.bigtable.admin.v2.CopyBackupRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + + return requestBuilder + .setParent(NameUtil.formatClusterName(projectId, instanceId, destClusterId)) + .setSourceBackup( + NameUtil.formatBackupName( + sourceProjectId == null ? projectId : sourceProjectId, + sourceInstanceId == null ? instanceId : sourceInstanceId, + sourceClusterId, + sourceBackupId)) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java new file mode 100644 index 000000000000..2ad236c07b08 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java @@ -0,0 +1,126 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.IsolationPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.MultiClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.RoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.SingleClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Cloud Bigtable app profile. + * + *

An application profile, or app profile, stores settings that tell your Cloud Bigtable instance + * how to handle incoming requests from an application. When one of your applications connects to a + * Cloud Bigtable instance, it can specify an app profile, and Cloud Bigtable uses that app profile + * for any requests that the application sends over that connection. + * + *

Sample code: + * + *

{@code
+ * AppProfile existingAppProfile = ...;
+ * CreateAppProfileRequest appProfileRequest = CreateAppProfileRequest.of("my-instance", "my-new-app-profile")
+ *   .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster"));
+ * }
+ * + * @see AppProfile for more details + */ +public final class CreateAppProfileRequest { + private final String instanceId; + private final com.google.bigtable.admin.v2.CreateAppProfileRequest.Builder proto; + + /** Builds a new request to create a new app profile in the specified instance. */ + public static CreateAppProfileRequest of(String instanceId, String appProfileId) { + return new CreateAppProfileRequest(instanceId, appProfileId); + } + + private CreateAppProfileRequest(String instanceId, String appProfileId) { + this.instanceId = instanceId; + this.proto = com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder(); + + proto.setAppProfileId(appProfileId); + proto.getAppProfileBuilder().setDescription(appProfileId); + } + + /** Configures if safety warnings should be disabled. */ + @SuppressWarnings("WeakerAccess") + public CreateAppProfileRequest setIgnoreWarnings(boolean value) { + proto.setIgnoreWarnings(value); + return this; + } + + /** Sets the optional long form description of the use case for the AppProfile. */ + @SuppressWarnings("WeakerAccess") + public CreateAppProfileRequest setDescription(@Nonnull String description) { + proto.getAppProfileBuilder().setDescription(description); + return this; + } + + /** Sets the routing policy for all read/write requests that use this app profile. */ + @SuppressWarnings("WeakerAccess") + public CreateAppProfileRequest setRoutingPolicy(RoutingPolicy routingPolicy) { + Preconditions.checkNotNull(routingPolicy); + + if (routingPolicy instanceof MultiClusterRoutingPolicy) { + proto + .getAppProfileBuilder() + .setMultiClusterRoutingUseAny(((MultiClusterRoutingPolicy) routingPolicy).toProto()); + } else if (routingPolicy instanceof SingleClusterRoutingPolicy) { + proto + .getAppProfileBuilder() + .setSingleClusterRouting(((SingleClusterRoutingPolicy) routingPolicy).toProto()); + } else { + throw new IllegalArgumentException("Unknown policy type: " + routingPolicy); + } + + return this; + } + + /** Sets the isolation policy for all read/write requests that use this app profile. */ + public CreateAppProfileRequest setIsolationPolicy(IsolationPolicy isolationPolicy) { + Preconditions.checkNotNull(isolationPolicy); + if (isolationPolicy instanceof StandardIsolationPolicy) { + proto + .getAppProfileBuilder() + .setStandardIsolation(((StandardIsolationPolicy) isolationPolicy).toProto()); + } else if (isolationPolicy instanceof AppProfile.DataBoostIsolationReadOnlyPolicy) { + proto + .getAppProfileBuilder() + .setDataBoostIsolationReadOnly( + ((AppProfile.DataBoostIsolationReadOnlyPolicy) isolationPolicy).toProto()); + } else { + throw new IllegalArgumentException("Unknown policy type: " + isolationPolicy); + } + + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateAppProfileRequest toProto(String projectId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + + return proto.setParent(name).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequest.java new file mode 100644 index 000000000000..0c251fa666e7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequest.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView.AuthorizedViewType; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Cloud Bigtable {@link AuthorizedView}, which represents subsets of + * a particular table. + * + *

Sample code: + * + *

{@code
+ * CreateAuthorizedViewRequest request =
+ *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+ *         .setAuthorizedViewType(
+ *             SubsetView.create()
+ *                 .addRowPrefix("row#")
+ *                 .addFamilySubsets(
+ *                     "my-family", FamilySubsets.create().addQualifier("column")));
+ * }
+ * + * @see AuthorizedView for more details. + */ +public final class CreateAuthorizedViewRequest { + private final String tableId; + private final com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.newBuilder(); + + public static CreateAuthorizedViewRequest of( + @Nonnull String tableId, @Nonnull String authorizedViewId) { + return new CreateAuthorizedViewRequest(tableId, authorizedViewId); + } + + private CreateAuthorizedViewRequest(@Nonnull String tableId, @Nonnull String authorizedViewId) { + Preconditions.checkNotNull(tableId, "tableId must be set"); + Preconditions.checkNotNull(authorizedViewId, "authorizedViewId must be set"); + + this.tableId = tableId; + requestBuilder.setAuthorizedViewId(authorizedViewId); + } + + /** Configures if the authorized view is deletion protected. */ + public CreateAuthorizedViewRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getAuthorizedViewBuilder().setDeletionProtection(deletionProtection); + return this; + } + + /** + * Sets the implementation for this authorized view. + * + * @see AuthorizedViewType for details. + */ + public CreateAuthorizedViewRequest setAuthorizedViewType( + @Nonnull AuthorizedViewType authorizedViewType) { + Preconditions.checkNotNull(authorizedViewType, "authorizedViewType must be set"); + + if (authorizedViewType instanceof SubsetView) { + requestBuilder + .getAuthorizedViewBuilder() + .setSubsetView(((SubsetView) authorizedViewType).toProto()); + } else { + throw new IllegalArgumentException("Unknown authorizedViewType: " + authorizedViewType); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAuthorizedViewRequest that = (CreateAuthorizedViewRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(tableId, that.tableId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), tableId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + return requestBuilder + .setParent(NameUtil.formatTableName(projectId, instanceId, tableId)) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java new file mode 100644 index 000000000000..542ba8da20a3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java @@ -0,0 +1,121 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.util.Timestamps; +import javax.annotation.Nonnull; +import org.threeten.bp.Instant; + +/** Fluent wrapper for {@link com.google.bigtable.admin.v2.CreateBackupRequest} */ +public final class CreateBackupRequest { + private final com.google.bigtable.admin.v2.CreateBackupRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.CreateBackupRequest.newBuilder(); + private final String clusterId; + private String sourceTableId; + + public static CreateBackupRequest of(String clusterId, String backupId) { + CreateBackupRequest request = new CreateBackupRequest(clusterId, backupId); + return request; + } + + private CreateBackupRequest(String clusterId, String backupId) { + Preconditions.checkNotNull(clusterId); + Preconditions.checkNotNull(backupId); + + requestBuilder.setBackupId(backupId); + this.clusterId = clusterId; + this.sourceTableId = null; + } + + public CreateBackupRequest setSourceTableId(String sourceTableId) { + Preconditions.checkNotNull(sourceTableId); + this.sourceTableId = sourceTableId; + return this; + } + + public CreateBackupRequest setExpireTime(Instant expireTime) { + Preconditions.checkNotNull(expireTime); + requestBuilder + .getBackupBuilder() + .setExpireTime(Timestamps.fromMillis(expireTime.toEpochMilli())); + return this; + } + + public CreateBackupRequest setBackupType(Backup.BackupType backupType) { + Preconditions.checkNotNull(backupType); + requestBuilder.getBackupBuilder().setBackupType(backupType.toProto()); + return this; + } + + // The time at which this backup will be converted from a hot backup to a standard backup. Only + // applicable for hot backups. If not set, the backup will remain as a hot backup until it is + // deleted. + public CreateBackupRequest setHotToStandardTime(Instant hotToStandardTime) { + Preconditions.checkNotNull(hotToStandardTime); + requestBuilder + .getBackupBuilder() + .setHotToStandardTime(Timestamps.fromMillis(hotToStandardTime.toEpochMilli())); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackupRequest that = (CreateBackupRequest) o; + return Objects.equal(requestBuilder.getBackupId(), that.requestBuilder.getBackupId()) + && Objects.equal(clusterId, that.clusterId) + && Objects.equal(sourceTableId, that.sourceTableId) + && Objects.equal( + requestBuilder.getBackup().getBackupType(), + that.requestBuilder.getBackup().getBackupType()) + && Objects.equal( + requestBuilder.getBackup().getHotToStandardTime(), + that.requestBuilder.getBackup().getHotToStandardTime()); + } + + @Override + public int hashCode() { + return Objects.hashCode( + requestBuilder.getBackupId(), + clusterId, + sourceTableId, + requestBuilder.getBackup().getBackupType(), + requestBuilder.getBackup().getHotToStandardTime()); + } + + @InternalApi + public com.google.bigtable.admin.v2.CreateBackupRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + + requestBuilder + .getBackupBuilder() + .setSourceTable(NameUtil.formatTableName(projectId, instanceId, sourceTableId)); + return requestBuilder + .setParent(NameUtil.formatClusterName(projectId, instanceId, clusterId)) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java new file mode 100644 index 000000000000..c7ad0a6e3895 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java @@ -0,0 +1,211 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.cloud.bigtable.admin.v2.models.StorageType.SSD; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Bigtable cluster. + * + *

A cluster represents the actual Cloud Bigtable service. Each cluster belongs to a single Cloud + * Bigtable instance. When your application sends requests to a Cloud Bigtable instance, those + * requests are actually handled by one of the clusters in the instance. + * + *

Each cluster is located in a single zone. An instance's clusters must be in unique zones that + * are within the same region. For example, if the first cluster is in us-east1-b, then us-east1-c + * is a valid zone for the second cluster. For a list of zones and regions where Cloud Bigtable is + * available, see Cloud Bigtable + * Locations. + * + *

Examples: + * + *

{@code
+ * // Small production instance:
+ * CreateClusterRequest clusterRequest = CreateClusterRequest.of("my-existing-instance", "my-cluster")
+ *   .setZone("us-east1-c")
+ *   .setServeNodes(3)
+ *   .setStorageType(StorageType.SSD);
+ * }
+ * + * @see For more + * details + */ +public final class CreateClusterRequest { + + private final com.google.bigtable.admin.v2.CreateClusterRequest.Builder proto = + com.google.bigtable.admin.v2.CreateClusterRequest.newBuilder(); + // instanceId and zone are short ids, which will be expanded to full names when the project name + // is passed to toProto + private final String instanceId; + private String zone; + + /** + * Builds a new request to create a new cluster to the specified instance with the specified + * cluster id. + */ + public static CreateClusterRequest of(String instanceId, String clusterId) { + return new CreateClusterRequest(instanceId, clusterId); + } + + private CreateClusterRequest(String instanceId, String clusterId) { + this.instanceId = instanceId; + proto.setClusterId(clusterId); + proto.getClusterBuilder().setDefaultStorageType(SSD.toProto()); + } + + /** + * Sets the zone where the new cluster will be located. Must be different from the existing + * cluster. + */ + @SuppressWarnings("WeakerAccess") + public CreateClusterRequest setZone(String zone) { + this.zone = zone; + return this; + } + + /** + * Sets the number of nodes allocated to this cluster. More nodes enable higher throughput and + * more consistent performance. + * + * @deprecated Please use CreateClusterRequest#setScalingMode instead + */ + @SuppressWarnings("WeakerAccess") + @Deprecated + public CreateClusterRequest setServeNodes(int numNodes) { + proto.getClusterBuilder().setServeNodes(numNodes); + return this; + } + + /** + * Sets the scaling node to manual and sets the number of nodes allocated to this cluster. More + * nodes enable higher throughput and more consistent performance. + */ + public CreateClusterRequest setScalingMode(@Nonnull StaticClusterSize staticClusterSize) { + Preconditions.checkState(staticClusterSize.getClusterSize() > 0, "Serve nodes must be > 0"); + if (proto.getCluster().getClusterConfig().hasClusterAutoscalingConfig()) { + throw new IllegalArgumentException( + "Autoscaling is already set. To enable manual scaling, do not set the max nodes, min" + + " nodes, and CPU percentage."); + } + proto.getClusterBuilder().setServeNodes(staticClusterSize.getClusterSize()); + return this; + } + + /** + * Sets the scaling mode to autoscaling by accepting an AutoscalingConfig where min nodes, max + * nodes, CPU utilization percent target, and storage utilization gib per node are set. + */ + public CreateClusterRequest setScalingMode(@Nonnull ClusterAutoscalingConfig autoscalingConfig) { + int minNodes = autoscalingConfig.getMinNodes(); + int maxNodes = autoscalingConfig.getMaxNodes(); + int cpuTargetPercent = autoscalingConfig.getCpuUtilizationTargetPercent(); + int storageUtilizationGibPerNode = autoscalingConfig.getStorageUtilizationGibPerNode(); + + proto + .getClusterBuilder() + .getClusterConfigBuilder() + .getClusterAutoscalingConfigBuilder() + .getAutoscalingLimitsBuilder() + .setMinServeNodes(minNodes); + proto + .getClusterBuilder() + .getClusterConfigBuilder() + .getClusterAutoscalingConfigBuilder() + .getAutoscalingLimitsBuilder() + .setMaxServeNodes(maxNodes); + proto + .getClusterBuilder() + .getClusterConfigBuilder() + .getClusterAutoscalingConfigBuilder() + .getAutoscalingTargetsBuilder() + .setCpuUtilizationPercent(cpuTargetPercent); + proto + .getClusterBuilder() + .getClusterConfigBuilder() + .getClusterAutoscalingConfigBuilder() + .getAutoscalingTargetsBuilder() + .setStorageUtilizationGibPerNode(storageUtilizationGibPerNode); + return this; + } + + /** + * Sets the type of storage used by this cluster to serve its parent instance's tables. Defaults + * to {@code SSD}. + */ + @SuppressWarnings("WeakerAccess") + public CreateClusterRequest setStorageType(@Nonnull StorageType storageType) { + Preconditions.checkNotNull(storageType); + Preconditions.checkArgument( + storageType != StorageType.UNRECOGNIZED, "StorageType can't be UNRECOGNIZED"); + + proto.getClusterBuilder().setDefaultStorageType(storageType.toProto()); + return this; + } + + /** + * Sets the Google Cloud Key Management Service (KMS) key for a CMEK-protected Bigtable. This + * requires the full resource name of the Cloud KMS key, in the format + * `projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}` + */ + public CreateClusterRequest setKmsKeyName(@Nonnull String kmsKeyName) { + Preconditions.checkNotNull(kmsKeyName); + proto.getClusterBuilder().getEncryptionConfigBuilder().setKmsKeyName(kmsKeyName); + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateClusterRequest toProto(String projectId) { + proto.setParent(NameUtil.formatInstanceName(projectId, instanceId)); + proto.getClusterBuilder().setLocation(NameUtil.formatLocationName(projectId, zone)); + + return proto.build(); + } + + /** + * Gets the clusterId. This method is meant to be used by {@link CreateClusterRequest} and is + * considered an internal implementation detail and not meant to be used by applications. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + String getClusterId() { + return proto.getClusterId(); + } + + /** + * Creates the request protobuf to be used in {@link CreateInstanceRequest}. This method is + * considered an internal implementation detail and not meant to be used by applications. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + com.google.bigtable.admin.v2.Cluster toEmbeddedProto(String projectId) { + proto.getClusterBuilder().setLocation(NameUtil.formatLocationName(projectId, zone)); + + return proto.getClusterBuilder().build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java new file mode 100644 index 000000000000..092a4c7aa064 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java @@ -0,0 +1,258 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Bigtable Instance. + * + *

A Cloud Bigtable instance is mostly just a container for your clusters and nodes, which do all + * of the real work. Instances come in 2 flavors: + * + *

+ *
Production + *
A standard instance with either 1 or 2 clusters, as well as 3 or more nodes in each + * cluster. You cannot downgrade a production instance to a development instance. + *
Development + *
A low-cost instance for development and testing, with performance limited to the equivalent + * of a 1-node cluster. Development instances only support a single 1 node cluster. At any + * point this can be upgraded to a production instance. + *
+ * + * When creating an Instance, you must create at least one cluster in it. + * + *

Examples: + * + *

{@code
+ * // Small production instance:
+ * CreateInstanceRequest smallProdInstanceRequest = CreateInstanceRequest.of("my-small-instance")
+ *   .addCluster("cluster1", "us-east1-c", 3, StorageType.SSD);
+ *
+ * // Development instance:
+ * CreateInstanceRequest smallProdInstanceRequest = CreateInstanceRequest.of("my-dev-instance")
+ *   .setType(Type.DEVELOPMENT)
+ *   .addDevelopmentCluster("cluster1", "us-east1-c", StorageType.SSD);
+ *
+ * }
+ * + * @see For more + * details + */ +public final class CreateInstanceRequest { + private final com.google.bigtable.admin.v2.CreateInstanceRequest.Builder builder = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder(); + + private final List clusterRequests = Lists.newArrayList(); + + /** Builds a new request to create a new instance with the specified id. */ + public static CreateInstanceRequest of(@Nonnull String instanceId) { + return new CreateInstanceRequest(instanceId); + } + + private CreateInstanceRequest(@Nonnull String instanceId) { + Preconditions.checkNotNull(instanceId, "InstanceId can't be null"); + + builder.setInstanceId(instanceId); + builder.getInstanceBuilder().setDisplayName(instanceId); + builder.getInstanceBuilder().setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION); + } + + /** + * Sets the friendly display name of the instance. If left unspecified, it will default to the id + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest setDisplayName(@Nonnull String displayName) { + Preconditions.checkNotNull(displayName); + builder.getInstanceBuilder().setDisplayName(displayName); + return this; + } + + /** + * Sets the type of instance. + * + *

Can be either DEVELOPMENT or PRODUCTION. Defaults to PRODUCTION. Please see class javadoc + * for details. + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest setType(@Nonnull Instance.Type type) { + Preconditions.checkNotNull(type); + Preconditions.checkArgument(type != Instance.Type.UNRECOGNIZED, "Type is unrecognized"); + builder.getInstanceBuilder().setType(type.toProto()); + return this; + } + + /** + * Adds an arbitrary label to the instance. + * + *

Labels are key-value pairs that you can use to group related instances and store metadata + * about an instance. + * + * @see For more + * details + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value) { + Preconditions.checkNotNull(key, "Key can't be null"); + Preconditions.checkNotNull(value, "Value can't be null"); + builder.getInstanceBuilder().putLabels(key, value); + return this; + } + + /** + * Adds a tag to the instance. + * + *

Tags are a way to organize and govern resources across Google Cloud. Unlike labels, Tags are + * standalone resources created and managed through the Resource Manager API. + * + * @see For more details + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest addTag(@Nonnull String key, @Nonnull String value) { + Preconditions.checkNotNull(key, "Key can't be null"); + Preconditions.checkNotNull(value, "Value can't be null"); + builder.getInstanceBuilder().putTags(key, value); + return this; + } + + /** + * Adds a cluster to the instance request with manual scaling enabled. + * + *

All new instances must have at least one cluster. DEVELOPMENT instances must have exactly + * one cluster. + * + * @param clusterId the name of the cluster. + * @param zone the zone where the cluster will be created. + * @param serveNodes the number of nodes that cluster will contain. DEVELOPMENT instance clusters + * must have exactly one node. + * @param storageType the type of storage used by this cluster to serve its parent instance's + * tables. + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest addCluster( + @Nonnull String clusterId, + @Nonnull String zone, + int serveNodes, + @Nonnull StorageType storageType) { + CreateClusterRequest clusterRequest = + CreateClusterRequest.of("ignored-instance-id", clusterId) + .setZone(zone) + .setScalingMode(StaticClusterSize.of(serveNodes)) + .setStorageType(storageType); + clusterRequests.add(clusterRequest); + + return this; + } + + /** + * Adds a cluster to the instance request with autoscaling enabled. + * + *

All new instances must have at least one cluster. DEVELOPMENT instances must have exactly + * one cluster. + * + * @param clusterId the name of the cluster. + * @param zone the zone where the cluster will be created. + * @param clusterAutoscalingConfig the autoscaling config that sets the min serve nodes, max serve + * nodes, and CPU utilization percentage + * @param storageType the type of storage used by this cluster to serve its parent instance's + * tables. + */ + public CreateInstanceRequest addCluster( + @Nonnull String clusterId, + @Nonnull String zone, + @Nonnull ClusterAutoscalingConfig clusterAutoscalingConfig, + @Nonnull StorageType storageType) { + CreateClusterRequest clusterRequest = + CreateClusterRequest.of("ignored-instance-id", clusterId) + .setZone(zone) + .setScalingMode(clusterAutoscalingConfig) + .setStorageType(storageType); + clusterRequests.add(clusterRequest); + + return this; + } + + /** + * Adds a CMEK protected cluster using the specified KMS key name. + * + * @param clusterId the name of the cluster. + * @param zone the zone where the cluster will be created. + * @param serveNodes the number of nodes that cluster will contain. DEVELOPMENT instance clusters + * must have exactly one node. + * @param storageType the type of storage used by this cluster to serve its parent instance's + * tables. + * @param kmsKeyName the full name of the KMS key name to use in the format + * `projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}` + */ + public CreateInstanceRequest addCmekCluster( + @Nonnull String clusterId, + @Nonnull String zone, + int serveNodes, + @Nonnull StorageType storageType, + @Nonnull String kmsKeyName) { + CreateClusterRequest clusterRequest = + CreateClusterRequest.of("ignored-instance-id", clusterId) + .setZone(zone) + .setScalingMode(StaticClusterSize.of(serveNodes)) + .setStorageType(storageType) + .setKmsKeyName(kmsKeyName); + clusterRequests.add(clusterRequest); + + return this; + } + + /** + * Adds a DEVELOPMENT cluster to the instance request. + * + *

This instance will have exactly one node cluster. + * + * @param clusterId the name of the cluster. + * @param zone the zone where the cluster will be created. + * @param storageType the type of storage used by this cluster to serve its parent instance's + * tables. + */ + @SuppressWarnings("WeakerAccess") + public CreateInstanceRequest addDevelopmentCluster( + @Nonnull String clusterId, @Nonnull String zone, @Nonnull StorageType storageType) { + CreateClusterRequest developmentCluster = + CreateClusterRequest.of("ignored-instance-id", clusterId) + .setZone(zone) + .setStorageType(storageType); + clusterRequests.add(developmentCluster); + + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateInstanceRequest toProto(String projectId) { + builder.setParent(NameUtil.formatProjectName(projectId)).clearClusters(); + + for (CreateClusterRequest clusterRequest : clusterRequests) { + builder.putClusters(clusterRequest.getClusterId(), clusterRequest.toEmbeddedProto(projectId)); + } + + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequest.java new file mode 100644 index 000000000000..5a3a6e0f5ff0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Cloud Bigtable logical view. + * + *

Sample code: + * + *

{@code
+ * LogicalView existingLogicalView = ...;
+ * CreateLogicalViewRequest logicalViewRequest = CreateLogicalViewRequest.of("my-instance", "my-new-logical-view")
+ *   .setQuery("...").setDeletionProtection(true);
+ * }
+ * + * @see LogicalView for more details + */ +public final class CreateLogicalViewRequest { + private final String instanceId; + private final com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder proto; + + /** Builds a new request to create a new logical view in the specified instance. */ + public static CreateLogicalViewRequest of(String instanceId, String logicalViewId) { + return new CreateLogicalViewRequest(instanceId, logicalViewId); + } + + private CreateLogicalViewRequest(String instanceId, String logicalViewId) { + this.instanceId = instanceId; + this.proto = com.google.bigtable.admin.v2.CreateLogicalViewRequest.newBuilder(); + + proto.setLogicalViewId(logicalViewId); + } + + /** Sets the query of the LogicalView. */ + @SuppressWarnings("WeakerAccess") + public CreateLogicalViewRequest setQuery(@Nonnull String query) { + proto.getLogicalViewBuilder().setQuery(query); + return this; + } + + /** Configures if the logical view is deletion protected. */ + @SuppressWarnings("WeakerAccess") + public CreateLogicalViewRequest setDeletionProtection(boolean value) { + proto.getLogicalViewBuilder().setDeletionProtection(value); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLogicalViewRequest that = (CreateLogicalViewRequest) o; + return Objects.equal(proto.build(), that.proto.build()) + && Objects.equal(instanceId, that.instanceId); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto.build(), instanceId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateLogicalViewRequest toProto(String projectId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + + return proto.setParent(name).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequest.java new file mode 100644 index 000000000000..983a0a48e148 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Cloud Bigtable materialized view. + * + *

Sample code: + * + *

{@code
+ * MaterializedView existingMaterializedView = ...;
+ * CreateMaterializedViewRequest materializedViewRequest = CreateMaterializedViewRequest.of("my-instance", "my-new-materialized-view")
+ *   .setQuery("...");
+ * }
+ * + * @see MaterializedView for more details + */ +public final class CreateMaterializedViewRequest { + private final String instanceId; + private final com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder proto; + + /** Builds a new request to create a new materialized view in the specified instance. */ + public static CreateMaterializedViewRequest of(String instanceId, String materializedViewId) { + return new CreateMaterializedViewRequest(instanceId, materializedViewId); + } + + private CreateMaterializedViewRequest(String instanceId, String materializedViewId) { + this.instanceId = instanceId; + this.proto = com.google.bigtable.admin.v2.CreateMaterializedViewRequest.newBuilder(); + + proto.setMaterializedViewId(materializedViewId); + } + + /** Configures if the materialized view is deletion protected. */ + @SuppressWarnings("WeakerAccess") + public CreateMaterializedViewRequest setDeletionProtection(boolean value) { + proto.getMaterializedViewBuilder().setDeletionProtection(value); + return this; + } + + /** Sets the query of the MaterializedView. */ + @SuppressWarnings("WeakerAccess") + public CreateMaterializedViewRequest setQuery(@Nonnull String query) { + proto.getMaterializedViewBuilder().setQuery(query); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMaterializedViewRequest that = (CreateMaterializedViewRequest) o; + return Objects.equal(proto.build(), that.proto.build()) + && Objects.equal(instanceId, that.instanceId); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto.build(), instanceId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest toProto(String projectId) { + String name = NameUtil.formatInstanceName(projectId, instanceId); + + return proto.setParent(name).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java new file mode 100644 index 000000000000..b6d88e2b53ff --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java @@ -0,0 +1,108 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ProtoSchema; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import javax.annotation.Nonnull; + +/** + * Parameters for creating a new Cloud Bigtable {@link SchemaBundle}, which represents subsets of a + * particular table. + * + *

Sample code: + * + *

{@code
+ * CreateSchemaBundleRequest request =
+ *     CreateSchemaBundleRequest.of("my-table", "my-new-schema-bundle")
+ *         .setProtoSchemaFile("proto_file.pb");
+ * }
+ * + * @see SchemaBundle for more details. + */ +public final class CreateSchemaBundleRequest { + private final String tableId; + private final com.google.bigtable.admin.v2.CreateSchemaBundleRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.newBuilder(); + + public static CreateSchemaBundleRequest of( + @Nonnull String tableId, @Nonnull String schemaBundleId) { + return new CreateSchemaBundleRequest(tableId, schemaBundleId); + } + + private CreateSchemaBundleRequest(@Nonnull String tableId, @Nonnull String schemaBundleId) { + Preconditions.checkNotNull(tableId, "tableId must be set"); + Preconditions.checkNotNull(schemaBundleId, "schemaBundleId must be set"); + + this.tableId = tableId; + requestBuilder.setSchemaBundleId(schemaBundleId); + } + + /** Sets the proto schema for this schema bundle. */ + public CreateSchemaBundleRequest setProtoSchemaFile(@Nonnull String protoSchemaFile) + throws IOException { + Preconditions.checkNotNull(protoSchemaFile, "protoSchemaFile must be set"); + byte[] content = Files.readAllBytes(Paths.get(protoSchemaFile)); + return setProtoSchema(ByteString.copyFrom(content)); + } + + /** Sets the proto schema for this schema bundle. */ + public CreateSchemaBundleRequest setProtoSchema(@Nonnull ByteString protoSchema) { + Preconditions.checkNotNull(protoSchema, "protoSchema must be set"); + requestBuilder.setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setProtoSchema(ProtoSchema.newBuilder().setProtoDescriptors(protoSchema))); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSchemaBundleRequest that = (CreateSchemaBundleRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(tableId, that.tableId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), tableId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.CreateSchemaBundleRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + return requestBuilder + .setParent(NameUtil.formatTableName(projectId, instanceId, tableId)) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java new file mode 100644 index 000000000000..88e6b99c22b3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java @@ -0,0 +1,177 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import javax.annotation.Nonnull; +import org.threeten.bp.Duration; + +/** + * Fluent wrapper for {@link com.google.bigtable.admin.v2.CreateTableRequest} + * + *

Allows for creating table with: + * + *

    + *
  • optional columnFamilies, including optional {@link GCRule} + *
  • optional granularity + *
  • and optional split points + *
+ */ +public final class CreateTableRequest { + private final com.google.bigtable.admin.v2.CreateTableRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder(); + + public static CreateTableRequest of(String tableId) { + return new CreateTableRequest(tableId); + } + + /** Configures table with the specified id */ + private CreateTableRequest(String tableId) { + requestBuilder.setTableId(tableId); + } + + /** Adds a new columnFamily to the configuration */ + public CreateTableRequest addFamily(String familyId) { + Preconditions.checkNotNull(familyId); + requestBuilder.getTableBuilder().putColumnFamilies(familyId, ColumnFamily.getDefaultInstance()); + return this; + } + + /** + * Adds a new columnFamily with {@link GCRule} to the configuration. Please note that calling this + * method with the same familyId will overwrite the previous family. + * + * @see GCRule for available options. + */ + public CreateTableRequest addFamily(@Nonnull String familyId, @Nonnull GCRule gcRule) { + return addFamily(familyId, gcRule, Type.raw()); + } + + /** + * Adds a new columnFamily with a {@link Type} to the configuration. Please note that calling this + * method with the same familyId will overwrite the previous family. + * + * @see Type for available options. + */ + public CreateTableRequest addFamily(@Nonnull String familyId, @Nonnull Type valueType) { + return addFamily(familyId, GCRules.GCRULES.defaultRule(), valueType); + } + + /** + * Adds a new columnFamily with a {@link GCRule} and {@link Type} to the configuration. Please + * note that calling this method with the same familyId will overwrite the previous family. + * + * @see GCRule for available options. + * @see Type for available options. + */ + public CreateTableRequest addFamily( + @Nonnull String familyId, @Nonnull GCRule gcRule, @Nonnull Type valueType) { + Preconditions.checkNotNull(familyId); + Preconditions.checkNotNull(gcRule); + Preconditions.checkNotNull(valueType); + + ColumnFamily.Builder builder = ColumnFamily.newBuilder().setGcRule(gcRule.toProto()); + + // Don't set the type if it's the default ("raw") + if (!valueType.equals(Type.raw())) { + builder.setValueType(valueType.toProto()); + } + requestBuilder.getTableBuilder().putColumnFamilies(familyId, builder.build()); + return this; + } + + /** Adds split at the specified key to the configuration. */ + public CreateTableRequest addSplit(ByteString key) { + Preconditions.checkNotNull(key); + requestBuilder.addInitialSplitsBuilder().setKey(key); + return this; + } + + /** Add change stream retention period between 1 day and 7 days. */ + public CreateTableRequest addChangeStreamRetention(Duration retention) { + Preconditions.checkNotNull(retention); + requestBuilder + .getTableBuilder() + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(retention.getSeconds()) + .setNanos(retention.getNano()) + .build()) + .build()); + return this; + } + + /** Configures if the table is deletion protected. */ + public CreateTableRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getTableBuilder().setDeletionProtection(deletionProtection); + return this; + } + + /** Set an automated backup policy for the table. */ + public CreateTableRequest setAutomatedBackup(Duration retentionPeriod, Duration frequency) { + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy policy = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(retentionPeriod.getSeconds()) + .setNanos(retentionPeriod.getNano()) + .build()) + .setFrequency( + com.google.protobuf.Duration.newBuilder() + .setSeconds(frequency.getSeconds()) + .setNanos(frequency.getNano()) + .build()) + .build(); + + requestBuilder.getTableBuilder().setAutomatedBackupPolicy(policy); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTableRequest that = (CreateTableRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build()); + } + + @InternalApi + public com.google.bigtable.admin.v2.CreateTableRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + + return requestBuilder.setParent(NameUtil.formatInstanceName(projectId, instanceId)).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfo.java new file mode 100644 index 000000000000..b96e0ade130a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfo.java @@ -0,0 +1,111 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType; +import com.google.cloud.bigtable.common.Status; +import com.google.common.base.Objects; + +/** + * Encryption information for a given resource. + * + *

If this resource is protected with customer managed encryption, the in-use Google Cloud Key + * Management Service (KMS) key versions will be specified along with their status. + */ +public final class EncryptionInfo { + public enum Type { + /** Encryption type was not specified, though data at rest remains encrypted. */ + ENCRYPTION_TYPE_UNSPECIFIED( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.ENCRYPTION_TYPE_UNSPECIFIED), + /** + * The data backing this resource is encrypted at rest with a key that is fully managed by + * Google. No key version or status will be populated. This is the default state. + */ + GOOGLE_DEFAULT_ENCRYPTION( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.GOOGLE_DEFAULT_ENCRYPTION), + /** + * The data backing this resource is encrypted at rest with a key that is managed by the + * customer. The in-use version of the key and its status are populated for CMEK-protected + * tables. CMEK-protected backups are pinned to the key version that was in use at the time the + * backup was taken. This key version is populated but its status is not tracked and is reported + * as `UNKNOWN`. + */ + CUSTOMER_MANAGED_ENCRYPTION( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.CUSTOMER_MANAGED_ENCRYPTION), + /** Type not known by the client, please upgrade your client */ + UNRECOGNIZED(com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType proto; + + Type(EncryptionType proto) { + this.proto = proto; + } + + /** Wraps the EncryptionInfo protobuf. */ + public static Type fromProto(com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType proto) { + for (Type type : values()) { + if (Objects.equal(type.proto, proto)) { + return type; + } + } + return UNRECOGNIZED; + } + } + + private com.google.bigtable.admin.v2.EncryptionInfo proto; + + public static EncryptionInfo fromProto(com.google.bigtable.admin.v2.EncryptionInfo proto) { + return new EncryptionInfo(proto); + } + + private EncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo proto) { + this.proto = proto; + } + + public Type getType() { + return EncryptionInfo.Type.fromProto(proto.getEncryptionType()); + } + + public String getKmsKeyVersion() { + return proto.getKmsKeyVersion(); + } + + public Status getStatus() { + return Status.fromProto(proto.getEncryptionStatus()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EncryptionInfo that = (EncryptionInfo) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + + @Override + public String toString() { + return proto.toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsets.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsets.java new file mode 100644 index 000000000000..e80452b2af25 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsets.java @@ -0,0 +1,119 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.List; +import javax.annotation.Nonnull; + +/** Represents subsets of a particular column family that are included in this authorized view. */ +public final class FamilySubsets { + private final com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder builder; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static FamilySubsets fromProto( + @Nonnull com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets proto) { + return new FamilySubsets(proto); + } + + public static FamilySubsets create() { + return new FamilySubsets(); + } + + private FamilySubsets(@Nonnull com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets proto) { + this.builder = proto.toBuilder(); + } + + private FamilySubsets() { + this.builder = com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder(); + } + + /** Gets the list of column qualifiers included in this authorized view. */ + public List getQualifiers() { + return ImmutableList.copyOf(this.builder.getQualifiersList()); + } + + /** Gets the list of column qualifier prefixes included in this authorized view. */ + public List getQualifierPrefixes() { + return ImmutableList.copyOf(this.builder.getQualifierPrefixesList()); + } + + /** Adds an individual column qualifier to be included in this authorized view. */ + public FamilySubsets addQualifier(ByteString qualifier) { + this.builder.addQualifiers(qualifier); + return this; + } + + /** Adds an individual column qualifier to be included in this authorized view. */ + public FamilySubsets addQualifier(String qualifier) { + this.builder.addQualifiers(ByteString.copyFromUtf8(qualifier)); + return this; + } + + /** + * Adds a prefix for column qualifiers to be included in this authorized view. Every qualifier + * starting with the prefix will be included in this authorized view. An empty string ("") prefix + * means to provide access to all qualifiers. + */ + public FamilySubsets addQualifierPrefix(ByteString qualifierPrefix) { + this.builder.addQualifierPrefixes(qualifierPrefix); + return this; + } + + /** + * Adds a prefix for column qualifiers to be included in this authorized view. Every qualifier + * starting with the prefix will be included in this authorized view. An empty string ("") prefix + * means to provide access to all qualifiers. + */ + public FamilySubsets addQualifierPrefix(String qualifierPrefix) { + this.builder.addQualifierPrefixes(ByteString.copyFromUtf8(qualifierPrefix)); + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets toProto() { + return builder.build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FamilySubsets that = (FamilySubsets) o; + return Objects.equal(builder.build(), that.builder.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(builder.build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GCRules.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GCRules.java new file mode 100644 index 000000000000..35f48c5260c3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GCRules.java @@ -0,0 +1,378 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.GcRule.Intersection; +import com.google.bigtable.admin.v2.GcRule.Union; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; +import org.threeten.bp.Duration; + +// TODO(igorbernstein2): the distinction between GcRule & GCRule is too subtle, use fully qualified +// names for the protos. +/** + * Wraps {@link GcRule} protocol buffer object and exposes a friendly API. + * + *

Note: Garbage collection executes opportunistically in the background, and so it's possible + * for reads to return a cell even if it matches the active GC expression for its family. Please use + * appropriate filters in your reads to exclude cells which are eligible for garbage collection. + */ +@BetaApi +public final class GCRules { + /** Factory method to create GCRules - entry point into the DSL. */ + public static final GCRules GCRULES = new GCRules(); + + private GCRules() {} + + /** Creates a new instance of the IntersectionRule */ + public IntersectionRule intersection() { + return new IntersectionRule(); + } + + /** Creates a new instance of the IntersectionRule */ + public UnionRule union() { + return new UnionRule(); + } + + /** + * Creates a new instance of the VersionRule + * + * @param maxVersion - maximum number of cell versions to keep + */ + public VersionRule maxVersions(int maxVersion) { + return new VersionRule(maxVersion); + } + + /** + * Creates a new instance of the DurationRule + * + * @param maxAge - maximum age of the cell to keep + * @param timeUnit - timeunit for the age + */ + public DurationRule maxAge(long maxAge, TimeUnit timeUnit) { + return maxAge(Duration.ofNanos(TimeUnit.NANOSECONDS.convert(maxAge, timeUnit))); + } + + /** + * Creates a new instance of the DurationRule + * + * @param duration - age expressed as duration + */ + public DurationRule maxAge(Duration duration) { + return new DurationRule(duration); + } + + /** Creates an empty default rule */ + public DefaultRule defaultRule() { + return new DefaultRule(); + } + + @InternalApi + public GCRule fromProto(GcRule source) { + switch (source.getRuleCase()) { + case MAX_AGE: + return GCRULES.maxAge( + Duration.ofSeconds(source.getMaxAge().getSeconds(), source.getMaxAge().getNanos())); + + case MAX_NUM_VERSIONS: + return GCRULES.maxVersions(source.getMaxNumVersions()); + + case INTERSECTION: + IntersectionRule intersection = GCRules.GCRULES.intersection(); + for (GcRule rule : source.getIntersection().getRulesList()) { + intersection.rule(fromProto(rule)); + } + return intersection; + + case UNION: + UnionRule union = GCRules.GCRULES.union(); + for (GcRule rule : source.getUnion().getRulesList()) { + union.rule(fromProto(rule)); + } + return union; + + case RULE_NOT_SET: + return defaultRule(); + + default: + throw new IllegalArgumentException("Unknown GcRule case: " + source.getRuleCase()); + } + } + + /** + * Fluent wrapper for {@link Intersection} rule. Allows far adding an hierarchy of rules with + * intersection as the root + */ + public static final class IntersectionRule implements GCRule { + private final List rulesList; + + private IntersectionRule() { + rulesList = new ArrayList<>(); + } + + /** Adds a new GCRule */ + // TODO(igorbernstein2): consider renaming this to addRule + public IntersectionRule rule(@Nonnull GCRule rule) { + rulesList.add(rule); + return this; + } + + /** Gets the list of child rules */ + public List getRulesList() { + return rulesList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntersectionRule that = (IntersectionRule) o; + return Objects.equal(rulesList, that.rulesList); + } + + @Override + public int hashCode() { + return Objects.hashCode(rulesList); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("rulesList", rulesList).toString(); + } + + @InternalApi + @Override + public GcRule toProto() { + switch (rulesList.size()) { + case 0: + return GcRule.newBuilder().build(); + case 1: + return rulesList.get(0).toProto(); + default: + return GcRule.newBuilder() + .setIntersection(Intersection.newBuilder().addAllRules(convertToGcRules(rulesList))) + .build(); + } + } + } + + /** + * Fluent wrapper for {@link Union} rule. Allows far adding an hierarchy of rules with union as + * the root + */ + public static final class UnionRule implements GCRule { + private final List rulesList; + + private UnionRule() { + rulesList = new ArrayList<>(); + } + + /** Adds a new GCRule */ + public UnionRule rule(@Nonnull GCRule rule) { + rulesList.add(rule); + return this; + } + + /** Gets the list of child rules */ + public List getRulesList() { + return rulesList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnionRule unionRule = (UnionRule) o; + return Objects.equal(rulesList, unionRule.rulesList); + } + + @Override + public int hashCode() { + return Objects.hashCode(rulesList); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("rulesList", rulesList).toString(); + } + + @InternalApi + @Override + public GcRule toProto() { + switch (rulesList.size()) { + case 0: + return GcRule.newBuilder().build(); + case 1: + return rulesList.get(0).toProto(); + default: + return GcRule.newBuilder() + .setUnion(Union.newBuilder().addAllRules(convertToGcRules(rulesList))) + .build(); + } + } + } + + /** Wrapper for building max versions rule */ + public static final class VersionRule implements GCRule { + private final GcRule.Builder builder; + + private VersionRule(int maxVersion) { + this.builder = GcRule.newBuilder(); + builder.setMaxNumVersions(maxVersion); + } + + /** Gets the configured maximum versions */ + public int getMaxVersions() { + return builder.getMaxNumVersions(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionRule that = (VersionRule) o; + return Objects.equal(builder.build(), that.builder.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(builder); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("maxNumVersions", getMaxVersions()).toString(); + } + + @InternalApi + @Override + public GcRule toProto() { + return builder.build(); + } + } + + /** Wrapper for building max duration rule */ + public static final class DurationRule implements GCRule { + private final com.google.protobuf.Duration.Builder builder; + + private DurationRule(Duration duration) { + this.builder = + com.google.protobuf.Duration.newBuilder() + .setSeconds(duration.getSeconds()) + .setNanos(duration.getNano()); + } + + /** Gets the configured maximum age */ + public Duration getMaxAge() { + return Duration.ofSeconds(builder.getSeconds(), builder.getNanos()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DurationRule that = (DurationRule) o; + return Objects.equal(builder.build(), that.builder.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(builder); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("maxAge", getMaxAge()).toString(); + } + + @InternalApi + @Override + public GcRule toProto() { + return GcRule.newBuilder().setMaxAge(builder.build()).build(); + } + } + + /** Wrapper for building a empty rule */ + public static final class DefaultRule implements GCRule { + private DefaultRule() {} + + @InternalApi + @Override + public GcRule toProto() { + return GcRule.getDefaultInstance(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + + return getClass() == o.getClass(); + } + + @Override + public int hashCode() { + return Objects.hashCode(1); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).toString(); + } + } + + /** interface for fluent GcRule wrappers */ + public interface GCRule { + @InternalApi + GcRule toProto(); + } + + private static List convertToGcRules(List rules) { + List gcRules = new ArrayList<>(rules.size()); + + for (GCRule rule : rules) { + gcRules.add(rule.toProto()); + } + return gcRules; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java new file mode 100644 index 000000000000..552a78962457 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.models; + +import com.google.bigtable.admin.v2.GcRule; +import com.google.protobuf.util.Durations; +import java.time.Duration; + +/** + * Factory for creating safe GcRule protos. + * + *

Use this class to construct {@link GcRule} instances instead of the raw proto builder ({@link + * GcRule#newBuilder()}) to avoid common pitfalls with "oneof" fields (e.g. accidentally overwriting + * max age with max versions). + */ +public final class GcRuleBuilder { + private GcRuleBuilder() {} // Static utility + + // Entry points for composite rules + + /** + * Starts building an Intersection (AND) rule. + * + * @return A new builder for an intersection rule. + */ + public static IntersectionRuleBuilder intersection() { + return new IntersectionRuleBuilder(); + } + + /** + * Starts building a Union (OR) rule. + * + * @return A new builder for a union rule. + */ + public static UnionRuleBuilder union() { + return new UnionRuleBuilder(); + } + + // Entry points for simple rules (return the Proto directly) + + /** + * Creates a Max Age rule. + * + * @param age The maximum age of the cell. + * @return The constructed GcRule proto. + */ + public static GcRule maxAge(Duration age) { + long seconds = age.getSeconds(); + int nanos = age.getNano(); + return GcRule.newBuilder() + .setMaxAge(Durations.fromNanos(seconds * 1_000_000_000L + nanos)) + .build(); + } + + /** + * Creates a Max Versions rule. + * + * @param versions The maximum number of versions. + * @return The constructed GcRule proto. + */ + public static GcRule maxVersions(int versions) { + return GcRule.newBuilder().setMaxNumVersions(versions).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java new file mode 100644 index 000000000000..df163b0e0daf --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java @@ -0,0 +1,198 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import java.util.Map; +import javax.annotation.Nonnull; + +/** + * Represents an existing Cloud Bigtable instance. + * + *

A Cloud Bigtable instance is mostly just a container for your clusters and nodes, which do all + * of the real work. + */ +public final class Instance { + public enum Type { + /** An instance meant for production use. `serve_nodes` must be set on the cluster. */ + PRODUCTION(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION), + /** The instance is meant for development and testing purposes only. */ + DEVELOPMENT(com.google.bigtable.admin.v2.Instance.Type.DEVELOPMENT), + /** The type of instance is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Instance.Type.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Instance.Type proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static Type fromProto(com.google.bigtable.admin.v2.Instance.Type proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument( + proto != com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED, + "Server instance type must always be specified"); + for (Type type : values()) { + if (type.proto.equals(proto)) { + return type; + } + } + return UNRECOGNIZED; + } + + Type(com.google.bigtable.admin.v2.Instance.Type proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Instance.Type toProto() { + return proto; + } + } + + public enum State { + /** The state of the instance could not be determined by the server. */ + NOT_KNOWN(com.google.bigtable.admin.v2.Instance.State.STATE_NOT_KNOWN), + /** The instance has been successfully created and can serve requests to its tables. */ + READY(com.google.bigtable.admin.v2.Instance.State.READY), + /** + * The instance is currently being created, and may be destroyed if the creation process + * encounters an error. + */ + CREATING(com.google.bigtable.admin.v2.Instance.State.CREATING), + /** The state of instance is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Instance.State.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Instance.State proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static State fromProto(com.google.bigtable.admin.v2.Instance.State proto) { + Preconditions.checkNotNull(proto); + for (State state : values()) { + if (state.proto.equals(proto)) { + return state; + } + } + return UNRECOGNIZED; + } + + State(com.google.bigtable.admin.v2.Instance.State proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Instance.State toProto() { + return proto; + } + } + + @Nonnull private final com.google.bigtable.admin.v2.Instance proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static Instance fromProto(@Nonnull com.google.bigtable.admin.v2.Instance proto) { + return new Instance(proto); + } + + private Instance(@Nonnull com.google.bigtable.admin.v2.Instance proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "Name must be set"); + this.proto = proto; + } + + /** Gets the instance's id. */ + @SuppressWarnings("WeakerAccess") + public String getId() { + // Constructor ensures that name is not null + InstanceName fullName = + Verify.verifyNotNull(InstanceName.parse(proto.getName()), "Name can never be null"); + + //noinspection ConstantConditions + return fullName.getInstance(); + } + + /** Gets the instance's friendly name. */ + @SuppressWarnings("WeakerAccess") + public String getDisplayName() { + return proto.getDisplayName(); + } + + /** Gets the instance's tags. */ + @SuppressWarnings("WeakerAccess") + public Map getTags() { + return proto.getTagsMap(); + } + + /** Gets the instance's current type. Can be DEVELOPMENT or PRODUCTION. */ + @SuppressWarnings("WeakerAccess") + public Type getType() { + return Type.fromProto(proto.getType()); + } + + /** + * Gets the current labels associated with the instance. + * + * @see For more + * details + */ + @SuppressWarnings("WeakerAccess") + public Map getLabels() { + return proto.getLabelsMap(); + } + + /** The current state of the instance. */ + @SuppressWarnings("WeakerAccess") + public State getState() { + return State.fromProto(proto.getState()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Instance instance = (Instance) o; + return Objects.equal(proto, instance.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java new file mode 100644 index 000000000000..96891669c4f2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.models; + +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.GcRule.Intersection; + +/** + * Builder for creating an Intersection (AND) GC Rule. + * + *

This class ensures type safety when constructing composite rules, preventing the misuse of the + * standard builder's ambiguous setters. + */ +public final class IntersectionRuleBuilder { + private final Intersection.Builder intersectionBuilder = Intersection.newBuilder(); + + /** + * Adds a rule to the intersection. + * + * @param rule The rule to add to the intersection. + * @return The builder instance for chaining. + */ + public IntersectionRuleBuilder add(GcRule rule) { + intersectionBuilder.addRules(rule); + return this; + } + + /** + * Builds the final GcRule proto. + * + * @return The constructed GcRule proto. + */ + public GcRule build() { + return GcRule.newBuilder().setIntersection(intersectionBuilder).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/LogicalView.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/LogicalView.java new file mode 100644 index 000000000000..48100c81de21 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/LogicalView.java @@ -0,0 +1,108 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.LogicalViewName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import javax.annotation.Nonnull; + +/** + * A class that wraps the {@link com.google.bigtable.admin.v2.LogicalView} protocol buffer object. + * + *

A LogicalView represents subsets of a particular table based on rules. The access to each + * LogicalView can be configured separately from the Table. + * + *

Users can perform read/write operation on a LogicalView by providing a logicalView id besides + * a table id, in which case the semantics remain identical as reading/writing on a Table except + * that visibility is restricted to the subset of the Table that the LogicalView represents. + */ +public final class LogicalView { + private final com.google.bigtable.admin.v2.LogicalView proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static LogicalView fromProto(@Nonnull com.google.bigtable.admin.v2.LogicalView proto) { + return new LogicalView(proto); + } + + private LogicalView(@Nonnull com.google.bigtable.admin.v2.LogicalView proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "LogicalView must have a name"); + this.proto = proto; + } + + /** Gets the logical view's id. */ + public String getId() { + // Constructor ensures that name is not null. + LogicalViewName fullName = LogicalViewName.parse(proto.getName()); + + //noinspection ConstantConditions + return fullName.getLogicalView(); + } + + /** Gets the id of the instance that owns this LogicalView. */ + @SuppressWarnings("WeakerAccess") + public String getInstanceId() { + LogicalViewName fullName = + Verify.verifyNotNull(LogicalViewName.parse(proto.getName()), "Name can never be null"); + + //noinspection ConstantConditions + return fullName.getInstance(); + } + + /** Gets the query of this logical view. */ + public String getQuery() { + return proto.getQuery(); + } + + /** Returns whether this logical view is deletion protected. */ + public boolean isDeletionProtected() { + return proto.getDeletionProtection(); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.LogicalView toProto() { + return proto; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogicalView that = (LogicalView) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/MaterializedView.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/MaterializedView.java new file mode 100644 index 000000000000..c3bf494c030e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/MaterializedView.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.MaterializedViewName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import javax.annotation.Nonnull; + +/** + * A class that wraps the {@link com.google.bigtable.admin.v2.MaterializedView} protocol buffer + * object. + * + *

A MaterializedView represents subsets of a particular table based on rules. The access to each + * MaterializedView can be configured separately from the Table. + * + *

Users can perform read/write operation on a MaterializedView by providing a materializedView + * id besides a table id, in which case the semantics remain identical as reading/writing on a Table + * except that visibility is restricted to the subset of the Table that the MaterializedView + * represents. + */ +public final class MaterializedView { + private final com.google.bigtable.admin.v2.MaterializedView proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static MaterializedView fromProto( + @Nonnull com.google.bigtable.admin.v2.MaterializedView proto) { + return new MaterializedView(proto); + } + + private MaterializedView(@Nonnull com.google.bigtable.admin.v2.MaterializedView proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "MaterializedView must have a name"); + this.proto = proto; + } + + /** Gets the materialized view's id. */ + public String getId() { + // Constructor ensures that name is not null. + MaterializedViewName fullName = MaterializedViewName.parse(proto.getName()); + + //noinspection ConstantConditions + return fullName.getMaterializedView(); + } + + /** Gets the id of the instance that owns this MaterializedView. */ + @SuppressWarnings("WeakerAccess") + public String getInstanceId() { + MaterializedViewName fullName = + Verify.verifyNotNull(MaterializedViewName.parse(proto.getName()), "Name can never be null"); + + //noinspection ConstantConditions + return fullName.getInstance(); + } + + /** Returns whether this materialized view is deletion protected. */ + public boolean isDeletionProtected() { + return proto.getDeletionProtection(); + } + + /** Gets the query of this materialized view. */ + public String getQuery() { + return proto.getQuery(); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.MaterializedView toProto() { + return proto; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaterializedView that = (MaterializedView) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java new file mode 100644 index 000000000000..664c54aede61 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java @@ -0,0 +1,112 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Fluent wrapper for {@link com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest} + * + *

Allows for the following ColumnFamily modifications: + * + *

    + *
  • create family, optionally with {@link GCRule} + *
  • update existing family {@link GCRule} + *
  • drop an existing family + *
+ */ +public final class ModifyColumnFamiliesRequest { + private final com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Builder modFamilyRequest = + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.newBuilder(); + private final String tableId; + + public static ModifyColumnFamiliesRequest of(String tableId) { + return new ModifyColumnFamiliesRequest(tableId); + } + + /** Configures the tableId to execute the modifications */ + ModifyColumnFamiliesRequest(String tableId) { + Preconditions.checkNotNull(tableId); + this.tableId = tableId; + } + + /** Configures the name of the new {@link ColumnFamily} to be created */ + public ModifyColumnFamiliesRequest addFamily(String familyId) { + return addFamily(familyId, GCRules.GCRULES.defaultRule()); + } + + /** Configures the name and {@link GCRule} of the new {@link ColumnFamily} to be created */ + public ModifyColumnFamiliesRequest addFamily(String familyId, GCRule gcRule) { + return addFamily(familyId, gcRule, Type.raw()); + } + + /** Configures the name and {@link Type} of the new {@link ColumnFamily} to be created */ + public ModifyColumnFamiliesRequest addFamily(String familyId, Type valueType) { + return addFamily(familyId, GCRules.GCRULES.defaultRule(), valueType); + } + + /** + * Configures the name, {@link GCRule}, and {@link Type} of the new {@link ColumnFamily} to be + * created + */ + public ModifyColumnFamiliesRequest addFamily( + @Nonnull String familyId, @Nonnull GCRule gcRule, @Nonnull Type valueType) { + Preconditions.checkNotNull(gcRule); + Preconditions.checkNotNull(valueType); + + Modification.Builder modification = Modification.newBuilder().setId(familyId); + com.google.bigtable.admin.v2.ColumnFamily.Builder createBuilder = + modification.getCreateBuilder().setGcRule(gcRule.toProto()); + + if (!valueType.equals(Type.raw())) { + createBuilder.setValueType(valueType.toProto()); + } + + modFamilyRequest.addModifications(modification.build()); + return this; + } + + /** Updates the {@link GCRule} of existing {@link ColumnFamily} */ + public ModifyColumnFamiliesRequest updateFamily(String familyId, GCRule gcRule) { + Preconditions.checkNotNull(gcRule); + Modification.Builder modification = Modification.newBuilder().setId(familyId); + modification.getUpdateBuilder().setGcRule(gcRule.toProto()); + modFamilyRequest.addModifications(modification.build()); + return this; + } + + /** Drops the specified {@link ColumnFamily} */ + public ModifyColumnFamiliesRequest dropFamily(String familyId) { + Modification.Builder modification = Modification.newBuilder().setId(familyId).setDrop(true); + modFamilyRequest.addModifications(modification.build()); + return this; + } + + @InternalApi + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId, "Project id can't be null"); + Preconditions.checkNotNull(instanceId, "Instance id can't be null"); + + String tableName = NameUtil.formatTableName(projectId, instanceId, tableId); + return modFamilyRequest.setName(tableName).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/OptimizeRestoredTableOperationToken.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/OptimizeRestoredTableOperationToken.java new file mode 100644 index 000000000000..d38f82e4f14e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/OptimizeRestoredTableOperationToken.java @@ -0,0 +1,42 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.base.Preconditions; + +/** + * OptimizeRestoredTableOperationToken is a wrapper for the name of OptimizeRestoredTable operation. + */ +public class OptimizeRestoredTableOperationToken { + private final String operationName; + + @InternalApi + public static OptimizeRestoredTableOperationToken of(String operationName) { + return new OptimizeRestoredTableOperationToken(operationName); + } + + private OptimizeRestoredTableOperationToken(String operationName) { + Preconditions.checkNotNull(operationName); + Preconditions.checkState(!operationName.isEmpty()); + this.operationName = operationName; + } + + @InternalApi + public String getOperationName() { + return operationName; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java new file mode 100644 index 000000000000..f04bdf326e99 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java @@ -0,0 +1,50 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * Exception thrown when some zones are unavailable and listClusters is unable to return a full + * cluster list. This exception can be inspected to get a partial list. + */ +public class PartialListClustersException extends RuntimeException { + private final List unavailableZones; + private final List clusters; + + /** + * This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public PartialListClustersException(List unavailableZones, List clusters) { + super("Failed to list all clusters, some zones were unavailable: " + unavailableZones); + this.unavailableZones = ImmutableList.copyOf(unavailableZones); + this.clusters = ImmutableList.copyOf(clusters); + } + + /** A list of zones, whose unavailability caused this error. */ + public List getUnavailableZones() { + return unavailableZones; + } + + /** A partial list of clusters that were found in the available zones. */ + public List getClusters() { + return clusters; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java new file mode 100644 index 000000000000..a24d66fb275d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.collect.ImmutableList; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * Exception thrown when some zones are unavailable and listInstances is unable to return a full + * instance list. This exception can be inspected to get a partial list. + */ +public class PartialListInstancesException extends RuntimeException { + private final List unavailableZones; + private final List instances; + + @InternalApi + public PartialListInstancesException( + @Nonnull List unavailableZones, @Nonnull List instances) { + super("Failed to list all instances, some zones were unavailable: " + unavailableZones); + + this.unavailableZones = ImmutableList.copyOf(unavailableZones); + this.instances = ImmutableList.copyOf(instances); + } + + /** A list of zones, whose unavailability caused this error. */ + public List getUnavailableZones() { + return unavailableZones; + } + + /** A partial list of instances that were found in the available zones. */ + public List getInstances() { + return instances; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java new file mode 100644 index 000000000000..b801b0db3bbd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java @@ -0,0 +1,133 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Fluent wrapper for {@link com.google.bigtable.admin.v2.RestoreTableRequest} */ +public final class RestoreTableRequest { + private final com.google.bigtable.admin.v2.RestoreTableRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder(); + private final String sourceBackupId; + private final String sourceClusterId; + private final String sourceInstanceId; + private final String sourceProjectId; + + /** + * Create a {@link RestoreTableRequest} object. It assumes the source backup locates in the same + * instance and project as the destination table. To restore a table from a backup in another + * instance, use {@link #of(String, String, String) of} method. To restore a table from a backup + * in another project, use {@link #of(String, String, String, String) of} method. + */ + public static RestoreTableRequest of(String sourceClusterId, String sourceBackupId) { + RestoreTableRequest request = + new RestoreTableRequest(null, sourceClusterId, sourceBackupId, null); + return request; + } + + /** + * Create a {@link RestoreTableRequest} object. The source backup could locate in the same or a + * different instance but the same project as the destination table. To restore a table from a + * backup in another project, use {@link #of(String, String, String, String) of} method. + */ + public static RestoreTableRequest of( + String sourceInstanceId, String sourceClusterId, String sourceBackupId) { + RestoreTableRequest request = + new RestoreTableRequest(sourceInstanceId, sourceClusterId, sourceBackupId, null); + return request; + } + + /** + * Create a {@link RestoreTableRequest} object. The source backup could locate in the same or a + * different instance and/or project. + */ + public static RestoreTableRequest of( + String sourceInstanceId, + String sourceClusterId, + String sourceBackupId, + String sourceProjectId) { + RestoreTableRequest request = + new RestoreTableRequest(sourceInstanceId, sourceClusterId, sourceBackupId, sourceProjectId); + return request; + } + + private RestoreTableRequest( + @Nullable String sourceInstanceId, + @Nonnull String sourceClusterId, + @Nonnull String sourceBackupId, + @Nullable String sourceProjectId) { + Preconditions.checkNotNull(sourceClusterId); + Preconditions.checkNotNull(sourceBackupId); + this.sourceBackupId = sourceBackupId; + this.sourceInstanceId = sourceInstanceId; + this.sourceClusterId = sourceClusterId; + this.sourceProjectId = sourceProjectId; + } + + public RestoreTableRequest setTableId(String tableId) { + Preconditions.checkNotNull(tableId); + requestBuilder.setTableId(tableId); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreTableRequest that = (RestoreTableRequest) o; + return Objects.equal(requestBuilder.getTableId(), that.requestBuilder.getTableId()) + && Objects.equal(sourceInstanceId, that.sourceInstanceId) + && Objects.equal(sourceClusterId, that.sourceClusterId) + && Objects.equal(sourceBackupId, that.sourceBackupId) + && Objects.equal(sourceProjectId, that.sourceProjectId); + } + + @Override + public int hashCode() { + return Objects.hashCode( + requestBuilder.getTableId(), + sourceInstanceId, + sourceClusterId, + sourceBackupId, + sourceProjectId); + } + + @InternalApi + public com.google.bigtable.admin.v2.RestoreTableRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + + return requestBuilder + .setParent(NameUtil.formatInstanceName(projectId, instanceId)) + .setBackup( + NameUtil.formatBackupName( + sourceProjectId == null ? projectId : sourceProjectId, + sourceInstanceId == null ? instanceId : sourceInstanceId, + sourceClusterId, + sourceBackupId)) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoredTableResult.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoredTableResult.java new file mode 100644 index 000000000000..e31d8c4b4a25 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoredTableResult.java @@ -0,0 +1,53 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.base.Strings; +import javax.annotation.Nullable; + +/** + * A RestoredTableResult holds the restored table object and the {@link + * OptimizeRestoredTableOperationToken} object (if any). + */ +public class RestoredTableResult { + + private final Table table; + private final OptimizeRestoredTableOperationToken optimizeRestoredTableOperationToken; + + @InternalApi + public RestoredTableResult( + Table restoredTable, @Nullable String optimizeRestoredTableOperationName) { + this.table = restoredTable; + this.optimizeRestoredTableOperationToken = + Strings.isNullOrEmpty(optimizeRestoredTableOperationName) + ? null + : OptimizeRestoredTableOperationToken.of(optimizeRestoredTableOperationName); + } + + public Table getTable() { + return table; + } + + /** + * OptimizeRestoredTable operation may not be started when the table was restored from a backup + * stored in HDD clusters. + */ + @Nullable + public OptimizeRestoredTableOperationToken getOptimizeRestoredTableOperationToken() { + return this.optimizeRestoredTableOperationToken; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundle.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundle.java new file mode 100644 index 000000000000..7782c335a2ef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundle.java @@ -0,0 +1,95 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.SchemaBundleName; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * A class that wraps the {@link com.google.bigtable.admin.v2.SchemaBundle} protocol buffer object. + */ +public final class SchemaBundle { + private final com.google.bigtable.admin.v2.SchemaBundle proto; + private final SchemaBundleName schemaBundleName; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static SchemaBundle fromProto(@Nonnull com.google.bigtable.admin.v2.SchemaBundle proto) { + return new SchemaBundle(proto); + } + + private SchemaBundle(@Nonnull com.google.bigtable.admin.v2.SchemaBundle proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument(!proto.getName().isEmpty(), "SchemaBundle must have a name"); + Preconditions.checkArgument( + proto.hasProtoSchema(), "Schemabundle must have a proto_schema field"); + this.proto = proto; + this.schemaBundleName = SchemaBundleName.parse(proto.getName()); + } + + /** Gets the schema bundle's id. */ + public String getId() { + //noinspection ConstantConditions + return schemaBundleName.getSchemaBundle(); + } + + /** Gets the id of the table that owns this schema bundle. */ + public String getTableId() { + //noinspection ConstantConditions + return schemaBundleName.getTable(); + } + + /** Gets the proto schema of this schema bundle. */ + public com.google.protobuf.ByteString getProtoSchema() { + if (proto.hasProtoSchema()) { + return proto.getProtoSchema().getProtoDescriptors(); + } + throw new IllegalStateException("This SchemaBundle doesn't have a valid type specified"); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.SchemaBundle toProto() { + return proto; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaBundle that = (SchemaBundle) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSize.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSize.java new file mode 100644 index 000000000000..c6826e03c4dd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSize.java @@ -0,0 +1,28 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import com.google.auto.value.AutoValue; + +@AutoValue +public abstract class StaticClusterSize { + + public static StaticClusterSize of(int clusterSize) { + return new AutoValue_StaticClusterSize(clusterSize); + } + + public abstract int getClusterSize(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StorageType.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StorageType.java new file mode 100644 index 000000000000..5ba4dad68c76 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StorageType.java @@ -0,0 +1,63 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.common.base.Preconditions; + +/** Storage media types for persisting Bigtable data. */ +public enum StorageType { + /** Flash (SSD) storage should be used. */ + HDD(com.google.bigtable.admin.v2.StorageType.HDD), + /** Magnetic drive (HDD) storage should be used. */ + SSD(com.google.bigtable.admin.v2.StorageType.SSD), + /** The storage type is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.StorageType.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.StorageType proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static StorageType fromProto(com.google.bigtable.admin.v2.StorageType proto) { + Preconditions.checkNotNull(proto); + Preconditions.checkArgument( + proto != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED, + "Storage type must be specified"); + + for (StorageType type : values()) { + if (type.proto.equals(proto)) { + return type; + } + } + return UNRECOGNIZED; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + StorageType(com.google.bigtable.admin.v2.StorageType proto) { + this.proto = proto; + } + + public com.google.bigtable.admin.v2.StorageType toProto() { + return proto; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java new file mode 100644 index 000000000000..dc0e599286c6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java @@ -0,0 +1,124 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView.AuthorizedViewType; +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import javax.annotation.Nonnull; + +/** + * Defines a simple authorized view that is a subset of the underlying Table. + * + *

Users can specify the rows in the form of row key prefixes, and specify the column families by + * adding the family id along with its familySubsets rule to the family subsets map. The subset is + * defined by the intersection of the specified row key prefixes and column family subsets. + */ +public class SubsetView implements AuthorizedViewType { + private final com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder builder; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static SubsetView fromProto( + @Nonnull com.google.bigtable.admin.v2.AuthorizedView.SubsetView proto) { + return new SubsetView(proto); + } + + public static SubsetView create() { + return new SubsetView(); + } + + private SubsetView(@Nonnull com.google.bigtable.admin.v2.AuthorizedView.SubsetView proto) { + this.builder = proto.toBuilder(); + } + + private SubsetView() { + this.builder = com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder(); + } + + /** Gets the row prefixes to be included in this subset view. */ + public List getRowPrefixes() { + return ImmutableList.copyOf(this.builder.getRowPrefixesList()); + } + + /** Gets the map from familyId to familySubsets in this subset view. */ + public Map getFamilySubsets() { + ImmutableMap.Builder familySubsets = ImmutableMap.builder(); + for (Entry entry : + builder.getFamilySubsetsMap().entrySet()) { + familySubsets.put(entry.getKey(), FamilySubsets.fromProto(entry.getValue())); + } + return familySubsets.build(); + } + + /** Adds a new rowPrefix to the subset view. */ + public SubsetView addRowPrefix(ByteString rowPrefix) { + this.builder.addRowPrefixes(rowPrefix); + return this; + } + + /** Adds a new rowPrefix to the subset view. */ + public SubsetView addRowPrefix(String rowPrefix) { + this.builder.addRowPrefixes(ByteString.copyFromUtf8(rowPrefix)); + return this; + } + + /** + * Adds a new familyId with its familySubsets to the subset view. Please note that calling this + * method with the same familyId will overwrite the previous rule set on the family. + */ + public SubsetView setFamilySubsets(String familyId, FamilySubsets familySubsets) { + this.builder.putFamilySubsets(familyId, familySubsets.toProto()); + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView toProto() { + return builder.build(); + } + + @Override + @SuppressWarnings("EqualsGetClass") + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubsetView that = (SubsetView) o; + return Objects.equal(builder.build(), that.builder.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(builder.build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java new file mode 100644 index 000000000000..2163b8c47dd1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java @@ -0,0 +1,272 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.TableName; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.threeten.bp.Duration; + +/** Wrapper for {@link Table} protocol buffer object */ +public final class Table { + public enum ReplicationState { + /** The replication state of the table is unknown in this cluster. */ + NOT_KNOWN(com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.STATE_NOT_KNOWN), + /** + * The cluster was recently created, and the table must finish copying over pre-existing data + * from other clusters before it can begin receiving live replication updates and serving Data + * API requests. + */ + INITIALIZING(com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.INITIALIZING), + /** + * The table is temporarily unable to serve Data API requests from this cluster due to planned + * internal maintenance. + */ + PLANNED_MAINTENANCE( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.PLANNED_MAINTENANCE), + /** + * The table is temporarily unable to serve Data API requests from this cluster due to unplanned + * or emergency maintenance. + */ + UNPLANNED_MAINTENANCE( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNPLANNED_MAINTENANCE), + /** + * The table can serve Data API requests from this cluster. Depending on replication delay, + * reads may not immediately reflect the state of the table in other clusters. + */ + READY(com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.READY), + + /** + * The table is fully created and ready for use after a restore, and is being optimized for + * performance. When optimizations are complete, the table will transition to`READY` state. + */ + READY_OPTIMIZING( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.READY_OPTIMIZING), + + /** The replication state of table is not known by this client. Please upgrade your client. */ + UNRECOGNIZED(com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNRECOGNIZED); + + private final com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static ReplicationState fromProto( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState proto) { + Preconditions.checkNotNull(proto); + + for (ReplicationState state : values()) { + if (state.proto.equals(proto)) { + return state; + } + } + return UNRECOGNIZED; + } + + ReplicationState(com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState toProto() { + return proto; + } + } + + public static class AutomatedBackupPolicy { + private final com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy proto; + + /** + * Wraps the protobuf. This method is considered an internal implementation detail and not meant + * to be used by applications. + */ + @InternalApi + public static AutomatedBackupPolicy fromProto( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy proto) { + Preconditions.checkNotNull(proto); + return new AutomatedBackupPolicy(proto); + } + + AutomatedBackupPolicy(@Nonnull com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy proto) { + this.proto = proto; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy toProto() { + return proto; + } + + /** Returns policy config contents as a string. */ + public String viewConfig() { + return MoreObjects.toStringHelper(this) + .add(proto.getClass().getName() + ".retention_period", proto.getRetentionPeriod()) + .add(proto.getClass().getName() + ".frequency", proto.getFrequency()) + .toString(); + } + } + + private final String id; + private final String instanceId; + private final Map replicationStatesByClusterId; + private final List columnFamilies; + + private final Duration changeStreamRetention; + private final boolean deletionProtection; + @Nullable private final AutomatedBackupPolicy automatedBackupPolicy; + + @InternalApi + public static Table fromProto(@Nonnull com.google.bigtable.admin.v2.Table proto) { + ImmutableMap.Builder replicationStates = ImmutableMap.builder(); + + for (Entry entry : + proto.getClusterStatesMap().entrySet()) { + replicationStates.put( + entry.getKey(), ReplicationState.fromProto(entry.getValue().getReplicationState())); + } + + ImmutableList.Builder columnFamilies = ImmutableList.builder(); + + for (Entry entry : + proto.getColumnFamiliesMap().entrySet()) { + columnFamilies.add(ColumnFamily.fromProto(entry.getKey(), entry.getValue())); + } + + Duration changeStreamConfig = null; + if (proto.hasChangeStreamConfig()) { + changeStreamConfig = + Duration.ofSeconds( + proto.getChangeStreamConfig().getRetentionPeriod().getSeconds(), + proto.getChangeStreamConfig().getRetentionPeriod().getNanos()); + } + + AutomatedBackupPolicy automatedBackupPolicy = null; + if (proto.hasAutomatedBackupPolicy()) { + automatedBackupPolicy = AutomatedBackupPolicy.fromProto(proto.getAutomatedBackupPolicy()); + } + + return new Table( + TableName.parse(proto.getName()), + replicationStates.build(), + columnFamilies.build(), + changeStreamConfig, + proto.getDeletionProtection(), + automatedBackupPolicy); + } + + private Table( + TableName tableName, + Map replicationStatesByClusterId, + List columnFamilies, + Duration changeStreamRetention, + boolean deletionProtection, + @Nullable AutomatedBackupPolicy automatedBackupPolicy) { + this.instanceId = tableName.getInstance(); + this.id = tableName.getTable(); + this.replicationStatesByClusterId = replicationStatesByClusterId; + this.columnFamilies = columnFamilies; + this.changeStreamRetention = changeStreamRetention; + this.deletionProtection = deletionProtection; + this.automatedBackupPolicy = automatedBackupPolicy; + } + + /** Gets the table's id. */ + public String getId() { + return id; + } + + /** Gets the id of the instance that owns this Table. */ + public String getInstanceId() { + return instanceId; + } + + public Map getReplicationStatesByClusterId() { + return replicationStatesByClusterId; + } + + public List getColumnFamilies() { + return columnFamilies; + } + + public Duration getChangeStreamRetention() { + return changeStreamRetention; + } + + /** Returns whether this table is deletion protected. */ + public boolean isDeletionProtected() { + return deletionProtection; + } + + /** Returns whether this table has automated backups enabled. */ + public boolean isAutomatedBackupEnabled() { + return automatedBackupPolicy != null; + } + + /** Returns the automated backup policy config. */ + @Nullable + public AutomatedBackupPolicy getAutomatedBackupPolicy() { + return automatedBackupPolicy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Table table = (Table) o; + return Objects.equal(id, table.id) + && Objects.equal(instanceId, table.instanceId) + && Objects.equal(replicationStatesByClusterId, table.replicationStatesByClusterId) + && Objects.equal(columnFamilies, table.columnFamilies) + && Objects.equal(changeStreamRetention, table.changeStreamRetention) + && Objects.equal(deletionProtection, table.deletionProtection) + && Objects.equal(automatedBackupPolicy, table.automatedBackupPolicy); + } + + @Override + public int hashCode() { + return Objects.hashCode( + id, + instanceId, + replicationStatesByClusterId, + columnFamilies, + changeStreamRetention, + deletionProtection, + automatedBackupPolicy); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java new file mode 100644 index 000000000000..0505aa90b362 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java @@ -0,0 +1,360 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.BetaApi; +import com.google.auto.value.AutoValue; +import javax.annotation.Nonnull; + +/** + * Wrapper class for the {@link com.google.bigtable.admin.v2.Type} protobuf message. + * + * @see com.google.bigtable.admin.v2.Type + */ +@BetaApi +@SuppressWarnings("SameNameButDifferent") +public interface Type { + /** + * These types are marker types that allow types to be used as the input to aggregate function. + */ + public static interface SumAggregateInput extends Type {} + + public static interface MinAggregateInput extends Type {} + + public static interface MaxAggregateInput extends Type {} + + public static interface HllAggregateInput extends Type {} + + com.google.bigtable.admin.v2.Type toProto(); + + static Type fromProto(com.google.bigtable.admin.v2.Type source) { + switch (source.getKindCase()) { + case INT64_TYPE: + return Int64.fromProto(source.getInt64Type()); + case BYTES_TYPE: + return Bytes.fromProto(source.getBytesType()); + case AGGREGATE_TYPE: + return Aggregate.fromProto(source.getAggregateType()); + case KIND_NOT_SET: + return Raw.create(); + default: + throw new UnsupportedOperationException(); + } + } + + /** The raw type denotes the absence of a type. */ + public static Raw raw() { + return Raw.create(); + } + + /** + * Creates a Bytes type with a "raw" encoding, leaving the bytes encoded as they are passed in. + */ + public static Bytes rawBytes() { + return Bytes.create(Bytes.Encoding.raw()); + } + + /** Creates a Bytes type with the specified encoding */ + public static Bytes bytes(Bytes.Encoding encoding) { + return Bytes.create(encoding); + } + + /** + * Creates an Int64 type with a big-endian encoding. The bytes are then encoded in "raw" format. + */ + public static Int64 bigEndianInt64() { + return Int64.create(Int64.Encoding.BigEndianBytes.create()); + } + + /** Creates an Int64 type with the specified encoding. */ + public static Int64 int64(Int64.Encoding encoding) { + return Int64.create(encoding); + } + + /** Creates an Aggregate type with a SUM aggregator and Int64 input type. */ + public static Aggregate int64Sum() { + return sum(bigEndianInt64()); + } + + /** Creates an Aggregate type with a SUM aggregator and specified input type. */ + public static Aggregate sum(SumAggregateInput inputType) { + return Aggregate.create(inputType, Aggregate.Aggregator.Sum.create()); + } + + /** Creates an Aggregate type with a MIN aggregator and Int64 input type. */ + public static Aggregate int64Min() { + return min(bigEndianInt64()); + } + + /** Creates an Aggregate type with a MIN aggregator and specified input type. */ + public static Aggregate min(MinAggregateInput inputType) { + return Aggregate.create(inputType, Aggregate.Aggregator.Min.create()); + } + + /** Creates an Aggregate type with a MAX aggregator and Int64 input type. */ + public static Aggregate int64Max() { + return max(bigEndianInt64()); + } + + /** Creates an Aggregate type with a MAX aggregator and specified input type. */ + public static Aggregate max(MaxAggregateInput inputType) { + return Aggregate.create(inputType, Aggregate.Aggregator.Max.create()); + } + + /** Creates an Aggregate type with a HLL aggregator and Int64 input type. */ + public static Aggregate int64Hll() { + return hll(bigEndianInt64()); + } + + /** Creates an Aggregate type with a HLL aggregator and specified input type. */ + public static Aggregate hll(HllAggregateInput inputType) { + return Aggregate.create(inputType, Aggregate.Aggregator.Hll.create()); + } + + /** Represents a string of bytes with a specific encoding. */ + @AutoValue + public abstract static class Bytes implements Type { + public static Bytes create(Encoding encoding) { + return new AutoValue_Type_Bytes(encoding); + } + + @Nonnull + public abstract Encoding getEncoding(); + + @Override + public com.google.bigtable.admin.v2.Type toProto() { + com.google.bigtable.admin.v2.Type.Builder builder = + com.google.bigtable.admin.v2.Type.newBuilder(); + builder.getBytesTypeBuilder().setEncoding(getEncoding().toProto()); + return builder.build(); + } + + static Bytes fromProto(com.google.bigtable.admin.v2.Type.Bytes source) { + return create(Encoding.fromProto(source.getEncoding())); + } + + public abstract static class Encoding { + + abstract com.google.bigtable.admin.v2.Type.Bytes.Encoding toProto(); + + static Encoding fromProto(com.google.bigtable.admin.v2.Type.Bytes.Encoding source) { + switch (source.getEncodingCase()) { + case RAW: + case ENCODING_NOT_SET: + return Raw.create(); + } + throw new UnsupportedOperationException(); + } + + public static Encoding raw() { + return Raw.create(); + } + + @AutoValue + public abstract static class Raw extends Encoding { + public static Raw create() { + return new AutoValue_Type_Bytes_Encoding_Raw(); + } + + private static final com.google.bigtable.admin.v2.Type.Bytes.Encoding PROTO_INSTANCE = + com.google.bigtable.admin.v2.Type.Bytes.Encoding.newBuilder() + .setRaw(com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) + .build(); + + @Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding toProto() { + return PROTO_INSTANCE; + } + } + } + } + + /** Represents a 64-bit integer with a specific encoding. */ + @AutoValue + public abstract static class Int64 + implements SumAggregateInput, MinAggregateInput, MaxAggregateInput, HllAggregateInput { + public static Int64 create(Encoding encoding) { + return new AutoValue_Type_Int64(encoding); + } + + @Nonnull + public abstract Encoding getEncoding(); + + public abstract static class Encoding { + + abstract com.google.bigtable.admin.v2.Type.Int64.Encoding toProto(); + + static Encoding fromProto(com.google.bigtable.admin.v2.Type.Int64.Encoding source) { + switch (source.getEncodingCase()) { + case BIG_ENDIAN_BYTES: + return BigEndianBytes.create(); + case ENCODING_NOT_SET: + return BigEndianBytes.create(); + default: + throw new UnsupportedOperationException(); + } + } + + @AutoValue + public abstract static class BigEndianBytes extends Encoding { + + public static BigEndianBytes create() { + return new AutoValue_Type_Int64_Encoding_BigEndianBytes(); + } + + @Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding toProto() { + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder builder = + com.google.bigtable.admin.v2.Type.Int64.Encoding.newBuilder(); + builder.getBigEndianBytesBuilder(); + return builder.build(); + } + } + } + + @Override + public com.google.bigtable.admin.v2.Type toProto() { + com.google.bigtable.admin.v2.Type.Builder builder = + com.google.bigtable.admin.v2.Type.newBuilder(); + builder.getInt64TypeBuilder().setEncoding(getEncoding().toProto()); + return builder.build(); + } + + static Int64 fromProto(com.google.bigtable.admin.v2.Type.Int64 source) { + return Int64.create(Encoding.fromProto(source.getEncoding())); + } + } + + @AutoValue + public abstract static class Raw implements Type { + public static Raw create() { + return new AutoValue_Type_Raw(); + } + + @Override + public com.google.bigtable.admin.v2.Type toProto() { + return com.google.bigtable.admin.v2.Type.getDefaultInstance(); + } + } + + /** + * A value that combines incremental updates into a summarized value. + * + *

Data is never directly written or read using type `Aggregate`. Writes will provide either + * the `input_type` or `state_type`, and reads will always return the `state_type` . + */ + @AutoValue + public abstract static class Aggregate implements Type { + public static Aggregate create(Type inputType, Aggregator aggregator) { + return new AutoValue_Type_Aggregate(inputType, aggregator); + } + + @Nonnull + public abstract Type getInputType(); + + @Nonnull + public abstract Aggregator getAggregator(); + + public abstract static class Aggregator { + @AutoValue + public abstract static class Sum extends Aggregator { + public static Sum create() { + return new AutoValue_Type_Aggregate_Aggregator_Sum(); + } + + @Override + void buildTo(com.google.bigtable.admin.v2.Type.Aggregate.Builder builder) { + builder.setSum(com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance()); + } + } + + @AutoValue + public abstract static class Min extends Aggregator { + public static Min create() { + return new AutoValue_Type_Aggregate_Aggregator_Min(); + } + + @Override + void buildTo(com.google.bigtable.admin.v2.Type.Aggregate.Builder builder) { + builder.setMin(com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance()); + } + } + + @AutoValue + public abstract static class Max extends Aggregator { + public static Max create() { + return new AutoValue_Type_Aggregate_Aggregator_Max(); + } + + @Override + void buildTo(com.google.bigtable.admin.v2.Type.Aggregate.Builder builder) { + builder.setMax(com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance()); + } + } + + @AutoValue + public abstract static class Hll extends Aggregator { + public static Hll create() { + return new AutoValue_Type_Aggregate_Aggregator_Hll(); + } + + @Override + void buildTo(com.google.bigtable.admin.v2.Type.Aggregate.Builder builder) { + builder.setHllppUniqueCount( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance()); + } + } + + abstract void buildTo(com.google.bigtable.admin.v2.Type.Aggregate.Builder builder); + } + + @Override + public com.google.bigtable.admin.v2.Type toProto() { + com.google.bigtable.admin.v2.Type.Builder typeBuilder = + com.google.bigtable.admin.v2.Type.newBuilder(); + com.google.bigtable.admin.v2.Type.Aggregate.Builder aggregateBuilder = + typeBuilder.getAggregateTypeBuilder(); + getAggregator().buildTo(aggregateBuilder); + aggregateBuilder.setInputType(getInputType().toProto()); + return typeBuilder.build(); + } + + static Aggregate fromProto(com.google.bigtable.admin.v2.Type.Aggregate source) { + Type inputType = Type.fromProto(source.getInputType()); + Aggregator aggregator = null; + switch (source.getAggregatorCase()) { + case SUM: + aggregator = Aggregator.Sum.create(); + break; + case MIN: + aggregator = Aggregator.Min.create(); + break; + case MAX: + aggregator = Aggregator.Max.create(); + break; + case HLLPP_UNIQUE_COUNT: + aggregator = Aggregator.Hll.create(); + break; + case AGGREGATOR_NOT_SET: + throw new UnsupportedOperationException(); + } + return Aggregate.create(inputType, checkNotNull(aggregator)); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java new file mode 100644 index 000000000000..0d4c1ba70ae8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.models; + +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.GcRule.Union; + +/** + * Builder for creating a Union (OR) GC Rule. + * + *

This class ensures type safety when constructing composite rules, preventing the misuse of the + * standard builder's ambiguous setters. + */ +public final class UnionRuleBuilder { + private final Union.Builder unionBuilder = Union.newBuilder(); + + /** + * Adds a rule to the union. + * + * @param rule The rule to add to the union. + * @return The builder instance for chaining. + */ + public UnionRuleBuilder add(GcRule rule) { + unionBuilder.addRules(rule); + return this; + } + + /** + * Builds the final GcRule proto. + * + * @return The constructed GcRule proto. + */ + public GcRule build() { + return GcRule.newBuilder().setUnion(unionBuilder).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java new file mode 100644 index 000000000000..b5e14f4f2aa9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.DataBoostIsolationReadOnlyPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.IsolationPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.MultiClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.RoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.SingleClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Cloud Bigtable app profile. + * + *

Examples + * + *

{@code
+ * AppProfile existingAppProfile = ...;
+ * UpdateAppProfileRequest appProfileRequest = UpdateAppProfileRequest.of(existingAppProfile)
+ *   .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster"));
+ * }
+ * + * @see AppProfile for more details + */ +public final class UpdateAppProfileRequest { + private final String instanceId; + private final String appProfileId; + + private final com.google.bigtable.admin.v2.UpdateAppProfileRequest.Builder proto; + + /** + * Builds a new update request using an existing AppProfile. + * + *

This variant is recommended over {@link #of(String, String)} because it provides optimistic + * concurrency control using etags. + */ + public static UpdateAppProfileRequest of(@Nonnull AppProfile appProfile) { + return new UpdateAppProfileRequest( + appProfile.getInstanceId(), + appProfile.getId(), + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile(appProfile.toProto())); + } + + /** Builds a new update request using an existing AppProfile. */ + public static UpdateAppProfileRequest of( + @Nonnull String instanceId, @Nonnull String appProfileId) { + return new UpdateAppProfileRequest( + instanceId, + appProfileId, + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder()); + } + + private UpdateAppProfileRequest( + @Nonnull String instanceId, + @Nonnull String appProfileId, + @Nonnull com.google.bigtable.admin.v2.UpdateAppProfileRequest.Builder proto) { + Preconditions.checkNotNull(instanceId, "instanceId must be set"); + Preconditions.checkNotNull(appProfileId, "appProfileId must be set"); + Preconditions.checkNotNull(proto, "proto must be set"); + + this.instanceId = instanceId; + this.appProfileId = appProfileId; + this.proto = proto; + } + + /** Configures if safety warnings should be disabled. */ + @SuppressWarnings("WeakerAccess") + public UpdateAppProfileRequest setIgnoreWarnings(boolean value) { + proto.setIgnoreWarnings(value); + return this; + } + + /** Sets the optional long form description of the use case for the AppProfile. */ + @SuppressWarnings("WeakerAccess") + public UpdateAppProfileRequest setDescription(@Nonnull String description) { + Preconditions.checkNotNull(description); + + proto.getAppProfileBuilder().setDescription(description); + updateFieldMask(com.google.bigtable.admin.v2.AppProfile.DESCRIPTION_FIELD_NUMBER); + return this; + } + + /** Sets the routing policy for all read/write requests that use this app profile. */ + @SuppressWarnings("WeakerAccess") + public UpdateAppProfileRequest setRoutingPolicy(@Nonnull RoutingPolicy routingPolicy) { + Preconditions.checkNotNull(routingPolicy); + + if (routingPolicy instanceof MultiClusterRoutingPolicy) { + proto + .getAppProfileBuilder() + .setMultiClusterRoutingUseAny(((MultiClusterRoutingPolicy) routingPolicy).toProto()); + updateFieldMask( + com.google.bigtable.admin.v2.AppProfile.MULTI_CLUSTER_ROUTING_USE_ANY_FIELD_NUMBER); + } else if (routingPolicy instanceof SingleClusterRoutingPolicy) { + proto + .getAppProfileBuilder() + .setSingleClusterRouting(((SingleClusterRoutingPolicy) routingPolicy).toProto()); + updateFieldMask(com.google.bigtable.admin.v2.AppProfile.SINGLE_CLUSTER_ROUTING_FIELD_NUMBER); + } else { + throw new IllegalArgumentException("Unknown policy type: " + routingPolicy); + } + + return this; + } + + /** Sets the isolation policy for all read/write requests that use this app profile. */ + public UpdateAppProfileRequest setIsolationPolicy(@Nonnull IsolationPolicy isolationPolicy) { + Preconditions.checkNotNull(isolationPolicy); + + if (isolationPolicy instanceof StandardIsolationPolicy) { + proto + .getAppProfileBuilder() + .setStandardIsolation(((StandardIsolationPolicy) isolationPolicy).toProto()); + updateFieldMask(com.google.bigtable.admin.v2.AppProfile.STANDARD_ISOLATION_FIELD_NUMBER); + } else if (isolationPolicy instanceof DataBoostIsolationReadOnlyPolicy) { + proto + .getAppProfileBuilder() + .setDataBoostIsolationReadOnly( + ((DataBoostIsolationReadOnlyPolicy) isolationPolicy).toProto()); + updateFieldMask( + com.google.bigtable.admin.v2.AppProfile.DATA_BOOST_ISOLATION_READ_ONLY_FIELD_NUMBER); + } else { + throw new IllegalArgumentException("Unknown policy type: " + isolationPolicy); + } + + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = + FieldMaskUtil.fromFieldNumbers(com.google.bigtable.admin.v2.AppProfile.class, fieldNumber); + proto.setUpdateMask(FieldMaskUtil.union(proto.getUpdateMask(), newMask)); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.UpdateAppProfileRequest toProto(String projectId) { + String name = NameUtil.formatAppProfileName(projectId, instanceId, appProfileId); + + proto.getAppProfileBuilder().setName(name); + + return proto.build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppProfileRequest that = (UpdateAppProfileRequest) o; + return Objects.equal(instanceId, that.instanceId) + && Objects.equal(appProfileId, that.appProfileId) + && Objects.equal(proto.build(), that.proto.build()); + } + + @Override + public int hashCode() { + return Objects.hashCode(instanceId, appProfileId, proto.build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequest.java new file mode 100644 index 000000000000..fbb54c994e29 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequest.java @@ -0,0 +1,154 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView.AuthorizedViewType; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Cloud Bigtable {@link AuthorizedView}. + * + *

Sample code: + * + *

{@code
+ * AuthorizedView existingAuthorizedView = client.getAuthorizedView("my-table", "my-authorized-view");
+ * UpdateAuthorizedViewRequest request =
+ *     UpdateAuthorizedViewRequest.of(existingAuthorizedView).setDeletionProtection(true);
+ * }
+ * + * @see AuthorizedView for more details. + */ +public final class UpdateAuthorizedViewRequest { + private final com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder requestBuilder; + private final String tableId; + private final String authorizedViewId; + + /** Builds a new update request using an existing authorized view. */ + public static UpdateAuthorizedViewRequest of(@Nonnull AuthorizedView authorizedView) { + return new UpdateAuthorizedViewRequest( + authorizedView.getTableId(), + authorizedView.getId(), + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView(authorizedView.toProto())); + } + + /** Builds a new update authorized view request. */ + public static UpdateAuthorizedViewRequest of( + @Nonnull String tableId, @Nonnull String authorizedViewId) { + return new UpdateAuthorizedViewRequest( + tableId, + authorizedViewId, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder()); + } + + private UpdateAuthorizedViewRequest( + @Nonnull String tableId, + @Nonnull String authorizedViewId, + @Nonnull com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder requestBuilder) { + Preconditions.checkNotNull(tableId, "tableId must be set"); + Preconditions.checkNotNull(authorizedViewId, "authorizedViewId must be set"); + Preconditions.checkNotNull(requestBuilder, "proto builder must be set"); + + this.tableId = tableId; + this.authorizedViewId = authorizedViewId; + this.requestBuilder = requestBuilder; + } + + /** Changes the deletion protection of an existing authorized view. */ + public UpdateAuthorizedViewRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getAuthorizedViewBuilder().setDeletionProtection(deletionProtection); + updateFieldMask(com.google.bigtable.admin.v2.AuthorizedView.DELETION_PROTECTION_FIELD_NUMBER); + return this; + } + + /** + * Updates the implementation for this authorized view. + * + * @see AuthorizedViewType for details. + */ + public UpdateAuthorizedViewRequest setAuthorizedViewType( + @Nonnull AuthorizedViewType authorizedViewType) { + Preconditions.checkNotNull(authorizedViewType, "authorizedViewType must be set"); + + if (authorizedViewType instanceof SubsetView) { + requestBuilder + .getAuthorizedViewBuilder() + .setSubsetView(((SubsetView) authorizedViewType).toProto()); + updateFieldMask(com.google.bigtable.admin.v2.AuthorizedView.SUBSET_VIEW_FIELD_NUMBER); + } else { + throw new IllegalArgumentException("Unknown authorizedViewType: " + authorizedViewType); + } + + return this; + } + + /** + * Configures if safety warnings should be disabled. If set, then updates that making the + * authorized view more restrictive are allowed. + */ + @SuppressWarnings("WeakerAccess") + public UpdateAuthorizedViewRequest setIgnoreWarnings(boolean value) { + requestBuilder.setIgnoreWarnings(value); + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = + FieldMaskUtil.fromFieldNumbers( + com.google.bigtable.admin.v2.AuthorizedView.class, fieldNumber); + requestBuilder.setUpdateMask(FieldMaskUtil.union(requestBuilder.getUpdateMask(), newMask)); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAuthorizedViewRequest that = (UpdateAuthorizedViewRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(tableId, that.tableId) + && Objects.equal(authorizedViewId, that.authorizedViewId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), tableId, authorizedViewId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + requestBuilder + .getAuthorizedViewBuilder() + .setName( + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId)); + return requestBuilder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java new file mode 100644 index 000000000000..9bf9076b0cbe --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java @@ -0,0 +1,120 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.Backup; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import com.google.protobuf.util.Timestamps; +import javax.annotation.Nonnull; +import org.threeten.bp.Instant; + +/** Fluent wrapper for {@link com.google.bigtable.admin.v2.UpdateBackupRequest} */ +public final class UpdateBackupRequest { + private final com.google.bigtable.admin.v2.UpdateBackupRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.UpdateBackupRequest.newBuilder(); + private final String backupId; + private final String clusterId; + + public static UpdateBackupRequest of(String clusterId, String backupId) { + UpdateBackupRequest request = new UpdateBackupRequest(clusterId, backupId); + return request; + } + + private UpdateBackupRequest(String clusterId, String backupId) { + Preconditions.checkNotNull(clusterId); + Preconditions.checkNotNull(backupId); + this.backupId = backupId; + this.clusterId = clusterId; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = FieldMaskUtil.fromFieldNumbers(Backup.class, fieldNumber); + requestBuilder.setUpdateMask(FieldMaskUtil.union(requestBuilder.getUpdateMask(), newMask)); + } + + public UpdateBackupRequest setExpireTime(Instant expireTime) { + Preconditions.checkNotNull(expireTime); + requestBuilder + .getBackupBuilder() + .setExpireTime(Timestamps.fromMillis(expireTime.toEpochMilli())); + updateFieldMask(Backup.EXPIRE_TIME_FIELD_NUMBER); + return this; + } + + // The time at which this backup will be converted from a hot backup to a standard backup. Only + // applicable for hot backups. If not set, the backup will remain as a hot backup until it is + // deleted. + public UpdateBackupRequest setHotToStandardTime(Instant hotToStandardTime) { + Preconditions.checkNotNull(hotToStandardTime); + requestBuilder + .getBackupBuilder() + .setHotToStandardTime(Timestamps.fromMillis(hotToStandardTime.toEpochMilli())); + updateFieldMask(Backup.HOT_TO_STANDARD_TIME_FIELD_NUMBER); + return this; + } + + public UpdateBackupRequest clearHotToStandardTime() { + requestBuilder.getBackupBuilder().clearHotToStandardTime(); + updateFieldMask(Backup.HOT_TO_STANDARD_TIME_FIELD_NUMBER); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateBackupRequest that = (UpdateBackupRequest) o; + return Objects.equal( + requestBuilder.getBackupBuilder().getExpireTime(), + that.requestBuilder.getBackupBuilder().getExpireTime()) + && Objects.equal( + requestBuilder.getBackupBuilder().getHotToStandardTime(), + that.requestBuilder.getBackupBuilder().getHotToStandardTime()) + && Objects.equal(requestBuilder.getUpdateMask(), that.requestBuilder.getUpdateMask()) + && Objects.equal(clusterId, that.clusterId) + && Objects.equal(backupId, that.backupId); + } + + @Override + public int hashCode() { + return Objects.hashCode( + requestBuilder.getBackupBuilder().getExpireTime(), + requestBuilder.getBackupBuilder().getHotToStandardTime(), + requestBuilder.getUpdateMask(), + backupId); + } + + @InternalApi + public com.google.bigtable.admin.v2.UpdateBackupRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + Preconditions.checkNotNull(projectId); + Preconditions.checkNotNull(instanceId); + + requestBuilder + .getBackupBuilder() + .setName(NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId)); + return requestBuilder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java new file mode 100644 index 000000000000..ddab8e7b88c6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java @@ -0,0 +1,108 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import java.util.Map; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Bigtable instance. + * + *

Existing instances maybe updated to change their superficial appearance (ie. display name) and + * can also be upgraded from a DEVELOPMENT instance to a PRODUCTION instance. Please note that + * upgrading to a PRODUCTION instance cannot be undone. + */ +public class UpdateInstanceRequest { + private final String instanceId; + private final PartialUpdateInstanceRequest.Builder builder = + PartialUpdateInstanceRequest.newBuilder(); + + /** Builds a new request to update an existing instance with the specified id. */ + public static UpdateInstanceRequest of(@Nonnull String instanceId) { + return new UpdateInstanceRequest(instanceId); + } + + private UpdateInstanceRequest(@Nonnull String instanceId) { + Preconditions.checkNotNull(instanceId, "instanceId can't be null"); + this.instanceId = instanceId; + } + + /** Changes the display name of the instance. */ + @SuppressWarnings("WeakerAccess") + public UpdateInstanceRequest setDisplayName(@Nonnull String displayName) { + Preconditions.checkNotNull(displayName); + builder.getInstanceBuilder().setDisplayName(displayName); + updateFieldMask(Instance.DISPLAY_NAME_FIELD_NUMBER); + + return this; + } + + /** + * Upgrades the instance from a DEVELOPMENT instance to a PRODUCTION instance. This cannot be + * undone. + */ + @SuppressWarnings("WeakerAccess") + public UpdateInstanceRequest setProductionType() { + builder.getInstanceBuilder().setType(Instance.Type.PRODUCTION); + updateFieldMask(Instance.TYPE_FIELD_NUMBER); + + return this; + } + + /** + * Replaces the labels associated with the instance. + * + * @see For more + * details + */ + @SuppressWarnings("WeakerAccess") + public UpdateInstanceRequest setAllLabels(@Nonnull Map labels) { + Preconditions.checkNotNull(labels, "labels can't be null"); + builder.getInstanceBuilder().clearLabels(); + builder.getInstanceBuilder().putAllLabels(labels); + updateFieldMask(Instance.LABELS_FIELD_NUMBER); + + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = FieldMaskUtil.fromFieldNumbers(Instance.class, fieldNumber); + builder.setUpdateMask(FieldMaskUtil.union(builder.getUpdateMask(), newMask)); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public PartialUpdateInstanceRequest toProto(String projectId) { + // Empty field mask implies full resource replacement, which would clear all fields in an empty + // update request. + Preconditions.checkState( + !builder.getUpdateMask().getPathsList().isEmpty(), "Update request is empty"); + + builder.getInstanceBuilder().setName(NameUtil.formatInstanceName(projectId, instanceId)); + + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequest.java new file mode 100644 index 000000000000..6cbc55a28dd9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Cloud Bigtable {@link LogicalView}. + * + *

Sample code: + * + *

{@code
+ * LogicalView existingLogicalView = client.getLogicalView("my-table", "my-logical-view");
+ * UpdateLogicalViewRequest request =
+ *     UpdateLogicalViewRequest.of(existingLogicalView).setQuery(query);
+ * }
+ * + * @see LogicalView for more details. + */ +public final class UpdateLogicalViewRequest { + private final com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder requestBuilder; + private final String instanceId; + private final String logicalViewId; + + /** Builds a new update request using an existing logical view. */ + public static UpdateLogicalViewRequest of(@Nonnull LogicalView logicalView) { + return new UpdateLogicalViewRequest( + logicalView.getId(), + logicalView.getInstanceId(), + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.newBuilder() + .setLogicalView(logicalView.toProto())); + } + + /** Builds a new update logical view request. */ + public static UpdateLogicalViewRequest of( + @Nonnull String instanceId, @Nonnull String logicalViewId) { + return new UpdateLogicalViewRequest( + logicalViewId, + instanceId, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.newBuilder()); + } + + private UpdateLogicalViewRequest( + @Nonnull String logicalViewId, + @Nonnull String instanceId, + @Nonnull com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder requestBuilder) { + Preconditions.checkNotNull(instanceId, "instanceId must be set"); + Preconditions.checkNotNull(logicalViewId, "logicalViewId must be set"); + Preconditions.checkNotNull(requestBuilder, "proto builder must be set"); + + this.instanceId = instanceId; + this.logicalViewId = logicalViewId; + this.requestBuilder = requestBuilder; + } + + /** Changes the query of an existing logical view. */ + public UpdateLogicalViewRequest setQuery(String query) { + requestBuilder.getLogicalViewBuilder().setQuery(query); + updateFieldMask(com.google.bigtable.admin.v2.LogicalView.QUERY_FIELD_NUMBER); + return this; + } + + /** Changes the deletion protection of an existing logical view. */ + public UpdateLogicalViewRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getLogicalViewBuilder().setDeletionProtection(deletionProtection); + updateFieldMask(com.google.bigtable.admin.v2.LogicalView.DELETION_PROTECTION_FIELD_NUMBER); + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = + FieldMaskUtil.fromFieldNumbers(com.google.bigtable.admin.v2.LogicalView.class, fieldNumber); + requestBuilder.setUpdateMask(FieldMaskUtil.union(requestBuilder.getUpdateMask(), newMask)); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateLogicalViewRequest that = (UpdateLogicalViewRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(logicalViewId, that.logicalViewId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), logicalViewId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest toProto(@Nonnull String projectId) { + requestBuilder + .getLogicalViewBuilder() + .setName(NameUtil.formatLogicalViewName(projectId, instanceId, logicalViewId)); + return requestBuilder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequest.java new file mode 100644 index 000000000000..57823da81f40 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequest.java @@ -0,0 +1,120 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Cloud Bigtable {@link MaterializedView}. + * + *

Sample code: + * + *

{@code
+ * MaterializedView existingMaterializedView = client.getMaterializedView("my-table", "my-materialized-view");
+ * UpdateMaterializedViewRequest request =
+ *     UpdateMaterializedViewRequest.of(existingMaterializedView).setDeletionProtection(true);
+ * }
+ * + * @see MaterializedView for more details. + */ +public final class UpdateMaterializedViewRequest { + private final com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder requestBuilder; + private final String instanceId; + private final String materializedViewId; + + /** Builds a new update request using an existing materialized view. */ + public static UpdateMaterializedViewRequest of(@Nonnull MaterializedView materializedView) { + return new UpdateMaterializedViewRequest( + materializedView.getId(), + materializedView.getInstanceId(), + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.newBuilder() + .setMaterializedView(materializedView.toProto())); + } + + /** Builds a new update materialized view request. */ + public static UpdateMaterializedViewRequest of( + @Nonnull String instanceId, @Nonnull String materializedViewId) { + return new UpdateMaterializedViewRequest( + materializedViewId, + instanceId, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.newBuilder()); + } + + private UpdateMaterializedViewRequest( + @Nonnull String materializedViewId, + @Nonnull String instanceId, + @Nonnull com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder requestBuilder) { + Preconditions.checkNotNull(instanceId, "instanceId must be set"); + Preconditions.checkNotNull(materializedViewId, "materializedViewId must be set"); + Preconditions.checkNotNull(requestBuilder, "proto builder must be set"); + + this.instanceId = instanceId; + this.materializedViewId = materializedViewId; + this.requestBuilder = requestBuilder; + } + + /** Changes the deletion protection of an existing materialized view. */ + public UpdateMaterializedViewRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getMaterializedViewBuilder().setDeletionProtection(deletionProtection); + updateFieldMask(com.google.bigtable.admin.v2.MaterializedView.DELETION_PROTECTION_FIELD_NUMBER); + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = + FieldMaskUtil.fromFieldNumbers( + com.google.bigtable.admin.v2.MaterializedView.class, fieldNumber); + requestBuilder.setUpdateMask(FieldMaskUtil.union(requestBuilder.getUpdateMask(), newMask)); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMaterializedViewRequest that = (UpdateMaterializedViewRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(materializedViewId, that.materializedViewId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), materializedViewId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest toProto( + @Nonnull String projectId) { + requestBuilder + .getMaterializedViewBuilder() + .setName(NameUtil.formatMaterializedViewName(projectId, instanceId, materializedViewId)); + return requestBuilder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java new file mode 100644 index 000000000000..904c4d0097f4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ProtoSchema; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import javax.annotation.Nonnull; + +/** + * Parameters for updating an existing Cloud Bigtable {@link SchemaBundle}. + * + *

Sample code: + * + *

{@code
+ * SchemaBundle existingSchemaBundle = client.getSchemaBundle("my-table", "my-schema-bundle");
+ * UpdateSchemaBundleRequest request =
+ *     UpdateSchemaBundleRequest.of(existingSchemaBundle).setProtoSchemaFile("file.pb");
+ * }
+ * + * @see SchemaBundle for more details. + */ +public final class UpdateSchemaBundleRequest { + private final com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.Builder requestBuilder; + private final String tableId; + private final String schemaBundleId; + + /** Builds a new update request using an existing schema bundle. */ + public static UpdateSchemaBundleRequest of(@Nonnull SchemaBundle schemaBundle) { + return new UpdateSchemaBundleRequest( + schemaBundle.getTableId(), + schemaBundle.getId(), + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder() + .setSchemaBundle(schemaBundle.toProto())); + } + + /** Builds a new update schema bundle request. */ + public static UpdateSchemaBundleRequest of( + @Nonnull String tableId, @Nonnull String schemaBundleId) { + return new UpdateSchemaBundleRequest( + tableId, + schemaBundleId, + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder()); + } + + private UpdateSchemaBundleRequest( + @Nonnull String tableId, + @Nonnull String schemaBundleId, + @Nonnull com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.Builder requestBuilder) { + Preconditions.checkNotNull(tableId, "tableId must be set"); + Preconditions.checkNotNull(schemaBundleId, "schemaBundleId must be set"); + Preconditions.checkNotNull(requestBuilder, "proto builder must be set"); + + this.tableId = tableId; + this.schemaBundleId = schemaBundleId; + this.requestBuilder = requestBuilder; + } + + /** Sets the proto schema for this schema bundle. */ + public UpdateSchemaBundleRequest setProtoSchemaFile(@Nonnull String protoSchemaFile) + throws IOException { + Preconditions.checkNotNull(protoSchemaFile, "protoSchemaFile must be set"); + byte[] content = Files.readAllBytes(Paths.get(protoSchemaFile)); + return setProtoSchema(ByteString.copyFrom(content)); + } + + /** Sets the proto schema for this schema bundle. */ + public UpdateSchemaBundleRequest setProtoSchema(@Nonnull ByteString protoSchema) + throws IOException { + Preconditions.checkNotNull(protoSchema, "protoSchema must be set"); + requestBuilder.setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setProtoSchema(ProtoSchema.newBuilder().setProtoDescriptors(protoSchema))); + updateFieldMask(com.google.bigtable.admin.v2.SchemaBundle.PROTO_SCHEMA_FIELD_NUMBER); + return this; + } + + /** + * Configures if safety warnings should be disabled. If set, then non backwards compatible changes + * are allowed. + */ + @SuppressWarnings("WeakerAccess") + public UpdateSchemaBundleRequest setIgnoreWarnings(boolean value) { + requestBuilder.setIgnoreWarnings(value); + return this; + } + + private void updateFieldMask(int fieldNumber) { + FieldMask newMask = + FieldMaskUtil.fromFieldNumbers( + com.google.bigtable.admin.v2.SchemaBundle.class, fieldNumber); + requestBuilder.setUpdateMask(FieldMaskUtil.union(requestBuilder.getUpdateMask(), newMask)); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSchemaBundleRequest that = (UpdateSchemaBundleRequest) o; + return Objects.equal(requestBuilder.build(), that.requestBuilder.build()) + && Objects.equal(tableId, that.tableId) + && Objects.equal(schemaBundleId, that.schemaBundleId); + } + + @Override + public int hashCode() { + return Objects.hashCode(requestBuilder.build(), tableId, schemaBundleId); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public com.google.bigtable.admin.v2.UpdateSchemaBundleRequest toProto( + @Nonnull String projectId, @Nonnull String instanceId) { + requestBuilder + .getSchemaBundleBuilder() + .setName(NameUtil.formatSchemaBundleName(projectId, instanceId, tableId, schemaBundleId)); + return requestBuilder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java new file mode 100644 index 000000000000..1d6d635ac01a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java @@ -0,0 +1,175 @@ +/* + * Copyright 2023 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.cloud.bigtable.admin.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.common.base.Preconditions; +import java.util.Objects; +import org.threeten.bp.Duration; + +/** + * Wrapper for {@link com.google.bigtable.admin.v2.UpdateTableRequest} + * + *

Allows for updating table: + * + *

    + *
  • Change stream retention period. + *
+ */ +public class UpdateTableRequest { + + private final String tableId; + + private final com.google.bigtable.admin.v2.UpdateTableRequest.Builder requestBuilder = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder(); + + private final com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder + automatedPolicyBuilder = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder(); + + public static UpdateTableRequest of(String tableId) { + return new UpdateTableRequest(tableId); + } + + private UpdateTableRequest(String tableId) { + this.tableId = tableId; + } + + /** Update change stream retention period between 1 day and 7 days. */ + public UpdateTableRequest addChangeStreamRetention(Duration retention) { + Preconditions.checkNotNull(retention); + if (!retention.isZero()) { + requestBuilder + .getTableBuilder() + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(retention.getSeconds()) + .setNanos(retention.getNano()) + .build()) + .build()); + requestBuilder.getUpdateMaskBuilder().addPaths("change_stream_config.retention_period"); + } else { + requestBuilder.getTableBuilder().clearChangeStreamConfig(); + requestBuilder.getUpdateMaskBuilder().addPaths("change_stream_config"); + } + return this; + } + + /** Disable change stream for table. */ + public UpdateTableRequest disableChangeStreamRetention() { + return addChangeStreamRetention(Duration.ZERO); + } + + /** Changes the deletion protection of an existing table. */ + public UpdateTableRequest setDeletionProtection(boolean deletionProtection) { + requestBuilder.getTableBuilder().setDeletionProtection(deletionProtection); + requestBuilder.getUpdateMaskBuilder().addPaths("deletion_protection"); + return this; + } + + /** Disables table automated backup policy. */ + public UpdateTableRequest disableAutomatedBackup() { + requestBuilder.getTableBuilder().setAutomatedBackupPolicy(automatedPolicyBuilder.build()); + requestBuilder.getUpdateMaskBuilder().addPaths("automated_backup_policy"); + return this; + } + + /** Set an automated backup policy for the table. */ + public UpdateTableRequest setAutomatedBackup(Duration retentionPeriod, Duration frequency) { + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy policy = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(retentionPeriod.getSeconds()) + .setNanos(retentionPeriod.getNano()) + .build()) + .setFrequency( + com.google.protobuf.Duration.newBuilder() + .setSeconds(frequency.getSeconds()) + .setNanos(frequency.getNano()) + .build()) + .build(); + + requestBuilder.getTableBuilder().setAutomatedBackupPolicy(policy); + requestBuilder.getUpdateMaskBuilder().addPaths("automated_backup_policy"); + return this; + } + + /** Updates table automated backup policy retention period. */ + public UpdateTableRequest setAutomatedBackupRetentionPeriod(Duration retention) { + requestBuilder + .getTableBuilder() + .setAutomatedBackupPolicy( + automatedPolicyBuilder + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(retention.getSeconds()) + .setNanos(retention.getNano()) + .build()) + .build()); + requestBuilder.getUpdateMaskBuilder().addPaths("automated_backup_policy.retention_period"); + return this; + } + + /** Updates table automated backup policy frequency. */ + public UpdateTableRequest setAutomatedBackupFrequency(Duration frequency) { + requestBuilder + .getTableBuilder() + .setAutomatedBackupPolicy( + automatedPolicyBuilder + .setFrequency( + com.google.protobuf.Duration.newBuilder() + .setSeconds(frequency.getSeconds()) + .setNanos(frequency.getNano()) + .build()) + .build()); + requestBuilder.getUpdateMaskBuilder().addPaths("automated_backup_policy.frequency"); + return this; + } + + @InternalApi + public com.google.bigtable.admin.v2.UpdateTableRequest toProto( + String projectId, String instanceId) { + requestBuilder + .getTableBuilder() + .setName(NameUtil.formatTableName(projectId, instanceId, tableId)); + return requestBuilder.build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof UpdateTableRequest)) return false; + UpdateTableRequest that = (UpdateTableRequest) o; + if (requestBuilder == that.requestBuilder) { + return true; + } + if (requestBuilder == null || that.requestBuilder == null) { + return false; + } + return Objects.equals(requestBuilder.build(), that.requestBuilder.build()); + } + + @Override + public int hashCode() { + return Objects.hash(requestBuilder); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java new file mode 100644 index 000000000000..e6b8340c68ac --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java @@ -0,0 +1,25 @@ +/* + * Copyright 2019 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. + */ + +/** + * Clients for the Cloud Bigtable admin API. + * + *

These APIs allow callers to create and manage Cloud Bigtable resources. + * + * @see com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient for instance level API. + * @see com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient for table level API. + */ +package com.google.cloud.bigtable.admin.v2; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java new file mode 100644 index 000000000000..a8ccdd970418 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java @@ -0,0 +1,240 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.core.ApiAsyncFunction; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.retrying.ExponentialPollAlgorithm; +import com.google.api.gax.retrying.NonCancellableFuture; +import com.google.api.gax.retrying.ResultRetryAlgorithmWithContext; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.retrying.RetryingExecutor; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.ScheduledRetryingExecutor; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; +import javax.annotation.Nullable; + +/** + * Callable that waits until either replication or Data Boost has caught up to the point it was + * called. + * + *

This callable wraps GenerateConsistencyToken and CheckConsistency RPCs. It will generate a + * token then poll until isConsistent is true. + */ +class AwaitConsistencyCallable extends UnaryCallable { + private final UnaryCallable + generateCallable; + private final UnaryCallable checkCallable; + private final RetryingExecutor executor; + + @Nullable private final TableAdminRequestContext requestContext; + + static AwaitConsistencyCallable create( + UnaryCallable + generateCallable, + UnaryCallable checkCallable, + ClientContext clientContext, + RetrySettings pollingSettings, + @Nullable TableAdminRequestContext requestContext) { + + RetryAlgorithm retryAlgorithm = + new RetryAlgorithm<>( + new PollResultAlgorithm(), + new ExponentialPollAlgorithm(pollingSettings, clientContext.getClock())); + + RetryingExecutor retryingExecutor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + + return new AwaitConsistencyCallable( + generateCallable, checkCallable, retryingExecutor, requestContext); + } + + static AwaitConsistencyCallable create( + UnaryCallable + generateCallable, + UnaryCallable checkCallable, + ClientContext clientContext, + RetrySettings pollingSettings) { + return create(generateCallable, checkCallable, clientContext, pollingSettings, null); + } + + @VisibleForTesting + AwaitConsistencyCallable( + UnaryCallable + generateCallable, + UnaryCallable checkCallable, + RetryingExecutor executor, + @Nullable TableAdminRequestContext requestContext) { + this.generateCallable = generateCallable; + this.checkCallable = checkCallable; + this.executor = executor; + this.requestContext = requestContext; + } + + @Override + public ApiFuture futureCall( + final ConsistencyRequest consistencyRequest, final ApiCallContext apiCallContext) { + + // If the token is already provided, skip generation and poll directly. + if (consistencyRequest.getConsistencyToken() != null) { + CheckConsistencyRequest request = + requestContext == null + ? consistencyRequest.toCheckConsistencyProto(consistencyRequest.getConsistencyToken()) + : consistencyRequest.toCheckConsistencyProto( + requestContext, consistencyRequest.getConsistencyToken()); + return pollToken(request, apiCallContext); + } + + ApiFuture tokenFuture = + generateToken( + requestContext == null + ? consistencyRequest.toGenerateTokenProto() + : consistencyRequest.toGenerateTokenProto(requestContext), + apiCallContext); + + return ApiFutures.transformAsync( + tokenFuture, + new ApiAsyncFunction() { + @Override + public ApiFuture apply(GenerateConsistencyTokenResponse input) { + CheckConsistencyRequest request = + requestContext == null + ? consistencyRequest.toCheckConsistencyProto(input.getConsistencyToken()) + : consistencyRequest.toCheckConsistencyProto( + requestContext, input.getConsistencyToken()); + return pollToken(request, apiCallContext); + } + }, + MoreExecutors.directExecutor()); + } + + private ApiFuture generateToken( + GenerateConsistencyTokenRequest generateRequest, ApiCallContext context) { + return generateCallable.futureCall(generateRequest, context); + } + + private ApiFuture pollToken(CheckConsistencyRequest request, ApiCallContext context) { + AttemptCallable attemptCallable = + new AttemptCallable<>(checkCallable, request, context); + RetryingFuture retryingFuture = + executor.createFuture(attemptCallable); + attemptCallable.setExternalFuture(retryingFuture); + attemptCallable.call(); + + return ApiFutures.transform( + retryingFuture, + new ApiFunction() { + @Override + public Void apply(CheckConsistencyResponse input) { + return null; + } + }, + MoreExecutors.directExecutor()); + } + + /** A callable representing an attempt to make an RPC call. */ + private static class AttemptCallable implements Callable { + private final UnaryCallable callable; + private final RequestT request; + + private volatile RetryingFuture externalFuture; + private final ApiCallContext callContext; + + AttemptCallable( + UnaryCallable callable, RequestT request, ApiCallContext callContext) { + this.callable = callable; + this.request = request; + this.callContext = callContext; + } + + void setExternalFuture(RetryingFuture externalFuture) { + this.externalFuture = externalFuture; + } + + @Override + public ResponseT call() { + try { + // NOTE: unlike gax's AttemptCallable, this ignores rpc timeouts + externalFuture.setAttemptFuture(new NonCancellableFuture()); + if (externalFuture.isDone()) { + return null; + } + ApiFuture internalFuture = callable.futureCall(request, callContext); + externalFuture.setAttemptFuture(internalFuture); + } catch (Throwable e) { + externalFuture.setAttemptFuture(ApiFutures.immediateFailedFuture(e)); + } + + return null; + } + } + + /** + * A polling algorithm for waiting for a consistent {@link CheckConsistencyResponse}. Please note + * that this class doesn't handle retryable errors and expects the underlying callable chain to + * handle this. + */ + private static class PollResultAlgorithm + implements ResultRetryAlgorithmWithContext { + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, + CheckConsistencyResponse prevResponse, + TimedAttemptSettings prevSettings) { + return null; + } + + @Override + public TimedAttemptSettings createNextAttempt( + RetryingContext context, + Throwable previousThrowable, + CheckConsistencyResponse previousResponse, + TimedAttemptSettings previousSettings) { + return null; + } + + @Override + public boolean shouldRetry( + RetryingContext context, Throwable previousThrowable, CheckConsistencyResponse prevResponse) + throws CancellationException { + return prevResponse != null && !prevResponse.getConsistent(); + } + + @Override + public boolean shouldRetry(Throwable prevThrowable, CheckConsistencyResponse prevResponse) + throws CancellationException { + return prevResponse != null && !prevResponse.getConsistent(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java new file mode 100644 index 000000000000..53b3be73e609 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java @@ -0,0 +1,54 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.TableName; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.common.annotations.VisibleForTesting; + +/** + * Callable that waits until replication has caught up to the point it was called. + * + *

This callable wraps GenerateConsistencyToken and CheckConsistency RPCs. It will generate a + * token then poll until isConsistent is true. + */ +/** + * @deprecated Please use {@link AwaitConsistencyCallable} instead. + */ +@Deprecated +class AwaitReplicationCallable extends UnaryCallable { + private final AwaitConsistencyCallable awaitConsistencyCallable; + + static AwaitReplicationCallable create(AwaitConsistencyCallable awaitConsistencyCallable) { + + return new AwaitReplicationCallable(awaitConsistencyCallable); + } + + @Override + public ApiFuture futureCall(final TableName tableName, final ApiCallContext context) { + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(tableName.getTable()); + + return awaitConsistencyCallable.futureCall(consistencyRequest, context); + } + + @VisibleForTesting + AwaitReplicationCallable(AwaitConsistencyCallable awaitConsistencyCallable) { + this.awaitConsistencyCallable = awaitConsistencyCallable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java new file mode 100644 index 000000000000..73db53f15e72 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java @@ -0,0 +1,305 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterMetadata; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewMetadata; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.UpdateAppProfileMetadata; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the BigtableInstanceAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class BigtableInstanceAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + partialUpdateInstanceOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: partialUpdateInstanceOperationCallable()"); + } + + public UnaryCallable partialUpdateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: partialUpdateInstanceCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public OperationCallable + createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + public UnaryCallable getClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getClusterCallable()"); + } + + public UnaryCallable listClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listClustersCallable()"); + } + + public OperationCallable + updateClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterOperationCallable()"); + } + + public UnaryCallable updateClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateClusterCallable()"); + } + + public OperationCallable + partialUpdateClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: partialUpdateClusterOperationCallable()"); + } + + public UnaryCallable partialUpdateClusterCallable() { + throw new UnsupportedOperationException("Not implemented: partialUpdateClusterCallable()"); + } + + public UnaryCallable deleteClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()"); + } + + public UnaryCallable createAppProfileCallable() { + throw new UnsupportedOperationException("Not implemented: createAppProfileCallable()"); + } + + public UnaryCallable getAppProfileCallable() { + throw new UnsupportedOperationException("Not implemented: getAppProfileCallable()"); + } + + public UnaryCallable + listAppProfilesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAppProfilesPagedCallable()"); + } + + public UnaryCallable listAppProfilesCallable() { + throw new UnsupportedOperationException("Not implemented: listAppProfilesCallable()"); + } + + public OperationCallable + updateAppProfileOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateAppProfileOperationCallable()"); + } + + public UnaryCallable updateAppProfileCallable() { + throw new UnsupportedOperationException("Not implemented: updateAppProfileCallable()"); + } + + public UnaryCallable deleteAppProfileCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAppProfileCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + public UnaryCallable + listHotTabletsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHotTabletsPagedCallable()"); + } + + public UnaryCallable listHotTabletsCallable() { + throw new UnsupportedOperationException("Not implemented: listHotTabletsCallable()"); + } + + public OperationCallable + createLogicalViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createLogicalViewOperationCallable()"); + } + + public UnaryCallable createLogicalViewCallable() { + throw new UnsupportedOperationException("Not implemented: createLogicalViewCallable()"); + } + + public UnaryCallable getLogicalViewCallable() { + throw new UnsupportedOperationException("Not implemented: getLogicalViewCallable()"); + } + + public UnaryCallable + listLogicalViewsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLogicalViewsPagedCallable()"); + } + + public UnaryCallable + listLogicalViewsCallable() { + throw new UnsupportedOperationException("Not implemented: listLogicalViewsCallable()"); + } + + public OperationCallable + updateLogicalViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateLogicalViewOperationCallable()"); + } + + public UnaryCallable updateLogicalViewCallable() { + throw new UnsupportedOperationException("Not implemented: updateLogicalViewCallable()"); + } + + public UnaryCallable deleteLogicalViewCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLogicalViewCallable()"); + } + + public OperationCallable< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createMaterializedViewOperationCallable()"); + } + + public UnaryCallable createMaterializedViewCallable() { + throw new UnsupportedOperationException("Not implemented: createMaterializedViewCallable()"); + } + + public UnaryCallable getMaterializedViewCallable() { + throw new UnsupportedOperationException("Not implemented: getMaterializedViewCallable()"); + } + + public UnaryCallable + listMaterializedViewsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listMaterializedViewsPagedCallable()"); + } + + public UnaryCallable + listMaterializedViewsCallable() { + throw new UnsupportedOperationException("Not implemented: listMaterializedViewsCallable()"); + } + + public OperationCallable< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateMaterializedViewOperationCallable()"); + } + + public UnaryCallable updateMaterializedViewCallable() { + throw new UnsupportedOperationException("Not implemented: updateMaterializedViewCallable()"); + } + + public UnaryCallable deleteMaterializedViewCallable() { + throw new UnsupportedOperationException("Not implemented: deleteMaterializedViewCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java new file mode 100644 index 000000000000..e7b94144c24e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java @@ -0,0 +1,1878 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterMetadata; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewMetadata; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.HotTablet; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.UpdateAppProfileMetadata; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BigtableInstanceAdminStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigtableadmin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BigtableInstanceAdminStubSettings.Builder baseBigtableInstanceAdminSettingsBuilder =
+ *     BigtableInstanceAdminStubSettings.newBuilder();
+ * baseBigtableInstanceAdminSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         baseBigtableInstanceAdminSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * BigtableInstanceAdminStubSettings baseBigtableInstanceAdminSettings =
+ *     baseBigtableInstanceAdminSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BigtableInstanceAdminStubSettings.Builder baseBigtableInstanceAdminSettingsBuilder =
+ *     BigtableInstanceAdminStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableInstanceAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class BigtableInstanceAdminStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigtable.admin") + .add("https://www.googleapis.com/auth/bigtable.admin.cluster") + .add("https://www.googleapis.com/auth/bigtable.admin.instance") + .add("https://www.googleapis.com/auth/cloud-bigtable.admin") + .add("https://www.googleapis.com/auth/cloud-bigtable.admin.cluster") + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings + listInstancesSettings; + private final UnaryCallSettings updateInstanceSettings; + private final UnaryCallSettings + partialUpdateInstanceSettings; + private final OperationCallSettings< + PartialUpdateInstanceRequest, Instance, UpdateInstanceMetadata> + partialUpdateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + private final UnaryCallSettings getClusterSettings; + private final UnaryCallSettings listClustersSettings; + private final UnaryCallSettings updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings + partialUpdateClusterSettings; + private final OperationCallSettings< + PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> + partialUpdateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final UnaryCallSettings createAppProfileSettings; + private final UnaryCallSettings getAppProfileSettings; + private final PagedCallSettings< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings; + private final UnaryCallSettings updateAppProfileSettings; + private final OperationCallSettings + updateAppProfileOperationSettings; + private final UnaryCallSettings deleteAppProfileSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + private final PagedCallSettings< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings; + private final UnaryCallSettings createLogicalViewSettings; + private final OperationCallSettings< + CreateLogicalViewRequest, LogicalView, CreateLogicalViewMetadata> + createLogicalViewOperationSettings; + private final UnaryCallSettings getLogicalViewSettings; + private final PagedCallSettings< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings; + private final UnaryCallSettings updateLogicalViewSettings; + private final OperationCallSettings< + UpdateLogicalViewRequest, LogicalView, UpdateLogicalViewMetadata> + updateLogicalViewOperationSettings; + private final UnaryCallSettings deleteLogicalViewSettings; + private final UnaryCallSettings + createMaterializedViewSettings; + private final OperationCallSettings< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings; + private final UnaryCallSettings + getMaterializedViewSettings; + private final PagedCallSettings< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings; + private final UnaryCallSettings + updateMaterializedViewSettings; + private final OperationCallSettings< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings; + private final UnaryCallSettings + deleteMaterializedViewSettings; + + private static final PagedListDescriptor< + ListAppProfilesRequest, ListAppProfilesResponse, AppProfile> + LIST_APP_PROFILES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAppProfilesRequest injectToken( + ListAppProfilesRequest payload, String token) { + return ListAppProfilesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAppProfilesRequest injectPageSize( + ListAppProfilesRequest payload, int pageSize) { + return ListAppProfilesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAppProfilesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAppProfilesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAppProfilesResponse payload) { + return payload.getAppProfilesList(); + } + }; + + private static final PagedListDescriptor + LIST_HOT_TABLETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListHotTabletsRequest injectToken(ListHotTabletsRequest payload, String token) { + return ListHotTabletsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListHotTabletsRequest injectPageSize( + ListHotTabletsRequest payload, int pageSize) { + return ListHotTabletsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListHotTabletsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListHotTabletsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListHotTabletsResponse payload) { + return payload.getHotTabletsList(); + } + }; + + private static final PagedListDescriptor< + ListLogicalViewsRequest, ListLogicalViewsResponse, LogicalView> + LIST_LOGICAL_VIEWS_PAGE_STR_DESC = + new PagedListDescriptor< + ListLogicalViewsRequest, ListLogicalViewsResponse, LogicalView>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLogicalViewsRequest injectToken( + ListLogicalViewsRequest payload, String token) { + return ListLogicalViewsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLogicalViewsRequest injectPageSize( + ListLogicalViewsRequest payload, int pageSize) { + return ListLogicalViewsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLogicalViewsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLogicalViewsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogicalViewsResponse payload) { + return payload.getLogicalViewsList(); + } + }; + + private static final PagedListDescriptor< + ListMaterializedViewsRequest, ListMaterializedViewsResponse, MaterializedView> + LIST_MATERIALIZED_VIEWS_PAGE_STR_DESC = + new PagedListDescriptor< + ListMaterializedViewsRequest, ListMaterializedViewsResponse, MaterializedView>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMaterializedViewsRequest injectToken( + ListMaterializedViewsRequest payload, String token) { + return ListMaterializedViewsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListMaterializedViewsRequest injectPageSize( + ListMaterializedViewsRequest payload, int pageSize) { + return ListMaterializedViewsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListMaterializedViewsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMaterializedViewsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListMaterializedViewsResponse payload) { + return payload.getMaterializedViewsList(); + } + }; + + private static final PagedListResponseFactory< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + LIST_APP_PROFILES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAppProfilesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_APP_PROFILES_PAGE_STR_DESC, request, context); + return ListAppProfilesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + LIST_HOT_TABLETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHotTabletsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HOT_TABLETS_PAGE_STR_DESC, request, context); + return ListHotTabletsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + LIST_LOGICAL_VIEWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLogicalViewsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_LOGICAL_VIEWS_PAGE_STR_DESC, request, context); + return ListLogicalViewsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + LIST_MATERIALIZED_VIEWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMaterializedViewsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListMaterializedViewsRequest, ListMaterializedViewsResponse, MaterializedView> + pageContext = + PageContext.create( + callable, LIST_MATERIALIZED_VIEWS_PAGE_STR_DESC, request, context); + return ListMaterializedViewsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to listInstances. */ + public UnaryCallSettings listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to partialUpdateInstance. */ + public UnaryCallSettings + partialUpdateInstanceSettings() { + return partialUpdateInstanceSettings; + } + + /** Returns the object with the settings used for calls to partialUpdateInstance. */ + public OperationCallSettings + partialUpdateInstanceOperationSettings() { + return partialUpdateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return createClusterSettings; + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return getClusterSettings; + } + + /** Returns the object with the settings used for calls to listClusters. */ + public UnaryCallSettings listClustersSettings() { + return listClustersSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to partialUpdateCluster. */ + public UnaryCallSettings partialUpdateClusterSettings() { + return partialUpdateClusterSettings; + } + + /** Returns the object with the settings used for calls to partialUpdateCluster. */ + public OperationCallSettings + partialUpdateClusterOperationSettings() { + return partialUpdateClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the object with the settings used for calls to createAppProfile. */ + public UnaryCallSettings createAppProfileSettings() { + return createAppProfileSettings; + } + + /** Returns the object with the settings used for calls to getAppProfile. */ + public UnaryCallSettings getAppProfileSettings() { + return getAppProfileSettings; + } + + /** Returns the object with the settings used for calls to listAppProfiles. */ + public PagedCallSettings< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings() { + return listAppProfilesSettings; + } + + /** Returns the object with the settings used for calls to updateAppProfile. */ + public UnaryCallSettings updateAppProfileSettings() { + return updateAppProfileSettings; + } + + /** Returns the object with the settings used for calls to updateAppProfile. */ + public OperationCallSettings + updateAppProfileOperationSettings() { + return updateAppProfileOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAppProfile. */ + public UnaryCallSettings deleteAppProfileSettings() { + return deleteAppProfileSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the object with the settings used for calls to listHotTablets. */ + public PagedCallSettings< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings() { + return listHotTabletsSettings; + } + + /** Returns the object with the settings used for calls to createLogicalView. */ + public UnaryCallSettings createLogicalViewSettings() { + return createLogicalViewSettings; + } + + /** Returns the object with the settings used for calls to createLogicalView. */ + public OperationCallSettings + createLogicalViewOperationSettings() { + return createLogicalViewOperationSettings; + } + + /** Returns the object with the settings used for calls to getLogicalView. */ + public UnaryCallSettings getLogicalViewSettings() { + return getLogicalViewSettings; + } + + /** Returns the object with the settings used for calls to listLogicalViews. */ + public PagedCallSettings< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings() { + return listLogicalViewsSettings; + } + + /** Returns the object with the settings used for calls to updateLogicalView. */ + public UnaryCallSettings updateLogicalViewSettings() { + return updateLogicalViewSettings; + } + + /** Returns the object with the settings used for calls to updateLogicalView. */ + public OperationCallSettings + updateLogicalViewOperationSettings() { + return updateLogicalViewOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteLogicalView. */ + public UnaryCallSettings deleteLogicalViewSettings() { + return deleteLogicalViewSettings; + } + + /** Returns the object with the settings used for calls to createMaterializedView. */ + public UnaryCallSettings + createMaterializedViewSettings() { + return createMaterializedViewSettings; + } + + /** Returns the object with the settings used for calls to createMaterializedView. */ + public OperationCallSettings< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings() { + return createMaterializedViewOperationSettings; + } + + /** Returns the object with the settings used for calls to getMaterializedView. */ + public UnaryCallSettings + getMaterializedViewSettings() { + return getMaterializedViewSettings; + } + + /** Returns the object with the settings used for calls to listMaterializedViews. */ + public PagedCallSettings< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings() { + return listMaterializedViewsSettings; + } + + /** Returns the object with the settings used for calls to updateMaterializedView. */ + public UnaryCallSettings + updateMaterializedViewSettings() { + return updateMaterializedViewSettings; + } + + /** Returns the object with the settings used for calls to updateMaterializedView. */ + public OperationCallSettings< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings() { + return updateMaterializedViewOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteMaterializedView. */ + public UnaryCallSettings deleteMaterializedViewSettings() { + return deleteMaterializedViewSettings; + } + + public BigtableInstanceAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcBigtableInstanceAdminStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "bigtableadmin"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "bigtableadmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "bigtableadmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(BigtableInstanceAdminStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BigtableInstanceAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + partialUpdateInstanceSettings = settingsBuilder.partialUpdateInstanceSettings().build(); + partialUpdateInstanceOperationSettings = + settingsBuilder.partialUpdateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + listClustersSettings = settingsBuilder.listClustersSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + partialUpdateClusterSettings = settingsBuilder.partialUpdateClusterSettings().build(); + partialUpdateClusterOperationSettings = + settingsBuilder.partialUpdateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + createAppProfileSettings = settingsBuilder.createAppProfileSettings().build(); + getAppProfileSettings = settingsBuilder.getAppProfileSettings().build(); + listAppProfilesSettings = settingsBuilder.listAppProfilesSettings().build(); + updateAppProfileSettings = settingsBuilder.updateAppProfileSettings().build(); + updateAppProfileOperationSettings = settingsBuilder.updateAppProfileOperationSettings().build(); + deleteAppProfileSettings = settingsBuilder.deleteAppProfileSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + listHotTabletsSettings = settingsBuilder.listHotTabletsSettings().build(); + createLogicalViewSettings = settingsBuilder.createLogicalViewSettings().build(); + createLogicalViewOperationSettings = + settingsBuilder.createLogicalViewOperationSettings().build(); + getLogicalViewSettings = settingsBuilder.getLogicalViewSettings().build(); + listLogicalViewsSettings = settingsBuilder.listLogicalViewsSettings().build(); + updateLogicalViewSettings = settingsBuilder.updateLogicalViewSettings().build(); + updateLogicalViewOperationSettings = + settingsBuilder.updateLogicalViewOperationSettings().build(); + deleteLogicalViewSettings = settingsBuilder.deleteLogicalViewSettings().build(); + createMaterializedViewSettings = settingsBuilder.createMaterializedViewSettings().build(); + createMaterializedViewOperationSettings = + settingsBuilder.createMaterializedViewOperationSettings().build(); + getMaterializedViewSettings = settingsBuilder.getMaterializedViewSettings().build(); + listMaterializedViewsSettings = settingsBuilder.listMaterializedViewsSettings().build(); + updateMaterializedViewSettings = settingsBuilder.updateMaterializedViewSettings().build(); + updateMaterializedViewOperationSettings = + settingsBuilder.updateMaterializedViewOperationSettings().build(); + deleteMaterializedViewSettings = settingsBuilder.deleteMaterializedViewSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-bigtable") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for BigtableInstanceAdminStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder< + CreateInstanceRequest, Instance, CreateInstanceMetadata> + createInstanceOperationSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + listInstancesSettings; + private final UnaryCallSettings.Builder updateInstanceSettings; + private final UnaryCallSettings.Builder + partialUpdateInstanceSettings; + private final OperationCallSettings.Builder< + PartialUpdateInstanceRequest, Instance, UpdateInstanceMetadata> + partialUpdateInstanceOperationSettings; + private final UnaryCallSettings.Builder deleteInstanceSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder< + CreateClusterRequest, Cluster, CreateClusterMetadata> + createClusterOperationSettings; + private final UnaryCallSettings.Builder getClusterSettings; + private final UnaryCallSettings.Builder + listClustersSettings; + private final UnaryCallSettings.Builder updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder + partialUpdateClusterSettings; + private final OperationCallSettings.Builder< + PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> + partialUpdateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final UnaryCallSettings.Builder + createAppProfileSettings; + private final UnaryCallSettings.Builder getAppProfileSettings; + private final PagedCallSettings.Builder< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings; + private final UnaryCallSettings.Builder + updateAppProfileSettings; + private final OperationCallSettings.Builder< + UpdateAppProfileRequest, AppProfile, UpdateAppProfileMetadata> + updateAppProfileOperationSettings; + private final UnaryCallSettings.Builder + deleteAppProfileSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private final PagedCallSettings.Builder< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings; + private final UnaryCallSettings.Builder + createLogicalViewSettings; + private final OperationCallSettings.Builder< + CreateLogicalViewRequest, LogicalView, CreateLogicalViewMetadata> + createLogicalViewOperationSettings; + private final UnaryCallSettings.Builder + getLogicalViewSettings; + private final PagedCallSettings.Builder< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings; + private final UnaryCallSettings.Builder + updateLogicalViewSettings; + private final OperationCallSettings.Builder< + UpdateLogicalViewRequest, LogicalView, UpdateLogicalViewMetadata> + updateLogicalViewOperationSettings; + private final UnaryCallSettings.Builder + deleteLogicalViewSettings; + private final UnaryCallSettings.Builder + createMaterializedViewSettings; + private final OperationCallSettings.Builder< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings; + private final UnaryCallSettings.Builder + getMaterializedViewSettings; + private final PagedCallSettings.Builder< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings; + private final UnaryCallSettings.Builder + updateMaterializedViewSettings; + private final OperationCallSettings.Builder< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings; + private final UnaryCallSettings.Builder + deleteMaterializedViewSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_5_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_6_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_7_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(300000L)) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build(); + definitions.put("no_retry_5_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_6_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_7_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listInstancesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + partialUpdateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + partialUpdateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listClustersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + partialUpdateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + partialUpdateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAppProfilesSettings = PagedCallSettings.newBuilder(LIST_APP_PROFILES_PAGE_STR_FACT); + updateAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAppProfileOperationSettings = OperationCallSettings.newBuilder(); + deleteAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listHotTabletsSettings = PagedCallSettings.newBuilder(LIST_HOT_TABLETS_PAGE_STR_FACT); + createLogicalViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createLogicalViewOperationSettings = OperationCallSettings.newBuilder(); + getLogicalViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLogicalViewsSettings = PagedCallSettings.newBuilder(LIST_LOGICAL_VIEWS_PAGE_STR_FACT); + updateLogicalViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateLogicalViewOperationSettings = OperationCallSettings.newBuilder(); + deleteLogicalViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createMaterializedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createMaterializedViewOperationSettings = OperationCallSettings.newBuilder(); + getMaterializedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listMaterializedViewsSettings = + PagedCallSettings.newBuilder(LIST_MATERIALIZED_VIEWS_PAGE_STR_FACT); + updateMaterializedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateMaterializedViewOperationSettings = OperationCallSettings.newBuilder(); + deleteMaterializedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createInstanceSettings, + getInstanceSettings, + listInstancesSettings, + updateInstanceSettings, + partialUpdateInstanceSettings, + deleteInstanceSettings, + createClusterSettings, + getClusterSettings, + listClustersSettings, + updateClusterSettings, + partialUpdateClusterSettings, + deleteClusterSettings, + createAppProfileSettings, + getAppProfileSettings, + listAppProfilesSettings, + updateAppProfileSettings, + deleteAppProfileSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + listHotTabletsSettings, + createLogicalViewSettings, + getLogicalViewSettings, + listLogicalViewsSettings, + updateLogicalViewSettings, + deleteLogicalViewSettings, + createMaterializedViewSettings, + getMaterializedViewSettings, + listMaterializedViewsSettings, + updateMaterializedViewSettings, + deleteMaterializedViewSettings); + initDefaults(this); + } + + protected Builder(BigtableInstanceAdminStubSettings settings) { + super(settings); + + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + partialUpdateInstanceSettings = settings.partialUpdateInstanceSettings.toBuilder(); + partialUpdateInstanceOperationSettings = + settings.partialUpdateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + listClustersSettings = settings.listClustersSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + partialUpdateClusterSettings = settings.partialUpdateClusterSettings.toBuilder(); + partialUpdateClusterOperationSettings = + settings.partialUpdateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + createAppProfileSettings = settings.createAppProfileSettings.toBuilder(); + getAppProfileSettings = settings.getAppProfileSettings.toBuilder(); + listAppProfilesSettings = settings.listAppProfilesSettings.toBuilder(); + updateAppProfileSettings = settings.updateAppProfileSettings.toBuilder(); + updateAppProfileOperationSettings = settings.updateAppProfileOperationSettings.toBuilder(); + deleteAppProfileSettings = settings.deleteAppProfileSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + listHotTabletsSettings = settings.listHotTabletsSettings.toBuilder(); + createLogicalViewSettings = settings.createLogicalViewSettings.toBuilder(); + createLogicalViewOperationSettings = settings.createLogicalViewOperationSettings.toBuilder(); + getLogicalViewSettings = settings.getLogicalViewSettings.toBuilder(); + listLogicalViewsSettings = settings.listLogicalViewsSettings.toBuilder(); + updateLogicalViewSettings = settings.updateLogicalViewSettings.toBuilder(); + updateLogicalViewOperationSettings = settings.updateLogicalViewOperationSettings.toBuilder(); + deleteLogicalViewSettings = settings.deleteLogicalViewSettings.toBuilder(); + createMaterializedViewSettings = settings.createMaterializedViewSettings.toBuilder(); + createMaterializedViewOperationSettings = + settings.createMaterializedViewOperationSettings.toBuilder(); + getMaterializedViewSettings = settings.getMaterializedViewSettings.toBuilder(); + listMaterializedViewsSettings = settings.listMaterializedViewsSettings.toBuilder(); + updateMaterializedViewSettings = settings.updateMaterializedViewSettings.toBuilder(); + updateMaterializedViewOperationSettings = + settings.updateMaterializedViewOperationSettings.toBuilder(); + deleteMaterializedViewSettings = settings.deleteMaterializedViewSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createInstanceSettings, + getInstanceSettings, + listInstancesSettings, + updateInstanceSettings, + partialUpdateInstanceSettings, + deleteInstanceSettings, + createClusterSettings, + getClusterSettings, + listClustersSettings, + updateClusterSettings, + partialUpdateClusterSettings, + deleteClusterSettings, + createAppProfileSettings, + getAppProfileSettings, + listAppProfilesSettings, + updateAppProfileSettings, + deleteAppProfileSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + listHotTabletsSettings, + createLogicalViewSettings, + getLogicalViewSettings, + listLogicalViewsSettings, + updateLogicalViewSettings, + deleteLogicalViewSettings, + createMaterializedViewSettings, + getMaterializedViewSettings, + listMaterializedViewsSettings, + updateMaterializedViewSettings, + deleteMaterializedViewSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .partialUpdateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .listClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .partialUpdateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .createAppProfileSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .getAppProfileSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .listAppProfilesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .updateAppProfileSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .deleteAppProfileSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .listHotTabletsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + + builder + .createLogicalViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLogicalViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLogicalViewsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateLogicalViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteLogicalViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createMaterializedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getMaterializedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listMaterializedViewsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateMaterializedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteMaterializedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateInstanceMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .partialUpdateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateInstanceMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateClusterMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(21600000L)) + .build())); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateClusterMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .partialUpdateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + PartialUpdateClusterMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .updateAppProfileOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AppProfile.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateAppProfileMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .createLogicalViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(LogicalView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateLogicalViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateLogicalViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(LogicalView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UpdateLogicalViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .createMaterializedViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(MaterializedView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateMaterializedViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateMaterializedViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(MaterializedView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UpdateMaterializedViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public UnaryCallSettings.Builder + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to partialUpdateInstance. */ + public UnaryCallSettings.Builder + partialUpdateInstanceSettings() { + return partialUpdateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to partialUpdateInstance. */ + public OperationCallSettings.Builder< + PartialUpdateInstanceRequest, Instance, UpdateInstanceMetadata> + partialUpdateInstanceOperationSettings() { + return partialUpdateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public UnaryCallSettings.Builder createClusterSettings() { + return createClusterSettings; + } + + /** Returns the builder for the settings used for calls to createCluster. */ + public OperationCallSettings.Builder + createClusterOperationSettings() { + return createClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to getCluster. */ + public UnaryCallSettings.Builder getClusterSettings() { + return getClusterSettings; + } + + /** Returns the builder for the settings used for calls to listClusters. */ + public UnaryCallSettings.Builder + listClustersSettings() { + return listClustersSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public UnaryCallSettings.Builder updateClusterSettings() { + return updateClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateCluster. */ + public OperationCallSettings.Builder + updateClusterOperationSettings() { + return updateClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to partialUpdateCluster. */ + public UnaryCallSettings.Builder + partialUpdateClusterSettings() { + return partialUpdateClusterSettings; + } + + /** Returns the builder for the settings used for calls to partialUpdateCluster. */ + public OperationCallSettings.Builder< + PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> + partialUpdateClusterOperationSettings() { + return partialUpdateClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCluster. */ + public UnaryCallSettings.Builder deleteClusterSettings() { + return deleteClusterSettings; + } + + /** Returns the builder for the settings used for calls to createAppProfile. */ + public UnaryCallSettings.Builder + createAppProfileSettings() { + return createAppProfileSettings; + } + + /** Returns the builder for the settings used for calls to getAppProfile. */ + public UnaryCallSettings.Builder getAppProfileSettings() { + return getAppProfileSettings; + } + + /** Returns the builder for the settings used for calls to listAppProfiles. */ + public PagedCallSettings.Builder< + ListAppProfilesRequest, ListAppProfilesResponse, ListAppProfilesPagedResponse> + listAppProfilesSettings() { + return listAppProfilesSettings; + } + + /** Returns the builder for the settings used for calls to updateAppProfile. */ + public UnaryCallSettings.Builder + updateAppProfileSettings() { + return updateAppProfileSettings; + } + + /** Returns the builder for the settings used for calls to updateAppProfile. */ + public OperationCallSettings.Builder< + UpdateAppProfileRequest, AppProfile, UpdateAppProfileMetadata> + updateAppProfileOperationSettings() { + return updateAppProfileOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAppProfile. */ + public UnaryCallSettings.Builder deleteAppProfileSettings() { + return deleteAppProfileSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to listHotTablets. */ + public PagedCallSettings.Builder< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings() { + return listHotTabletsSettings; + } + + /** Returns the builder for the settings used for calls to createLogicalView. */ + public UnaryCallSettings.Builder + createLogicalViewSettings() { + return createLogicalViewSettings; + } + + /** Returns the builder for the settings used for calls to createLogicalView. */ + public OperationCallSettings.Builder< + CreateLogicalViewRequest, LogicalView, CreateLogicalViewMetadata> + createLogicalViewOperationSettings() { + return createLogicalViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to getLogicalView. */ + public UnaryCallSettings.Builder getLogicalViewSettings() { + return getLogicalViewSettings; + } + + /** Returns the builder for the settings used for calls to listLogicalViews. */ + public PagedCallSettings.Builder< + ListLogicalViewsRequest, ListLogicalViewsResponse, ListLogicalViewsPagedResponse> + listLogicalViewsSettings() { + return listLogicalViewsSettings; + } + + /** Returns the builder for the settings used for calls to updateLogicalView. */ + public UnaryCallSettings.Builder + updateLogicalViewSettings() { + return updateLogicalViewSettings; + } + + /** Returns the builder for the settings used for calls to updateLogicalView. */ + public OperationCallSettings.Builder< + UpdateLogicalViewRequest, LogicalView, UpdateLogicalViewMetadata> + updateLogicalViewOperationSettings() { + return updateLogicalViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteLogicalView. */ + public UnaryCallSettings.Builder deleteLogicalViewSettings() { + return deleteLogicalViewSettings; + } + + /** Returns the builder for the settings used for calls to createMaterializedView. */ + public UnaryCallSettings.Builder + createMaterializedViewSettings() { + return createMaterializedViewSettings; + } + + /** Returns the builder for the settings used for calls to createMaterializedView. */ + public OperationCallSettings.Builder< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationSettings() { + return createMaterializedViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to getMaterializedView. */ + public UnaryCallSettings.Builder + getMaterializedViewSettings() { + return getMaterializedViewSettings; + } + + /** Returns the builder for the settings used for calls to listMaterializedViews. */ + public PagedCallSettings.Builder< + ListMaterializedViewsRequest, + ListMaterializedViewsResponse, + ListMaterializedViewsPagedResponse> + listMaterializedViewsSettings() { + return listMaterializedViewsSettings; + } + + /** Returns the builder for the settings used for calls to updateMaterializedView. */ + public UnaryCallSettings.Builder + updateMaterializedViewSettings() { + return updateMaterializedViewSettings; + } + + /** Returns the builder for the settings used for calls to updateMaterializedView. */ + public OperationCallSettings.Builder< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationSettings() { + return updateMaterializedViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteMaterializedView. */ + public UnaryCallSettings.Builder + deleteMaterializedViewSettings() { + return deleteMaterializedViewSettings; + } + + @Override + public BigtableInstanceAdminStubSettings build() throws IOException { + return new BigtableInstanceAdminStubSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java new file mode 100644 index 000000000000..db34b67438e5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java @@ -0,0 +1,339 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotTableMetadata; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.UndeleteTableMetadata; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the BigtableTableAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class BigtableTableAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createTableCallable() { + throw new UnsupportedOperationException("Not implemented: createTableCallable()"); + } + + public OperationCallable + createTableFromSnapshotOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createTableFromSnapshotOperationCallable()"); + } + + public UnaryCallable + createTableFromSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: createTableFromSnapshotCallable()"); + } + + public UnaryCallable listTablesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTablesPagedCallable()"); + } + + public UnaryCallable listTablesCallable() { + throw new UnsupportedOperationException("Not implemented: listTablesCallable()"); + } + + public UnaryCallable getTableCallable() { + throw new UnsupportedOperationException("Not implemented: getTableCallable()"); + } + + public OperationCallable + updateTableOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateTableOperationCallable()"); + } + + public UnaryCallable updateTableCallable() { + throw new UnsupportedOperationException("Not implemented: updateTableCallable()"); + } + + public UnaryCallable deleteTableCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTableCallable()"); + } + + public OperationCallable + undeleteTableOperationCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteTableOperationCallable()"); + } + + public UnaryCallable undeleteTableCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteTableCallable()"); + } + + public OperationCallable< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createAuthorizedViewOperationCallable()"); + } + + public UnaryCallable createAuthorizedViewCallable() { + throw new UnsupportedOperationException("Not implemented: createAuthorizedViewCallable()"); + } + + public UnaryCallable + listAuthorizedViewsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAuthorizedViewsPagedCallable()"); + } + + public UnaryCallable + listAuthorizedViewsCallable() { + throw new UnsupportedOperationException("Not implemented: listAuthorizedViewsCallable()"); + } + + public UnaryCallable getAuthorizedViewCallable() { + throw new UnsupportedOperationException("Not implemented: getAuthorizedViewCallable()"); + } + + public OperationCallable< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAuthorizedViewOperationCallable()"); + } + + public UnaryCallable updateAuthorizedViewCallable() { + throw new UnsupportedOperationException("Not implemented: updateAuthorizedViewCallable()"); + } + + public UnaryCallable deleteAuthorizedViewCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAuthorizedViewCallable()"); + } + + public UnaryCallable modifyColumnFamiliesCallable() { + throw new UnsupportedOperationException("Not implemented: modifyColumnFamiliesCallable()"); + } + + public UnaryCallable dropRowRangeCallable() { + throw new UnsupportedOperationException("Not implemented: dropRowRangeCallable()"); + } + + public UnaryCallable + generateConsistencyTokenCallable() { + throw new UnsupportedOperationException("Not implemented: generateConsistencyTokenCallable()"); + } + + public UnaryCallable + checkConsistencyCallable() { + throw new UnsupportedOperationException("Not implemented: checkConsistencyCallable()"); + } + + public OperationCallable + snapshotTableOperationCallable() { + throw new UnsupportedOperationException("Not implemented: snapshotTableOperationCallable()"); + } + + public UnaryCallable snapshotTableCallable() { + throw new UnsupportedOperationException("Not implemented: snapshotTableCallable()"); + } + + public UnaryCallable getSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); + } + + public UnaryCallable + listSnapshotsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsPagedCallable()"); + } + + public UnaryCallable listSnapshotsCallable() { + throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); + } + + public UnaryCallable deleteSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSnapshotCallable()"); + } + + public OperationCallable + createBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()"); + } + + public UnaryCallable createBackupCallable() { + throw new UnsupportedOperationException("Not implemented: createBackupCallable()"); + } + + public UnaryCallable getBackupCallable() { + throw new UnsupportedOperationException("Not implemented: getBackupCallable()"); + } + + public UnaryCallable updateBackupCallable() { + throw new UnsupportedOperationException("Not implemented: updateBackupCallable()"); + } + + public UnaryCallable deleteBackupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()"); + } + + public UnaryCallable listBackupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()"); + } + + public UnaryCallable listBackupsCallable() { + throw new UnsupportedOperationException("Not implemented: listBackupsCallable()"); + } + + public OperationCallable + restoreTableOperationCallable() { + throw new UnsupportedOperationException("Not implemented: restoreTableOperationCallable()"); + } + + public UnaryCallable restoreTableCallable() { + throw new UnsupportedOperationException("Not implemented: restoreTableCallable()"); + } + + public OperationCallable + copyBackupOperationCallable() { + throw new UnsupportedOperationException("Not implemented: copyBackupOperationCallable()"); + } + + public UnaryCallable copyBackupCallable() { + throw new UnsupportedOperationException("Not implemented: copyBackupCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + public OperationCallable + createSchemaBundleOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createSchemaBundleOperationCallable()"); + } + + public UnaryCallable createSchemaBundleCallable() { + throw new UnsupportedOperationException("Not implemented: createSchemaBundleCallable()"); + } + + public OperationCallable + updateSchemaBundleOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateSchemaBundleOperationCallable()"); + } + + public UnaryCallable updateSchemaBundleCallable() { + throw new UnsupportedOperationException("Not implemented: updateSchemaBundleCallable()"); + } + + public UnaryCallable getSchemaBundleCallable() { + throw new UnsupportedOperationException("Not implemented: getSchemaBundleCallable()"); + } + + public UnaryCallable + listSchemaBundlesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaBundlesPagedCallable()"); + } + + public UnaryCallable + listSchemaBundlesCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaBundlesCallable()"); + } + + public UnaryCallable deleteSchemaBundleCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSchemaBundleCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java new file mode 100644 index 000000000000..15eafd4a65d9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java @@ -0,0 +1,2074 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotTableMetadata; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.UndeleteTableMetadata; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link BigtableTableAdminStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigtableadmin.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTable: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BigtableTableAdminStubSettings.Builder baseBigtableTableAdminSettingsBuilder =
+ *     BigtableTableAdminStubSettings.newBuilder();
+ * baseBigtableTableAdminSettingsBuilder
+ *     .createTableSettings()
+ *     .setRetrySettings(
+ *         baseBigtableTableAdminSettingsBuilder
+ *             .createTableSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * BigtableTableAdminStubSettings baseBigtableTableAdminSettings =
+ *     baseBigtableTableAdminSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createTableFromSnapshot: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * BigtableTableAdminStubSettings.Builder baseBigtableTableAdminSettingsBuilder =
+ *     BigtableTableAdminStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableTableAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class BigtableTableAdminStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigtable.admin") + .add("https://www.googleapis.com/auth/bigtable.admin.table") + .add("https://www.googleapis.com/auth/cloud-bigtable.admin") + .add("https://www.googleapis.com/auth/cloud-bigtable.admin.table") + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final UnaryCallSettings createTableSettings; + private final UnaryCallSettings + createTableFromSnapshotSettings; + private final OperationCallSettings< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings; + private final PagedCallSettings + listTablesSettings; + private final UnaryCallSettings getTableSettings; + private final UnaryCallSettings updateTableSettings; + private final OperationCallSettings + updateTableOperationSettings; + private final UnaryCallSettings deleteTableSettings; + private final UnaryCallSettings undeleteTableSettings; + private final OperationCallSettings + undeleteTableOperationSettings; + private final UnaryCallSettings + createAuthorizedViewSettings; + private final OperationCallSettings< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings; + private final PagedCallSettings< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings; + private final UnaryCallSettings + getAuthorizedViewSettings; + private final UnaryCallSettings + updateAuthorizedViewSettings; + private final OperationCallSettings< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings; + private final UnaryCallSettings deleteAuthorizedViewSettings; + private final UnaryCallSettings modifyColumnFamiliesSettings; + private final UnaryCallSettings dropRowRangeSettings; + private final UnaryCallSettings + generateConsistencyTokenSettings; + private final UnaryCallSettings + checkConsistencySettings; + private final UnaryCallSettings snapshotTableSettings; + private final OperationCallSettings + snapshotTableOperationSettings; + private final UnaryCallSettings getSnapshotSettings; + private final PagedCallSettings< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings; + private final UnaryCallSettings deleteSnapshotSettings; + private final UnaryCallSettings createBackupSettings; + private final OperationCallSettings + createBackupOperationSettings; + private final UnaryCallSettings getBackupSettings; + private final UnaryCallSettings updateBackupSettings; + private final UnaryCallSettings deleteBackupSettings; + private final PagedCallSettings + listBackupsSettings; + private final UnaryCallSettings restoreTableSettings; + private final OperationCallSettings + restoreTableOperationSettings; + private final UnaryCallSettings copyBackupSettings; + private final OperationCallSettings + copyBackupOperationSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + private final UnaryCallSettings createSchemaBundleSettings; + private final OperationCallSettings< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationSettings; + private final UnaryCallSettings updateSchemaBundleSettings; + private final OperationCallSettings< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationSettings; + private final UnaryCallSettings getSchemaBundleSettings; + private final PagedCallSettings< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings; + private final UnaryCallSettings deleteSchemaBundleSettings; + + private static final PagedListDescriptor + LIST_TABLES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTablesRequest injectToken(ListTablesRequest payload, String token) { + return ListTablesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTablesRequest injectPageSize(ListTablesRequest payload, int pageSize) { + return ListTablesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTablesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTablesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable
extractResources(ListTablesResponse payload) { + return payload.getTablesList(); + } + }; + + private static final PagedListDescriptor< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, AuthorizedView> + LIST_AUTHORIZED_VIEWS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, AuthorizedView>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAuthorizedViewsRequest injectToken( + ListAuthorizedViewsRequest payload, String token) { + return ListAuthorizedViewsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAuthorizedViewsRequest injectPageSize( + ListAuthorizedViewsRequest payload, int pageSize) { + return ListAuthorizedViewsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAuthorizedViewsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAuthorizedViewsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAuthorizedViewsResponse payload) { + return payload.getAuthorizedViewsList(); + } + }; + + private static final PagedListDescriptor + LIST_SNAPSHOTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSnapshotsRequest injectToken(ListSnapshotsRequest payload, String token) { + return ListSnapshotsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSnapshotsRequest injectPageSize(ListSnapshotsRequest payload, int pageSize) { + return ListSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSnapshotsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSnapshotsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSnapshotsResponse payload) { + return payload.getSnapshotsList(); + } + }; + + private static final PagedListDescriptor + LIST_BACKUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBackupsRequest injectToken(ListBackupsRequest payload, String token) { + return ListBackupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBackupsRequest injectPageSize(ListBackupsRequest payload, int pageSize) { + return ListBackupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBackupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBackupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBackupsResponse payload) { + return payload.getBackupsList(); + } + }; + + private static final PagedListDescriptor< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, SchemaBundle> + LIST_SCHEMA_BUNDLES_PAGE_STR_DESC = + new PagedListDescriptor< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, SchemaBundle>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSchemaBundlesRequest injectToken( + ListSchemaBundlesRequest payload, String token) { + return ListSchemaBundlesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSchemaBundlesRequest injectPageSize( + ListSchemaBundlesRequest payload, int pageSize) { + return ListSchemaBundlesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSchemaBundlesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSchemaBundlesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSchemaBundlesResponse payload) { + return payload.getSchemaBundlesList(); + } + }; + + private static final PagedListResponseFactory< + ListTablesRequest, ListTablesResponse, ListTablesPagedResponse> + LIST_TABLES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTablesRequest, ListTablesResponse, ListTablesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTablesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TABLES_PAGE_STR_DESC, request, context); + return ListTablesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, ListAuthorizedViewsPagedResponse> + LIST_AUTHORIZED_VIEWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + ListAuthorizedViewsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAuthorizedViewsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_AUTHORIZED_VIEWS_PAGE_STR_DESC, request, context); + return ListAuthorizedViewsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + LIST_SNAPSHOTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSnapshotsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context); + return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + LIST_BACKUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBackupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BACKUPS_PAGE_STR_DESC, request, context); + return ListBackupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + LIST_SCHEMA_BUNDLES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSchemaBundlesRequest, + ListSchemaBundlesResponse, + ListSchemaBundlesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSchemaBundlesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SCHEMA_BUNDLES_PAGE_STR_DESC, request, context); + return ListSchemaBundlesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createTable. */ + public UnaryCallSettings createTableSettings() { + return createTableSettings; + } + + /** Returns the object with the settings used for calls to createTableFromSnapshot. */ + public UnaryCallSettings + createTableFromSnapshotSettings() { + return createTableFromSnapshotSettings; + } + + /** Returns the object with the settings used for calls to createTableFromSnapshot. */ + public OperationCallSettings< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings() { + return createTableFromSnapshotOperationSettings; + } + + /** Returns the object with the settings used for calls to listTables. */ + public PagedCallSettings + listTablesSettings() { + return listTablesSettings; + } + + /** Returns the object with the settings used for calls to getTable. */ + public UnaryCallSettings getTableSettings() { + return getTableSettings; + } + + /** Returns the object with the settings used for calls to updateTable. */ + public UnaryCallSettings updateTableSettings() { + return updateTableSettings; + } + + /** Returns the object with the settings used for calls to updateTable. */ + public OperationCallSettings + updateTableOperationSettings() { + return updateTableOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteTable. */ + public UnaryCallSettings deleteTableSettings() { + return deleteTableSettings; + } + + /** Returns the object with the settings used for calls to undeleteTable. */ + public UnaryCallSettings undeleteTableSettings() { + return undeleteTableSettings; + } + + /** Returns the object with the settings used for calls to undeleteTable. */ + public OperationCallSettings + undeleteTableOperationSettings() { + return undeleteTableOperationSettings; + } + + /** Returns the object with the settings used for calls to createAuthorizedView. */ + public UnaryCallSettings createAuthorizedViewSettings() { + return createAuthorizedViewSettings; + } + + /** Returns the object with the settings used for calls to createAuthorizedView. */ + public OperationCallSettings< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings() { + return createAuthorizedViewOperationSettings; + } + + /** Returns the object with the settings used for calls to listAuthorizedViews. */ + public PagedCallSettings< + ListAuthorizedViewsRequest, ListAuthorizedViewsResponse, ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings() { + return listAuthorizedViewsSettings; + } + + /** Returns the object with the settings used for calls to getAuthorizedView. */ + public UnaryCallSettings getAuthorizedViewSettings() { + return getAuthorizedViewSettings; + } + + /** Returns the object with the settings used for calls to updateAuthorizedView. */ + public UnaryCallSettings updateAuthorizedViewSettings() { + return updateAuthorizedViewSettings; + } + + /** Returns the object with the settings used for calls to updateAuthorizedView. */ + public OperationCallSettings< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings() { + return updateAuthorizedViewOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAuthorizedView. */ + public UnaryCallSettings deleteAuthorizedViewSettings() { + return deleteAuthorizedViewSettings; + } + + /** Returns the object with the settings used for calls to modifyColumnFamilies. */ + public UnaryCallSettings modifyColumnFamiliesSettings() { + return modifyColumnFamiliesSettings; + } + + /** Returns the object with the settings used for calls to dropRowRange. */ + public UnaryCallSettings dropRowRangeSettings() { + return dropRowRangeSettings; + } + + /** Returns the object with the settings used for calls to generateConsistencyToken. */ + public UnaryCallSettings + generateConsistencyTokenSettings() { + return generateConsistencyTokenSettings; + } + + /** Returns the object with the settings used for calls to checkConsistency. */ + public UnaryCallSettings + checkConsistencySettings() { + return checkConsistencySettings; + } + + /** Returns the object with the settings used for calls to snapshotTable. */ + public UnaryCallSettings snapshotTableSettings() { + return snapshotTableSettings; + } + + /** Returns the object with the settings used for calls to snapshotTable. */ + public OperationCallSettings + snapshotTableOperationSettings() { + return snapshotTableOperationSettings; + } + + /** Returns the object with the settings used for calls to getSnapshot. */ + public UnaryCallSettings getSnapshotSettings() { + return getSnapshotSettings; + } + + /** Returns the object with the settings used for calls to listSnapshots. */ + public PagedCallSettings + listSnapshotsSettings() { + return listSnapshotsSettings; + } + + /** Returns the object with the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public UnaryCallSettings createBackupSettings() { + return createBackupSettings; + } + + /** Returns the object with the settings used for calls to createBackup. */ + public OperationCallSettings + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to getBackup. */ + public UnaryCallSettings getBackupSettings() { + return getBackupSettings; + } + + /** Returns the object with the settings used for calls to updateBackup. */ + public UnaryCallSettings updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the object with the settings used for calls to deleteBackup. */ + public UnaryCallSettings deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the object with the settings used for calls to listBackups. */ + public PagedCallSettings + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the object with the settings used for calls to restoreTable. */ + public UnaryCallSettings restoreTableSettings() { + return restoreTableSettings; + } + + /** Returns the object with the settings used for calls to restoreTable. */ + public OperationCallSettings + restoreTableOperationSettings() { + return restoreTableOperationSettings; + } + + /** Returns the object with the settings used for calls to copyBackup. */ + public UnaryCallSettings copyBackupSettings() { + return copyBackupSettings; + } + + /** Returns the object with the settings used for calls to copyBackup. */ + public OperationCallSettings + copyBackupOperationSettings() { + return copyBackupOperationSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the object with the settings used for calls to createSchemaBundle. */ + public UnaryCallSettings createSchemaBundleSettings() { + return createSchemaBundleSettings; + } + + /** Returns the object with the settings used for calls to createSchemaBundle. */ + public OperationCallSettings + createSchemaBundleOperationSettings() { + return createSchemaBundleOperationSettings; + } + + /** Returns the object with the settings used for calls to updateSchemaBundle. */ + public UnaryCallSettings updateSchemaBundleSettings() { + return updateSchemaBundleSettings; + } + + /** Returns the object with the settings used for calls to updateSchemaBundle. */ + public OperationCallSettings + updateSchemaBundleOperationSettings() { + return updateSchemaBundleOperationSettings; + } + + /** Returns the object with the settings used for calls to getSchemaBundle. */ + public UnaryCallSettings getSchemaBundleSettings() { + return getSchemaBundleSettings; + } + + /** Returns the object with the settings used for calls to listSchemaBundles. */ + public PagedCallSettings< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings() { + return listSchemaBundlesSettings; + } + + /** Returns the object with the settings used for calls to deleteSchemaBundle. */ + public UnaryCallSettings deleteSchemaBundleSettings() { + return deleteSchemaBundleSettings; + } + + public BigtableTableAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcBigtableTableAdminStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "bigtableadmin"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "bigtableadmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "bigtableadmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(BigtableTableAdminStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BigtableTableAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createTableSettings = settingsBuilder.createTableSettings().build(); + createTableFromSnapshotSettings = settingsBuilder.createTableFromSnapshotSettings().build(); + createTableFromSnapshotOperationSettings = + settingsBuilder.createTableFromSnapshotOperationSettings().build(); + listTablesSettings = settingsBuilder.listTablesSettings().build(); + getTableSettings = settingsBuilder.getTableSettings().build(); + updateTableSettings = settingsBuilder.updateTableSettings().build(); + updateTableOperationSettings = settingsBuilder.updateTableOperationSettings().build(); + deleteTableSettings = settingsBuilder.deleteTableSettings().build(); + undeleteTableSettings = settingsBuilder.undeleteTableSettings().build(); + undeleteTableOperationSettings = settingsBuilder.undeleteTableOperationSettings().build(); + createAuthorizedViewSettings = settingsBuilder.createAuthorizedViewSettings().build(); + createAuthorizedViewOperationSettings = + settingsBuilder.createAuthorizedViewOperationSettings().build(); + listAuthorizedViewsSettings = settingsBuilder.listAuthorizedViewsSettings().build(); + getAuthorizedViewSettings = settingsBuilder.getAuthorizedViewSettings().build(); + updateAuthorizedViewSettings = settingsBuilder.updateAuthorizedViewSettings().build(); + updateAuthorizedViewOperationSettings = + settingsBuilder.updateAuthorizedViewOperationSettings().build(); + deleteAuthorizedViewSettings = settingsBuilder.deleteAuthorizedViewSettings().build(); + modifyColumnFamiliesSettings = settingsBuilder.modifyColumnFamiliesSettings().build(); + dropRowRangeSettings = settingsBuilder.dropRowRangeSettings().build(); + generateConsistencyTokenSettings = settingsBuilder.generateConsistencyTokenSettings().build(); + checkConsistencySettings = settingsBuilder.checkConsistencySettings().build(); + snapshotTableSettings = settingsBuilder.snapshotTableSettings().build(); + snapshotTableOperationSettings = settingsBuilder.snapshotTableOperationSettings().build(); + getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); + listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build(); + deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build(); + createBackupSettings = settingsBuilder.createBackupSettings().build(); + createBackupOperationSettings = settingsBuilder.createBackupOperationSettings().build(); + getBackupSettings = settingsBuilder.getBackupSettings().build(); + updateBackupSettings = settingsBuilder.updateBackupSettings().build(); + deleteBackupSettings = settingsBuilder.deleteBackupSettings().build(); + listBackupsSettings = settingsBuilder.listBackupsSettings().build(); + restoreTableSettings = settingsBuilder.restoreTableSettings().build(); + restoreTableOperationSettings = settingsBuilder.restoreTableOperationSettings().build(); + copyBackupSettings = settingsBuilder.copyBackupSettings().build(); + copyBackupOperationSettings = settingsBuilder.copyBackupOperationSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + createSchemaBundleSettings = settingsBuilder.createSchemaBundleSettings().build(); + createSchemaBundleOperationSettings = + settingsBuilder.createSchemaBundleOperationSettings().build(); + updateSchemaBundleSettings = settingsBuilder.updateSchemaBundleSettings().build(); + updateSchemaBundleOperationSettings = + settingsBuilder.updateSchemaBundleOperationSettings().build(); + getSchemaBundleSettings = settingsBuilder.getSchemaBundleSettings().build(); + listSchemaBundlesSettings = settingsBuilder.listSchemaBundlesSettings().build(); + deleteSchemaBundleSettings = settingsBuilder.deleteSchemaBundleSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-bigtable") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for BigtableTableAdminStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createTableSettings; + private final UnaryCallSettings.Builder + createTableFromSnapshotSettings; + private final OperationCallSettings.Builder< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings; + private final PagedCallSettings.Builder< + ListTablesRequest, ListTablesResponse, ListTablesPagedResponse> + listTablesSettings; + private final UnaryCallSettings.Builder getTableSettings; + private final UnaryCallSettings.Builder updateTableSettings; + private final OperationCallSettings.Builder + updateTableOperationSettings; + private final UnaryCallSettings.Builder deleteTableSettings; + private final UnaryCallSettings.Builder undeleteTableSettings; + private final OperationCallSettings.Builder + undeleteTableOperationSettings; + private final UnaryCallSettings.Builder + createAuthorizedViewSettings; + private final OperationCallSettings.Builder< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings; + private final PagedCallSettings.Builder< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings; + private final UnaryCallSettings.Builder + getAuthorizedViewSettings; + private final UnaryCallSettings.Builder + updateAuthorizedViewSettings; + private final OperationCallSettings.Builder< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings; + private final UnaryCallSettings.Builder + deleteAuthorizedViewSettings; + private final UnaryCallSettings.Builder + modifyColumnFamiliesSettings; + private final UnaryCallSettings.Builder dropRowRangeSettings; + private final UnaryCallSettings.Builder< + GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse> + generateConsistencyTokenSettings; + private final UnaryCallSettings.Builder + checkConsistencySettings; + private final UnaryCallSettings.Builder snapshotTableSettings; + private final OperationCallSettings.Builder< + SnapshotTableRequest, Snapshot, SnapshotTableMetadata> + snapshotTableOperationSettings; + private final UnaryCallSettings.Builder getSnapshotSettings; + private final PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings; + private final UnaryCallSettings.Builder deleteSnapshotSettings; + private final UnaryCallSettings.Builder createBackupSettings; + private final OperationCallSettings.Builder + createBackupOperationSettings; + private final UnaryCallSettings.Builder getBackupSettings; + private final UnaryCallSettings.Builder updateBackupSettings; + private final UnaryCallSettings.Builder deleteBackupSettings; + private final PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings; + private final UnaryCallSettings.Builder restoreTableSettings; + private final OperationCallSettings.Builder + restoreTableOperationSettings; + private final UnaryCallSettings.Builder copyBackupSettings; + private final OperationCallSettings.Builder + copyBackupOperationSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private final UnaryCallSettings.Builder + createSchemaBundleSettings; + private final OperationCallSettings.Builder< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationSettings; + private final UnaryCallSettings.Builder + updateSchemaBundleSettings; + private final OperationCallSettings.Builder< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationSettings; + private final UnaryCallSettings.Builder + getSchemaBundleSettings; + private final PagedCallSettings.Builder< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings; + private final UnaryCallSettings.Builder + deleteSchemaBundleSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_4_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(300000L)) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) + .build(); + definitions.put("no_retry_4_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTableFromSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTableFromSnapshotOperationSettings = OperationCallSettings.newBuilder(); + listTablesSettings = PagedCallSettings.newBuilder(LIST_TABLES_PAGE_STR_FACT); + getTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateTableOperationSettings = OperationCallSettings.newBuilder(); + deleteTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteTableOperationSettings = OperationCallSettings.newBuilder(); + createAuthorizedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAuthorizedViewOperationSettings = OperationCallSettings.newBuilder(); + listAuthorizedViewsSettings = + PagedCallSettings.newBuilder(LIST_AUTHORIZED_VIEWS_PAGE_STR_FACT); + getAuthorizedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAuthorizedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAuthorizedViewOperationSettings = OperationCallSettings.newBuilder(); + deleteAuthorizedViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + modifyColumnFamiliesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + dropRowRangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateConsistencyTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + checkConsistencySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + snapshotTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + snapshotTableOperationSettings = OperationCallSettings.newBuilder(); + getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT); + deleteSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBackupOperationSettings = OperationCallSettings.newBuilder(); + getBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT); + restoreTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restoreTableOperationSettings = OperationCallSettings.newBuilder(); + copyBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyBackupOperationSettings = OperationCallSettings.newBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSchemaBundleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSchemaBundleOperationSettings = OperationCallSettings.newBuilder(); + updateSchemaBundleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSchemaBundleOperationSettings = OperationCallSettings.newBuilder(); + getSchemaBundleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSchemaBundlesSettings = PagedCallSettings.newBuilder(LIST_SCHEMA_BUNDLES_PAGE_STR_FACT); + deleteSchemaBundleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createTableSettings, + createTableFromSnapshotSettings, + listTablesSettings, + getTableSettings, + updateTableSettings, + deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, + modifyColumnFamiliesSettings, + dropRowRangeSettings, + generateConsistencyTokenSettings, + checkConsistencySettings, + snapshotTableSettings, + getSnapshotSettings, + listSnapshotsSettings, + deleteSnapshotSettings, + createBackupSettings, + getBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listBackupsSettings, + restoreTableSettings, + copyBackupSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + createSchemaBundleSettings, + updateSchemaBundleSettings, + getSchemaBundleSettings, + listSchemaBundlesSettings, + deleteSchemaBundleSettings); + initDefaults(this); + } + + protected Builder(BigtableTableAdminStubSettings settings) { + super(settings); + + createTableSettings = settings.createTableSettings.toBuilder(); + createTableFromSnapshotSettings = settings.createTableFromSnapshotSettings.toBuilder(); + createTableFromSnapshotOperationSettings = + settings.createTableFromSnapshotOperationSettings.toBuilder(); + listTablesSettings = settings.listTablesSettings.toBuilder(); + getTableSettings = settings.getTableSettings.toBuilder(); + updateTableSettings = settings.updateTableSettings.toBuilder(); + updateTableOperationSettings = settings.updateTableOperationSettings.toBuilder(); + deleteTableSettings = settings.deleteTableSettings.toBuilder(); + undeleteTableSettings = settings.undeleteTableSettings.toBuilder(); + undeleteTableOperationSettings = settings.undeleteTableOperationSettings.toBuilder(); + createAuthorizedViewSettings = settings.createAuthorizedViewSettings.toBuilder(); + createAuthorizedViewOperationSettings = + settings.createAuthorizedViewOperationSettings.toBuilder(); + listAuthorizedViewsSettings = settings.listAuthorizedViewsSettings.toBuilder(); + getAuthorizedViewSettings = settings.getAuthorizedViewSettings.toBuilder(); + updateAuthorizedViewSettings = settings.updateAuthorizedViewSettings.toBuilder(); + updateAuthorizedViewOperationSettings = + settings.updateAuthorizedViewOperationSettings.toBuilder(); + deleteAuthorizedViewSettings = settings.deleteAuthorizedViewSettings.toBuilder(); + modifyColumnFamiliesSettings = settings.modifyColumnFamiliesSettings.toBuilder(); + dropRowRangeSettings = settings.dropRowRangeSettings.toBuilder(); + generateConsistencyTokenSettings = settings.generateConsistencyTokenSettings.toBuilder(); + checkConsistencySettings = settings.checkConsistencySettings.toBuilder(); + snapshotTableSettings = settings.snapshotTableSettings.toBuilder(); + snapshotTableOperationSettings = settings.snapshotTableOperationSettings.toBuilder(); + getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); + listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder(); + deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder(); + createBackupSettings = settings.createBackupSettings.toBuilder(); + createBackupOperationSettings = settings.createBackupOperationSettings.toBuilder(); + getBackupSettings = settings.getBackupSettings.toBuilder(); + updateBackupSettings = settings.updateBackupSettings.toBuilder(); + deleteBackupSettings = settings.deleteBackupSettings.toBuilder(); + listBackupsSettings = settings.listBackupsSettings.toBuilder(); + restoreTableSettings = settings.restoreTableSettings.toBuilder(); + restoreTableOperationSettings = settings.restoreTableOperationSettings.toBuilder(); + copyBackupSettings = settings.copyBackupSettings.toBuilder(); + copyBackupOperationSettings = settings.copyBackupOperationSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + createSchemaBundleSettings = settings.createSchemaBundleSettings.toBuilder(); + createSchemaBundleOperationSettings = + settings.createSchemaBundleOperationSettings.toBuilder(); + updateSchemaBundleSettings = settings.updateSchemaBundleSettings.toBuilder(); + updateSchemaBundleOperationSettings = + settings.updateSchemaBundleOperationSettings.toBuilder(); + getSchemaBundleSettings = settings.getSchemaBundleSettings.toBuilder(); + listSchemaBundlesSettings = settings.listSchemaBundlesSettings.toBuilder(); + deleteSchemaBundleSettings = settings.deleteSchemaBundleSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createTableSettings, + createTableFromSnapshotSettings, + listTablesSettings, + getTableSettings, + updateTableSettings, + deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, + modifyColumnFamiliesSettings, + dropRowRangeSettings, + generateConsistencyTokenSettings, + checkConsistencySettings, + snapshotTableSettings, + getSnapshotSettings, + listSnapshotsSettings, + deleteSnapshotSettings, + createBackupSettings, + getBackupSettings, + updateBackupSettings, + deleteBackupSettings, + listBackupsSettings, + restoreTableSettings, + copyBackupSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings, + createSchemaBundleSettings, + updateSchemaBundleSettings, + getSchemaBundleSettings, + listSchemaBundlesSettings, + deleteSchemaBundleSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createTableFromSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listTablesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .getTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .undeleteTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createAuthorizedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listAuthorizedViewsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getAuthorizedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateAuthorizedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteAuthorizedViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .modifyColumnFamiliesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .dropRowRangeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + + builder + .generateConsistencyTokenSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .checkConsistencySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .snapshotTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .listSnapshotsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .deleteSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBackupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .restoreTableSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .copyBackupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .createSchemaBundleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateSchemaBundleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSchemaBundleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSchemaBundlesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSchemaBundleSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createTableFromSnapshotOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Table.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateTableFromSnapshotMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) + .build())); + + builder + .updateTableOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Table.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateTableMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .undeleteTableOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Table.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UndeleteTableMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .createAuthorizedViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AuthorizedView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateAuthorizedViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateAuthorizedViewOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AuthorizedView.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UpdateAuthorizedViewMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .snapshotTableOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Snapshot.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SnapshotTableMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .createBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateBackupMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .restoreTableOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Table.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RestoreTableMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build())); + + builder + .copyBackupOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Backup.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CopyBackupMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .createSchemaBundleOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SchemaBundle.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateSchemaBundleMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateSchemaBundleOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SchemaBundle.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UpdateSchemaBundleMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createTable. */ + public UnaryCallSettings.Builder createTableSettings() { + return createTableSettings; + } + + /** Returns the builder for the settings used for calls to createTableFromSnapshot. */ + public UnaryCallSettings.Builder + createTableFromSnapshotSettings() { + return createTableFromSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to createTableFromSnapshot. */ + public OperationCallSettings.Builder< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationSettings() { + return createTableFromSnapshotOperationSettings; + } + + /** Returns the builder for the settings used for calls to listTables. */ + public PagedCallSettings.Builder + listTablesSettings() { + return listTablesSettings; + } + + /** Returns the builder for the settings used for calls to getTable. */ + public UnaryCallSettings.Builder getTableSettings() { + return getTableSettings; + } + + /** Returns the builder for the settings used for calls to updateTable. */ + public UnaryCallSettings.Builder updateTableSettings() { + return updateTableSettings; + } + + /** Returns the builder for the settings used for calls to updateTable. */ + public OperationCallSettings.Builder + updateTableOperationSettings() { + return updateTableOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteTable. */ + public UnaryCallSettings.Builder deleteTableSettings() { + return deleteTableSettings; + } + + /** Returns the builder for the settings used for calls to undeleteTable. */ + public UnaryCallSettings.Builder undeleteTableSettings() { + return undeleteTableSettings; + } + + /** Returns the builder for the settings used for calls to undeleteTable. */ + public OperationCallSettings.Builder + undeleteTableOperationSettings() { + return undeleteTableOperationSettings; + } + + /** Returns the builder for the settings used for calls to createAuthorizedView. */ + public UnaryCallSettings.Builder + createAuthorizedViewSettings() { + return createAuthorizedViewSettings; + } + + /** Returns the builder for the settings used for calls to createAuthorizedView. */ + public OperationCallSettings.Builder< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationSettings() { + return createAuthorizedViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to listAuthorizedViews. */ + public PagedCallSettings.Builder< + ListAuthorizedViewsRequest, + ListAuthorizedViewsResponse, + ListAuthorizedViewsPagedResponse> + listAuthorizedViewsSettings() { + return listAuthorizedViewsSettings; + } + + /** Returns the builder for the settings used for calls to getAuthorizedView. */ + public UnaryCallSettings.Builder + getAuthorizedViewSettings() { + return getAuthorizedViewSettings; + } + + /** Returns the builder for the settings used for calls to updateAuthorizedView. */ + public UnaryCallSettings.Builder + updateAuthorizedViewSettings() { + return updateAuthorizedViewSettings; + } + + /** Returns the builder for the settings used for calls to updateAuthorizedView. */ + public OperationCallSettings.Builder< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationSettings() { + return updateAuthorizedViewOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAuthorizedView. */ + public UnaryCallSettings.Builder + deleteAuthorizedViewSettings() { + return deleteAuthorizedViewSettings; + } + + /** Returns the builder for the settings used for calls to modifyColumnFamilies. */ + public UnaryCallSettings.Builder + modifyColumnFamiliesSettings() { + return modifyColumnFamiliesSettings; + } + + /** Returns the builder for the settings used for calls to dropRowRange. */ + public UnaryCallSettings.Builder dropRowRangeSettings() { + return dropRowRangeSettings; + } + + /** Returns the builder for the settings used for calls to generateConsistencyToken. */ + public UnaryCallSettings.Builder< + GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse> + generateConsistencyTokenSettings() { + return generateConsistencyTokenSettings; + } + + /** Returns the builder for the settings used for calls to checkConsistency. */ + public UnaryCallSettings.Builder + checkConsistencySettings() { + return checkConsistencySettings; + } + + /** Returns the builder for the settings used for calls to snapshotTable. */ + public UnaryCallSettings.Builder snapshotTableSettings() { + return snapshotTableSettings; + } + + /** Returns the builder for the settings used for calls to snapshotTable. */ + public OperationCallSettings.Builder + snapshotTableOperationSettings() { + return snapshotTableOperationSettings; + } + + /** Returns the builder for the settings used for calls to getSnapshot. */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to listSnapshots. */ + public PagedCallSettings.Builder< + ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> + listSnapshotsSettings() { + return listSnapshotsSettings; + } + + /** Returns the builder for the settings used for calls to deleteSnapshot. */ + public UnaryCallSettings.Builder deleteSnapshotSettings() { + return deleteSnapshotSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public UnaryCallSettings.Builder createBackupSettings() { + return createBackupSettings; + } + + /** Returns the builder for the settings used for calls to createBackup. */ + public OperationCallSettings.Builder + createBackupOperationSettings() { + return createBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to getBackup. */ + public UnaryCallSettings.Builder getBackupSettings() { + return getBackupSettings; + } + + /** Returns the builder for the settings used for calls to updateBackup. */ + public UnaryCallSettings.Builder updateBackupSettings() { + return updateBackupSettings; + } + + /** Returns the builder for the settings used for calls to deleteBackup. */ + public UnaryCallSettings.Builder deleteBackupSettings() { + return deleteBackupSettings; + } + + /** Returns the builder for the settings used for calls to listBackups. */ + public PagedCallSettings.Builder< + ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse> + listBackupsSettings() { + return listBackupsSettings; + } + + /** Returns the builder for the settings used for calls to restoreTable. */ + public UnaryCallSettings.Builder restoreTableSettings() { + return restoreTableSettings; + } + + /** Returns the builder for the settings used for calls to restoreTable. */ + public OperationCallSettings.Builder + restoreTableOperationSettings() { + return restoreTableOperationSettings; + } + + /** Returns the builder for the settings used for calls to copyBackup. */ + public UnaryCallSettings.Builder copyBackupSettings() { + return copyBackupSettings; + } + + /** Returns the builder for the settings used for calls to copyBackup. */ + public OperationCallSettings.Builder + copyBackupOperationSettings() { + return copyBackupOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to createSchemaBundle. */ + public UnaryCallSettings.Builder + createSchemaBundleSettings() { + return createSchemaBundleSettings; + } + + /** Returns the builder for the settings used for calls to createSchemaBundle. */ + public OperationCallSettings.Builder< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationSettings() { + return createSchemaBundleOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateSchemaBundle. */ + public UnaryCallSettings.Builder + updateSchemaBundleSettings() { + return updateSchemaBundleSettings; + } + + /** Returns the builder for the settings used for calls to updateSchemaBundle. */ + public OperationCallSettings.Builder< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationSettings() { + return updateSchemaBundleOperationSettings; + } + + /** Returns the builder for the settings used for calls to getSchemaBundle. */ + public UnaryCallSettings.Builder + getSchemaBundleSettings() { + return getSchemaBundleSettings; + } + + /** Returns the builder for the settings used for calls to listSchemaBundles. */ + public PagedCallSettings.Builder< + ListSchemaBundlesRequest, ListSchemaBundlesResponse, ListSchemaBundlesPagedResponse> + listSchemaBundlesSettings() { + return listSchemaBundlesSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchemaBundle. */ + public UnaryCallSettings.Builder + deleteSchemaBundleSettings() { + return deleteSchemaBundleSettings; + } + + @Override + public BigtableTableAdminStubSettings build() throws IOException { + return new BigtableTableAdminStubSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java new file mode 100644 index 000000000000..3c5a585c0f77 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java @@ -0,0 +1,248 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.ProtoOperationTransformers.MetadataTransformer; +import com.google.api.gax.grpc.ProtoOperationTransformers.ResponseTransformer; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata; +import com.google.bigtable.admin.v2.TableName; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.MethodDescriptor.Marshaller; +import io.grpc.MethodDescriptor.MethodType; +import java.io.IOException; +import java.io.InputStream; +import org.threeten.bp.Duration; + +/** + * Extension of the autogenerated {@link GrpcBigtableTableAdminStub}. It acts as a decorator to add + * enhanced abilities to the autogenerated stub. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class EnhancedBigtableTableAdminStub extends GrpcBigtableTableAdminStub { + private final BigtableTableAdminStubSettings settings; + private final ClientContext clientContext; + + @javax.annotation.Nullable private final TableAdminRequestContext requestContext; + + @Deprecated private final AwaitReplicationCallable awaitReplicationCallable; + + private final AwaitConsistencyCallable awaitConsistencyCallable; + private final OperationCallable + optimizeRestoredTableOperationBaseCallable; + + /** + * Creates an instance of {@link EnhancedBigtableTableAdminStub} using the provided settings. This + * variant is used by the V2 client stack which relies on fully qualified table names and + * therefore does not require a {@link TableAdminRequestContext}. + * + * @param settings The settings used to configure the stub. + * @return A new instance of {@code EnhancedBigtableTableAdminStub}. + * @throws IOException If there are errors creating the underlying client context. + */ + public static EnhancedBigtableTableAdminStub createEnhanced( + BigtableTableAdminStubSettings settings) throws IOException { + return new EnhancedBigtableTableAdminStub(settings, ClientContext.create(settings), null); + } + + /** + * Creates an instance of {@link EnhancedBigtableTableAdminStub} using the provided settings. This + * variant is used by the legacy client stack which relies on short table IDs and requires a + * {@link TableAdminRequestContext} to construct fully qualified table names. + * + * @param settings The settings used to configure the stub. + * @param requestContext The context used to format short table IDs. + * @return A new instance of {@code EnhancedBigtableTableAdminStub}. + * @throws IOException If there are errors creating the underlying client context. + */ + public static EnhancedBigtableTableAdminStub createEnhanced( + BigtableTableAdminStubSettings settings, TableAdminRequestContext requestContext) + throws IOException { + return new EnhancedBigtableTableAdminStub( + settings, ClientContext.create(settings), requestContext); + } + + private EnhancedBigtableTableAdminStub( + BigtableTableAdminStubSettings settings, + ClientContext clientContext, + @javax.annotation.Nullable TableAdminRequestContext requestContext) + throws IOException { + super(settings, clientContext); + + this.settings = settings; + this.clientContext = clientContext; + this.requestContext = requestContext; + this.awaitConsistencyCallable = createAwaitConsistencyCallable(); + this.awaitReplicationCallable = createAwaitReplicationCallable(); + this.optimizeRestoredTableOperationBaseCallable = + createOptimizeRestoredTableOperationBaseCallable(); + } + + @Deprecated + private AwaitReplicationCallable createAwaitReplicationCallable() { + return AwaitReplicationCallable.create(awaitConsistencyCallable); + } + + private AwaitConsistencyCallable createAwaitConsistencyCallable() { + // TODO(igorbernstein2): expose polling settings + RetrySettings pollingSettings = + RetrySettings.newBuilder() + // use overall timeout from checkConsistencyCallable + // NOTE: The overall timeout might exceed this value due to underlying retries + .setTotalTimeout( + settings.checkConsistencySettings().getRetrySettings().getTotalTimeout()) + // Use constant polling with jitter + .setInitialRetryDelay(Duration.ofSeconds(10)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofSeconds(10)) + // These rpc timeouts are ignored, instead the rpc timeouts defined for + // generateConsistencyToken and checkConsistency callables will be used. + .setInitialRpcTimeout(Duration.ZERO) + .setMaxRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .build(); + + return AwaitConsistencyCallable.create( + generateConsistencyTokenCallable(), + checkConsistencyCallable(), + clientContext, + pollingSettings, + requestContext); + } + + // Plug into gax operation infrastructure + // gax assumes that all operations are started immediately and doesn't provide support for child + // operations + // this method wraps a fake method "OptimizeTable" in an OperationCallable. This should not be + // exposed to + // end users, but will be used for its resumeOperation functionality via a wrapper + private OperationCallable + createOptimizeRestoredTableOperationBaseCallable() { + // Fake initial callable settings. Since this is child operation, it doesn't have an initial + // callable but gax doesn't have support for child operation, so this creates a fake method + // descriptor that will never be used. + GrpcCallSettings unusedInitialCallSettings = + GrpcCallSettings.create( + MethodDescriptor.newBuilder() + .setType(MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableTableAdmin/OptimizeRestoredTable") + .setRequestMarshaller( + new Marshaller() { + @Override + public InputStream stream(Void value) { + throw new UnsupportedOperationException("not used"); + } + + @Override + public Void parse(InputStream stream) { + throw new UnsupportedOperationException("not used"); + } + }) + .setResponseMarshaller( + new Marshaller() { + @Override + public InputStream stream(Operation value) { + throw new UnsupportedOperationException("not used"); + } + + @Override + public Operation parse(InputStream stream) { + throw new UnsupportedOperationException("not used"); + } + }) + .build()); + + // helpers to extract the underlying protos from the operation + final MetadataTransformer protoMetadataTransformer = + MetadataTransformer.create(OptimizeRestoredTableMetadata.class); + + final ResponseTransformer protoResponseTransformer = + ResponseTransformer.create(com.google.protobuf.Empty.class); + + // TODO(igorbernstein2): expose polling settings + OperationCallSettings operationCallSettings = + OperationCallSettings.newBuilder() + // Since this is used for a child operation, the initial call settings will not be used + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setSimpleTimeoutNoRetries(Duration.ZERO) + .build()) + // Configure the extractors to wrap the protos + .setMetadataTransformer( + new ApiFunction() { + @Override + public OptimizeRestoredTableMetadata apply(OperationSnapshot input) { + return protoMetadataTransformer.apply(input); + } + }) + .setResponseTransformer( + new ApiFunction() { + @Override + public Empty apply(OperationSnapshot input) { + return protoResponseTransformer.apply(input); + } + }) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(600000L)) + .build())) + .build(); + + // Create the callable + return GrpcCallableFactory.createOperationCallable( + unusedInitialCallSettings, operationCallSettings, clientContext, getOperationsStub()); + } + + @Deprecated + public UnaryCallable awaitReplicationCallable() { + return awaitReplicationCallable; + } + + public UnaryCallable awaitConsistencyCallable() { + return awaitConsistencyCallable; + } + + public OperationCallable + awaitOptimizeRestoredTableCallable() { + return optimizeRestoredTableOperationBaseCallable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java new file mode 100644 index 000000000000..c3df94408692 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the BigtableInstanceAdmin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcBigtableInstanceAdminCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java new file mode 100644 index 000000000000..110b421d9523 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java @@ -0,0 +1,1385 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterMetadata; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewMetadata; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.UpdateAppProfileMetadata; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewMetadata; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the BigtableInstanceAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance") + .setRequestMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + partialUpdateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(PartialUpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters") + .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateCluster") + .setRequestMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + partialUpdateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/PartialUpdateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(PartialUpdateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteCluster") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createAppProfileMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/CreateAppProfile") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAppProfileRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AppProfile.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getAppProfileMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetAppProfile") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAppProfileRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AppProfile.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listAppProfilesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/ListAppProfiles") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAppProfilesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAppProfilesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateAppProfileMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateAppProfile") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAppProfileRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteAppProfileMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteAppProfile") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAppProfileRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listHotTabletsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/ListHotTablets") + .setRequestMarshaller( + ProtoUtils.marshaller(ListHotTabletsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListHotTabletsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createLogicalViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/CreateLogicalView") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateLogicalViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getLogicalViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetLogicalView") + .setRequestMarshaller( + ProtoUtils.marshaller(GetLogicalViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogicalView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLogicalViewsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/ListLogicalViews") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLogicalViewsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLogicalViewsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateLogicalViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateLogicalView") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateLogicalViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteLogicalViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteLogicalView") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteLogicalViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createMaterializedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/CreateMaterializedView") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateMaterializedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getMaterializedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/GetMaterializedView") + .setRequestMarshaller( + ProtoUtils.marshaller(GetMaterializedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MaterializedView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMaterializedViewsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/ListMaterializedViews") + .setRequestMarshaller( + ProtoUtils.marshaller(ListMaterializedViewsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListMaterializedViewsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateMaterializedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateMaterializedView") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateMaterializedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteMaterializedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteMaterializedView") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteMaterializedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable listInstancesCallable; + private final UnaryCallable updateInstanceCallable; + private final UnaryCallable + partialUpdateInstanceCallable; + private final OperationCallable + partialUpdateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable listClustersCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable partialUpdateClusterCallable; + private final OperationCallable< + PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> + partialUpdateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final UnaryCallable createAppProfileCallable; + private final UnaryCallable getAppProfileCallable; + private final UnaryCallable + listAppProfilesCallable; + private final UnaryCallable + listAppProfilesPagedCallable; + private final UnaryCallable updateAppProfileCallable; + private final OperationCallable + updateAppProfileOperationCallable; + private final UnaryCallable deleteAppProfileCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable listHotTabletsCallable; + private final UnaryCallable + listHotTabletsPagedCallable; + private final UnaryCallable createLogicalViewCallable; + private final OperationCallable + createLogicalViewOperationCallable; + private final UnaryCallable getLogicalViewCallable; + private final UnaryCallable + listLogicalViewsCallable; + private final UnaryCallable + listLogicalViewsPagedCallable; + private final UnaryCallable updateLogicalViewCallable; + private final OperationCallable + updateLogicalViewOperationCallable; + private final UnaryCallable deleteLogicalViewCallable; + private final UnaryCallable + createMaterializedViewCallable; + private final OperationCallable< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationCallable; + private final UnaryCallable + getMaterializedViewCallable; + private final UnaryCallable + listMaterializedViewsCallable; + private final UnaryCallable + listMaterializedViewsPagedCallable; + private final UnaryCallable + updateMaterializedViewCallable; + private final OperationCallable< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationCallable; + private final UnaryCallable deleteMaterializedViewCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcBigtableInstanceAdminStub create( + BigtableInstanceAdminStubSettings settings) throws IOException { + return new GrpcBigtableInstanceAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcBigtableInstanceAdminStub create(ClientContext clientContext) + throws IOException { + return new GrpcBigtableInstanceAdminStub( + BigtableInstanceAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcBigtableInstanceAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcBigtableInstanceAdminStub( + BigtableInstanceAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcBigtableInstanceAdminStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcBigtableInstanceAdminStub( + BigtableInstanceAdminStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcBigtableInstanceAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcBigtableInstanceAdminStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcBigtableInstanceAdminStub( + BigtableInstanceAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + partialUpdateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(partialUpdateInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings partialUpdateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(partialUpdateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings createAppProfileTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAppProfileMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getAppProfileTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAppProfileMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + listAppProfilesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAppProfilesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateAppProfileTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAppProfileMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "app_profile.name", String.valueOf(request.getAppProfile().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteAppProfileTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAppProfileMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + listHotTabletsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listHotTabletsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings createLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + listLogicalViewsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLogicalViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "logical_view.name", String.valueOf(request.getLogicalView().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + createMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + getMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + listMaterializedViewsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listMaterializedViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + updateMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "materialized_view.name", + String.valueOf(request.getMaterializedView().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + operationsStub); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.partialUpdateInstanceCallable = + callableFactory.createUnaryCallable( + partialUpdateInstanceTransportSettings, + settings.partialUpdateInstanceSettings(), + clientContext); + this.partialUpdateInstanceOperationCallable = + callableFactory.createOperationCallable( + partialUpdateInstanceTransportSettings, + settings.partialUpdateInstanceOperationSettings(), + clientContext, + operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + operationsStub); + this.partialUpdateClusterCallable = + callableFactory.createUnaryCallable( + partialUpdateClusterTransportSettings, + settings.partialUpdateClusterSettings(), + clientContext); + this.partialUpdateClusterOperationCallable = + callableFactory.createOperationCallable( + partialUpdateClusterTransportSettings, + settings.partialUpdateClusterOperationSettings(), + clientContext, + operationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.createAppProfileCallable = + callableFactory.createUnaryCallable( + createAppProfileTransportSettings, settings.createAppProfileSettings(), clientContext); + this.getAppProfileCallable = + callableFactory.createUnaryCallable( + getAppProfileTransportSettings, settings.getAppProfileSettings(), clientContext); + this.listAppProfilesCallable = + callableFactory.createUnaryCallable( + listAppProfilesTransportSettings, settings.listAppProfilesSettings(), clientContext); + this.listAppProfilesPagedCallable = + callableFactory.createPagedCallable( + listAppProfilesTransportSettings, settings.listAppProfilesSettings(), clientContext); + this.updateAppProfileCallable = + callableFactory.createUnaryCallable( + updateAppProfileTransportSettings, settings.updateAppProfileSettings(), clientContext); + this.updateAppProfileOperationCallable = + callableFactory.createOperationCallable( + updateAppProfileTransportSettings, + settings.updateAppProfileOperationSettings(), + clientContext, + operationsStub); + this.deleteAppProfileCallable = + callableFactory.createUnaryCallable( + deleteAppProfileTransportSettings, settings.deleteAppProfileSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + this.listHotTabletsCallable = + callableFactory.createUnaryCallable( + listHotTabletsTransportSettings, settings.listHotTabletsSettings(), clientContext); + this.listHotTabletsPagedCallable = + callableFactory.createPagedCallable( + listHotTabletsTransportSettings, settings.listHotTabletsSettings(), clientContext); + this.createLogicalViewCallable = + callableFactory.createUnaryCallable( + createLogicalViewTransportSettings, + settings.createLogicalViewSettings(), + clientContext); + this.createLogicalViewOperationCallable = + callableFactory.createOperationCallable( + createLogicalViewTransportSettings, + settings.createLogicalViewOperationSettings(), + clientContext, + operationsStub); + this.getLogicalViewCallable = + callableFactory.createUnaryCallable( + getLogicalViewTransportSettings, settings.getLogicalViewSettings(), clientContext); + this.listLogicalViewsCallable = + callableFactory.createUnaryCallable( + listLogicalViewsTransportSettings, settings.listLogicalViewsSettings(), clientContext); + this.listLogicalViewsPagedCallable = + callableFactory.createPagedCallable( + listLogicalViewsTransportSettings, settings.listLogicalViewsSettings(), clientContext); + this.updateLogicalViewCallable = + callableFactory.createUnaryCallable( + updateLogicalViewTransportSettings, + settings.updateLogicalViewSettings(), + clientContext); + this.updateLogicalViewOperationCallable = + callableFactory.createOperationCallable( + updateLogicalViewTransportSettings, + settings.updateLogicalViewOperationSettings(), + clientContext, + operationsStub); + this.deleteLogicalViewCallable = + callableFactory.createUnaryCallable( + deleteLogicalViewTransportSettings, + settings.deleteLogicalViewSettings(), + clientContext); + this.createMaterializedViewCallable = + callableFactory.createUnaryCallable( + createMaterializedViewTransportSettings, + settings.createMaterializedViewSettings(), + clientContext); + this.createMaterializedViewOperationCallable = + callableFactory.createOperationCallable( + createMaterializedViewTransportSettings, + settings.createMaterializedViewOperationSettings(), + clientContext, + operationsStub); + this.getMaterializedViewCallable = + callableFactory.createUnaryCallable( + getMaterializedViewTransportSettings, + settings.getMaterializedViewSettings(), + clientContext); + this.listMaterializedViewsCallable = + callableFactory.createUnaryCallable( + listMaterializedViewsTransportSettings, + settings.listMaterializedViewsSettings(), + clientContext); + this.listMaterializedViewsPagedCallable = + callableFactory.createPagedCallable( + listMaterializedViewsTransportSettings, + settings.listMaterializedViewsSettings(), + clientContext); + this.updateMaterializedViewCallable = + callableFactory.createUnaryCallable( + updateMaterializedViewTransportSettings, + settings.updateMaterializedViewSettings(), + clientContext); + this.updateMaterializedViewOperationCallable = + callableFactory.createOperationCallable( + updateMaterializedViewTransportSettings, + settings.updateMaterializedViewOperationSettings(), + clientContext, + operationsStub); + this.deleteMaterializedViewCallable = + callableFactory.createUnaryCallable( + deleteMaterializedViewTransportSettings, + settings.deleteMaterializedViewSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public UnaryCallable partialUpdateInstanceCallable() { + return partialUpdateInstanceCallable; + } + + @Override + public OperationCallable + partialUpdateInstanceOperationCallable() { + return partialUpdateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable partialUpdateClusterCallable() { + return partialUpdateClusterCallable; + } + + @Override + public OperationCallable + partialUpdateClusterOperationCallable() { + return partialUpdateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public UnaryCallable createAppProfileCallable() { + return createAppProfileCallable; + } + + @Override + public UnaryCallable getAppProfileCallable() { + return getAppProfileCallable; + } + + @Override + public UnaryCallable listAppProfilesCallable() { + return listAppProfilesCallable; + } + + @Override + public UnaryCallable + listAppProfilesPagedCallable() { + return listAppProfilesPagedCallable; + } + + @Override + public UnaryCallable updateAppProfileCallable() { + return updateAppProfileCallable; + } + + @Override + public OperationCallable + updateAppProfileOperationCallable() { + return updateAppProfileOperationCallable; + } + + @Override + public UnaryCallable deleteAppProfileCallable() { + return deleteAppProfileCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public UnaryCallable listHotTabletsCallable() { + return listHotTabletsCallable; + } + + @Override + public UnaryCallable + listHotTabletsPagedCallable() { + return listHotTabletsPagedCallable; + } + + @Override + public UnaryCallable createLogicalViewCallable() { + return createLogicalViewCallable; + } + + @Override + public OperationCallable + createLogicalViewOperationCallable() { + return createLogicalViewOperationCallable; + } + + @Override + public UnaryCallable getLogicalViewCallable() { + return getLogicalViewCallable; + } + + @Override + public UnaryCallable + listLogicalViewsCallable() { + return listLogicalViewsCallable; + } + + @Override + public UnaryCallable + listLogicalViewsPagedCallable() { + return listLogicalViewsPagedCallable; + } + + @Override + public UnaryCallable updateLogicalViewCallable() { + return updateLogicalViewCallable; + } + + @Override + public OperationCallable + updateLogicalViewOperationCallable() { + return updateLogicalViewOperationCallable; + } + + @Override + public UnaryCallable deleteLogicalViewCallable() { + return deleteLogicalViewCallable; + } + + @Override + public UnaryCallable createMaterializedViewCallable() { + return createMaterializedViewCallable; + } + + @Override + public OperationCallable< + CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata> + createMaterializedViewOperationCallable() { + return createMaterializedViewOperationCallable; + } + + @Override + public UnaryCallable getMaterializedViewCallable() { + return getMaterializedViewCallable; + } + + @Override + public UnaryCallable + listMaterializedViewsCallable() { + return listMaterializedViewsCallable; + } + + @Override + public UnaryCallable + listMaterializedViewsPagedCallable() { + return listMaterializedViewsPagedCallable; + } + + @Override + public UnaryCallable updateMaterializedViewCallable() { + return updateMaterializedViewCallable; + } + + @Override + public OperationCallable< + UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata> + updateMaterializedViewOperationCallable() { + return updateMaterializedViewOperationCallable; + } + + @Override + public UnaryCallable deleteMaterializedViewCallable() { + return deleteMaterializedViewCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java new file mode 100644 index 000000000000..9826dedb73c5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the BigtableTableAdmin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcBigtableTableAdminCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java new file mode 100644 index 000000000000..8b1bc3991096 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java @@ -0,0 +1,1529 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotTableMetadata; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.UndeleteTableMetadata; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the BigtableTableAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { + private static final MethodDescriptor createTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CreateTable") + .setRequestMarshaller(ProtoUtils.marshaller(CreateTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createTableFromSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateTableFromSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listTablesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ListTables") + .setRequestMarshaller(ProtoUtils.marshaller(ListTablesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTablesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetTable") + .setRequestMarshaller(ProtoUtils.marshaller(GetTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + undeleteTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeleteTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createAuthorizedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CreateAuthorizedView") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAuthorizedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listAuthorizedViewsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ListAuthorizedViews") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAuthorizedViewsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAuthorizedViewsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getAuthorizedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetAuthorizedView") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAuthorizedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AuthorizedView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateAuthorizedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/UpdateAuthorizedView") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAuthorizedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteAuthorizedViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteAuthorizedView") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAuthorizedViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + modifyColumnFamiliesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies") + .setRequestMarshaller( + ProtoUtils.marshaller(ModifyColumnFamiliesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor dropRowRangeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange") + .setRequestMarshaller(ProtoUtils.marshaller(DropRowRangeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse> + generateConsistencyTokenMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateConsistencyTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateConsistencyTokenResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + checkConsistencyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency") + .setRequestMarshaller( + ProtoUtils.marshaller(CheckConsistencyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CheckConsistencyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + snapshotTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable") + .setRequestMarshaller( + ProtoUtils.marshaller(SnapshotTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot") + .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSnapshotsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetBackup") + .setRequestMarshaller(ProtoUtils.marshaller(GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Backup.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBackupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ListBackups") + .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + restoreTableMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable") + .setRequestMarshaller(ProtoUtils.marshaller(RestoreTableRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor copyBackupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CopyBackup") + .setRequestMarshaller(ProtoUtils.marshaller(CopyBackupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createSchemaBundleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CreateSchemaBundle") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSchemaBundleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateSchemaBundleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/UpdateSchemaBundle") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSchemaBundleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSchemaBundleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetSchemaBundle") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSchemaBundleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SchemaBundle.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSchemaBundlesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/ListSchemaBundles") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSchemaBundlesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSchemaBundlesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSchemaBundleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteSchemaBundle") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSchemaBundleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createTableCallable; + private final UnaryCallable + createTableFromSnapshotCallable; + private final OperationCallable< + CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> + createTableFromSnapshotOperationCallable; + private final UnaryCallable listTablesCallable; + private final UnaryCallable listTablesPagedCallable; + private final UnaryCallable getTableCallable; + private final UnaryCallable updateTableCallable; + private final OperationCallable + updateTableOperationCallable; + private final UnaryCallable deleteTableCallable; + private final UnaryCallable undeleteTableCallable; + private final OperationCallable + undeleteTableOperationCallable; + private final UnaryCallable createAuthorizedViewCallable; + private final OperationCallable< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationCallable; + private final UnaryCallable + listAuthorizedViewsCallable; + private final UnaryCallable + listAuthorizedViewsPagedCallable; + private final UnaryCallable getAuthorizedViewCallable; + private final UnaryCallable updateAuthorizedViewCallable; + private final OperationCallable< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationCallable; + private final UnaryCallable deleteAuthorizedViewCallable; + private final UnaryCallable modifyColumnFamiliesCallable; + private final UnaryCallable dropRowRangeCallable; + private final UnaryCallable + generateConsistencyTokenCallable; + private final UnaryCallable + checkConsistencyCallable; + private final UnaryCallable snapshotTableCallable; + private final OperationCallable + snapshotTableOperationCallable; + private final UnaryCallable getSnapshotCallable; + private final UnaryCallable listSnapshotsCallable; + private final UnaryCallable + listSnapshotsPagedCallable; + private final UnaryCallable deleteSnapshotCallable; + private final UnaryCallable createBackupCallable; + private final OperationCallable + createBackupOperationCallable; + private final UnaryCallable getBackupCallable; + private final UnaryCallable updateBackupCallable; + private final UnaryCallable deleteBackupCallable; + private final UnaryCallable listBackupsCallable; + private final UnaryCallable + listBackupsPagedCallable; + private final UnaryCallable restoreTableCallable; + private final OperationCallable + restoreTableOperationCallable; + private final UnaryCallable copyBackupCallable; + private final OperationCallable + copyBackupOperationCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable createSchemaBundleCallable; + private final OperationCallable< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationCallable; + private final UnaryCallable updateSchemaBundleCallable; + private final OperationCallable< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationCallable; + private final UnaryCallable getSchemaBundleCallable; + private final UnaryCallable + listSchemaBundlesCallable; + private final UnaryCallable + listSchemaBundlesPagedCallable; + private final UnaryCallable deleteSchemaBundleCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcBigtableTableAdminStub create(BigtableTableAdminStubSettings settings) + throws IOException { + return new GrpcBigtableTableAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcBigtableTableAdminStub create(ClientContext clientContext) + throws IOException { + return new GrpcBigtableTableAdminStub( + BigtableTableAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcBigtableTableAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcBigtableTableAdminStub( + BigtableTableAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcBigtableTableAdminStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcBigtableTableAdminStub( + BigtableTableAdminStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcBigtableTableAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcBigtableTableAdminStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcBigtableTableAdminStub( + BigtableTableAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + createTableFromSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTableFromSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings listTablesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTablesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table.name", String.valueOf(request.getTable().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings undeleteTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings createAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + listAuthorizedViewsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAuthorizedViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "authorized_view.name", + String.valueOf(request.getAuthorizedView().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings modifyColumnFamiliesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(modifyColumnFamiliesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings dropRowRangeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(dropRowRangeMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + generateConsistencyTokenTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(generateConsistencyTokenMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + checkConsistencyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(checkConsistencyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings snapshotTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(snapshotTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings getSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listSnapshotsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSnapshotsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings deleteSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSnapshotMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings createBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listBackupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBackupsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings restoreTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(restoreTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings copyBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(copyBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings createSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "schema_bundle.name", String.valueOf(request.getSchemaBundle().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + listSchemaBundlesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSchemaBundlesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings deleteSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createTableCallable = + callableFactory.createUnaryCallable( + createTableTransportSettings, settings.createTableSettings(), clientContext); + this.createTableFromSnapshotCallable = + callableFactory.createUnaryCallable( + createTableFromSnapshotTransportSettings, + settings.createTableFromSnapshotSettings(), + clientContext); + this.createTableFromSnapshotOperationCallable = + callableFactory.createOperationCallable( + createTableFromSnapshotTransportSettings, + settings.createTableFromSnapshotOperationSettings(), + clientContext, + operationsStub); + this.listTablesCallable = + callableFactory.createUnaryCallable( + listTablesTransportSettings, settings.listTablesSettings(), clientContext); + this.listTablesPagedCallable = + callableFactory.createPagedCallable( + listTablesTransportSettings, settings.listTablesSettings(), clientContext); + this.getTableCallable = + callableFactory.createUnaryCallable( + getTableTransportSettings, settings.getTableSettings(), clientContext); + this.updateTableCallable = + callableFactory.createUnaryCallable( + updateTableTransportSettings, settings.updateTableSettings(), clientContext); + this.updateTableOperationCallable = + callableFactory.createOperationCallable( + updateTableTransportSettings, + settings.updateTableOperationSettings(), + clientContext, + operationsStub); + this.deleteTableCallable = + callableFactory.createUnaryCallable( + deleteTableTransportSettings, settings.deleteTableSettings(), clientContext); + this.undeleteTableCallable = + callableFactory.createUnaryCallable( + undeleteTableTransportSettings, settings.undeleteTableSettings(), clientContext); + this.undeleteTableOperationCallable = + callableFactory.createOperationCallable( + undeleteTableTransportSettings, + settings.undeleteTableOperationSettings(), + clientContext, + operationsStub); + this.createAuthorizedViewCallable = + callableFactory.createUnaryCallable( + createAuthorizedViewTransportSettings, + settings.createAuthorizedViewSettings(), + clientContext); + this.createAuthorizedViewOperationCallable = + callableFactory.createOperationCallable( + createAuthorizedViewTransportSettings, + settings.createAuthorizedViewOperationSettings(), + clientContext, + operationsStub); + this.listAuthorizedViewsCallable = + callableFactory.createUnaryCallable( + listAuthorizedViewsTransportSettings, + settings.listAuthorizedViewsSettings(), + clientContext); + this.listAuthorizedViewsPagedCallable = + callableFactory.createPagedCallable( + listAuthorizedViewsTransportSettings, + settings.listAuthorizedViewsSettings(), + clientContext); + this.getAuthorizedViewCallable = + callableFactory.createUnaryCallable( + getAuthorizedViewTransportSettings, + settings.getAuthorizedViewSettings(), + clientContext); + this.updateAuthorizedViewCallable = + callableFactory.createUnaryCallable( + updateAuthorizedViewTransportSettings, + settings.updateAuthorizedViewSettings(), + clientContext); + this.updateAuthorizedViewOperationCallable = + callableFactory.createOperationCallable( + updateAuthorizedViewTransportSettings, + settings.updateAuthorizedViewOperationSettings(), + clientContext, + operationsStub); + this.deleteAuthorizedViewCallable = + callableFactory.createUnaryCallable( + deleteAuthorizedViewTransportSettings, + settings.deleteAuthorizedViewSettings(), + clientContext); + this.modifyColumnFamiliesCallable = + callableFactory.createUnaryCallable( + modifyColumnFamiliesTransportSettings, + settings.modifyColumnFamiliesSettings(), + clientContext); + this.dropRowRangeCallable = + callableFactory.createUnaryCallable( + dropRowRangeTransportSettings, settings.dropRowRangeSettings(), clientContext); + this.generateConsistencyTokenCallable = + callableFactory.createUnaryCallable( + generateConsistencyTokenTransportSettings, + settings.generateConsistencyTokenSettings(), + clientContext); + this.checkConsistencyCallable = + callableFactory.createUnaryCallable( + checkConsistencyTransportSettings, settings.checkConsistencySettings(), clientContext); + this.snapshotTableCallable = + callableFactory.createUnaryCallable( + snapshotTableTransportSettings, settings.snapshotTableSettings(), clientContext); + this.snapshotTableOperationCallable = + callableFactory.createOperationCallable( + snapshotTableTransportSettings, + settings.snapshotTableOperationSettings(), + clientContext, + operationsStub); + this.getSnapshotCallable = + callableFactory.createUnaryCallable( + getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); + this.listSnapshotsCallable = + callableFactory.createUnaryCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.listSnapshotsPagedCallable = + callableFactory.createPagedCallable( + listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.deleteSnapshotCallable = + callableFactory.createUnaryCallable( + deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); + this.createBackupCallable = + callableFactory.createUnaryCallable( + createBackupTransportSettings, settings.createBackupSettings(), clientContext); + this.createBackupOperationCallable = + callableFactory.createOperationCallable( + createBackupTransportSettings, + settings.createBackupOperationSettings(), + clientContext, + operationsStub); + this.getBackupCallable = + callableFactory.createUnaryCallable( + getBackupTransportSettings, settings.getBackupSettings(), clientContext); + this.updateBackupCallable = + callableFactory.createUnaryCallable( + updateBackupTransportSettings, settings.updateBackupSettings(), clientContext); + this.deleteBackupCallable = + callableFactory.createUnaryCallable( + deleteBackupTransportSettings, settings.deleteBackupSettings(), clientContext); + this.listBackupsCallable = + callableFactory.createUnaryCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.listBackupsPagedCallable = + callableFactory.createPagedCallable( + listBackupsTransportSettings, settings.listBackupsSettings(), clientContext); + this.restoreTableCallable = + callableFactory.createUnaryCallable( + restoreTableTransportSettings, settings.restoreTableSettings(), clientContext); + this.restoreTableOperationCallable = + callableFactory.createOperationCallable( + restoreTableTransportSettings, + settings.restoreTableOperationSettings(), + clientContext, + operationsStub); + this.copyBackupCallable = + callableFactory.createUnaryCallable( + copyBackupTransportSettings, settings.copyBackupSettings(), clientContext); + this.copyBackupOperationCallable = + callableFactory.createOperationCallable( + copyBackupTransportSettings, + settings.copyBackupOperationSettings(), + clientContext, + operationsStub); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + this.createSchemaBundleCallable = + callableFactory.createUnaryCallable( + createSchemaBundleTransportSettings, + settings.createSchemaBundleSettings(), + clientContext); + this.createSchemaBundleOperationCallable = + callableFactory.createOperationCallable( + createSchemaBundleTransportSettings, + settings.createSchemaBundleOperationSettings(), + clientContext, + operationsStub); + this.updateSchemaBundleCallable = + callableFactory.createUnaryCallable( + updateSchemaBundleTransportSettings, + settings.updateSchemaBundleSettings(), + clientContext); + this.updateSchemaBundleOperationCallable = + callableFactory.createOperationCallable( + updateSchemaBundleTransportSettings, + settings.updateSchemaBundleOperationSettings(), + clientContext, + operationsStub); + this.getSchemaBundleCallable = + callableFactory.createUnaryCallable( + getSchemaBundleTransportSettings, settings.getSchemaBundleSettings(), clientContext); + this.listSchemaBundlesCallable = + callableFactory.createUnaryCallable( + listSchemaBundlesTransportSettings, + settings.listSchemaBundlesSettings(), + clientContext); + this.listSchemaBundlesPagedCallable = + callableFactory.createPagedCallable( + listSchemaBundlesTransportSettings, + settings.listSchemaBundlesSettings(), + clientContext); + this.deleteSchemaBundleCallable = + callableFactory.createUnaryCallable( + deleteSchemaBundleTransportSettings, + settings.deleteSchemaBundleSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createTableCallable() { + return createTableCallable; + } + + @Override + public UnaryCallable + createTableFromSnapshotCallable() { + return createTableFromSnapshotCallable; + } + + @Override + public OperationCallable + createTableFromSnapshotOperationCallable() { + return createTableFromSnapshotOperationCallable; + } + + @Override + public UnaryCallable listTablesCallable() { + return listTablesCallable; + } + + @Override + public UnaryCallable listTablesPagedCallable() { + return listTablesPagedCallable; + } + + @Override + public UnaryCallable getTableCallable() { + return getTableCallable; + } + + @Override + public UnaryCallable updateTableCallable() { + return updateTableCallable; + } + + @Override + public OperationCallable + updateTableOperationCallable() { + return updateTableOperationCallable; + } + + @Override + public UnaryCallable deleteTableCallable() { + return deleteTableCallable; + } + + @Override + public UnaryCallable undeleteTableCallable() { + return undeleteTableCallable; + } + + @Override + public OperationCallable + undeleteTableOperationCallable() { + return undeleteTableOperationCallable; + } + + @Override + public UnaryCallable createAuthorizedViewCallable() { + return createAuthorizedViewCallable; + } + + @Override + public OperationCallable< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationCallable() { + return createAuthorizedViewOperationCallable; + } + + @Override + public UnaryCallable + listAuthorizedViewsCallable() { + return listAuthorizedViewsCallable; + } + + @Override + public UnaryCallable + listAuthorizedViewsPagedCallable() { + return listAuthorizedViewsPagedCallable; + } + + @Override + public UnaryCallable getAuthorizedViewCallable() { + return getAuthorizedViewCallable; + } + + @Override + public UnaryCallable updateAuthorizedViewCallable() { + return updateAuthorizedViewCallable; + } + + @Override + public OperationCallable< + UpdateAuthorizedViewRequest, AuthorizedView, UpdateAuthorizedViewMetadata> + updateAuthorizedViewOperationCallable() { + return updateAuthorizedViewOperationCallable; + } + + @Override + public UnaryCallable deleteAuthorizedViewCallable() { + return deleteAuthorizedViewCallable; + } + + @Override + public UnaryCallable modifyColumnFamiliesCallable() { + return modifyColumnFamiliesCallable; + } + + @Override + public UnaryCallable dropRowRangeCallable() { + return dropRowRangeCallable; + } + + @Override + public UnaryCallable + generateConsistencyTokenCallable() { + return generateConsistencyTokenCallable; + } + + @Override + public UnaryCallable + checkConsistencyCallable() { + return checkConsistencyCallable; + } + + @Override + public UnaryCallable snapshotTableCallable() { + return snapshotTableCallable; + } + + @Override + public OperationCallable + snapshotTableOperationCallable() { + return snapshotTableOperationCallable; + } + + @Override + public UnaryCallable getSnapshotCallable() { + return getSnapshotCallable; + } + + @Override + public UnaryCallable listSnapshotsCallable() { + return listSnapshotsCallable; + } + + @Override + public UnaryCallable + listSnapshotsPagedCallable() { + return listSnapshotsPagedCallable; + } + + @Override + public UnaryCallable deleteSnapshotCallable() { + return deleteSnapshotCallable; + } + + @Override + public UnaryCallable createBackupCallable() { + return createBackupCallable; + } + + @Override + public OperationCallable + createBackupOperationCallable() { + return createBackupOperationCallable; + } + + @Override + public UnaryCallable getBackupCallable() { + return getBackupCallable; + } + + @Override + public UnaryCallable updateBackupCallable() { + return updateBackupCallable; + } + + @Override + public UnaryCallable deleteBackupCallable() { + return deleteBackupCallable; + } + + @Override + public UnaryCallable listBackupsCallable() { + return listBackupsCallable; + } + + @Override + public UnaryCallable listBackupsPagedCallable() { + return listBackupsPagedCallable; + } + + @Override + public UnaryCallable restoreTableCallable() { + return restoreTableCallable; + } + + @Override + public OperationCallable + restoreTableOperationCallable() { + return restoreTableOperationCallable; + } + + @Override + public UnaryCallable copyBackupCallable() { + return copyBackupCallable; + } + + @Override + public OperationCallable + copyBackupOperationCallable() { + return copyBackupOperationCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public UnaryCallable createSchemaBundleCallable() { + return createSchemaBundleCallable; + } + + @Override + public OperationCallable + createSchemaBundleOperationCallable() { + return createSchemaBundleOperationCallable; + } + + @Override + public UnaryCallable updateSchemaBundleCallable() { + return updateSchemaBundleCallable; + } + + @Override + public OperationCallable + updateSchemaBundleOperationCallable() { + return updateSchemaBundleOperationCallable; + } + + @Override + public UnaryCallable getSchemaBundleCallable() { + return getSchemaBundleCallable; + } + + @Override + public UnaryCallable + listSchemaBundlesCallable() { + return listSchemaBundlesCallable; + } + + @Override + public UnaryCallable + listSchemaBundlesPagedCallable() { + return listSchemaBundlesPagedCallable; + } + + @Override + public UnaryCallable deleteSchemaBundleCallable() { + return deleteSchemaBundleCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/Version.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/Version.java new file mode 100644 index 000000000000..13df7919364d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:google-cloud-bigtable:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Status.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Status.java new file mode 100644 index 000000000000..8ee3f54b071c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Status.java @@ -0,0 +1,131 @@ +/* + * 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.cloud.bigtable.common; + +import com.google.common.base.Objects; +import java.io.Serializable; + +/** + * The `Status` type defines a logical error model. Each `Status` message contains an error code and + * a error message. + * + *

This primarily wraps the protobuf {@link com.google.rpc.Status}. + */ +public final class Status implements Serializable { + private static final long serialVersionUID = -5512896228725308380L; + + public enum Code { + OK(com.google.rpc.Code.OK), + CANCELLED(com.google.rpc.Code.CANCELLED), + UNKNOWN(com.google.rpc.Code.UNKNOWN), + INVALID_ARGUMENT(com.google.rpc.Code.INVALID_ARGUMENT), + DEADLINE_EXCEEDED(com.google.rpc.Code.DEADLINE_EXCEEDED), + NOT_FOUND(com.google.rpc.Code.NOT_FOUND), + ALREADY_EXISTS(com.google.rpc.Code.ALREADY_EXISTS), + PERMISSION_DENIED(com.google.rpc.Code.PERMISSION_DENIED), + UNAUTHENTICATED(com.google.rpc.Code.UNAUTHENTICATED), + RESOURCE_EXHAUSTED(com.google.rpc.Code.RESOURCE_EXHAUSTED), + FAILED_PRECONDITION(com.google.rpc.Code.FAILED_PRECONDITION), + ABORTED(com.google.rpc.Code.ABORTED), + OUT_OF_RANGE(com.google.rpc.Code.OUT_OF_RANGE), + UNIMPLEMENTED(com.google.rpc.Code.UNIMPLEMENTED), + INTERNAL(com.google.rpc.Code.INTERNAL), + UNAVAILABLE(com.google.rpc.Code.UNAVAILABLE), + DATA_LOSS(com.google.rpc.Code.DATA_LOSS), + + /** Code not known by the client, please upgrade your client */ + UNRECOGNIZED(com.google.rpc.Code.UNRECOGNIZED); + + private final com.google.rpc.Code proto; + + public static Code fromProto(com.google.rpc.Code proto) { + for (Code code : values()) { + if (code.proto.equals(proto)) { + return code; + } + } + return UNRECOGNIZED; + } + + public static Code fromCodeNumber(int num) { + for (Code code : values()) { + if (code.proto == com.google.rpc.Code.UNRECOGNIZED) { + continue; + } + if (code.proto.getNumber() == num) { + return code; + } + } + return UNRECOGNIZED; + } + + Code(com.google.rpc.Code proto) { + this.proto = proto; + } + + public com.google.rpc.Code toProto() { + return proto; + } + } + + private final com.google.rpc.Status proto; + + /** Wraps the given protobuf Status */ + public static Status fromProto(com.google.rpc.Status proto) { + return new Status(proto); + } + + private Status(com.google.rpc.Status proto) { + this.proto = proto; + } + + /** Gets the typesafe code. */ + public Code getCode() { + return Code.fromCodeNumber(proto.getCode()); + } + + /** Gets error message. */ + public String getMessage() { + return proto.getMessage(); + } + + /** Gets the underlying protobuf. */ + public com.google.rpc.Status toProto() { + return proto; + } + + @Override + public String toString() { + return proto.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Status status = (Status) o; + return Objects.equal(proto, status.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java new file mode 100644 index 000000000000..8d283af11b5b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java @@ -0,0 +1,608 @@ +/* + * Copyright 2024 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.cloud.bigtable.common; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.ColumnToIndexMapper; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Parser; +import com.google.protobuf.ProtocolMessageEnum; +import java.time.Instant; +import java.util.List; +import java.util.function.Function; +import javax.annotation.Nonnull; + +/** + * Shared type implementations. Right now this is only used by SqlType but this will become a shared + * definition with Schema type (called {@link com.google.cloud.bigtable.admin.v2.models.Type} right + * now), and any other type interfaces needed in the future. + * + *

This is considered an internal implementation detail and not meant to be used by applications. + * Types should only be used through the relevant interfaces and factories, e.g. {@link SqlType}. + */ +@BetaApi +@InternalApi +@SuppressWarnings({"SameNameButDifferent", "JavaLangClash"}) +public interface Type { + + @AutoValue + abstract class Bytes implements Type, SqlType { + + public static Bytes create() { + return DefaultInstances.BYTES; + } + + @Override + public Code getCode() { + return Code.BYTES; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class String implements Type, SqlType { + public static String create() { + return DefaultInstances.STRING; + } + + @Override + public Code getCode() { + return Code.STRING; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Int64 implements Type, SqlType { + public static Int64 create() { + return DefaultInstances.INT64; + } + + @Override + public Code getCode() { + return Code.INT64; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Float64 implements Type, SqlType { + public static Float64 create() { + return DefaultInstances.FLOAT64; + } + + @Override + public Code getCode() { + return Code.FLOAT64; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Float32 implements Type, SqlType { + public static Float32 create() { + return DefaultInstances.FLOAT32; + } + + @Override + public Code getCode() { + return Code.FLOAT32; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Bool implements Type, SqlType { + public static Bool create() { + return DefaultInstances.BOOL; + } + + @Override + public Code getCode() { + return Code.BOOL; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Timestamp implements Type, SqlType { + public static Timestamp create() { + return DefaultInstances.TIMESTAMP; + } + + @Override + public Code getCode() { + return Code.TIMESTAMP; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + @AutoValue + abstract class Date implements Type, SqlType { + public static Date create() { + return DefaultInstances.DATE; + } + + @Override + public Code getCode() { + return Code.DATE; + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + /** + * This is a special version of struct that is intended to only be used in the {@link + * com.google.cloud.bigtable.data.v2.models.sql.StructReader} getters that require types. We don't + * want users to need to specify the struct schema when the schema will be validated on calls to + * {@link com.google.cloud.bigtable.data.v2.models.sql.StructReader} methods on the struct. + * + *

Any attempts to interact with the schema will throw an exception. + * + *

For example the historical map data type uses this as follows: + * + *

{@code
+   * Map> historicalMap =
+   *     resultSet.getMap(
+   *        "cf",
+   *        SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.struct())));
+   * Struct struct = historicalMap.get("column").get(0);
+   * // Struct schema will be validated here so there's no need for users to pass the schema to getMap above
+   * ByteString value = struct.getBytes("value");
+   * }
+ */ + @AutoValue + abstract class SchemalessStruct implements Type, SqlType.Struct { + public static SchemalessStruct create() { + return DefaultInstances.SCHEMALESS_STRUCT; + } + + @Override + public Code getCode() { + return Code.STRUCT; + } + + @Override + public List getFields() { + throw new UnsupportedOperationException( + "Attempting to access schema of Schemaless Struct. These structs should only be used for" + + " typing of StructReader data access calls."); + } + + @Override + public SqlType getType(int fieldIndex) { + throw new UnsupportedOperationException( + "Attempting to access schema of Schemaless Struct. These structs should only be used for" + + " typing of StructReader data access calls."); + } + + @Override + public SqlType getType(java.lang.String fieldName) { + throw new UnsupportedOperationException( + "Attempting to access schema of Schemaless Struct. These structs should only be used for" + + " typing of StructReader data access calls."); + } + + @Override + public int getColumnIndex(java.lang.String fieldName) { + throw new UnsupportedOperationException( + "Attempting to access schema of Schemaless Struct. These structs should only be used for" + + " typing of StructReader data access calls."); + } + + @Override + public final java.lang.String toString() { + return getCode().name(); + } + } + + /** + * Struct implementation that contains a schema that users can access. This should never be + * constructed by users. It is only intended to be created directly from Type protobufs. + */ + class StructWithSchema extends ColumnToIndexMapper implements Type, SqlType.Struct { + + private final List fields; + + @InternalApi("Visible for testing") + public StructWithSchema(List fields) { + super(fields); + this.fields = fields; + } + + @InternalApi("Visible for testing") + @AutoValue + public abstract static class Field implements SqlType.Struct.Field { + public static Field fromProto(com.google.bigtable.v2.Type.Struct.Field proto) { + return new AutoValue_Type_StructWithSchema_Field( + proto.getFieldName(), SqlType.fromProto(proto.getType())); + } + + @Override + public abstract java.lang.String name(); + + @Override + public abstract SqlType type(); + } + + public static StructWithSchema fromProto(com.google.bigtable.v2.Type.Struct proto) { + ImmutableList.Builder fields = ImmutableList.builder(); + for (com.google.bigtable.v2.Type.Struct.Field protoField : proto.getFieldsList()) { + fields.add(Field.fromProto(protoField)); + } + return new StructWithSchema(fields.build()); + } + + @Override + public Code getCode() { + return Code.STRUCT; + } + + @Override + public List getFields() { + return fields; + } + + @Override + public SqlType getType(int fieldIndex) { + return fields.get(fieldIndex).type(); + } + + @Override + public SqlType getType(java.lang.String fieldName) { + int index = getColumnIndex(fieldName); + return getType(index); + } + + @Override + @SuppressWarnings("EqualsGetClass") + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + StructWithSchema struct = (StructWithSchema) obj; + // Everything is derived from fields so that's all we need to compare; + return Objects.equal(getFields(), struct.getFields()); + } + + @Override + public int hashCode() { + // Everything is derived from fields so that's all we need; + return Objects.hashCode(fields); + } + + @Override + public final java.lang.String toString() { + return getCode().name() + "{fields=" + fields.toString() + "}"; + } + } + + @AutoValue + abstract class Array implements Type, SqlType.Array { + // Do we need non-sql type array elements? Might get messy + public static Type.Array create(SqlType elemType) { + return new AutoValue_Type_Array<>(elemType); + } + + protected abstract SqlType elementType(); + + @Override + public Code getCode() { + return Code.ARRAY; + } + + @Override + public SqlType getElementType() { + return elementType(); + } + + @Override + public final java.lang.String toString() { + return getCode().name() + "{elementType=" + getElementType().getCode() + "}"; + } + } + + @AutoValue + abstract class Map implements Type, SqlType.Map { + // Same question as for array + public static Type.Map create(SqlType keyType, SqlType valueType) { + return new AutoValue_Type_Map<>(keyType, valueType); + } + + protected abstract SqlType keyType(); + + protected abstract SqlType valueType(); + + @Override + public Code getCode() { + return Code.MAP; + } + + @Override + public SqlType getKeyType() { + return keyType(); + } + + @Override + public SqlType getValueType() { + return valueType(); + } + + @Override + public final java.lang.String toString() { + return getCode().name() + + "{keyType=" + + getKeyType().toString() + + ", valueType=" + + getValueType().toString() + + "}"; + } + } + + @AutoValue + abstract class Proto implements Type, SqlType.Proto { + + public static SqlType.Proto create(T message) { + Preconditions.checkNotNull( + message, + "Proto message may not be null. Use 'MyProtoMessage::getDefaultInstance()' as a parameter" + + " value."); + return new AutoValue_Type_Proto<>(message); + } + + @Nonnull + abstract T getMessage(); + + @Override + public Code getCode() { + return Code.PROTO; + } + + @Nonnull + @Override + public Parser getParserForType() { + return (Parser) getMessage().getParserForType(); + } + + @Override + public java.lang.String getMessageName() { + return getMessage().getDescriptorForType().getFullName(); + } + + @Override + public final java.lang.String toString() { + return getCode().name() + "{message=" + getMessageName() + "}"; + } + } + + @AutoValue + abstract class Enum implements Type, SqlType.Enum { + + public static SqlType.Enum create( + Function forNumber) { + Preconditions.checkNotNull( + forNumber, "Method may not be null. Use 'MyProtoEnum::forNumber' as a parameter value."); + return new AutoValue_Type_Enum<>(forNumber); + } + + @Nonnull + @Override + public abstract Function getForNumber(); + + @Override + public java.lang.String getEnumName() { + T thisEnum = getForNumber().apply(0); + if (thisEnum == null) { + return ""; + } + return thisEnum.getDescriptorForType().getFullName(); + } + + @Override + public Code getCode() { + return Code.ENUM; + } + + @Override + public final java.lang.String toString() { + return getCode().name() + "{enum=" + getEnumName() + "}"; + } + + @Override + public final boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Type.Enum)) { + return false; + } + Type.Enum that = (Type.Enum) o; + // We don't want to compare functions directly, so try to get the enum descriptor and compare + // those. + T thisEnum = getForNumber().apply(0); + Object thatEnum = that.getForNumber().apply(0); + + if (thisEnum == null || thatEnum == null) { + // Can't determine equality, fallback to object equality on the function. + return getForNumber().equals(that.getForNumber()); + } + return thisEnum + .getDescriptorForType() + .getFullName() + .equals(((ProtocolMessageEnum) thatEnum).getDescriptorForType().getFullName()); + } + + @Override + public final int hashCode() { + T thisEnum = getForNumber().apply(0); + if (thisEnum == null) { + return getForNumber().hashCode(); + } + return java.util.Objects.hash(getCode(), thisEnum.getDescriptorForType().getFullName()); + } + } + + /** + * This is a special version of proto that is intended to only be used internally, to facilitate + * proto schema parsing, which does not have the full information required to parse the protobuf + * messages. + * + *

Any attempts to call getParserForType() will throw an exception. + */ + @AutoValue + abstract class SchemalessProto implements SqlType.Proto { + + public static SchemalessProto fromProto(com.google.bigtable.v2.Type.Proto proto) { + return create(proto.getMessageName(), proto.getSchemaBundleId()); + } + + public static SchemalessProto create( + java.lang.String messageName, java.lang.String schemaBundleId) { + return new AutoValue_Type_SchemalessProto(messageName, schemaBundleId); + } + + @Override + public abstract java.lang.String getMessageName(); + + public abstract java.lang.String schemaBundleId(); + + @Override + public Parser getParserForType() { + throw new UnsupportedOperationException( + "Cannot get parser for unresolved proto type. Please use the getProtoMessage overload" + + " that takes a message instance."); + } + + @Override + public Code getCode() { + return Code.PROTO; + } + + @Override + public final java.lang.String toString() { + return getCode().name() + + "{messageName=" + + getMessageName() + + ", schemaBundleId=" + + schemaBundleId() + + "}"; + } + } + + /** + * This is a special version of enum that is intended to only be used internally, to facilitate + * enum schema parsing, which does not have the full information required to parse the protobuf + * enum messages. + * + *

Any attempts to call getForNumber() will throw an exception. + */ + @AutoValue + abstract class SchemalessEnum implements SqlType.Enum { + + public static SchemalessEnum fromProto(com.google.bigtable.v2.Type.Enum proto) { + return create(proto.getEnumName(), proto.getSchemaBundleId()); + } + + public static SchemalessEnum create( + java.lang.String enumName, java.lang.String schemaBundleId) { + return new AutoValue_Type_SchemalessEnum(enumName, schemaBundleId); + } + + @Override + public abstract java.lang.String getEnumName(); + + public abstract java.lang.String schemaBundleId(); + + @Override + public Function getForNumber() { + throw new UnsupportedOperationException( + "Cannot get forNumber for unresolved enum type. Please use the getProtoEnum overload that" + + " takes a forNumber function."); + } + + @Override + public Code getCode() { + return Code.ENUM; + } + + @Override + public final java.lang.String toString() { + return getCode().name() + + "{enumName=" + + getEnumName() + + ", schemaBundleId=" + + schemaBundleId() + + "}"; + } + } + + // Implementation detail to make singleton instances private without referencing the concrete + // autovalue generated class from the abstract base classes. + @InternalApi + class DefaultInstances { + + private static final Bytes BYTES = new AutoValue_Type_Bytes(); + private static final String STRING = new AutoValue_Type_String(); + private static final Int64 INT64 = new AutoValue_Type_Int64(); + private static final Float64 FLOAT64 = new AutoValue_Type_Float64(); + private static final Float32 FLOAT32 = new AutoValue_Type_Float32(); + private static final Bool BOOL = new AutoValue_Type_Bool(); + private static final Timestamp TIMESTAMP = new AutoValue_Type_Timestamp(); + private static final Date DATE = new AutoValue_Type_Date(); + private static final SchemalessStruct SCHEMALESS_STRUCT = new AutoValue_Type_SchemalessStruct(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java new file mode 100644 index 000000000000..85529de8d904 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -0,0 +1,2762 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl; +import com.google.cloud.bigtable.data.v2.internal.ResultSetImpl; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Client for reading from and writing to existing Bigtable tables. + * + *

This class provides the ability to make remote calls to the backing service. Sample code to + * get started: + * + *

{@code
+ * // One instance per application.
+ * BigtableDataClient client = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")
+ *
+ * for(Row row : client.readRows(Query.create("[TABLE]"))) {
+ *   // Do something with row
+ * }
+ *
+ * // Cleanup during application shutdown.
+ * client.close();
+ * }
+ * + *

Creating a new client is a very expensive operation and should only be done once and shared in + * an application. However, close() needs to be called on the client object to clean up resources + * such as threads during application shutdown. + * + *

This client can be safely shared across multiple threads except for the Batcher instances + * returned from bulk operations, eg. `newBulkMutationBatcher()`, `newBulkReadRowsBatcher()`. + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method, like `readRows()`. With this type of method, the fields of the + * request type have been converted into function parameters. It may be the case that not all + * fields are available as parameters, and not every API method will have a flattened method + * entry point. + *
  2. A "callable" method, like `readRowsCallable()`. This type of method takes no parameters and + * returns an immutable API callable object, which can be used to initiate calls to the + * service. + *
+ * + *

Taking ReadRows as an example for callable: + * + *

{@code
+ * // These two invocation are equivalent
+ * ServerStream stream1 = client.readRows(query);
+ * ServerStream stream2 = client.readRowsCallable().call(query);
+ *
+ * // These two invocation are also equivalent
+ * client.readRowsAsync(query, observer);
+ * client.readRowsCallable().call(query, observer);
+ * }
+ * + *

All RPC related errors are represented as subclasses of {@link + * com.google.api.gax.rpc.ApiException}. For example, a nonexistent table will trigger a {@link + * com.google.api.gax.rpc.NotFoundException}. Async methods will wrap the error inside the future. + * Synchronous methods will re-throw the async error but will try to preserve the caller's + * stacktrace by attaching a suppressed exception at the callsite. This allows callers to use + * typesafe exceptions, without losing their callsite. Streaming methods (ie. readRows) will + * re-throw the async exception (like sync methods) when starting iteration. + * + *

See the individual methods for example code. + * + *

This class can be customized by passing in a custom instance of BigtableDataSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * BigtableDataSettings settings =
+ *     BigtableDataSettings.newBuilder()
+ *         .setProjectId("[PROJECT]")
+ *         .setInstanceId("[INSTANCE]")
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * BigtableDataClient client = BigtableDataClient.create(settings);
+ * }
+ * + * To customize the endpoint: + * + *
{@code
+ * BigtableDataSettings.Builder settingsBuilder =
+ *     BigtableDataSettings.newBuilder()
+ *       .setProjectId("[PROJECT]")
+ *       .setInstanceId("[INSTANCE]");
+ *
+ * settingsBuilder.stubSettings()
+ *     .setEndpoint(myEndpoint).build();
+ *
+ * BigtableDataClient client = BigtableDataClient.create(settings.build());
+ * }
+ */ +public class BigtableDataClient implements AutoCloseable { + private final EnhancedBigtableStub stub; + + /** + * Constructs an instance of BigtableDataClient with default settings. + * + * @param projectId The project id of the instance to connect to. + * @param instanceId The id of the instance to connect to. + * @return A new client. + * @throws IOException If any. + */ + public static BigtableDataClient create(String projectId, String instanceId) throws IOException { + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + return create(settings); + } + + /** + * Constructs an instance of BigtableDataClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static BigtableDataClient create(BigtableDataSettings settings) throws IOException { + EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.getStubSettings()); + return new BigtableDataClient(stub); + } + + @InternalApi("Visible for testing") + BigtableDataClient(EnhancedBigtableStub stub) { + this.stub = stub; + } + + /** + * Confirms synchronously if given row key exists or not. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   String key = "key";
+   *
+   *   boolean isRowPresent = bigtableDataClient.exists(tableId, key);
+   *
+   *   // Do something with result, for example, display a message
+   *   if(isRowPresent) {
+   *     System.out.println(key + " is present");
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#exists(TargetId, String)} instead. + */ + @Deprecated + public boolean exists(String tableId, String rowKey) { + return ApiExceptions.callAndTranslateApiException(existsAsync(tableId, rowKey)); + } + + /** + * Confirms synchronously if given row key exists or not. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   ByteString key = ByteString.copyFromUtf8("key");
+   *
+   *   boolean isRowPresent = bigtableDataClient.exists(tableId, key);
+   *
+   *   // Do something with result, for example, display a message
+   *   if(isRowPresent) {
+   *     System.out.println(key.toStringUtf8() + " is present");
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#exists(TargetId, ByteString)} instead. + */ + @Deprecated + public boolean exists(String tableId, ByteString rowKey) { + return ApiExceptions.callAndTranslateApiException(existsAsync(tableId, rowKey)); + } + + /** + * Confirms synchronously if given row key exists or not on the specified {@link TargetId}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   String key = "key";
+   *
+   *   boolean isRowPresent = bigtableDataClient.exists(TableId.of(tableId), key);
+   *
+   *   // Do something with result, for example, display a message
+   *   if(isRowPresent) {
+   *     System.out.println(key + " is present");
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public boolean exists(TargetId targetId, String rowKey) { + return ApiExceptions.callAndTranslateApiException(existsAsync(targetId, rowKey)); + } + + /** + * Confirms synchronously if given row key exists or not on the specified {@link TargetId}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   ByteString key = ByteString.copyFromUtf8("key");
+   *
+   *   boolean isRowPresent = bigtableDataClient.exists(TableId.of(tableId), key);
+   *
+   *   // Do something with result, for example, display a message
+   *   if(isRowPresent) {
+   *     System.out.println(key.toStringUtf8() + " is present");
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public boolean exists(TargetId targetId, ByteString rowKey) { + return ApiExceptions.callAndTranslateApiException(existsAsync(targetId, rowKey)); + } + + /** + * Confirms asynchronously if given row key exists or not. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   final String key = "key";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.existsAsync(tableId, key);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *     public void onSuccess(Boolean isRowPresent) {
+   *       if(isRowPresent) {
+   *         System.out.println(key + " is present");
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#existsAsync(TargetId, String)} instead. + */ + @Deprecated + public ApiFuture existsAsync(String tableId, String rowKey) { + return existsAsync(tableId, ByteString.copyFromUtf8(rowKey)); + } + + /** + * Confirms asynchronously if given row key exists or not. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   final ByteString key = ByteString.copyFromUtf8("key");
+   *
+   *   ApiFuture futureResult = bigtableDataClient.existsAsync(tableId, key);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *     public void onSuccess(Boolean isRowPresent) {
+   *       if(isRowPresent) {
+   *         System.out.println(key.toStringUtf8() + " is present");
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#existsAsync(TargetId, ByteString)} instead. + */ + @Deprecated + public ApiFuture existsAsync(String tableId, ByteString rowKey) { + return existsAsync(TableId.of(tableId), rowKey); + } + + /** + * Confirms asynchronously if given row key exists or not on the specified {@link TargetId}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   final String key = "key";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.existsAsync(TableId.of(tableId), key);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *     public void onSuccess(Boolean isRowPresent) {
+   *       if(isRowPresent) {
+   *         System.out.println(key + " is present");
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture existsAsync(TargetId targetId, String rowKey) { + return existsAsync(targetId, ByteString.copyFromUtf8(rowKey)); + } + + /** + * Confirms asynchronously if given row key exists or not on the specified {@link TargetId}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *   final ByteString key = ByteString.copyFromUtf8("key");
+   *
+   *   ApiFuture futureResult = bigtableDataClient.existsAsync(TableId.of(tableId), key);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *     public void onSuccess(Boolean isRowPresent) {
+   *       if(isRowPresent) {
+   *         System.out.println(key.toStringUtf8() + " is present");
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture existsAsync(TargetId targetId, ByteString rowKey) { + Query query = + Query.create(targetId) + .rowKey(rowKey) + .filter( + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerRow(1)) + .filter(FILTERS.value().strip())); + ApiFuture resultFuture = stub.readRowCallable().futureCall(query); + return ApiFutures.transform( + resultFuture, + new ApiFunction() { + @Override + public Boolean apply(Row row) { + return row != null; + } + }, + MoreExecutors.directExecutor()); + } + + /** + * Convenience method for synchronously reading a single row. If the row does not exist, the value + * will be null. + * + *

Sample code: + * + *

{code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   * String tableId = "[TABLE]";
+   *
+   * Row row = bigtableDataClient.readRow(tableId, ByteString.copyFromUtf8("key"));
+   * // Do something with row, for example, display all cells
+   * if(row != null) {
+   *   System.out.println(row.getKey().toStringUtf8());
+   *   for(RowCell cell : row.getCells()) {
+   *      System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *         cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *   }
+   * }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#readRow(TargetId, ByteString)} instead. + */ + @Deprecated + public Row readRow(String tableId, ByteString rowKey) { + return ApiExceptions.callAndTranslateApiException(readRowAsync(tableId, rowKey, null)); + } + + /** + * Convenience method for synchronously reading a single row. If the row does not exist, the value + * will be null. + * + *

Sample code: + * + *

{code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Row row = bigtableDataClient.readRow(tableId, "key");
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#readRow(TargetId, String)} instead. + */ + @Deprecated + public Row readRow(String tableId, String rowKey) { + return ApiExceptions.callAndTranslateApiException( + readRowAsync(tableId, ByteString.copyFromUtf8(rowKey), null)); + } + + /** + * Convenience method for synchronously reading a single row. If the row does not exist, the value + * will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   Row row = bigtableDataClient.readRow(tableId, "key", filter);
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#readRow(TargetId, String, Filter)} instead. + */ + @Deprecated + public Row readRow(String tableId, String rowKey, @Nullable Filter filter) { + return ApiExceptions.callAndTranslateApiException( + readRowAsync(tableId, ByteString.copyFromUtf8(rowKey), filter)); + } + + /** + * Convenience method for synchronously reading a single row. If the row does not exist, the value + * will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   Row row = bigtableDataClient.readRow(tableId, ByteString.copyFromUtf8("key"), filter);
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#readRow(TargetId, ByteString, Filter)} + * instead. + */ + @Deprecated + public Row readRow(String tableId, ByteString rowKey, @Nullable Filter filter) { + return ApiExceptions.callAndTranslateApiException(readRowAsync(tableId, rowKey, filter)); + } + + /** + * Convenience method for synchronously reading a single row on the specified {@link TargetId}. If + * the row does not exist, the value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Row row = bigtableDataClient.readRow(TableId.of(tableId), ByteString.copyFromUtf8("key"));
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Row readRow(TargetId targetId, ByteString rowKey) { + return ApiExceptions.callAndTranslateApiException(readRowAsync(targetId, rowKey, null)); + } + + /** + * Convenience method for synchronously reading a single row on the specified {@link TargetId}. If + * the row does not exist, the value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Row row = bigtableDataClient.readRow(TableId.of(tableId), "key");
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Row readRow(TargetId targetId, String rowKey) { + return ApiExceptions.callAndTranslateApiException( + readRowAsync(targetId, ByteString.copyFromUtf8(rowKey), null)); + } + + /** + * Convenience method for synchronously reading a single row on the specified {@link TargetId}. If + * the row does not exist, the value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   // Build the filter expression
+   *   Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   Row row = bigtableDataClient.readRow(TableId.of(tableId), "key", filter);
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Row readRow(TargetId targetId, String rowKey, @Nullable Filter filter) { + return ApiExceptions.callAndTranslateApiException( + readRowAsync(targetId, ByteString.copyFromUtf8(rowKey), filter)); + } + + /** + * Convenience method for synchronously reading a single row on the specified {@link TargetId}. If + * the row does not exist, the value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   // Build the filter expression
+   *   Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   Row row = bigtableDataClient.readRow(TableId.of(tableId), ByteString.copyFromUtf8("key"), filter);
+   *   // Do something with row, for example, display all cells
+   *   if(row != null) {
+   *     System.out.println(row.getKey().toStringUtf8());
+   *      for(RowCell cell : row.getCells()) {
+   *        System.out.printf("Family: %s   Qualifier: %s   Value: %s", cell.getFamily(),
+   *           cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8());
+   *      }
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Row readRow(TargetId targetId, ByteString rowKey, @Nullable Filter filter) { + return ApiExceptions.callAndTranslateApiException(readRowAsync(targetId, rowKey, filter)); + } + + /** + * Convenience method for asynchronously reading a single row. If the row does not exist, the + * future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId,  "key");
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, String)} instead. + */ + @Deprecated + public ApiFuture readRowAsync(String tableId, String rowKey) { + return readRowAsync(tableId, ByteString.copyFromUtf8(rowKey), null); + } + + /** + * Convenience method for asynchronously reading a single row. If the row does not exist, the + * future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId,  ByteString.copyFromUtf8("key"));
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row row) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, ByteString)} instead. + */ + @Deprecated + public ApiFuture readRowAsync(String tableId, ByteString rowKey) { + return readRowAsync(tableId, rowKey, null); + } + + /** + * Convenience method for asynchronously reading a single row. If the row does not exist, the + * future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *  // Build the filter expression
+   *   Filters.Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId, "key", filter);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row row) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, String, Filter)} + * instead. + */ + @Deprecated + public ApiFuture readRowAsync(String tableId, String rowKey, @Nullable Filter filter) { + return readRowAsync(tableId, ByteString.copyFromUtf8(rowKey), filter); + } + + /** + * Convenience method for asynchronously reading a single row. If the row does not exist, the + * future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *  // Build the filter expression
+   *  Filters.Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(tableId, ByteString.copyFromUtf8("key"), filter);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row row) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, ByteString, Filter)} + * instead. + */ + @Deprecated + public ApiFuture readRowAsync(String tableId, ByteString rowKey, @Nullable Filter filter) { + return readRowAsync(TableId.of(tableId), rowKey, filter); + } + + /** + * Convenience method for asynchronously reading a single row on the specified {@link TargetId}. + * If the row does not exist, the future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), "key");
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture readRowAsync(TargetId targetId, String rowKey) { + return readRowAsync(targetId, ByteString.copyFromUtf8(rowKey), null); + } + + /** + * Convenience method for asynchronously reading a single row on the specified {@link TargetId}. + * If the row does not exist, the future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), ByteString.copyFromUtf8("key"));
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture readRowAsync(TargetId targetId, ByteString rowKey) { + return readRowAsync(targetId, rowKey, null); + } + + /** + * Convenience method for asynchronously reading a single row on the specified {@link TargetId}. + * If the row does not exist, the future's value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   // Build the filter expression
+   *   Filters.Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), "key", filter);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture readRowAsync(TargetId targetId, String rowKey, @Nullable Filter filter) { + return readRowAsync(targetId, ByteString.copyFromUtf8(rowKey), filter); + } + + /** + * Convenience method for asynchronously reading a single row on the specified {@link TargetId}. + * If the row does not exist, the value will be null. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   // Build the filter expression
+   *   Filters.Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.qualifier().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), ByteString.copyFromUtf8("key"), filter);
+   *
+   *   ApiFutures.addCallback(futureResult, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       if (result != null) {
+   *          System.out.println("Got row: " + result);
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture readRowAsync( + TargetId targetId, ByteString rowKey, @Nullable Filter filter) { + Query query = Query.create(targetId).rowKey(rowKey); + if (filter != null) { + query = query.filter(filter); + } + return readRowCallable().futureCall(query); + } + + /** + * Reads a single row. The returned callable object allows for customization of api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .rowKey("[KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Synchronous invocation
+   *   try {
+   *     Row row = bigtableDataClient.readRowCallable().call(query);
+   *     if (row == null) {
+   *       System.out.println("Row not found");
+   *     }
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Asynchronous invocation
+   *   ApiFuture rowFuture = bigtableDataClient.readRowCallable().futureCall(query);
+   *
+   *   ApiFutures.addCallback(rowFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row row) {
+   *       if (row == null) {
+   *         System.out.println("Row not found");
+   *       }
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see UnaryCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + public UnaryCallable readRowCallable() { + return stub.readRowCallable(); + } + + /** + * Reads a single row. This callable allows for customization of the logical representation of a + * row. It's meant for advanced use cases. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .rowKey("[KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Synchronous invocation
+   *   CustomRow row = bigtableDataClient.readRowCallable(new CustomRowAdapter()).call(query));
+   *   // Do something with row
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + public UnaryCallable readRowCallable(RowAdapter rowAdapter) { + return stub.createReadRowCallable(rowAdapter); + } + + /** + * Convenience method for synchronously streaming the results of a {@link Query}. The returned + * ServerStream instance is not threadsafe, it can only be used from single thread. + * + *

Sample code: + * + *

{@code
+   * // Import the filter DSL
+   * import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;
+   *
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   try {
+   *     ServerStream stream = bigtableDataClient.readRows(query);
+   *     int count = 0;
+   *
+   *     // Iterator style
+   *     for (Row row : stream) {
+   *       if (++count > 10) {
+   *         stream.cancel();
+   *         break;
+   *       }
+   *       // Do something with row
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + public ServerStream readRows(Query query) { + return readRowsCallable().call(query); + } + + /** + * Convenience method for asynchronously streaming the results of a {@link Query}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   bigtableDataClient.readRowsAsync(query, new ResponseObserver() {
+   *     StreamController controller;
+   *     int count = 0;
+   *
+   *     public void onStart(StreamController controller) {
+   *       this.controller = controller;
+   *     }
+   *     public void onResponse(Row row) {
+   *       if (++count > 10) {
+   *         controller.cancel();
+   *         return;
+   *       }
+   *       // Do something with Row
+   *     }
+   *     public void onError(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onComplete() {
+   *       // Handle stream completion
+   *     }
+   *   });
+   * }
+   * }
+ */ + public void readRowsAsync(Query query, ResponseObserver observer) { + readRowsCallable().call(query, observer); + } + + /** + * Streams back the results of the query. The returned callable object allows for customization of + * api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Iterator style
+   *   try {
+   *     for(Row row : bigtableDataClient.readRowsCallable().call(query)) {
+   *       // Do something with row
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Sync style
+   *   try {
+   *     List rows = bigtableDataClient.readRowsCallable().all().call(query);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Point look up
+   *   ApiFuture rowFuture = bigtableDataClient.readRowsCallable().first().futureCall(query);
+   *
+   *   ApiFutures.addCallback(rowFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row result) {
+   *       System.out.println("Got row: " + result);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   *
+   *   // etc
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + public ServerStreamingCallable readRowsCallable() { + return stub.readRowsCallable(); + } + + /** + * Streams back the results of the read query & omits large rows. The returned callable object + * allows for customization of api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Iterator style
+   *   try {
+   *     for(Row row : bigtableDataClient.skipLargeRowsCallable().call(query)) {
+   *       // Do something with row
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Sync style
+   *   try {
+   *     List rows = bigtableDataClient.skipLargeRowsCallable().all().call(query);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // etc
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + @InternalApi("only to be used by Bigtable beam connector") + public ServerStreamingCallable skipLargeRowsCallable() { + return stub.skipLargeRowsCallable(); + } + + /** + * Streams back the results of the query. This callable allows for customization of the logical + * representation of a row. It's meant for advanced use cases. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Iterator style
+   *   try {
+   *     for(CustomRow row : bigtableDataClient.readRowsCallable(new CustomRowAdapter()).call(query)) {
+   *       // Do something with row
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + public ServerStreamingCallable readRowsCallable(RowAdapter rowAdapter) { + return stub.createReadRowsCallable(rowAdapter); + } + + /** + * This is an internal API, it is subject to breaking changes and should not be relied on by user + * code + * + *

Streams back the results of the query skipping the large-rows. This callable allows for + * customization of the logical representation of a row. It's meant for advanced use cases. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   Query query = Query.create(tableId)
+   *          .range("[START KEY]", "[END KEY]")
+   *          .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+   *
+   *   // Iterator style
+   *   try {
+   *     for(CustomRow row : bigtableDataClient.skipLargeRowsCallable(new CustomRowAdapter()).call(query)) {
+   *       // Do something with row
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see Query For query options. + * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL. + */ + @InternalApi("only to be used by Bigtable beam connector") + public ServerStreamingCallable skipLargeRowsCallable( + RowAdapter rowAdapter) { + return stub.createSkipLargeRowsCallable(rowAdapter); + } + + /** + * Convenience method to synchronously return a sample of row keys in the table. The returned row + * keys will delimit contiguous sections of the table of approximately equal size, which can be + * used to break up the data for distributed tasks like mapreduces. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE_ID]";
+   *
+   *   List keyOffsets = bigtableDataClient.sampleRowKeys(tableId);
+   *   for(KeyOffset keyOffset : keyOffsets) {
+   *   // Do something with keyOffset
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @deprecated Please use {@link BigtableDataClient#sampleRowKeys(TargetId)} instead. + */ + @Deprecated + public List sampleRowKeys(String tableId) { + return ApiExceptions.callAndTranslateApiException(sampleRowKeysAsync(tableId)); + } + + /** + * Convenience method to synchronously return a sample of row keys on the specified {@link + * TargetId}. + * + *

The returned row keys will delimit contiguous sections of the table of approximately equal + * size, which can be used to break up the data for distributed tasks like mapreduces. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE_ID]";
+   *
+   *   List keyOffsets = bigtableDataClient.sampleRowKeys(TableId.of(tableId));
+   *   for(KeyOffset keyOffset : keyOffsets) {
+   *   // Do something with keyOffset
+   *   }
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + */ + public List sampleRowKeys(TargetId targetId) { + return ApiExceptions.callAndTranslateApiException(sampleRowKeysAsync(targetId)); + } + + /** + * Convenience method to asynchronously return a sample of row keys in the table. The returned row + * keys will delimit contiguous sections of the table of approximately equal size, which can be + * used to break up the data for distributed tasks like mapreduces. + * + *

Sample code: + * + *

{@code
+   * try (BigtableClient bigtableDataClient = BigtableClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ApiFuture> keyOffsetsFuture = bigtableClient.sampleRowKeysAsync("[TABLE]");
+   *
+   *   ApiFutures.addCallback(keyOffsetsFuture, new ApiFutureCallback>() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to sample keys of a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(List keyOffsets) {
+   *       System.out.println("Got key offsets: " + keyOffsets);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#sampleRowKeysAsync(TargetId)} instead. + */ + @Deprecated + public ApiFuture> sampleRowKeysAsync(String tableId) { + return sampleRowKeysAsync(TableId.of(tableId)); + } + + /** + * Convenience method to asynchronously return a sample of row keys on the specified {@link + * TargetId}. + * + *

The returned row keys will delimit contiguous sections of the table of approximately equal + * size, which can be used to break up the data for distributed tasks like mapreduces. + * + *

Sample code: + * + *

{@code
+   * try (BigtableClient bigtableDataClient = BigtableClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE_ID]";
+   *   ApiFuture> keyOffsetsFuture = bigtableClient.sampleRowKeysAsync(TableId.of(tableId));
+   *
+   *   ApiFutures.addCallback(keyOffsetsFuture, new ApiFutureCallback>() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to sample keys of a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(List keyOffsets) {
+   *       System.out.println("Got key offsets: " + keyOffsets);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public ApiFuture> sampleRowKeysAsync(TargetId targetId) { + return sampleRowKeysCallableWithRequest().futureCall(SampleRowKeysRequest.create(targetId)); + } + + /** + * Returns a sample of row keys in the table. The returned row keys will delimit contiguous + * sections of the table of approximately equal size, which can be used to break up the data for + * distributed tasks like mapreduces. The returned callable object allows for customization of api + * invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   // Synchronous invocation
+   *   try {
+   *     List keyOffsets = bigtableDataClient.sampleRowKeysCallable().call("[TABLE]");
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to sample keys of a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Asynchronous invocation
+   *   ApiFuture> keyOffsetsFuture = bigtableDataClient.sampleRowKeysCallable().futureCall("[TABLE]");
+   *
+   *   ApiFutures.addCallback(keyOffsetsFuture, new ApiFutureCallback>() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to sample keys of a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(List keyOffsets) {
+   *       System.out.println("Got key offsets: " + keyOffsets);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#sampleRowKeysCallableWithRequest()} instead. + */ + @Deprecated + public UnaryCallable> sampleRowKeysCallable() { + return stub.sampleRowKeysCallable(); + } + + /** + * Returns a sample of row keys in the table. This callable allows takes a {@link + * SampleRowKeysRequest} object rather than a String input, and thus can be used to sample against + * a specified {@link TargetId}. + * + *

The returned row keys will delimit contiguous sections of the table of approximately equal + * size, which can be used to break up the data for distributed tasks like mapreduces. The + * returned callable object allows for customization of api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   SampleRowKeysRequest sampleRowKeys = SampleRowKeysRequest.create(TableId.of("[TABLE]"));
+   *   // Synchronous invocation
+   *   try {
+   *     List keyOffsets = bigtableDataClient.sampleRowKeysCallableWithRequest().call(sampleRowKeys);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to sample keys of a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Asynchronous invocation
+   *   ApiFuture> keyOffsetsFuture = bigtableDataClient.sampleRowKeysCallableWithRequest().futureCall(sampleRowKeys);
+   *
+   *   ApiFutures.addCallback(keyOffsetsFuture, new ApiFutureCallback>() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to sample keys of a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(List keyOffsets) {
+   *       System.out.println("Got key offsets: " + keyOffsets);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public UnaryCallable> sampleRowKeysCallableWithRequest() { + return stub.sampleRowKeysCallableWithRequest(); + } + + /** + * Convenience method to synchronously mutate a single row atomically. Cells already present in + * the row are left unchanged unless explicitly changed by the {@link RowMutation}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
+   *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
+   *
+   *   bigtableDataClient.mutateRow(mutation);
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + */ + public void mutateRow(RowMutation rowMutation) { + ApiExceptions.callAndTranslateApiException(mutateRowAsync(rowMutation)); + } + + /** + * Convenience method to asynchronously mutate a single row atomically. Cells already present in + * the row are left unchanged unless explicitly changed by the {@link RowMutation}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
+   *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
+   *
+   *   ApiFuture future = bigtableDataClient.mutateRowAsync(mutation);
+   *
+   *   ApiFutures.addCallback(future, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to mutate a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Void ignored) {
+   *       System.out.println("Successfully applied mutation");
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ */ + public ApiFuture mutateRowAsync(RowMutation rowMutation) { + return mutateRowCallable().futureCall(rowMutation); + } + + /** + * Mutates a single row atomically. Cells already present in the row are left unchanged unless + * explicitly changed by the {@link RowMutation}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   RowMutation mutation = RowMutation.create("[TABLE]", "[ROW KEY]")
+   *     .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
+   *
+   *   // Sync style
+   *   try {
+   *     bigtableDataClient.mutateRowCallable().call(mutation);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to mutate a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ */ + public UnaryCallable mutateRowCallable() { + return stub.mutateRowCallable(); + } + + /** + * Convenience method to mutate multiple rows in a batch. Each individual row is mutated + * atomically as in MutateRow, but the entire batch is not executed atomically. This method + * expects the mutations to be pre-batched. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   BulkMutation batch = BulkMutation.create("[TABLE]");
+   *   for (String someValue : someCollection) {
+   *     batch.add("[ROW KEY]", Mutation.create().setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *   }
+   *   bigtableDataClient.bulkMutateRows(batch);
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * } catch(MutateRowsException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + * @throws com.google.cloud.bigtable.data.v2.models.MutateRowsException if any of the entries + * failed to be applied + */ + public void bulkMutateRows(BulkMutation mutation) { + ApiExceptions.callAndTranslateApiException(bulkMutateRowsAsync(mutation)); + } + + /** + * Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, + * but the entire batch is not executed atomically. The returned Batcher instance is not + * threadsafe, it can only be used from single thread. + * + *

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher("[TABLE]")) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkMutationBatcher(TargetId)} instead. + */ + @Deprecated + public Batcher newBulkMutationBatcher(@Nonnull String tableId) { + return newBulkMutationBatcher(tableId, null); + } + + /** + * Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, + * but the entire batch is not executed atomically. The returned Batcher instance is not + * threadsafe, it can only be used from single thread. This method allows customization of the + * underlying RPCs by passing in a {@link com.google.api.gax.grpc.GrpcCallContext}. The same + * context will be reused for all batches. This can be used to customize things like per attempt + * timeouts. + * + *

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher("[TABLE]", GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkMutationBatcher(TargetId, + * GrpcCallContext)} instead. + */ + @Deprecated + public Batcher newBulkMutationBatcher( + @Nonnull String tableId, @Nullable GrpcCallContext ctx) { + return stub.newMutateRowsBatcher(TableId.of(tableId), ctx); + } + + /** + * Mutates multiple rows in a batch on the specified {@link TargetId}. + * + *

Each individual row is mutated atomically as in MutateRow, but the entire batch is not + * executed atomically. The returned Batcher instance is not threadsafe, it can only be used from + * single thread. + * + *

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher(TableId.of("[TABLE]"))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + @BetaApi("This surface is likely to change as the batching surface evolves.") + public Batcher newBulkMutationBatcher(TargetId targetId) { + return newBulkMutationBatcher(targetId, null); + } + + /** + * Mutates multiple rows in a batch on the specified {@link TargetId}. + * + *

Each individual row is mutated atomically as in MutateRow, but the entire batch is not + * executed atomically. The returned Batcher instance is not threadsafe, it can only be used from + * single thread. This method allows customization of the underlying RPCs by passing in a {@link + * com.google.api.gax.grpc.GrpcCallContext}. The same context will be reused for all batches. This + * can be used to customize things like per attempt timeouts. + * + *

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   GrpcCallContext ctx = GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10));
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher(TableId.of("[TABLE]"), ctx)) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + @BetaApi("This surface is likely to change as the batching surface evolves.") + public Batcher newBulkMutationBatcher( + TargetId targetId, @Nullable GrpcCallContext ctx) { + return stub.newMutateRowsBatcher(targetId, ctx); + } + + /** + * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. The + * returned Batcher instance is not threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("[TABLE]")) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkReadRowsBatcher(TargetId)} instead. + */ + @Deprecated + public Batcher newBulkReadRowsBatcher(String tableId) { + return newBulkReadRowsBatcher(tableId, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch. If the row does not exist, the + * value will be null. The returned Batcher instance is not threadsafe, it can only be used from a + * single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("[TABLE]", filter)) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkReadRowsBatcher(TargetId, Filter)} + * instead. + */ + @Deprecated + public Batcher newBulkReadRowsBatcher( + String tableId, @Nullable Filters.Filter filter) { + return newBulkReadRowsBatcher(tableId, filter, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch. If the row does not exist, the + * value will be null. The returned Batcher instance is not threadsafe, it can only be used from a + * single thread. This method allows customization of the underlying RPCs by passing in a {@link + * com.google.api.gax.grpc.GrpcCallContext}. The same context will be reused for all batches. This + * can be used to customize things like per attempt timeouts. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(
+   *    "[TABLE]", filter, GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkReadRowsBatcher(TargetId, Filter, + * GrpcCallContext)} instead. + */ + @Deprecated + public Batcher newBulkReadRowsBatcher( + String tableId, @Nullable Filters.Filter filter, @Nullable GrpcCallContext ctx) { + return newBulkReadRowsBatcher(TableId.of(tableId), filter, ctx); + } + + /** + * Reads rows for given tableId in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(TableId.of("[TABLE]"))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher(TargetId targetId) { + return newBulkReadRowsBatcher(targetId, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(TableId.of("[TABLE]"), filter)) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher( + TargetId targetId, @Nullable Filter filter) { + return newBulkReadRowsBatcher(targetId, filter, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. This method allows customization of the + * underlying RPCs by passing in a {@link com.google.api.gax.grpc.GrpcCallContext}. The same + * context will be reused for all batches. This can be used to customize things like per attempt + * timeouts. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(
+   *    TableId.of("[TABLE]"), filter, GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher( + TargetId targetId, @Nullable Filter filter, @Nullable GrpcCallContext ctx) { + Query query = Query.create(targetId); + if (filter != null) { + query = query.filter(filter); + } + return stub.newBulkReadRowsBatcher(query, ctx); + } + + /** + * Convenience method to mutate multiple rows in a batch. Each individual row is mutated + * atomically as in MutateRow, but the entire batch is not executed atomically. This method + * expects the mutations to be pre-batched. + * + *

Sample code: + * + *

{@code
+   * try (BigtableClient bigtableClient = BigtableClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   BulkMutation batch = BulkMutation.create("[TABLE]");
+   *   for (String someValue : someCollection) {
+   *     ApiFuture entryFuture = batch.add("[ROW KEY]",
+   *       Mutation.create().setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *   }
+   *   ApiFuture resultFuture = bigtableDataClient.bulkMutateRowsAsync(batch);
+   *
+   *   ApiFutures.addCallback(resultFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof BulkMutationFailure) {
+   *         System.out.println("Some entries failed to apply");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Void ignored) {
+   *       System.out.println("Successfully applied all mutation");
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ */ + public ApiFuture bulkMutateRowsAsync(BulkMutation mutation) { + return bulkMutationCallable().futureCall(mutation); + } + + /** + * Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, + * but the entire batch is not executed atomically. This method expects the mutations to be + * pre-batched. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   BulkMutation batch = BulkMutation.create("[TABLE]");
+   *   for (String someValue : someCollection) {
+   *     ApiFuture entryFuture = batch.add("[ROW KEY]",
+   *       Mutation.create().setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]");
+   *   }
+   *   bigtableDataClient.bulkMutationCallable().call(batch);
+   * }
+   * }
+ */ + public UnaryCallable bulkMutationCallable() { + return stub.bulkMutateRowsCallable(); + } + + /** + * Convenience method to synchronously mutate a row atomically based on the output of a filter. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
+   *     .condition(FILTERS.value().regex("old-value"))
+   *     .then(
+   *       Mutation.create()
+   *         .setCell("[FAMILY]", "[QUALIFIER]", "[VALUE]")
+   *       );
+   *
+   *   Boolean result = bigtableDataClient.checkAndMutateRow(mutation);
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + */ + public Boolean checkAndMutateRow(ConditionalRowMutation mutation) { + return ApiExceptions.callAndTranslateApiException(checkAndMutateRowAsync(mutation)); + } + + /** + * Convenience method to asynchronously mutate a row atomically based on the output of a filter. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
+   *     .condition(FILTERS.value().regex("old-value"))
+   *     .then(
+   *       Mutation.create()
+   *         .setCell("[FAMILY]", "[QUALIFIER]", "[VALUE]")
+   *       );
+   *
+   *   ApiFuture future = bigtableDataClient.checkAndMutateRowAsync(mutation);
+   *
+   *   ApiFutures.addCallback(future, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to mutate a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Boolean wasApplied) {
+   *       System.out.println("Row was modified: " + wasApplied);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ */ + public ApiFuture checkAndMutateRowAsync(ConditionalRowMutation mutation) { + return checkAndMutateRowCallable().futureCall(mutation); + } + + /** + * Mutates a row atomically based on the output of a filter. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ConditionalRowMutation mutation = ConditionalRowMutation.create("[TABLE]", "[KEY]")
+   *     .condition(FILTERS.value().regex("old-value"))
+   *     .then(
+   *       Mutation.create()
+   *         .setCell("[FAMILY]", "[QUALIFIER]", "[VALUE]")
+   *       );
+   *
+   *   // Sync style
+   *   try {
+   *     boolean success = bigtableDataClient.checkAndMutateRowCallable().call(mutation);
+   *     if (!success) {
+   *       System.out.println("Row did not match conditions");
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to mutate a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ */ + public UnaryCallable checkAndMutateRowCallable() { + return stub.checkAndMutateRowCallable(); + } + + /** + * Convenience method that synchronously 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. The + * new value for the timestamp is the greater of the existing timestamp or the current server + * time. The method returns the new contents of all modified cells. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
+   *     .increment("[FAMILY]", "[QUALIFIER]", 1)
+   *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
+   *
+   *   Row success = bigtableDataClient.readModifyWriteRow(mutation);
+   * } catch(ApiException e) {
+   *   e.printStackTrace();
+   * }
+   * }
+ * + * @throws com.google.api.gax.rpc.ApiException when a serverside error occurs + */ + public Row readModifyWriteRow(ReadModifyWriteRow mutation) { + return ApiExceptions.callAndTranslateApiException(readModifyWriteRowAsync(mutation)); + } + + /** + * Convenience method that asynchronously 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. The new value for the timestamp is the greater of the existing timestamp or the current + * server time. The method returns the new contents of all modified cells. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
+   *     .increment("[FAMILY]", "[QUALIFIER]", 1)
+   *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
+   *
+   *   ApiFuture rowFuture = bigtableDataClient.readModifyWriteRowAsync(mutation);
+   *
+   *   ApiFutures.addCallback(rowFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to mutate a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(Row resultingRow) {
+   *       System.out.println("Resulting row: " + resultingRow);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   * }
+   * }
+ */ + public ApiFuture readModifyWriteRowAsync(ReadModifyWriteRow mutation) { + return readModifyWriteRowCallable().futureCall(mutation); + } + + /** + * 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. The new value for the timestamp is the + * greater of the existing timestamp or the current server time. The method returns the new + * contents of all modified cells. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   ReadModifyWriteRow mutation = ReadModifyWriteRow.create("[TABLE]", "[KEY]")
+   *     .increment("[FAMILY]", "[QUALIFIER]", 1)
+   *     .append("[FAMILY2]", "[QUALIFIER2]", "suffix");
+   *
+   *   try {
+   *     Row row = bigtableDataClient.readModifyWriteRowCallable().call(mutation);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to mutate a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ */ + public UnaryCallable readModifyWriteRowCallable() { + return stub.readModifyWriteRowCallable(); + } + + /** + * Convenience method for synchronously streaming the partitions of a table. The returned + * ServerStream instance is not threadsafe, it can only be used from single thread. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   try {
+   *     ServerStream stream = bigtableDataClient.generateInitialChangeStreamPartitions(tableId);
+   *     int count = 0;
+   *
+   *     // Iterator style
+   *     for (ByteStringRange partition : stream) {
+   *       if (++count > 10) {
+   *         stream.cancel();
+   *         break;
+   *       }
+   *       // Do something with partition
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public ServerStream generateInitialChangeStreamPartitions(String tableId) { + return generateInitialChangeStreamPartitionsCallable().call(tableId); + } + + /** + * Convenience method for asynchronously streaming the partitions of a table. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   bigtableDataClient.generateInitialChangeStreamPartitionsAsync(tableId, new ResponseObserver() {
+   *     StreamController controller;
+   *     int count = 0;
+   *
+   *     public void onStart(StreamController controller) {
+   *       this.controller = controller;
+   *     }
+   *     public void onResponse(ByteStringRange partition) {
+   *       if (++count > 10) {
+   *         controller.cancel();
+   *         return;
+   *       }
+   *       // Do something with partition
+   *     }
+   *     public void onError(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onComplete() {
+   *       // Handle stream completion
+   *     }
+   *   });
+   * }
+   * }
+ */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public void generateInitialChangeStreamPartitionsAsync( + String tableId, ResponseObserver observer) { + generateInitialChangeStreamPartitionsCallable().call(tableId, observer); + } + + /** + * Streams back the results of the query. The returned callable object allows for customization of + * api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   // Iterator style
+   *   try {
+   *     for(ByteStringRange partition : bigtableDataClient.generateInitialChangeStreamPartitionsCallable().call(tableId)) {
+   *       // Do something with partition
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Sync style
+   *   try {
+   *     List partitions = bigtableDataClient.generateInitialChangeStreamPartitionsCallable().all().call(tableId);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Point look up
+   *   ApiFuture partitionFuture =
+   *     bigtableDataClient.generateInitialChangeStreamPartitionsCallable().first().futureCall(tableId);
+   *
+   *   ApiFutures.addCallback(partitionFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(RowRange result) {
+   *       System.out.println("Got partition: " + result);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   *
+   *   // etc
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public ServerStreamingCallable + generateInitialChangeStreamPartitionsCallable() { + return stub.generateInitialChangeStreamPartitionsCallable(); + } + + /** + * Convenience method for synchronously streaming the results of a {@link ReadChangeStreamQuery}. + * The returned ServerStream instance is not threadsafe, it can only be used from single thread. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ReadChangeStreamQuery query = ReadChangeStreamQuery.create(tableId)
+   *          .streamPartition("START_KEY", "END_KEY")
+   *          .startTime(Timestamp.newBuilder().setSeconds(100).build());
+   *
+   *   try {
+   *     ServerStream stream = bigtableDataClient.readChangeStream(query);
+   *     int count = 0;
+   *
+   *     // Iterator style
+   *     for (ChangeStreamRecord record : stream) {
+   *       if (++count > 10) {
+   *         stream.cancel();
+   *         break;
+   *       }
+   *       // Do something with the change stream record.
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see ReadChangeStreamQuery For query options. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public ServerStream readChangeStream(ReadChangeStreamQuery query) { + return readChangeStreamCallable().call(query); + } + + /** + * Convenience method for asynchronously streaming the results of a {@link ReadChangeStreamQuery}. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ReadChangeStreamQuery query = ReadChangeStreamQuery.create(tableId)
+   *          .streamPartition("START_KEY", "END_KEY")
+   *          .startTime(Timestamp.newBuilder().setSeconds(100).build());
+   *
+   *   bigtableDataClient.readChangeStreamAsync(query, new ResponseObserver() {
+   *     StreamController controller;
+   *     int count = 0;
+   *
+   *     public void onStart(StreamController controller) {
+   *       this.controller = controller;
+   *     }
+   *     public void onResponse(ChangeStreamRecord record) {
+   *       if (++count > 10) {
+   *         controller.cancel();
+   *         return;
+   *       }
+   *       // Do something with the change stream record.
+   *     }
+   *     public void onError(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onComplete() {
+   *       // Handle stream completion
+   *     }
+   *   });
+   * }
+   * }
+ */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public void readChangeStreamAsync( + ReadChangeStreamQuery query, ResponseObserver observer) { + readChangeStreamCallable().call(query, observer); + } + + /** + * Streams back the results of the query. The returned callable object allows for customization of + * api invocation. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String tableId = "[TABLE]";
+   *
+   *   ReadChangeStreamQuery query = ReadChangeStreamQuery.create(tableId)
+   *          .streamPartition("START_KEY", "END_KEY")
+   *          .startTime(Timestamp.newBuilder().setSeconds(100).build());
+   *
+   *   // Iterator style
+   *   try {
+   *     for(ChangeStreamRecord record : bigtableDataClient.readChangeStreamCallable().call(query)) {
+   *       // Do something with record
+   *     }
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Sync style
+   *   try {
+   *     List records = bigtableDataClient.readChangeStreamCallable().all().call(query);
+   *   } catch (NotFoundException e) {
+   *     System.out.println("Tried to read a non-existent table");
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   *
+   *   // Point look up
+   *   ApiFuture recordFuture =
+   *     bigtableDataClient.readChangeStreamCallable().first().futureCall(query);
+   *
+   *   ApiFutures.addCallback(recordFuture, new ApiFutureCallback() {
+   *     public void onFailure(Throwable t) {
+   *       if (t instanceof NotFoundException) {
+   *         System.out.println("Tried to read a non-existent table");
+   *       } else {
+   *         t.printStackTrace();
+   *       }
+   *     }
+   *     public void onSuccess(ChangeStreamRecord result) {
+   *       System.out.println("Got record: " + result);
+   *     }
+   *   }, MoreExecutors.directExecutor());
+   *
+   *   // etc
+   * }
+   * }
+ * + * @see ServerStreamingCallable For call styles. + * @see ReadChangeStreamQuery For query options. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public ServerStreamingCallable + readChangeStreamCallable() { + return stub.readChangeStreamCallable(); + } + + /** + * Executes a SQL Query and returns a ResultSet to iterate over the results. The returned + * ResultSet instance is not threadsafe, it can only be used from single thread. + * + *

The {@link BoundStatement} must be built from a {@link PreparedStatement} created using the + * same instance and app profile. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String query = "SELECT CAST(cf['stringCol'] AS STRING) FROM [TABLE]";
+   *   Map> paramTypes = new HashMap<>();
+   *   PreparedStatement preparedStatement = bigtableDataClient.prepareStatement(query, paramTypes));
+   *   // Ideally one PreparedStatement should be reused across requests
+   *   BoundStatement boundStatement = preparedStatement.bind()
+   *      // set any query params before calling build
+   *      .build();
+   *   try (ResultSet resultSet = bigtableDataClient.executeQuery(boundStatement)) {
+   *       while (resultSet.next()) {
+   *           String s = resultSet.getString("stringCol");
+   *            // do something with data
+   *       }
+   *    } catch (RuntimeException e) {
+   *        e.printStackTrace();
+   *   }
+   * }
+   * }
+ * + * @see PreparedStatement for query options. + * @see BoundStatement for query options. + */ + public ResultSet executeQuery(BoundStatement boundStatement) { + boundStatement.assertUsingSameStub(stub); + SqlServerStream stream = stub.createExecuteQueryCallable().call(boundStatement); + return ResultSetImpl.create(stream); + } + + /** + * Prepares a query for execution. If possible this should be called once and reused across + * requests. This will amortize the cost of query preparation. + * + *

A parameterized query should contain placeholders in the form of {@literal @} followed by + * the parameter name. Parameter names may consist of any combination of letters, numbers, and + * underscores. + * + *

Parameters can appear anywhere that a literal value is expected. The same parameter name can + * be used more than once, for example: {@code WHERE cf["qualifier1"] = @value OR cf["qualifier2"] + * = @value } + * + * @param query sql query string to prepare + * @param paramTypes a Map of the parameter names and the corresponding {@link SqlType} for all + * query parameters in 'query' + * @return {@link PreparedStatement} which is used to create {@link BoundStatement}s to execute + */ + public PreparedStatement prepareStatement(String query, Map> paramTypes) { + PrepareQueryRequest request = PrepareQueryRequest.create(query, paramTypes); + PrepareResponse response = stub.prepareQueryCallable().call(request); + return PreparedStatementImpl.create(response, paramTypes, request, stub); + } + + /** Close the clients and releases all associated resources. */ + @Override + public void close() { + stub.close(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java new file mode 100644 index 000000000000..61ab4cc12c12 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java @@ -0,0 +1,178 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.stub.BigtableClientContext; +import com.google.cloud.bigtable.data.v2.stub.ClientOperationSettings; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import java.io.IOException; +import javax.annotation.Nonnull; + +/** + * A factory to create multiple {@link BigtableDataClient} instances that all share the same channel + * pool. + * + *

This allows multiple client instances to share the same gRPC channel pool, which makes client + * creation very cheap. The intended use case is for applications that need to access multiple + * Bigtable Instances from the same process. + * + *

Example Usage: + * + *

{@code
+ * BigtableDataSettings defaultSettings = BigtableDataSettings.newBuilder()
+ *   .setProject("my-default-project")
+ *   .setInstance("my-default-instance")
+ *   .build();
+ *
+ * BigtableDataClientFactory clientFactory = BigtableDataClientFactory.create(defaultSettings);
+ *
+ * // Create a new client for "my-default-instance" in "my-default-project";
+ * BigtableDataClient defaultInstanceClient = clientFactory.createDefault();
+ *
+ * // Create a new client for a different application profile
+ * BigtableDataClient otherAppProfileClient = clientFactory.createForAppProfile("other-app-profile");
+ *
+ * // Create a new client for a completely different instance and application profile.
+ * BigtableDataClient otherInstanceClient = clientFactory
+ *   .createForInstance("my-other-project", "my-other-instance", "my-other-app-profile");
+ *
+ * // Clean up: make sure close the clients AND the factory.
+ * defaultInstanceClient.close();
+ * otherAppProfileClient.close();
+ * otherInstanceClient.close();
+ *
+ * clientFactory.close();
+ *
+ * 

Please note that this is an experimental feature and might be changed or removed in future. + * }

+ */ +@BetaApi("This feature is currently experimental and can change in the future") +public final class BigtableDataClientFactory implements AutoCloseable { + private final BigtableClientContext sharedClientContext; + private final ClientOperationSettings perOpSettings; + + /** + * Create a instance of this factory. + * + *

The factory will be used to create clients using the provided settings as the base. Make + * sure to call {@link #close()} on the factory after closing all clients. + */ + public static BigtableDataClientFactory create(BigtableDataSettings defaultSettings) + throws IOException { + BigtableDataSettings.Builder builder = defaultSettings.toBuilder(); + builder.stubSettings().setSessionsEnabled(false); + defaultSettings = builder.build(); + + BigtableClientContext sharedClientContext = + BigtableClientContext.create(defaultSettings.getStubSettings()); + ClientOperationSettings perOpSettings = defaultSettings.getStubSettings().getPerOpSettings(); + return new BigtableDataClientFactory(sharedClientContext, perOpSettings); + } + + private BigtableDataClientFactory( + BigtableClientContext sharedClientContext, ClientOperationSettings perOpSettings) { + this.sharedClientContext = sharedClientContext; + this.perOpSettings = perOpSettings; + } + + /** + * Release all of the resources associated with this factory. + * + *

This will close the underlying channel pooling, disconnecting all create clients. + */ + @Override + public void close() throws Exception { + sharedClientContext.close(); + } + + /** + * Create a lightweight client using the default settings in this factory. This will use the + * factory default project, instance and application profile ids. The client will also share + * resources like the channel pool with other clients created using this factory. + * + *

The client should be closed when it is no longer needed. Closing the client will release + * client specific resources, but will leave shared resources like the channel pool open. To + * release all resources, first close all of the created clients and then this factory instance. + */ + public BigtableDataClient createDefault() { + try { + BigtableClientContext ctx = + sharedClientContext.createChild( + sharedClientContext.getClientInfo().getInstanceName(), + sharedClientContext.getClientInfo().getAppProfileId()); + + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); + } catch (IOException e) { + // Should never happen because the connection has been established already + throw new RuntimeException( + "Failed to create a new client using factory default settings and shared resources."); + } + } + + /** + * Create a lightweight client with an overriden application profile and the factory default + * project and instance ids. The client will also share resources like the channel pool with other + * clients created using this factory. + * + *

The client should be closed when it is no longer needed. Closing the client will release + * client specific resources, but will leave shared resources like the channel pool open. To + * release all resources, first close all of the created clients and then this factory instance. + */ + public BigtableDataClient createForAppProfile(@Nonnull String appProfileId) throws IOException { + BigtableClientContext ctx = + sharedClientContext.createChild( + sharedClientContext.getClientInfo().getInstanceName(), appProfileId); + + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); + } + + /** + * Create a lightweight client with the specified project and instance id. The resulting client + * will use the server default application profile. The client will also share resources like the + * channel pool with other clients created using this factory. + * + *

The client should be closed when it is no longer needed. Closing the client will release + * client specific resources, but will leave shared resources like the channel pool open. To + * release all resources, first close all of the created clients and then this factory instance. + */ + public BigtableDataClient createForInstance(@Nonnull String projectId, @Nonnull String instanceId) + throws IOException { + BigtableClientContext ctx = + sharedClientContext.createChild(InstanceName.of(projectId, instanceId), ""); + + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); + } + + /** + * Create a lightweight client to the specified project, instance and application profile id. The + * client will share resources like the channel pool with other clients created using this + * factory. + * + *

The client should be closed when it is no longer needed. Closing the client will release + * client specific resources, but will leave shared resources like the channel pool open. To + * release all resources, first close all of the created clients and then this factory instance. + */ + public BigtableDataClient createForInstance( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String appProfileId) + throws IOException { + BigtableClientContext ctx = + sharedClientContext.createChild(InstanceName.of(projectId, instanceId), appProfileId); + + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java new file mode 100644 index 000000000000..96aef5334a39 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java @@ -0,0 +1,601 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; +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.stub.BigtableBatchingCallSettings; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.base.MoreObjects; +import com.google.common.base.Strings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Settings class to configure an instance of {@link BigtableDataClient}. + * + *

Sane defaults are provided for most settings: + * + *

    + *
  • The default service address (bigtable.googleapis.com) and default port (443) are used. + *
  • The transport provider is configured with a channel pool that contains twice as many + * connections as CPUs. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The only required setting is the instance name. + * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

{@code
+ * BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder()
+ *   .setProjectId("my-project")
+ *   .setInstanceId("my-instance-id")
+ *   .setAppProfileId("default");
+ *
+ * BigtableDataSettings settings = builder.build();
+ * }
+ * + *

For fine grained control of individual RPCs, please refer to {@link + * EnhancedBigtableStubSettings}, which is exposed as {@link Builder#stubSettings()}. + */ +public final class BigtableDataSettings { + + private static final Logger LOGGER = Logger.getLogger(BigtableDataSettings.class.getName()); + private static final String BIGTABLE_EMULATOR_HOST_ENV_VAR = "BIGTABLE_EMULATOR_HOST"; + // This is the legacy credential override used in the deprecated enableBuiltinMetrics method to + // override the default credentials set on the Bigtable client. Keeping it for backward + // compatibility. + @Deprecated @Nullable private static Credentials legacyMetricCredentialOverride; + + private final EnhancedBigtableStubSettings stubSettings; + + private BigtableDataSettings(Builder builder) { + stubSettings = builder.stubSettings().build(); + } + + /** + * Create a new builder. + * + *

If emulator configuration provided in BIGTABLE_EMULATOR_HOST environment variable then it + * creates a builder preconfigured to connect to Bigtable using emulator hostname and port number. + */ + public static Builder newBuilder() { + String hostAndPort = System.getenv(BIGTABLE_EMULATOR_HOST_ENV_VAR); + if (!Strings.isNullOrEmpty(hostAndPort)) { + try { + int lastIndexOfCol = hostAndPort.lastIndexOf(":"); + int port = Integer.parseInt(hostAndPort.substring(lastIndexOfCol + 1)); + return newBuilderForEmulator(hostAndPort.substring(0, lastIndexOfCol), port); + } catch (NumberFormatException | IndexOutOfBoundsException ex) { + throw new RuntimeException( + "Invalid host/port in " + + BIGTABLE_EMULATOR_HOST_ENV_VAR + + " environment variable: " + + hostAndPort); + } + } + return new Builder(); + } + + /** Create a new builder preconfigured to connect to the Bigtable emulator with port number. */ + public static Builder newBuilderForEmulator(int port) { + return newBuilderForEmulator("localhost", port); + } + + /** + * Creates a new builder preconfigured to connect to the Bigtable emulator with a host name and + * port number. + */ + public static Builder newBuilderForEmulator(String hostname, int port) { + BigtableDataSettings.Builder builder = new BigtableDataSettings.Builder(); + + // TODO: remove the suppression once setRefreshingChannel is no longer necessary + @SuppressWarnings({"deprecation", "VariableUnused"}) + EnhancedBigtableStubSettings.Builder ignored = + builder + .stubSettings() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(hostname + ":" + port) + // disable channel refreshing when creating an emulator + .setRefreshingChannel(false) + .setMetricsProvider( + NoopMetricsProvider.INSTANCE) // disable exporting metrics for emulator + .disableInternalMetrics() + .setSessionsEnabled(false) + .setTransportChannelProvider( + InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(256 * 1024 * 1024) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setKeepAliveTimeDuration( + java.time.Duration.ofSeconds(61)) // sends ping in this interval + .setKeepAliveTimeoutDuration( + java.time.Duration.ofSeconds( + 10)) // wait this long before considering the connection dead + .build()); + + LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port); + return builder; + } + + /** + * @deprecated OpenCensus support is deprecated and will be removed in a future version Enables + * OpenCensus metric aggregations. + *

This will register Bigtable client relevant {@link io.opencensus.stats.View}s. When + * coupled with an exporter, it allows users to monitor client behavior. + *

Please note that in addition to calling this method, the application must: + *

    + *
  • Include openensus-impl dependency on the classpath + *
  • Configure an exporter like opencensus-exporter-stats-stackdriver + *
+ *

Example usage for maven: + *

{@code
+   * 
+   *   io.opencensus
+   *   opencensus-impl
+   *   ${opencensus.version}
+   *   runtime
+   * 
+   *
+   * 
+   *   io.opencensus
+   *   opencensus-exporter-stats-stackdriver
+   *   ${opencensus.version}
+   * 
+   * }
+ * Java: + *
{@code
+   * StackdriverStatsExporter.createAndRegister();
+   * BigtableDataSettings.enableOpenCensusStats();
+   * }
+ */ + @Deprecated + public static void enableOpenCensusStats() { + com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientViews(); + // TODO(igorbernstein): Enable grpc views once we upgrade to grpc-java 1.24.0 + // Required change: https://github.com/grpc/grpc-java/pull/5996 + // io.opencensus.contrib.grpc.metrics.RpcViews.registerClientGrpcBasicViews(); + } + + /** + * @deprecated OpenCensus support is deprecated and will be removed in a future version Enables + * OpenCensus GFE metric aggregations. + *

This will register views for gfe_latency and gfe_header_missing_count metrics. + *

gfe_latency measures the latency between Google's network receives an RPC and reads back + * the first byte of the response. gfe_header_missing_count is a counter of the number of RPC + * responses received without the server-timing header. + */ + @Deprecated + public static void enableGfeOpenCensusStats() { + com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientGfeViews(); + } + + /** + * Register built in metrics. + * + * @deprecated This is a no-op that doesn't do anything. Builtin metrics are enabled by default + * now. Please refer to {@link + * BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)} on how to enable or + * disable built-in metrics. + */ + @Deprecated + public static void enableBuiltinMetrics() throws IOException {} + + /** + * Register built in metrics with credentials. The credentials need to have metric write access + * for all the projects you're publishing to. + * + * @deprecated This is a no-op that doesn't do anything. Builtin metrics are enabled by default + * now. Please refer {@link BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)} + * on how to enable or disable built-in metrics. + */ + @Deprecated + public static void enableBuiltinMetrics(Credentials credentials) throws IOException { + BigtableDataSettings.legacyMetricCredentialOverride = credentials; + } + + /** Get the metrics credentials if it's set by {@link #enableBuiltinMetrics(Credentials)}. */ + @InternalApi + public static Credentials getMetricsCredentials() { + return legacyMetricCredentialOverride; + } + + /** Returns the target project id. */ + public String getProjectId() { + return stubSettings.getProjectId(); + } + + /** Returns the target instance id. */ + public String getInstanceId() { + return stubSettings.getInstanceId(); + } + + /** Returns the configured AppProfile id to use. */ + public String getAppProfileId() { + return stubSettings.getAppProfileId(); + } + + /** + * Gets if channels will gracefully refresh connections to Cloud Bigtable service + * + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public boolean isRefreshingChannel() { + return stubSettings.isRefreshingChannel(); + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public List getPrimingTableIds() { + return stubSettings.getPrimedTableIds(); + } + + /** + * Gets if latency based throttling is enabled for {@link + * BigtableDataClient#newBulkMutationBatcher(String)} + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + public boolean isLatencyBasedThrottlingForBatchMutationsEnabled() { + return stubSettings.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled(); + } + + /** + * Gets target bulk mutation rpc latency if latency based throttling is enabled for {@link + * BigtableDataClient#newBulkMutationBatcher(String)}. Otherwise returns null. + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + @Nullable + public Long getBatchMutationsTargetRpcLatencyMs() { + return stubSettings.bulkMutateRowsSettings().getTargetRpcLatencyMs(); + } + + /** + * Gets if flow control is enabled for {@link BigtableDataClient#newBulkMutationBatcher(String)} + * based on the load of the Bigtable server. + */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public boolean isBulkMutationFlowControlEnabled() { + return stubSettings.bulkMutateRowsSettings().isServerInitiatedFlowControlEnabled(); + } + + /** Gets the {@link MetricsProvider}. * */ + public MetricsProvider getMetricsProvider() { + return stubSettings.getMetricsProvider(); + } + + /** Checks if internal metrics are enabled */ + public boolean areInternalMetricsEnabled() { + return stubSettings.areInternalMetricsEnabled(); + } + + /** Returns the underlying RPC settings. */ + public EnhancedBigtableStubSettings getStubSettings() { + return stubSettings; + } + + /** Returns the object with the settings used for point reads via ReadRow. */ + public UnaryCallSettings readRowSettings() { + return stubSettings.readRowSettings(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("stubSettings", stubSettings).toString(); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + /** Builder for BigtableDataSettings. */ + public static class Builder { + private final EnhancedBigtableStubSettings.Builder stubSettings; + + /** + * Initializes a new Builder with sane defaults for all settings. + * + *

Most defaults are extracted from {@link + * com.google.cloud.bigtable.data.v2.stub.BigtableStubSettings}, however some of the more + * complex defaults are configured explicitly here. Once the overlayed defaults are configured, + * the base settings are augmented to work with overlayed functionality (like disabling retries + * in the underlying GAPIC client for batching). + */ + private Builder() { + stubSettings = EnhancedBigtableStubSettings.newBuilder(); + } + + private Builder(BigtableDataSettings settings) { + stubSettings = settings.getStubSettings().toBuilder(); + } + + // + /** + * Sets the target project. This setting is required. All RPCs will be made in the context of + * this setting. + */ + public Builder setProjectId(@Nonnull String projectId) { + stubSettings.setProjectId(projectId); + return this; + } + + /** Gets the project id that was previously set on this Builder. */ + public String getProjectId() { + return stubSettings.getProjectId(); + } + + /** + * Sets the target instance. This setting is required. All RPCs will be made in the context of + * this setting. + */ + public Builder setInstanceId(@Nonnull String instanceId) { + stubSettings.setInstanceId(instanceId); + return this; + } + + /** Gets the instance id that was previously set on this Builder. */ + public String getInstanceId() { + return stubSettings.getInstanceId(); + } + + /** + * Sets the AppProfile to use. + * + *

An application profile (sometimes also shortened to "app profile") is a group of + * configuration parameters for an individual use case. A client will identify itself with an + * application profile ID at connection time, and the requests will be handled according to that + * application profile. + */ + public Builder setAppProfileId(@Nonnull String appProfileId) { + stubSettings.setAppProfileId(appProfileId); + return this; + } + + /** + * Resets the AppProfile id to the default for the instance. + * + *

An application profile (sometimes also shortened to "app profile") is a group of + * configuration parameters for an individual use case. A client will identify itself with an + * application profile ID at connection time, and the requests will be handled according to that + * application profile. + * + *

Every Bigtable Instance has a default application profile associated with it, this method + * configures the client to use it. + */ + public Builder setDefaultAppProfileId() { + stubSettings.setDefaultAppProfileId(); + return this; + } + + /** Gets the app profile id that was previously set on this Builder. */ + public String getAppProfileId() { + return stubSettings.getAppProfileId(); + } + + /** Sets the CredentialsProvider to use for getting the credentials to make calls with. */ + public Builder setCredentialsProvider(CredentialsProvider credentialsProvider) { + stubSettings.setCredentialsProvider(credentialsProvider); + return this; + } + + /** Gets the CredentialsProvider to use for getting the credentials to make calls with. */ + public CredentialsProvider getCredentialsProvider() { + return stubSettings.getCredentialsProvider(); + } + + /** + * Configure periodic gRPC channel refreshes. + * + *

This feature will gracefully refresh connections to the Cloud Bigtable service. This is a + * feature to address tail latency caused by the service dropping long lived gRPC connections, + * which causes the client to renegotiate the gRPC connection in the request path, which causes + * periodic spikes in latency. + * + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public Builder setRefreshingChannel(boolean isRefreshingChannel) { + stubSettings.setRefreshingChannel(isRefreshingChannel); + return this; + } + + /** + * Gets if channels will gracefully refresh connections to Cloud Bigtable service. + * + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public boolean isRefreshingChannel() { + return stubSettings.isRefreshingChannel(); + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public Builder setPrimingTableIds(String... tableIds) { + return this; + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public List getPrimingTableIds() { + return stubSettings.getPrimedTableIds(); + } + + /** + * Enable latency based throttling for {@link BigtableDataClient#newBulkMutationBatcher(String)} + * with a target rpc latency. The number of allowed in-flight requests will be adjusted to reach + * the target bulk mutations rpc latency. + * + *

The logic of adjusting in-flight request limits is as follows: + * + *

+     * To start, {@link Batcher} allows {@link FlowController#getCurrentElementCountLimit()}
+     * in-flight elements with a total size of {@link FlowController#getCurrentRequestBytesLimit()}.
+     *
+     * Every 20 seconds, {@link Batcher} checks the mean rpc latency of the requests and compare
+     * it with the target rpc latency:
+     *   if (mean latency > 3 * target latency) {
+     *     decrease element count limit by 30% of {@link FlowController#getMaxElementCountLimit()}
+     *   } else if (mean latency > 1.2 * target latency) {
+     *     decrease element count limit by 10% of {@link FlowController#getMaxElementCountLimit()}
+     *   } else if (there was throttling in the past 5 minutes
+     *        && mean latency < 0.8 * target latency) {
+     *     increase element count limit by 5% of {@link FlowController#getMaxElementCountLimit()}
+     *   } else if (there was throttling in the past 5 minutes
+     *        && parallelism is 5% of {@link FlowController#getMaxElementCountLimit()}
+     *        && mean latency < 2 * target latency) {
+     *     increase element count limit by 2% of {@link FlowController#getMaxElementCountLimit()}
+     *
+     * Increases are capped by {@link
+     * FlowController#getMaxElementCountLimit()}, Decreases are floored at {@link
+     * FlowController#getMinElementCountLimit()} so that there is some level of throughput.
+     * 
+ * + * @see BigtableBatchingCallSettings.Builder#getDynamicFlowControlSettings() for explanation on + * default configurations. + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + public Builder enableBatchMutationLatencyBasedThrottling(long targetRpcLatencyMs) { + stubSettings.bulkMutateRowsSettings().enableLatencyBasedThrottling(targetRpcLatencyMs); + return this; + } + + /** + * Disable latency based throttling for {@link + * BigtableDataClient#newBulkMutationBatcher(String)}. + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + public Builder disableBatchMutationLatencyBasedThrottling() { + stubSettings.bulkMutateRowsSettings().disableLatencyBasedThrottling(); + return this; + } + + /** + * Gets if latency based throttling is enabled for {@link + * BigtableDataClient#newBulkMutationBatcher(String)} + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + public boolean isLatencyBasedThrottlingForBatchMutationEnabled() { + return stubSettings.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled(); + } + + /** + * Gets target bulk mutation rpc latency if latency based throttling is enabled for {@link + * BigtableDataClient#newBulkMutationBatcher(String)}. Otherwise returns null. + */ + @BetaApi("Latency based throttling is not currently stable and may change in the future") + @Nullable + public Long getTargetRpcLatencyMsForBatchMutation() { + return stubSettings.bulkMutateRowsSettings().getTargetRpcLatencyMs(); + } + + /** + * Configure flow control for {@link BigtableDataClient#newBulkMutationBatcher(String)} based on + * the current load on the Bigtable cluster. + * + *

This is different from the {@link FlowController} that's always enabled on batch reads and + * batch writes, which limits the number of outstanding requests to the Bigtable server. + */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public Builder setBulkMutationFlowControl(boolean isEnableFlowControl) { + stubSettings.bulkMutateRowsSettings().setServerInitiatedFlowControl(isEnableFlowControl); + return this; + } + + /** + * Gets if flow control is enabled for {@link BigtableDataClient#newBulkMutationBatcher(String)} + * based on the load of the Bigtable server. + */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public boolean isBulkMutationFlowControlEnabled() { + return stubSettings.bulkMutateRowsSettings().isServerInitiatedFlowControlEnabled(); + } + + /** + * Sets the {@link MetricsProvider}. + * + *

By default, this is set to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider#INSTANCE} which will + * collect and export client side metrics. + * + *

To disable client side metrics, set it to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider#INSTANCE}. + * + *

To use a custom OpenTelemetry instance, refer to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider} on how to + * set it up. + */ + public Builder setMetricsProvider(MetricsProvider metricsProvider) { + stubSettings.setMetricsProvider(metricsProvider); + return this; + } + + /** Gets the {@link MetricsProvider}. */ + public MetricsProvider getMetricsProvider() { + return stubSettings.getMetricsProvider(); + } + + public Builder disableInternalMetrics() { + stubSettings.disableInternalMetrics(); + return this; + } + + public boolean areInternalMetricsEnabled() { + return stubSettings.areInternalMetricsEnabled(); + } + + /** + * Returns the underlying settings for making RPC calls. The settings should be changed with + * care. + */ + public EnhancedBigtableStubSettings.Builder stubSettings() { + return stubSettings; + } + + public BigtableDataSettings build() { + return new BigtableDataSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json new file mode 100644 index 000000000000..5bc262fb5c9d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.bigtable.v2", + "libraryPackage": "com.google.cloud.bigtable.data.v2", + "services": { + "Bigtable": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableDataClient", + "rpcs": { + "CheckAndMutateRow": { + "methods": ["checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRowCallable"] + }, + "ExecuteQuery": { + "methods": ["executeQueryCallable"] + }, + "GenerateInitialChangeStreamPartitions": { + "methods": ["generateInitialChangeStreamPartitionsCallable"] + }, + "MutateRow": { + "methods": ["mutateRow", "mutateRow", "mutateRow", "mutateRow", "mutateRow", "mutateRowCallable"] + }, + "MutateRows": { + "methods": ["mutateRowsCallable"] + }, + "PingAndWarm": { + "methods": ["pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarmCallable"] + }, + "PrepareQuery": { + "methods": ["prepareQuery", "prepareQuery", "prepareQuery", "prepareQuery", "prepareQuery", "prepareQueryCallable"] + }, + "ReadChangeStream": { + "methods": ["readChangeStreamCallable"] + }, + "ReadModifyWriteRow": { + "methods": ["readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRowCallable"] + }, + "ReadRows": { + "methods": ["readRowsCallable"] + }, + "SampleRowKeys": { + "methods": ["sampleRowKeysCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java new file mode 100644 index 000000000000..166da1b55310 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java @@ -0,0 +1,419 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.Value; +import com.google.bigtable.v2.Value.KindCase; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import com.google.cloud.bigtable.data.v2.models.sql.StructReader; +import com.google.common.base.Preconditions; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.ProtocolMessageEnum; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +@InternalApi +public abstract class AbstractProtoStructReader implements StructReader { + + abstract List values(); + + // Force subclasses to override equals and hashcode. We need this for tests. + @Override + public abstract boolean equals(Object other); + + @Override + public abstract int hashCode(); + + /** + * @param columnName name of the column + * @return the index of the column named {@code columnName} + * @throws IllegalArgumentException if there is not exactly one column with the given name + */ + public abstract int getColumnIndex(String columnName); + + /** + * @param columnIndex index of the column + * @return the type of the column at the given index + */ + public abstract SqlType getColumnType(int columnIndex); + + /** + * @param columnName name of the column + * @return the type of the column with the given name + * @throws IllegalArgumentException if there is not exactly one column with the given name + */ + public SqlType getColumnType(String columnName) { + return getColumnType(getColumnIndex(columnName)); + } + + @Override + public boolean isNull(int columnIndex) { + Value value = values().get(columnIndex); + return value.getKindCase().equals(KindCase.KIND_NOT_SET); + } + + @Override + public boolean isNull(String columnName) { + return isNull(getColumnIndex(columnName)); + } + + @Override + public ByteString getBytes(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.bytes(), columnIndex); + Value value = values().get(columnIndex); + return value.getBytesValue(); + } + + @Override + public ByteString getBytes(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.bytes(), columnName); + Value value = values().get(columnIndex); + return value.getBytesValue(); + } + + @Override + public String getString(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.string(), columnIndex); + Value value = values().get(columnIndex); + return value.getStringValue(); + } + + @Override + public String getString(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.string(), columnName); + Value value = values().get(columnIndex); + return value.getStringValue(); + } + + @Override + public long getLong(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.int64(), columnIndex); + Value value = values().get(columnIndex); + return value.getIntValue(); + } + + @Override + public long getLong(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.int64(), columnName); + Value value = values().get(columnIndex); + return value.getIntValue(); + } + + @Override + public double getDouble(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.float64(), columnIndex); + Value value = values().get(columnIndex); + return value.getFloatValue(); + } + + @Override + public double getDouble(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.float64(), columnName); + Value value = values().get(columnIndex); + return value.getFloatValue(); + } + + @Override + public float getFloat(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.float32(), columnIndex); + Value value = values().get(columnIndex); + return (float) value.getFloatValue(); + } + + @Override + public float getFloat(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.float32(), columnName); + Value value = values().get(columnIndex); + return (float) value.getFloatValue(); + } + + @Override + public boolean getBoolean(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.bool(), columnIndex); + Value value = values().get(columnIndex); + return value.getBoolValue(); + } + + @Override + public boolean getBoolean(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.bool(), columnName); + Value value = values().get(columnIndex); + return value.getBoolValue(); + } + + @Override + public Instant getTimestamp(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.timestamp(), columnIndex); + Value value = values().get(columnIndex); + return TimestampUtil.toInstant(value.getTimestampValue()); + } + + @Override + public Instant getTimestamp(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.timestamp(), columnName); + Value value = values().get(columnIndex); + return TimestampUtil.toInstant(value.getTimestampValue()); + } + + @Override + public Date getDate(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.date(), columnIndex); + Value value = values().get(columnIndex); + return fromProto(value.getDateValue()); + } + + @Override + public Date getDate(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.date(), columnName); + Value value = values().get(columnIndex); + return fromProto(value.getDateValue()); + } + + @Override + public Struct getStruct(int columnIndex) { + checkNonNullOfType(columnIndex, SqlType.struct(), columnIndex); + Value value = values().get(columnIndex); + SqlType.Struct schema = (SqlType.Struct) getColumnType(columnIndex); + // A struct value is represented as an array + return ProtoStruct.create(schema, value.getArrayValue()); + } + + @Override + public Struct getStruct(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.struct(), columnName); + Value value = values().get(columnIndex); + SqlType.Struct schema = (SqlType.Struct) getColumnType(columnIndex); + // A struct value is represented as an array + return ProtoStruct.create(schema, value.getArrayValue()); + } + + @Override + public List getList(int columnIndex, SqlType.Array arrayType) { + // Note it is important that we use the actualType to decode bc user passed struct types + // won't have schemas + SqlType actualType = getColumnType(columnIndex); + checkNonNullOfType(columnIndex, arrayType, actualType, columnIndex); + Value value = values().get(columnIndex); + // If the element type is proto/enum, we should use the user passed type, which contains the + // schema. Otherwise, we should use the type from metadata. + SqlType elementType = arrayType.getElementType(); + if (elementType.getCode() == SqlType.Code.PROTO || elementType.getCode() == SqlType.Code.ENUM) { + return (List) decodeValue(value, arrayType); + } + return (List) decodeValue(value, actualType); + } + + @Override + public List getList(String columnName, SqlType.Array arrayType) { + int columnIndex = getColumnIndex(columnName); + // Note it is important that we use the actualType to decode bc user passed struct types + // won't have schemas + SqlType actualType = getColumnType(columnIndex); + checkNonNullOfType(columnIndex, arrayType, actualType, columnName); + Value value = values().get(columnIndex); + // If the element type is proto/enum, we should use the user passed type, which contains the + // schema. Otherwise, we should use the type from metadata. + SqlType elementType = arrayType.getElementType(); + if (elementType.getCode() == SqlType.Code.PROTO || elementType.getCode() == SqlType.Code.ENUM) { + return (List) decodeValue(value, arrayType); + } + return (List) decodeValue(value, actualType); + } + + @Override + public Map getMap(int columnIndex, SqlType.Map mapType) { + // Note it is important that we use the actualType to decode bc user passed struct types + // won't have schemas + SqlType actualType = getColumnType(columnIndex); + checkNonNullOfType(columnIndex, mapType, actualType, columnIndex); + Value value = values().get(columnIndex); + // If the value type is proto/enum, we should use the user passed type, which contains the + // schema. Otherwise, we should use the type from metadata. + SqlType valueType = mapType.getValueType(); + if (valueType.getCode() == SqlType.Code.PROTO || valueType.getCode() == SqlType.Code.ENUM) { + return (Map) decodeValue(value, mapType); + } + return (Map) decodeValue(value, actualType); + } + + @Override + public Map getMap(String columnName, SqlType.Map mapType) { + int columnIndex = getColumnIndex(columnName); + // Note it is important that we use the actualType to decode bc user passed struct types + // won't have schemas + SqlType actualType = getColumnType(columnIndex); + checkNonNullOfType(columnIndex, mapType, actualType, columnName); + Value value = values().get(columnIndex); + // If the value type is proto/enum, we should use the user passed type, which contains the + // schema. Otherwise, we should use the type from metadata. + SqlType valueType = mapType.getValueType(); + if (valueType.getCode() == SqlType.Code.PROTO || valueType.getCode() == SqlType.Code.ENUM) { + return (Map) decodeValue(value, mapType); + } + return (Map) decodeValue(value, actualType); + } + + @Override + public MsgType getProtoMessage( + int columnIndex, MsgType message) { + // Note it is import that we use the user passed message object to decode, because the type in + // the corresponding column metadata only have a message name and doesn't have schemas + SqlType.Proto actualType = SqlType.protoOf(message); + checkNonNullOfType(columnIndex, getColumnType(columnIndex), actualType, columnIndex); + Value value = values().get(columnIndex); + return (MsgType) decodeValue(value, actualType); + } + + @Override + public MsgType getProtoMessage( + String columnName, MsgType message) { + int columnIndex = getColumnIndex(columnName); + // Note it is import that we use the user passed message object to decode, because the type in + // the corresponding column metadata only have a message name and doesn't have schemas + SqlType.Proto actualType = SqlType.protoOf(message); + checkNonNullOfType(columnIndex, getColumnType(columnIndex), actualType, columnName); + Value value = values().get(columnIndex); + return (MsgType) decodeValue(value, actualType); + } + + @Override + public EnumType getProtoEnum( + int columnIndex, Function forNumber) { + // Note it is import that we use the user passed function to decode, because the type in + // the corresponding column metadata only have an enum message name and doesn't have schemas + SqlType.Enum actualType = SqlType.enumOf(forNumber); + checkNonNullOfType(columnIndex, getColumnType(columnIndex), actualType, columnIndex); + Value value = values().get(columnIndex); + return (EnumType) decodeValue(value, actualType); + } + + @Override + public EnumType getProtoEnum( + String columnName, Function forNumber) { + int columnIndex = getColumnIndex(columnName); + // Note it is import that we use the user passed function to decode, because the type in + // the corresponding column metadata only have an enum message name and doesn't have schemas + SqlType.Enum actualType = SqlType.enumOf(forNumber); + checkNonNullOfType(columnIndex, getColumnType(columnIndex), actualType, columnName); + Value value = values().get(columnIndex); + return (EnumType) decodeValue(value, actualType); + } + + Object decodeValue(Value value, SqlType type) { + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + return null; + } + switch (type.getCode()) { + case BYTES: + return value.getBytesValue(); + case STRING: + return value.getStringValue(); + case INT64: + return value.getIntValue(); + case FLOAT64: + return value.getFloatValue(); + case FLOAT32: + // cast to float so we produce List, etc + return (float) value.getFloatValue(); + case BOOL: + return value.getBoolValue(); + case TIMESTAMP: + return TimestampUtil.toInstant(value.getTimestampValue()); + case DATE: + return fromProto(value.getDateValue()); + case STRUCT: + SqlType.Struct schema = (SqlType.Struct) type; + // A struct value is represented as an array + return ProtoStruct.create(schema, value.getArrayValue()); + case PROTO: + try { + SqlType.Proto protoType = (SqlType.Proto) type; + return protoType.getParserForType().parseFrom(value.getBytesValue()); + } catch (InvalidProtocolBufferException e) { + throw new IllegalStateException("Unable to parse value to proto " + type, e); + } + case ENUM: + return ((SqlType.Enum) type).getForNumber().apply((int) value.getIntValue()); + case ARRAY: + ArrayList listBuilder = new ArrayList<>(); + SqlType.Array arrayType = (SqlType.Array) type; + SqlType elemType = arrayType.getElementType(); + for (Value elem : value.getArrayValue().getValuesList()) { + listBuilder.add(decodeValue(elem, elemType)); + } + // We use unmodifiableList instead of guava ImmutableList to allow null elements + return Collections.unmodifiableList(listBuilder); + case MAP: + HashMap mapBuilder = new HashMap<>(); + SqlType.Map mapType = (SqlType.Map) type; + SqlType keyType = mapType.getKeyType(); + SqlType valType = mapType.getValueType(); + // A map value is represented as an array of k, v tuples where the tuple is a nested array + for (Value entry : value.getArrayValue().getValuesList()) { + Object key = decodeValue(entry.getArrayValue().getValues(0), keyType); + Object val = decodeValue(entry.getArrayValue().getValues(1), valType); + mapBuilder.put(key, val); + } + // We use unmodifiableMap instead of guava ImmutableMap to allow null keys & values + return Collections.unmodifiableMap(mapBuilder); + default: + // We should have already thrown an exception in the SqlRowMerger + throw new IllegalStateException("Unrecognized type: " + type); + } + } + + private void checkNonNullOfType( + int columnIndex, SqlType expectedType, Object columnNameForError) { + SqlType actualType = getColumnType(columnIndex); + checkNonNullOfType(columnIndex, expectedType, actualType, columnNameForError); + } + + private void checkNonNullOfType( + int columnIndex, SqlType expectedType, SqlType actualType, Object columnNameForError) { + Preconditions.checkState( + SqlType.typesMatch(expectedType, actualType), + "Column %s is not of correct type: expected %s but was %s", + columnNameForError, + expectedType.toString(), + actualType.toString()); + if (isNull(columnIndex)) { + throw new NullPointerException("Column " + columnNameForError + " contains NULL value"); + } + } + + private Date fromProto(com.google.type.Date proto) { + return Date.fromYearMonthDay(proto.getYear(), proto.getMonth(), proto.getDay()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparator.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparator.java new file mode 100644 index 000000000000..a281b2e98bb9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparator.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.protobuf.ByteString; +import java.util.Comparator; + +/** Compares {@link ByteString}s as unsigned byte arrays. */ +@InternalApi +public class ByteStringComparator implements Comparator { + public static final ByteStringComparator INSTANCE = new ByteStringComparator(); + + @Override + public int compare(ByteString o1, ByteString o2) { + int sizeA = o1.size(); + int sizeB = o2.size(); + int shortestSize = Math.min(sizeA, sizeB); + for (int i = 0; i < shortestSize; i++) { + int byteA = o1.byteAt(i) & 0xff; + int byteB = o2.byteAt(i) & 0xff; + + if (byteA != byteB) { + return byteA < byteB ? -1 : 1; + } + } + if (sizeA == sizeB) { + return 0; + } + return sizeA < sizeB ? -1 : 1; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnMetadataImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnMetadataImpl.java new file mode 100644 index 000000000000..966cca5e602f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnMetadataImpl.java @@ -0,0 +1,38 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; + +/** + * Implementation of {@link ColumnMetadata} using AutoValue + * + *

This is considered an internal implementation detail and not meant to be used by applications. + */ +@InternalApi("For internal use only") +@AutoValue +public abstract class ColumnMetadataImpl implements ColumnMetadata { + public static ColumnMetadata create(String name, SqlType type) { + return new AutoValue_ColumnMetadataImpl(name, type); + } + + static ColumnMetadata fromProto(com.google.bigtable.v2.ColumnMetadata proto) { + return create(proto.getName(), SqlType.fromProto(proto.getType())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnToIndexMapper.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnToIndexMapper.java new file mode 100644 index 000000000000..aec1c5897cdc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnToIndexMapper.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.common.collect.ImmutableMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * This is an internal helper to share the index to column name lookup and the handling of ambiguous + * columns described below for Rows and Structs + */ +@InternalApi +public abstract class ColumnToIndexMapper { + // It is valid for a select query to return columns with the same name. This marker is used + // internally in the client to designate that getting a value by column name is invalid and will + // be converted into an exception. + private static final int AMBIGUOUS_FIELD_MARKER = -1; + + private Map columnNameMapping; + + protected ColumnToIndexMapper(List columns) { + columnNameMapping = buildColumnNameMapping(columns); + } + + public int getColumnIndex(String columnName) { + Integer index = columnNameMapping.get(columnName); + if (index == null) { + throw new IllegalArgumentException("Column name not found: " + columnName); + } + int unboxedIndex = index; + if (unboxedIndex == AMBIGUOUS_FIELD_MARKER) { + throw new IllegalArgumentException( + "Ambiguous column name: " + columnName + ". Same name is used for multiple columns."); + } + return unboxedIndex; + } + + private Map buildColumnNameMapping(List columns) { + HashMap mapping = new HashMap<>(columns.size()); + for (int i = 0; i < columns.size(); i++) { + String columnName = columns.get(i).name(); + if (mapping.containsKey(columnName)) { + mapping.put(columnName, AMBIGUOUS_FIELD_MARKER); + } else { + mapping.put(columnName, i); + } + } + return ImmutableMap.copyOf(mapping); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/JwtCredentialsWithAudience.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/JwtCredentialsWithAudience.java new file mode 100644 index 000000000000..4456e278e242 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/JwtCredentialsWithAudience.java @@ -0,0 +1,84 @@ +/* + * 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auth.Credentials; +import com.google.auth.RequestMetadataCallback; +import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; +import java.io.IOException; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executor; + +/** + * Internal helper to fix the mapping between JWT audiences and service endpoints. + * + *

In most cases JWT audiences correspond to service endpoints. However, in some cases they + * diverge. To workaround this, this class hardcodes the audience and forces the underlying + * implementation to use it. + * + *

Internal Only - public for technical reasons + */ +@InternalApi +public class JwtCredentialsWithAudience extends Credentials { + private final ServiceAccountJwtAccessCredentials delegate; + + public JwtCredentialsWithAudience(ServiceAccountJwtAccessCredentials delegate, URI audience) { + this.delegate = delegate.toBuilder().setDefaultAudience(audience).build(); + } + + @Override + public String getAuthenticationType() { + return delegate.getAuthenticationType(); + } + + @Override + public Map> getRequestMetadata() throws IOException { + return delegate.getRequestMetadata(); + } + + @Override + public void getRequestMetadata(URI ignored, Executor executor, RequestMetadataCallback callback) { + delegate.getRequestMetadata(null, executor, callback); + } + + @Override + public Map> getRequestMetadata(URI ignored) throws IOException { + return delegate.getRequestMetadata(null); + } + + @Override + public boolean hasRequestMetadata() { + return delegate.hasRequestMetadata(); + } + + @Override + public boolean hasRequestMetadataOnly() { + return delegate.hasRequestMetadataOnly(); + } + + @Override + public void refresh() throws IOException { + delegate.refresh(); + } + + @Override + public String getUniverseDomain() { + return delegate.getUniverseDomain(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java new file mode 100644 index 000000000000..b53f235d7b65 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java @@ -0,0 +1,189 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.MaterializedViewId; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.annotation.Nonnull; + +/** + * Internal helper to compose full resource names. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class NameUtil { + private static final Pattern TABLE_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)"); + private static final Pattern AUTHORIZED_VIEW_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)/authorizedViews/([^/]+)"); + private static final Pattern MATERIALIZED_VIEW_PATTERN = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/materializedViews/([^/]+)"); + + public static String formatInstanceName(@Nonnull String projectId, @Nonnull String instanceId) { + return "projects/" + projectId + "/instances/" + instanceId; + } + + public static String formatTableName( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String tableId) { + return formatInstanceName(projectId, instanceId) + "/tables/" + tableId; + } + + public static String formatTableName( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull TableId tableId) { + return formatTableName(projectId, instanceId, tableId.getTableId()); + } + + public static String formatAuthorizedViewName( + @Nonnull String projectId, + @Nonnull String instanceId, + @Nonnull String tableId, + @Nonnull String authorizedViewId) { + return formatTableName(projectId, instanceId, tableId) + "/authorizedViews/" + authorizedViewId; + } + + public static String formatAuthorizedViewName( + @Nonnull String projectId, + @Nonnull String instanceId, + @Nonnull AuthorizedViewId authorizedViewId) { + return formatTableName(projectId, instanceId, authorizedViewId.getTableId()) + + "/authorizedViews/" + + authorizedViewId.getAuthorizedViewId(); + } + + public static String formatMaterializedViewName( + @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) { + return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId; + } + + public static String formatMaterializedViewName( + @Nonnull String projectId, + @Nonnull String instanceId, + @Nonnull MaterializedViewId materializedViewId) { + return formatInstanceName(projectId, instanceId) + + "/materializedViews/" + + materializedViewId.getMaterializedViewId(); + } + + public static String extractTableIdFromTableName(@Nonnull String fullTableName) { + Matcher matcher = TABLE_PATTERN.matcher(fullTableName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid table name: " + fullTableName); + } + return matcher.group(3); + } + + public static String extractTableIdFromAuthorizedViewName( + @Nonnull String fullAuthorizedViewName) { + Matcher matcher = AUTHORIZED_VIEW_PATTERN.matcher(fullAuthorizedViewName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid authorized view name: " + fullAuthorizedViewName); + } + return matcher.group(3); + } + + public static String extractTableNameFromAuthorizedViewName( + @Nonnull String fullAuthorizedViewName) { + Matcher matcher = AUTHORIZED_VIEW_PATTERN.matcher(fullAuthorizedViewName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid authorized view name: " + fullAuthorizedViewName); + } + return formatTableName(matcher.group(1), matcher.group(2), matcher.group(3)); + } + + public static String extractAuthorizedViewIdFromAuthorizedViewName( + @Nonnull String fullAuthorizedViewName) { + Matcher matcher = AUTHORIZED_VIEW_PATTERN.matcher(fullAuthorizedViewName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid authorized view name: " + fullAuthorizedViewName); + } + return matcher.group(4); + } + + public static String extractMaterializedViewIdFromMaterializedViewName( + @Nonnull String fullMaterializedViewName) { + Matcher matcher = MATERIALIZED_VIEW_PATTERN.matcher(fullMaterializedViewName); + if (!matcher.matches()) { + throw new IllegalArgumentException( + "Invalid materialized view name: " + fullMaterializedViewName); + } + return matcher.group(3); + } + + /** A helper to convert fully qualified tableName andauthorizedViewName to a {@link TargetId} */ + public static TargetId extractTargetId( + @Nonnull String tableName, @Nonnull String authorizedViewName) { + return extractTargetId(tableName, authorizedViewName, ""); + } + + /** + * A helper to convert fully qualified tableName, authorizedViewName and materializedViewName to a + * {@link TargetId} + */ + public static TargetId extractTargetId( + @Nonnull String tableName, + @Nonnull String authorizedViewName, + @Nonnull String materializedViewName) { + if (tableName.isEmpty() && authorizedViewName.isEmpty() && materializedViewName.isEmpty()) { + throw new IllegalArgumentException( + "Either table name, authorized view name or materialized view name must be specified." + + " Table name: " + + tableName + + ", authorized view name: " + + authorizedViewName + + ", materialized view name: " + + materializedViewName); + } + int names = 0; + if (!tableName.isEmpty()) { + ++names; + } + if (!authorizedViewName.isEmpty()) { + ++names; + } + if (!materializedViewName.isEmpty()) { + ++names; + } + if (names > 1) { + throw new IllegalArgumentException( + "Only one of table name, authorized view name and materialized view name can be specified" + + " at the same time. Table name: " + + tableName + + ", authorized view name: " + + authorizedViewName + + ", materialized view name: " + + materializedViewName); + } + + if (!tableName.isEmpty()) { + String tableId = extractTableIdFromTableName(tableName); + return TableId.of(tableId); + } else if (!authorizedViewName.isEmpty()) { + String tableId = extractTableIdFromAuthorizedViewName(authorizedViewName); + String authorizedViewId = extractAuthorizedViewIdFromAuthorizedViewName(authorizedViewName); + return AuthorizedViewId.of(tableId, authorizedViewId); + } + String materializedViewId = + extractMaterializedViewIdFromMaterializedViewName(materializedViewName); + return MaterializedViewId.of(materializedViewId); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequest.java new file mode 100644 index 000000000000..0a330d32c629 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import java.util.HashMap; +import java.util.Map; + +/** + * Internal representation of PrepareQueryRequest that handles conversion from user-facing types to + * proto. + * + *

This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +@AutoValue +public abstract class PrepareQueryRequest { + + public abstract String query(); + + public abstract Map> paramTypes(); + + public static PrepareQueryRequest create(String query, Map> paramTypes) { + return new AutoValue_PrepareQueryRequest(query, paramTypes); + } + + public com.google.bigtable.v2.PrepareQueryRequest toProto(RequestContext requestContext) { + HashMap protoParamTypes = new HashMap<>(paramTypes().size()); + for (Map.Entry> entry : paramTypes().entrySet()) { + Type proto = QueryParamUtil.convertToQueryParamProto(entry.getValue()); + protoParamTypes.put(entry.getKey(), proto); + } + + return com.google.bigtable.v2.PrepareQueryRequest.newBuilder() + .setInstanceName( + NameUtil.formatInstanceName( + requestContext.getProjectId(), requestContext.getInstanceId())) + .setAppProfileId(requestContext.getAppProfileId()) + .setQuery(query()) + .putAllParamTypes(protoParamTypes) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareResponse.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareResponse.java new file mode 100644 index 000000000000..35247e2dc9a8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareResponse.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.protobuf.ByteString; +import java.time.Instant; + +/** + * Wrapper for results of a PrepareQuery call. + * + *

This should only be managed by {@link + * com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement}, and never used directly by users + * + *

This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +@AutoValue +public abstract class PrepareResponse { + public abstract ResultSetMetadata resultSetMetadata(); + + public abstract ByteString preparedQuery(); + + public abstract Instant validUntil(); + + public static PrepareResponse fromProto(PrepareQueryResponse proto) { + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(proto.getMetadata()); + Instant validUntil = TimestampUtil.toInstant(proto.getValidUntil()); + return new AutoValue_PrepareResponse(metadata, proto.getPreparedQuery(), validUntil); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImpl.java new file mode 100644 index 000000000000..0af50b62f334 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImpl.java @@ -0,0 +1,285 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.Futures; +import java.time.Duration; +import java.time.Instant; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Implementation of PreparedStatement that handles PreparedQuery refresh. + * + *

This allows for both hard refresh and background refresh of the current PreparedQueryData. + * When the server returns an error indicating that a plan is expired, hardRefresh should be used. + * Otherwise this will handle updating the PreparedQuery in the background, whenever it is accessed + * within one second of expiry. + * + *

This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public class PreparedStatementImpl implements PreparedStatement { + // Time before plan expiry to trigger background refresh + private static final Duration EXPIRY_REFRESH_WINDOW = Duration.ofSeconds(1L); + private final AtomicReference currentState; + private final Map> paramTypes; + private final PrepareQueryRequest prepareRequest; + private final EnhancedBigtableStub stub; + + @VisibleForTesting + protected PreparedStatementImpl( + PrepareResponse response, + Map> paramTypes, + PrepareQueryRequest request, + EnhancedBigtableStub stub) { + this.currentState = new AtomicReference<>(PrepareQueryState.createInitialState(response)); + this.paramTypes = paramTypes; + this.prepareRequest = request; + this.stub = stub; + } + + public static PreparedStatement create( + PrepareResponse response, + Map> paramTypes, + PrepareQueryRequest request, + EnhancedBigtableStub stub) { + return new PreparedStatementImpl(response, paramTypes, request, stub); + } + + @Override + public BoundStatement.Builder bind() { + return new BoundStatement.Builder(this, paramTypes); + } + + /** + * Asserts that the given stub matches the stub used for plan refresh. This is necessary to ensure + * that the request comes from the same client and uses the same configuration. We enforce this + * make sure plan refresh will continue to work as expected throughout the lifecycle of + * executeQuery requests. + */ + public void assertUsingSameStub(EnhancedBigtableStub stub) { + Preconditions.checkArgument( + this.stub == stub, + "executeQuery must be called from the same client instance that created the" + + " PreparedStatement being used."); + } + + /** + * When the client receives an error indicating the current plan has expired, it should call + * immediate refresh with the version of the expired plan. UID is used to handle concurrent + * refresh without making duplicate calls. + * + * @param expiredPreparedQueryVersion version of the PreparedQuery used to make the request that + * triggered immediate refresh + * @return refreshed PreparedQuery to use for retry. + */ + public synchronized PreparedQueryData markExpiredAndStartRefresh( + PreparedQueryVersion expiredPreparedQueryVersion) { + PrepareQueryState localState = this.currentState.get(); + // Check if the expired plan is the current plan. If it's not, then the plan has already + // been refreshed by another thread. + if (!(localState.current().version() == expiredPreparedQueryVersion)) { + return localState.current(); + } + startBackgroundRefresh(expiredPreparedQueryVersion); + // Immediately promote the refresh we just started + return promoteBackgroundRefreshingPlan(expiredPreparedQueryVersion); + } + + private synchronized PreparedQueryData promoteBackgroundRefreshingPlan( + PreparedQueryVersion expiredPreparedQueryVersion) { + PrepareQueryState localState = this.currentState.get(); + // If the expired plan has already been removed, return the current plan + if (!(localState.current().version() == expiredPreparedQueryVersion)) { + return localState.current(); + } + // There is a chance that the background plan could be expired if the PreparedStatement + // isn't used for a long time. It will be refreshed on the next retry if necessary. + PrepareQueryState nextState = localState.promoteBackgroundPlan(); + this.currentState.set(nextState); + return nextState.current(); + } + + /** + * If planNearExpiry is still the latest plan, and there is no ongoing background refresh, start a + * background refresh. Otherwise, refresh has already been triggered for this plan, so do nothing. + */ + private synchronized void startBackgroundRefresh(PreparedQueryVersion planVersionNearExpiry) { + PrepareQueryState localState = this.currentState.get(); + // We've already updated the plan we are triggering refresh based on + if (!(localState.current().version() == planVersionNearExpiry)) { + return; + } + // Another thread already started the refresh + if (localState.maybeBackgroundRefresh().isPresent()) { + return; + } + ApiFuture nextPlanFuture = getFreshPlan(); + PrepareQueryState withRefresh = localState.withBackgroundPlan(nextPlanFuture); + this.currentState.set(withRefresh); + } + + ApiFuture getFreshPlan() { + return this.stub.prepareQueryCallable().futureCall(this.prepareRequest); + } + + /** + * Check the expiry of the current plan, if it's future is resolved. If we are within 1s of + * expiry, call startBackgroundRefresh with the version of the latest PrepareQuery. + */ + synchronized void backgroundRefreshIfNeeded() { + PrepareQueryState localState = this.currentState.get(); + if (localState.maybeBackgroundRefresh().isPresent()) { + // We already have an ongoing refresh + return; + } + PreparedQueryData currentPlan = localState.current(); + // Can't access ttl until the current prepare future has resolved + if (!currentPlan.prepareFuture().isDone()) { + return; + } + try { + // Trigger a background refresh if within 1 second of TTL + Instant currentPlanExpireTime = Futures.getDone(currentPlan.prepareFuture()).validUntil(); + Instant backgroundRefreshTime = currentPlanExpireTime.minus(EXPIRY_REFRESH_WINDOW); + if (Instant.now().isAfter(backgroundRefreshTime)) { + // Initiate a background refresh. startBackgroundRefresh handles deduplication. + startBackgroundRefresh(currentPlan.version()); + } + } catch (ExecutionException | CancellationException e) { + // Do nothing if we can't get the future result, a refresh will be done when it's actually + // needed, or during the next call to this method + } + } + + /** + * Returns the most recently refreshed PreparedQueryData. It may still be refreshing if the + * previous plan has expired. + */ + public synchronized PreparedQueryData getLatestPrepareResponse() { + PrepareQueryState localState = currentState.get(); + if (localState.maybeBackgroundRefresh().isPresent() + && localState.maybeBackgroundRefresh().get().prepareFuture().isDone()) { + // TODO: consider checking if background plan has already expired and triggering + // a new refresh if so. Right now we are ok with attempting a request w an expired + // plan + + // Current background refresh has completed, so we should make it the current plan. + // promoteBackgroundRefreshingPlan handles duplicate calls. + return promoteBackgroundRefreshingPlan(localState.current().version()); + } else { + backgroundRefreshIfNeeded(); + return localState.current(); + } + } + + /** + * Used to compare different versions of a PreparedQuery by comparing reference equality. + * + *

This is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi("For internal use only") + public static class PreparedQueryVersion {} + + /** + * Manages the data around the latest prepared query + * + *

This is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi("For internal use only") + @AutoValue + public abstract static class PreparedQueryData { + /** + * Unique identifier for each version of a PreparedQuery. Changes each time the plan is + * refreshed + */ + public abstract PreparedQueryVersion version(); + + /** + * A future holding the prepareResponse. It will never fail, so the caller is responsible for + * timing out requests based on the retry settings of the execute query request + */ + public abstract ApiFuture prepareFuture(); + + public static PreparedQueryData create(ApiFuture prepareFuture) { + return new AutoValue_PreparedStatementImpl_PreparedQueryData( + new PreparedQueryVersion(), prepareFuture); + } + } + + /** + * Encapsulates the state needed to for PreparedStatementImpl. This is both the latest + * PrepareQuery response and, when present, any ongoing background refresh. + * + *

This is stored together because it is accessed concurrently. This makes it easy to reason + * about and mutate the state atomically. + */ + @AutoValue + abstract static class PrepareQueryState { + /** The data representing the latest PrepareQuery response */ + abstract PreparedQueryData current(); + + /** An Optional, that if present represents an ongoing background refresh attempt */ + abstract Optional maybeBackgroundRefresh(); + + /** Creates a fresh state, using initialPlan as current, with no backgroundRefresh */ + static PrepareQueryState createInitialState(PrepareResponse initialPlan) { + PreparedQueryData initialData = + PreparedQueryData.create(ApiFutures.immediateFuture(initialPlan)); + return new AutoValue_PreparedStatementImpl_PrepareQueryState(initialData, Optional.empty()); + } + + /** + * Returns a new state with the same current PreparedQueryData, using the given PrepareResponse + * future to add a backgroundRefresh + */ + PrepareQueryState withBackgroundPlan(ApiFuture backgroundPlan) { + return new AutoValue_PreparedStatementImpl_PrepareQueryState( + current(), Optional.of(PreparedQueryData.create(backgroundPlan))); + } + + /** + * Returns a new state with the background plan promoted to current, and without a new + * background refresh. This should be used to update the state once a backgroundRefresh has + * completed. + */ + PrepareQueryState promoteBackgroundPlan() { + if (maybeBackgroundRefresh().isPresent()) { + return new AutoValue_PreparedStatementImpl_PrepareQueryState( + maybeBackgroundRefresh().get(), Optional.empty()); + } + // We don't expect this to happen, but if so returning the current plan allows retry on + // subsequent attempts + return this; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.java new file mode 100644 index 000000000000..45542d96e6d9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ProtoSchema; +import com.google.bigtable.v2.ResultSetMetadata.SchemaCase; +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Implementation of {@link ResultSetMetadata} using an underlying protobuf schema. + * + *

This is considered an internal implementation detail and not meant to be used by applications. + */ +@InternalApi +public class ProtoResultSetMetadata extends ColumnToIndexMapper implements ResultSetMetadata { + private final List columns; + + public static ResultSetMetadata create(List columns) { + return new ProtoResultSetMetadata(columns); + } + + private ProtoResultSetMetadata(List columns) { + super(columns); + this.columns = ImmutableList.copyOf(columns); + } + + @Override + public List getColumns() { + return columns; + } + + @Override + public SqlType getColumnType(int columnIndex) { + return columns.get(columnIndex).type(); + } + + @Override + public SqlType getColumnType(String columnName) { + return getColumnType(getColumnIndex(columnName)); + } + + @InternalApi + public static ResultSetMetadata fromProto(com.google.bigtable.v2.ResultSetMetadata proto) { + Preconditions.checkState( + proto.getSchemaCase().equals(SchemaCase.PROTO_SCHEMA), + "Unsupported schema type: %s", + proto.getSchemaCase().name()); + ProtoSchema schema = proto.getProtoSchema(); + validateSchema(schema); + ImmutableList.Builder columnsBuilder = ImmutableList.builder(); + for (com.google.bigtable.v2.ColumnMetadata protoColumn : schema.getColumnsList()) { + columnsBuilder.add(ColumnMetadataImpl.fromProto(protoColumn)); + } + return create(columnsBuilder.build()); + } + + private static void validateSchema(ProtoSchema schema) { + List columns = schema.getColumnsList(); + Preconditions.checkState(!columns.isEmpty(), "columns cannot be empty"); + for (com.google.bigtable.v2.ColumnMetadata column : columns) { + Preconditions.checkState( + column.getType().getKindCase() != Type.KindCase.KIND_NOT_SET, + "Column type cannot be empty"); + } + } + + @Override + public boolean equals(@Nullable Object other) { + if (other instanceof ProtoResultSetMetadata) { + ProtoResultSetMetadata o = (ProtoResultSetMetadata) other; + // columnNameMapping is derived from columns, so we only need to compare columns + return columns.equals(o.columns); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hashCode(columns); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoSqlRow.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoSqlRow.java new file mode 100644 index 000000000000..3a63fe089aef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoSqlRow.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import java.util.List; + +@InternalApi +@AutoValue +public abstract class ProtoSqlRow extends AbstractProtoStructReader implements SqlRow { + /** + * Creates a new SqlRow + * + * @param metadata the {@link ResultSetMetadata} for the results + * @param values list of the values for each column + */ + public static ProtoSqlRow create(ResultSetMetadata metadata, List values) { + return new AutoValue_ProtoSqlRow(values, metadata); + } + + /** {@link ResultSetMetadata} describing the schema of the row. */ + abstract ResultSetMetadata metadata(); + + @Override + public int getColumnIndex(String columnName) { + return metadata().getColumnIndex(columnName); + } + + @Override + public SqlType getColumnType(int columnIndex) { + return metadata().getColumnType(columnIndex); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoStruct.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoStruct.java new file mode 100644 index 000000000000..f9da3ef9fbac --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoStruct.java @@ -0,0 +1,58 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import java.util.List; + +/** + * Implementation of a {@link Struct} backed by protobuf {@link Value}s. + * + *

This is considered an internal implementation detail and not meant to be used by applications. + */ +@InternalApi("For internal use only") +@AutoValue +public abstract class ProtoStruct extends AbstractProtoStructReader implements Struct { + + @InternalApi + static ProtoStruct create(SqlType.Struct type, ArrayValue fieldValues) { + return new AutoValue_ProtoStruct(type, fieldValues); + } + + protected abstract SqlType.Struct type(); + + protected abstract ArrayValue fieldValues(); + + @Override + List values() { + return fieldValues().getValuesList(); + } + + @Override + public int getColumnIndex(String columnName) { + return type().getColumnIndex(columnName); + } + + @Override + public SqlType getColumnType(int columnIndex) { + return type().getType(columnIndex); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtil.java new file mode 100644 index 000000000000..439f8f720541 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtil.java @@ -0,0 +1,98 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType.Array; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType.Code; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Helper to convert SqlTypes to protobuf query parameter representation + * + *

This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public class QueryParamUtil { + private static final Type STRING_TYPE = + Type.newBuilder().setStringType(Type.String.getDefaultInstance()).build(); + private static final Type BYTES_TYPE = + Type.newBuilder().setBytesType(Type.Bytes.getDefaultInstance()).build(); + private static final Type INT64_TYPE = + Type.newBuilder().setInt64Type(Type.Int64.getDefaultInstance()).build(); + private static final Type FLOAT32_TYPE = + Type.newBuilder().setFloat32Type(Type.Float32.getDefaultInstance()).build(); + private static final Type FLOAT64_TYPE = + Type.newBuilder().setFloat64Type(Type.Float64.getDefaultInstance()).build(); + private static final Type BOOL_TYPE = + Type.newBuilder().setBoolType(Type.Bool.getDefaultInstance()).build(); + private static final Type TIMESTAMP_TYPE = + Type.newBuilder().setTimestampType(Type.Timestamp.getDefaultInstance()).build(); + private static final Type DATE_TYPE = + Type.newBuilder().setDateType(Type.Date.getDefaultInstance()).build(); + + private static final Set VALID_ARRAY_ELEMENT_TYPES = + new HashSet<>( + Arrays.asList( + Code.STRING, + Code.BYTES, + Code.INT64, + Code.FLOAT64, + Code.FLOAT32, + Code.BOOL, + Code.TIMESTAMP, + Code.DATE)); + + public static Type convertToQueryParamProto(SqlType sqlType) { + switch (sqlType.getCode()) { + case BYTES: + return BYTES_TYPE; + case STRING: + return STRING_TYPE; + case INT64: + return INT64_TYPE; + case FLOAT64: + return FLOAT64_TYPE; + case FLOAT32: + return FLOAT32_TYPE; + case BOOL: + return BOOL_TYPE; + case TIMESTAMP: + return TIMESTAMP_TYPE; + case DATE: + return DATE_TYPE; + case STRUCT: + throw new IllegalArgumentException("STRUCT is not a supported query parameter type"); + case MAP: + throw new IllegalArgumentException("MAP is not a supported query parameter type"); + case ARRAY: + SqlType.Array arrayType = (Array) sqlType; + if (!VALID_ARRAY_ELEMENT_TYPES.contains(arrayType.getElementType().getCode())) { + throw new IllegalArgumentException( + "Unsupported query parameter Array element type: " + arrayType.getElementType()); + } + Type elementType = convertToQueryParamProto(arrayType.getElementType()); + Type.Array arrayProto = Type.Array.newBuilder().setElementType(elementType).build(); + return Type.newBuilder().setArrayType(arrayProto).build(); + default: + throw new IllegalArgumentException("Unsupported Query parameter type: " + sqlType); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java new file mode 100644 index 000000000000..00cebcf462c7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java @@ -0,0 +1,84 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.protobuf.ByteString; +import com.google.protobuf.ByteString.ByteIterator; + +/** + * Contains utilities to handle RE2 flavor regular expressions. This differs from {@link + * java.util.regex.Pattern} in two important ways: + * + *

    + *
  1. Binary strings are supported. + *
  2. The syntax is a lot more restricted but allows different modifiers. + *
+ * + *

See https://github.com/google/re2 for more + * details. + */ +@InternalApi +public final class RegexUtil { + private static final byte[] NULL_BYTES = {0}; + + private RegexUtil() {} + + public static String literalRegex(final String value) { + return literalRegex(ByteString.copyFromUtf8(value)).toStringUtf8(); + } + + /** Converts the value to a quoted regular expression. */ + public static ByteString literalRegex(ByteString value) { + ByteString.Output output = ByteString.newOutput(value.size() * 2); + + ByteIterator it = value.iterator(); + writeLiteralRegex(it, output); + + return output.toByteString(); + } + + // Extracted from: re2 QuoteMeta: + // https://github.com/google/re2/blob/70f66454c255080a54a8da806c52d1f618707f8a/re2/re2.cc#L456 + private static void writeLiteralRegex(ByteIterator input, ByteString.Output output) { + while (input.hasNext()) { + byte unquoted = input.nextByte(); + + if ((unquoted < 'a' || unquoted > 'z') + && (unquoted < 'A' || unquoted > 'Z') + && (unquoted < '0' || unquoted > '9') + && unquoted != '_' + && + // If this is the part of a UTF8 or Latin1 character, we need + // to copy this byte without escaping. Experimentally this is + // what works correctly with the regexp library. + (unquoted & 128) == 0) { + + if (unquoted == '\0') { // Special handling for null chars. + // Note that this special handling is not strictly required for RE2, + // but this quoting is required for other regexp libraries such as + // PCRE. + // Can't use "\\0" since the next character might be a digit. + output.write(NULL_BYTES, 0, NULL_BYTES.length); + continue; + } + + output.write('\\'); + } + output.write(unquoted); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java new file mode 100644 index 000000000000..7058ae137c58 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import java.io.Serializable; + +/** + * Contains information necessary to construct Bigtable protobuf requests from user facing models. + * + *

The intention is to extract repetitive details like instance names and app profiles into a + * configurable values in {@link com.google.cloud.bigtable.data.v2.BigtableDataSettings} and expose + * them (via this class) to each wrapper's toProto method. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +@AutoValue +public abstract class RequestContext implements Serializable { + + public static RequestContext create(ClientInfo clientInfo) { + return create( + clientInfo.getInstanceName().getProjectId(), + clientInfo.getInstanceName().getInstanceId(), + clientInfo.getAppProfileId()); + } + + /** Creates a new instance of the {@link RequestContext}. */ + public static RequestContext create(String projectId, String instanceId, String appProfileId) { + return new AutoValue_RequestContext(projectId, instanceId, appProfileId); + } + + /** The project id that the client is configured to target. */ + public abstract String getProjectId(); + + /** The instance id that the client is configured to target. */ + public abstract String getInstanceId(); + + /** The App Profile to use when processing the current request */ + public abstract String getAppProfileId(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java new file mode 100644 index 000000000000..77bc0ebd6b96 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java @@ -0,0 +1,245 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import com.google.cloud.bigtable.data.v2.models.sql.StructReader; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream; +import com.google.common.base.Preconditions; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.ProtocolMessageEnum; +import java.time.Instant; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +/** + * The primary implementation of a ResultSet. + * + *

This passes through StructReader calls to each row rather than implementing + * AbstractProtoStructReader directly so that it can support different types of rows in the future. + * + *

This is considered an internal implementation detail and not meant to be used by applications. + */ +@InternalApi("For internal use only") +public class ResultSetImpl implements ResultSet, StructReader { + + private final ServerStream serverStream; + private final Iterator rowIterator; + private final ApiFuture metadataApiFuture; + private boolean consumed; + private SqlRow currentRow; + + public static ResultSet create(SqlServerStream sqlServerStream) { + return new ResultSetImpl(sqlServerStream); + } + + private ResultSetImpl(SqlServerStream sqlServerStream) { + this.serverStream = sqlServerStream.rows(); + this.rowIterator = serverStream.iterator(); + this.metadataApiFuture = sqlServerStream.metadataFuture(); + this.consumed = false; + } + + private SqlRow getCurrentRow() { + Preconditions.checkState(!consumed, "Attempted to access data from closed ResultSet"); + Preconditions.checkState(currentRow != null, "Attempted to access data before calling next()"); + return currentRow; + } + + @Override + public boolean next() { + if (consumed) { + return false; + } + boolean hasNext = rowIterator.hasNext(); + if (hasNext) { + currentRow = rowIterator.next(); + } else { + consumed = true; + } + return hasNext; + } + + @Override + public ResultSetMetadata getMetadata() { + return ApiExceptions.callAndTranslateApiException(metadataApiFuture); + } + + @Override + public void close() { + // If the stream has been consumed we don't want to cancel because it could + // cancel the request before it receives response trailers. + if (!consumed) { + serverStream.cancel(); + } + consumed = true; + } + + @Override + public boolean isNull(int columnIndex) { + return getCurrentRow().isNull(columnIndex); + } + + @Override + public boolean isNull(String columnName) { + return getCurrentRow().isNull(columnName); + } + + @Override + public ByteString getBytes(int columnIndex) { + return getCurrentRow().getBytes(columnIndex); + } + + @Override + public ByteString getBytes(String columnName) { + return getCurrentRow().getBytes(columnName); + } + + @Override + public String getString(int columnIndex) { + return getCurrentRow().getString(columnIndex); + } + + @Override + public String getString(String columnName) { + return getCurrentRow().getString(columnName); + } + + @Override + public long getLong(int columnIndex) { + return getCurrentRow().getLong(columnIndex); + } + + @Override + public long getLong(String columnName) { + return getCurrentRow().getLong(columnName); + } + + @Override + public double getDouble(int columnIndex) { + return getCurrentRow().getDouble(columnIndex); + } + + @Override + public double getDouble(String columnName) { + return getCurrentRow().getDouble(columnName); + } + + @Override + public float getFloat(int columnIndex) { + return getCurrentRow().getFloat(columnIndex); + } + + @Override + public float getFloat(String columnName) { + return getCurrentRow().getFloat(columnName); + } + + @Override + public boolean getBoolean(int columnIndex) { + return getCurrentRow().getBoolean(columnIndex); + } + + @Override + public boolean getBoolean(String columnName) { + return getCurrentRow().getBoolean(columnName); + } + + @Override + public Instant getTimestamp(int columnIndex) { + return getCurrentRow().getTimestamp(columnIndex); + } + + @Override + public Instant getTimestamp(String columnName) { + return getCurrentRow().getTimestamp(columnName); + } + + @Override + public Date getDate(int columnIndex) { + return getCurrentRow().getDate(columnIndex); + } + + @Override + public Date getDate(String columnName) { + return getCurrentRow().getDate(columnName); + } + + @Override + public Struct getStruct(int columnIndex) { + return getCurrentRow().getStruct(columnIndex); + } + + @Override + public Struct getStruct(String columnName) { + return getCurrentRow().getStruct(columnName); + } + + @Override + public List getList(int columnIndex, SqlType.Array arrayType) { + return getCurrentRow().getList(columnIndex, arrayType); + } + + @Override + public List getList(String columnName, SqlType.Array arrayType) { + return getCurrentRow().getList(columnName, arrayType); + } + + @Override + public Map getMap(int columnIndex, SqlType.Map mapType) { + return getCurrentRow().getMap(columnIndex, mapType); + } + + @Override + public Map getMap(String columnName, SqlType.Map mapType) { + return getCurrentRow().getMap(columnName, mapType); + } + + @Override + public EnumType getProtoEnum( + int columnIndex, Function forNumber) { + return getCurrentRow().getProtoEnum(columnIndex, forNumber); + } + + @Override + public EnumType getProtoEnum( + String columnName, Function forNumber) { + return getCurrentRow().getProtoEnum(columnName, forNumber); + } + + @Override + public MsgType getProtoMessage( + int columnIndex, MsgType message) { + return getCurrentRow().getProtoMessage(columnIndex, message); + } + + @Override + public MsgType getProtoMessage( + String columnName, MsgType message) { + return getCurrentRow().getProtoMessage(columnName, message); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtil.java new file mode 100644 index 000000000000..184dfff6230b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtil.java @@ -0,0 +1,55 @@ +/* + * 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.google.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.cloud.bigtable.data.v2.stub.readrows.RowMerger; +import java.util.ArrayList; +import java.util.List; + +@InternalApi("For internal google use only") +public class RowMergerUtil implements AutoCloseable { + private final RowMerger merger; + + public RowMergerUtil() { + RowBuilder rowBuilder = new DefaultRowAdapter().createRowBuilder(); + merger = new RowMerger<>(rowBuilder, false); + } + + @Override + public void close() { + if (merger.hasPartialFrame()) { + throw new IllegalStateException("Tried to close merger with unmerged partial data"); + } + } + + public List parseReadRowsResponses(Iterable responses) { + List rows = new ArrayList<>(); + + for (ReadRowsResponse response : responses) { + merger.push(response); + while (merger.hasFullFrame()) { + rows.add(merger.pop()); + } + } + + return rows; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java new file mode 100644 index 000000000000..2c4ce914bb66 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java @@ -0,0 +1,456 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.RowSet; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsResumptionStrategy; +import com.google.common.base.Preconditions; +import com.google.common.collect.ComparisonChain; +import com.google.protobuf.ByteString; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.SortedSet; +import java.util.stream.Collectors; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Internal helper to split a {@link RowSet} into segments based on keys. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + * + * @see Query#shard(List) + * @see Query#getBound() + * @see ReadRowsResumptionStrategy#getResumeRequest(ReadRowsRequest) + */ +@InternalApi +public final class RowSetUtil { + private RowSetUtil() {} + + /** Removes the {@code #excludePoint} rowkey from the {@code RowSet} */ + public static RowSet eraseLargeRow(RowSet rowSet, ByteString excludePoint) { + + RowSet.Builder newRowSet = RowSet.newBuilder(); + + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { + // querying range (, excludePoint) and (excludePoint, ) + newRowSet.addRowRanges(RowRange.newBuilder().setEndKeyOpen(excludePoint).build()); + newRowSet.addRowRanges(RowRange.newBuilder().setStartKeyOpen(excludePoint).build()); + } + + // remove large row key from point reads + rowSet.getRowKeysList().stream() + .filter(k -> !k.equals(excludePoint)) + .forEach(newRowSet::addRowKeys); + + // Handle ranges + for (RowRange rowRange : rowSet.getRowRangesList()) { + List afterSplit = splitOnLargeRowKey(rowRange, excludePoint); + if (!afterSplit.isEmpty()) { + afterSplit.forEach(newRowSet::addRowRanges); + } + } + + if (newRowSet.getRowKeysList().isEmpty() && newRowSet.getRowRangesList().isEmpty()) { + return null; + } + return newRowSet.build(); + } + + /** + * Removes all the keys and range parts that fall on or before the splitPoint. + * + *

The direction of before is determined by fromStart: for forward scans fromStart is true and + * will remove all the keys and range segments that would've been read prior to the splitPoint + * (ie. all of the keys sort lexiographically at or before the split point. For reverse scans, + * fromStart is false and all segments that sort lexiographically at or after the split point are + * removed. The primary usecase is to resume a broken ReadRows stream. + */ + public static RowSet erase(RowSet rowSet, ByteString splitPoint, boolean fromStart) { + RowSet.Builder newRowSet = RowSet.newBuilder(); + + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { + rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); + } + + // Handle point lookups + for (ByteString key : rowSet.getRowKeysList()) { + if (fromStart) { + // key is right of the split + if (ByteStringComparator.INSTANCE.compare(key, splitPoint) > 0) { + newRowSet.addRowKeys(key); + } + } else { + // key is left of the split + if (ByteStringComparator.INSTANCE.compare(key, splitPoint) < 0) { + newRowSet.addRowKeys(key); + } + } + } + + // Handle ranges + for (RowRange rowRange : rowSet.getRowRangesList()) { + RowRange newRange = truncateRange(rowRange, splitPoint, fromStart); + if (newRange != null) { + newRowSet.addRowRanges(newRange); + } + } + + // Return the new rowset if there is anything left to read + RowSet result = newRowSet.build(); + if (result.getRowKeysList().isEmpty() && result.getRowRangesList().isEmpty()) { + return null; + } + return result; + } + + private static RowRange truncateRange(RowRange range, ByteString split, boolean fromStart) { + if (fromStart) { + // range end is on or left of the split: skip + if (EndPoint.extract(range).compareTo(new EndPoint(split, true)) <= 0) { + return null; + } + } else { + // range is on or right of the split + if (StartPoint.extract(range).compareTo(new StartPoint(split, true)) >= 0) { + return null; + } + } + RowRange.Builder newRange = range.toBuilder(); + + if (fromStart) { + // range start is on or left of the split + if (StartPoint.extract(range).compareTo(new StartPoint(split, true)) <= 0) { + newRange.setStartKeyOpen(split); + } + } else { + // range end is on or right of the split + if (EndPoint.extract(range).compareTo(new EndPoint(split, true)) >= 0) { + newRange.setEndKeyOpen(split); + } + } + + return newRange.build(); + } + + /** This method erases the {@code #split} key from the range */ + private static List splitOnLargeRowKey(RowRange range, ByteString largeRowKey) { + List rowRanges = new ArrayList<>(); + + ByteString startKey = StartPoint.extract(range).value; + ByteString endKey = EndPoint.extract(range).value; + + // Empty endKey means it's unbounded + boolean boundedEnd = !endKey.isEmpty(); + + // if end key is on the left of large row key, don't split. + if (boundedEnd && ByteStringComparator.INSTANCE.compare(endKey, largeRowKey) < 0) { + rowRanges.add(range); + return rowRanges; + } + + // if start key is on the right of the large row key, don't split + if (ByteStringComparator.INSTANCE.compare(startKey, largeRowKey) > 0) { + rowRanges.add(range); + return rowRanges; + } + + // if start key is on the left of the large row key, set the end key to be large row key open + if (ByteStringComparator.INSTANCE.compare(startKey, largeRowKey) < 0) { + RowRange beforeSplit = range.toBuilder().setEndKeyOpen(largeRowKey).build(); + rowRanges.add(beforeSplit); + } + + // if the end key is on the right of the large row key, set the start key to be large row key + // open. + if (!boundedEnd || ByteStringComparator.INSTANCE.compare(endKey, largeRowKey) > 0) { + // handle the edge case where (key, key\0) is an empty range and should be excluded + ByteString nextKey = largeRowKey.concat(ByteString.copyFrom(new byte[] {0})); + EndPoint endPoint = EndPoint.extract(range); + boolean isEmptyRange = !endPoint.isClosed && endPoint.value.equals(nextKey); + + if (!isEmptyRange) { + RowRange afterSplit = range.toBuilder().setStartKeyOpen(largeRowKey).build(); + rowRanges.add(afterSplit); + } + } + + return rowRanges; + } + + /** + * Splits the provided {@link RowSet} into segments partitioned by the provided {@code + * splitPoints}. The split points will be treated as start keys of the segments. The primary + * usecase is for sharding a query for MapReduce style processing. + */ + @Nonnull + public static List shard( + @Nonnull RowSet rowSet, @Nonnull SortedSet splitPoints) { + + // An empty RowSet represents a full table scan. Make that explicit so that there is RowRange to + // split. + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { + rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); + } + + ArrayDeque keys = + rowSet.getRowKeysList().stream() + .sorted(ByteStringComparator.INSTANCE) + .collect(Collectors.toCollection(ArrayDeque::new)); + ArrayDeque ranges = + rowSet.getRowRangesList().stream() + .sorted(Comparator.comparing(StartPoint::extract)) + .collect(Collectors.toCollection(ArrayDeque::new)); + + List segments = new ArrayList<>(); + + boolean currentSegmentIsEmpty; + RowSet.Builder segment; + + for (ByteString splitPoint : splitPoints) { + Preconditions.checkArgument(!splitPoint.isEmpty(), "Can't handle empty splitPoints"); + + segment = RowSet.newBuilder(); + currentSegmentIsEmpty = true; + + // Handle keys - add all keys strictly < split point + while (!keys.isEmpty()) { + if (ByteStringComparator.INSTANCE.compare(keys.peek(), splitPoint) < 0) { + segment.addRowKeys(keys.poll()); + currentSegmentIsEmpty = false; + } else { + // This key and the following will be in a later segment + break; + } + } + + // Handle ranges + while (!ranges.isEmpty()) { + // Break early when encountering the first start point that is past the split point. + // Ranges start on or after the split point lay to the right + StartPoint startPoint = StartPoint.extract(ranges.peek()); + int startCmp = + ComparisonChain.start() + .compareTrueFirst(startPoint.value.isEmpty(), false) + .compare(startPoint.value, splitPoint, ByteStringComparator.INSTANCE) + // when start point is on the split point, it will always be on the right + .result(); + if (startCmp >= 0) { + break; + } + RowRange range = ranges.poll(); + + @SuppressWarnings("ConstantConditions") + EndPoint endPoint = EndPoint.extract(range); + + int endCmp = + ComparisonChain.start() + .compareFalseFirst(endPoint.value.isEmpty(), false) + .compare(endPoint.value, splitPoint, ByteStringComparator.INSTANCE) + .compareFalseFirst(endPoint.isClosed, true) + .result(); + if (endCmp < 0) { + segment.addRowRanges(range); + currentSegmentIsEmpty = false; + } else { + segment.addRowRanges(range.toBuilder().setEndKeyOpen(splitPoint)); + currentSegmentIsEmpty = false; + ranges.addFirst(range.toBuilder().setStartKeyClosed(splitPoint).build()); + } + } + + if (!currentSegmentIsEmpty) { + segments.add(segment.build()); + } + } + + if (!keys.isEmpty() || !ranges.isEmpty()) { + segment = RowSet.newBuilder().addAllRowKeys(keys).addAllRowRanges(ranges); + segments.add(segment.build()); + } + + return segments; + } + + /** Get the bounding range of a {@link RowSet}. */ + public static ByteStringRange getBound(RowSet rowSet) { + // Find min & max keys + ByteString minKey = null; + ByteString maxKey = null; + + for (ByteString key : rowSet.getRowKeysList()) { + if (minKey == null || ByteStringComparator.INSTANCE.compare(minKey, key) > 0) { + minKey = key; + } + if (maxKey == null || ByteStringComparator.INSTANCE.compare(maxKey, key) < 0) { + maxKey = key; + } + } + + // Convert min & max keys in start & end points for a range + StartPoint minStartPoint = null; + EndPoint maxEndPoint = null; + if (minKey != null) { + minStartPoint = new StartPoint(minKey, true); + } + if (maxKey != null) { + maxEndPoint = new EndPoint(maxKey, true); + } + + // Expand the range using the RowSet ranges + for (RowRange rowRange : rowSet.getRowRangesList()) { + StartPoint currentStartPoint = StartPoint.extract(rowRange); + if (minStartPoint == null || minStartPoint.compareTo(currentStartPoint) > 0) { + minStartPoint = currentStartPoint; + } + + EndPoint currentEndpoint = EndPoint.extract(rowRange); + if (maxEndPoint == null || maxEndPoint.compareTo(currentEndpoint) < 0) { + maxEndPoint = currentEndpoint; + } + } + + // Build a range using the endpoints + ByteStringRange boundingRange = ByteStringRange.unbounded(); + if (minStartPoint != null) { + if (minStartPoint.isClosed) { + boundingRange.startClosed(minStartPoint.value); + } else { + boundingRange.startOpen(minStartPoint.value); + } + } + if (maxEndPoint != null) { + if (maxEndPoint.isClosed) { + boundingRange.endClosed(maxEndPoint.value); + } else { + boundingRange.endOpen(maxEndPoint.value); + } + } + + return boundingRange; + } + + /** + * Represents a RowSet split into 2 non-overlapping parts. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + @AutoValue + public abstract static class Split { + @Nullable + public abstract RowSet getLeft(); + + @Nullable + public abstract RowSet getRight(); + + public static Split of(RowSet left, RowSet right) { + return new AutoValue_RowSetUtil_Split(left, right); + } + } + + /** Helper class to ease comparison of RowRange start points. */ + private static final class StartPoint implements Comparable { + private final ByteString value; + private final boolean isClosed; + + @Nonnull + static StartPoint extract(@Nonnull RowRange rowRange) { + switch (rowRange.getStartKeyCase()) { + case STARTKEY_NOT_SET: + return new StartPoint(ByteString.EMPTY, true); + case START_KEY_CLOSED: + return new StartPoint(rowRange.getStartKeyClosed(), true); + case START_KEY_OPEN: + if (rowRange.getStartKeyOpen().isEmpty()) { + // Take care to normalize an open empty start key to be closed. + return new StartPoint(ByteString.EMPTY, true); + } else { + return new StartPoint(rowRange.getStartKeyOpen(), false); + } + default: + throw new IllegalArgumentException("Unknown startKeyCase: " + rowRange.getStartKeyCase()); + } + } + + StartPoint(@Nonnull ByteString value, boolean isClosed) { + this.value = value; + this.isClosed = isClosed; + } + + @Override + public int compareTo(@Nonnull StartPoint o) { + return ComparisonChain.start() + // Empty string comes first + .compareTrueFirst(value.isEmpty(), o.value.isEmpty()) + .compare(value, o.value, ByteStringComparator.INSTANCE) + // Closed start point comes before an open start point: [x,y] starts before (x,y]. + .compareTrueFirst(isClosed, o.isClosed) + .result(); + } + } + + /** Helper class to ease comparison of RowRange endpoints. */ + private static final class EndPoint implements Comparable { + private final ByteString value; + private final boolean isClosed; + + @Nonnull + static EndPoint extract(@Nonnull RowRange rowRange) { + switch (rowRange.getEndKeyCase()) { + case ENDKEY_NOT_SET: + return new EndPoint(ByteString.EMPTY, true); + case END_KEY_CLOSED: + return new EndPoint(rowRange.getEndKeyClosed(), true); + case END_KEY_OPEN: + if (rowRange.getEndKeyOpen().isEmpty()) { + // Take care to normalize an open empty end key to be closed. + return new EndPoint(ByteString.EMPTY, true); + } else { + return new EndPoint(rowRange.getEndKeyOpen(), false); + } + default: + throw new IllegalArgumentException("Unknown endKeyCase: " + rowRange.getEndKeyCase()); + } + } + + EndPoint(@Nonnull ByteString value, boolean isClosed) { + this.value = value; + this.isClosed = isClosed; + } + + @Override + public int compareTo(@Nonnull EndPoint o) { + return ComparisonChain.start() + // Empty string comes last + .compareFalseFirst(value.isEmpty(), o.value.isEmpty()) + .compare(value, o.value, ByteStringComparator.INSTANCE) + // Open end point comes before a closed end point: [x,y) ends before [x,y]. + .compareFalseFirst(isClosed, o.isClosed) + .result(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRow.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRow.java new file mode 100644 index 000000000000..6ddde591553d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRow.java @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.models.sql.StructReader; +import java.io.Serializable; + +/** Internal implementation detail that provides access to row data for SQL requests. */ +@InternalApi +public interface SqlRow extends StructReader, Serializable {} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java new file mode 100644 index 000000000000..90631f3bbd7c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java @@ -0,0 +1,70 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMerger; +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * Wrapper around {@link SqlRowMerger} that provides an easy way to transform a set of + * ExecuteQueryResponses into rows. Must create a new instance per ExecuteQueryRequest, and pass in + * the response stream of ExecuteQueryResponses in the order they were received. + */ +@InternalApi("For internal use only") +@BetaApi +public class SqlRowMergerUtil implements AutoCloseable { + + private final SqlRowMerger merger; + + public SqlRowMergerUtil(ResultSetMetadata metadata) { + merger = new SqlRowMerger(() -> ProtoResultSetMetadata.fromProto(metadata)); + } + + @Override + public void close() { + if (merger.hasPartialFrame()) { + throw new IllegalStateException("Tried to close SqlRowMerger with unconsumed partial data"); + } + } + + /** + * Transforms a list of {@link ExecuteQueryResponse} objects into a list of {@link + * com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow} objects . The first call must contain + * the ResultSetMetadata as the first ExecuteQueryResponse. This will return any complete {@link + * com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow}s from the given responses and buffer + * partial rows waiting for the next ExecuteQueryResponse. + * + * @param responses List of {@link ExecuteQueryResponse} for a query + * @return a list of the complete {@link com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow}s + * that have been merged from the given responses. + */ + public List parseExecuteQueryResponses(ImmutableList responses) { + ImmutableList.Builder rows = new ImmutableList.Builder<>(); + + for (ExecuteQueryResponse response : responses) { + merger.push(response); + while (merger.hasFullFrame()) { + rows.add(merger.pop()); + } + } + return rows.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TableAdminRequestContext.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TableAdminRequestContext.java new file mode 100644 index 000000000000..05554425b455 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TableAdminRequestContext.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import java.io.Serializable; + +/** + * Contains information necessary to construct Bigtable protobuf requests from user facing models. + * + *

The intention is to extract repetitive details like instance names into a configurable values + * in {@link com.google.cloud.bigtable.data.v2.BigtableDataSettings} and expose them (via this + * class) to each wrapper's toProto method. + * + *

This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +@AutoValue +public abstract class TableAdminRequestContext implements Serializable { + + /** Creates a new instance of the {@link TableAdminRequestContext}. */ + public static TableAdminRequestContext create(String projectId, String instanceId) { + return new AutoValue_TableAdminRequestContext(projectId, instanceId); + } + + /** The project id that the client is configured to target. */ + public abstract String getProjectId(); + + /** The instance id that the client is configured to target. */ + public abstract String getInstanceId(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtil.java new file mode 100644 index 000000000000..d659e03c2c36 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtil.java @@ -0,0 +1,28 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; +import com.google.protobuf.Timestamp; +import java.time.Instant; + +/** For internal use only. Utility for converting proto timestamps to appropriate Java types. */ +@InternalApi("For internal use only") +public class TimestampUtil { + public static Instant toInstant(Timestamp timestamp) { + return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java new file mode 100644 index 000000000000..3edacf7766e0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class AuthorizedViewAsync implements AutoCloseable, Closeable { + + private final TableBase base; + + static AuthorizedViewAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String tableId, + String viewId, + Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + AuthorizedViewName viewName = + AuthorizedViewName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setTableId(tableId) + .setAuthorizedViewId(viewId) + .build(); + + OpenAuthorizedViewRequest openRequest = + OpenAuthorizedViewRequest.newBuilder() + .setAuthorizedViewName(viewName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openRequest, + VRpcDescriptor.AUTHORIZED_VIEW_SESSION, + VRpcDescriptor.READ_ROW_AUTH_VIEW, + VRpcDescriptor.MUTATE_ROW_AUTH_VIEW, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + viewName.toString(), + metrics, + executorService); + + return new AuthorizedViewAsync(base); + } + + AuthorizedViewAsync(TableBase viewBase) { + this.base = viewBase; + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } + + public CompletableFuture mutateRow( + SessionMutateRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.mutateRow(req, f, deadline); + return f; + } + + @Override + public void close() { + this.base.close(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java new file mode 100644 index 000000000000..dd90a7068316 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class AuthorizedViewName { + + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + public abstract String getTableId(); + + public abstract String getAuthorizedViewId(); + + public InstanceName getInstanceName() { + return InstanceName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .build(); + } + + public TableName getTableName() { + return TableName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .setTableId(getTableId()) + .build(); + } + + @Override + public final String toString() { + return String.format("%s/authorizedViews/%s", getTableName(), getAuthorizedViewId()); + } + + public static AuthorizedViewName of( + String projectId, String instanceId, String tableId, String viewId) { + return builder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .setTableId(tableId) + .setAuthorizedViewId(viewId) + .build(); + } + + public static Builder builder() { + return new AutoValue_AuthorizedViewName.Builder(); + } + + public static AuthorizedViewName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 8, "Invalid authorized view name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), + "Invalid authorized view name: %s, must start with projects/", + name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid authorized view name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid authorized view name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), "Invalid authorized view name %s, must have an instance id", name); + Preconditions.checkArgument( + "tables".equals(parts.get(4)), + "Invalid authorized view name: %s, must start with" + + " projects/$PROJECT_ID/instances/$INSTANCE_ID/tables", + name); + Preconditions.checkArgument( + !parts.get(5).isEmpty(), "Invalid authorized view name %s, must have table id", name); + Preconditions.checkArgument( + "authorizedViews".equals(parts.get(6)), + "Invalid authorized view name: %s, must start with" + + " projects/$PROJECT_ID/instances/$INSTANCE_ID/tables/$TABLE_ID/authorizedViews", + name); + Preconditions.checkArgument( + !parts.get(7).isEmpty(), + "Invalid authorized view name %s, must have authorized view id", + name); + + return builder() + .setProjectId(parts.get(1)) + .setInstanceId(parts.get(3)) + .setTableId(parts.get(5)) + .setAuthorizedViewId(parts.get(7)) + .build(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract Builder setTableId(String tableId); + + public abstract Builder setAuthorizedViewId(String viewId); + + public abstract AuthorizedViewName build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java new file mode 100644 index 000000000000..945e08ab47fb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java @@ -0,0 +1,319 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.channels.DirectPathIpInterceptor; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; +import com.google.common.collect.ImmutableList; +import io.grpc.ChannelCredentials; +import io.grpc.CompositeChannelCredentials; +import io.grpc.Grpc; +import io.grpc.ManagedChannelBuilder; +import io.grpc.TlsChannelCredentials; +import io.grpc.alts.AltsChannelCredentials; +import io.grpc.alts.GoogleDefaultChannelCredentials; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.Random; +import java.util.function.Function; + +public abstract class ChannelProviders { + public static final String DEFAULT_HOST = "bigtable.googleapis.com"; + + public interface ChannelProvider { + + ManagedChannelBuilder newChannelBuilder(); + + Optional getFallback(); + + FeatureFlags updateFeatureFlags(FeatureFlags featureFlags); + + boolean isSingleEndpoint(); + } + + public static class CloudPath implements ChannelProvider { + private final String host; + private final int port; + private final ChannelCredentials credentials; + + public CloudPath(String endpoint) throws IOException { + this(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public CloudPath(String endpoint, Credentials credentials) { + this.credentials = + CompositeChannelCredentials.create( + TlsChannelCredentials.create(), MoreCallCredentials.from(credentials)); + String host = endpoint; + int port = 443; + + int sepI = endpoint.lastIndexOf(":"); + if (sepI > 0) { + host = endpoint.substring(0, sepI); + port = Integer.parseInt(endpoint.substring(sepI + 1)); + } + this.host = host; + this.port = port; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return Grpc.newChannelBuilderForAddress(host, port, credentials); + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .addValue(String.format("%s:%d", host, port)) + .toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags; + } + } + + public static class DirectAccess implements ChannelProvider { + private final String endpoint; + private final ChannelCredentials credentials; + private final Optional fallback; + + public DirectAccess(String endpoint) throws IOException { + this(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public DirectAccess(String endpoint, Credentials credentials) { + this(endpoint, credentials, Optional.empty()); + } + + private DirectAccess( + String endpoint, Credentials credentials, Optional fallback) { + this.endpoint = endpoint; + this.credentials = + GoogleDefaultChannelCredentials.newBuilder() + .callCredentials(MoreCallCredentials.from(credentials)) + .build(); + this.fallback = fallback; + } + + public static DirectAccess withFallback(String endpoint) throws IOException { + return DirectAccess.withFallback(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public static DirectAccess withFallback(String endpoint, Credentials credentials) { + Optional fallback = Optional.of(new CloudPath(endpoint, credentials)); + return new DirectAccess(endpoint, credentials, fallback); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return Grpc.newChannelBuilder("google-c2p:///" + endpoint, credentials) + .intercept(new DirectPathIpInterceptor(true)); + } + + public String getEndpoint() { + return endpoint; + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(true) + .setDirectAccessRequested(true) + .build(); + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public Optional getFallback() { + return fallback; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).addValue(endpoint).toString(); + } + } + + public static class RawDirectPath implements ChannelProvider { + private final List endpoints; + ChannelCredentials credentials; + + public RawDirectPath(List endpoints) throws IOException { + this(endpoints, GoogleCredentials.getApplicationDefault()); + } + + public RawDirectPath(List endpoints, Credentials credentials) { + this.endpoints = ImmutableList.copyOf(endpoints); + this.credentials = + CompositeChannelCredentials.create( + AltsChannelCredentials.create(), MoreCallCredentials.from(credentials)); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + int endpointI = new Random().nextInt(endpoints.size()); + String endpoint = endpoints.get(endpointI); + int portSplit = endpoint.lastIndexOf(":"); + String host = endpoint.substring(0, portSplit); + int port = Integer.parseInt(endpoint.substring(portSplit + 1)); + + return Grpc.newChannelBuilderForAddress(host, port, credentials); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder().setDirectAccessRequested(true).build(); + } + + @Override + public boolean isSingleEndpoint() { + return endpoints.size() <= 1; + } + + @Override + public String toString() { + ToStringHelper stringHelper = MoreObjects.toStringHelper(this); + endpoints.forEach(stringHelper::addValue); + return stringHelper.toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + } + + public static class EmulatorChannelProvider implements ChannelProvider { + + private final String host; + private final int port; + + public EmulatorChannelProvider(String host, int port) { + this.host = host; + this.port = port; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return ManagedChannelBuilder.forAddress(host, port).usePlaintext(); + } + + @Override + public boolean isSingleEndpoint() { + return true; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .addValue(String.format("%s:%d", host, port)) + .toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags; + } + } + + public static class ForwardingChannelProvider implements ChannelProvider { + private final ChannelProvider delegate; + + public ForwardingChannelProvider(ChannelProvider delegate) { + this.delegate = delegate; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return delegate.newChannelBuilder(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return delegate.updateFeatureFlags(featureFlags); + } + + @Override + public boolean isSingleEndpoint() { + return delegate.isSingleEndpoint(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).addValue(delegate).toString(); + } + + @Override + public Optional getFallback() { + return delegate.getFallback(); + } + } + + /** + * ConfiguredChannelProvider is responsible for applying a custom options to the channel builder. + * It is meant to be used only during client construction phase and not during client + * configuration phase. + */ + public static class ConfiguredChannelProvider extends ForwardingChannelProvider { + private final Function, ManagedChannelBuilder> configurator; + + public ConfiguredChannelProvider( + ChannelProvider delegate, + Function, ManagedChannelBuilder> configurator) { + super(delegate); + this.configurator = configurator; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return configurator.apply(super.newChannelBuilder()); + } + + @Override + public Optional getFallback() { + return super.getFallback() + .flatMap(cb -> Optional.of(new ConfiguredChannelProvider(cb, configurator))); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java new file mode 100644 index 000000000000..82ddff08c3cb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java @@ -0,0 +1,284 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ConfiguredChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SwitchingChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.opencensus.stats.Stats; +import io.opencensus.tags.Tags; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import java.io.IOException; +import java.util.Collections; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +public class Client implements AutoCloseable { + public static final FeatureFlags BASE_FEATURE_FLAGS = + FeatureFlags.newBuilder() + .setReverseScans(false) + .setMutateRowsRateLimit(false) + .setMutateRowsRateLimit2(false) + .setLastScannedRowResponses(false) + .setRoutingCookie(true) + .setRetryInfo(true) + .setClientSideMetricsEnabled(true) + // These are set by the channel provider + // .setTrafficDirectorEnabled(true) + // .setDirectAccessRequested(true) + .setPeerInfo(true) + .setSessionsCompatible(true) + .build(); + // gRPC keep-alive interval 60 seconds. + public static final int KEEPALIVE_TIME_MS = 60000; + // gRPC keep-alive timeout 10 seconds. + public static final int KEEPALIVE_TIMEOUT_MS = 10000; + + private final FeatureFlags featureFlags; + private final ClientInfo clientInfo; + private final Resource backgroundExecutor; + + private final CallOptions defaultCallOptions; + private final ChannelPool channelPool; + private final Resource metrics; + private final Resource configManager; + + private final Set> sessionPools = Collections.newSetFromMap(new WeakHashMap<>()); + + public static Client create(ClientSettings settings) throws IOException { + FeatureFlags featureFlags = + settings.getChannelProvider().updateFeatureFlags(BASE_FEATURE_FLAGS); + + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(settings.getInstanceName()) + .setAppProfileId(settings.getAppProfileId()) + .build(); + + ScheduledExecutorService backgroundExecutor = Executors.newScheduledThreadPool(4); + + // TODO: compat layer: get this from settings + String universeDomain = "googleapis.com"; + + Metrics metrics; + if (settings.getChannelProvider() instanceof ChannelProviders.EmulatorChannelProvider) { + metrics = new NoopMetrics(); + } else { + GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); + MetricRegistry registry = new MetricRegistry(); + OpenTelemetrySdk otel = + MetricsImpl.createBuiltinOtel( + registry, clientInfo, credentials, null, universeDomain, backgroundExecutor); + metrics = + new MetricsImpl( + registry, + clientInfo, + BaseApiTracerFactory.getInstance(), + otel, + null, + Tags.getTagger(), + Stats.getStatsRecorder(), + backgroundExecutor); + metrics.start(); + } + + ClientConfigurationManager configManager = null; + + try { + configManager = + new ClientConfigurationManager( + featureFlags, + clientInfo, + settings.getChannelProvider(), + metrics.getDebugTagTracer(), + backgroundExecutor); + configManager.start().get(); + metrics.getDebugTagTracer().setClientConfigurationManager(configManager); + } catch (Exception e) { + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + if (configManager != null) { + configManager.close(); + } + metrics.close(); + backgroundExecutor.shutdown(); + throw new RuntimeException("Failed to fetch initial config", e); + } + + if (configManager.areSessionsRequired()) { + featureFlags = featureFlags.toBuilder().setSessionsCompatible(true).build(); + } + + return new Client( + featureFlags, + clientInfo, + settings.getChannelProvider(), + Resource.createOwned(metrics, metrics::close), + Resource.createOwned(configManager, configManager::close), + Resource.createOwned(backgroundExecutor, backgroundExecutor::shutdown)); + } + + public Client( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + Resource metrics, + Resource configManager, + Resource bgExecutor) + throws IOException { + this.featureFlags = featureFlags; + this.clientInfo = clientInfo; + this.metrics = metrics; + this.configManager = configManager; + this.backgroundExecutor = bgExecutor; + + defaultCallOptions = CallOptions.DEFAULT; + + ChannelProvider configuredChannelProvider = + new ConfiguredChannelProvider( + channelProvider, + channelBuilder -> + metrics + .get() + .configureGrpcChannel(channelBuilder) + .keepAliveTime(KEEPALIVE_TIME_MS, TimeUnit.MILLISECONDS) + .keepAliveTimeout(KEEPALIVE_TIMEOUT_MS, TimeUnit.MILLISECONDS) + // TODO: consider localizing this for large reads + .maxInboundMessageSize(256 * 1024 * 1024)); + + channelPool = + new SwitchingChannelPool( + configuredChannelProvider, + configManager.get(), + metrics.get(), + backgroundExecutor.get()); + channelPool.start(); + } + + @Override + public void close() { + sessionPools.forEach( + pool -> + pool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("Client closing") + .build())); + metrics.close(); + channelPool.close(); + configManager.close(); + backgroundExecutor.close(); + } + + public TableAsync openTableAsync(String tableId, Permission permission) { + TableAsync tableAsync = + TableAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + tableId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(tableAsync.getSessionPool()); + return tableAsync; + } + + public AuthorizedViewAsync openAuthorizedViewAsync( + String tableId, String viewId, OpenAuthorizedViewRequest.Permission permission) { + AuthorizedViewAsync viewAsync = + AuthorizedViewAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + tableId, + viewId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(viewAsync.getSessionPool()); + return viewAsync; + } + + public MaterializedViewAsync openMaterializedViewAsync( + String viewId, OpenMaterializedViewRequest.Permission permission) { + MaterializedViewAsync viewAsync = + MaterializedViewAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + viewId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(viewAsync.getSessionPool()); + return viewAsync; + } + + public static class Resource { + private T value; + private Runnable closer; + + public static Resource createOwned(T value, Runnable closer) { + return new Resource<>(value, closer); + } + + public static Resource createShared(T value) { + return new Resource<>(value, () -> {}); + } + + private Resource(T value, Runnable closer) { + this.value = value; + this.closer = closer; + } + + public void close() { + this.closer.run(); + } + + public T get() { + return value; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java new file mode 100644 index 000000000000..6b4448945eef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.DirectAccess; +import java.io.IOException; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ClientSettings { + public abstract ChannelProvider getChannelProvider(); + + public abstract InstanceName getInstanceName(); + + public abstract String getAppProfileId(); + + public static Builder builder() { + return new AutoValue_ClientSettings.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setChannelProvider(ChannelProvider channelProvider); + + @Nullable + abstract ChannelProvider getChannelProvider(); + + public abstract Builder setInstanceName(InstanceName name); + + public abstract Builder setAppProfileId(String appProfileId); + + abstract ClientSettings autoBuild(); // not public + + public ClientSettings build() { + if (getChannelProvider() != null) { + return autoBuild(); + } + + Credentials creds; + try { + creds = GoogleCredentials.getApplicationDefault(); + } catch (IOException e) { + throw new RuntimeException("Failed to create default credentials"); + } + + if (getChannelProvider() == null) { + setChannelProvider(DirectAccess.withFallback(ChannelProviders.DEFAULT_HOST, creds)); + } + return autoBuild(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java new file mode 100644 index 000000000000..e30710362a30 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class InstanceName { + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + @Override + public final String toString() { + return String.format("projects/%s/instances/%s", getProjectId(), getInstanceId()); + } + + public static InstanceName of(String projectId, String instanceId) { + return InstanceName.builder().setProjectId(projectId).setInstanceId(instanceId).build(); + } + + public static Builder builder() { + return new AutoValue_InstanceName.Builder(); + } + + public static InstanceName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 4, "Invalid instance name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), + "Invalid instance name: %s, must start with projects/", + name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid instance name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid instance name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), "Invalid instance name %s, must have an instance id", name); + + return builder().setProjectId(parts.get(1)).setInstanceId(parts.get(3)).build(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract InstanceName build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java new file mode 100644 index 000000000000..70023645efc2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class MaterializedViewAsync implements AutoCloseable, Closeable { + + private final TableBase base; + + public static MaterializedViewAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String viewId, + OpenMaterializedViewRequest.Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + MaterializedViewName viewName = + MaterializedViewName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setMaterializedViewId(viewId) + .build(); + + OpenMaterializedViewRequest openReq = + OpenMaterializedViewRequest.newBuilder() + .setMaterializedViewName(viewName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openReq, + VRpcDescriptor.MATERIALIZED_VIEW_SESSION, + VRpcDescriptor.READ_ROW_MAT_VIEW, + null, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + viewId, + metrics, + executorService); + + return new MaterializedViewAsync(base); + } + + MaterializedViewAsync(TableBase base) { + this.base = base; + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + @Override + public void close() { + base.close(); + } + + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java new file mode 100644 index 000000000000..30f4b85d2f5f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class MaterializedViewName { + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + public abstract String getMaterializedViewId(); + + public InstanceName getInstanceName() { + return InstanceName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .build(); + } + + public static MaterializedViewName of(String projectId, String instanceId, String viewId) { + return builder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .setMaterializedViewId(viewId) + .build(); + } + + public static Builder builder() { + return new AutoValue_MaterializedViewName.Builder(); + } + + public static MaterializedViewName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 6, "Invalid materialized view name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), + "Invalid materialized view name: %s, must start with projects/", + name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid materialized view name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid materialized view name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), + "Invalid materialized view name %s, must have an instance id", + name); + Preconditions.checkArgument( + "materializedViews".equals(parts.get(4)), + "Invalid materialized view name: %s, must start with" + + " projects/$PROJECT_ID/instances/$INSTANCE_ID/materializedViews", + name); + Preconditions.checkArgument( + !parts.get(5).isEmpty(), "Invalid materialized view name %s, must have table id", name); + return MaterializedViewName.builder() + .setProjectId(parts.get(1)) + .setInstanceId(parts.get(3)) + .setMaterializedViewId(parts.get(5)) + .build(); + } + + @Override + public final String toString() { + return String.format("%s/materializedViews/%s", getInstanceName(), getMaterializedViewId()); + } + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract Builder setMaterializedViewId(String viewId); + + public abstract MaterializedViewName build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java new file mode 100644 index 000000000000..0bc699d4f146 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class TableAsync implements AutoCloseable, Closeable { + private final TableBase base; + + public static TableAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String tableId, + Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + TableName tableName = + TableName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setTableId(tableId) + .build(); + + OpenTableRequest openReq = + OpenTableRequest.newBuilder() + .setTableName(tableName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openReq, + VRpcDescriptor.TABLE_SESSION, + VRpcDescriptor.READ_ROW, + VRpcDescriptor.MUTATE_ROW, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + tableId, + metrics, + executorService); + + return new TableAsync(base); + } + + TableAsync(TableBase base) { + this.base = base; + } + + @Override + public void close() { + base.close(); + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + // TODO: get deadline from compatibility layer + // Currently these are the deadlines from gax: + // ApiCallContext#timeout (attempt timeout) + // ApiCallContext#RetrySettings#totalTimeout + // ApiCallContext#RetrySettings#attemptTimeout + // GrpcApiCallContext#Calloptions#Deadline + // attemptTimeout will be ignored + // {totalTimeout and CallOptions deadline} -> deadline on this call + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } + + // TODO: get deadline from compatibility layer + public CompletableFuture mutateRow( + SessionMutateRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.mutateRow(req, f, deadline); + return f; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java new file mode 100644 index 000000000000..8feef399d625 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.CancellableVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.RetryingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolImpl; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.annotations.VisibleForTesting; +import com.google.protobuf.Message; +import io.grpc.CallOptions; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import java.util.concurrent.ScheduledExecutorService; + +class TableBase implements AutoCloseable { + private final SessionPool sessionPool; + private final ScheduledExecutorService backgroundExecutor; + private final Metrics metrics; + private final VRpcDescriptor readRowDescriptor; + private final VRpcDescriptor + mutateRowDescriptor; + + static TableBase createAndStart( + ReqT openReq, + VRpcDescriptor.SessionDescriptor sessionDescriptor, + VRpcDescriptor readRowDescriptor, + VRpcDescriptor mutateRowDescriptor, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String sessionPoolName, + Metrics metrics, + ScheduledExecutorService executor) { + + SessionPool sessionPool = + new SessionPoolImpl<>( + metrics, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + sessionDescriptor, + sessionPoolName, + executor); + + sessionPool.start(openReq, new Metadata()); + + return new TableBase(sessionPool, readRowDescriptor, mutateRowDescriptor, metrics, executor); + } + + @VisibleForTesting + TableBase( + SessionPool sessionPool, + VRpcDescriptor readRowDescriptor, + VRpcDescriptor mutateRowDescriptor, + Metrics metrics, + ScheduledExecutorService executor) { + this.sessionPool = sessionPool; + this.readRowDescriptor = readRowDescriptor; + this.mutateRowDescriptor = mutateRowDescriptor; + this.metrics = metrics; + this.backgroundExecutor = executor; + } + + @Override + public void close() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("user closed session") + .build()); + } + + public SessionPool getSessionPool() { + return sessionPool; + } + + public void readRow( + SessionReadRowRequest req, VRpcListener listener, Deadline deadline) { + RetryingVRpc retry = + new RetryingVRpc<>(() -> sessionPool.newCall(readRowDescriptor), backgroundExecutor); + + VRpcTracer tracer = metrics.newTableTracer(sessionPool.getInfo(), readRowDescriptor, deadline); + VRpcCallContext ctx = VRpcCallContext.create(deadline, true, tracer); + + CancellableVRpc cancellableVRpc = + new CancellableVRpc<>(retry, Context.current()); + + cancellableVRpc.start(req, ctx, listener); + } + + public void mutateRow( + SessionMutateRowRequest req, + VRpcListener listener, + Deadline deadline) { + RetryingVRpc retry = + new RetryingVRpc<>(() -> sessionPool.newCall(mutateRowDescriptor), backgroundExecutor); + + boolean idempotent = Util.isIdempotent(req.getMutationsList()); + + VRpcTracer tracer = + metrics.newTableTracer(sessionPool.getInfo(), mutateRowDescriptor, deadline); + VRpcCallContext ctx = VRpcCallContext.create(deadline, idempotent, tracer); + + CancellableVRpc cancellable = + new CancellableVRpc<>(retry, Context.current()); + + cancellable.start(req, ctx, listener); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java new file mode 100644 index 000000000000..7a094f8550f4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class TableName { + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + public abstract String getTableId(); + + public InstanceName getInstanceName() { + return InstanceName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .build(); + } + + @Override + public final String toString() { + return String.format("%s/tables/%s", getInstanceName(), getTableId()); + } + + public static TableName of(String projectId, String instanceId, String tableId) { + return builder().setProjectId(projectId).setInstanceId(instanceId).setTableId(tableId).build(); + } + + public static Builder builder() { + return new AutoValue_TableName.Builder(); + } + + public static TableName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 6, "Invalid table name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), "Invalid table name: %s, must start with projects/", name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid table name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid table name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), "Invalid table name %s, must have an instance id", name); + Preconditions.checkArgument( + "tables".equals(parts.get(4)), + "Invalid table name: %s, must start with" + + " projects/$PROJECT_ID/instances/$INSTANCE_ID/tables", + name); + Preconditions.checkArgument( + !parts.get(5).isEmpty(), "Invalid table name %s, must have table id", name); + + return builder() + .setProjectId(parts.get(1)) + .setInstanceId(parts.get(3)) + .setTableId(parts.get(5)) + .build(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract Builder setTableId(String tableId); + + public abstract TableName build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java new file mode 100644 index 000000000000..18ccfd6e09ef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.common.base.Preconditions; +import java.util.concurrent.CompletableFuture; +import java.util.logging.Logger; + +public class UnaryResponseFuture extends CompletableFuture implements VRpcListener { + private static final Logger DEFAULT_LOGGER = + Logger.getLogger(UnaryResponseFuture.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private T msg = null; + private boolean hasMsg = false; + + @Override + public void onMessage(T msg) { + Preconditions.checkState(!hasMsg, "Unary rpc received duplicated message"); + hasMsg = true; + this.msg = msg; + } + + @Override + public void onClose(VRpcResult result) { + if (result.getStatus().isOk()) { + if (!hasMsg) { + completeExceptionally( + new IllegalStateException("Unary rpc completed OK but missing result")); + } else { + complete(msg); + } + } else { + if (!completeExceptionally(VRpcException.create(result))) { + logger.warning("Unary rpc got error after it was resolved: " + result); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java new file mode 100644 index 000000000000..fba8bd0b8710 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.Mutation; +import io.grpc.Metadata; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class Util { + private static final Metadata.Key REQUEST_PARAMS_KEY = + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key FEATURE_FLAGS_KEY = + Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER); + + public static Metadata composeMetadata( + FeatureFlags featureFlags, Map headerParams) { + Metadata metadata = new Metadata(); + + // Configure FeatureFlags for RLS + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + featureFlags.writeTo(baos); + } catch (IOException e) { + throw new IllegalStateException("ByteArrayOutputStream should never throw an IOException"); + } + String encodedFeatureFlags = + new String(Base64.getUrlEncoder().encode(baos.toByteArray()), StandardCharsets.UTF_8); + metadata.put(FEATURE_FLAGS_KEY, encodedFeatureFlags); + } + + // Configure resource names for RLS + metadata.put( + REQUEST_PARAMS_KEY, + headerParams.entrySet().stream() + .map(e -> String.format("%s=%s", e.getKey(), urlEncode(e.getValue()))) + .collect(Collectors.joining("&"))); + + return metadata; + } + + public static boolean isIdempotent(List mutations) { + for (Mutation mutation : mutations) { + // aggregates are not idempotent + if (mutation.hasAddToCell() || mutation.hasMergeToCell()) { + return false; + } + // mutations with system timestamps are not idempotent + if (mutation.hasSetCell() && mutation.getSetCell().getTimestampMicros() == -1) { + return false; + } + } + return true; + } + + private static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new IllegalStateException("Should never happen", e); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java new file mode 100644 index 000000000000..be212be1ccb2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; + +// TODO: capture caller stack - this will be mostly created by a gRPC response threads, which loses +// the caller stacktrace, which isnt helpful +public class VRpcException extends StatusRuntimeException { + private final VRpcResult result; + + public static VRpcException create(VRpcResult result) { + if (result.getStatus().isOk()) { + return new VRpcException( + Status.INTERNAL.withDescription("Unexpected OK status used for an exception"), result); + } + return new VRpcException(result); + } + + private VRpcException(Status overridenStatus, VRpcResult result) { + super(overridenStatus); + this.result = result; + } + + private VRpcException(VRpcResult result) { + super(result.getStatus()); + this.result = result; + } + + public VRpcResult getResult() { + return result; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java new file mode 100644 index 000000000000..0c041be523f4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.CallOptions; +import io.grpc.MethodDescriptor; + +public interface ChannelPool extends AutoCloseable { + + void start(); + + @Override + void close(); + + SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions); + + void updateConfig(ChannelPoolConfiguration config); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java new file mode 100644 index 000000000000..9ef2a486f195 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java @@ -0,0 +1,523 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multiset; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import io.grpc.Status.Code; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** + * Proof of concept channel pool that avoids parallel channels to the same afe. The pool is + * dynamically sized based on outstanding streams and tries to limit each channel to at most 10 + * streams. + */ +public class ChannelPoolDpImpl implements ChannelPool { + private static final Logger LOGGER = Logger.getLogger(ChannelPoolDpImpl.class.getName()); + private static final String DEFAULT_LOG_NAME = "pool"; + private static final AtomicInteger INDEX = new AtomicInteger(); + + private final String poolLogId; + + @VisibleForTesting volatile int minGroups; + @VisibleForTesting volatile int maxGroups; + @VisibleForTesting volatile int softMaxPerGroup; + + private final Clock clock; + private final Supplier channelSupplier; + private final ScheduledExecutorService executor; + + private final DebugTagTracer debugTagTracer; + + @GuardedBy("this") + private final List channelGroups; + + @GuardedBy("this") + private final AfeChannelGroup startingGroup; + + @GuardedBy("this") + private int totalStreams = 0; + + // TODO: replace SocketAddress with AfeId + @GuardedBy("this") + private final Multiset sessionsPerAfeId = HashMultiset.create(); + + private ScheduledFuture serviceFuture = null; + + @GuardedBy("this") + private boolean closed = false; + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor) { + this(channelSupplier, config, DEFAULT_LOG_NAME, debugTagTracer, executor, Clock.systemUTC()); + } + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + String logName, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor) { + this(channelSupplier, config, logName, debugTagTracer, executor, Clock.systemUTC()); + } + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + String logName, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor, + Clock clock) { + this.poolLogId = String.format("%d-%s", INDEX.getAndIncrement(), logName); + this.clock = clock; + this.channelSupplier = channelSupplier; + this.executor = executor; + updateConfig(config); + channelGroups = new ArrayList<>(); + startingGroup = new AfeChannelGroup(null); + this.debugTagTracer = debugTagTracer; + } + + @Override + public void updateConfig(ChannelPoolConfiguration config) { + this.minGroups = config.getMinServerCount(); + this.maxGroups = config.getMaxServerCount(); + this.softMaxPerGroup = config.getPerServerSessionCount(); + } + + @Override + public synchronized void start() { + serviceChannels(); + serviceFuture = executor.scheduleAtFixedRate(this::serviceChannels, 1, 1, TimeUnit.MINUTES); + } + + @Override + public synchronized void close() { + closed = true; + + if (serviceFuture != null) { + serviceFuture.cancel(false); + } + + channelGroups.stream() + .flatMap(g -> g.channels.stream()) + .forEach(channelWrapper -> channelWrapper.channel.shutdown()); + } + + @Override + public synchronized SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + if (closed) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "channel_pool_new_stream_failed"); + return new FailingSessionStream(Status.UNAVAILABLE.withDescription("ChannelPool is closed")); + } + // Find the AFE with the fewest sessions + Optional maybeGroup = + channelGroups.stream() + .filter(g -> g.numStreams < softMaxPerGroup) + .min(Comparator.comparingInt(a -> a.numStreams)); + + // Find the first channel that has capacity + Optional maybeChannel = + maybeGroup.flatMap(g -> g.channels.stream().findFirst()); + + // try to find a channel that has capacity in the least loaded afe + final ChannelWrapper channelWrapper = + maybeChannel.orElseGet( + () -> { + log( + Level.FINE, + "Couldn't find an existing channel with capacity, num outstanding streams across" + + " all channel groups: %d, num groups: %d", + channelGroups.stream().mapToInt(g -> g.numStreams).sum(), + channelGroups.size()); + + // If there is no such channel, then try to add a channel that being resolved + // and if no channel is in the process of being added or its already nearing 50% + // utilization + // during initialization, then add a new channel + return startingGroup.channels.stream() + .filter(w -> w.numOutstanding < softMaxPerGroup / 2) + .min(Comparator.comparingInt(w -> w.numOutstanding)) + .map( + (w) -> { + log(Level.FINE, "Using a channel thats already connecting"); + return w; + }) + .orElseGet( + () -> { + log(Level.FINE, "Creating a new channel"); + return addChannel(); + }); + }); + + channelWrapper.numOutstanding++; + channelWrapper.group.numStreams++; + totalStreams++; + + ClientCall innerCall = + channelWrapper.channel.newCall(desc, callOptions); + + return new SessionStreamImpl(innerCall) { + // mark as null so that onClose can tell if onBeforeSessionStart was never called + @Nullable AfeId afeId = null; + + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingListener(responseListener) { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + afeId = AfeId.extract(peerInfo); + synchronized (ChannelPoolDpImpl.this) { + rehomeChannel(channelWrapper, afeId); + sessionsPerAfeId.add(afeId); + } + super.onBeforeSessionStart(peerInfo); + } + + @Override + public void onClose(Status status, Metadata trailers) { + synchronized (ChannelPoolDpImpl.this) { + if (afeId != null) { + sessionsPerAfeId.remove(afeId); + } + releaseChannel(channelWrapper, status); + } + super.onClose(status, trailers); + } + }, + headers); + } + }; + } + + @GuardedBy("this") + private ChannelWrapper addChannel() { + debugTagTracer.checkPrecondition( + !closed, "channel_pool_add_channel_failure", "Channel pool is closed"); + log(Level.FINE, "Adding a new channel"); + ChannelWrapper wrapped = new ChannelWrapper(startingGroup, channelSupplier.get(), clock); + startingGroup.channels.addFirst(wrapped); + return wrapped; + } + + @GuardedBy("this") + private void removeGroup(AfeChannelGroup group) { + log(Level.FINE, "Removing group: %s", group.afeId); + group.channels.forEach(c -> c.channel.shutdown()); + channelGroups.remove(group); + // TODO: need to handle a group being added right after it was removed with lingering sessions + } + + @GuardedBy("this") + private void rehomeChannel(ChannelWrapper channelWrapper, AfeId afeId) { + // No need to rehome recycled channels. + if (channelWrapper.channel.isShutdown()) { + return; + } + + AfeChannelGroup origGroup = channelWrapper.group; + + if (Objects.equals(origGroup.afeId, afeId)) { + return; + } + + log(Level.FINE, "Rehoming channel from: %s to %s", origGroup.afeId, afeId); + + // Re-home the channel + AfeChannelGroup newGroup = + channelGroups.stream() + .filter(g -> Objects.equals(g.afeId, afeId)) + .findAny() + .orElseGet( + () -> { + AfeChannelGroup g = new AfeChannelGroup(afeId); + channelGroups.add(g); + return g; + }); + channelWrapper.group = newGroup; + origGroup.channels.remove(channelWrapper); + if (origGroup.channels.isEmpty()) { + channelGroups.remove(origGroup); + } + origGroup.numStreams -= channelWrapper.numOutstanding; + newGroup.channels.add(channelWrapper); + newGroup.numStreams += channelWrapper.numOutstanding; + + return; + } + + // Update accounting when a stream is closed and releases its channel + @GuardedBy("this") + private void releaseChannel(ChannelWrapper channelWrapper, Status status) { + totalStreams--; + channelWrapper.group.numStreams--; + channelWrapper.numOutstanding--; + + if (shouldRecycleChannel(status)) { + recycleChannel(channelWrapper); + } + } + + private static boolean shouldRecycleChannel(Status status) { + if (status.getCode() == Code.UNIMPLEMENTED) { + return true; + } + + // TODO: replace this with a flag in the ErrorDetails + if (status.getDescription() != null + && status.getDescription().toLowerCase(Locale.ENGLISH).contains("server is draining")) { + return true; + } + + return false; + } + + @GuardedBy("this") + private void recycleChannel(ChannelWrapper channelWrapper) { + if (channelWrapper.channel.isShutdown()) { + // Channel is already recycled. + return; + } + + channelWrapper.group.channels.remove(channelWrapper); + channelWrapper.channel.shutdown(); + // Checking for starting group because we don't want to delete the stating group. + if (channelWrapper.group.channels.isEmpty() && channelWrapper.group != startingGroup) { + removeGroup(channelWrapper.group); + } + addChannel(); + } + + @VisibleForTesting + void serviceChannels() { + try { + serviceChannelsSafe(); + } catch (Exception e) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "service_channel_failure"); + log(Level.WARNING, "Failed to service channels", e); + } + } + + /* + - add new group if existing groups are overflowing + - shutdown older channels within a group + */ + private synchronized void serviceChannelsSafe() { + log(Level.FINE, "Servicing channels"); + dumpState(); + + Instant now = Instant.now(clock); + Instant createdAtThreshold = now.minus(Duration.ofMinutes(50)); + + // Thin out the channels in each group, so that each AFEGroup only has 1 channel + for (AfeChannelGroup group : channelGroups) { + if (LOGGER.isLoggable(Level.FINEST) && group.channels.size() > 1) { + log( + Level.FINEST, + "Shutting down %d parallel channels for %s", + group.channels.size() - 1, + group.afeId); + } + while (group.channels.size() > 1) { + // Clean up parallel channels. + // Recent channels added to the end, thus removing the oldest from the beginning. + group.channels.removeFirst().channel.shutdown(); + } + } + + // try to adjust the groups + int desiredGroups = (int) Math.ceil(((float) totalStreams / softMaxPerGroup) * 2); + if (desiredGroups > maxGroups) { + desiredGroups = maxGroups; + } else if (desiredGroups < minGroups) { + desiredGroups = minGroups; + } + + // Right size the groups + if (desiredGroups < channelGroups.size()) { + // Remove extra groups, oldest first + Iterator it = + channelGroups.stream() + .sorted(Comparator.comparing(g -> g.channels.peek().createdAt)) + .limit(channelGroups.size() - desiredGroups) + .iterator(); + + while (it.hasNext()) { + AfeChannelGroup group = it.next(); + log( + Level.FINE, + "Removing %d channel for %s due to lack of concurrency", + group.channels.size(), + group.afeId); + removeGroup(group); + } + } else if (desiredGroups > channelGroups.size() + startingGroup.channels.size()) { + log(Level.FINE, "Adding %d channels", desiredGroups - channelGroups.size()); + for (int i = channelGroups.size(); i < desiredGroups; i++) { + addChannel(); + } + } + + log(Level.FINE, "Done servicing channels"); + dumpState(); + } + + private void log(Level level, String msg, Throwable throwable) { + LOGGER.log(level, String.format("[%s] %s", poolLogId, msg), throwable); + } + + private void log(Level level, String format, Object... args) { + LOGGER.log(level, String.format("[%s] %s", poolLogId, String.format(format, args))); + } + + @GuardedBy("this") + void dumpState() { + if (!LOGGER.isLoggable(Level.FINE)) { + return; + } + + int channels = + channelGroups.stream().mapToInt((AfeChannelGroup chg) -> chg.channels.size()).sum(); + String s = + sessionsPerAfeId.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getElement().toString())) + .map(e -> String.format("%d", e.getCount())) + .collect(Collectors.joining(", ")); + + log( + Level.FINE, + "ChannelPool channelGroups: " + + channelGroups.size() + + ", channels: " + + channels + + ", starting channels: " + + startingGroup.channels.size() + + ", totalStreams: " + + totalStreams + + ", AFEs: " + + sessionsPerAfeId.entrySet().size() + + ", distribution: [" + + s + + "]"); + + if (LOGGER.isLoggable(Level.FINEST)) { + String afeToSessions = + sessionsPerAfeId.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getElement().toString())) + .map(e -> String.format("%s: %d", e.getElement(), e.getCount())) + .collect(Collectors.joining("\n")); + log(Level.FINEST, "ChannelPool session distribution:\n%s", afeToSessions); + } + } + + static class AfeChannelGroup { + private final AfeId afeId; + private final Deque channels; + private int numStreams; + + public AfeChannelGroup(AfeId afeId) { + this.afeId = afeId; + channels = new ArrayDeque<>(); + numStreams = 0; + } + } + + static class ChannelWrapper { + private AfeChannelGroup group; + private final ManagedChannel channel; + private final Instant createdAt; + private int numOutstanding = 0; + + public ChannelWrapper(AfeChannelGroup group, ManagedChannel channel, Clock clock) { + this.group = group; + this.channel = channel; + createdAt = Instant.now(clock); + } + } + + private static class AfeId { + private final long id; + + static AfeId extract(PeerInfo peerInfo) { + return new AfeId(peerInfo.getApplicationFrontendId()); + } + + private AfeId(long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AfeId)) { + return false; + } + return id == ((AfeId) o).id; + } + + @Override + public int hashCode() { + return com.google.common.base.Objects.hashCode(id); + } + + @Override + public String toString() { + return Long.toString(id); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java new file mode 100644 index 000000000000..e22588858eea --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; + +public class DirectPathIpInterceptor implements ClientInterceptor { + private static final Logger LOGGER = Logger.getLogger(DirectPathIpInterceptor.class.getName()); + + private static final String DP_IPV6_PREFIX = "2001:4860:8040"; + private static final String DP_IPV4_PREFIX = "34.126"; + + private static final AtomicInteger nextObjectId = new AtomicInteger(); + private final int myId = nextObjectId.getAndIncrement(); + + private AtomicReference lastIp = new AtomicReference<>(); + private final boolean expectDirectPath; + + public DirectPathIpInterceptor(boolean expectDirectPath) { + this.expectDirectPath = expectDirectPath; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + ClientCall clientCall = channel.newCall(methodDescriptor, callOptions); + return new SimpleForwardingClientCall(clientCall) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + SocketAddress socketAddress = + clientCall.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + + if (socketAddress != null + && !socketAddress.equals(lastIp.getAndSet(socketAddress))) { + boolean directPathActive = isDirectPath(socketAddress); + if (directPathActive != expectDirectPath) { + LOGGER.warning( + String.format( + "Channel %d, Unexpected DirectPath status: %s, expected: %s. ip: %s", + myId, directPathActive, expectDirectPath, socketAddress)); + } + } + super.onHeaders(headers); + } + }, + headers); + } + }; + } + + private static boolean isDirectPath(SocketAddress remoteAddress) { + InetAddress inetAddress = ((InetSocketAddress) remoteAddress).getAddress(); + String addr = inetAddress.getHostAddress(); + + return addr.startsWith(DP_IPV6_PREFIX) || addr.startsWith(DP_IPV4_PREFIX); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java new file mode 100644 index 000000000000..7aad36e8f824 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import io.grpc.alts.AltsContextUtil; + +public class DirectpathEnforcer implements ClientInterceptor { + private final String reason; + + public DirectpathEnforcer(String reason) { + this.reason = reason; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onHeaders(Metadata headers) { + if (!AltsContextUtil.check(getAttributes())) { + // Non-ALTS. Despite configuring a channel for directpath + // on a lower level a fallback may happen. We detect it here + // and bubble up the exception for the channel pool to react. + throw Status.UNAVAILABLE.augmentDescription(reason).asRuntimeException(); + } + super.onHeaders(headers); + } + }, + headers); + } + }; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java new file mode 100644 index 000000000000..df2ae9ad35c1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import io.grpc.Metadata; +import io.grpc.Status; +import javax.annotation.Nullable; + +class FailingSessionStream implements SessionStream { + private final Status status; + + FailingSessionStream(Status status) { + this.status = status; + } + + @Override + public PeerInfo getPeerInfo() { + return DISCONNECTED_PEER_INFO; + } + + @Override + public void start(Listener responseListener, Metadata headers) { + responseListener.onClose(status, new Metadata()); + } + + @Override + public void sendMessage(SessionRequest request) { + // noop + } + + @Override + public void halfClose() { + // noop + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + // noop + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java new file mode 100644 index 000000000000..2ae8772b9744 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java @@ -0,0 +1,212 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener.ChannelFallbackReason; +import com.google.common.base.Preconditions; +import io.grpc.CallOptions; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.time.Duration; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +public class FallbackChannelPool implements ChannelPool { + private FallbackConfiguration config; + private final ChannelPool primary; + private final ChannelPool secondary; + private final PoolFallbackListener poolFallbackListener; + private final ScheduledExecutorService exec; + + @GuardedBy("this") + private ScheduledFuture checkTask; + + private final AtomicReference currentPool; + + private final AtomicInteger successCount = new AtomicInteger(); + private final AtomicInteger failureCount = new AtomicInteger(); + + public FallbackChannelPool( + FallbackConfiguration config, + PoolFallbackListener poolFallbackListener, + ScheduledExecutorService exec) { + Preconditions.checkNotNull(config); + Preconditions.checkNotNull(poolFallbackListener); + Preconditions.checkNotNull(exec); + this.config = config; + this.primary = config.getPrimaryChannelPool(); + this.secondary = config.getFallbackChannelPool(); + currentPool = new AtomicReference(primary); + this.poolFallbackListener = poolFallbackListener; + this.exec = exec; + } + + @Override + public void start() { + scheduleCheckRates(); + primary.start(); + secondary.start(); + } + + @Override + public void updateConfig(ChannelPoolConfiguration newConfig) { + if (!newConfig.hasDirectAccessWithFallback()) { + return; + } + + DirectAccessWithFallback directAccessWithFallback = newConfig.getDirectAccessWithFallback(); + updateConfig( + config.toBuilder() + .setEnabled(true) + .setErrorRate(directAccessWithFallback.getErrorRateThreshold()) + .setCheckInterval( + Duration.ofSeconds(directAccessWithFallback.getCheckInterval().getSeconds())) + .build()); + + // Propagate further. + primary.updateConfig(newConfig); + secondary.updateConfig(newConfig); + } + + // For now only updates error rate, interval, and is enabled. + synchronized void updateConfig(FallbackConfiguration newConfig) { + config = + config.toBuilder() + .setEnabled(newConfig.isEnabled()) + .setCheckInterval(newConfig.getCheckInterval()) + .setErrorRate(newConfig.getErrorRate()) + .build(); + + if (!config.isEnabled()) { + if (currentPool.compareAndSet(secondary, primary)) { + poolFallbackListener.onFallback( + config.getFallbackName(), + config.getPrimaryName(), + ChannelFallbackReason.FALLBACK_DISABLE); + } + } + } + + @Override + public synchronized void close() { + if (checkTask != null) { + checkTask.cancel(false); + } + primary.close(); + secondary.close(); + } + + @Override + public SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + final ChannelPool current = currentPool.get(); + final SessionStream stream = current.newStream(desc, callOptions); + + return new ForwardingSessionStream(stream) { + private boolean ignoreError; + + @Override + public void start(Listener responseListener, Metadata headers) { + try { + super.start( + new SessionStream.ForwardingListener(responseListener) { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + if (current == primary) { + // Count successful session establishment as success. + successCount.incrementAndGet(); + // peerInfo received successfully, session is established, + // this is a successful start, thus ignoring any following errors. + ignoreError = true; + } + super.onBeforeSessionStart(peerInfo); + } + + @Override + public void onClose(Status status, Metadata trailers) { + // Already using fallback. + if (current != primary) { + super.onClose(status, trailers); + return; + } + + if (!status.isOk() && !ignoreError) { + failureCount.incrementAndGet(); + } + super.onClose(status, trailers); + } + }, + headers); + } catch (Exception e) { + if (current == primary) { + // Any exception on newStream start is a failure. + failureCount.incrementAndGet(); + } + throw e; + } + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + // Force closing the session, thus ignoring the error caused by that. + ignoreError = true; + super.forceClose(message, cause); + } + }; + } + + private synchronized void scheduleCheckRates() { + checkTask = + exec.schedule( + this::checkRatesAndReschedule, + config.getCheckInterval().toMillis(), + TimeUnit.MILLISECONDS); + } + + private void checkRatesAndReschedule() { + checkRates(); + scheduleCheckRates(); + } + + private synchronized void checkRates() { + int successes = successCount.getAndSet(0); + int failures = failureCount.getAndSet(0); + int total = successes + failures; + + if (!config.isEnabled()) { + return; + } + + if (total > 0 && ((double) failures) / total >= config.getErrorRate()) { + if (currentPool.compareAndSet(primary, secondary)) { + poolFallbackListener.onFallback( + config.getPrimaryName(), config.getFallbackName(), ChannelFallbackReason.ERROR_RATE); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java new file mode 100644 index 000000000000..058dfdcaeb7a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java @@ -0,0 +1,69 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.auto.value.AutoValue; +import java.time.Duration; + +@AutoValue +public abstract class FallbackConfiguration { + public abstract boolean isEnabled(); + + public abstract double getErrorRate(); + + public abstract Duration getCheckInterval(); + + public abstract String getPrimaryName(); + + public abstract String getFallbackName(); + + public abstract ChannelPool getPrimaryChannelPool(); + + public abstract ChannelPool getFallbackChannelPool(); + + public abstract Builder toBuilder(); + + public static Builder builder() { + return new AutoValue_FallbackConfiguration.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setEnabled(boolean enabled); + + public abstract Builder setErrorRate(double errorRate); + + public abstract Builder setCheckInterval(Duration checkInterval); + + protected abstract Builder setPrimaryName(String primaryName); + + protected abstract Builder setFallbackName(String fallbackName); + + protected abstract Builder setPrimaryChannelPool(ChannelPool primaryChannelPool); + + protected abstract Builder setFallbackChannelPool(ChannelPool fallbackChannelPool); + + public Builder setPrimary(String name, ChannelPool pool) { + return setPrimaryName(name).setPrimaryChannelPool(pool); + } + + public Builder setFallback(String name, ChannelPool pool) { + return setFallbackName(name).setFallbackChannelPool(pool); + } + + public abstract FallbackConfiguration build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java new file mode 100644 index 000000000000..54652c044ee5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import io.grpc.Metadata; +import javax.annotation.Nullable; + +public class ForwardingSessionStream implements SessionStream { + private final SessionStream delegate; + + public ForwardingSessionStream(SessionStream delegate) { + this.delegate = delegate; + } + + @Override + public PeerInfo getPeerInfo() { + return delegate.getPeerInfo(); + } + + @Override + public void start(Listener responseListener, Metadata headers) { + delegate.start(responseListener, headers); + } + + @Override + public void sendMessage(SessionRequest request) { + delegate.sendMessage(request); + } + + @Override + public void halfClose() { + delegate.halfClose(); + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + delegate.forceClose(message, cause); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java new file mode 100644 index 000000000000..ebbc39af7f2c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.Metadata; +import io.grpc.Status; +import javax.annotation.Nullable; + +public interface SessionStream { + public static final PeerInfo DISCONNECTED_PEER_INFO = + PeerInfo.newBuilder().setTransportType(TransportType.TRANSPORT_TYPE_SESSION_UNKNOWN).build(); + + public PeerInfo getPeerInfo(); + + public void start(Listener responseListener, Metadata headers); + + public void sendMessage(SessionRequest request); + + public void halfClose(); + + public void forceClose(@Nullable String message, @Nullable Throwable cause); + + public interface Listener { + void onBeforeSessionStart(PeerInfo peerInfo); + + void onMessage(SessionResponse msg); + + void onClose(Status status, Metadata trailers); + } + + public static class ForwardingListener implements Listener { + private final Listener delegate; + + public ForwardingListener(Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + delegate.onBeforeSessionStart(peerInfo); + } + + @Override + public void onMessage(SessionResponse msg) { + delegate.onMessage(msg); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java new file mode 100644 index 000000000000..fa46914df03b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import io.grpc.ClientCall; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.alts.AltsContextUtil; +import java.util.Base64; +import javax.annotation.Nullable; + +public class SessionStreamImpl implements SessionStream { + private final ClientCall call; + private volatile PeerInfo peerInfo = DISCONNECTED_PEER_INFO; + + @VisibleForTesting + static final Metadata.Key PEER_INFO_KEY = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + + public SessionStreamImpl(ClientCall call) { + this.call = call; + } + + @Override + public PeerInfo getPeerInfo() { + return peerInfo; + } + + @Override + public void start(Listener responseListener, Metadata headers) { + call.start( + new ClientCall.Listener() { + @Override + public void onHeaders(Metadata headers) { + String encodedStr = headers.get(PEER_INFO_KEY); + Preconditions.checkArgument( + !Strings.isNullOrEmpty(encodedStr), + "Session open response headers missing %s", + PEER_INFO_KEY.name()); + + PeerInfo newPeerInfo; + + try { + byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); + newPeerInfo = PeerInfo.parseFrom(decoded); + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to parse " + + PEER_INFO_KEY.name() + + " from the response header value: " + + encodedStr); + } + // TODO: remove these fallbacks once PeerInfo is properly populated on the server + if (newPeerInfo.getTransportType() == TransportType.TRANSPORT_TYPE_UNKNOWN) { + if (AltsContextUtil.check(call.getAttributes())) { + newPeerInfo = + newPeerInfo.toBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .build(); + } else { + newPeerInfo = + newPeerInfo.toBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_UNKNOWN) + .build(); + } + } + SessionStreamImpl.this.peerInfo = newPeerInfo; + responseListener.onBeforeSessionStart(peerInfo); + super.onHeaders(headers); + } + + @Override + public void onMessage(SessionResponse message) { + responseListener.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + responseListener.onClose(status, trailers); + } + }, + headers); + call.request(Integer.MAX_VALUE); + } + + @Override + public void sendMessage(SessionRequest request) { + call.sendMessage(request); + } + + @Override + public void halfClose() { + call.halfClose(); + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + call.cancel("Force closed: " + message, cause); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java new file mode 100644 index 000000000000..6d40b58d53d4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.CallOptions; +import io.grpc.ManagedChannel; +import io.grpc.MethodDescriptor; +import java.util.function.Supplier; + +public class SingleChannelPool implements ChannelPool { + private final Supplier channelSupplier; + private ManagedChannel channel; + + public SingleChannelPool(Supplier channelSupplier) { + this.channelSupplier = channelSupplier; + } + + @Override + public void start() { + channel = channelSupplier.get(); + } + + @Override + public void close() { + channel.shutdown(); + } + + @Override + public SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + return new SessionStreamImpl(channel.newCall(desc, callOptions)); + } + + @Override + public void updateConfig(ChannelPoolConfiguration config) { + // No-op. + return; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java new file mode 100644 index 000000000000..428a0080d8dc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java @@ -0,0 +1,213 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import static com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.transportTypeToString; + +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager.ListenerHandle; +import io.grpc.CallOptions; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.MethodDescriptor; +import java.time.Duration; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import javax.annotation.concurrent.GuardedBy; + +/** + * SwitchingChannelPool reads channel pool configuration from configManager on initialization, + * creates underlying channel pool according to the configuration, and subscribes to configuration + * updates. When update happens, it propagates updated configuration to the underlying channel pool + * or creates a different channel pool if channel pool mode has changed. + */ +public class SwitchingChannelPool implements ChannelPool { + @GuardedBy("this") + private ChannelPool delegate; + + private ChannelPoolConfiguration currentConfiguration; + + private final boolean fallbackAvailable; + private final ListenerHandle configListener; + + @GuardedBy("this") + private boolean isClosed; + + private final ChannelProvider channelProvider; + private final Metrics metrics; + private final ScheduledExecutorService backgroundExecutor; + + public SwitchingChannelPool( + ChannelProvider channelProvider, + ClientConfigurationManager configManager, + Metrics metrics, + ScheduledExecutorService backgroundExecutor) { + this.channelProvider = channelProvider; + this.metrics = metrics; + this.backgroundExecutor = backgroundExecutor; + + currentConfiguration = + configManager.getClientConfiguration().getSessionConfiguration().getChannelConfiguration(); + + if (channelProvider.getFallback().isPresent()) { + fallbackAvailable = true; + delegate = createChannelPoolForCurrentMode(); + } else { + // Depending on whether DirectAccess is avaialbe, the channelProvider + // is either a DirectAccess with fallback to Cloudpath + // or a basic Cloudpath. + // If it's a basic cloudpath we can't do any fallback, + // and we can't do directaccess without fallback. + // Essentially, fallback configuration is not applicable here. + fallbackAvailable = false; + delegate = newChannelPoolFromProvider(channelProvider); + } + + // Subscribe to config changes. + configListener = + configManager.addListener( + cfg -> cfg.getSessionConfiguration().getChannelConfiguration(), this::updateConfig); + } + + @Override + public synchronized void updateConfig(ChannelPoolConfiguration newConfig) { + if (isClosed) { + return; + } + + if (fallbackAvailable && currentConfiguration.getModeCase() != newConfig.getModeCase()) { + // Mode has changed and we can change modes. + currentConfiguration = newConfig; + ChannelPool cp = createChannelPoolForCurrentMode(); + replaceChannelPool(cp); + return; + } + + currentConfiguration = newConfig; + delegate.updateConfig(currentConfiguration); + } + + private ChannelPool createChannelPoolForCurrentMode() { + switch (currentConfiguration.getModeCase()) { + default: + case MODE_NOT_SET: + case CLOUD_PATH_ONLY: + return newChannelPoolFromProvider(channelProvider.getFallback().get()); + case DIRECT_ACCESS_ONLY: + return newChannelPoolFromProvider(channelProvider); + case DIRECT_ACCESS_WITH_FALLBACK: + ChannelPool primaryChannelPool = + newChannelPoolFromProvider( + channelProvider, + "primary", + new DirectpathEnforcer( + "Non-directpath connections are not allowed in the directpath channel " + + "pool when a fallback channel pool is available.")); + ChannelPool fallbackChannelPool = + newChannelPoolFromProvider(channelProvider.getFallback().get(), "fallback"); + FallbackConfiguration fallbackConfiguration = + FallbackConfiguration.builder() + .setPrimary( + transportTypeToString(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS), + primaryChannelPool) + .setFallback( + transportTypeToString(TransportType.TRANSPORT_TYPE_SESSION_CLOUD_PATH), + fallbackChannelPool) + .setEnabled(true) + .setCheckInterval( + Duration.ofSeconds( + currentConfiguration + .getDirectAccessWithFallback() + .getCheckInterval() + .getSeconds())) + .setErrorRate( + currentConfiguration.getDirectAccessWithFallback().getErrorRateThreshold()) + .build(); + return new FallbackChannelPool( + fallbackConfiguration, metrics.getPoolFallbackListener(), backgroundExecutor); + } + } + + private synchronized void replaceChannelPool(ChannelPool newChannelPool) { + newChannelPool.start(); + ChannelPool prev = delegate; + delegate = newChannelPool; + prev.close(); + } + + @Override + public synchronized void start() { + delegate.start(); + } + + @Override + public synchronized void close() { + if (isClosed) { + return; + } + + configListener.close(); + delegate.close(); + isClosed = true; + } + + @Override + public synchronized SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + return delegate.newStream(desc, callOptions); + } + + private ChannelPool newChannelPoolFromProvider( + ChannelProvider channelProvider, ClientInterceptor... interceptors) { + return newChannelPoolFromProvider(channelProvider, null, interceptors); + } + + private ChannelPool newChannelPoolFromProvider( + ChannelProvider channelProvider, String logName, ClientInterceptor... interceptors) { + if (channelProvider.isSingleEndpoint()) { + return new SingleChannelPool( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors)); + } + + if (logName != null) { + return new ChannelPoolDpImpl( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors), + currentConfiguration, + logName, + metrics.getDebugTagTracer(), + backgroundExecutor); + } + + return new ChannelPoolDpImpl( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors), + currentConfiguration, + metrics.getDebugTagTracer(), + backgroundExecutor); + } + + private Supplier channelBuilderToSupplier( + ManagedChannelBuilder channelBuilder, ClientInterceptor... interceptors) { + return () -> channelBuilder.intercept(interceptors).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java new file mode 100644 index 000000000000..b4d3cc305cf4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; + +public class DisabledShim implements Shim { + + @Override + public void close() {} + + @Override + public UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings) { + return classic; + } + + @Override + public UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings) { + return classic; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java new file mode 100644 index 000000000000..4db124936902 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.core.ApiFuture; +import io.grpc.Context.CancellableContext; +import java.util.concurrent.CancellationException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import javax.annotation.Nonnull; + +public class FutureAdapter implements ApiFuture { + private final CompletableFuture inner; + private final CancellableContext ambientCtx; + + public FutureAdapter(CompletableFuture inner, CancellableContext ambientCtx) { + this.inner = inner; + this.ambientCtx = ambientCtx; + + CompletableFuture ignored = inner.whenComplete((ignored1, ignored2) -> ambientCtx.close()); + } + + @Override + public void addListener(Runnable listener, Executor executor) { + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = inner.whenCompleteAsync((v, t) -> listener.run(), executor); + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + boolean wasCancelled = inner.cancel(mayInterruptIfRunning); + ambientCtx.cancel(new CancellationException("Operation Future was cancelled by the end user")); + return wasCancelled; + } + + @Override + public boolean isCancelled() { + return inner.isCancelled(); + } + + @Override + public boolean isDone() { + return inner.isDone(); + } + + @Override + public V get() throws InterruptedException, ExecutionException { + return inner.get(); + } + + @Override + public V get(long timeout, @Nonnull TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException { + return inner.get(timeout, unit); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java new file mode 100644 index 000000000000..90f843cb39b2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.auth.Credentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import io.grpc.CallCredentials; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import io.grpc.MethodDescriptor; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; +import java.util.Optional; +import javax.annotation.Nullable; + +public class GaxBasicChannelProvider implements ChannelProvider { + private final ApiFunction channelConfigurator; + private final InstantiatingGrpcChannelProvider inner; + private final @Nullable CallCredentials credentials; + + @SuppressWarnings("rawtypes") + public GaxBasicChannelProvider( + InstantiatingGrpcChannelProvider inner, @Nullable Credentials credentials) { + this.channelConfigurator = + Optional.ofNullable(inner.toBuilder().getChannelConfigurator()).orElse(b -> b); + this.inner = inner.toBuilder().setAttemptDirectPath(false).build(); + this.credentials = Optional.ofNullable(credentials).map(MoreCallCredentials::from).orElse(null); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(false) + .setDirectAccessRequested(false) + .build(); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + try { + ManagedChannelBuilder builder = inner.createChannelBuilder(); + if (credentials != null) { + builder.intercept(new CredInterceptor(credentials)); + } + builder = channelConfigurator.apply(builder); + return builder; + } catch (IOException e) { + throw new RuntimeException("Gax channel provider failed to provide a channel builder", e); + } + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + private static class CredInterceptor implements ClientInterceptor { + private final CallCredentials callCredentials; + + private CredInterceptor(CallCredentials callCredentials) { + this.callCredentials = callCredentials; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + return next.newCall(method, callOptions.withCallCredentials(callCredentials)); + } + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java new file mode 100644 index 000000000000..b562c6922330 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.auth.Credentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.util.Optional; +import javax.annotation.Nullable; + +public class GaxDirectAccessChannelProvider implements ChannelProvider { + private final InstantiatingGrpcChannelProvider inner; + + @SuppressWarnings("rawtypes") + private final ApiFunction channelConfigurator; + + private final Optional fallback; + + public static ChannelProvider create( + InstantiatingGrpcChannelProvider outer, @Nullable Credentials credentials) { + InstantiatingGrpcChannelProvider directAccessProvider = + outer.toBuilder().setAttemptDirectPath(true).setAttemptDirectPathXds().build(); + + InstantiatingGrpcChannelProvider cloudPathProvider = + outer.toBuilder().setAttemptDirectPath(false).build(); + + if (directAccessProvider.canUseDirectPath()) { + return new GaxDirectAccessChannelProvider( + directAccessProvider, credentials, Optional.empty()); + } else { + return new GaxBasicChannelProvider(cloudPathProvider, credentials); + } + } + + public static ChannelProvider createWithFallback( + InstantiatingGrpcChannelProvider outer, @Nullable Credentials credentials) { + InstantiatingGrpcChannelProvider directAccessProvider = + outer.toBuilder().setAttemptDirectPath(true).setAttemptDirectPathXds().build(); + + InstantiatingGrpcChannelProvider cloudPathProvider = + outer.toBuilder().setAttemptDirectPath(false).build(); + + if (directAccessProvider.canUseDirectPath()) { + return new GaxDirectAccessChannelProvider( + directAccessProvider, + credentials, + Optional.of(new GaxBasicChannelProvider(cloudPathProvider, credentials))); + } else { + return new GaxBasicChannelProvider(cloudPathProvider, credentials); + } + } + + private GaxDirectAccessChannelProvider( + InstantiatingGrpcChannelProvider directAccessProvider, + @SuppressWarnings("unused") @Nullable Credentials credentials, + Optional fallback) { + this.inner = directAccessProvider; + this.channelConfigurator = + Optional.ofNullable(directAccessProvider.toBuilder().getChannelConfigurator()) + .orElse(b -> b); + this.fallback = fallback; + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(true) + .setDirectAccessRequested(true) + .build(); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + try { + return channelConfigurator.apply(inner.createChannelBuilder()); + } catch (IOException e) { + throw new RuntimeException("Gax channel provider failed to provide a channel builder", e); + } + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public Optional getFallback() { + return fallback; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java new file mode 100644 index 000000000000..b15e4003af34 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java @@ -0,0 +1,35 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; + +public interface Shim { + + void close(); + + UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings); + + UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java new file mode 100644 index 000000000000..353973dc8e58 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java @@ -0,0 +1,276 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.BigtableGrpc.BigtableBlockingV2Stub; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ConfiguredChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.Client.Resource; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.DivertingUnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.MutateRowShim; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.ReadRowShim; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.ReadRowShimInner; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.stub.MetadataUtils; +import java.io.IOException; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Implementation of a shim to fork off traffic to session based apis. It acts as a factory for + * callable decorators. + */ +public class ShimImpl implements Shim { + private static final Logger logger = Logger.getLogger(ShimImpl.class.getName()); + + // TODO: this should be a client config + public static final int MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES = 30; + private static final Duration DA_CHECK_TIMEOUT = Duration.ofSeconds(5); + + private final ClientConfigurationManager configManager; + private final Client client; + + private final ReadRowShimInner readRowShimInner; + private final MutateRowShim mutateRowShim; + + public static Shim create( + ClientInfo clientInfo, + @Nullable Credentials callCreds, + Metrics metrics, + ScheduledExecutorService bgExecutor, + StubSettings stubSettings) + throws IOException { + + TransportChannelProvider transportProvider = stubSettings.getTransportChannelProvider(); + if (!(transportProvider instanceof InstantiatingGrpcChannelProvider)) { + return new DisabledShim(); + } + + transportProvider = + ((InstantiatingGrpcChannelProvider) transportProvider) + .toBuilder() + .setHeaderProvider(ImmutableMap::of) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .build(); + + if (transportProvider.needsEndpoint()) { + transportProvider = transportProvider.withEndpoint(stubSettings.getEndpoint()); + } + if (callCreds != null && transportProvider.needsCredentials()) { + transportProvider = transportProvider.withCredentials(callCreds); + } + if (transportProvider.needsBackgroundExecutor()) { + transportProvider = transportProvider.withBackgroundExecutor(bgExecutor); + } + if (transportProvider.needsMtlsEndpoint() + && !Strings.isNullOrEmpty(stubSettings.getMtlsEndpoint())) { + transportProvider = transportProvider.withMtlsEndpoint(stubSettings.getMtlsEndpoint()); + } + + // Channel provider for the client. DirectAccess with fallback by default. + ChannelProvider clientChannelProvider = + configureChannelProvider( + GaxDirectAccessChannelProvider.createWithFallback( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + + if (!checkDirectAccessAvailable( + Client.BASE_FEATURE_FLAGS, clientInfo, clientChannelProvider, metrics, bgExecutor)) { + // Directpath failed, revert to basic channel provider for the client. + clientChannelProvider = + configureChannelProvider( + new GaxBasicChannelProvider( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + } + + // ChannelProvider for configuration manager. + ChannelProvider configChannelProvider = + configureChannelProvider( + new GaxBasicChannelProvider( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + + ClientConfigurationManager configManager = + new ClientConfigurationManager( + configChannelProvider.updateFeatureFlags(Client.BASE_FEATURE_FLAGS), + clientInfo, + configChannelProvider, + metrics.getDebugTagTracer(), + bgExecutor); + + try { + configManager.start().get(); + metrics.getDebugTagTracer().setClientConfigurationManager(configManager); + } catch (Exception e) { + logger.log(Level.WARNING, "Failed to fetch initial client configuration", e); + configManager.close(); + return new DisabledShim(); + } + + FeatureFlags featureFlags = Client.BASE_FEATURE_FLAGS; + + if (configManager.areSessionsRequired()) { + featureFlags = featureFlags.toBuilder().setSessionsRequired(true).build(); + } + + Client client = + new Client( + clientChannelProvider.updateFeatureFlags(featureFlags), + clientInfo, + clientChannelProvider, + Resource.createShared(metrics), + Resource.createShared(configManager), + Resource.createShared(bgExecutor)); + + return new ShimImpl(configManager, client); + } + + public ShimImpl(ClientConfigurationManager configManager, Client client) { + this.configManager = configManager; + this.client = client; + + this.readRowShimInner = new ReadRowShimInner(client); + this.mutateRowShim = new MutateRowShim(client); + } + + private static ChannelProvider configureChannelProvider( + ChannelProvider channelProvider, Metrics metrics) { + return new ConfiguredChannelProvider( + channelProvider, + channelBuilder -> + metrics + .configureGrpcChannel(channelBuilder) + .keepAliveTime(Client.KEEPALIVE_TIME_MS, TimeUnit.MILLISECONDS) + .keepAliveTimeout(Client.KEEPALIVE_TIMEOUT_MS, TimeUnit.MILLISECONDS) + // TODO: consider localizing this for large reads + .maxInboundMessageSize(256 * 1024 * 1024)); + } + + private static boolean checkDirectAccessAvailable( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + Metrics metrics, + ScheduledExecutorService bgExecutor) { + ManagedChannel channel = channelProvider.newChannelBuilder().build(); + DirectPathCompatibleTracer tracer = metrics.getDirectPathCompatibleTracer(); + + Metadata metadata = + com.google.cloud.bigtable.data.v2.internal.api.Util.composeMetadata( + channelProvider.updateFeatureFlags(featureFlags), + ImmutableMap.of( + "instance_name", clientInfo.getInstanceName().toString(), + "app_profile_id", clientInfo.getAppProfileId())); + ClientInterceptor attachMetadata = MetadataUtils.newAttachHeadersInterceptor(metadata); + MetadataExtractorInterceptor metaInterceptor = new MetadataExtractorInterceptor(); + + BigtableBlockingV2Stub stub = + BigtableGrpc.newBlockingV2Stub(channel).withInterceptors(attachMetadata, metaInterceptor); + + try { + stub.withDeadlineAfter(DA_CHECK_TIMEOUT) + .getClientConfiguration( + GetClientConfigurationRequest.newBuilder() + .setInstanceName(clientInfo.getInstanceName().toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .build()); + } catch (Exception e) { + logger.log(Level.FINE, "DirectAccess check RPC failed.", e); + // Spin up investigation. + bgExecutor.execute(() -> DirectAccessInvestigator.investigateAndReport(tracer, e)); + return false; + } finally { + channel.shutdownNow(); + } + + TransportType tt = + Optional.ofNullable(metaInterceptor.getSidebandData().getPeerInfo()) + .map(PeerInfo::getTransportType) + .orElse(TransportType.TRANSPORT_TYPE_UNKNOWN); + + boolean result = + tt == TransportType.TRANSPORT_TYPE_DIRECT_ACCESS + || tt == TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS; + + if (result) { + tracer.recordSuccess(metaInterceptor.getSidebandData().getIpProtocol()); + } else { + // Spin up investigation. + bgExecutor.execute(() -> DirectAccessInvestigator.investigateAndReport(tracer, null)); + } + + return result; + } + + @Override + public void close() { + client.close(); + configManager.close(); + } + + @Override + public UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings) { + return new DivertingUnaryCallable<>( + configManager, + classic, + new ReadRowShim<>(readRowShimInner, rowAdapter), + Util.extractTimeout(settings)); + } + + @Override + public UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings) { + return new DivertingUnaryCallable<>( + configManager, classic, mutateRowShim, Util.extractTimeout(settings)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java new file mode 100644 index 000000000000..42fa0b9b1d04 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.cache.RemovalListener; +import io.grpc.Context; +import io.grpc.Deadline; +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import javax.annotation.Nonnull; + +public class Util { + public static LoadingCache createSessionMap( + Function factory) { + return CacheBuilder.newBuilder() + .expireAfterAccess(Duration.ofMinutes(5)) + .removalListener( + (RemovalListener) + notification -> { + try { + @SuppressWarnings("DataFlowIssue") + @Nonnull + V value = notification.getValue(); + //noinspection DataFlowIssue + value.close(); + } catch (IOException e) { + // TODO log + } + }) + .build( + new CacheLoader() { + @Override + @Nonnull + public V load(@Nonnull K key) { + return factory.apply(key); + } + }); + } + + public static Duration extractTimeout(UnaryCallSettings settings) { + return settings.getRetrySettings().getTotalTimeoutDuration(); + } + + public static Deadline extractDeadline(GrpcCallContext callContext, Duration defaultDeadline) { + // NOTE: ignoring callContext.timeout because its an attempt timeout + Optional ambientDeadline = Optional.ofNullable(Context.current().getDeadline()); + Optional retryTotalTimeout = + Optional.ofNullable(callContext) + .flatMap(ctx -> Optional.ofNullable(ctx.getRetrySettings())) + .map(RetrySettings::getTotalTimeoutDuration); + Optional grpcCallDeadline = + Optional.ofNullable(callContext) + .flatMap(ctx -> Optional.ofNullable(ctx.getCallOptions())) + .flatMap(ctx -> Optional.ofNullable(ctx.getDeadline())); + + Deadline effectiveDeadline = null; + if (ambientDeadline.isPresent()) { + effectiveDeadline = ambientDeadline.get(); + } + if (grpcCallDeadline.isPresent()) { + if (effectiveDeadline == null || grpcCallDeadline.get().isBefore(effectiveDeadline)) { + effectiveDeadline = grpcCallDeadline.get(); + } + } + if (retryTotalTimeout.isPresent()) { + Deadline retryDeadline = + Deadline.after(retryTotalTimeout.get().toMillis(), TimeUnit.MILLISECONDS); + if (effectiveDeadline == null || retryDeadline.isBefore(effectiveDeadline)) { + effectiveDeadline = retryDeadline; + } + } + if (effectiveDeadline == null) { + effectiveDeadline = Deadline.after(defaultDeadline.toMillis(), TimeUnit.MILLISECONDS); + } + return effectiveDeadline; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java new file mode 100644 index 000000000000..1097bf96379e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat.ops; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.compat.FutureAdapter; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.base.Throwables; +import io.grpc.Context; +import io.grpc.Context.CancellableContext; +import io.grpc.Deadline; +import io.grpc.Status; +import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; +import java.time.Duration; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ThreadLocalRandom; + +/** A callable to fork traffic between classic and session based operations. */ +public class DivertingUnaryCallable extends UnaryCallable { + private final ClientConfigurationManager configurationManager; + + private final UnaryCallable classic; + private final UnaryShim experimental; + + private final Duration defaultTimeout; + + public DivertingUnaryCallable( + ClientConfigurationManager configurationManager, + UnaryCallable classic, + UnaryShim experimental, + Duration defaultTimeout) { + this.configurationManager = configurationManager; + this.classic = classic; + this.experimental = experimental; + this.defaultTimeout = defaultTimeout; + } + + @Override + public ApiFuture futureCall(ReqT request, ApiCallContext context) { + if (!useExperimental(request)) { + return classic.futureCall(request, context); + } + + Deadline deadline = Util.extractDeadline((GrpcCallContext) context, defaultTimeout); + + // Java8 futures dont chain cancellations + // ApiFutures do, so we pipe cancellation via the ambient Context + // futureCall is responsible for attaching/detaching + // FutureAdapter is responsible for cleaning up the context + CancellableContext ambientCtx = Context.current().withCancellation(); + + CompletableFuture f; + + try { + f = ambientCtx.call(() -> experimental.call(request, deadline)); + } catch (Throwable e) { + ambientCtx.close(); + + Throwables.throwIfUnchecked(e); + throw new RuntimeException(e); + } + + f = + f.handle( + (r, e) -> { + if (e != null) { + throw translateException(e); + } + return r; + }); + + return new FutureAdapter<>(f, ambientCtx); + } + + private boolean useExperimental(ReqT req) { + if (!experimental.supports(req)) { + return false; + } + + float ratio = + configurationManager.getClientConfiguration().getSessionConfiguration().getSessionLoad(); + if (ratio == 0) { + return false; + } + if (ratio != 1.0 && ThreadLocalRandom.current().nextFloat() > ratio) { + return false; + } + return true; + } + + ApiException translateException(Throwable e) { + Throwable cause = e; + while (cause instanceof CompletionException || cause instanceof ExecutionException) { + if (cause.getCause() != null) { + cause = cause.getCause(); + } else { + break; + } + } + + Status.Code code = Status.Code.UNKNOWN; + + if (cause instanceof StatusRuntimeException) { + code = ((StatusRuntimeException) cause).getStatus().getCode(); + } + if (cause instanceof StatusException) { + code = ((StatusException) cause).getStatus().getCode(); + } + + return ApiExceptionFactory.createException( + cause.getMessage(), e, GrpcStatusCode.of(code), false); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java new file mode 100644 index 000000000000..9102714457ae --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat.ops; + +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.cloud.bigtable.data.v2.internal.api.AuthorizedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.TableAsync; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.common.cache.LoadingCache; +import io.grpc.Deadline; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; + +public class MutateRowShim implements UnaryShim { + + private final LoadingCache tables; + private final LoadingCache authViews; + + public MutateRowShim(Client client) { + tables = + Util.createSessionMap( + k -> client.openTableAsync(k.getTableId(), Permission.PERMISSION_WRITE)); + authViews = + Util.createSessionMap( + k -> + client.openAuthorizedViewAsync( + k.getTableId(), + k.getAuthorizedViewId(), + OpenAuthorizedViewRequest.Permission.PERMISSION_WRITE)); + } + + @Override + public void close() throws IOException { + tables.invalidateAll(); + authViews.invalidateAll(); + } + + @Override + public boolean supports(RowMutation request) { + TargetId targetId = request.getTargetId(); + SessionPool pool; + // TODO: avoid double lookup + if (targetId instanceof TableId) { + pool = tables.getUnchecked((TableId) targetId).getSessionPool(); + } else if (targetId instanceof AuthorizedViewId) { + pool = authViews.getUnchecked((AuthorizedViewId) targetId).getSessionPool(); + } else { + return false; + } + // Currently this will only fallback in case RLS is misconfigured. If the AFE + // pool is unavailable, it'll be controlled by ClientConfiguration. + return pool.getConsecutiveUnimplementedFailures() + < ShimImpl.MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES + || pool.hasSession(); + } + + @Override + public CompletableFuture call(RowMutation request, Deadline deadline) { + TargetId targetId = request.getTargetId(); + + SessionMutateRowRequest innerReq = request.toSessionProto(); + + if (targetId instanceof TableId) { + return tables + .getUnchecked((TableId) targetId) + .mutateRow(innerReq, deadline) + .thenApply(r -> null); + } + if (targetId instanceof AuthorizedViewId) { + return authViews + .getUnchecked((AuthorizedViewId) targetId) + .mutateRow(innerReq, deadline) + .thenApply(r -> null); + } + + CompletableFuture f = new CompletableFuture<>(); + f.completeExceptionally( + new UnsupportedOperationException("Unsupported targetId type: " + targetId)); + return f; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java new file mode 100644 index 000000000000..68d9b9443c83 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat.ops; + +import com.google.bigtable.v2.Cell; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +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.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import io.grpc.Deadline; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; + +/** + * Stateless wrapper around {@link ReadRowShimInner}. It primary purpose is to pair a {@link + * RowAdapter} with a stateful {@link ReadRowShimInner}. + */ +public class ReadRowShim implements UnaryShim { + private static final RowAdapter DEFAULT_ADAPTER = new DefaultRowAdapter(); + + private final ReadRowShimInner inner; + private final RowAdapter adapter; + + public static ReadRowShim createDefault(ReadRowShimInner inner) { + return new ReadRowShim<>(inner, DEFAULT_ADAPTER); + } + + public ReadRowShim(ReadRowShimInner inner, RowAdapter adapter) { + this.inner = inner; + this.adapter = adapter; + } + + @Override + public boolean supports(Query request) { + return inner.supports(request); + } + + @Override + public CompletableFuture call(Query request, Deadline deadline) { + CompletableFuture f = inner.call(request, deadline); + return f.thenApply(r -> buildRow(adapter.createRowBuilder(), r)); + } + + @Override + public void close() throws IOException { + inner.close(); + } + + private static T buildRow(RowBuilder adapter, SessionReadRowResponse input) { + if (!input.hasRow()) { + return null; + } + com.google.bigtable.v2.Row protoRow = input.getRow(); + + adapter.startRow(protoRow.getKey()); + + for (Family family : protoRow.getFamiliesList()) { + for (Column column : family.getColumnsList()) { + for (Cell cell : column.getCellsList()) { + adapter.startCell( + family.getName(), + column.getQualifier(), + cell.getTimestampMicros(), + cell.getLabelsList(), + 0); + adapter.cellValue(cell.getValue()); + adapter.finishCell(); + } + } + } + return adapter.finishRow(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java new file mode 100644 index 000000000000..9dc134bd2392 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat.ops; + +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.api.AuthorizedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.MaterializedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.TableAsync; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.MaterializedViewId; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.common.cache.LoadingCache; +import io.grpc.Deadline; +import java.util.concurrent.CompletableFuture; + +public class ReadRowShimInner implements UnaryShim { + private final LoadingCache tables; + private final LoadingCache authViews; + private final LoadingCache matViews; + + public ReadRowShimInner(Client client) { + tables = + Util.createSessionMap( + k -> client.openTableAsync(k.getTableId(), Permission.PERMISSION_READ)); + authViews = + Util.createSessionMap( + k -> + client.openAuthorizedViewAsync( + k.getTableId(), + k.getAuthorizedViewId(), + OpenAuthorizedViewRequest.Permission.PERMISSION_READ)); + matViews = + Util.createSessionMap( + k -> + client.openMaterializedViewAsync( + k.getMaterializedViewId(), + OpenMaterializedViewRequest.Permission.PERMISSION_READ)); + } + + @Override + public void close() { + tables.invalidateAll(); + authViews.invalidateAll(); + matViews.invalidateAll(); + } + + @Override + public boolean supports(Query request) { + TargetId targetId = request.getTargetId(); + SessionPool pool; + // TODO avoid double lookup + if (targetId instanceof TableId) { + pool = tables.getUnchecked((TableId) targetId).getSessionPool(); + } else if (targetId instanceof AuthorizedViewId) { + pool = authViews.getUnchecked((AuthorizedViewId) targetId).getSessionPool(); + } else if (targetId instanceof MaterializedViewId) { + pool = matViews.getUnchecked((MaterializedViewId) targetId).getSessionPool(); + } else { + return false; + } + // Currently this will only fallback in case RLS is misconfigured. If the AFE + // pool is unavailable, it'll be controlled by ClientConfiguration. + return pool.getConsecutiveUnimplementedFailures() + < ShimImpl.MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES + || pool.hasSession(); + } + + @Override + public CompletableFuture call(Query query, Deadline deadline) { + TargetId targetId = query.getTargetId(); + + SessionReadRowRequest innerReq = query.toSessionPointProto(); + + if (targetId instanceof TableId) { + return tables.getUnchecked((TableId) targetId).readRow(innerReq, deadline); + } + if (targetId instanceof AuthorizedViewId) { + return authViews.getUnchecked((AuthorizedViewId) targetId).readRow(innerReq, deadline); + } + if (targetId instanceof MaterializedViewId) { + return matViews.getUnchecked((MaterializedViewId) targetId).readRow(innerReq, deadline); + } + + CompletableFuture f = new CompletableFuture<>(); + f.completeExceptionally( + new UnsupportedOperationException("Unsupported targetId type: " + targetId)); + return f; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java new file mode 100644 index 000000000000..864e765b2c50 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat.ops; + +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; + +/** + * Wrapper interface for session operations. It will own a set of {@link + * com.google.cloud.bigtable.data.v2.internal.session.SessionPool}s and wil dispatch vRPCs. It's + * responsible for creating these {@link + * com.google.cloud.bigtable.data.v2.internal.session.SessionPool}s on the fly and garbage + * collecting them when they are no longer used. Each logical operation will implement this + * interface. + */ +public interface UnaryShim extends Closeable { + CompletableFuture call(ReqT request, Deadline deadline); + + default boolean supports(ReqT request) { + return true; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java new file mode 100644 index 000000000000..ac31f2cfab3e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java @@ -0,0 +1,274 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlFactor; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlTargetQps; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientChannelPoolFallbackCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientChannelPoolOutstandingRpcs; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientDebugTagCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientDpCompatGuage; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientPerConnectionErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionOpenLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionUptime; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientTransportLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.CustomAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.GrpcMetric; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.MetricWrapper; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.PacemakerDelay; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableApplicationBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency2; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableClientBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableConnectivityErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableFirstResponseLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRetryCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableServerLatency; +import com.google.common.collect.ImmutableList; +import io.opentelemetry.api.metrics.Meter; +import io.opentelemetry.api.metrics.MeterProvider; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Repository for all client metrics. This class has 2 audiences: + * + *

    + *
  • VRpcTracer, which reference each metric directly + *
  • Exporter, which will look up each metric by name and use the {@link MetricWrapper} + * interface to augment the {@code MonitoredResource} and {@code Metric Labels} + *
+ */ +public class MetricRegistry { + public static final String METER_NAME = "bigtable.googleapis.com/internal/client/"; + + final TableOperationLatency operationLatencyMetric; + final TableAttemptLatency attemptLatencyMetric; + final TableAttemptLatency2 attemptLatency2Metric; + final TableRetryCount retryCountMetric; + final TableFirstResponseLatency firstResponseLantencyMetric; + final TableServerLatency serverLatencyMetric; + final ClientChannelPoolOutstandingRpcs channelPoolOutstandingRpcsMetric; + final TableConnectivityErrorCount connectivityErrorCountMetric; + final ClientDpCompatGuage dpCompatGuageMetric; + final TableApplicationBlockingLatency applicationBlockingLatencyMetric; + final TableClientBlockingLatency clientBlockingLatencyMetric; + final ClientPerConnectionErrorCount perConnectionErrorCountMetric; + final TableRemainingDeadline remainingDeadlineMetric; + final ClientBatchWriteFlowControlFactor batchWriteFlowControlFactorMetric; + final ClientBatchWriteFlowControlTargetQps batchWriteFlowControlTargetQpsMetric; + + final ClientTransportLatency transportLatencyMetric; + + final ClientSessionUptime sessionUptimeMetric; + final ClientSessionDuration sessionDurationMetric; + final ClientSessionOpenLatency sessionOpenLatencyMetric; + + final ClientDebugTagCount debugTagCountMetric; + final PacemakerDelay pacemakerDelayMetric; + + final ClientChannelPoolFallbackCount channelFallbackCountMetric; + + final CustomAttemptLatency customAttemptLatencyMetric; + + private final Map> metrics = new HashMap<>(); + private final List grpcMetricNames = new ArrayList<>(); + + public MetricRegistry() { + operationLatencyMetric = register(new TableOperationLatency()); + attemptLatencyMetric = register(new TableAttemptLatency()); + attemptLatency2Metric = register(new TableAttemptLatency2()); + retryCountMetric = register(new TableRetryCount()); + firstResponseLantencyMetric = register(new TableFirstResponseLatency()); + serverLatencyMetric = register(new TableServerLatency()); + channelPoolOutstandingRpcsMetric = register(new ClientChannelPoolOutstandingRpcs()); + connectivityErrorCountMetric = register(new TableConnectivityErrorCount()); + applicationBlockingLatencyMetric = register(new TableApplicationBlockingLatency()); + clientBlockingLatencyMetric = register(new TableClientBlockingLatency()); + perConnectionErrorCountMetric = register(new ClientPerConnectionErrorCount()); + dpCompatGuageMetric = register(new ClientDpCompatGuage()); + remainingDeadlineMetric = register(new TableRemainingDeadline()); + batchWriteFlowControlFactorMetric = register(new ClientBatchWriteFlowControlFactor()); + batchWriteFlowControlTargetQpsMetric = register(new ClientBatchWriteFlowControlTargetQps()); + + sessionUptimeMetric = register(new ClientSessionUptime()); + sessionDurationMetric = register(new ClientSessionDuration()); + sessionOpenLatencyMetric = register(new ClientSessionOpenLatency()); + transportLatencyMetric = register(new ClientTransportLatency()); + + debugTagCountMetric = register(new ClientDebugTagCount()); + pacemakerDelayMetric = register(new PacemakerDelay()); + + channelFallbackCountMetric = register(new ClientChannelPoolFallbackCount()); + + customAttemptLatencyMetric = register(new CustomAttemptLatency()); + + // From + // https://github.com/grpc/grpc-java/blob/31fdb6c2268b4b1c8ba6c995ee46c58e84a831aa/rls/src/main/java/io/grpc/rls/CachingRlsLbClient.java#L138-L165 + registerGrpcMetric( + "grpc.client.attempt.duration", + ImmutableList.of("grpc.lb.locality", "grpc.status", "grpc.method", "grpc.target")); + registerGrpcMetric( + "grpc.lb.rls.default_target_picks", + ImmutableList.of( + "grpc.target", + "grpc.lb.rls.server_target", + "grpc.lb.rls.data_plane_target", + "grpc.lb.pick_result")); + registerGrpcMetric( + "grpc.lb.rls.target_picks", + ImmutableList.of( + "grpc.target", + "grpc.lb.rls.server_target", + "grpc.lb.rls.data_plane_target", + "grpc.lb.pick_result")); + registerGrpcMetric( + "grpc.lb.rls.failed_picks", ImmutableList.of("grpc.target", "grpc.lb.rls.server_target")); + + // From + // https://github.com/grpc/grpc-java/blob/31fdb6c2268b4b1c8ba6c995ee46c58e84a831aa/xds/src/main/java/io/grpc/xds/XdsClientMetricReporterImpl.java#L67-L94 + // TODO: "grpc.xds_client.connected" + registerGrpcMetric( + "grpc.xds_client.server_failure", ImmutableList.of("grpc.target", "grpc.xds.server")); + // TODO: "grpc.xds_client.resource_updates_valid", + registerGrpcMetric( + "grpc.xds_client.resource_updates_invalid", + ImmutableList.of("grpc.target", "grpc.xds.server", "grpc.xds.resource_type")); + // TODO: "grpc.xds_client.resources" + + // From + // https://github.com/grpc/proposal/blob/86990145a7cef9e5473a132709b2556fec00c4c6/A94-subchannel-otel-metrics.md + registerGrpcMetric( + "grpc.subchannel.disconnections", + ImmutableList.of( + "grpc.target", "grpc.lb.backend_service", "grpc.lb.locality", "grpc.disconnect_error")); + + registerGrpcMetric( + "grpc.subchannel.connection_attempts_succeeded", + ImmutableList.of("grpc.target", "grpc.lb.backend_service", "grpc.lb.locality")); + + registerGrpcMetric( + "grpc.subchannel.connection_attempts_failed", + ImmutableList.of("grpc.target", "grpc.lb.backend_service", "grpc.lb.locality")); + + registerGrpcMetric( + "grpc.subchannel.open_connections", + ImmutableList.of( + "grpc.target", "grpc.security_level", "grpc.lb.backend_service", "grpc.lb.locality")); + } + + private void registerGrpcMetric(String name, List labels) { + grpcMetricNames.add(name); + register(new GrpcMetric(name, labels)); + } + + private > T register(T instrument) { + metrics.put(instrument.getName(), instrument); + return instrument; + } + + List getGrpcMetricNames() { + return ImmutableList.copyOf(grpcMetricNames); + } + + public MetricWrapper getMetric(String name) { + return metrics.get(name); + } + + public RecorderRegistry newInternalRecorderRegistry(MeterProvider meterProvider) { + return new RecorderRegistry(meterProvider.get(METER_NAME), false); + } + + public RecorderRegistry newUserRecorderRegistry(MeterProvider meterProvider) { + return new RecorderRegistry(meterProvider.get(METER_NAME), true); + } + + public class RecorderRegistry { + public final TableOperationLatency.Recorder operationLatency; + public final TableAttemptLatency.Recorder attemptLatency; + public final TableAttemptLatency2.Recorder attemptLatency2; + public final TableRetryCount.Recorder retryCount; + public final TableFirstResponseLatency.Recorder firstResponseLantency; + public final TableServerLatency.Recorder serverLatency; + public final ClientChannelPoolOutstandingRpcs.Recorder channelPoolOutstandingRpcs; + public final TableConnectivityErrorCount.Recorder connectivityErrorCount; + public final ClientDpCompatGuage.Recorder dpCompatGuage; + public final TableApplicationBlockingLatency.Recorder applicationBlockingLatency; + public final TableClientBlockingLatency.Recorder clientBlockingLatency; + public final ClientPerConnectionErrorCount.Recorder perConnectionErrorCount; + public final TableRemainingDeadline.Recorder remainingDeadline; + public final ClientBatchWriteFlowControlTargetQps.Recorder batchWriteFlowControlTargetQps; + public final ClientBatchWriteFlowControlFactor.Recorder batchWriteFlowControlFactor; + + public final ClientTransportLatency.Recorder transportLatency; + + public final ClientSessionUptime.Recorder sessionUptime; + public final ClientSessionDuration.Recorder sessionDuration; + public final ClientSessionOpenLatency.Recorder sessionOpenLatency; + + public final ClientDebugTagCount.Recorder debugTagCount; + + public final PacemakerDelay.Recorder pacemakerDelay; + + public final ClientChannelPoolFallbackCount.Recorder channelFallbackCount; + + public final CustomAttemptLatency.Recorder customAttemptLatency; + + private RecorderRegistry(Meter meter, boolean disableInternalMetrics) { + // Public metrics + operationLatency = operationLatencyMetric.newRecorder(meter); + attemptLatency = attemptLatencyMetric.newRecorder(meter); + retryCount = retryCountMetric.newRecorder(meter); + firstResponseLantency = firstResponseLantencyMetric.newRecorder(meter); + serverLatency = serverLatencyMetric.newRecorder(meter); + connectivityErrorCount = connectivityErrorCountMetric.newRecorder(meter); + applicationBlockingLatency = applicationBlockingLatencyMetric.newRecorder(meter); + clientBlockingLatency = clientBlockingLatencyMetric.newRecorder(meter); + + // Internal Metrics - only recorded by internalOtel, when configuring userOtel instances, + // internal metrics get registered on a noop provider + if (disableInternalMetrics) { + meter = MeterProvider.noop().get(METER_NAME); + } + attemptLatency2 = attemptLatency2Metric.newRecorder(meter); + channelPoolOutstandingRpcs = channelPoolOutstandingRpcsMetric.newRecorder(meter); + dpCompatGuage = dpCompatGuageMetric.newRecorder(meter); + perConnectionErrorCount = perConnectionErrorCountMetric.newRecorder(meter); + remainingDeadline = remainingDeadlineMetric.newRecorder(meter); + batchWriteFlowControlTargetQps = batchWriteFlowControlTargetQpsMetric.newRecorder(meter); + batchWriteFlowControlFactor = batchWriteFlowControlFactorMetric.newRecorder(meter); + + transportLatency = transportLatencyMetric.newRecorder(meter); + + sessionUptime = sessionUptimeMetric.newRecorder(meter); + sessionDuration = sessionDurationMetric.newRecorder(meter); + sessionOpenLatency = sessionOpenLatencyMetric.newRecorder(meter); + + debugTagCount = debugTagCountMetric.newRecorder(meter); + pacemakerDelay = pacemakerDelayMetric.newRecorder(meter); + + channelFallbackCount = channelFallbackCountMetric.newRecorder(meter); + + customAttemptLatency = customAttemptLatencyMetric.newRecorder(meter); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java new file mode 100644 index 000000000000..8f736a5da824 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import io.grpc.Deadline; +import io.grpc.ManagedChannelBuilder; +import java.io.Closeable; +import java.io.IOException; +import javax.annotation.Nullable; + +public interface Metrics extends Closeable { + @Nullable + ChannelPoolMetricsTracer getChannelPoolMetricsTracer(); + + DirectPathCompatibleTracer getDirectPathCompatibleTracer(); + + VRpcTracer newTableTracer(SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline); + + SessionTracer newSessionTracer(SessionPoolInfo poolInfo); + + PoolFallbackListener getPoolFallbackListener(); + + ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException; + + > T configureGrpcChannel(T channelBuilder); + + DebugTagTracer getDebugTagTracer(); + + void start(); + + @Override + void close(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java new file mode 100644 index 000000000000..2eef8c9a3f3a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java @@ -0,0 +1,385 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import com.google.api.gax.tracing.OpencensusTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.auth.Credentials; +import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopPoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopSessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopVrpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtableCloudMonitoringExporter; +import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtableFilteringExporter; +import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtablePeriodicReader; +import com.google.cloud.bigtable.data.v2.internal.csm.opencensus.MetricsTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BuiltinMetricsTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeVRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.Pacemaker; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListenerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.UserApiVRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.opentelemetry.metric.GoogleCloudMetricExporter; +import com.google.cloud.opentelemetry.metric.MetricConfiguration; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import io.grpc.Deadline; +import io.grpc.ManagedChannelBuilder; +import io.grpc.opentelemetry.GrpcOpenTelemetry; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tagger; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +public class MetricsImpl implements Metrics, Closeable { + + public static final String CUSTOM_METRIC = "bigtable.internal.enable-custom-metric"; + + private static final boolean enableCustomMetric = + Optional.ofNullable(System.getProperty(CUSTOM_METRIC)) + .map(Boolean::parseBoolean) + .orElse(false); + + private final ApiTracerFactory userTracerFactory; + private final @Nullable OpenTelemetrySdk internalOtel; + private final @Nullable MetricRegistry.RecorderRegistry internalRecorder; + private final @Nullable MetricRegistry.RecorderRegistry userRecorder; + private final ScheduledExecutorService executor; + private final Tagger ocTagger; + private final StatsRecorder ocRecorder; + + @Nullable private final GrpcOpenTelemetry grpcOtel; + @Nullable private final ChannelPoolMetricsTracer channelPoolMetricsTracer; + private final DirectPathCompatibleTracer directPathCompatibleTracer; + private final DebugTagTracer debugTagTracer; + @Nullable private final Pacemaker pacemaker; + private final PoolFallbackListener poolFallbackListener; + private final Object sessionLock = new Object(); + + @GuardedBy("sessionLock") + private final List sessionTracers = new ArrayList<>(); + + private final List> tasks = new ArrayList<>(); + + public MetricsImpl( + MetricRegistry metricRegistry, + ClientInfo clientInfo, + ApiTracerFactory userTracerFactory, + @Nullable OpenTelemetrySdk internalOtel, + @Nullable OpenTelemetry userOtel, + Tagger ocTagger, + StatsRecorder ocRecorder, + ScheduledExecutorService executor) { + this.userTracerFactory = Preconditions.checkNotNull(userTracerFactory); + + this.internalOtel = internalOtel; + + this.ocTagger = ocTagger; + this.ocRecorder = ocRecorder; + + this.executor = executor; + + if (internalOtel != null) { + this.internalRecorder = + metricRegistry.newInternalRecorderRegistry(internalOtel.getMeterProvider()); + this.pacemaker = new Pacemaker(internalRecorder, clientInfo, "background"); + this.channelPoolMetricsTracer = new ChannelPoolMetricsTracer(internalRecorder, clientInfo); + this.directPathCompatibleTracer = + new DirectPathCompatibleTracerImpl(clientInfo, internalRecorder); + this.debugTagTracer = new DebugTagTracerImpl(clientInfo, internalRecorder); + // Session based channel pool tracer + this.poolFallbackListener = new PoolFallbackListenerImpl(internalRecorder, clientInfo); + this.grpcOtel = + GrpcOpenTelemetry.newBuilder() + .sdk(internalOtel) + .addOptionalLabel("grpc.lb.locality") + // Disable default grpc metrics + .disableAllMetrics() + // Enable specific grpc metrics + .enableMetrics(metricRegistry.getGrpcMetricNames()) + .build(); + + } else { + this.internalRecorder = null; + this.grpcOtel = null; + this.pacemaker = null; + this.channelPoolMetricsTracer = null; + this.directPathCompatibleTracer = NoopMetricsProvider.NoopDirectPathCompatibleTracer.INSTANCE; + this.debugTagTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + this.poolFallbackListener = new NoopPoolFallbackListener(); + } + + if (userOtel != null) { + this.userRecorder = metricRegistry.newUserRecorderRegistry(userOtel.getMeterProvider()); + } else { + this.userRecorder = null; + } + } + + @Override + public void close() { + for (ScheduledFuture task : tasks) { + task.cancel(false); + } + if (internalOtel != null) { + internalOtel.close(); + } + } + + @Override + public void start() { + if (channelPoolMetricsTracer != null) { + tasks.add(channelPoolMetricsTracer.start(executor)); + } + if (pacemaker != null) { + tasks.add(pacemaker.start(executor)); + } + if (internalOtel != null) { + tasks.add( + executor.scheduleAtFixedRate(this::recordAsyncSessionMetrics, 1, 1, TimeUnit.MINUTES)); + } + } + + @Override + public > T configureGrpcChannel(T channelBuilder) { + if (grpcOtel == null) { + return channelBuilder; + } + grpcOtel.configureChannelBuilder(channelBuilder); + return channelBuilder; + } + + @Override + public VRpcTracer newTableTracer( + SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline) { + if (internalRecorder == null) { + return new NoopVrpcTracer(); + } + ImmutableList.Builder builder = ImmutableList.builder(); + builder.add( + new VRpcTracerImpl( + internalRecorder, poolInfo, descriptor.getMethodInfo(), deadline, enableCustomMetric)); + if (userRecorder != null) { + builder.add(new VRpcTracerImpl(userRecorder, poolInfo, descriptor.getMethodInfo(), deadline)); + } + if (userTracerFactory != null) { + List nameStrings = Splitter.on('.').splitToList(descriptor.getMethodInfo().getName()); + builder.add( + new UserApiVRpcTracer( + userTracerFactory.newTracer( + null, + SpanName.of(nameStrings.get(0), nameStrings.get(1)), + descriptor.getMethodInfo().getStreaming() + ? OperationType.ServerStreaming + : OperationType.Unary), + poolInfo, + descriptor)); + } + return new CompositeVRpcTracer(builder.build()); + } + + @Override + public SessionTracer newSessionTracer(SessionPoolInfo poolInfo) { + if (internalRecorder == null) { + return new NoopSessionTracer(); + } + + SessionTracerImpl tracer = new SessionTracerImpl(internalRecorder, poolInfo); + synchronized (sessionLock) { + sessionTracers.add(tracer); + } + return tracer; + } + + private void recordAsyncSessionMetrics() { + synchronized (sessionLock) { + sessionTracers.removeIf(tracer -> !tracer.recordAsyncMetrics()); + } + } + + @Override + public PoolFallbackListener getPoolFallbackListener() { + return poolFallbackListener; + } + + @Override + public ApiTracerFactory createTracerFactory(ClientInfo clientInfo) { + ImmutableList.Builder tracerFactories = ImmutableList.builder(); + tracerFactories + .add(createOCTracingFactory(clientInfo)) + .add(createOCMetricsFactory(clientInfo, ocTagger, ocRecorder)) + .add(userTracerFactory); + + if (internalRecorder != null) { + tracerFactories.add(createOtelMetricsFactory(internalRecorder, clientInfo)); + } + if (userRecorder != null) { + tracerFactories.add(createOtelMetricsFactory(userRecorder, clientInfo)); + } + + return new CompositeTracerFactory(tracerFactories.build()); + } + + @Override + @Nullable + public ChannelPoolMetricsTracer getChannelPoolMetricsTracer() { + return channelPoolMetricsTracer; + } + + @Override + public DirectPathCompatibleTracer getDirectPathCompatibleTracer() { + return directPathCompatibleTracer; + } + + @Override + public DebugTagTracer getDebugTagTracer() { + return debugTagTracer; + } + + public static OpenTelemetrySdk createBuiltinOtel( + MetricRegistry metricRegistry, + ClientInfo clientInfo, + @Nullable Credentials defaultCredentials, + @Nullable String metricsEndpoint, + String universeDomain, + ScheduledExecutorService executor) + throws IOException { + + Credentials credentials = + BigtableDataSettings.getMetricsCredentials() != null + ? BigtableDataSettings.getMetricsCredentials() + : defaultCredentials; + + SdkMeterProviderBuilder meterProvider = SdkMeterProvider.builder(); + + BigtableCloudMonitoringExporter exporter = + BigtableCloudMonitoringExporter.create( + metricRegistry, + // Lazily compute EnvInfo, but memoize it to make sure it stays constant + Suppliers.memoize(EnvInfo::detect), + clientInfo, + credentials, + metricsEndpoint, + universeDomain); + + meterProvider.registerMetricReader( + new BigtablePeriodicReader( + new BigtableFilteringExporter( + exporter, + input -> input.getName().startsWith("bigtable.googleapis.com/internal/client")), + executor)); + + if (enableCustomMetric) { + // Monitored resource and project id are detected at export time + MetricConfiguration metricConfig = + MetricConfiguration.builder() + .setCredentials(credentials) + .setInstrumentationLibraryLabelsEnabled(false) + .build(); + meterProvider.registerMetricReader( + PeriodicMetricReader.builder( + new BigtableFilteringExporter( + GoogleCloudMetricExporter.createWithConfiguration(metricConfig), + input -> input.getName().startsWith("bigtable.custom"))) + .setInterval(Duration.ofMinutes(1)) + .build()); + } + return OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + } + + private static ApiTracerFactory createOCTracingFactory(ClientInfo clientInfo) { + return new OpencensusTracerFactory( + ImmutableMap.builder() + // Annotate traces with the same tags as metrics + .put( + RpcMeasureConstants.BIGTABLE_PROJECT_ID.getName(), + clientInfo.getInstanceName().getProjectId()) + .put( + RpcMeasureConstants.BIGTABLE_INSTANCE_ID.getName(), + clientInfo.getInstanceName().getInstanceId()) + .put( + RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID.getName(), clientInfo.getAppProfileId()) + // Also annotate traces with library versions + .put("gax", GaxGrpcProperties.getGaxGrpcVersion()) + .put("grpc", GaxGrpcProperties.getGrpcVersion()) + .put("gapic", Version.VERSION) + .build()); + } + + private static ApiTracerFactory createOCMetricsFactory( + ClientInfo clientInfo, Tagger tagger, StatsRecorder stats) { + + ImmutableMap attributes = + ImmutableMap.builder() + .put( + RpcMeasureConstants.BIGTABLE_PROJECT_ID, + TagValue.create(clientInfo.getInstanceName().getProjectId())) + .put( + RpcMeasureConstants.BIGTABLE_INSTANCE_ID, + TagValue.create(clientInfo.getInstanceName().getInstanceId())) + .put( + RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID, + TagValue.create(clientInfo.getAppProfileId())) + .build(); + return MetricsTracerFactory.create(tagger, stats, attributes); + } + + private static BuiltinMetricsTracerFactory createOtelMetricsFactory( + RecorderRegistry recorder, ClientInfo clientInfo) { + + return BuiltinMetricsTracerFactory.create(recorder, clientInfo); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java new file mode 100644 index 000000000000..4990987ea3bc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider.NoopDirectPathCompatibleTracer; +import com.google.common.collect.ImmutableList; +import io.grpc.Deadline; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Status; +import java.io.IOException; +import java.time.Duration; +import javax.annotation.Nullable; + +public class NoopMetrics implements Metrics { + + @Override + public void start() {} + + @Override + public void close() {} + + @Override + public VRpcTracer newTableTracer( + SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline) { + return NoopVrpcTracer.INSTANCE; + } + + @Override + public SessionTracer newSessionTracer(SessionPoolInfo poolInfo) { + return new NoopSessionTracer(); + } + + @Override + public DirectPathCompatibleTracer getDirectPathCompatibleTracer() { + return NoopDirectPathCompatibleTracer.INSTANCE; + } + + @Override + public DebugTagTracer getDebugTagTracer() { + return NoopDebugTracer.INSTANCE; + } + + @Override + public PoolFallbackListener getPoolFallbackListener() { + return new NoopPoolFallbackListener(); + } + + @Nullable + @Override + public ChannelPoolMetricsTracer getChannelPoolMetricsTracer() { + return null; + } + + @Override + public ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException { + return new CompositeTracerFactory(ImmutableList.of()); + } + + @Override + public > T configureGrpcChannel(T channelBuilder) { + return channelBuilder; + } + + public static class NoopVrpcTracer implements VRpcTracer { + + public static final NoopVrpcTracer INSTANCE = new NoopVrpcTracer(); + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object request) {} + + @Override + public void onRequestSent(PeerInfo peerInfo) {} + + @Override + public void onResponseReceived() {} + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) {} + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) {} + + @Override + public void onOperationFinish(VRpc.VRpcResult result) {} + } + + public static class NoopSessionTracer implements SessionTracer { + + @Override + public void onStart() {} + + @Override + public void onOpen(PeerInfo peerInfo) {} + + @Override + public void onVRpcClose(Status.Code code) {} + + @Override + public void onClose( + PeerInfo peerInfo, CloseSessionRequest.CloseSessionReason reason, Status status) {} + + @Override + public boolean recordAsyncMetrics() { + return false; + } + } + + public static class NoopPoolFallbackListener implements PoolFallbackListener { + @Override + public void onFallback(String from, String to, ChannelFallbackReason reason) {} + } + + public static class NoopDebugTracer extends DebugTagTracer { + public static final NoopDebugTracer INSTANCE = new NoopDebugTracer(); + + @Override + public void record(TelemetryConfiguration.Level level, String tag) {} + + @Override + public void setClientConfigurationManager(ClientConfigurationManager manager) {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java new file mode 100644 index 000000000000..b1d90f593cd1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; + +/** + * A value class to capture parameters that the client was instantiated with. These parameters will + * be used by the Exporter to derive MonitoredResource for GrpcMetrics. + */ +@AutoValue +public abstract class ClientInfo { + /** The name and version of the client. */ + public abstract String getClientName(); + + /** A unique identifier to disambiguate TimeSeries from multiple processes on the same VM. */ + public abstract InstanceName getInstanceName(); + + public abstract String getAppProfileId(); + + public abstract Builder toBuilder(); + + public static Builder builder() { + return new AutoValue_ClientInfo.Builder().setClientName("java-bigtable/" + Version.VERSION); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setClientName(String name); + + public abstract Builder setInstanceName(InstanceName name); + + public abstract Builder setAppProfileId(String appProfileId); + + public abstract ClientInfo build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java new file mode 100644 index 000000000000..e45ea2607f5b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java @@ -0,0 +1,189 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import com.google.auto.value.AutoValue; +import com.google.cloud.opentelemetry.detection.AttributeKeys; +import com.google.cloud.opentelemetry.detection.DetectedPlatform; +import com.google.cloud.opentelemetry.detection.GCPPlatformDetector; +import com.google.common.base.Function; +import com.google.common.base.Splitter; +import com.google.common.base.Supplier; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** + * Environment attributes, lazily extracted by the Exporter. + * + *

The information will be extracted from the GCE metadata service and environment. + */ +@AutoValue +public abstract class EnvInfo { + private static final Logger logger = Logger.getLogger(EnvInfo.class.getName()); + + private static final Map SUPPORTED_PLATFORM_MAP = + ImmutableMap.of( + GCPPlatformDetector.SupportedPlatform.GOOGLE_COMPUTE_ENGINE, "gcp_compute_engine", + GCPPlatformDetector.SupportedPlatform.GOOGLE_KUBERNETES_ENGINE, "gcp_kubernetes_engine"); + + private static final AtomicLong uidSuffix = new AtomicLong(0); + + public abstract String getUid(); + + /** The Google platform running this client. ie. gcp_compute_engine */ + public abstract String getPlatform(); + + /** The Google project that the VM belongs to. */ + public abstract String getProject(); + + /** The geographic region that the VM is located in. */ + public abstract String getRegion(); + + /** The numeric GCE vm instance id. */ + public abstract String getHostId(); + + /** The hostname of the vm or container running the client. For gke, this will be the pod name. */ + public abstract String getHostName(); + + public static Builder builder() { + return new AutoValue_EnvInfo.Builder().setUid(computeUid() + "-" + uidSuffix.getAndIncrement()); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setUid(String uid); + + public abstract Builder setPlatform(String platform); + + public abstract Builder setProject(String project); + + public abstract Builder setRegion(String region); + + public abstract Builder setHostId(String hostId); + + public abstract Builder setHostName(String hostName); + + public abstract EnvInfo build(); + } + + private static String computeUid() { + final String jvmName = ManagementFactory.getRuntimeMXBean().getName(); + // If jvm doesn't have the expected format, fallback to the local hostname + if (jvmName.indexOf('@') < 1) { + String hostname = "localhost"; + try { + hostname = InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + logger.log(Level.INFO, "Unable to get the hostname.", e); + } + // Generate a random number and use the same format "random_number@hostname". + return "java-" + UUID.randomUUID() + "@" + hostname; + } + return "java-" + UUID.randomUUID() + jvmName; + } + + public static EnvInfo detect() { + return detect( + GCPPlatformDetector.DEFAULT_INSTANCE.detectPlatform(), + System::getenv, + () -> { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + }); + } + + @Nullable + static EnvInfo detect( + DetectedPlatform detectedPlatform, + Function envGetter, + Supplier hostnameSupplier) { + @Nullable + String cloud_platform = SUPPORTED_PLATFORM_MAP.get(detectedPlatform.getSupportedPlatform()); + if (cloud_platform == null) { + return EnvInfo.builder() + .setPlatform("unknown") + .setHostName(detectHostname(envGetter, hostnameSupplier)) + .setRegion("global") + .setProject("") + .setHostId("") + .build(); + } + + Map attrs = detectedPlatform.getAttributes(); + ImmutableList locationKeys = + ImmutableList.of( + AttributeKeys.GCE_CLOUD_REGION, + AttributeKeys.GCE_AVAILABILITY_ZONE, + AttributeKeys.GKE_LOCATION_TYPE_REGION, + AttributeKeys.GKE_CLUSTER_LOCATION); + + String region = + locationKeys.stream().map(attrs::get).filter(Objects::nonNull).findFirst().orElse("global"); + + // Deal with possibility of a zone. Zones are of the form us-east1-c, but we want a region + // which, which is us-east1. + region = Splitter.on('-').splitToStream(region).limit(2).collect(Collectors.joining("-")); + + String hostname = attrs.get(AttributeKeys.GCE_INSTANCE_NAME); + // TODO: add support for cloud run & gae by looking at SERVERLESS_COMPUTE_NAME & GAE_MODULE_NAME + if (hostname == null) { + hostname = detectHostname(envGetter, hostnameSupplier); + } + + String hostId = Optional.ofNullable(attrs.get(AttributeKeys.GCE_INSTANCE_ID)).orElse(""); + + return builder() + .setPlatform(cloud_platform) + .setProject(detectedPlatform.getProjectId()) + .setRegion(region) + .setHostId(hostId) + .setHostName(hostname) + .build(); + } + + private static String detectHostname( + Function envGetter, Supplier hostnameSupplier) { + String hostname = envGetter.apply("HOSTNAME"); + + if (hostname == null) { + try { + hostname = hostnameSupplier.get(); + } catch (RuntimeException e) { + logger.log(Level.WARNING, "failed to detect hostname", e); + } + } + if (hostname == null) { + hostname = ""; + } + return hostname; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java new file mode 100644 index 000000000000..59b76077f2aa --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import com.google.auto.value.AutoValue; + +/** Method specific attributes. */ +@AutoValue +public abstract class MethodInfo { + + /** The name of the method. ie "Bigtable.ReadRow" */ + public abstract String getName(); + + /** If the method is streaming (ie a scan). */ + public abstract boolean getStreaming(); + + public static MethodInfo of(String name, boolean streaming) { + return builder().setName(name).setStreaming(streaming).build(); + } + + public static Builder builder() { + return new AutoValue_MethodInfo.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setName(String name); + + public abstract Builder setStreaming(boolean isStreaming); + + public abstract MethodInfo build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java new file mode 100644 index 000000000000..3679fb22ee40 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java @@ -0,0 +1,207 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import com.google.bigtable.v2.AuthorizedViewName; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.MaterializedViewName; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.SampleRowKeysRequest; +import com.google.bigtable.v2.TableName; +import com.google.common.annotations.VisibleForTesting; +import io.grpc.Status; +import java.util.Locale; +import java.util.Optional; +import java.util.concurrent.CancellationException; +import javax.annotation.Nullable; + +public class Util { + public enum IpProtocol { + IPV4("ipv4"), + IPV6("ipv6"), + UNKNOWN("unknown"); + + private final String value; + + IpProtocol(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + static final String TRANSPORT_TYPE_PREFIX = "TRANSPORT_TYPE_"; + + public static String formatTransportRegion(@Nullable PeerInfo peerInfo) { + return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendRegion).orElse(""); + } + + @SuppressWarnings("deprecation") + // TODO: server is still sending back zone instead of region. Update this after server is updated + public static String formatTransportZone(@Nullable PeerInfo peerInfo) { + return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendZone).orElse(""); + } + + public static String formatTransportSubzone(@Nullable PeerInfo peerInfo) { + return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendSubzone).orElse(""); + } + + public static String formatTransportType(@Nullable PeerInfo peerInfo) { + return transportTypeToString( + Optional.ofNullable(peerInfo) + .map(PeerInfo::getTransportType) + .orElse(TransportType.TRANSPORT_TYPE_UNKNOWN)); + } + + public static long formatAfeId(@Nullable PeerInfo peerInfo) { + return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendId).orElse(0L); + } + + public static String transportTypeToString(TransportType transportType) { + String label = transportTypeToStringWithoutFallback(transportType); + if (label != null) { + return label; + } + // In case the client is running with a newer version of protos + if (transportType.name().startsWith(TRANSPORT_TYPE_PREFIX)) { + return transportType + .name() + .substring(TRANSPORT_TYPE_PREFIX.length()) + .toLowerCase(Locale.ENGLISH); + } else { + return transportType.name(); + } + } + + @VisibleForTesting + static String transportTypeToStringWithoutFallback(TransportType transportType) { + if (transportType == null) { + return "null"; + } + switch (transportType) { + case TRANSPORT_TYPE_UNKNOWN: + return "unknown"; + case TRANSPORT_TYPE_EXTERNAL: + return "external"; + case TRANSPORT_TYPE_CLOUD_PATH: + return "cloudpath"; + case TRANSPORT_TYPE_DIRECT_ACCESS: + return "directpath"; + case TRANSPORT_TYPE_SESSION_UNKNOWN: + return "session_unknown"; + case TRANSPORT_TYPE_SESSION_EXTERNAL: + return "session_external"; + case TRANSPORT_TYPE_SESSION_CLOUD_PATH: + return "session_cloudpath"; + case TRANSPORT_TYPE_SESSION_DIRECT_ACCESS: + return "session_directpath"; + case UNRECOGNIZED: + return "unrecognized"; + default: + return null; + } + } + + public static String formatClusterIdMetricLabel(@Nullable ClusterInformation clusterInfo) { + return Optional.ofNullable(clusterInfo) + .map(ClusterInformation::getClusterId) + .filter(s -> !s.isEmpty()) + .orElse(""); + } + + public static String formatZoneIdMetricLabel(@Nullable ClusterInformation clusterInfo) { + return Optional.ofNullable(clusterInfo) + .map(ClusterInformation::getZoneId) + .filter(s -> !s.isEmpty()) + .orElse("global"); + } + + public static Status.Code extractStatus(@Nullable Throwable error) { + if (error == null) { + return Status.Code.OK; + } + // Handle java CancellationException as if it was a gax CancelledException + if (error instanceof CancellationException) { + return Status.Code.CANCELLED; + } + if (error instanceof ApiException) { + ApiException apiException = (ApiException) error; + if (apiException.getStatusCode() instanceof GrpcStatusCode) { + return ((GrpcStatusCode) apiException.getStatusCode()).getTransportCode(); + } + } + + Status s = Status.fromThrowable(error); + if (s != null) { + return s.getCode(); + } + return Status.Code.UNKNOWN; + } + + public static String extractTableId(Object request) { + String tableName = null; + String authorizedViewName = null; + String materializedViewName = null; + if (request instanceof ReadRowsRequest) { + tableName = ((ReadRowsRequest) request).getTableName(); + authorizedViewName = ((ReadRowsRequest) request).getAuthorizedViewName(); + materializedViewName = ((ReadRowsRequest) request).getMaterializedViewName(); + } else if (request instanceof MutateRowsRequest) { + tableName = ((MutateRowsRequest) request).getTableName(); + authorizedViewName = ((MutateRowsRequest) request).getAuthorizedViewName(); + } else if (request instanceof MutateRowRequest) { + tableName = ((MutateRowRequest) request).getTableName(); + authorizedViewName = ((MutateRowRequest) request).getAuthorizedViewName(); + } else if (request instanceof SampleRowKeysRequest) { + tableName = ((SampleRowKeysRequest) request).getTableName(); + authorizedViewName = ((SampleRowKeysRequest) request).getAuthorizedViewName(); + materializedViewName = ((SampleRowKeysRequest) request).getMaterializedViewName(); + } else if (request instanceof CheckAndMutateRowRequest) { + tableName = ((CheckAndMutateRowRequest) request).getTableName(); + authorizedViewName = ((CheckAndMutateRowRequest) request).getAuthorizedViewName(); + } else if (request instanceof ReadModifyWriteRowRequest) { + tableName = ((ReadModifyWriteRowRequest) request).getTableName(); + authorizedViewName = ((ReadModifyWriteRowRequest) request).getAuthorizedViewName(); + } else if (request instanceof GenerateInitialChangeStreamPartitionsRequest) { + tableName = ((GenerateInitialChangeStreamPartitionsRequest) request).getTableName(); + } else if (request instanceof ReadChangeStreamRequest) { + tableName = ((ReadChangeStreamRequest) request).getTableName(); + } + if (tableName != null && !tableName.isEmpty()) { + return TableName.parse(tableName).getTable(); + } + if (authorizedViewName != null && !authorizedViewName.isEmpty()) { + return AuthorizedViewName.parse(authorizedViewName).getTable(); + } + if (materializedViewName != null && !materializedViewName.isEmpty()) { + return MaterializedViewName.parse(materializedViewName).getMaterializedView(); + } + return ""; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java new file mode 100644 index 000000000000..3aa034a51987 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java @@ -0,0 +1,277 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.auth.Credentials; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.MetricServiceSettings; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.Iterables; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.monitoring.v3.CreateTimeSeriesRequest; +import com.google.monitoring.v3.ProjectName; +import com.google.monitoring.v3.TimeSeries; +import com.google.protobuf.Empty; +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.metrics.InstrumentType; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.export.MetricExporter; +import java.io.IOException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +public class BigtableCloudMonitoringExporter implements MetricExporter { + private static final Logger LOGGER = + Logger.getLogger(BigtableCloudMonitoringExporter.class.getName()); + + // This system property can be used to override the monitoring endpoint + // to a different environment. It's meant for internal testing only and + // will be removed in future versions. Use settings in EnhancedBigtableStubSettings + // to override the endpoint. + @Deprecated @Nullable + private static final String MONITORING_ENDPOINT_OVERRIDE_SYS_PROP = + System.getProperty("bigtable.test-monitoring-endpoint"); + + // This the quota limit from Cloud Monitoring. More details in + // https://cloud.google.com/monitoring/quotas#custom_metrics_quotas. + private static final int EXPORT_BATCH_SIZE_LIMIT = 200; + + private final Supplier envInfo; + private final ClientInfo clientInfo; + private final MetricRegistry metricRegistry; + private final MetricServiceClient client; + + private final AtomicReference state; + private AtomicReference lastExportCode = new AtomicReference<>(); + private final AtomicBoolean exportFailureLogged = new AtomicBoolean(false); + + private enum State { + Running, + Closing, + Closed + } + + public static BigtableCloudMonitoringExporter create( + MetricRegistry metricRegistry, + Supplier envInfo, + ClientInfo clientInfo, + @Nullable Credentials credentials, + @Nullable String endpoint, + String universeDomain) + throws IOException { + + Preconditions.checkNotNull(universeDomain); + + MetricServiceSettings.Builder settingsBuilder = + MetricServiceSettings.newBuilder() + .setUniverseDomain(universeDomain) + .setCredentialsProvider( + Optional.ofNullable(credentials) + .map(FixedCredentialsProvider::create) + .orElse(NoCredentialsProvider.create())); + + if (MONITORING_ENDPOINT_OVERRIDE_SYS_PROP != null) { + LOGGER.warning( + "Setting the monitoring endpoint through system variable will be removed in future" + + " versions"); + settingsBuilder.setEndpoint(MONITORING_ENDPOINT_OVERRIDE_SYS_PROP); + } + + if (endpoint != null) { + settingsBuilder.setEndpoint(endpoint); + } + + Duration timeout = Duration.ofMinutes(1); + // TODO: createServiceTimeSeries needs special handling if the request failed. Leaving + // it as not retried for now. + settingsBuilder.createServiceTimeSeriesSettings().setSimpleTimeoutNoRetriesDuration(timeout); + + return new BigtableCloudMonitoringExporter( + metricRegistry, envInfo, clientInfo, MetricServiceClient.create(settingsBuilder.build())); + } + + @VisibleForTesting + public BigtableCloudMonitoringExporter( + MetricRegistry metricRegistry, + Supplier envInfo, + ClientInfo clientInfo, + MetricServiceClient client) { + this.metricRegistry = metricRegistry; + this.envInfo = envInfo; + this.clientInfo = clientInfo; + this.client = client; + this.state = new AtomicReference<>(State.Running); + } + + @Override + public void close() { + client.close(); + } + + @Override + public CompletableResultCode export(Collection metricData) { + Preconditions.checkState(state.get() != State.Closed, "Exporter is closed"); + + CompletableResultCode result = doExport(metricData); + lastExportCode.set(result); + return result; + } + + private CompletableResultCode doExport(Collection metricData) { + Map> converted; + + try { + converted = new Converter(metricRegistry, envInfo.get(), clientInfo).convertAll(metricData); + } catch (Throwable t) { + if (exportFailureLogged.compareAndSet(false, true)) { + LOGGER.log(Level.WARNING, "Failed to compose metrics for export", t); + } + + return CompletableResultCode.ofExceptionalFailure(t); + } + + List> futures = new ArrayList<>(); + + for (Entry> e : converted.entrySet()) { + futures.addAll(exportTimeSeries(e.getKey(), e.getValue())); + } + + CompletableResultCode exportCode = new CompletableResultCode(); + + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + + ApiFutures.addCallback( + ApiFutures.allAsList(futures), + new ApiFutureCallback>() { + @Override + public void onFailure(Throwable throwable) { + if (exportFailureLogged.compareAndSet(false, true)) { + String msg = "createServiceTimeSeries request failed"; + if (throwable instanceof PermissionDeniedException) { + msg += + String.format( + " Need monitoring metric writer permission on project=%s. Follow" + + " https://cloud.google.com/bigtable/docs/client-side-metrics-setup" + + " to set up permissions.", + clientInfo.getInstanceName().getProjectId()); + } + RuntimeException asyncWrapper = new RuntimeException("export failed", throwable); + asyncWrapper.setStackTrace(stackTrace); + + if (state.get() != State.Closing && state.get() != State.Closed) { + // ignore the export warning when client is shutting down + LOGGER.log(Level.WARNING, msg, asyncWrapper); + } + } + exportCode.fail(); + } + + @Override + public void onSuccess(List objects) { + exportFailureLogged.set(false); + exportCode.succeed(); + } + }, + MoreExecutors.directExecutor()); + return exportCode; + } + + private List> exportTimeSeries( + ProjectName projectName, Collection timeSeries) { + List> batchResults = new ArrayList<>(); + + for (List batch : Iterables.partition(timeSeries, EXPORT_BATCH_SIZE_LIMIT)) { + CreateTimeSeriesRequest req = + CreateTimeSeriesRequest.newBuilder() + .setName(projectName.toString()) + .addAllTimeSeries(batch) + .build(); + ApiFuture f = this.client.createServiceTimeSeriesCallable().futureCall(req); + batchResults.add(f); + } + + return batchResults; + } + + @Override + public CompletableResultCode flush() { + if (lastExportCode.get() != null) { + return lastExportCode.get(); + } + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode shutdown() { + State prevState = state.getAndSet(State.Closed); + if (prevState == State.Closed) { + LOGGER.log(Level.WARNING, "shutdown is called multiple times"); + return CompletableResultCode.ofSuccess(); + } + CompletableResultCode flushResult = flush(); + CompletableResultCode shutdownResult = new CompletableResultCode(); + flushResult.whenComplete( + () -> { + Throwable throwable = null; + try { + client.shutdown(); + } catch (Throwable e) { + LOGGER.log(Level.WARNING, "failed to shutdown the monitoring client", e); + throwable = e; + } + if (throwable != null) { + shutdownResult.fail(); + } else { + shutdownResult.succeed(); + } + }); + + return CompletableResultCode.ofAll(Arrays.asList(flushResult, shutdownResult)); + } + + @Override + public AggregationTemporality getAggregationTemporality(InstrumentType instrumentType) { + return AggregationTemporality.CUMULATIVE; + } + + public void prepareForShutdown() { + state.compareAndSet(State.Running, State.Closing); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableFilteringExporter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableFilteringExporter.java new file mode 100644 index 000000000000..9b6963c33c03 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableFilteringExporter.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.metrics.InstrumentType; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.export.MetricExporter; +import java.util.Collection; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +public class BigtableFilteringExporter implements MetricExporter { + + private MetricExporter delegate; + private Predicate filter; + + public BigtableFilteringExporter(MetricExporter exporter, Predicate filter) { + this.delegate = exporter; + this.filter = filter; + } + + @Override + public CompletableResultCode export(Collection metrics) { + List filtered = metrics.stream().filter(filter).collect(Collectors.toList()); + return delegate.export(filtered); + } + + @Override + public CompletableResultCode flush() { + return delegate.flush(); + } + + @Override + public CompletableResultCode shutdown() { + return delegate.shutdown(); + } + + public void prepareForShutdown() { + if (delegate instanceof BigtableCloudMonitoringExporter) { + ((BigtableCloudMonitoringExporter) delegate).prepareForShutdown(); + } + } + + @Override + public AggregationTemporality getAggregationTemporality(InstrumentType instrumentType) { + return delegate.getAggregationTemporality(instrumentType); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtablePeriodicReader.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtablePeriodicReader.java new file mode 100644 index 000000000000..02c750657682 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtablePeriodicReader.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.common.export.MemoryMode; +import io.opentelemetry.sdk.metrics.Aggregation; +import io.opentelemetry.sdk.metrics.InstrumentType; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector; +import io.opentelemetry.sdk.metrics.export.CollectionRegistration; +import io.opentelemetry.sdk.metrics.export.DefaultAggregationSelector; +import io.opentelemetry.sdk.metrics.export.MetricReader; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import java.io.IOException; +import java.util.concurrent.ScheduledExecutorService; + +/** + * Wrapper around a {@link PeriodicMetricReader} that will notify the exporter when it's shutting + * down. This is necessary to filter out noisy error logs on shutdown. + */ +public class BigtablePeriodicReader implements MetricReader { + private final MetricReader delegate; + private final BigtableFilteringExporter exporter; + + public BigtablePeriodicReader( + BigtableFilteringExporter exporter, ScheduledExecutorService executor) { + delegate = PeriodicMetricReader.builder(exporter).setExecutor(executor).build(); + this.exporter = exporter; + } + + @Override + public void register(CollectionRegistration registration) { + delegate.register(registration); + } + + @Override + public Aggregation getDefaultAggregation(InstrumentType instrumentType) { + return delegate.getDefaultAggregation(instrumentType); + } + + @Override + public MemoryMode getMemoryMode() { + return delegate.getMemoryMode(); + } + + @Override + public CompletableResultCode forceFlush() { + return delegate.forceFlush(); + } + + @Override + public CompletableResultCode shutdown() { + exporter.prepareForShutdown(); + return delegate.shutdown(); + } + + @Override + public void close() throws IOException { + delegate.close(); + } + + public static AggregationTemporalitySelector alwaysCumulative() { + return AggregationTemporalitySelector.alwaysCumulative(); + } + + public static AggregationTemporalitySelector deltaPreferred() { + return AggregationTemporalitySelector.deltaPreferred(); + } + + public static AggregationTemporalitySelector lowMemory() { + return AggregationTemporalitySelector.lowMemory(); + } + + @Override + public AggregationTemporality getAggregationTemporality(InstrumentType instrumentType) { + return delegate.getAggregationTemporality(instrumentType); + } + + public static String asString(AggregationTemporalitySelector selector) { + return AggregationTemporalitySelector.asString(selector); + } + + public static DefaultAggregationSelector getDefault() { + return DefaultAggregationSelector.getDefault(); + } + + @Override + public DefaultAggregationSelector with(InstrumentType instrumentType, Aggregation aggregation) { + return delegate.with(instrumentType, aggregation); + } + + public static String asString(DefaultAggregationSelector selector) { + return DefaultAggregationSelector.asString(selector); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java new file mode 100644 index 000000000000..cbb9cd37012b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java @@ -0,0 +1,220 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import static com.google.api.MetricDescriptor.MetricKind.CUMULATIVE; +import static com.google.api.MetricDescriptor.MetricKind.GAUGE; +import static com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED; +import static com.google.api.MetricDescriptor.ValueType.DISTRIBUTION; +import static com.google.api.MetricDescriptor.ValueType.DOUBLE; +import static com.google.api.MetricDescriptor.ValueType.INT64; + +import com.google.api.Distribution; +import com.google.api.Distribution.BucketOptions; +import com.google.api.Distribution.BucketOptions.Explicit; +import com.google.api.Metric; +import com.google.api.MetricDescriptor.MetricKind; +import com.google.api.MetricDescriptor.ValueType; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.MetricWrapper; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import com.google.monitoring.v3.Point; +import com.google.monitoring.v3.ProjectName; +import com.google.monitoring.v3.TimeInterval; +import com.google.monitoring.v3.TimeSeries; +import com.google.monitoring.v3.TypedValue; +import com.google.protobuf.util.Timestamps; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.HistogramData; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.metrics.data.SumData; +import java.util.Collection; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Helper for exporting metrics from Opentelemetry to Cloud Monitoring. + * + *

Takes collection {@link MetricData} and uses the {@link MetricWrapper}s defined in {@link + * MetricRegistry} to compose both the {@link com.google.api.MonitoredResource} and {@link Point}. + */ +class Converter { + private static final Logger LOGGER = Logger.getLogger(Converter.class.getName()); + + private final MetricRegistry metricRegistry; + private final EnvInfo envInfo; + private final ClientInfo clientInfo; + + Converter(MetricRegistry metricRegistry, EnvInfo envInfo, ClientInfo clientInfo) { + this.metricRegistry = metricRegistry; + this.envInfo = envInfo; + this.clientInfo = clientInfo; + } + + Map> convertAll(Collection otelMetrics) { + ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); + + for (MetricData metricData : otelMetrics) { + Multimap perProject = convertMetricData(metricData); + builder.putAll(perProject); + } + return builder.build().asMap(); + } + + private Multimap convertMetricData(MetricData metricData) { + MetricWrapper metricDef = metricRegistry.getMetric(metricData.getName()); + if (metricDef == null) { + LOGGER.log(Level.FINE, "Skipping unexpected metric: {}", metricData.getName()); + return ImmutableListMultimap.of(); + } + + ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); + MetricKind metricKind = convertMetricKind(metricData); + for (PointData pd : metricData.getData().getPoints()) { + ProjectName projectName = + metricDef.getSchema().extractProjectName(pd.getAttributes(), envInfo, clientInfo); + + TimeSeries timeSeries = + TimeSeries.newBuilder() + .setMetricKind(metricKind) + .setValueType(convertValueType(metricData.getType())) + .setResource( + metricDef + .getSchema() + .extractMonitoredResource(pd.getAttributes(), envInfo, clientInfo)) + .setMetric( + Metric.newBuilder() + .setType(metricDef.getExternalName()) + .putAllLabels( + metricDef.extractMetricLabels(pd.getAttributes(), envInfo, clientInfo))) + .addPoints(convertPointData(metricData.getType(), pd, metricKind)) + .build(); + + builder.put(projectName, timeSeries); + } + return builder.build(); + } + + private Point convertPointData(MetricDataType type, PointData pointData, MetricKind metricKind) { + long startNanos = + metricKind == GAUGE ? pointData.getEpochNanos() : pointData.getStartEpochNanos(); + + TimeInterval timeInterval = + TimeInterval.newBuilder() + .setStartTime(Timestamps.fromNanos(startNanos)) + .setEndTime(Timestamps.fromNanos(pointData.getEpochNanos())) + .build(); + + Point.Builder builder = Point.newBuilder().setInterval(timeInterval); + switch (type) { + case HISTOGRAM: + case EXPONENTIAL_HISTOGRAM: + return builder + .setValue( + TypedValue.newBuilder() + .setDistributionValue(convertHistogramData((HistogramPointData) pointData)) + .build()) + .build(); + case DOUBLE_GAUGE: + case DOUBLE_SUM: + return builder + .setValue( + TypedValue.newBuilder() + .setDoubleValue(((DoublePointData) pointData).getValue()) + .build()) + .build(); + case LONG_GAUGE: + case LONG_SUM: + return builder + .setValue(TypedValue.newBuilder().setInt64Value(((LongPointData) pointData).getValue())) + .build(); + default: + LOGGER.log(Level.WARNING, "unsupported metric type %s", type); + return builder.build(); + } + } + + private static Distribution convertHistogramData(HistogramPointData pointData) { + return Distribution.newBuilder() + .setCount(pointData.getCount()) + .setMean(pointData.getCount() == 0L ? 0.0D : pointData.getSum() / pointData.getCount()) + .setBucketOptions( + BucketOptions.newBuilder() + .setExplicitBuckets(Explicit.newBuilder().addAllBounds(pointData.getBoundaries()))) + .addAllBucketCounts(pointData.getCounts()) + .build(); + } + + private static MetricKind convertMetricKind(MetricData metricData) { + switch (metricData.getType()) { + case HISTOGRAM: + case EXPONENTIAL_HISTOGRAM: + return convertHistogramType(metricData.getHistogramData()); + case LONG_GAUGE: + case DOUBLE_GAUGE: + return GAUGE; + case LONG_SUM: + return convertSumDataType(metricData.getLongSumData()); + case DOUBLE_SUM: + return convertSumDataType(metricData.getDoubleSumData()); + default: + return UNRECOGNIZED; + } + } + + private static MetricKind convertHistogramType(HistogramData histogramData) { + if (histogramData.getAggregationTemporality() == AggregationTemporality.CUMULATIVE) { + return CUMULATIVE; + } + return UNRECOGNIZED; + } + + private static MetricKind convertSumDataType(SumData sum) { + if (!sum.isMonotonic()) { + return GAUGE; + } + if (sum.getAggregationTemporality() == AggregationTemporality.CUMULATIVE) { + return CUMULATIVE; + } + return UNRECOGNIZED; + } + + private static ValueType convertValueType(MetricDataType metricDataType) { + switch (metricDataType) { + case LONG_GAUGE: + case LONG_SUM: + return INT64; + case DOUBLE_GAUGE: + case DOUBLE_SUM: + return DOUBLE; + case HISTOGRAM: + case EXPONENTIAL_HISTOGRAM: + return DISTRIBUTION; + default: + return ValueType.UNRECOGNIZED; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlFactor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlFactor.java new file mode 100644 index 000000000000..c4c6d9711829 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlFactor.java @@ -0,0 +1,69 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleGauge; +import io.opentelemetry.api.metrics.Meter; + +public class ClientBatchWriteFlowControlFactor extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/batch_write_flow_control_factor"; + + public ClientBatchWriteFlowControlFactor() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleGauge instrument; + + private Recorder(Meter meter) { + this.instrument = + meter + .gaugeBuilder(NAME) + .setDescription( + "The distribution of batch write flow control factors received from the server.") + .setUnit("1") + .build(); + } + + public void record( + ClientInfo clientInfo, + Status.Code code, + boolean applied, + MethodInfo methodInfo, + double factor) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.APPLIED_KEY, applied) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .build(); + + instrument.set(factor, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlTargetQps.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlTargetQps.java new file mode 100644 index 000000000000..a15189aa4a04 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlTargetQps.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleGauge; +import io.opentelemetry.api.metrics.Meter; + +public class ClientBatchWriteFlowControlTargetQps extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/batch_write_flow_control_target_qps"; + + public ClientBatchWriteFlowControlTargetQps() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleGauge instrument; + + private Recorder(Meter meter) { + this.instrument = + meter + .gaugeBuilder(NAME) + .setDescription( + "The current target QPS of the client under batch write flow control.") + .setUnit("1") + .build(); + } + + public void record(ClientInfo clientInfo, MethodInfo methodInfo, double qps) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .build(); + + instrument.set(qps, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java new file mode 100644 index 000000000000..1a5a5b312230 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener.ChannelFallbackReason; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; + +public class ClientChannelPoolFallbackCount extends MetricWrapper { + + private static final String NAME = + "bigtable.googleapis.com/internal/client/channel_fallback_count"; + private static final AttributeKey FROM_KEY = AttributeKey.stringKey("from"); + private static final AttributeKey TO_KEY = AttributeKey.stringKey("to"); + private static final AttributeKey REASON_KEY = AttributeKey.stringKey("reason"); + + public ClientChannelPoolFallbackCount() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongCounter instrument; + + private Recorder(Meter meter) { + instrument = + meter + .counterBuilder(NAME) + .setDescription("Number of fallback occurrences.") + .setUnit(Units.COUNT) + .build(); + } + + public void record( + ClientInfo clientInfo, long count, String from, String to, ChannelFallbackReason reason) { + Attributes attrs = + getSchema() + .createResourceAttrs(clientInfo) + .put(FROM_KEY, from) + .put(TO_KEY, to) + .put(REASON_KEY, reason.name()) + .build(); + instrument.add(count, attrs); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolOutstandingRpcs.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolOutstandingRpcs.java new file mode 100644 index 000000000000..c5c1589c4fda --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolOutstandingRpcs.java @@ -0,0 +1,79 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings.LoadBalancingStrategy; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.util.List; +import java.util.stream.Collectors; + +public class ClientChannelPoolOutstandingRpcs extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/connection_pool/outstanding_rpcs"; + + private static final List BUCKETS = + Buckets.generateLinearSeq(0d, 200d, 5).stream() + .map(Double::longValue) + .collect(Collectors.toList()); + + public ClientChannelPoolOutstandingRpcs() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + this.instrument = + meter + .histogramBuilder(NAME) + .ofLongs() + .setExplicitBucketBoundariesAdvice(BUCKETS) + .setDescription( + "A distribution of the number of outstanding RPCs per connection in the client" + + " pool, sampled periodically.") + .setUnit("1") + .build(); + } + + public void record( + ClientInfo clientInfo, + TransportType transportType, + LoadBalancingStrategy lbPolicy, + boolean isStreaming, + long rpcCount) { + instrument.record( + rpcCount, + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.TRANSPORT_TYPE, Util.transportTypeToString(transportType)) + .put(MetricLabels.CHANNEL_POOL_LB_POLICY, lbPolicy.name()) + .put(MetricLabels.STREAMING_KEY, isStreaming) + .build()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java new file mode 100644 index 000000000000..3abdc751c2ca --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; + +public class ClientDebugTagCount extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/debug_tags"; + + public ClientDebugTagCount() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongCounter instrument; + + private Recorder(Meter meter) { + instrument = + meter + .counterBuilder(NAME) + .setDescription("A counter of internal client events used for debugging.") + .setUnit(Units.COUNT) + .build(); + } + + public void record(ClientInfo clientInfo, String tag, long amount) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + .put(MetricLabels.DEBUG_TAG_KEY, tag) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .build(); + instrument.add(amount, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDpCompatGuage.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDpCompatGuage.java new file mode 100644 index 000000000000..90715a5e5c3a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDpCompatGuage.java @@ -0,0 +1,75 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; +import io.opentelemetry.api.metrics.LongGauge; +import io.opentelemetry.api.metrics.Meter; + +public class ClientDpCompatGuage extends MetricWrapper { + private static final String NAME = + "bigtable.googleapis.com/internal/client/direct_access/compatible"; + + public ClientDpCompatGuage() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongGauge instrument; + + private Recorder(Meter meter) { + this.instrument = + meter + .gaugeBuilder(NAME) + .ofLongs() + .setDescription( + "Reports 1 if the environment is eligible for DirectPath, 0 otherwise. Based on" + + " an attempt at startup.") + .setUnit("1") + .build(); + } + + // TODO: replace ipPreference with an enum + public void recordSuccess(ClientInfo clientInfo, String ipPreference) { + instrument.set( + 1, + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.DP_REASON_KEY, "") + .put(MetricLabels.DP_IP_PREFERENCE_KEY, ipPreference) + .build()); + } + + // TODO: replace reason with an enum + public void recordFailure( + ClientInfo clientInfo, DirectAccessInvestigator.FailureReason reason) { + instrument.set( + 0, + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.DP_REASON_KEY, reason.getValue()) + .put(MetricLabels.DP_IP_PREFERENCE_KEY, "") + .build()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java new file mode 100644 index 000000000000..6637795e2309 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.util.List; +import java.util.Set; + +public class ClientPerConnectionErrorCount extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/per_connection_error_count"; + + static final List BUCKETS = + ImmutableList.builder() + .add(0L) + .addAll(Buckets.generateGeometricSeq(1, 64)) + .addAll(Buckets.generateGeometricSeq(125, 1_000_000L)) + .build(); + + // This metric migrated from gce/gke schemas to bigtable_client + // So a lot of the metric labels overlap with the resource labels. + // we need special handling since the logic in MetricWrapper assumes that there is no + // overlap. + @SuppressWarnings("deprecation") + private static final Set> METRIC_LABELS = + ImmutableSet.of( + MetricLabels.BIGTABLE_PROJECT_ID_KEY, + MetricLabels.CLIENT_UID, + MetricLabels.INSTANCE_ID_KEY, + MetricLabels.CLIENT_NAME, + MetricLabels.APP_PROFILE_KEY); + + public ClientPerConnectionErrorCount() { + super(ClientSchema.INSTANCE, NAME); + } + + // Override the default metric labels to account for backwards compatibility. + // This metric used to live under bigtable_table, and has moved to bigtable_client + // The new schema duplicates some of the metric labels. However the default implementation + // in MetricWrapper will remove all resource labels from the metric labels. + // To maintain backwards compatibility, this metric override the extractMetricLabels + // to always emit the duplicate metric labels. + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + metricAttrs.forEach( + (k, v) -> { + if (METRIC_LABELS.contains(k) && v != null) { + builder.put(k.getKey(), v.toString()); + } + }); + builder.put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()); + return builder.build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .ofLongs() + .setDescription("Distribution of counts of channels per 'error count per minute'.") + .setUnit("1") + .setExplicitBucketBoundariesAdvice(BUCKETS) + .build(); + } + + public void record(ClientInfo clientInfo, long value) { + @SuppressWarnings("deprecation") + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo) + .put( + MetricLabels.BIGTABLE_PROJECT_ID_KEY, clientInfo.getInstanceName().getProjectId()) + .put(MetricLabels.INSTANCE_ID_KEY, clientInfo.getInstanceName().getInstanceId()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .build(); + instrument.record(value, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java new file mode 100644 index 000000000000..0a51ad16d315 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class ClientSessionDuration extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/session/durations"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .add(0L) + .addAll(Buckets.generateGeometricSeq(1, TimeUnit.MINUTES.toMillis(20))) + .build() + .asList(); + + public enum SessionCloseVRpcState { + None("none", false, false), + SomeOk("some_ok", true, true), + AllOk("all_ok", true, false), + AllError("all_error", false, true); + + private final String label; + private final boolean hasOk; + private final boolean hasError; + + SessionCloseVRpcState(String label, boolean hasOk, boolean hasError) { + this.label = label; + this.hasOk = hasOk; + this.hasError = hasError; + } + + public static SessionCloseVRpcState find(boolean hasOk, boolean hasError) { + for (SessionCloseVRpcState v : SessionCloseVRpcState.values()) { + if (v.hasOk == hasOk && v.hasError == hasError) { + return v; + } + } + throw new IllegalStateException( + String.format( + "Failed to find SessionCloseVRpcState variant for hasOk: %b, hasError: %b", + hasOk, hasError)); + } + } + + public ClientSessionDuration() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency for establishing a new session") + .setUnit(Units.MILLISECOND) + .ofLongs() + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, + @Nullable PeerInfo peerInfo, + Status.Code code, + CloseSessionReason closeReason, + SessionCloseVRpcState vrpcState, + boolean isReady, + Duration latency) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + // metric specific + .put(MetricLabels.SESSION_READY_KEY, isReady) + .put(MetricLabels.STATUS_KEY, code.name()) // gRPC stream status + .put(MetricLabels.REASON_KEY, closeReason.name()) + .put(MetricLabels.VRPCS_KEY, vrpcState.label) + .build(); + + instrument.record((long) toMillis(latency), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java new file mode 100644 index 000000000000..a8fc77e4cb20 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +public class ClientSessionOpenLatency extends MetricWrapper { + private static final String NAME = + "bigtable.googleapis.com/internal/client/session/open_latencies"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .addAll(Buckets.generateLinearSeq(0, 3, 0.1)) + .addAll(Buckets.generateLinearSeq(3, 9, 1)) + .addAll( + Buckets.generateGeometricSeq(10, TimeUnit.MINUTES.toMillis(5)).stream() + .map(Long::doubleValue) + .collect(Collectors.toList())) + .build() + .asList(); + + public ClientSessionOpenLatency() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency for establishing a new session") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, @Nullable PeerInfo peerInfo, Status.Code code, Duration latency) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + // metric specific + .put(MetricLabels.STATUS_KEY, code.name()) + .build(); + + instrument.record(toMillis(latency), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java new file mode 100644 index 000000000000..1a0acb1bf879 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class ClientSessionUptime extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/session/uptime"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .add(0L) + .addAll(Buckets.generateGeometricSeq(1, TimeUnit.MINUTES.toMillis(20))) + .build() + .asList(); + + public ClientSessionUptime() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("A distribution age of all active sessions") + .setUnit(Units.MILLISECOND) + .ofLongs() + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, @Nullable PeerInfo peerInfo, boolean isReady, Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + .put(MetricLabels.SESSION_READY_KEY, isReady) + .build(); + + instrument.record((long) toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java new file mode 100644 index 000000000000..9ff2d25000d5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java @@ -0,0 +1,75 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class ClientTransportLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/transport_latencies"; + + public ClientTransportLatency() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("The latency measured from e2e latencies minus node latencies.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, + @Nullable PeerInfo peerInfo, + MethodInfo methodInfo, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java new file mode 100644 index 000000000000..010dbfc3df85 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java @@ -0,0 +1,130 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.common.collect.ImmutableList; +import io.opentelemetry.api.common.AttributeKey; +import java.util.ArrayList; +import java.util.List; + +public final class Constants { + private Constants() {} + + public static final class MetricLabels { + private MetricLabels() {} + + // TODO: remove overlapping attributes + // Project & Instance overlap with resource labels because they were migrated from + // an old gce/gke schema to support per_connection_error_count metric + @Deprecated + public static final AttributeKey BIGTABLE_PROJECT_ID_KEY = + AttributeKey.stringKey("project_id"); + + @Deprecated + public static final AttributeKey INSTANCE_ID_KEY = AttributeKey.stringKey("instance"); + + public static final AttributeKey TRANSPORT_TYPE = + AttributeKey.stringKey("transport_type"); + public static final AttributeKey TRANSPORT_REGION = + AttributeKey.stringKey("transport_region"); + public static final AttributeKey TRANSPORT_ZONE = + AttributeKey.stringKey("transport_zone"); + public static final AttributeKey TRANSPORT_SUBZONE = + AttributeKey.stringKey("transport_subzone"); + + public static final AttributeKey CLIENT_UID = AttributeKey.stringKey("client_uid"); + public static final AttributeKey CLIENT_NAME = AttributeKey.stringKey("client_name"); + public static final AttributeKey METHOD_KEY = AttributeKey.stringKey("method"); + public static final AttributeKey STREAMING_KEY = AttributeKey.booleanKey("streaming"); + public static final AttributeKey APP_PROFILE_KEY = + AttributeKey.stringKey("app_profile"); + public static final AttributeKey DEBUG_TAG_KEY = AttributeKey.stringKey("tag"); + + public static final AttributeKey APPLIED_KEY = AttributeKey.booleanKey("applied"); + + static final AttributeKey CHANNEL_POOL_LB_POLICY = AttributeKey.stringKey("lb_policy"); + static final AttributeKey DP_REASON_KEY = AttributeKey.stringKey("reason"); + static final AttributeKey DP_IP_PREFERENCE_KEY = + AttributeKey.stringKey("ip_preference"); + + static final AttributeKey SESSION_TYPE_KEY = AttributeKey.stringKey("session_type"); + static final AttributeKey SESSION_NAME = AttributeKey.stringKey("session_name"); + static final AttributeKey AFE_LOCATION_KEY = AttributeKey.stringKey("afe_location"); + + static final AttributeKey REASON_KEY = AttributeKey.stringKey("closing_reason"); + static final AttributeKey VRPCS_KEY = AttributeKey.stringKey("vrpcs"); + static final AttributeKey SESSION_READY_KEY = AttributeKey.booleanKey("ready"); + + public static final AttributeKey STATUS_KEY = AttributeKey.stringKey("status"); + + static final AttributeKey EXECUTOR_KEY = AttributeKey.stringKey("executor"); + } + + static final class Units { + private Units() {} + + static final String MILLISECOND = "ms"; + static final String MICROSECOND = "us"; + static final String COUNT = "1"; + } + + static final class Buckets { + static final List AGGREGATION_WITH_MILLIS_HISTOGRAM = + ImmutableList.builder() + // Match `bigtable.googleapis.com/frontend_server/handler_latencies` buckets + .addAll(generateLinearSeq(0, 3.0, 0.1)) + .add(4.0, 5.0, 6.0, 8.0, 10.0, 13.0, 16.0, 20.0, 25.0, 30.0, 40.0, 50.0, 65.0, 80.0) + .add(100.0, 130.0, 160.0, 200.0, 250.0, 300.0, 400.0, 500.0, 650.0, 800.0, 900.0) + .add(1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 10000.0, 20000.0, 50000.0) + .add(100000.0, 200000.0, 500000.0, 1000000.0, 2000000.0, 5000000.0) + .build(); + + @SuppressWarnings("SameParameterValue") + static List generateLinearSeq(double start, double end, double increment) { + ImmutableList.Builder builder = ImmutableList.builder(); + for (int i = 0; true; i++) { + double next = start + (increment * i); + if (next > end) { + break; + } + builder.add(next); + } + + return builder.build(); + } + + @SuppressWarnings("SameParameterValue") + static List generateExponentialSeq(double start, int count, double factor) { + List buckets = new ArrayList<>(); + + for (int i = 0; i < count; i++) { + buckets.add(start); + start *= factor; + } + + return buckets; + } + + static List generateGeometricSeq(long startClose, long endClosed) { + ImmutableList.Builder builder = ImmutableList.builder(); + for (long i = startClose; i <= endClosed; i *= 2) { + builder.add(i); + } + return builder.build(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/CustomAttemptLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/CustomAttemptLatency.java new file mode 100644 index 000000000000..453b3957a1fc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/CustomAttemptLatency.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.CustomSchema; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +/** + * Custom attempt latencies with afe id metric label. This metric is high cardinality and is + * exported as a custom metric. + */ +public class CustomAttemptLatency extends MetricWrapper { + private static final String NAME = "bigtable.custom.attempt_latencies"; + + public CustomAttemptLatency() { + super(CustomSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public static class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency per RPC attempt.") + .setUnit(Constants.Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice( + Constants.Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + @Nullable PeerInfo peerInfo, + @Nullable ClusterInformation clusterInfo, + MethodInfo methodInfo, + Status.Code code, + Duration latency) { + + Attributes attributes = + Attributes.builder() + .put( + Constants.MetricLabels.BIGTABLE_PROJECT_ID_KEY, + clientInfo.getInstanceName().getProjectId()) + .put( + Constants.MetricLabels.INSTANCE_ID_KEY, + clientInfo.getInstanceName().getInstanceId()) + .put("table", tableId) + .put(Constants.MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put("cluster", Util.formatClusterIdMetricLabel(clusterInfo)) + .put("zone", Util.formatZoneIdMetricLabel(clusterInfo)) + .put(Constants.MetricLabels.STATUS_KEY, code.name()) + .put(Constants.MetricLabels.METHOD_KEY, methodInfo.getName()) + .put("afe_id", Util.formatAfeId(peerInfo)) + .build(); + + instrument.record(toMillis(latency), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java new file mode 100644 index 000000000000..517ab454e806 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.GrpcClientSchema; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import java.util.List; + +/** + * Base class for gRpc metrics that are exported using bigtable_client schema. + * + *

gRPC doesn't record the bigtable specific metric labels, so they must be passed to the + * exporter via a side channel. + */ +public class GrpcMetric extends MetricWrapper { + public static final String METER_SCOPE = "grpc-java"; + + private final List> metricKeys; + + public GrpcMetric(String name, List metricKeys) { + super(GrpcClientSchema.INSTANCE, name); + this.metricKeys = + metricKeys.stream().map(AttributeKey::stringKey).collect(ImmutableList.toImmutableList()); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo ignored1, ClientInfo ignored2) { + ImmutableMap.Builder attributes = ImmutableMap.builder(); + + for (AttributeKey key : metricKeys) { + String newKeyName = key.getKey().replace('.', '_'); + Object value = metricAttrs.get(key); + if (value != null) { + attributes.put(newKeyName, value.toString()); + } + } + + return attributes.build(); + } + + @Override + public String getExternalName() { + return "bigtable.googleapis.com/internal/client/" + getName().replace('.', '/'); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java new file mode 100644 index 000000000000..3947d3e680d4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.api.MonitoredResource; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.Schema; +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.common.Attributes; +import java.time.Duration; +import java.util.concurrent.TimeUnit; + +/** + * Base class for all the metrics. + * + *

Each metric is composed of an OpenTelemetry instrument (ie histogram), and a set of resource + * and metric attributes. Since some of the resource attributes are dynamic, all the resource + * attributes are sent to the instrument as metric {@link Attributes}. Then during the export phase, + * a {@link MonitoredResource} and a set of metric labels are extracted from the collected + * attributes. + * + *

This base class implements the foundation of this lifecycle: + * + *

    + *
  • The instrument for recording is passed in during construction + *
  • The concrete subclass will define a metric specific typesafe record method to populate the + * metric labels for the instrument + *
  • The list of resource attribute keys are defined by a resource specific subclass and passed + * in during construction. These will be used by {@code MetricWrapper.createMonitoredResource} + * to create the monitored resource during the export phase + *
  • The remaining attributes will be added as metric labels + *
+ */ +public abstract class MetricWrapper { + private final SchemaT schema; + private final String name; + + public MetricWrapper(SchemaT schema, String name) { + this.schema = schema; + this.name = name; + } + + public SchemaT getSchema() { + return schema; + } + + /** + * Used by the Exporter to compose metric labels to be sent to Cloud Monitoring. + * + *

Extracts metric labels from metric {@link Attributes}. By default, all keys that are not + * listed in {@code resourceKeys} are extracted. However, subclasses can override this method to + * inject data from {@link EnvInfo} and {@link ClientInfo}. + */ + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + metricAttrs.forEach( + (k, v) -> { + if (!getSchema().getResourceKeys().contains(k) && v != null) { + builder.put(k.getKey(), v.toString()); + } + }); + return builder.build(); + } + + /** + * Used by the Exporter to match an instance of this class to the aggregated timeseries to export. + * + *

Gets the name of the metric. This is used by the exporter to look up this metric definition + * in MetricRegistry during export. + */ + public String getName() { + return name; + } + + /** + * Used by the exporter to post process the metric name from grpc conventions to Cloud Monitoring. + */ + public String getExternalName() { + return getName(); + } + + /** Converts a duration in fractional milliseconds. */ + protected static double toMillis(Duration duration) { + return Math.round(((double) duration.toNanos()) / TimeUnit.MILLISECONDS.toNanos(1) * 100.0) + / 100.0; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/PacemakerDelay.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/PacemakerDelay.java new file mode 100644 index 000000000000..ec081f2afd35 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/PacemakerDelay.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.common.collect.ImmutableList; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; + +/** + * Pacemaker delay records the delta between the pacemaker scheduled time and the actual time. When + * the delay is high, it could indicate issues with the machine that the client is running on like + * CPU saturation. + */ +public class PacemakerDelay extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/pacemaker_delays"; + + private static final List BUCKETS = + ImmutableList.builder() + // Up to 67,108,864, ~1 minute in microseconds + .addAll(Buckets.generateExponentialSeq(1.0, 13, 4)) + .build(); + + public PacemakerDelay() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "Distribution of the delay between the pacemaker firing and the pacemaker task" + + " being scheduled.") + .setUnit(Units.MICROSECOND) + .setExplicitBucketBoundariesAdvice(BUCKETS) + .build(); + } + + public void record(ClientInfo clientInfo, String executorName, Duration delta) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.EXECUTOR_KEY, executorName) + .build(); + instrument.record(delta.toNanos() / 1000.0, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java new file mode 100644 index 000000000000..464a4138d134 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableApplicationBlockingLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/application_latencies"; + + public TableApplicationBlockingLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + this.instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "The latency of the client application consuming available response data.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java new file mode 100644 index 000000000000..fa7666c740e2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableAttemptLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/attempt_latencies"; + + public TableAttemptLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency per RPC attempt.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + @Nullable ClusterInformation clusterInfo, + MethodInfo methodInfo, + Status.Code code, + Duration latency) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STREAMING_KEY, methodInfo.getStreaming()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(latency), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java new file mode 100644 index 000000000000..090e386eec70 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableAttemptLatency2 extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/attempt_latencies2"; + + public TableAttemptLatency2() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency per RPC attempt.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + @Nullable PeerInfo peerInfo, + @Nullable ClusterInformation clusterInfo, + MethodInfo methodInfo, + Status.Code code, + Duration latency) { + + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.TRANSPORT_REGION, Util.formatTransportRegion(peerInfo)) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .put(MetricLabels.TRANSPORT_ZONE, Util.formatTransportZone(peerInfo)) + .put(MetricLabels.TRANSPORT_SUBZONE, Util.formatTransportSubzone(peerInfo)) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.STREAMING_KEY, methodInfo.getStreaming()) + .build(); + + instrument.record(toMillis(latency), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java new file mode 100644 index 000000000000..74ec711c2fb5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java @@ -0,0 +1,87 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableClientBlockingLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/throttling_latencies"; + + public TableClientBlockingLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "The latency introduced by the client queuing the RPC due to an unavailable" + + " transport or overload.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java new file mode 100644 index 000000000000..228b2c88b0e1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; +import javax.annotation.Nullable; + +public class TableConnectivityErrorCount extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/connectivity_error_count"; + + public TableConnectivityErrorCount() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongCounter instrument; + + private Recorder(Meter meter) { + instrument = + meter + .counterBuilder(NAME) + .setDescription( + "Number of requests that failed to reach the Google datacenter. (Requests without" + + " google response headers)") + .setUnit(Units.COUNT) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + long count) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.add(count, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java new file mode 100644 index 000000000000..2c64b53cf40c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableFirstResponseLatency extends MetricWrapper { + public static final String NAME = + "bigtable.googleapis.com/internal/client/first_response_latencies"; + + public TableFirstResponseLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "Latency from operation start until the response headers were received. The" + + " publishing of the measurement will be delayed until the attempt response" + + " has been received.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java new file mode 100644 index 000000000000..b66f1e2b37cf --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableOperationLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/operation_latencies"; + + public TableOperationLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "Total time until final operation success or failure, including retries and" + + " backoff.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STREAMING_KEY, methodInfo.getStreaming()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java new file mode 100644 index 000000000000..1d5d0819129e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableRemainingDeadline extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/remaining_deadline"; + + public TableRemainingDeadline() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "The remaining deadline when the request is sent to grpc. This will either be the" + + " operation timeout, or the remaining deadline from operation timeout after" + + " retries and back offs.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.STATUS_KEY, code.name()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.STREAMING_KEY, methodInfo.getStreaming()) + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java new file mode 100644 index 000000000000..eb6e394afb44 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; +import javax.annotation.Nullable; + +public class TableRetryCount extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/retry_count"; + + public TableRetryCount() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongCounter instrument; + + private Recorder(Meter meter) { + instrument = + meter + .counterBuilder(NAME) + .setDescription("The number of additional RPCs sent after the initial attempt.") + .setUnit(Units.COUNT) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + long amount) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + instrument.add(amount, attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java new file mode 100644 index 000000000000..6535def001aa --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.collect.ImmutableMap; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class TableServerLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/server_latencies"; + + public TableServerLatency() { + super(TableSchema.INSTANCE, NAME); + } + + @Override + public ImmutableMap extractMetricLabels( + Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ImmutableMap.builder() + .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build(); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription( + "The latency measured from the moment that the RPC entered the Google data center" + + " until the RPC was completed.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + MethodInfo methodInfo, + @Nullable ClusterInformation clusterInfo, + Status.Code code, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .put(MetricLabels.APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(MetricLabels.STREAMING_KEY, methodInfo.getStreaming()) + .put(MetricLabels.STATUS_KEY, code.name()) + .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) + // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/package-info.java new file mode 100644 index 000000000000..e6e4fb388c5b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.metrics; + +// Implements the metrics from bigtable_googleapis_com/metrics/aliased_metrics.gcl & +// cloud_pulse_monarch/bigtable/metrics diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java new file mode 100644 index 000000000000..b430cb8119db --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java @@ -0,0 +1,259 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.retrying.ServerStreamingAttemptException; +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import com.google.api.gax.tracing.SpanName; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.base.Stopwatch; +import io.opencensus.stats.MeasureMap; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.TagContext; +import io.opencensus.tags.TagContextBuilder; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tagger; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import javax.annotation.Nullable; + +class MetricsTracer extends BigtableTracer { + + private final OperationType operationType; + + private final Tagger tagger; + private final StatsRecorder stats; + + // Tags + private final TagContext parentContext; + private final SpanName spanName; + private final Map statsAttributes; + + // Operation level metrics + private final AtomicBoolean opFinished = new AtomicBoolean(); + private final Stopwatch operationTimer = Stopwatch.createStarted(); + private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); + + // Attempt level metrics + private int attemptCount = 0; + private Stopwatch attemptTimer; + + private volatile int attempt = 0; + + private volatile boolean reportBatchingLatency = false; + private final AtomicLong batchThrottledLatency = new AtomicLong(0); + private MetadataExtractorInterceptor.SidebandData sidebandData; + + MetricsTracer( + OperationType operationType, + Tagger tagger, + StatsRecorder stats, + SpanName spanName, + Map statsAttributes) { + this.operationType = operationType; + this.tagger = tagger; + this.stats = stats; + this.parentContext = tagger.getCurrentTagContext(); + this.spanName = spanName; + this.statsAttributes = statsAttributes; + } + + @Override + public Scope inScope() { + return new Scope() { + @Override + public void close() {} + }; + } + + @Override + public void operationFinishEarly() { + attemptTimer.stop(); + operationTimer.stop(); + } + + @Override + public void operationSucceeded() { + recordOperationCompletion(null); + } + + @Override + public void operationCancelled() { + recordOperationCompletion(new CancellationException()); + } + + @Override + public void operationFailed(Throwable throwable) { + recordOperationCompletion(throwable); + } + + private void recordOperationCompletion(@Nullable Throwable throwable) { + if (!opFinished.compareAndSet(false, true)) { + return; + } + + long elapsed = operationTimer.elapsed(TimeUnit.MILLISECONDS); + + MeasureMap measures = + stats + .newMeasureMap() + .put(RpcMeasureConstants.BIGTABLE_OP_LATENCY, elapsed) + .put(RpcMeasureConstants.BIGTABLE_OP_ATTEMPT_COUNT, attemptCount); + + if (operationType == OperationType.ServerStreaming + && spanName.getMethodName().equals("ReadRows")) { + measures.put( + RpcMeasureConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY, + firstResponsePerOpTimer.elapsed(TimeUnit.MILLISECONDS)); + } + + TagContextBuilder tagCtx = + newTagCtxBuilder() + .putLocal( + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create(Util.extractStatus(throwable).name())); + + measures.record(tagCtx.build()); + } + + @Override + public void attemptStarted(int attemptNumber) { + attempt = attemptNumber; + attemptCount++; + attemptTimer = Stopwatch.createStarted(); + } + + @Override + public void attemptSucceeded() { + recordAttemptCompletion(null); + } + + @Override + public void attemptCancelled() { + recordAttemptCompletion(new CancellationException()); + } + + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + @Override + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + + @Override + public void attemptFailedDuration(Throwable throwable, java.time.Duration duration) { + recordAttemptCompletion(throwable); + } + + @Override + public void attemptFailedRetriesExhausted(Throwable throwable) { + recordAttemptCompletion(throwable); + } + + @Override + public void attemptPermanentFailure(Throwable throwable) { + recordAttemptCompletion(throwable); + } + + private void recordAttemptCompletion(@Nullable Throwable throwable) { + MeasureMap measures = + stats + .newMeasureMap() + .put( + RpcMeasureConstants.BIGTABLE_ATTEMPT_LATENCY, + attemptTimer.elapsed(TimeUnit.MILLISECONDS)); + + if (sidebandData != null && sidebandData.getGfeTiming() != null) { + measures + .put(RpcMeasureConstants.BIGTABLE_GFE_LATENCY, sidebandData.getGfeTiming().toMillis()) + .put(RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT, 0L); + } else { + measures.put(RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT, 1L); + } + + if (reportBatchingLatency) { + measures.put(RpcMeasureConstants.BIGTABLE_BATCH_THROTTLED_TIME, batchThrottledLatency.get()); + + // Reset batch throttling latency for next attempt. This can't be done in attemptStarted + // because batching flow control will add batching latency before the attempt has started. + batchThrottledLatency.set(0); + } + + // Patch the throwable until it's fixed in gax. When an attempt failed, + // it'll throw a ServerStreamingAttemptException. Unwrap the exception + // so it could get processed by extractStatus + if (throwable instanceof ServerStreamingAttemptException) { + throwable = throwable.getCause(); + } + + TagContextBuilder tagCtx = + newTagCtxBuilder() + .putLocal( + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create(Util.extractStatus(throwable).name())); + + measures.record(tagCtx.build()); + } + + @Override + public void responseReceived() { + if (firstResponsePerOpTimer.isRunning()) { + firstResponsePerOpTimer.stop(); + } + } + + @Override + public int getAttempt() { + return attempt; + } + + @Override + public void setSidebandData(MetadataExtractorInterceptor.SidebandData sidebandData) { + this.sidebandData = sidebandData; + } + + @Override + public void batchRequestThrottled(long totalThrottledMs) { + reportBatchingLatency = true; + batchThrottledLatency.addAndGet(totalThrottledMs); + } + + private TagContextBuilder newTagCtxBuilder() { + TagContextBuilder tagCtx = + tagger.toBuilder(parentContext) + .putLocal(RpcMeasureConstants.BIGTABLE_OP, TagValue.create(spanName.toString())); + + // Copy client level tags in + for (Entry entry : statsAttributes.entrySet()) { + tagCtx.putLocal(entry.getKey(), entry.getValue()); + } + + return tagCtx; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java new file mode 100644 index 000000000000..0f557e65366c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java @@ -0,0 +1,55 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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.cloud.bigtable.data.v2.internal.csm.opencensus; + +import com.google.api.core.InternalApi; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.common.collect.ImmutableMap; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tagger; + +/** + * {@link ApiTracerFactory} that will generate OpenCensus metrics by using the {@link ApiTracer} + * api. + */ +@InternalApi("For internal use only") +public class MetricsTracerFactory extends BaseApiTracerFactory { + private final Tagger tagger; + private final StatsRecorder stats; + private final ImmutableMap statsAttributes; + + public static MetricsTracerFactory create( + Tagger tagger, StatsRecorder stats, ImmutableMap statsAttributes) { + return new MetricsTracerFactory(tagger, stats, statsAttributes); + } + + private MetricsTracerFactory( + Tagger tagger, StatsRecorder stats, ImmutableMap statsAttributes) { + this.tagger = tagger; + this.stats = stats; + this.statsAttributes = statsAttributes; + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + return new MetricsTracer(operationType, tagger, stats, spanName, statsAttributes); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java new file mode 100644 index 000000000000..39c9bb0e9988 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.internal.csm.opencensus; + +import com.google.api.core.InternalApi; +import io.opencensus.stats.Measure.MeasureLong; +import io.opencensus.tags.TagKey; + +@InternalApi("For internal use only") +public class RpcMeasureConstants { + // TagKeys + public static final TagKey BIGTABLE_PROJECT_ID = TagKey.create("bigtable_project_id"); + public static final TagKey BIGTABLE_INSTANCE_ID = TagKey.create("bigtable_instance_id"); + public static final TagKey BIGTABLE_APP_PROFILE_ID = TagKey.create("bigtable_app_profile_id"); + + /** Tag key that represents a Bigtable operation name. */ + static final TagKey BIGTABLE_OP = TagKey.create("bigtable_op"); + + /** Tag key that represents the final status of the Bigtable operation. */ + static final TagKey BIGTABLE_STATUS = TagKey.create("bigtable_status"); + + // Units + /** Unit to represent counts. */ + private static final String COUNT = "1"; + + /** Unit to represent milliseconds. */ + private static final String MILLISECOND = "ms"; + + // Measurements + /** + * Latency for a logic operation, which will include latencies for each attempt and exponential + * backoff delays. + */ + static final MeasureLong BIGTABLE_OP_LATENCY = + MeasureLong.create( + "cloud.google.com/java/bigtable/op_latency", + "Time between request being sent to last row received, " + + "or terminal error of the last retry attempt.", + MILLISECOND); + + /** + * Number of attempts a logical operation took to complete. Under normal circumstances should be + * 1. + */ + static final MeasureLong BIGTABLE_OP_ATTEMPT_COUNT = + MeasureLong.MeasureLong.create( + "cloud.google.com/java/bigtable/op_attempt_count", + "Number of attempts per operation", + COUNT); + + /** Latency that a single attempt (RPC) took to complete. */ + static final MeasureLong BIGTABLE_ATTEMPT_LATENCY = + MeasureLong.create( + "cloud.google.com/java/bigtable/attempt_latency", + "Duration of an individual operation attempt", + MILLISECOND); + + /** Latency for the caller to see the first row in a ReadRows stream. */ + static final MeasureLong BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY = + MeasureLong.create( + "cloud.google.com/java/bigtable/read_rows_first_row_latency", + "Time between request being sent to the first row received", + MILLISECOND); + + /** GFE t4t7 latency extracted from server-timing header. */ + public static final MeasureLong BIGTABLE_GFE_LATENCY = + MeasureLong.create( + "cloud.google.com/java/bigtable/gfe_latency", + "Latency between Google's network receives an RPC and reads back the first byte of the" + + " response", + MILLISECOND); + + /** Number of responses without the server-timing header. */ + public static final MeasureLong BIGTABLE_GFE_HEADER_MISSING_COUNT = + MeasureLong.create( + "cloud.google.com/java/bigtable/gfe_header_missing_count", + "Number of RPC responses received without the server-timing header, most likely means" + + " that the RPC never reached Google's network", + COUNT); + + /** Total throttled time of a batch in msecs. */ + public static final MeasureLong BIGTABLE_BATCH_THROTTLED_TIME = + MeasureLong.create( + "cloud.google.com/java/bigtable/batch_throttled_time", + "Total throttled time of a batch in msecs", + MILLISECOND); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java new file mode 100644 index 000000000000..1db8b443ec40 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java @@ -0,0 +1,179 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.internal.csm.opencensus; + +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_ATTEMPT_LATENCY; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_BATCH_THROTTLED_TIME; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_GFE_LATENCY; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_INSTANCE_ID; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_OP; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_OP_ATTEMPT_COUNT; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_OP_LATENCY; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_PROJECT_ID; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY; +import static com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcMeasureConstants.BIGTABLE_STATUS; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import io.opencensus.stats.Aggregation; +import io.opencensus.stats.Aggregation.Count; +import io.opencensus.stats.Aggregation.Distribution; +import io.opencensus.stats.Aggregation.Sum; +import io.opencensus.stats.BucketBoundaries; +import io.opencensus.stats.View; +import java.util.Arrays; + +public class RpcViewConstants { + // Aggregations + private static final Aggregation COUNT = Count.create(); + private static final Aggregation SUM = Sum.create(); + + private static final Aggregation AGGREGATION_WITH_MILLIS_HISTOGRAM = + Distribution.create( + BucketBoundaries.create( + ImmutableList.of( + 0.0, 0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, + 13.0, 16.0, 20.0, 25.0, 30.0, 40.0, 50.0, 65.0, 80.0, 100.0, 130.0, 160.0, 200.0, + 250.0, 300.0, 400.0, 500.0, 650.0, 800.0, 1000.0, 2000.0, 5000.0, 10000.0, + 20000.0, 50000.0, 100000.0))); + + private static final Aggregation AGGREGATION_ATTEMPT_COUNT = + Distribution.create( + BucketBoundaries.create( + ImmutableList.of( + 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, + 100.0))); + + /** + * {@link View} for Bigtable client roundtrip latency in milliseconds including all retry + * attempts. + */ + static final View BIGTABLE_OP_LATENCY_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/op_latency"), + "Operation latency in msecs", + BIGTABLE_OP_LATENCY, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + ImmutableList.of( + BIGTABLE_PROJECT_ID, + BIGTABLE_INSTANCE_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + static final View BIGTABLE_COMPLETED_OP_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/completed_ops"), + "Number of completed Bigtable client operations", + BIGTABLE_OP_LATENCY, + COUNT, + Arrays.asList( + BIGTABLE_PROJECT_ID, + BIGTABLE_INSTANCE_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + static final View BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/read_rows_first_row_latency"), + "Latency to receive the first row in a ReadRows stream", + BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + ImmutableList.of(BIGTABLE_PROJECT_ID, BIGTABLE_INSTANCE_ID, BIGTABLE_APP_PROFILE_ID)); + + static final View BIGTABLE_ATTEMPT_LATENCY_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/attempt_latency"), + "Attempt latency in msecs", + BIGTABLE_ATTEMPT_LATENCY, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + ImmutableList.of( + BIGTABLE_PROJECT_ID, + BIGTABLE_INSTANCE_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + static final View BIGTABLE_ATTEMPTS_PER_OP_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/attempts_per_op"), + "Distribution of attempts per logical operation", + BIGTABLE_OP_ATTEMPT_COUNT, + AGGREGATION_ATTEMPT_COUNT, + ImmutableList.of( + BIGTABLE_PROJECT_ID, + BIGTABLE_INSTANCE_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + static final View BIGTABLE_GFE_LATENCY_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/gfe_latency"), + "Latency between Google's network receives an RPC and reads back the first byte of the" + + " response", + BIGTABLE_GFE_LATENCY, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + ImmutableList.of( + BIGTABLE_INSTANCE_ID, + BIGTABLE_PROJECT_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + static final View BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/gfe_header_missing_count"), + "Number of RPC responses received without the server-timing header, most likely means" + + " that the RPC never reached Google's network", + BIGTABLE_GFE_HEADER_MISSING_COUNT, + SUM, + ImmutableList.of( + BIGTABLE_INSTANCE_ID, + BIGTABLE_PROJECT_ID, + BIGTABLE_APP_PROFILE_ID, + BIGTABLE_OP, + BIGTABLE_STATUS)); + + // use distribution so we can correlate batch throttled time with op_latency + static final View BIGTABLE_BATCH_THROTTLED_TIME_VIEW = + View.create( + View.Name.create("cloud.google.com/java/bigtable/batch_throttled_time"), + "Total throttled time of a batch in msecs", + BIGTABLE_BATCH_THROTTLED_TIME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + ImmutableList.of( + BIGTABLE_INSTANCE_ID, BIGTABLE_PROJECT_ID, BIGTABLE_APP_PROFILE_ID, BIGTABLE_OP)); + + @VisibleForTesting + public static final ImmutableSet BIGTABLE_CLIENT_VIEWS_SET = + ImmutableSet.of( + RpcViewConstants.BIGTABLE_OP_LATENCY_VIEW, + RpcViewConstants.BIGTABLE_COMPLETED_OP_VIEW, + RpcViewConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW, + RpcViewConstants.BIGTABLE_ATTEMPT_LATENCY_VIEW, + RpcViewConstants.BIGTABLE_ATTEMPTS_PER_OP_VIEW, + RpcViewConstants.BIGTABLE_BATCH_THROTTLED_TIME_VIEW); + + public static final ImmutableSet GFE_VIEW_SET = + ImmutableSet.of( + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java new file mode 100644 index 000000000000..86fc15faea42 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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. + */ + +/** + * Clientside metrics apis + * + *

Bigtable clientside metrics are implemented using Opentelemetry. However unlike most libraries + * that use Opentelemetry, the Bigtable client bundles its own exporter that is on by default. The + * metrics collected are exported to Cloud Monitoring. + * + *

There are 3 types of metrics that are collected: + * + *

    + *
  • Table based metrics - these metrics are meant to be the clientside counterpart of the + * serverside bigtable_table metrics. The are tied to Table-bound RPCs. + *
  • Client based metrics - these metrics are internal and used to monitor the e2e health of the + * client. They are tied to the bigtable_client resource. + *
  • Client based gRPC metrics - these are metrics collected by the underlying gRPC library and + * are exported using the bigtable_client resource + *
+ * + *

The client will attach relevant attributes to the measurement when it is being recorded. There + * are 2 types of attributes: resource and metric. Some of the table based resource attributes are + * dynamic and are extracted from an RPC response. To facilitate this, the resource attributes will + * be sent into Opentelemetry as metric attributes and then during export, the attributes will be + * split between the monitored resource and metric labels. + * + *

Client based metrics use a schema that's mostly static, however some of the attributes are + * slow to resolve. The resolution of those attributes will be deferred until the export phase in + * the Exporter. While the non-expensive ones will be sent as metric attributes same as table based + * metrics + * + *

Client based gRPC metrics are recorded by gRPC and don't have access to the any Bigtable + * attributes. All of the Bigtable attributes will be filled in by the Exporter. + * + *

To make this manageable, attributes from different sources are encapsulated by POJOs and are + * plumbed to the RpcTracer and the Exporter. The metrics themselves are wrapped in typesafe + * classes. Each metric has its own class which will have a metric specific record method. In + * addition the metric classes will extend a schema specific class (ie AbstractClientMetric). The + * schema specific class will serve 2 use cases: + * + *

    + *
  • During the record phase, createResourceAttrs method, will ensure all of the resource + * attributes are captured as metric attributes. + *
  • During the export phase, createMonitoredResource and createMetricLabels methods are used to + * extract a MonitoredResource and Metric labels. + *
+ */ +package com.google.cloud.bigtable.data.v2.internal.csm; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/ClientSchema.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/ClientSchema.java new file mode 100644 index 000000000000..5ef030539db8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/ClientSchema.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.schema; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.ProjectName; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; + +/** + * The attributes for this schema are partially populated during the record phase and finalized + * during the export phase with {@link EnvInfo}. This is necessary because resolving {@link EnvInfo} + * is slow and should not happen during client startup. + */ +public final class ClientSchema extends Schema { + // This implements the `bigtable_client` resource defined in + // bigtable_googleapis_com/metrics/resource_types.gcl + + public static final AttributeKey BIGTABLE_PROJECT_ID_KEY = + AttributeKey.stringKey("project_id"); + // Resource labels passed during recording + public static final AttributeKey INSTANCE_ID_KEY = AttributeKey.stringKey("instance"); + public static final AttributeKey APP_PROFILE_KEY = AttributeKey.stringKey("app_profile"); + public static final AttributeKey CLIENT_NAME = AttributeKey.stringKey("client_name"); + + // Resource labels injected during export + private static final DeferredAttr CLIENT_PROJECT = + DeferredAttr.fromEnv("client_project", EnvInfo::getProject); + private static final DeferredAttr CLIENT_REGION = + DeferredAttr.fromEnv("region", EnvInfo::getRegion); + private static final DeferredAttr CLOUD_PLATFORM = + DeferredAttr.fromEnv("cloud_platform", EnvInfo::getPlatform); + private static final DeferredAttr HOST_ID = DeferredAttr.fromEnv("host_id", EnvInfo::getHostId); + private static final DeferredAttr HOST_NAME = + DeferredAttr.fromEnv("host_name", EnvInfo::getHostName); + private static final DeferredAttr UUID = DeferredAttr.fromEnv("uuid", EnvInfo::getUid); + + // Must come after all other static members + public static final ClientSchema INSTANCE = new ClientSchema(); + + public ClientSchema() { + super( + "bigtable_client", + ImmutableList.of(BIGTABLE_PROJECT_ID_KEY, INSTANCE_ID_KEY, APP_PROFILE_KEY, CLIENT_NAME), + ImmutableList.of(CLIENT_PROJECT, CLIENT_REGION, CLOUD_PLATFORM, HOST_ID, HOST_NAME, UUID)); + } + + @Override + public ProjectName extractProjectName(Attributes attrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ProjectName.of(clientInfo.getInstanceName().getProjectId()); + } + + public AttributesBuilder createResourceAttrs(ClientInfo clientInfo) { + return Attributes.builder() + .put(BIGTABLE_PROJECT_ID_KEY, clientInfo.getInstanceName().getProjectId()) + .put(INSTANCE_ID_KEY, clientInfo.getInstanceName().getInstanceId()) + .put(APP_PROFILE_KEY, clientInfo.getAppProfileId()) + .put(CLIENT_NAME, clientInfo.getClientName()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/CustomSchema.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/CustomSchema.java new file mode 100644 index 000000000000..437ec9788b6d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/CustomSchema.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.schema; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.ProjectName; +import io.opentelemetry.api.common.Attributes; + +/** Placeholder schema for exporting custom metrics */ +public class CustomSchema extends Schema { + private CustomSchema() { + super("custom_schema", ImmutableList.of()); + } + + public static final CustomSchema INSTANCE = new CustomSchema(); + + @Override + public ProjectName extractProjectName(Attributes attrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ProjectName.of(clientInfo.getInstanceName().getProjectId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java new file mode 100644 index 000000000000..69a450977b73 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java @@ -0,0 +1,78 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.schema; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.ProjectName; +import io.opentelemetry.api.common.Attributes; + +/** + * The attributes for this schema are partially populated during the record phase and finalized + * during the export phase with {@link EnvInfo}. This is necessary because resolving {@link EnvInfo} + * is slow and should not happen during client startup. + */ +public final class GrpcClientSchema extends Schema { + // Unlike the normal ClientSchema, the bigtable resource ids must be injected during export time + private static final DeferredAttr BIGTABLE_PROJECT_ID = + DeferredAttr.fromClientInfo("project_id", ci -> ci.getInstanceName().getProjectId()); + private static final DeferredAttr INSTANCE_ID = + DeferredAttr.fromClientInfo("instance", ci -> ci.getInstanceName().getInstanceId()); + private static final DeferredAttr APP_PROFILE_ID = + DeferredAttr.fromClientInfo("app_profile", ClientInfo::getAppProfileId); + private static final DeferredAttr CLIENT_NAME = + DeferredAttr.fromClientInfo("client_name", ClientInfo::getClientName); + + private static final DeferredAttr CLIENT_PROJECT = + DeferredAttr.fromEnv("client_project", EnvInfo::getProject); + private static final DeferredAttr CLIENT_REGION = + DeferredAttr.fromEnv("region", EnvInfo::getRegion); + private static final DeferredAttr CLOUD_PLATFORM = + DeferredAttr.fromEnv("cloud_platform", EnvInfo::getPlatform); + private static final DeferredAttr HOST_ID = DeferredAttr.fromEnv("host_id", EnvInfo::getHostId); + private static final DeferredAttr HOST_NAME = + DeferredAttr.fromEnv("host_name", EnvInfo::getHostName); + private static final DeferredAttr UUID = DeferredAttr.fromEnv("uuid", EnvInfo::getUid); + + // Must come after all other static members + public static final GrpcClientSchema INSTANCE = new GrpcClientSchema(); + + private GrpcClientSchema() { + super( + "bigtable_client", + ImmutableList.of(), + ImmutableList.of( + BIGTABLE_PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID, + CLIENT_NAME, + // Same as ClientSchema + CLIENT_PROJECT, + CLIENT_REGION, + CLOUD_PLATFORM, + HOST_ID, + HOST_NAME, + UUID)); + } + + @Override + public ProjectName extractProjectName( + Attributes ignored, EnvInfo ignored2, ClientInfo clientInfo) { + return ProjectName.of(clientInfo.getInstanceName().getProjectId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java new file mode 100644 index 000000000000..3458ce606450 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.schema; + +import com.google.api.MonitoredResource; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.ProjectName; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; + +public abstract class Schema { + private final String name; + private final List> resourceKeys; + private final List deferredAttrs; + + Schema(String name, List> resourceKeys) { + this(name, resourceKeys, ImmutableList.of()); + } + + Schema(String name, List> resourceKeys, List deferredAttrs) { + this.name = name; + this.resourceKeys = resourceKeys; + this.deferredAttrs = deferredAttrs; + } + + public List> getResourceKeys() { + return resourceKeys; + } + + public abstract ProjectName extractProjectName( + Attributes attrs, EnvInfo envInfo, ClientInfo clientInfo); + + public MonitoredResource extractMonitoredResource( + Attributes attrs, EnvInfo envInfo, ClientInfo clientInfo) { + MonitoredResource.Builder builder = MonitoredResource.newBuilder().setType(name); + + for (AttributeKey key : resourceKeys) { + Object value = attrs.get(key); + if (value != null) { + builder.putLabels(key.getKey(), value.toString()); + } + } + for (DeferredAttr a : deferredAttrs) { + builder.putLabels(a.getKey().getKey(), a.getValue(envInfo, clientInfo)); + } + return builder.build(); + } + + public String getName() { + return name; + } + + static class DeferredAttr { + private final AttributeKey name; + private BiFunction extractor; + + static DeferredAttr fromEnv(String name, Function envExtractor) { + return new DeferredAttr( + AttributeKey.stringKey(name), (envInfo, ignored) -> envExtractor.apply(envInfo)); + } + + static DeferredAttr fromClientInfo(String name, Function envExtractor) { + return new DeferredAttr( + AttributeKey.stringKey(name), (ignored, clientInfo) -> envExtractor.apply(clientInfo)); + } + + private DeferredAttr( + AttributeKey name, BiFunction extractor) { + this.name = name; + this.extractor = extractor; + } + + AttributeKey getKey() { + return name; + } + + String getValue(EnvInfo envInfo, ClientInfo clientInfo) { + return extractor.apply(envInfo, clientInfo); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java new file mode 100644 index 000000000000..8a655cfd7686 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.schema; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.ProjectName; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import javax.annotation.Nullable; + +public final class TableSchema extends Schema { + // This implements the `bigtable_client_raw` resource defined in + // bigtable_googleapis_com/metrics/resource_types.gcl + + public static final AttributeKey BIGTABLE_PROJECT_ID_KEY = + AttributeKey.stringKey("project_id"); + public static final AttributeKey INSTANCE_ID_KEY = AttributeKey.stringKey("instance"); + public static final AttributeKey TABLE_ID_KEY = AttributeKey.stringKey("table"); + public static final AttributeKey CLUSTER_ID_KEY = AttributeKey.stringKey("cluster"); + public static final AttributeKey ZONE_ID_KEY = AttributeKey.stringKey("zone"); + + // Must come after all other static members + public static final TableSchema INSTANCE = new TableSchema(); + + public TableSchema() { + super( + "bigtable_client_raw", + ImmutableList.of( + BIGTABLE_PROJECT_ID_KEY, INSTANCE_ID_KEY, TABLE_ID_KEY, CLUSTER_ID_KEY, ZONE_ID_KEY)); + } + + @Override + public ProjectName extractProjectName(Attributes attrs, EnvInfo envInfo, ClientInfo clientInfo) { + return ProjectName.of(attrs.get(BIGTABLE_PROJECT_ID_KEY)); + } + + public AttributesBuilder createResourceAttrs( + ClientInfo clientInfo, String tableId, @Nullable ClusterInformation clusterInfo) { + return Attributes.builder() + .put(BIGTABLE_PROJECT_ID_KEY, clientInfo.getInstanceName().getProjectId()) + .put(INSTANCE_ID_KEY, clientInfo.getInstanceName().getInstanceId()) + .put(TABLE_ID_KEY, tableId) + .put(CLUSTER_ID_KEY, Util.formatClusterIdMetricLabel(clusterInfo)) + .put(ZONE_ID_KEY, Util.formatZoneIdMetricLabel(clusterInfo)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableGrpcStreamTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableGrpcStreamTracer.java new file mode 100644 index 000000000000..99a184b5e30d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableGrpcStreamTracer.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import io.grpc.ClientStreamTracer; +import io.grpc.Metadata; + +/** + * Records the time a request is enqueued in a grpc channel queue. This a bridge between gRPC stream + * tracing and Bigtable tracing. Its primary purpose is to measure the transition time between + * asking gRPC to start an RPC and gRPC actually serializing that RPC. + */ +class BigtableGrpcStreamTracer extends ClientStreamTracer { + private final BigtableTracer tracer; + + private BigtableGrpcStreamTracer(BigtableTracer tracer) { + this.tracer = tracer; + } + + @Override + public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize) { + tracer.grpcMessageSent(); + } + + static class Factory extends ClientStreamTracer.Factory { + + private final BigtableTracer tracer; + + Factory(BigtableTracer tracer) { + this.tracer = tracer; + } + + @Override + public ClientStreamTracer newClientStreamTracer( + ClientStreamTracer.StreamInfo info, Metadata headers) { + return new BigtableGrpcStreamTracer(tracer); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerStreamingCallable.java new file mode 100644 index 000000000000..c45e608c0a20 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerStreamingCallable.java @@ -0,0 +1,138 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.base.Preconditions; +import com.google.common.base.Stopwatch; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; + +/** + * This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class BigtableTracerStreamingCallable + extends ServerStreamingCallable { + + private final ServerStreamingCallable innerCallable; + + public BigtableTracerStreamingCallable( + @Nonnull ServerStreamingCallable callable) { + this.innerCallable = Preconditions.checkNotNull(callable, "Inner callable must be set"); + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + GrpcCallContext grpcCtx = (GrpcCallContext) context; + + MetadataExtractorInterceptor metadataExtractor = new MetadataExtractorInterceptor(); + grpcCtx = metadataExtractor.injectInto(grpcCtx); + + // tracer should always be an instance of bigtable tracer + if (context.getTracer() instanceof BigtableTracer) { + BigtableTracer tracer = (BigtableTracer) context.getTracer(); + tracer.setSidebandData(metadataExtractor.getSidebandData()); + grpcCtx = + grpcCtx.withCallOptions( + grpcCtx + .getCallOptions() + .withStreamTracerFactory(new BigtableGrpcStreamTracer.Factory(tracer))); + + BigtableTracerResponseObserver innerObserver = + new BigtableTracerResponseObserver<>(responseObserver, tracer); + if (context.getRetrySettings() != null) { + tracer.setTotalTimeoutDuration(context.getRetrySettings().getTotalTimeoutDuration()); + } + innerCallable.call(request, innerObserver, grpcCtx); + } else { + innerCallable.call(request, responseObserver, grpcCtx); + } + } + + private static class BigtableTracerResponseObserver + extends SafeResponseObserver { + private final BigtableTracer tracer; + private final ResponseObserver outerObserver; + + BigtableTracerResponseObserver(ResponseObserver observer, BigtableTracer tracer) { + super(observer); + + this.tracer = tracer; + this.outerObserver = observer; + } + + @Override + protected void onStartImpl(final StreamController controller) { + TracedStreamController tracedController = new TracedStreamController(controller, tracer); + outerObserver.onStart(tracedController); + } + + @Override + protected void onResponseImpl(ResponseT response) { + Stopwatch stopwatch = Stopwatch.createStarted(); + outerObserver.onResponse(response); + tracer.afterResponse(stopwatch.elapsed(TimeUnit.MILLISECONDS)); + } + + @Override + protected void onErrorImpl(Throwable t) { + outerObserver.onError(t); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + } + + private static class TracedStreamController implements StreamController { + private final StreamController innerController; + private final BigtableTracer tracer; + + TracedStreamController(StreamController innerController, BigtableTracer tracer) { + this.innerController = innerController; + this.tracer = tracer; + } + + @Override + public void cancel() { + innerController.cancel(); + } + + @Override + public void disableAutoInboundFlowControl() { + tracer.disableFlowControl(); + innerController.disableAutoInboundFlowControl(); + } + + @Override + public void request(int i) { + tracer.onRequest(i); + innerController.request(i); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerUnaryCallable.java new file mode 100644 index 000000000000..443ee17345b6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerUnaryCallable.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class BigtableTracerUnaryCallable + extends UnaryCallable { + + private final UnaryCallable innerCallable; + + public BigtableTracerUnaryCallable(@Nonnull UnaryCallable innerCallable) { + this.innerCallable = Preconditions.checkNotNull(innerCallable, "Inner callable must be set"); + } + + @Override + public ApiFuture futureCall(RequestT request, ApiCallContext context) { + MetadataExtractorInterceptor interceptor = new MetadataExtractorInterceptor(); + GrpcCallContext grpcCtx = interceptor.injectInto((GrpcCallContext) context); + + // tracer should always be an instance of BigtableTracer + if (context.getTracer() instanceof BigtableTracer) { + BigtableTracer tracer = (BigtableTracer) context.getTracer(); + tracer.setSidebandData(interceptor.getSidebandData()); + + grpcCtx = + grpcCtx.withCallOptions( + grpcCtx + .getCallOptions() + .withStreamTracerFactory(new BigtableGrpcStreamTracer.Factory(tracer))); + + if (context.getRetrySettings() != null) { + tracer.setTotalTimeoutDuration(context.getRetrySettings().getTotalTimeoutDuration()); + } + } + return innerCallable.futureCall(request, grpcCtx); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java new file mode 100644 index 000000000000..305ec53315e6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java @@ -0,0 +1,433 @@ +/* + * 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.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.extractStatus; + +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.retrying.ServerStreamingAttemptException; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor.SidebandData; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.base.Stopwatch; +import com.google.common.collect.Comparators; +import com.google.common.math.IntMath; +import io.grpc.Deadline; +import io.grpc.Status; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import javax.annotation.Nullable; + +/** + * A {@link BigtableTracer} that records built-in metrics and publish under the + * bigtable.googleapis.com/client namespace + */ +class BuiltinMetricsTracer extends BigtableTracer { + private static final MethodInfo READ_ROWS = + MethodInfo.builder().setName("Bigtable.ReadRows").setStreaming(true).build(); + private final MetricRegistry.RecorderRegistry recorder; + private final ClientInfo clientInfo; + private final MethodInfo methodInfo; + + // Operation level metrics + private final AtomicBoolean operationFinishedEarly = new AtomicBoolean(); + private final AtomicBoolean opFinished = new AtomicBoolean(); + private final Stopwatch operationTimer = Stopwatch.createStarted(); + private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); + + // Attempt level metrics + private int attemptCount = 0; + private Stopwatch attemptTimer; + private volatile int attempt = 0; + + // Total server latency needs to be atomic because it's accessed from different threads. E.g. + // request() from user thread and attempt failed from grpc thread. We're only measuring the extra + // time application spent blocking grpc buffer, which will be operationLatency - serverLatency. + private final AtomicLong totalServerLatencyNano = new AtomicLong(0); + // Stopwatch is not thread safe so this is a workaround to check if the stopwatch changes is + // flushed to memory. + private final Stopwatch serverLatencyTimer = Stopwatch.createUnstarted(); + private final Object timerLock = new Object(); + + private boolean flowControlIsDisabled = false; + + private final AtomicInteger requestLeft = new AtomicInteger(0); + + private String tableId = ""; + + private final AtomicLong totalClientBlockingTime = new AtomicLong(0); + + private final AtomicLong grpcMessageSentDelay = new AtomicLong(0); + + private Deadline operationDeadline = null; + private volatile Duration remainingDeadlineAtAttemptStart = Duration.ZERO; + + private volatile MetadataExtractorInterceptor.SidebandData sidebandData = new SidebandData(); + + BuiltinMetricsTracer( + MetricRegistry.RecorderRegistry recorder, ClientInfo clientInfo, MethodInfo methodInfo) { + + this.recorder = recorder; + this.clientInfo = clientInfo; + this.methodInfo = methodInfo; + } + + @Override + public Scope inScope() { + return new Scope() { + @Override + public void close() {} + }; + } + + @Override + public void operationFinishEarly() { + operationFinishedEarly.set(true); + attemptTimer.stop(); + operationTimer.stop(); + } + + @Override + public void operationSucceeded() { + recordOperationCompletion(null); + } + + @Override + public void operationCancelled() { + recordOperationCompletion(new CancellationException()); + } + + @Override + public void operationFailed(Throwable error) { + recordOperationCompletion(error); + } + + @Override + public void attemptStarted(int attemptNumber) { + attemptStarted(null, attemptNumber); + } + + @Override + public void attemptStarted(Object request, int attemptNumber) { + this.attempt = attemptNumber; + attemptCount++; + attemptTimer = Stopwatch.createStarted(); + if (operationDeadline != null) { + remainingDeadlineAtAttemptStart = + Duration.ofMillis(operationDeadline.timeRemaining(TimeUnit.MILLISECONDS)); + } + if (request != null) { + this.tableId = Util.extractTableId(request); + } + if (!flowControlIsDisabled) { + synchronized (timerLock) { + if (!serverLatencyTimer.isRunning()) { + serverLatencyTimer.start(); + } + } + } + } + + @Override + public void attemptSucceeded() { + recordAttemptCompletion(null); + } + + @Override + public void attemptCancelled() { + recordAttemptCompletion(new CancellationException()); + } + + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + @Override + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + + @Override + public void attemptFailedDuration(Throwable error, Duration delay) { + recordAttemptCompletion(error); + } + + @Override + public void attemptPermanentFailure(Throwable throwable) { + recordAttemptCompletion(throwable); + } + + @Override + public void onRequest(int requestCount) { + requestLeft.accumulateAndGet(requestCount, IntMath::saturatedAdd); + + if (operationFinishedEarly.get()) { + return; + } + + if (flowControlIsDisabled) { + // On request is only called when auto flow control is disabled. When auto flow control is + // disabled, server latency is measured between onRequest and onResponse. + synchronized (timerLock) { + if (!serverLatencyTimer.isRunning()) { + serverLatencyTimer.start(); + } + } + } + } + + @Override + public void responseReceived() { + if (operationFinishedEarly.get()) { + return; + } + + if (firstResponsePerOpTimer.isRunning()) { + firstResponsePerOpTimer.stop(); + } + // When auto flow control is enabled, server latency is measured between afterResponse and + // responseReceived. + // When auto flow control is disabled, server latency is measured between onRequest and + // responseReceived. + // When auto flow control is disabled and application requested multiple responses, server + // latency is measured between afterResponse and responseReceived. + // In all the cases, we want to stop the serverLatencyTimer here. + synchronized (timerLock) { + if (serverLatencyTimer.isRunning()) { + totalServerLatencyNano.addAndGet(serverLatencyTimer.elapsed(TimeUnit.NANOSECONDS)); + serverLatencyTimer.reset(); + } + } + } + + @Override + public void afterResponse(long applicationLatency) { + if (!flowControlIsDisabled || requestLeft.decrementAndGet() > 0) { + if (operationFinishedEarly.get()) { + return; + } + // When auto flow control is enabled, request will never be called, so server latency is + // measured between after the last response is processed and before the next response is + // received. If flow control is disabled but requestLeft is greater than 0, + // also start the timer to count the time between afterResponse and responseReceived. + synchronized (timerLock) { + if (!serverLatencyTimer.isRunning()) { + serverLatencyTimer.start(); + } + } + } + } + + @Override + public int getAttempt() { + return attempt; + } + + @Override + public void setSidebandData(MetadataExtractorInterceptor.SidebandData sidebandData) { + this.sidebandData = sidebandData; + } + + @Override + public void batchRequestThrottled(long throttledTimeNanos) { + totalClientBlockingTime.addAndGet(java.time.Duration.ofNanos(throttledTimeNanos).toMillis()); + } + + @Override + public void grpcMessageSent() { + grpcMessageSentDelay.set(attemptTimer.elapsed(TimeUnit.NANOSECONDS)); + } + + @Override + public void setTotalTimeoutDuration(java.time.Duration totalTimeoutDuration) { + // This method is called by BigtableTracerStreamingCallable and + // BigtableTracerUnaryCallable which is called per attempt. We only set + // the operationDeadline on the first attempt and when totalTimeout is set. + if (operationDeadline == null && !totalTimeoutDuration.isZero()) { + this.operationDeadline = + Deadline.after(totalTimeoutDuration.toMillis(), TimeUnit.MILLISECONDS); + this.remainingDeadlineAtAttemptStart = totalTimeoutDuration; + } + } + + @Override + public void disableFlowControl() { + flowControlIsDisabled = true; + } + + private void recordOperationCompletion(@Nullable Throwable throwable) { + if (operationFinishedEarly.get()) { + throwable = null; // force an ok + } + + if (!opFinished.compareAndSet(false, true)) { + return; + } + long operationLatencyNano = operationTimer.elapsed(TimeUnit.NANOSECONDS); + + Status.Code code = extractStatus(throwable); + + // Only record when retry count is greater than 0 so the retry + // graph will be less confusing + if (attemptCount > 1) { + recorder.retryCount.record( + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, attemptCount - 1); + } + + recorder.operationLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + code, + Duration.ofNanos(operationLatencyNano)); + + // serverLatencyTimer should already be stopped in recordAttemptCompletion + long applicationLatencyNano = operationLatencyNano - totalServerLatencyNano.get(); + recorder.applicationBlockingLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + Duration.ofNanos(applicationLatencyNano)); + + if (methodInfo.equals(READ_ROWS)) { + recorder.firstResponseLantency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + code, + firstResponsePerOpTimer.elapsed()); + } + } + + private void recordAttemptCompletion(@Nullable Throwable throwable) { + if (operationFinishedEarly.get()) { + throwable = null; // force an ok + } + // If the attempt failed, the time spent in retry should be counted in application latency. + // Stop the stopwatch and decrement requestLeft. + synchronized (timerLock) { + if (serverLatencyTimer.isRunning()) { + requestLeft.decrementAndGet(); + totalServerLatencyNano.addAndGet(serverLatencyTimer.elapsed(TimeUnit.NANOSECONDS)); + serverLatencyTimer.reset(); + } + } + + // Patch the throwable until it's fixed in gax. When an attempt failed, + // it'll throw a ServerStreamingAttemptException. Unwrap the exception + // so it could get processed by extractStatus + if (throwable instanceof ServerStreamingAttemptException) { + throwable = throwable.getCause(); + } + + Status.Code code = extractStatus(throwable); + + totalClientBlockingTime.addAndGet(grpcMessageSentDelay.get()); + recorder.clientBlockingLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + Duration.ofNanos(totalClientBlockingTime.get())); + + recorder.attemptLatency.record( + clientInfo, + tableId, + sidebandData.getClusterInfo(), + methodInfo, + code, + attemptTimer.elapsed()); + + recorder.attemptLatency2.record( + clientInfo, + tableId, + sidebandData.getPeerInfo(), + sidebandData.getClusterInfo(), + methodInfo, + code, + attemptTimer.elapsed()); + + // When operationDeadline is set, it's possible that the deadline is passed by the time we send + // a new attempt. In this case we'll record 0. + if (operationDeadline != null) { + recorder.remainingDeadline.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + code, + Comparators.max(remainingDeadlineAtAttemptStart, Duration.ZERO)); + } + + if (sidebandData.getGfeTiming() != null) { + recorder.serverLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getClusterInfo(), + code, + sidebandData.getGfeTiming()); + } + + boolean seenServer = + Optional.ofNullable(sidebandData.getPeerInfo()) + .map(pe -> pe.getApplicationFrontendId() != 0) + .orElse(false); + + seenServer = + seenServer + || Optional.ofNullable(sidebandData.getPeerInfo()) + .map(rp -> !PeerInfo.getDefaultInstance().equals(rp)) + .orElse(false); + + seenServer = seenServer || (sidebandData.getGfeTiming() != null); + + if (seenServer) { + recorder.connectivityErrorCount.record( + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, 0); + } else { + recorder.connectivityErrorCount.record( + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, 1); + } + } + + @Override + public void setBatchWriteFlowControlTargetQps(double targetQps) { + recorder.batchWriteFlowControlTargetQps.record(clientInfo, methodInfo, targetQps); + } + + @Override + public void addBatchWriteFlowControlFactor( + double factor, @Nullable Throwable throwable, boolean applied) { + recorder.batchWriteFlowControlFactor.record( + clientInfo, extractStatus(throwable), applied, methodInfo, factor); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerFactory.java new file mode 100644 index 000000000000..8a41fd339ee5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerFactory.java @@ -0,0 +1,56 @@ +/* + * 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.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; + +/** + * {@link ApiTracerFactory} that will generate OpenTelemetry metrics by using the {@link ApiTracer} + * api. + */ +@InternalApi("For internal use only") +public class BuiltinMetricsTracerFactory extends BaseApiTracerFactory { + + private final MetricRegistry.RecorderRegistry recorder; + private final ClientInfo clientInfo; + + public static BuiltinMetricsTracerFactory create( + MetricRegistry.RecorderRegistry recorder, ClientInfo clientInfo) { + return new BuiltinMetricsTracerFactory(recorder, clientInfo); + } + + BuiltinMetricsTracerFactory(MetricRegistry.RecorderRegistry recorder, ClientInfo clientInfo) { + this.recorder = recorder; + this.clientInfo = clientInfo; + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + MethodInfo methodInfo = + MethodInfo.builder() + .setName(spanName.toString()) + .setStreaming(operationType == OperationType.ServerStreaming) + .build(); + return new BuiltinMetricsTracer(recorder, clientInfo, methodInfo); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java new file mode 100644 index 000000000000..2d53d119c1f3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java @@ -0,0 +1,102 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelObserver; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolObserver; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings.LoadBalancingStrategy; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; + +@InternalApi("For internal use only") +public class ChannelPoolMetricsTracer implements Runnable { + private static final Logger logger = Logger.getLogger(ChannelPoolMetricsTracer.class.getName()); + + private static final int SAMPLING_PERIOD_SECONDS = 60; + private final MetricRegistry.RecorderRegistry recorder; + private final ClientInfo clientInfo; + + private final AtomicReference bigtableChannelInsightsProviderRef = + new AtomicReference<>(); + private final AtomicReference lbPolicyRef = + new AtomicReference<>(LoadBalancingStrategy.ROUND_ROBIN); + + // Attributes for unary and streaming RPCs, built on demand in run() + + public ChannelPoolMetricsTracer(MetricRegistry.RecorderRegistry recorder, ClientInfo clientInfo) { + this.recorder = recorder; + this.clientInfo = clientInfo; + } + + /** + * Registers the provider for the channel pool entries. This should be called by the component + * that creates the BigtableChannelPool. + */ + public void registerChannelInsightsProvider(BigtableChannelPoolObserver channelInsightsProvider) { + this.bigtableChannelInsightsProviderRef.set(channelInsightsProvider); + } + + /** Register the current lb policy * */ + public void registerLoadBalancingStrategy(LoadBalancingStrategy lbPolicy) { + this.lbPolicyRef.set(lbPolicy); + } + + /** Starts the periodic collection. */ + public ScheduledFuture start(ScheduledExecutorService scheduler) { + return scheduler.scheduleAtFixedRate( + this, SAMPLING_PERIOD_SECONDS, SAMPLING_PERIOD_SECONDS, TimeUnit.SECONDS); + } + + @Override + public void run() { + BigtableChannelPoolObserver channelInsightsProvider = bigtableChannelInsightsProviderRef.get(); + if (channelInsightsProvider == null) { + logger.warning("No Bigtable ChannelPoolObserver available"); + return; // Not registered yet + } + List channelInsights = + channelInsightsProvider.getChannelInfos(); + if (channelInsights == null || channelInsights.isEmpty()) { + return; + } + + LoadBalancingStrategy lbPolicy = lbPolicyRef.get(); + + for (BigtableChannelObserver info : channelInsights) { + TransportType transportType = info.getTransportType(); + + long currentOutstandingUnaryRpcs = info.getOutstandingUnaryRpcs(); + long currentOutstandingStreamingRpcs = info.getOutstandingStreamingRpcs(); + + recorder.channelPoolOutstandingRpcs.record( + clientInfo, transportType, lbPolicy, false, currentOutstandingUnaryRpcs); + recorder.channelPoolOutstandingRpcs.record( + clientInfo, transportType, lbPolicy, true, currentOutstandingStreamingRpcs); + + long errors = info.getAndResetErrorCount(); + // Record errors with empty attributes. + recorder.perConnectionErrorCount.record(clientInfo, errors); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracer.java new file mode 100644 index 000000000000..d9362acb48bd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracer.java @@ -0,0 +1,265 @@ +/* + * 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.tracing.ApiTracer; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Combines multiple {@link ApiTracer}s and {@link BigtableTracer}s into a single {@link ApiTracer}. + */ +class CompositeTracer extends BigtableTracer { + private final List children; + private final List bigtableTracers; + private volatile int attempt; + + CompositeTracer(List children) { + ImmutableList.Builder childrenBuilder = ImmutableList.builder(); + ImmutableList.Builder bigtableTracerBuilder = ImmutableList.builder(); + + for (ApiTracer child : children) { + if (child instanceof BigtableTracer) { + bigtableTracerBuilder.add((BigtableTracer) child); + } + childrenBuilder.add(child); + } + this.children = childrenBuilder.build(); + this.bigtableTracers = bigtableTracerBuilder.build(); + } + + @Override + public Scope inScope() { + final List childScopes = new ArrayList<>(children.size()); + + for (ApiTracer child : children) { + childScopes.add(child.inScope()); + } + + return new Scope() { + @Override + public void close() { + for (Scope childScope : childScopes) { + childScope.close(); + } + } + }; + } + + @Override + public void operationFinishEarly() { + for (BigtableTracer tracer : bigtableTracers) { + tracer.operationFinishEarly(); + } + } + + @Override + public void operationSucceeded() { + for (ApiTracer child : children) { + child.operationSucceeded(); + } + } + + @Override + public void operationCancelled() { + for (ApiTracer child : children) { + child.operationCancelled(); + } + } + + @Override + public void operationFailed(Throwable error) { + for (ApiTracer child : children) { + child.operationFailed(error); + } + } + + @Override + public void connectionSelected(String id) { + for (ApiTracer child : children) { + child.connectionSelected(id); + } + } + + @Override + public void attemptStarted(int attemptNumber) { + attemptStarted(null, attemptNumber); + } + + @Override + public void attemptStarted(Object request, int attemptNumber) { + this.attempt = attemptNumber; + for (ApiTracer child : children) { + child.attemptStarted(request, attemptNumber); + } + } + + @Override + public void attemptSucceeded() { + for (ApiTracer child : children) { + child.attemptSucceeded(); + } + } + + @Override + public void attemptCancelled() { + for (ApiTracer child : children) { + child.attemptCancelled(); + } + } + + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + @Override + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + + @Override + public void attemptFailedDuration(Throwable error, java.time.Duration delay) { + for (ApiTracer child : children) { + child.attemptFailedDuration(error, delay); + } + } + + @Override + public void attemptFailedRetriesExhausted(Throwable error) { + for (ApiTracer child : children) { + child.attemptFailedRetriesExhausted(error); + } + } + + @Override + public void attemptPermanentFailure(Throwable error) { + for (ApiTracer child : children) { + child.attemptPermanentFailure(error); + } + } + + @Override + public void lroStartFailed(Throwable error) { + for (ApiTracer child : children) { + child.lroStartFailed(error); + } + } + + @Override + public void lroStartSucceeded() { + for (ApiTracer child : children) { + child.lroStartSucceeded(); + } + } + + @Override + public void responseReceived() { + for (ApiTracer child : children) { + child.responseReceived(); + } + } + + @Override + public void requestSent() { + for (ApiTracer child : children) { + child.requestSent(); + } + } + + @Override + public void batchRequestSent(long elementCount, long requestSize) { + for (ApiTracer child : children) { + child.batchRequestSent(elementCount, requestSize); + } + } + + @Override + public int getAttempt() { + return attempt; + } + + @Override + public void batchRequestThrottled(long throttledTimeMs) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.batchRequestThrottled(throttledTimeMs); + } + } + + @Override + public void setSidebandData(MetadataExtractorInterceptor.SidebandData sidebandData) { + for (BigtableTracer bigtableTracer : bigtableTracers) { + bigtableTracer.setSidebandData(sidebandData); + } + } + + @Override + public void onRequest(int requestCount) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.onRequest(requestCount); + } + } + + @Override + public void disableFlowControl() { + for (BigtableTracer tracer : bigtableTracers) { + tracer.disableFlowControl(); + } + } + + @Override + public void afterResponse(long applicationLatency) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.afterResponse(applicationLatency); + } + } + + @Override + public void grpcMessageSent() { + for (BigtableTracer tracer : bigtableTracers) { + tracer.grpcMessageSent(); + } + } + + @Override + public void setTotalTimeoutDuration(java.time.Duration totalTimeoutDuration) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.setTotalTimeoutDuration(totalTimeoutDuration); + } + } + + @Override + public void setBatchWriteFlowControlTargetQps(double targetQps) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.setBatchWriteFlowControlTargetQps(targetQps); + } + } + + @Override + public void addBatchWriteFlowControlFactor( + double factor, @Nullable Throwable status, boolean applied) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.addBatchWriteFlowControlFactor(factor, status, applied); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java new file mode 100644 index 000000000000..8b2606e955f0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java @@ -0,0 +1,45 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.List; + +/** Combines multiple {@link ApiTracerFactory} into a single {@link ApiTracerFactory}. */ +@InternalApi("For internal use only") +public class CompositeTracerFactory extends BaseApiTracerFactory { + private final List apiTracerFactories; + + public CompositeTracerFactory(List apiTracerFactories) { + this.apiTracerFactories = ImmutableList.copyOf(apiTracerFactories); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + List children = new ArrayList<>(apiTracerFactories.size()); + + for (ApiTracerFactory factory : apiTracerFactories) { + children.add(factory.newTracer(parent, spanName, operationType)); + } + return new CompositeTracer(children); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java new file mode 100644 index 000000000000..473c8c56811c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import java.time.Duration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class CompositeVRpcTracer implements VRpcTracer { + + private static final Logger logger = Logger.getLogger(CompositeVRpcTracer.class.getName()); + + private final List children; + + public CompositeVRpcTracer(List children) { + this.children = children; + } + + @Override + public void onOperationStart() { + children.forEach( + c -> { + try { + c.onOperationStart(); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log operation start on tracer {0}", + c.getClass().getName()); + } + }); + } + + @Override + public void onAttemptStart(Object req) { + children.forEach( + c -> { + try { + c.onAttemptStart(req); + } catch (Throwable e) { + logger.log( + Level.WARNING, "Failed to log attempt start on tracer {0}", c.getClass().getName()); + } + }); + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + children.forEach( + c -> { + try { + c.onRequestSent(peerInfo); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log request sent on tracer {0} for peer {1}", + new Object[] {c.getClass().getName(), peerInfo}); + } + }); + } + + @Override + public void onResponseReceived() { + children.forEach( + c -> { + try { + c.onResponseReceived(); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log response received on tracer {0}", + c.getClass().getName()); + } + }); + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) { + children.forEach( + c -> { + try { + c.recordApplicationBlockingLatencies(elapsed); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log application latencies on tracer {0} with duration {1}", + new Object[] {c.getClass().getName(), elapsed}); + } + }); + } + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + children.forEach( + c -> { + try { + c.onAttemptFinish(result); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log attempt finish on tracer {0} with result {1}", + new Object[] {c.getClass().getName(), result}); + } + }); + } + + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + children.forEach( + c -> { + try { + c.onOperationFinish(result); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log operation finish on tracer {0} with result {1}", + new Object[] {c.getClass().getName(), result}); + } + }); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java new file mode 100644 index 000000000000..e841f8b9bb8b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java @@ -0,0 +1,34 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; + +public abstract class DebugTagTracer { + + public abstract void record(TelemetryConfiguration.Level level, String tag); + + public abstract void setClientConfigurationManager(ClientConfigurationManager manager); + + public final void checkPrecondition( + boolean expression, String tag, String errorMessage, Object... args) { + if (!expression) { + record(TelemetryConfiguration.Level.ERROR, tag); + throw new IllegalStateException(String.format(errorMessage, args)); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java new file mode 100644 index 000000000000..4ba0f28ef5b8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import java.util.Optional; + +public class DebugTagTracerImpl extends DebugTagTracer { + + private final MetricRegistry.RecorderRegistry registry; + private final ClientInfo clientInfo; + + private Optional manager = Optional.empty(); + + public DebugTagTracerImpl(ClientInfo clientInfo, MetricRegistry.RecorderRegistry registry) { + this.clientInfo = clientInfo; + this.registry = registry; + } + + public void setClientConfigurationManager(ClientConfigurationManager manager) { + this.manager = Optional.of(manager); + } + + @Override + public void record(TelemetryConfiguration.Level level, String tag) { + if (shouldRecord(level)) { + registry.debugTagCount.record(clientInfo, tag, 1); + } + } + + private boolean shouldRecord(TelemetryConfiguration.Level level) { + TelemetryConfiguration.Level currentLevel = + manager + .map(m -> m.getClientConfiguration().getTelemetryConfiguration().getDebugTagLevel()) + .orElse(TelemetryConfiguration.Level.WARN); + return level.getNumber() >= currentLevel.getNumber(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracer.java new file mode 100644 index 000000000000..701e93ef0d61 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; + +/** Interface for recording DirectPath/DirectAccess eligibility metrics. */ +@InternalApi +public interface DirectPathCompatibleTracer { + + /** + * Records that the environment is eligible and successfully connected via DirectPath. + * + * @param ipProtocol The IP protocol used (e.g., "ipv6"). + */ + void recordSuccess(Util.IpProtocol ipProtocol); + + /** + * Records that the environment is not eligible or failed to connect via DirectPath. + * + * @param reason The reason for the failure (e.g., "routing_check_failed"). + */ + // TODO: Make this an enum + void recordFailure(DirectAccessInvestigator.FailureReason reason); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracerImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracerImpl.java new file mode 100644 index 000000000000..9995d1c90de1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracerImpl.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; +import com.google.common.base.Preconditions; + +@InternalApi +public class DirectPathCompatibleTracerImpl implements DirectPathCompatibleTracer { + private final ClientInfo clientInfo; + private final MetricRegistry.RecorderRegistry recorder; + + public DirectPathCompatibleTracerImpl( + ClientInfo clientInfo, MetricRegistry.RecorderRegistry recorder) { + this.clientInfo = Preconditions.checkNotNull(clientInfo); + this.recorder = Preconditions.checkNotNull(recorder); + } + + @Override + public void recordSuccess(Util.IpProtocol ipProtocol) { + recorder.dpCompatGuage.recordSuccess(clientInfo, ipProtocol.getValue()); + } + + @Override + public void recordFailure(DirectAccessInvestigator.FailureReason reason) { + recorder.dpCompatGuage.recordFailure(clientInfo, reason); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/Pacemaker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/Pacemaker.java new file mode 100644 index 000000000000..8a3771406aee --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/Pacemaker.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +public class Pacemaker implements Runnable { + + static final Duration PACEMAKER_INTERVAL = Duration.ofMillis(100); + + private final RecorderRegistry registry; + private final ClientInfo clientInfo; + private final String executorName; + + private Instant prev; + + public Pacemaker(RecorderRegistry registry, ClientInfo clientInfo, String name) { + this.prev = Instant.now(); + this.registry = registry; + this.clientInfo = clientInfo; + this.executorName = name; + } + + public ScheduledFuture start(ScheduledExecutorService executor) { + return executor.scheduleAtFixedRate( + this, + Pacemaker.PACEMAKER_INTERVAL.toMillis(), + Pacemaker.PACEMAKER_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + } + + @Override + public void run() { + Instant current = Instant.now(); + Duration delta = Duration.between(prev, current).minus(PACEMAKER_INTERVAL); + prev = current; + registry.pacemakerDelay.record( + clientInfo, executorName, delta.isNegative() ? Duration.ZERO : delta); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java new file mode 100644 index 000000000000..cb808b094ce8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java @@ -0,0 +1,25 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +public interface PoolFallbackListener { + public enum ChannelFallbackReason { + ERROR_RATE, + FALLBACK_DISABLE + }; + + void onFallback(String from, String to, ChannelFallbackReason reason); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java new file mode 100644 index 000000000000..154c3f8a3f65 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java @@ -0,0 +1,34 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; + +public class PoolFallbackListenerImpl implements PoolFallbackListener { + private final RecorderRegistry registry; + private final ClientInfo clientInfo; + + public PoolFallbackListenerImpl(RecorderRegistry registry, ClientInfo clientInfo) { + this.registry = registry; + this.clientInfo = clientInfo; + } + + @Override + public void onFallback(String from, String to, ChannelFallbackReason reason) { + registry.channelFallbackCount.record(clientInfo, 1, from, to, reason); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java new file mode 100644 index 000000000000..a9048490d769 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import io.grpc.Status; + +public interface SessionTracer { + + void onStart(); + + void onOpen(PeerInfo peerInfo); + + void onVRpcClose(Status.Code code); + + void onClose(PeerInfo peerInfo, CloseSessionReason reason, Status status); + + /** + * Record any metrics outside of the normal flow (ie periodically recording how long a session has + * been open). + * + * @return false if this tracker is done and will not have anymore metrics to record. + */ + boolean recordAsyncMetrics(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java new file mode 100644 index 000000000000..add572f28b7e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration.SessionCloseVRpcState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.base.Stopwatch; +import io.grpc.Status; +import io.grpc.Status.Code; + +public class SessionTracerImpl implements SessionTracer { + private final RecorderRegistry metricRegistry; + private final SessionPoolInfo poolInfo; + + private final Stopwatch uptime = Stopwatch.createUnstarted(); + + private enum State { + New, + Ready, + Closed + } + + private volatile State state = State.New; + private volatile boolean hasOkRpcs = false; + private volatile boolean hasErrorRpcs = false; + private volatile PeerInfo lastPeerInfo = SessionStream.DISCONNECTED_PEER_INFO; + + public SessionTracerImpl(RecorderRegistry metricRegistry, SessionPoolInfo sessionInfo) { + this.metricRegistry = metricRegistry; + this.poolInfo = sessionInfo; + } + + @Override + public void onStart() { + uptime.start(); + } + + @Override + public void onOpen(PeerInfo peerInfo) { + state = State.Ready; + lastPeerInfo = peerInfo; + + metricRegistry.sessionOpenLatency.record(poolInfo, peerInfo, Status.Code.OK, uptime.elapsed()); + } + + @Override + public void onVRpcClose(Status.Code code) { + if (code == Code.OK) { + hasOkRpcs = true; + } else { + hasErrorRpcs = true; + } + } + + @Override + public void onClose(PeerInfo peerInfo, CloseSessionReason reason, Status status) { + lastPeerInfo = peerInfo; + + if (state == State.New) { + metricRegistry.sessionOpenLatency.record( + poolInfo, peerInfo, status.getCode(), uptime.elapsed()); + } + + metricRegistry.sessionDuration.record( + poolInfo, + peerInfo, + status.getCode(), + reason, + SessionCloseVRpcState.find(hasOkRpcs, hasErrorRpcs), + state == State.Ready, + uptime.elapsed()); + + state = State.Closed; + } + + @Override + public boolean recordAsyncMetrics() { + if (state == State.Closed) { + return false; + } + metricRegistry.sessionUptime.record( + poolInfo, lastPeerInfo, state == State.Ready, uptime.elapsed()); + return true; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/TracedBatcherUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/TracedBatcherUnaryCallable.java new file mode 100644 index 000000000000..9b1b9764abba --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/TracedBatcherUnaryCallable.java @@ -0,0 +1,53 @@ +/* + * 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.tracing.ApiTracer; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; + +/** + * This callable will extract total throttled time from {@link ApiCallContext} and add it to {@link + * ApiTracer}. This class needs to be wrapped by a callable that injects the {@link ApiTracer}. + */ +@InternalApi +public final class TracedBatcherUnaryCallable + extends UnaryCallable { + private final UnaryCallable innerCallable; + + public TracedBatcherUnaryCallable(UnaryCallable innerCallable) { + this.innerCallable = innerCallable; + } + + @Override + public ApiFuture futureCall(RequestT request, ApiCallContext context) { + if (context.getOption(Batcher.THROTTLED_TIME_KEY) != null) { + ApiTracer tracer = context.getTracer(); + // this should always be true + if (tracer instanceof BigtableTracer) { + ((BigtableTracer) tracer) + .batchRequestThrottled( + java.time.Duration.ofMillis(context.getOption(Batcher.THROTTLED_TIME_KEY)) + .toNanos()); + } + } + return innerCallable.futureCall(request, context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java new file mode 100644 index 000000000000..e794036d5aa0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.api.gax.tracing.ApiTracer; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import java.time.Duration; +import java.util.concurrent.atomic.AtomicInteger; + +/* A VRpc tracer that wraps the legacy gax ApiTracer */ +public class UserApiVRpcTracer implements VRpcTracer { + + private final ApiTracer delegate; + private final AtomicInteger counter = new AtomicInteger(0); + private final TableName tableName; + private final String appProfileId; + private final VRpcDescriptor descriptor; + + public UserApiVRpcTracer( + ApiTracer apiTracer, SessionPoolInfo poolInfo, VRpcDescriptor descriptor) { + this.delegate = apiTracer; + this.tableName = + TableName.newBuilder() + .setProject(poolInfo.getClientInfo().getInstanceName().getProjectId()) + .setInstance(poolInfo.getClientInfo().getInstanceName().getInstanceId()) + .setTable(poolInfo.getName()) + .build(); + this.appProfileId = poolInfo.getClientInfo().getAppProfileId(); + this.descriptor = descriptor; + } + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object req) { + delegate.attemptStarted( + descriptor.toLegacyProto(tableName.toString(), appProfileId, req), + counter.getAndIncrement()); + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + delegate.requestSent(); + } + + @Override + public void onResponseReceived() { + delegate.responseReceived(); + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) {} + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + if (result.getStatus().isOk()) { + delegate.attemptSucceeded(); + } else { + delegate.attemptFailedDuration(result.getStatus().asException(), Duration.ZERO); + } + } + + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + if (result.getStatus().isOk()) { + delegate.operationSucceeded(); + } else { + delegate.operationFailed(result.getStatus().asException()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java new file mode 100644 index 000000000000..924bdd4d6006 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java @@ -0,0 +1,38 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import java.time.Duration; + +public interface VRpcTracer { + + void onOperationStart(); + + void onAttemptStart(Object request); + + void onRequestSent(PeerInfo peerInfo); + + void onResponseReceived(); + + void recordApplicationBlockingLatencies(Duration elapsed); + + void onAttemptFinish(VRpcResult result); + + void onOperationFinish(VRpcResult result); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java new file mode 100644 index 000000000000..0f20ae1a0214 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult.State; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.base.Stopwatch; +import io.grpc.Deadline; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +/** + * + * + *
+ * The following events happen in an operation:
+ * operation
+ *   attempt start
+ *     attempt waiting for session / channel
+ *     rpc sent from client
+ *     rpc waiting for grpc buffer to be ready
+ *     receive response from server and calls back app's listener
+ *   attempt finish
+ *   retry wait
+ *   attempt start again
+ *   ...
+ *   attempt finish
+ * operation finish
+ * 
+ */ +public class VRpcTracerImpl implements VRpcTracer { + private static final ClusterInformation UNKNOWN_CLUSTER = + ClusterInformation.newBuilder().setZoneId("global").setClusterId("").build(); + + private final RecorderRegistry metricRegistry; + private final SessionPoolInfo poolInfo; + private final MethodInfo methodInfo; + private final Deadline originalDeadline; + + private final Stopwatch attemptTimer = Stopwatch.createStarted(); // per attempt + private final Stopwatch operationTimer = Stopwatch.createStarted(); // per operation + private final Stopwatch clientBlockingTimer = Stopwatch.createStarted(); // per attempt + private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); // per operation + private Duration applicationBlockingLatency = Duration.ZERO; // per operation + private long remainingDeadline; // per attempt + + private final Stopwatch applicationBlockingTimer = Stopwatch.createUnstarted(); + private ClusterInformation lastClusterInfo; + private PeerInfo lastPeerInfo = SessionStream.DISCONNECTED_PEER_INFO; + + private int numAttempts = 0; + + private final boolean enableCustomMetric; + + public VRpcTracerImpl( + RecorderRegistry metricRegistry, + SessionPoolInfo poolInfo, + MethodInfo methodInfo, + Deadline deadline) { + this(metricRegistry, poolInfo, methodInfo, deadline, false); + } + + public VRpcTracerImpl( + RecorderRegistry metricRegistry, + SessionPoolInfo poolInfo, + MethodInfo methodInfo, + Deadline deadline, + boolean enableCustomMetric) { + this.metricRegistry = metricRegistry; + this.poolInfo = poolInfo; + this.methodInfo = methodInfo; + this.originalDeadline = deadline; + this.lastClusterInfo = UNKNOWN_CLUSTER; + this.enableCustomMetric = enableCustomMetric; + } + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object req) { + if (!attemptTimer.isRunning()) { + attemptTimer.reset().start(); + } + if (!clientBlockingTimer.isRunning()) { + clientBlockingTimer.reset().start(); + } + remainingDeadline = originalDeadline.timeRemaining(TimeUnit.MILLISECONDS); + numAttempts++; + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + this.lastPeerInfo = peerInfo; + if (clientBlockingTimer.isRunning()) { + clientBlockingTimer.stop(); + } + } + + @Override + public void onResponseReceived() { + if (firstResponsePerOpTimer.isRunning()) { + firstResponsePerOpTimer.stop(); + } + if (!applicationBlockingTimer.isRunning()) { + applicationBlockingTimer.reset().start(); + } + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) { + applicationBlockingLatency = applicationBlockingLatency.plus(elapsed); + } + + @Override + public void onAttemptFinish(VRpcResult result) { + attemptTimer.stop(); + + @SuppressWarnings("AssignmentExpression") + ClusterInformation clusterInfo = + lastClusterInfo = Optional.ofNullable(result.getClusterInfo()).orElse(UNKNOWN_CLUSTER); + + Duration attemptLatency = attemptTimer.elapsed(); + + metricRegistry.attemptLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + clusterInfo, + methodInfo, + result.getStatus().getCode(), + attemptLatency); + + metricRegistry.attemptLatency2.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + lastPeerInfo, + clusterInfo, + methodInfo, + result.getStatus().getCode(), + attemptLatency); + + if (enableCustomMetric) { + metricRegistry.customAttemptLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + lastPeerInfo, + clusterInfo, + methodInfo, + result.getStatus().getCode(), + attemptLatency); + } + + // TODO: what should be server latency? + // metricRegistry.serverLatency.record( + // poolInfo, methodInfo, clusterInfo, result.getStatus(), result.getServerLatency()); + + // If the result state is not SERVER_RESULT that means the vrpc failed before + // reaching the AFE and we increment the connectivity error counter. + metricRegistry.connectivityErrorCount.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + result.getStatus().getCode(), + (result.getState() != State.SERVER_RESULT) ? 1 : 0); + + metricRegistry.clientBlockingLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + clientBlockingTimer.elapsed()); + + metricRegistry.remainingDeadline.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + result.getStatus().getCode(), + Duration.ofMillis(remainingDeadline)); + + metricRegistry.transportLatency.record( + poolInfo, lastPeerInfo, methodInfo, attemptLatency.minus(result.getBackendLatency())); + } + + @Override + public void onOperationFinish(VRpcResult result) { + metricRegistry.operationLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + operationTimer.elapsed()); + metricRegistry.applicationBlockingLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + applicationBlockingLatency); + metricRegistry.firstResponseLantency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + firstResponsePerOpTimer.elapsed()); + metricRegistry.retryCount.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + numAttempts - 1); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/AlwaysEnabledDirectAccessChecker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/AlwaysEnabledDirectAccessChecker.java new file mode 100644 index 000000000000..307f55a18ddc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/AlwaysEnabledDirectAccessChecker.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import com.google.api.core.InternalApi; +import io.grpc.Channel; +import io.grpc.ManagedChannel; +import javax.annotation.Nullable; + +@InternalApi +public class AlwaysEnabledDirectAccessChecker implements DirectAccessChecker { + public static final AlwaysEnabledDirectAccessChecker INSTANCE = + new AlwaysEnabledDirectAccessChecker(); + + private AlwaysEnabledDirectAccessChecker() {} + + @Override + public boolean check(Channel channel) { + if (channel instanceof ManagedChannel) { + ((ManagedChannel) channel).shutdownNow(); + } + return true; + } + + @Override + public void investigateFailure(@Nullable Throwable originalError) { + // No-op: + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessChecker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessChecker.java new file mode 100644 index 000000000000..ea11be7ce921 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessChecker.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import io.grpc.Channel; +import io.grpc.ClientInterceptors; +import io.grpc.ManagedChannel; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Evaluates whether a given channel has Direct Access (DirectPath) routing by executing a RPC and + * inspecting the response headers. + */ +@InternalApi +public class ClassicDirectAccessChecker implements DirectAccessChecker { + private static final Logger LOG = Logger.getLogger(ClassicDirectAccessChecker.class.getName()); + private final DirectPathCompatibleTracer tracer; + private final ChannelPrimer channelPrimer; + private final ScheduledExecutorService executor; + + public ClassicDirectAccessChecker( + DirectPathCompatibleTracer tracer, + ChannelPrimer channelPrimer, + ScheduledExecutorService executor) { + this.tracer = Preconditions.checkNotNull(tracer); + this.channelPrimer = Preconditions.checkNotNull(channelPrimer); + this.executor = Preconditions.checkNotNull(executor); + } + + @VisibleForTesting + MetadataExtractorInterceptor createInterceptor() { + return new MetadataExtractorInterceptor(); + } + + @Override + public boolean check(Channel channel) { + try { + return evaluateEligibility(channel); + } catch (Exception e) { + investigateFailure(e); + LOG.log(Level.WARNING, "Failed to evaluate direct access eligibility.", e); + return false; + } finally { + if (channel instanceof ManagedChannel) { + ManagedChannel managedChannel = (ManagedChannel) channel; + managedChannel.shutdownNow(); + } + } + } + + /** Executes the underlying RPC and evaluates the eligibility. */ + private boolean evaluateEligibility(Channel channel) { + MetadataExtractorInterceptor interceptor = createInterceptor(); + Channel interceptedChannel = ClientInterceptors.intercept(channel, interceptor); + MetadataExtractorInterceptor.SidebandData sidebandData = interceptor.getSidebandData(); + boolean isEligible = false; + try { + channelPrimer.primeChannel(interceptedChannel); + isEligible = + Optional.ofNullable(sidebandData.getPeerInfo()) + .map(PeerInfo::getTransportType) + .map(type -> type == PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS) + .orElse(false); + } catch (StatusRuntimeException e) { + if (e.getStatus().getCode() != Code.PERMISSION_DENIED) { + throw e; + } + // Failed with permission error, resorting to ALTS check. + isEligible = sidebandData.isAlts(); + } + + if (isEligible) { + // getIp should be non-null as isEligible is true + tracer.recordSuccess(sidebandData.getIpProtocol()); + } else { + investigateFailure(null); + } + return isEligible; + } + + @Override + public void investigateFailure(@Nullable Throwable originalError) { + if (executor != null) { + executor.execute(() -> DirectAccessInvestigator.investigateAndReport(tracer, originalError)); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessChecker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessChecker.java new file mode 100644 index 000000000000..e6954d279da5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessChecker.java @@ -0,0 +1,38 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import com.google.api.core.InternalApi; +import io.grpc.Channel; + +@InternalApi +/* Evaluates whether a given channel supports Direct Access. */ +public interface DirectAccessChecker { + /** + * Evaluates if Direct Access is available by sending request via provided channel. + * + * @param channel A channel to probe direct access connectivity + * @return true if the channel is eligible for Direct Access + */ + boolean check(Channel channel); + + /** + * Triggers a investigation into why Direct Access routing failed. + * + * @param originalError An optional exception that caused the failure. + */ + void investigateFailure(Throwable originalError); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessInvestigator.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessInvestigator.java new file mode 100644 index 000000000000..2a80672d82d6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessInvestigator.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +@InternalApi +public class DirectAccessInvestigator { + private static final Logger LOG = Logger.getLogger(DirectAccessInvestigator.class.getName()); + + /** Metric reason codes for Direct Access failures. */ + public enum FailureReason { + NOT_IN_GCP("not_in_gcp"), + METADATA_UNREACHABLE("metadata_unreachable"), + NO_IP_ASSIGNED("no_ip_assigned"), + LOOPBACK_DOWN("loopback_misconfigured"), + LOOPBACK_V4_MISSING("loopback_misconfigured_ipv4"), + LOOPBACK_V6_MISSING("loopback_misconfigured_ipv6"), + USER_DISABLED("user_disabled"), + UNKNOWN("unknown"); + + private final String value; + + FailureReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + // This is only called when direct access check fails. + public static void investigateAndReport( + DirectPathCompatibleTracer tracer, @Nullable Throwable originalError) { + try { + // TODO: Implement checks in a future PR. + // For now, default to returning "unknown". + recordAndLog( + tracer, + FailureReason.UNKNOWN, + "Direct Access investigation: Defaulting to unknown failure reason for now.", + originalError); + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to record results of the Direct Access investigation", e); + } + } + + /** Helper method to consistently log the failure reason and record it to the tracer. */ + private static void recordAndLog( + DirectPathCompatibleTracer tracer, + FailureReason reason, + String logMessage, + @Nullable Throwable error) { + if (error != null) { + LOG.log(Level.FINE, logMessage, error); + } else { + LOG.log(Level.FINE, logMessage); + } + tracer.recordFailure(reason); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/NoopDirectAccessChecker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/NoopDirectAccessChecker.java new file mode 100644 index 000000000000..bf79fd547889 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/NoopDirectAccessChecker.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import com.google.api.core.InternalApi; +import io.grpc.Channel; +import io.grpc.ManagedChannel; +import javax.annotation.Nullable; + +@InternalApi +public class NoopDirectAccessChecker implements DirectAccessChecker { + public static final NoopDirectAccessChecker INSTANCE = new NoopDirectAccessChecker(); + + private NoopDirectAccessChecker() {} + + @Override + public boolean check(Channel channel) { + // We must shut down the temporary probe channel to prevent gRPC resource leaks! + if (channel instanceof ManagedChannel) { + ((ManagedChannel) channel).shutdownNow(); + } + // If it's disabled, it is never eligible. + return false; + } + + @Override + public void investigateFailure(@Nullable Throwable originalError) { + // Do nothing. We don't investigate failures if the feature is disabled. + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java new file mode 100644 index 000000000000..ded284e1979c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import com.google.common.util.concurrent.MoreExecutors; +import io.grpc.Context; +import io.grpc.Deadline; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +/** + * A {@link VRpc} decorator that propagates gRPC {@link Context} cancellation to the underlying + * VRpc. + */ +public class CancellableVRpc extends ForwardingVRpc { + private final Context context; + private final Context.CancellationListener cancellationListener; + + public CancellableVRpc(VRpc delegate, Context context) { + super(delegate); + this.context = context; + this.cancellationListener = + (c) -> { + boolean deadlineExceeded = + Optional.ofNullable(c.getDeadline()).map(Deadline::isExpired).orElse(false); + deadlineExceeded = deadlineExceeded && c.cancellationCause() instanceof TimeoutException; + // Let VRpc machinery handle deadline exceeded + if (!deadlineExceeded) { + delegate.cancel("gRPC context cancelled", c.cancellationCause()); + } + }; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + context.addListener(cancellationListener, MoreExecutors.directExecutor()); + super.start( + req, ctx, new CancellationCleanupListener<>(listener, context, cancellationListener)); + } + + private static class CancellationCleanupListener extends ForwardListener { + private final Context context; + private final Context.CancellationListener cancellationListener; + + private CancellationCleanupListener( + VRpcListener delegate, + Context context, + Context.CancellationListener cancellationListener) { + super(delegate); + this.context = context; + this.cancellationListener = cancellationListener; + } + + @Override + public void onClose(VRpcResult result) { + context.removeListener(cancellationListener); + super.onClose(result); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java new file mode 100644 index 000000000000..05173e6a9ef9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import javax.annotation.Nullable; + +/** Simple helper to delegate all calls to another {@link VRpc}. */ +public class ForwardingVRpc implements VRpc { + private final VRpc delegate; + + public ForwardingVRpc(VRpc delegate) { + this.delegate = delegate; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + delegate.start(req, ctx, listener); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + delegate.cancel(message, cause); + } + + @Override + public void requestNext() { + delegate.requestNext(); + } + + public static class ForwardListener implements VRpc.VRpcListener { + private final VRpc.VRpcListener delegate; + + public ForwardListener(VRpcListener delegate) { + this.delegate = delegate; + } + + @Override + public void onMessage(RespT msg) { + delegate.onMessage(msg); + } + + @Override + public void onClose(VRpcResult result) { + delegate.onClose(result); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java new file mode 100644 index 000000000000..d6048bfb9140 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java @@ -0,0 +1,340 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.common.base.Stopwatch; +import com.google.protobuf.Duration; +import com.google.protobuf.util.Durations; +import com.google.rpc.RetryInfo; +import io.grpc.Context; +import io.grpc.Status; +import io.grpc.SynchronizationContext; +import java.util.Optional; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +public class RetryingVRpc implements VRpc { + + private static final Logger LOG = Logger.getLogger(RetryingVRpc.class.getName()); + + private final Context grpcContext; + private final io.opentelemetry.context.Context otelContext; + + private final Supplier> attemptFactory; + private ReqT request; + private VRpcListener listener; + private VRpcCallContext context; + private VRpcTracer tracer; + + private final ScheduledExecutorService executor; + private final SynchronizationContext syncContext; + + // current state and all the flags don't need to be volatile because they're only updated within + // the sync context. + private State currentState; + private boolean started; + // Breaks the loop if uncaught exception happens during sync context execution. + private boolean isCancelling; + + public RetryingVRpc(Supplier> supplier, ScheduledExecutorService executor) { + this.attemptFactory = supplier; + + grpcContext = Context.current(); + otelContext = io.opentelemetry.context.Context.current(); + + this.executor = otelContext.wrap(executor); + this.syncContext = + new SynchronizationContext( + (t, e) -> { + this.cancel( + "Unexpected error while notifying the caller of RetryingVRpc. Trying to cancel" + + " vRpc to ensure consistent state", + e); + }); + + started = false; + isCancelling = false; + this.currentState = new Idle(); + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + syncContext.execute( + () -> { + if (started) { + listener.onClose( + VRpcResult.createRejectedError( + Status.FAILED_PRECONDITION.withDescription("operation is already started"))); + return; + } + started = true; + + this.request = req; + this.listener = listener; + this.context = ctx; + this.tracer = context.getTracer(); + + tracer.onOperationStart(); + currentState.onStart(); + }); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + syncContext.execute( + () -> { + if (currentState.isDone() || isCancelling) { + LOG.fine("Ignoring cancel because the vRPC is already cancelled or done."); + return; + } + // Prevents infinite loop if there's any error thrown during this phase. + isCancelling = true; + Throwable finalCause = cause; + try { + currentState.onCancel(message, cause); + } catch (Throwable t) { + if (finalCause != null) { + finalCause.addSuppressed(t); + } else { + finalCause = t; + } + } + onStateChange( + new Done( + VRpcResult.createRejectedError( + Status.CANCELLED.withDescription(message).withCause(finalCause)))); + }); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException("request next is not supported in unary"); + } + + void onStateChange(State state) { + syncContext.throwIfNotInThisSynchronizationContext(); + if (currentState.isDone()) { + return; + } + this.currentState = state; + currentState.onStart(); + } + + abstract static class State { + public abstract void onStart(); + + public void onCancel(String reason, Throwable throwable) {} + + public boolean isDone() { + return false; + } + } + + class Idle extends State { + + @Override + public void onStart() { + // initial request and retries will all start in idle state. + // TODO: When stream is supported we only transition to active state when + // caller is requesting more. And this should be part of the attempt time and app blocking + // time. + Active active = new Active(); + onStateChange(active); + } + } + + class Active extends State { + + private VRpc attempt; + + @Override + public void onStart() { + attempt = attemptFactory.get(); + tracer.onAttemptStart(request); + attempt.start( + request, + context, + new VRpcListener() { + @Override + public void onMessage(RespT msg) { + syncContext.execute( + () -> { + if (currentState != Active.this) { + LOG.log( + Level.FINE, + "Discarding response {0} because the attempt is no longer active.", + msg); + return; + } + tracer.onResponseReceived(); + Stopwatch appTimer = Stopwatch.createStarted(); + try { + listener.onMessage(msg); + } finally { + tracer.recordApplicationBlockingLatencies(appTimer.elapsed()); + } + }); + } + + @Override + public void onClose(VRpcResult result) { + syncContext.execute( + () -> { + tracer.onAttemptFinish(result); + if (currentState != Active.this) { + LOG.log( + Level.FINE, + "Discarding server close with result {0} because the the attempt is no" + + " longer active.", + result); + return; + } + if (shouldRetry(result)) { + context = context.createForNextAttempt(); + Duration retryDelay = + Optional.ofNullable(result.getRetryInfo()) + .map(RetryInfo::getRetryDelay) + .orElse(Durations.ZERO); + if (Durations.compare(retryDelay, Durations.ZERO) > 0) { + Scheduled scheduled = new Scheduled(retryDelay); + onStateChange(scheduled); + } else { + onStateChange(new Idle()); + } + return; + } + + onStateChange(new Done(result)); + }); + } + }); + } + + @Override + public void onCancel(String reason, Throwable throwable) { + // attempt could be null if attemptFactory.get() throws an exception. In which case sync + // context uncaught exception handler will be called, which calls cancel on the current + // state before transition into done state. + if (attempt != null) { + attempt.cancel(reason, throwable); + } + } + + boolean shouldRetry(VRpcResult result) { + // If the error has RetryInfo, it means it comes from the server and should + // be retried. + if (!result.getStatus().isOk() + && result.getRetryInfo() != null + && result.getRetryInfo().hasRetryDelay()) { + long retryDelay = Durations.toMillis(result.getRetryInfo().getRetryDelay()); + // only schedule retry if there's still a chance for the request to succeed + return context.getOperationInfo().getDeadline().timeRemaining(TimeUnit.MILLISECONDS) + - retryDelay + > 1; + } + // Do not retry result that is explicitly rejected + if (result.getRejected()) { + return false; + } + // If the error didn't leave the client or failed in transport and is idempotent, we + // can retry up to 3 times. + boolean isRetryable = + (result.getState() == VRpcResult.State.UNCOMMITED) + || (context.getOperationInfo().isIdempotent() + && result.getState() == VRpcResult.State.TRANSPORT_FAILURE); + if (isRetryable && context.getOperationInfo().getAttemptNumber() < 3) { + return true; + } + return false; + } + } + + class Scheduled extends State { + private final Duration retryDelay; + private SynchronizationContext.ScheduledHandle future; + + Scheduled(Duration retryDelay) { + this.retryDelay = retryDelay; + } + + @Override + public void onStart() { + try { + future = + syncContext.schedule( + () -> grpcContext.wrap(() -> onStateChange(new Idle())).run(), + Durations.toMillis(retryDelay), + TimeUnit.MILLISECONDS, + executor); + } catch (RejectedExecutionException e) { + onStateChange( + new Done( + VRpcResult.createRejectedError( + Status.CANCELLED + .withDescription( + "Executor shutting down, can't schedule operation for retry.") + .withCause(e)))); + } + } + + @Override + public void onCancel(String reason, Throwable throwable) { + // future can be null if schedule throws an exception that's not RejectedExecutionException. + // In which case sync context uncaught exception handler will be called, which calls cancel on + // the current + // state before transition into done state. + if (future != null && future.isPending()) { + future.cancel(); + } + } + } + + class Done extends State { + + private final VRpcResult result; + + Done(VRpcResult result) { + this.result = result; + } + + @Override + public void onStart() { + if (!started) { + LOG.fine("operation is not started yet."); + return; + } + Stopwatch appTimer = Stopwatch.createStarted(); + try { + listener.onClose(result); + } finally { + tracer.recordApplicationBlockingLatencies(appTimer.elapsed()); + tracer.onOperationFinish(result); + } + } + + @Override + public boolean isDone() { + return true; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java new file mode 100644 index 000000000000..a29a51fd72c6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java @@ -0,0 +1,328 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Ticker; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.Any; +import com.google.rpc.RetryInfo; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.protobuf.StatusProto; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Internal Bigtable representation of an RPC. + * + *

The primary intent is to model the RPC as a chain of composable middleware. This abstraction + * models Unary and ServerStreaming style RPCs by generalizing them as ServerStreaming. + */ +public interface VRpc { + + /** + * Start the RPC and send the request message. + * + *

This must be called before any other method on this object. The {@code listener} will be + * notified of the results. Please note, that the first response of the response stream will be + * delivered by default. + */ + void start(ReqT req, VRpcCallContext ctx, VRpcListener listener); + + /** Cancel a started RPC. This will be done by best effort. */ + void cancel(@Nullable String message, @Nullable Throwable cause); + + /** + * TBD - server streaming rpcs. This will be used to request more data. Unlike gRPC's request(n), + * starting a call will implicitly request the first message. + */ + void requestNext(); + + /** + * Bigtable specific version of ClientCall.Listener - simplified to only cater to client unary + * RPCs. Methods on this class are guaranteed to be called sequentially. + */ + interface VRpcListener { + + /** Called when the next response message is the received. */ + void onMessage(RespT msg); + + /** Called when the vRPC completes. */ + void onClose(VRpcResult result); + } + + /** vRPC side band data. */ + // TODO: set grpc deadline on callOptions or context + @AutoValue + abstract class VRpcCallContext { + + private static final Logger logger = Logger.getLogger(VRpcCallContext.class.getName()); + + /** Retry related metadata. */ + public abstract OperationInfo getOperationInfo(); + + /** The TraceId of the caller. */ + public abstract String getTraceParent(); + + public abstract VRpcTracer getTracer(); + + // TODO: csm + // Clientside metrics instrument + // public abstract BigtableTracer getTracer(); + + public static VRpcCallContext create( + Deadline deadline, boolean isIdempotent, VRpcTracer tracer) { + + Deadline grpcContextDeadline = Context.current().getDeadline(); + + Duration operationTimeout; + if (grpcContextDeadline != null && grpcContextDeadline.isBefore(deadline)) { + logger.log( + Level.FINE, + "grpc Context deadline {} is shorter than VrpcCallContext deadline {}", + new Object[] {grpcContextDeadline, deadline}); + operationTimeout = + Duration.ofNanos(grpcContextDeadline.timeRemaining(TimeUnit.NANOSECONDS)); + } else { + operationTimeout = Duration.ofNanos(deadline.timeRemaining(TimeUnit.NANOSECONDS)); + } + + return new AutoValue_VRpc_VRpcCallContext( + OperationInfo.create(operationTimeout, isIdempotent), "TODO", tracer); + } + + public VRpcCallContext createForNextAttempt() { + return new AutoValue_VRpc_VRpcCallContext( + getOperationInfo().createForNextAttempt(), getTraceParent(), getTracer()); + } + } + + /** Sideband data required for retries and/or hedging. */ + @AutoValue + abstract class OperationInfo { + /** + * Monotonically increasing number of retry attempt per operation. Starts with 0 for the + * original attempt. + */ + public abstract int getAttemptNumber(); + + /** + * When the caller started the operation (ie. when the first attempt was sent). This is the + * machine time. + */ + abstract long getOperationStartTickNs(); + + /** + * Original timeout of the operation (OperationStart + OperationTimeout = original deadline). + */ + public abstract Duration getOperationTimeout(); + + /** If it's safe to retry the vRPC after its been commited. */ + public abstract boolean isIdempotent(); + + abstract Ticker getTicker(); + + public Deadline getDeadline() { + return Deadline.after( + getOperationTimeout().toNanos() + getOperationStartTickNs() - getTicker().read(), + TimeUnit.NANOSECONDS); + } + + /** Create a new copy of the {@link OperationInfo} for the next retry/heding attempt. */ + public OperationInfo createForNextAttempt() { + return new AutoValue_VRpc_OperationInfo( + getAttemptNumber() + 1, + getOperationStartTickNs(), + getOperationTimeout(), + isIdempotent(), + getTicker()); + } + + /** Create new {@link OperationInfo} for the first attempt. */ + public static OperationInfo create(Duration operationTimeout, boolean isIdempotent) { + return create(Ticker.systemTicker(), operationTimeout, isIdempotent); + } + + @VisibleForTesting + static OperationInfo create(Ticker ticker, Duration operationTimeout, boolean isIdempotent) { + return new AutoValue_VRpc_OperationInfo( + 0, ticker.read(), operationTimeout, isIdempotent, ticker); + } + } + + /** Represents the final state of a vRPC. */ + @AutoValue + abstract class VRpcResult { + /** + * Describes how far the vRPC progressed prior to failure: + * + *

+ *
{@code UNCOMMITED} + *
The vRPC never left the client + *
{@code TRANSPORT_FAILURE} + *
The vRPC failed due to transport + *
{@code SERVER_RESULT} + *
The vRPC result was explicitly communicated by the server + *
{@code USER_FAILURE} + *
The vRPC failed due to errors in users callback + *
+ */ + public enum State { + UNCOMMITED, + TRANSPORT_FAILURE, + SERVER_RESULT, + USER_FAILURE + } + + /** + * How far the vRPC progressed before reaching terminal state. + * + * @see State + */ + public abstract State getState(); + + public abstract Status getStatus(); + + /** The status details. */ + @Nullable + protected abstract List getDetails(); + + /** + * Side channel metadata for client side metrics - describes the cluster that handled the + * request. + */ + @Nullable + public abstract ClusterInformation getClusterInfo(); + + /** Latency returned in SessionRequestStats. */ + public abstract Duration getBackendLatency(); + + /** Server directed retries. */ + // Server directed retries + @Nullable + public abstract RetryInfo getRetryInfo(); + + /** If the vrpc should be rejected for retry. */ + public abstract boolean getRejected(); + + public static VRpcResult createUncommitedError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.UNCOMMITED, status, ImmutableList.of(), null, Duration.ZERO, null, false); + } + + public static VRpcResult createRejectedError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.UNCOMMITED, status, ImmutableList.of(), null, Duration.ZERO, null, true); + } + + /** + * vRPC failed because the underlying transport failed. We don't know if the vRPC made it to the + * nodes, so we must assume complete uncertainty. + */ + public static VRpcResult createRemoteTransportError(Status transportStatus, Metadata trailers) { + Status status = Status.UNAVAILABLE.withDescription("vRPC failed due to transport error"); + + if (transportStatus.getCause() != null) { + status = status.withCause(transportStatus.getCause()); + } else { + status = + status.augmentDescription( + String.format( + "Transport error: %s: %s", + transportStatus.getCode(), transportStatus.getDescription())); + } + + List details = + StatusProto.fromStatusAndTrailers(transportStatus, trailers).getDetailsList(); + + return new AutoValue_VRpc_VRpcResult( + // TODO: need clusterInfo + State.TRANSPORT_FAILURE, status, details, null, Duration.ZERO, null, false); + } + + /** + * vRPC failed because the underlying transport failed. We don't know if the the vRPC made it to + * the nodes, so we must assume complete uncertainty. + */ + public static VRpcResult createLocalTransportError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.TRANSPORT_FAILURE, status, null, null, Duration.ZERO, null, false); + } + + public static VRpcResult createUserError(Throwable throwable) { + return new AutoValue_VRpc_VRpcResult( + State.USER_FAILURE, + Status.CANCELLED + .withCause(throwable) + .withDescription("Cancelling RPC due to exception thrown by user callback"), + ImmutableList.of(), + null, + Duration.ZERO, + // TODO: use server retry delay if available + null, + true); + } + + /** Wrap an OK from the server. */ + public static VRpcResult createServerOk(VirtualRpcResponse r) { + return new AutoValue_VRpc_VRpcResult( + State.SERVER_RESULT, + Status.OK, + ImmutableList.of(), + normalizeClusterInfo(r.getClusterInfo()), + Duration.ofSeconds( + r.getStats().getBackendLatency().getSeconds(), + r.getStats().getBackendLatency().getNanos()), + null, + false); + } + + /** Wrap the error response from the server. */ + public static VRpcResult createServerError(ErrorResponse r) { + Status grpcStatus = + Status.fromCodeValue(r.getStatus().getCode()).withDescription(r.getStatus().getMessage()); + return new AutoValue_VRpc_VRpcResult( + State.SERVER_RESULT, + grpcStatus, + r.getStatus().getDetailsList(), + normalizeClusterInfo(r.getClusterInfo()), + Duration.ZERO, + r.getRetryInfo(), + false); + } + + @Nullable + private static ClusterInformation normalizeClusterInfo(ClusterInformation clusterInformation) { + if (ClusterInformation.getDefaultInstance().equals(clusterInformation)) { + return null; + } + return clusterInformation; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/package-info.java new file mode 100644 index 000000000000..bd02f2a63f20 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/package-info.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 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. + */ + +/** + * Internal implementation helpers used by the client. + * + *

Classes defined here do not have a stable API and change without deprecation. + */ +@InternalApi +package com.google.cloud.bigtable.data.v2.internal; + +import com.google.api.core.InternalApi; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java new file mode 100644 index 000000000000..1d932a865b6c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 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. + */ + +package com.google.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * A Picker that delegates to a concrete Picker implementation based on the current configuration. + */ +class DynamicPicker extends Picker { + private static final Logger LOGGER = Logger.getLogger(DynamicPicker.class.getName()); + private final SessionList sessions; + + private volatile Picker delegate; + private volatile LoadBalancingOptions currentOptions; + + public DynamicPicker(SessionList sessions, LoadBalancingOptions initialOptions) { + this.sessions = sessions; + this.currentOptions = initialOptions; + this.delegate = createPicker(initialOptions); + } + + @Override + public Optional pickSession() { + return delegate.pickSession(); + } + + public void updateConfig(SessionClientConfiguration.SessionPoolConfiguration config) { + LoadBalancingOptions newOptions = config.getLoadBalancingOptions(); + if (!newOptions.equals(currentOptions)) { + delegate = createPicker(newOptions); + currentOptions = newOptions; + } + } + + private Picker createPicker(LoadBalancingOptions options) { + switch (options.getLoadBalancingStrategyCase()) { + case RANDOM: + return new SimplePicker(sessions, options.getRandom()); + case LEAST_IN_FLIGHT: + return new LeastInFlightPicker(sessions, options.getLeastInFlight()); + case PEAK_EWMA: + return new LeastLatencyPicker(sessions, options.getPeakEwma()); + default: + LOGGER.log( + Level.FINE, + "got load balancing strategy {0} which was not implemented", + options.getLoadBalancingStrategyCase()); + return new LeastInFlightPicker( + sessions, LoadBalancingOptions.LeastInFlight.getDefaultInstance()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java new file mode 100644 index 000000000000..fe6cd7becabd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.AfeHandle; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; + +/** Pick the AFE with the fewest in-flight requests. */ +class LeastInFlightPicker extends Picker { + private final SessionList sessionList; + private final LoadBalancingOptions.LeastInFlight options; + + public LeastInFlightPicker(SessionList sessionList, LoadBalancingOptions.LeastInFlight options) { + this.sessionList = sessionList; + this.options = options; + } + + @Override + Optional pickSession() { + List readyAfes = sessionList.getAfesWithReadySessions(); + if (readyAfes.isEmpty()) { + return Optional.empty(); + } + + ThreadLocalRandom rng = ThreadLocalRandom.current(); + List candidates = new ArrayList<>(readyAfes); + int bestCost = Integer.MAX_VALUE; + AfeHandle bestAfe = null; + long iterations = readyAfes.size(); + if (options.getRandomSubsetSize() > 0) { + iterations = Math.min(options.getRandomSubsetSize(), iterations); + } + + // Partial Fisher-Yates shuffle. + for (int i = 0; i < iterations; i++) { + int randomIndex = i + rng.nextInt(candidates.size() - i); + AfeHandle picked = candidates.get(randomIndex); + if (picked.getNumOutstanding() < bestCost) { + bestCost = picked.getNumOutstanding(); + bestAfe = picked; + } + // Move candidate to the `i`th entry so that it's not picked again. + Collections.swap(candidates, i, randomIndex); + } + return sessionList.checkoutSession(bestAfe); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastLatencyPicker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastLatencyPicker.java new file mode 100644 index 000000000000..c4e264b1fa3b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastLatencyPicker.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.AfeHandle; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; + +/** Pick the AFE with the least latency. Experimental for now. */ +class LeastLatencyPicker extends Picker { + private final SessionList sessionList; + private final LoadBalancingOptions.PeakEwma options; + + public LeastLatencyPicker(SessionList sessionList, LoadBalancingOptions.PeakEwma options) { + this.sessionList = sessionList; + this.options = options; + } + + @Override + Optional pickSession() { + List readyAfes = sessionList.getAfesWithReadySessions(); + if (readyAfes.isEmpty()) { + return Optional.empty(); + } + + ThreadLocalRandom rng = ThreadLocalRandom.current(); + List candidates = new ArrayList<>(readyAfes); + double bestCost = Double.MAX_VALUE; + AfeHandle bestAfe = null; + long iterations = readyAfes.size(); + + if (options.getRandomSubsetSize() > 0) { + iterations = Math.min(options.getRandomSubsetSize(), iterations); + } + + // Partial Fisher-Yates shuffle. + for (int i = 0; i < iterations; i++) { + int randomIndex = i + rng.nextInt(candidates.size() - i); + AfeHandle picked = candidates.get(randomIndex); + if (picked.getE2eCost() < bestCost) { + bestCost = picked.getE2eCost(); + bestAfe = picked; + } + // Move candidate to the `i`th entry so that it's not picked again. + Collections.swap(candidates, i, randomIndex); + } + return sessionList.checkoutSession(bestAfe); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java new file mode 100644 index 000000000000..ce4bc5a68c98 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java @@ -0,0 +1,24 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.Optional; + +abstract class Picker { + abstract Optional pickSession(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java new file mode 100644 index 000000000000..01a83a661486 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.rpc.Status; +import javax.annotation.CheckReturnValue; + +class PoolSizer { + + // Fraction of idle sessions to keep in order to manage an increase in requests-in-flight. For + // example, a headroom of 50% will keep enough sessions to deal with a 50% increase in QPS or a + // 50% increase in latency (since that also increases requests-in-flight). + private volatile float idlesSessionHeadRoom; + private volatile int minIdleSessions; + private volatile int maxIdleSessions; + + private final PoolStats stats; + private final Sized pendingRpcs; + + // This resolves cold start overprovisioning issue. + // Session creation sometimes involves creating new connection and warming the backend. + // So it takes time, but accumulated vRPCs may be processed rather quickly as simple + // point reads are expected to complete within 1-4ms. + // We assume that it is okay to collect 10 pending calls per starting session so that after + // the session is ready it takes 10-40ms to process all pending calls. + private volatile int pendingVRpcsPerSession; + + interface Sized { + int getSize(); + } + + PoolSizer( + PoolStats stats, + Sized pendingRpcs, + SessionClientConfiguration.SessionPoolConfiguration poolConfig) { + this.stats = stats; + this.pendingRpcs = pendingRpcs; + + this.idlesSessionHeadRoom = poolConfig.getHeadroom(); + this.minIdleSessions = poolConfig.getMinSessionCount(); + this.maxIdleSessions = poolConfig.getMaxSessionCount(); + this.pendingVRpcsPerSession = poolConfig.getNewSessionQueueLength(); + } + + void updateConfig(SessionClientConfiguration.SessionPoolConfiguration poolConfiguration) { + this.idlesSessionHeadRoom = poolConfiguration.getHeadroom(); + this.minIdleSessions = poolConfiguration.getMinSessionCount(); + this.maxIdleSessions = poolConfiguration.getMaxSessionCount(); + this.pendingVRpcsPerSession = poolConfiguration.getNewSessionQueueLength(); + } + + public int getScaleDelta() { + // Assume each session handles 1 RPC at a time. This should be revisited if sessions get + // support for multiplexing. + int effectivePending = (int) Math.ceil((float) pendingRpcs.getSize() / pendingVRpcsPerSession); + int sessionsInUse = effectivePending + stats.getInUseCount(); + int unboundedDesiredIdleSessions = (int) Math.ceil(sessionsInUse * idlesSessionHeadRoom); + int desiredIdleSessions = + Math.max(Math.min(unboundedDesiredIdleSessions, maxIdleSessions), minIdleSessions); + + int desiredCapacity = sessionsInUse + desiredIdleSessions; + int eventualCapacity = stats.getExpectedCapacity(); + int immediateCapacity = eventualCapacity - stats.getStartingCount(); + + if (desiredCapacity < immediateCapacity) { + return desiredCapacity - immediateCapacity; + } else if (desiredCapacity > eventualCapacity) { + return desiredCapacity - eventualCapacity; + } else { + return 0; + } + } + + /** Returns true if the session should be replaced */ + @CheckReturnValue + public boolean handleGoAway(GoAwayResponse msg) { + return getScaleDelta() >= 0; + } + + /** Returns true if the closed session should be replaced */ + @CheckReturnValue + boolean handleSessionClose(Status statusProto) { + return getScaleDelta() >= 0; + } + + /** Returns true if a new session should be added. */ + @CheckReturnValue + boolean handleNewCall() { + return getScaleDelta() > 0; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java new file mode 100644 index 000000000000..35f8f98bc571 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Instant; + +/** + * A Bigtable abstraction over a bidirectional {@link io.grpc.ClientCall} to treat it as a stateful + * vRPC transport. + */ +public interface Session { + /** State transitions of Session, will happen in defined order */ + enum SessionState { + NEW(0), + STARTING(1), + READY(2), + CLOSING(3), + WAIT_SERVER_CLOSE(4), + CLOSED(5); + + final int phase; + + SessionState(int phase) { + this.phase = phase; + } + } + + @AutoValue + abstract class OpenParams { + abstract Metadata metadata(); + + abstract OpenSessionRequest request(); + + static OpenParams create(Metadata metadata, OpenSessionRequest request) { + return new AutoValue_Session_OpenParams(metadata, request); + } + + OpenParams withResetConsecutiveAttempt() { + return new AutoValue_Session_OpenParams( + metadata(), request().toBuilder().setConsecutiveFailedConnectionAttempts(0).build()); + } + + OpenParams withIncrementedAttempts() { + return new AutoValue_Session_OpenParams( + metadata(), + request().toBuilder() + .setConsecutiveFailedConnectionAttempts( + request().getConsecutiveFailedConnectionAttempts() + 1) + .build()); + } + } + + SessionState getState(); + + Instant getLastStateChange(); + + OpenParams getOpenParams(); + + boolean isOpenParamsUpdated(); + + PeerInfo getPeerInfo(); + + String getLogName(); + + Instant getNextHeartbeat(); + + /** + * Start the session by sending the opening message. + * + *

This must be the first method called on the {@link Session}. It will try setup a session + * using the req (for the server) and headers (for rls). + */ + void start(OpenSessionRequest req, Metadata headers, Listener sessionListener); + + /** + * Caller instructed close of the Session. Will immediately close the session and abort all + * outstanding vRPCs. + */ + void close(CloseSessionRequest req); + + /** Force close a session. */ + void forceClose(CloseSessionRequest reason); + + /** + * Start a new vRPC. This method can only be called after {@link + * Listener#onReady(OpenSessionResponse)} has been notified. + */ + VRpc newCall( + VRpcDescriptor descriptor) throws IllegalStateException; + + /** Callback for Session lifecycyle transitions. Methods are called sequentially. */ + interface Listener { + + void onReady(OpenSessionResponse msg); + + void onGoAway(GoAwayResponse msg); + + void onClose(SessionState prevState, Status status, Metadata trailers); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java new file mode 100644 index 000000000000..bfa8dd2213a9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.common.annotations.VisibleForTesting; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.concurrent.NotThreadSafe; + +@NotThreadSafe +class SessionCreationBudget { + private static final Logger DEFAULT_LOGGER = + Logger.getLogger(SessionCreationBudget.class.getName()); + + // TODO: add a metric for session can't be created because there's no budget + private volatile int maxConcurrentRequest; + private volatile Duration penalty; + private final Clock clock; + + private int concurrentRequests = 0; + + // Whenever a session creation failed, add the time to the list + private final List delayedCreationTokens = new ArrayList<>(); + + static SessionCreationBudget create(int max, Duration penalty) { + return new SessionCreationBudget(max, penalty, Clock.systemUTC()); + } + + @VisibleForTesting + SessionCreationBudget(int max, Duration penalty, Clock clock) { + this.maxConcurrentRequest = max; + this.penalty = penalty; + this.clock = clock; + } + + Instant getNextAvailableBudget() { + if (concurrentRequests < maxConcurrentRequest) { + return Instant.now(); + } + + if (delayedCreationTokens.isEmpty()) { + return Instant.now(); + } + + return delayedCreationTokens.get(0); + } + + boolean tryReserveSession() { + sanityCheck(); + + if (concurrentRequests == maxConcurrentRequest) { + drainCreationFailures(); + } + + if (concurrentRequests == maxConcurrentRequest) { + return false; + } + + concurrentRequests++; + return true; + } + + void onSessionCreationFailure() { + delayedCreationTokens.add(Instant.now(clock).plus(penalty)); + } + + void onSessionCreationSuccess() { + concurrentRequests--; + } + + private void drainCreationFailures() { + Instant now = Instant.now(clock); + Iterator iter = delayedCreationTokens.listIterator(); + while (iter.hasNext()) { + if (iter.next().isBefore(now)) { + concurrentRequests--; + iter.remove(); + } else { + // The list should be roughly sorted. Exit early when we encounter + // something expires later. + break; + } + } + } + + private void sanityCheck() { + // This could happen if the budget is updated + if (concurrentRequests < 0) { + DEFAULT_LOGGER.log( + Level.FINE, + "concurrent request can't be negative: {0}. Resetting it to 0.", + concurrentRequests); + concurrentRequests = 0; + } + if (concurrentRequests > maxConcurrentRequest) { + DEFAULT_LOGGER.log( + Level.FINE, + "Concurrent requests out of range: {0}. Resetting it to max.", + concurrentRequests); + concurrentRequests = maxConcurrentRequest; + } + } + + public int getMaxConcurrentRequest() { + return maxConcurrentRequest; + } + + void updateConfig(SessionClientConfiguration.SessionPoolConfiguration config) { + int oldBudget = this.maxConcurrentRequest; + this.maxConcurrentRequest = config.getNewSessionCreationBudget(); + this.penalty = SessionUtil.toJavaDuration(config.getNewSessionCreationPenalty()); + DEFAULT_LOGGER.log( + Level.FINE, + "updated session creation budget from {0} to {1}.", + new Object[] {oldBudget, config.getNewSessionCreationBudget()}); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java new file mode 100644 index 000000000000..20246775b6cb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import io.grpc.CallOptions; +import io.grpc.MethodDescriptor; + +/** Wrapper around a channel to centralize per call session customizations. */ +public final class SessionFactory { + private final ChannelPool channelPool; + private final MethodDescriptor methodDescriptor; + private final CallOptions callOptions; + + public SessionFactory( + ChannelPool channelPool, + MethodDescriptor methodDescriptor, + CallOptions callOptions) { + this.channelPool = channelPool; + this.methodDescriptor = methodDescriptor; + this.callOptions = callOptions; + } + + public SessionStream createNew() { + return channelPool.newStream(methodDescriptor, callOptions); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java new file mode 100644 index 000000000000..a2ef4f619821 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.HeartbeatResponse; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.SessionRefreshConfig; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcImpl.VRpcSessionApi; +import com.google.common.annotations.VisibleForTesting; +import com.google.protobuf.Message; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.Locale; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** Wraps a Bidi ClientCall and layers session semantics on top. */ +@VisibleForTesting +public class SessionImpl implements Session, VRpcSessionApi { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(SessionImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private static final SessionParametersResponse DEFAULT_SESSION_PARAMS = + SessionParametersResponse.newBuilder().setKeepAlive(Durations.fromMillis(100)).build(); + + static final Duration HEARTBEAT_CHECK_INTERVAL = + Duration.ofMillis(Durations.toMillis(DEFAULT_SESSION_PARAMS.getKeepAlive())); + + @VisibleForTesting + // A time in the future to skip heartbeat checks when there's no active vRPCs on the session + static final Duration FUTURE_TIME = Duration.ofMinutes(30); + + /* + * This lock should be mostly uncontended - all access should be naturally interleaved. Contention + * can only really happen when an unsolicited gRPC control message (ie GOAWAY) arrives at the same + * time as newCall or cancel. + * TODO: Contention will increase when multiplexing is implemented. + */ + private final Object lock = new Object(); + + private final Clock clock; + + private final SessionTracer tracer; + private final DebugTagTracer debugTagTracer; + + private final SessionInfo info; + + @GuardedBy("lock") + private final SessionStream stream; + + @GuardedBy("lock") + private SessionState state = SessionState.NEW; + + @GuardedBy("lock") + private Instant lastStateChangedAt; + + private Listener sessionListener; + + private volatile OpenParams openParams; + + private volatile boolean openParamsUpdated; + + @Nullable private CloseSessionRequest closeReason = null; + + @GuardedBy("lock") + private long nextRpcId = 1; + + // TODO: replace with a map when implementing multiplexing + @GuardedBy("lock") + private VRpcImpl currentRpc = null; + + @GuardedBy("lock") + private VRpcResult currentCancel = null; + + private SessionParametersResponse sessionParameters = DEFAULT_SESSION_PARAMS; + private Duration heartbeatInterval = + Duration.ofMillis(Durations.toMillis(sessionParameters.getKeepAlive())); + + private volatile Instant nextHeartbeat; + + public SessionImpl( + Metrics metrics, SessionPoolInfo poolInfo, long sessionNum, SessionStream stream) { + this(metrics, Clock.systemUTC(), poolInfo, sessionNum, stream); + } + + SessionImpl( + Metrics metrics, + Clock clock, + SessionPoolInfo poolInfo, + long sessionNum, + SessionStream stream) { + this.clock = clock; + this.info = SessionInfo.create(poolInfo, sessionNum); + this.stream = stream; + this.tracer = metrics.newSessionTracer(poolInfo); + this.debugTagTracer = metrics.getDebugTagTracer(); + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + this.openParamsUpdated = false; + } + + @Override + public SessionState getState() { + synchronized (lock) { + return state; + } + } + + @Override + public Instant getLastStateChange() { + synchronized (lock) { + return lastStateChangedAt; + } + } + + @Override + public OpenParams getOpenParams() { + return openParams; + } + + @Override + public boolean isOpenParamsUpdated() { + return openParamsUpdated; + } + + @Override + public Instant getNextHeartbeat() { + return nextHeartbeat; + } + + @Override + public PeerInfo getPeerInfo() { + // This lock might not be necessary, its populated once on a gRPC callback which should + // establish a happens before relationship. However access to the underlying stream is guarded + // with errorprone, so sync block is required to get around the lint. + // TODO: consider removing the sync block + synchronized (lock) { + return stream.getPeerInfo(); + } + } + + @Override + public String getLogName() { + return info.getLogName(); + } + + @Override + public void forceClose(CloseSessionRequest closeReason) { + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_force_close_wrong_state", + "Tried to forceClose an unstarted session %s in state %s", + info.getLogName(), + state); + + if (state == SessionState.CLOSED) { + return; + } + + updateState(SessionState.WAIT_SERVER_CLOSE); + this.closeReason = closeReason; + + // Not sending the CloseSessionRequest because cancel() will just drop it + stream.forceClose(closeReason.getDescription(), null); + // Listeners will be notified by dispatchStreamClosed + } + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + synchronized (lock) { + debugTagTracer.checkPrecondition( + state == SessionState.NEW, + "session_start_wrong_state", + "Tried to start a started session, current state: %s", + state); + + logger.fine(String.format("Starting session %s", info.getLogName())); + tracer.onStart(); + + updateState(SessionState.STARTING); + openParams = OpenParams.create(headers, req); + this.sessionListener = sessionListener; + + SessionRequest wrappedReq = SessionRequest.newBuilder().setOpenSession(req).build(); + stream.start( + new SessionStream.Listener() { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) {} + + @Override + public void onMessage(SessionResponse message) { + dispatchResponseMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + dispatchStreamClosed(status, trailers); + } + }, + headers); + + stream.sendMessage(wrappedReq); + } + } + + @Override + public void close(CloseSessionRequest req) { + logger.fine(String.format("Closing session %s for reason: %s", info.getLogName(), req)); + + synchronized (lock) { + // Throw an exception because this is a bug and we dont have a listener + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_close_wrong_state", + "Session error: Caller tried to close session %s before starting it with the reason: %s", + info.getLogName(), + req); + + // Multiple close is a no-op + if (state.phase >= SessionState.CLOSING.phase) { + logger.fine( + String.format( + "Session error: Caller tried to close a session %s that is %s for reason: %s", + info.getLogName(), state, req)); + return; + } + + closeReason = req; + updateState(SessionState.CLOSING); + + if (currentRpc == null) { + startGracefulClose(); + } + } + } + + /** Wraps the flow of closing a session. */ + @GuardedBy("lock") + private void startGracefulClose() { + debugTagTracer.checkPrecondition( + state == SessionState.CLOSING, + "session_graceful_close_wrong_state", + "Session error: %s tried to actuate session closing when not in the correct state. State:" + + " %s", + info.getLogName(), + state); + + // TODO: send metrics + updateState(SessionState.WAIT_SERVER_CLOSE); + + // Should never happen + if (closeReason == null) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_close_no_reason"); + logger.log( + Level.WARNING, + String.format("%s graceful shutdown started without a reason", info.getLogName()), + new IllegalStateException("Tried to close a session without a reason")); + // Synthesize a reason so that we let the server know of the problem instead + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription("Started graceful shutdown close without a reason set") + .build(); + } + stream.sendMessage(SessionRequest.newBuilder().setCloseSession(closeReason).build()); + // TODO: remove this after the server is updated + stream.halfClose(); + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) { + debugTagTracer.checkPrecondition( + descriptor.getSessionDescriptor().getType() == info.getPoolInfo().getType(), + "session_new_call_wrong_type", + "wrong VRpc descriptor type"); + + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_new_call_wrong_state", + "Session error: newCall called before start"); + + long rpcId = nextRpcId; + nextRpcId = Math.incrementExact(nextRpcId); + return new VRpcImpl<>(this, descriptor, rpcId, stream.getPeerInfo(), debugTagTracer); + } + } + + @Override + public Status startRpc(VRpcImpl rpc, VirtualRpcRequest payload) { + // start monitoring for heartbeat when the vrpc is started + this.nextHeartbeat = clock.instant().plus(heartbeatInterval); + + synchronized (lock) { + if (currentRpc != null) { + return Status.INTERNAL.withDescription( + "Session error: RPC multiplexing is not yet supported"); + } + if (state != SessionState.READY) { + return Status.INTERNAL.withDescription( + "Session error: Session was not ready, state = " + state); + } + + this.currentRpc = rpc; + stream.sendMessage(SessionRequest.newBuilder().setVirtualRpc(payload).build()); + return Status.OK; + } + } + + @Override + public void cancelRpc(long rpcId, @Nullable String message, @Nullable Throwable cause) { + synchronized (lock) { + if (currentRpc != null && rpcId == currentRpc.rpcId) { + currentCancel = + VRpcResult.createRejectedError( + Status.CANCELLED.withDescription(message).withCause(cause)); + } + // do nothing if the rpc is already finished + } + } + + // region SessionStream event handlers + private void dispatchResponseMessage(SessionResponse message) { + switch (message.getPayloadCase()) { + case OPEN_SESSION: + handleOpenSessionResponse(message.getOpenSession()); + break; + case SESSION_PARAMETERS: + handleSessionParamsResponse(message.getSessionParameters()); + break; + case GO_AWAY: + handleGoAwayResponse(message.getGoAway()); + break; + case VIRTUAL_RPC: + handleVRpcResponse(message.getVirtualRpc()); + break; + case HEARTBEAT: + handleHeartBeatResponse(message.getHeartbeat()); + break; + case SESSION_REFRESH_CONFIG: + handleSessionRefreshConfigResponse(message.getSessionRefreshConfig()); + break; + case ERROR: + handleVRpcErrorResponse(message.getError()); + break; + case PAYLOAD_NOT_SET: + default: + handleUnknownResponseMessage(message); + } + } + + private void handleOpenSessionResponse(OpenSessionResponse openSession) { + logger.fine(String.format("%s Session is ready", info.getLogName())); + + PeerInfo localPeerInfo; + + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_open_wrong_state", + "Got session open response before session started"); + debugTagTracer.checkPrecondition( + state != SessionState.CLOSED, + "session_open_wrong_state", + "Got session open response after session was closed"); + + if (state != SessionState.STARTING) { + logger.fine(String.format("Stream was already %s when session open was received", state)); + return; + } + localPeerInfo = stream.getPeerInfo(); + updateState(SessionState.READY); + } + tracer.onOpen(localPeerInfo); + sessionListener.onReady(openSession); + } + + private void handleSessionParamsResponse(SessionParametersResponse resp) { + synchronized (lock) { + if (state.phase >= SessionState.CLOSING.phase) { + logger.fine( + String.format("Stream was already %s when session params were received", state)); + return; + } + + if (!sessionParameters.equals(resp)) { + this.sessionParameters = resp; + this.heartbeatInterval = + Duration.ofMillis(Durations.toMillis(sessionParameters.getKeepAlive())); + logger.log( + Level.CONFIG, + () -> + String.format( + "%s session params changed: %s", + info.getLogName(), + TextFormat.printer().emittingSingleLine(true).printToString(resp))); + } + } + } + + private void handleVRpcResponse(VirtualRpcResponse vrpc) { + // TODO: when stream is supported this should be updated to the next expected time instead of + // session life time + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + VRpcImpl localRpc; + VRpcResult localCancel; + + boolean needsClose; + + synchronized (lock) { + if (state.phase > SessionState.CLOSING.phase) { + debugTagTracer.record( + TelemetryConfiguration.Level.WARN, "session_closed_discard_vrpc_response"); + logger.warning( + String.format( + "%s Discarding vRPC error because session is past the CLOSING phase with the" + + " reason: %s", + info.getLogName(), closeReason)); + return; + } + + debugTagTracer.checkPrecondition( + state == SessionState.READY || state == SessionState.CLOSING, + "session_vrpc_response_wrong_state", + "Unexpected vRPC response when session is %s", + state); + debugTagTracer.checkPrecondition( + currentRpc != null, "session_vrpc_null", "Got vRPC response but current vRPC is unset"); + debugTagTracer.checkPrecondition( + currentRpc.rpcId == vrpc.getRpcId(), + "session_vrpc_id_mismatch", + "Got vRPC response for the wrong vRPC: expect: %s, actual: %s", + currentRpc.rpcId, + vrpc.getRpcId()); + + // reset state of the current rpc + localCancel = currentCancel; + currentCancel = null; + localRpc = currentRpc; + // TODO: handle multiplexing + currentRpc = null; + needsClose = (state == SessionState.CLOSING); + } + + if (localCancel != null) { + tracer.onVRpcClose(localCancel.getStatus().getCode()); + localRpc.handleError(localCancel); + } else { + tracer.onVRpcClose(Status.OK.getCode()); + localRpc.handleResponse(vrpc); + } + if (needsClose) { + synchronized (lock) { + if (state == SessionState.CLOSING) { + startGracefulClose(); + } + } + } + } + + private void handleHeartBeatResponse(HeartbeatResponse ignored) { + this.nextHeartbeat = clock.instant().plus(heartbeatInterval); + } + + private void handleSessionRefreshConfigResponse(SessionRefreshConfig config) { + synchronized (lock) { + Metadata grpcMetadata = new Metadata(); + config + .getMetadataList() + .forEach( + entry -> + grpcMetadata.put( + Metadata.Key.of(entry.getKey(), Metadata.ASCII_STRING_MARSHALLER), + entry.getValue().toStringUtf8())); + openParams = OpenParams.create(grpcMetadata, config.getOptimizedOpenRequest()); + openParamsUpdated = true; + } + } + + private void handleVRpcErrorResponse(ErrorResponse error) { + // Skips the heartbeat check when there's no active vrpc on the session + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + + VRpcImpl localRpc; + boolean needsClose; + VRpcResult localCancel; + + synchronized (lock) { + if (state.phase > SessionState.CLOSING.phase) { + debugTagTracer.record( + TelemetryConfiguration.Level.WARN, "session_closed_discard_vrpc_response"); + logger.warning( + String.format( + "%s Discarding vRPC error because session is past the CLOSING phase with the" + + " reason: %s, error was: %s", + info.getLogName(), closeReason, error)); + return; + } + + debugTagTracer.checkPrecondition( + state == SessionState.READY || state == SessionState.CLOSING, + "session_vrpc_response_wrong_state", + "Unexpected vRPC response when session is %s", + state); + + debugTagTracer.checkPrecondition( + currentRpc != null, "session_vrpc_null", "Got vRPC response but current vRPC is unset"); + debugTagTracer.checkPrecondition( + currentRpc.rpcId == error.getRpcId(), + "session_vrpc_id_mismatch", + "Got vRPC response for the wrong vRPC: expect: %s, actual: %s", + currentRpc.rpcId, + error.getRpcId()); + + // reset the state of the current rpc + localCancel = currentCancel; + currentCancel = null; + localRpc = currentRpc; + currentRpc = null; + needsClose = (state == SessionState.CLOSING); + } + + if (localCancel != null) { + tracer.onVRpcClose(localCancel.getStatus().getCode()); + localRpc.handleError(localCancel); + } else { + tracer.onVRpcClose(Status.fromCodeValue(error.getStatus().getCode()).getCode()); + localRpc.handleError(VRpcResult.createServerError(error)); + } + if (needsClose) { + synchronized (lock) { + if (state == SessionState.CLOSING) { + startGracefulClose(); + } + } + } + } + + private void handleGoAwayResponse(GoAwayResponse goAwayResponse) { + synchronized (lock) { + if (state.phase >= SessionState.CLOSING.phase) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_go_away_ignored"); + logger.warning( + String.format( + "Session error: %s Ignoring goaway because session is %s", + info.getLogName(), state)); + return; + } + + debugTagTracer.checkPrecondition( + state.phase >= SessionState.STARTING.phase, + "session_go_away_wrong_state", + "Unexpected goaway when session is %s", + state); + + updateState(SessionState.CLOSING); + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_GOAWAY) + .setDescription( + "Server sent GO_AWAY_" + goAwayResponse.getReason().toUpperCase(Locale.ENGLISH)) + .build(); + if (currentRpc == null) { + startGracefulClose(); + } + } + sessionListener.onGoAway(goAwayResponse); + } + + private void handleUnknownResponseMessage(SessionResponse message) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_unknown_response"); + logger.warning(String.format("%s Unknown control message: %s", info.getLogName(), message)); + } + + private void dispatchStreamClosed(Status status, Metadata trailers) { + SessionState prevState; + VRpcImpl localVRpc; + + PeerInfo localPeerInfo; + synchronized (lock) { + prevState = state; + + if (!status.isOk()) { + String augmentedDescription = + Optional.ofNullable(status.getDescription()).map(d -> d + ". ").orElse("") + + "PeerInfo: " + + formatPeerInfo(getPeerInfo()); + + status = status.withDescription(augmentedDescription); + } + + if (state == SessionState.WAIT_SERVER_CLOSE) { + logger.fine(String.format("%s closed normally with status %s", info.getLogName(), status)); + } else { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_abnormal_close"); + // Unexpected path + String msg = + String.format( + "Session error: %s session closed unexpectedly in state %s. Status: %s", + info.getLogName(), state, status); + logger.warning(msg); + + if (state == SessionState.CLOSED) { + return; + } + + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription("Unexpected session close with status: " + status.getCode()) + .build(); + } + + localVRpc = currentRpc; + localPeerInfo = stream.getPeerInfo(); + currentRpc = null; + updateState(SessionState.CLOSED); + } + + if (localVRpc != null) { + try { + localVRpc.handleSessionClose(VRpcResult.createRemoteTransportError(status, trailers)); + } catch (Throwable t) { + logger.log( + Level.WARNING, + String.format( + "Session error: %s Unhandled exception while notifying vRpc of session closure" + + " status %s", + info.getLogName(), status), + t); + } + tracer.onVRpcClose(Status.UNAVAILABLE.getCode()); + } + tracer.onClose(localPeerInfo, closeReason.getReason(), status); + sessionListener.onClose(prevState, status, trailers); + } + + @GuardedBy("lock") + private void updateState(SessionState newState) { + this.state = newState; + this.lastStateChangedAt = clock.instant(); + } + + private static String formatPeerInfo(PeerInfo peerInfo) { + if (peerInfo == null) { + return "null"; + } + return TextFormat.printer().emittingSingleLine(true).printToString(peerInfo); + } + // endregion +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java new file mode 100644 index 000000000000..a3c4bf1d7397 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java @@ -0,0 +1,33 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.auto.value.AutoValue; + +@AutoValue +public abstract class SessionInfo { + public abstract SessionPoolInfo getPoolInfo(); + + public abstract String getLogName(); + + public abstract boolean isReady(); + + static SessionInfo create(SessionPoolInfo poolInfo, long sessionNum) { + String logName = String.format("%s-%d", poolInfo.getLogName(), sessionNum); + return new AutoValue_SessionInfo(poolInfo, logName, false); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java new file mode 100644 index 000000000000..061e7e197c17 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java @@ -0,0 +1,444 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_MISSED_HEARTBEAT; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.common.annotations.VisibleForTesting; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.concurrent.NotThreadSafe; + +/** + * A data structure to track sessions through their lifecycle transitions. + * + *

Each session will be wrapped in a SessionHandle to track per Session state. + * + *

This class is not thread safe and requires external synchronization. + */ +@NotThreadSafe +class SessionList { + private static final Logger LOG = Logger.getLogger(SessionList.class.getName()); + + static final Duration SESSION_LIST_PRUNE_INTERVAL = Duration.ofMinutes(10); + + // List of afes that have sessions that are ready now. + private final List afesWithReadySessions = new ArrayList<>(); + // A map of all recently used Afes with possibly empty sessions + private final Map afeHandles = new HashMap<>(); + // All the sessions being tracked by this SessionList including: + // - ones that are in use + // - starting sessions + // - closing sessions + private final Set allSessions = new HashSet<>(); + private final Set inUseSessions = new HashSet<>(); + + private final CloseSessionRequest missedHeartbeatCloseRequest = + CloseSessionRequest.newBuilder() + .setReason(CLOSE_SESSION_REASON_MISSED_HEARTBEAT) + .setDescription("missed heartbeat") + .build(); + + // pool level statistics across all the afes + private final PoolStats poolStats = new PoolStats(); + + /** Entrypoint for a session's lifecycle */ + SessionHandle newHandle(Session session) { + SessionHandle h = new SessionHandle(session); + allSessions.add(h); + poolStats.startingCount++; + poolStats.expectedCapacity++; + return h; + } + + /** Get {@link PoolStats} */ + PoolStats getStats() { + return poolStats; + } + + Set getAllSessions() { + return allSessions; + } + + List getAfesWithReadySessions() { + return Collections.unmodifiableList(afesWithReadySessions); + } + + /** + * Gets the next ready session from the afe. This will be called when a vrpc is about to be + * started, it is called by the {@link Picker}. + */ + public Optional checkoutSession(AfeHandle afeHandle) { + Optional maybeHandle = Optional.ofNullable(afeHandle.sessions.poll()); + + maybeHandle.ifPresent( + handle -> { + poolStats.readyCount--; + poolStats.inUseCount++; + inUseSessions.add(handle); + if (handle.afe.get().sessions.isEmpty()) { + afesWithReadySessions.remove(afeHandle); + } + }); + + return maybeHandle; + } + + /** Closes all the sessions with this reason. */ + void close(CloseSessionRequest req) { + // Notify all sessions to close and have the callbacks clean up the rest of the state + for (SessionHandle s : allSessions) { + s.getSession().close(req); + } + } + + void prune() { + Instant now = Instant.now(); + Instant horizon = now.minus(SESSION_LIST_PRUNE_INTERVAL); + + Iterator> it = afeHandles.entrySet().iterator(); + while (it.hasNext()) { + Entry e = it.next(); + AfeHandle handle = e.getValue(); + if (handle.refCount > 0) { + continue; + } + if (handle.lastConnected.isBefore(horizon)) { + continue; + } + it.remove(); + } + } + + void checkHeartbeat(Clock clock) { + Instant now = clock.instant(); + inUseSessions.forEach( + handle -> { + if (now.isAfter(handle.getSession().getNextHeartbeat())) { + LOG.log( + Level.WARNING, + "Missed heartbeat for {0}, forcing session close", + handle.getSession().getLogName()); + handle.getSession().forceClose(missedHeartbeatCloseRequest); + } + }); + } + + @NotThreadSafe + class SessionHandle { + private final Session session; + private boolean inExpectedCount = true; + + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + private Optional afe = Optional.empty(); + + SessionHandle(Session session) { + this.session = session; + } + + Session getSession() { + return session; + } + + /** First transition in the happy path - server acknowledged the session */ + void onSessionStarted() { + PeerInfo peerInfo = session.getPeerInfo(); + + AfeHandle afeHandle = + afeHandles.computeIfAbsent(AfeId.extract(peerInfo), (ignored) -> new AfeHandle()); + this.afe = Optional.of(afeHandle); + afeHandle.sessions.add(this); + afeHandle.refCount++; + afeHandle.lastConnected = Instant.now(); + if (afeHandle.sessions.size() == 1) { + afesWithReadySessions.add(afeHandle); + } + + poolStats.startingCount--; + poolStats.readyCount++; + } + + /** + * The session is returned to the pool after use. This undoes what SessionList#checkoutSession + */ + void onVRpcFinish(Duration elapsed, VRpcResult result) { + // Guaranteed to be set - vrpc can only start after the session is ready + AfeHandle afeHandle = this.afe.get(); + + poolStats.inUseCount--; + inUseSessions.remove(this); + + if (result.getStatus().isOk()) { + afeHandle.updateLatency(elapsed, result.getBackendLatency()); + } + + if (session.getState() == SessionState.READY) { + poolStats.readyCount++; + afeHandle.sessions.add(this); + afeHandle.lastConnected = Instant.now(); + + // If this is the first session returned to the pool, transition the afe to ready list + if (afeHandle.sessions.size() == 1) { + afesWithReadySessions.add(afeHandle); + } + } + } + + /** + * Server started graceful refresh. The session is still available, but a replacement is being + * searched for. + */ + void onSessionClosing() { + // The session could get a goaway before it started, which means it has not been + // associated with an afe. + // Also the session could get a goaway when its either idle or in use. + boolean wasReady = false; + + // if afe is not present, the session has not started, so skip this + if (afe.isPresent()) { + wasReady = afe.get().sessions.remove(this); + + if (afe.get().sessions.isEmpty()) { + afesWithReadySessions.remove(afe.get()); + } + } + + if (wasReady) { + poolStats.readyCount--; + } + // eagerly decrement expected count and make sure to avoid double counting in onSessionClosed + poolStats.expectedCapacity--; + inExpectedCount = false; + } + + void onSessionClosed(SessionState prevState) { + if (inExpectedCount) { + poolStats.expectedCapacity--; + inExpectedCount = false; + } + // only update counts after the session started and has an afe associated + afe.ifPresent(afeHandle -> afeHandle.refCount--); + + // NOTE: don't need to update vRpc counters, onVRpcFinish will have been invoked already + switch (prevState) { + case NEW: + throw new IllegalStateException("NEW session was closed"); + case STARTING: + poolStats.startingCount--; + break; + case READY: + { + AfeHandle afeHandle = afe.get(); + // If the session was available & idle, then we need to remove it + if (afeHandle.sessions.remove(this)) { + poolStats.readyCount--; + if (afeHandle.sessions.isEmpty()) { + afesWithReadySessions.remove(afeHandle); + } + } + break; + } + case CLOSING: + case WAIT_SERVER_CLOSE: + // noop + break; + case CLOSED: + throw new IllegalStateException("double close"); + } + + allSessions.remove(this); + } + } + + /** Simple counters for the sessions contained in this list. */ + @NotThreadSafe + static class PoolStats { + private int startingCount; + private int readyCount; + private int inUseCount; + private int expectedCapacity; + + PoolStats() { + reset(); + } + + void reset() { + startingCount = 0; + readyCount = 0; + inUseCount = 0; + expectedCapacity = 0; + } + + /** Number of Sessions that are being prepped, but not ready for use. */ + int getStartingCount() { + return startingCount; + } + + /** Number of Sessions ready for immediate use. */ + int getReadyCount() { + return readyCount; + } + + /** + * Number of Sessions that are in use and thus unavailable. This includes sessions that will not + * be returned to the pool because they will be closed when the go idle. + */ + int getInUseCount() { + return inUseCount; + } + + /** + * Number of sessions should be usable in the short term future. Includes sessions that are + * starting, idle and in used. + */ + int getExpectedCapacity() { + return expectedCapacity; + } + + @VisibleForTesting + TestHelper getTestHelper() { + return new TestHelper(); + } + + @Override + public String toString() { + return String.format( + "PoolStats{startingCount=%d, readyCount=%d, inUseCount=%d, expectedCapacity=%d}", + startingCount, readyCount, inUseCount, expectedCapacity); + } + + @VisibleForTesting + class TestHelper { + void setStartingCount(int n) { + startingCount = n; + } + + void setReadyCount(int n) { + readyCount = n; + } + + void setExpectedCapacity(int n) { + expectedCapacity = n; + } + + void setInUseCount(int n) { + inUseCount = n; + } + } + } + + /** Typesafe wrapper around the applicationFrontendId the server sent us */ + @AutoValue + abstract static class AfeId { + protected abstract long getId(); + + static AfeId extract(PeerInfo peerInfo) { + return new AutoValue_SessionList_AfeId(peerInfo.getApplicationFrontendId()); + } + } + + static class AfeHandle { + // All sessions in the queue are ready to be used + @VisibleForTesting final Queue sessions; + // Last time this afe was used. It will be consulted when we need to garbage collect + // afe that have disappeared + private Instant lastConnected = Instant.now(); + // Tracks number ready and inUse sessions, also used for garbage collection + private int refCount = 0; + + private final PeakEwma transportLatency = new PeakEwma(Duration.of(500, ChronoUnit.MICROS)); + private final PeakEwma e2eLatency = new PeakEwma(Duration.ofMillis(1)); + + public AfeHandle() { + sessions = new ArrayDeque<>(); + } + + void updateLatency(Duration e2eLatency, Duration backendLatency) { + this.transportLatency.update(e2eLatency.minus(backendLatency)); + this.e2eLatency.update(e2eLatency); + } + + double getTransportCost() { + return transportLatency.getCost(); + } + + double getE2eCost() { + return e2eLatency.getCost(); + } + + int getNumOutstanding() { + return refCount - sessions.size(); + } + } + + static class PeakEwma { + // Use the last 10s as a look back window + private final double decayNs = TimeUnit.SECONDS.toNanos(10); + private long timestamp = System.nanoTime(); + private double cost; + + public PeakEwma(Duration initialLatency) { + this.cost = initialLatency.toNanos(); + } + + public double getCost() { + return cost; + } + + void update(Duration rtt) { + if (rtt.compareTo(Duration.ZERO) <= 0) { + LOG.warning("Ignoring latency<= 0: " + rtt); + return; + } + + long now = System.nanoTime(); + long rttNs = rtt.toNanos(); + + if (cost < rttNs) { + this.cost = rttNs; + } else { + long elapsed = Math.max(now - timestamp, 0); + double decay = Math.exp(-elapsed / decayNs); + double recency = 1.0 - decay; + this.cost = cost * decay + rttNs * recency; + } + this.timestamp = now; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java new file mode 100644 index 000000000000..0b8cd1cdaea6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java @@ -0,0 +1,37 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import io.grpc.Metadata; + +public interface SessionPool { + void start(OpenReqT openReq, Metadata md); + + VRpc newCall( + VRpcDescriptor desc); + + void close(CloseSessionRequest req); + + SessionPoolInfo getInfo(); + + int getConsecutiveUnimplementedFailures(); + + boolean hasSession(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java new file mode 100644 index 000000000000..35884cb74319 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java @@ -0,0 +1,845 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.api.Util; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.ForwardingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.Listener; +import com.google.cloud.bigtable.data.v2.internal.session.Session.OpenParams; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Stopwatch; +import com.google.protobuf.ByteString; +import com.google.protobuf.Message; +import io.grpc.CallOptions; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.protobuf.StatusProto; +import io.opentelemetry.context.Scope; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +public class SessionPoolImpl implements SessionPool { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(SessionPoolImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private enum PoolState { + NEW, + STARTED, + CLOSED + } + + private static final int PROTOCOL_VERSION = 0; + + private final Metrics metrics; + private final FeatureFlags featureFlags; + private final SessionPoolInfo info; + private long sessionNum = 0; + private final SessionFactory factory; + private final SessionDescriptor descriptor; + + // Set once by start(), and read by both user & grpc threads + private volatile OpenParams openParams; + + @GuardedBy("this") + private PoolState poolState = PoolState.NEW; + + @VisibleForTesting + @GuardedBy("this") + final SessionList sessions; + + @GuardedBy("this") + private final DynamicPicker picker; + + @GuardedBy("this") + private final PoolSizer poolSizer; + + // TODO: we need to close pendingVRpcs when deadline expires + @GuardedBy("this") + private final Deque> pendingRpcs = new ArrayDeque<>(); + + private final Watchdog watchdog; + + @GuardedBy("this") + private int consecutiveFailures = 0; + + /** + * When the client fallback to a non-session AFE session creation will return unimplemented + * errors. In which case the requests should fallback to classic client instead of waiting for an + * available session. + */ + private volatile int consecutiveUnimplementedFailures = 0; + + private final ScheduledFuture afeListPruneTask; + + private final ScheduledFuture heartbeatMonitor; + + private final ScheduledExecutorService executorService; + + @GuardedBy("this") + private ScheduledFuture retryCreateSessionFuture = null; + + // TODO: get the max from ClientConfiguration + @GuardedBy("this") + private final SessionCreationBudget budget; + + private final ClientConfigurationManager configManager; + private final ClientConfigurationManager.ListenerHandle configListenerHandle; + + private final DebugTagTracer debugTagTracer; + + @SuppressWarnings("GuardedBy") + public SessionPoolImpl( + Metrics metrics, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + SessionDescriptor sessionDescriptor, + String name, + ScheduledExecutorService executorService) { + this( + metrics, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + sessionDescriptor, + name, + executorService, + createInitialBudget(configManager.getClientConfiguration())); + } + + @SuppressWarnings("GuardedBy") + @VisibleForTesting + SessionPoolImpl( + Metrics metrics, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + SessionDescriptor sessionDescriptor, + String name, + ScheduledExecutorService executorService, + SessionCreationBudget budget) { + this.metrics = metrics; + this.featureFlags = featureFlags; + this.info = SessionPoolInfo.create(clientInfo, sessionDescriptor, name); + this.factory = + new SessionFactory(channelPool, sessionDescriptor.getMethodDescriptor(), callOptions); + this.descriptor = sessionDescriptor; + this.executorService = executorService; + + sessions = new SessionList(); + LoadBalancingOptions lbOptions = + configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration() + .getLoadBalancingOptions(); + picker = new DynamicPicker(sessions, lbOptions); + poolSizer = + new PoolSizer( + sessions.getStats(), + pendingRpcs::size, + configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration()); + + debugTagTracer = metrics.getDebugTagTracer(); + + // Watchdog checks for sessions in WAIT_SERVER_CLOSE state and runs every 5 minutes + watchdog = new Watchdog(this, executorService, Duration.ofMinutes(5), sessions, debugTagTracer); + // Heartbeat monitor checks for sessions in READY state with active vRPCs and runs more + // frequently + heartbeatMonitor = + executorService.scheduleAtFixedRate( + () -> { + synchronized (SessionPoolImpl.this) { + sessions.checkHeartbeat(Clock.systemUTC()); + } + }, + SessionImpl.HEARTBEAT_CHECK_INTERVAL.toMillis(), + SessionImpl.HEARTBEAT_CHECK_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + afeListPruneTask = + executorService.scheduleAtFixedRate( + () -> { + synchronized (SessionPoolImpl.this) { + sessions.prune(); + } + }, + SessionList.SESSION_LIST_PRUNE_INTERVAL.toMillis(), + SessionList.SESSION_LIST_PRUNE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + + this.budget = budget; + + this.configManager = configManager; + this.configListenerHandle = + configManager.addListener( + clientConfig -> clientConfig.getSessionConfiguration().getSessionPoolConfiguration(), + newConfig -> { + synchronized (SessionPoolImpl.this) { + budget.updateConfig(newConfig); + poolSizer.updateConfig(newConfig); + picker.updateConfig(newConfig); + } + }); + } + + @Override + public SessionPoolInfo getInfo() { + return info; + } + + @Override + public void close(CloseSessionRequest req) { + configListenerHandle.close(); + + synchronized (this) { + if (poolState == PoolState.CLOSED) { + logger.fine(String.format("Tried to close a closed SessionPool %s", info.getLogName())); + return; + } + logger.fine(String.format("Closing session pool %s for reason %s", info.getLogName(), req)); + + poolState = PoolState.CLOSED; + + for (PendingVRpc pendingRpc : pendingRpcs) { + pendingRpc.cancel("SessionPool closed: " + req, null); + } + afeListPruneTask.cancel(false); + heartbeatMonitor.cancel(false); + if (retryCreateSessionFuture != null) { + retryCreateSessionFuture.cancel(false); + retryCreateSessionFuture = null; + } + watchdog.close(); + sessions.close(req); + } + } + + @Override + public synchronized void start(OpenReqT openReq, Metadata md) { + Preconditions.checkState(poolState == PoolState.NEW); + + Metadata mergedMd = new Metadata(); + mergedMd.merge(md); + mergedMd.merge(Util.composeMetadata(featureFlags, descriptor.extractHeaderParams(openReq))); + + openParams = + OpenParams.create( + mergedMd, + OpenSessionRequest.newBuilder() + .setProtocolVersion(PROTOCOL_VERSION) + .setFlags(featureFlags) + .setConsecutiveFailedConnectionAttempts(0) // will be updated each handshake attempt + .setRoutingCookie(ByteString.EMPTY) // set when each session is renegotiated + .setPayload(openReq.toByteString()) // will be set on start + .build()); + poolState = PoolState.STARTED; // TODO: maybe need a READY state as well? + + // Pre-start + for (int i = poolSizer.getScaleDelta(); i > 0; i--) { + createSession(openParams); + } + + watchdog.start(); + } + + private static SessionCreationBudget createInitialBudget( + ClientConfiguration clientConfiguration) { + SessionClientConfiguration.SessionPoolConfiguration sessionPoolConfig = + clientConfiguration.getSessionConfiguration().getSessionPoolConfiguration(); + // Always use the config from the server. The budget should only be 0 when the + // session load is 0. + return SessionCreationBudget.create( + sessionPoolConfig.getNewSessionCreationBudget(), + SessionUtil.toJavaDuration(sessionPoolConfig.getNewSessionCreationPenalty())); + } + + private int getMaxConsecutiveFailures(ClientConfigurationManager configManager) { + return configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration() + .getConsecutiveSessionFailureThreshold(); + } + + private synchronized void createSession(OpenParams openParams) { + if (!budget.tryReserveSession()) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_pool_no_budget"); + logger.fine( + String.format( + "Refusing to add a new session due to exhausted %s concurrent create session" + + " requests", + budget.getMaxConcurrentRequest())); + // Retry create session if we run out of budget. In the edge case where we get a new VRpc + // after failing to create any sessions and exhausting all the budget, we'll retry session + // creation once the budget becomes available so the VRpc still has a chance to succeed. + maybeScheduleCreateSessionRetry(); + return; + } + + // Explicit create session streams in a detached context + // We don't want to propagate the rpc deadline nor the trace context + Context prevContext = Context.ROOT.attach(); + try { + try (Scope ignored = io.opentelemetry.context.Context.root().makeCurrent()) { + + SessionStream stream = factory.createNew(); + Session session = new SessionImpl(metrics, info, sessionNum++, stream); + SessionHandle handle = sessions.newHandle(session); + + Metadata localMd = new Metadata(); + localMd.merge(openParams.metadata()); + session.start( + openParams.request(), + localMd, + new Listener() { + @Override + public void onReady(OpenSessionResponse msg) { + SessionPoolImpl.this.onSessionReady(handle, msg); + } + + @Override + public void onGoAway(GoAwayResponse msg) { + SessionPoolImpl.this.onSessionGoAway(handle, msg); + } + + @Override + public void onClose(SessionState prevState, Status status, Metadata trailers) { + SessionPoolImpl.this.onSessionClose(handle, prevState, status, trailers); + } + }); + } + } finally { + Context.ROOT.detach(prevContext); + } + } + + @GuardedBy("this") + private void maybeScheduleCreateSessionRetry() { + if (retryCreateSessionFuture != null) { + return; + } + // This interval could be 0 or negative if nextAvailableBudget is now. In which case + // we'll retry after 1 millisecond to avoid retrying in a busy loop. + long retryIntervalMs = + Duration.between(Instant.now(), budget.getNextAvailableBudget()).toMillis(); + if (retryIntervalMs < 1) { + retryIntervalMs = 1; + } + retryCreateSessionFuture = + executorService.schedule( + () -> { + synchronized (this) { + retryCreateSessionFuture = null; + if (poolState != PoolState.CLOSED && poolSizer.getScaleDelta() > 0) { + createSession(openParams); + } + } + }, + retryIntervalMs, + TimeUnit.MILLISECONDS); + } + + private synchronized void onSessionReady(SessionHandle handle, OpenSessionResponse ignored) { + logger.log( + Level.FINE, + "Session {0} in state {1}", + new Object[] {handle.getSession().getLogName(), handle.getSession().getState()}); + + consecutiveFailures = 0; + consecutiveUnimplementedFailures = 0; + + if (poolState != PoolState.STARTED) { + logger.fine( + String.format( + "%s Session became ready after pool transitioned to %s, ignoring", + handle.getSession().getLogName(), poolState)); + // The session will be closed as part of SessionList#close + return; + } + handle.onSessionStarted(); + + budget.onSessionCreationSuccess(); + + // handle pending rpcs + tryDrainPendingRpcs(); + } + + private synchronized void onVRpcComplete( + SessionHandle handle, Duration elapsed, VRpcResult result) { + handle.onVRpcFinish(elapsed, result); + + // pool is shutting down, dont try to drain vrpcs + if (poolState != PoolState.STARTED) { + return; + } + // Session is shutting down, don't try to drain vrpcs + if (handle.getSession().getState() != SessionState.READY) { + return; + } + tryDrainPendingRpcs(); + } + + private synchronized void onSessionGoAway(SessionHandle handle, GoAwayResponse msg) { + handle.onSessionClosing(); + + // If the session received refresh config or pool requires a replacement, keep the current + // session and request a replacement. + // TODO: remove the check on if the open params is updated. In the future, server should + // broadcast session refresh config to all the sessions that needs reconnect and client + // just need to recreate sessions when pool sizer requries a replacement. + if (handle.getSession().isOpenParamsUpdated() || poolSizer.handleGoAway(msg)) { + logger.fine( + String.format( + "Adding new session to replace a going away session %s", + handle.getSession().getLogName())); + createSession(handle.getSession().getOpenParams()); + } + } + + private void onSessionClose( + SessionHandle handle, SessionState prevState, Status status, Metadata trailers) { + + List> toBeClosed = new ArrayList<>(); + + synchronized (this) { + logger.fine( + String.format("Removing closed session from pool %s", handle.getSession().getLogName())); + + handle.onSessionClosed(prevState); + + // If the pool is closed then there is nothing else to do + // dont need to create a replacement session and pending vRpcs get cleaned up in close() + if (poolState == PoolState.CLOSED) { + return; + } + + // Handle abnormal close. This can happen if the Session was aborted due to underlying stream + // termination + if (prevState != SessionState.WAIT_SERVER_CLOSE) { + consecutiveFailures++; + if (status.getCode() == Status.Code.UNIMPLEMENTED) { + consecutiveUnimplementedFailures++; + } else { + consecutiveUnimplementedFailures = 0; + } + // TODO: decide if max consecutive failures should be capped per client + if (consecutiveFailures >= getMaxConsecutiveFailures(configManager)) { + toBeClosed = popClosableRpcs(); + } + + if (prevState == SessionState.STARTING) { + budget.onSessionCreationFailure(); + } + + // TODO: backoff creating a new session when consecutive failures > max? + if (poolSizer.handleSessionClose(StatusProto.fromStatusAndTrailers(status, trailers))) { + logger.fine( + String.format( + "Replacing abnormally closed session %s", handle.getSession().getLogName())); + createSession(openParams.withIncrementedAttempts()); + } + } + } + + if (!toBeClosed.isEmpty()) { + // vRPCs failing with consecutive failures should fail + VRpcResult result = + VRpcResult.createRejectedError( + Status.fromCode(status.getCode()) + .withDescription( + String.format( + "Session failed with consecutive failures. Most recent server status: %s," + + " metadata: %s.", + status, trailers))); + for (PendingVRpc vrpc : toBeClosed) { + try { + vrpc.getListener().onClose(result); + } catch (Throwable t) { + logger.log(Level.WARNING, "Exception when closing request", t); + } + } + } + } + + @GuardedBy("this") + private void tryDrainPendingRpcs() { + while (!pendingRpcs.isEmpty()) { + if (pendingRpcs.peek().isCancelled) { + pendingRpcs.pop(); + continue; + } + Optional handle = picker.pickSession(); + if (!handle.isPresent()) { + break; + } + PendingVRpc rpc = pendingRpcs.removeFirst(); + rpc.drainTo(handle.get()); + } + } + + @GuardedBy("this") + private List> popClosableRpcs() { + List> toBeClosed = new ArrayList<>(); + Iterator> iter = pendingRpcs.iterator(); + while (iter.hasNext()) { + PendingVRpc vrpc = iter.next(); + // vrpcs that have started on a session gets closed in SessionImpl. Do not double close. + if (!vrpc.isCancelled && vrpc.realCall == null) { + iter.remove(); + toBeClosed.add(vrpc); + } + } + return toBeClosed; + } + + @Override + public synchronized VRpc newCall( + VRpcDescriptor desc) { + Optional handle = picker.pickSession(); + if (handle.isPresent()) { + return newRealCall(desc, handle.get()); + } + if (logger.isLoggable(Level.FINE)) { + logger.fine( + String.format( + "%s Creating new rpc as pending, numPending: %d, %s", + info.getLogName(), pendingRpcs.size(), sessions.getStats())); + } + return new PendingVRpc<>(desc); + } + + @GuardedBy("this") + private VRpc newRealCall( + VRpcDescriptor desc, SessionHandle handle) { + + return new ForwardingVRpc(handle.getSession().newCall(desc)) { + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + final Stopwatch stopwatch = Stopwatch.createStarted(); + super.start( + req, + ctx, + new ForwardListener(listener) { + @Override + public void onClose(VRpcResult result) { + SessionPoolImpl.this.onVRpcComplete(handle, stopwatch.elapsed(), result); + super.onClose(result); + } + }); + } + }; + } + + // Used in the shim layer for fallback decisions. Called on every RPC and we're ok with seeing + // slightly outdated value. + @Override + public int getConsecutiveUnimplementedFailures() { + return consecutiveUnimplementedFailures; + } + + // Used in the shim layer for fallback decisions. Called on every RPC. + @Override + public synchronized boolean hasSession() { + return sessions.getStats().getReadyCount() + sessions.getStats().getInUseCount() > 0; + } + + class PendingVRpc implements VRpc { + private final VRpcDescriptor desc; + + private ReqT req; + private VRpcCallContext ctx; + private VRpcListener listener; + + private boolean isCancelled = false; + private VRpc realCall; + + private ScheduledFuture deadlineMonitor; + + public PendingVRpc(VRpcDescriptor desc) { + this.desc = desc; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + Preconditions.checkState(this.req == null, "request is already started"); + Preconditions.checkNotNull(req, "request can't be null"); + Preconditions.checkNotNull(ctx, "ctx can't be null"); + Preconditions.checkNotNull(listener, "listener can't be null"); + + this.req = req; + this.ctx = ctx; + this.listener = listener; + this.deadlineMonitor = monitorDeadline(executorService, ctx.getOperationInfo().getDeadline()); + + synchronized (SessionPoolImpl.this) { + if (SessionPoolImpl.this.poolState != PoolState.STARTED) { + listener.onClose( + VRpcResult.createUncommitedError( + Status.UNAVAILABLE.withCause( + new IllegalStateException("SessionPool is closed")))); + return; + } + pendingRpcs.add(this); + + if (logger.isLoggable(Level.FINE)) { + logger.fine( + String.format( + "starting pending call, numPending: %d, %s", + pendingRpcs.size(), sessions.getStats())); + } + + if (poolSizer.handleNewCall()) { + logger.fine( + String.format("Adding session to handle incoming vrpc %s", info.getLogName())); + createSession(openParams); + } + + tryDrainPendingRpcs(); + } + } + + // It's safe to call cancel on a vrpc more than once. It'll be a noop after the initial + // call. Cancelled vrpcs are removed from the pending vrpc queue the next time we + // drain the queue. + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + Status status = Status.CANCELLED; + if (message != null) { + status = status.withDescription(message); + } + if (cause != null) { + status = status.withCause(cause); + } + cancel(status, false); + } + + // Cancel could race with drainTo which sets the real call. Assign realCall to a NOOP_CALL + // so if drainTo gets called at the same time, it'll just get swallowed and we're only calling + // onClose once on the listener. The cancel could also come from deadline monitor when + // the deadline expires. In this case if the real call is already set, we want to real call + // to handle the deadline and return early. + private void cancel(Status status, boolean onlyCancelPendingCall) { + boolean delegateToRealCall = true; + synchronized (SessionPoolImpl.this) { + if (isCancelled) { + return; + } + isCancelled = true; + if (realCall == null) { + this.realCall = NOOP_CALL; + delegateToRealCall = false; + } else if (onlyCancelPendingCall) { + return; + } + } + if (delegateToRealCall) { + realCall.cancel(status.getDescription(), status.getCause()); + } else { + listener.onClose(VRpcResult.createRejectedError(status)); + } + } + + @Override + public void requestNext() { + if (realCall != null) { + realCall.requestNext(); + return; + } + throw new IllegalStateException("requestNext can't be called until data has been received"); + } + + private void drainTo(SessionHandle handle) { + synchronized (SessionPoolImpl.this) { + if (realCall == null) { + this.realCall = newRealCall(desc, handle); + } + } + this.realCall.start(req, ctx, listener); + if (deadlineMonitor != null) { + deadlineMonitor.cancel(false); + } + } + + private VRpcListener getListener() { + return listener; + } + + private ScheduledFuture monitorDeadline( + ScheduledExecutorService executorService, Deadline deadline) { + return executorService.schedule( + () -> + // This could race with user cancel. Setting onlyCancelPendingCall to true + // so that if the real call is set, this cancellation is going to be a noop. + cancel( + Status.DEADLINE_EXCEEDED.withDescription("Deadline exceeded waiting for session"), + true), + deadline.timeRemaining(TimeUnit.NANOSECONDS), + TimeUnit.NANOSECONDS); + } + } + + static class Watchdog implements Runnable { + private static final Logger LOG = Logger.getLogger(Watchdog.class.getName()); + + private final Object lock; + private final ScheduledExecutorService executor; + private final Duration interval; + private final SessionList sessions; + private ScheduledFuture future; + private final Clock clock; + private final DebugTagTracer debugTagTracer; + + // TODO: fix lock sharing + public Watchdog( + Object lock, + ScheduledExecutorService executor, + Duration interval, + SessionList sessionList, + DebugTagTracer debugTagTracer) { + this(lock, executor, interval, sessionList, debugTagTracer, Clock.systemUTC()); + } + + @VisibleForTesting + Watchdog( + Object lock, + ScheduledExecutorService executor, + Duration interval, + SessionList sessionList, + DebugTagTracer debugTagTracer, + Clock clock) { + this.lock = lock; + this.executor = executor; + this.interval = interval; + this.sessions = sessionList; + this.debugTagTracer = debugTagTracer; + this.clock = clock; + } + + public void start() { + future = + executor.scheduleAtFixedRate( + this, interval.toMillis(), interval.toMillis(), TimeUnit.MILLISECONDS); + } + + @Override + public void run() { + Set allSessions; + synchronized (lock) { + allSessions = sessions.getAllSessions(); + } + + for (SessionHandle handle : allSessions) { + Session s = handle.getSession(); + + if (s.getState() != SessionState.WAIT_SERVER_CLOSE) { + continue; + } + + Duration stateDuration = Duration.between(s.getLastStateChange(), Instant.now(clock)); + if (stateDuration.compareTo(interval) < 0) { + continue; + } + + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "watchdog_close_session"); + LOG.fine( + String.format( + "Found session %s that lingered too long in WAIT_SERVER_CLOSE state, canceling" + + " session", + handle.getSession().getLogName())); + handle + .getSession() + .forceClose( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription( + String.format( + "Watchdog found session %s in awaiting close for too long. Last" + + " activity was %s ago.", + handle.getSession().getLogName(), + Duration.between( + handle.getSession().getLastStateChange(), Instant.now(clock)))) + .build()); + } + } + + public void close() { + if (future != null) { + future.cancel(false); + } + } + } + + private static final VRpc NOOP_CALL = + new VRpc() { + @Override + public void start(Object req, VRpcCallContext ctx, VRpcListener listener) {} + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) {} + + @Override + public void requestNext() {} + }; +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java new file mode 100644 index 000000000000..3fcf322a0236 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.SessionType; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.common.base.Ascii; + +@AutoValue +public abstract class SessionPoolInfo { + public abstract ClientInfo getClientInfo(); + + public abstract SessionType getType(); + + public abstract String getTypeLabel(); + + public abstract String getName(); + + public abstract String getLogName(); + + public static SessionPoolInfo create( + ClientInfo clientInfo, SessionDescriptor descriptor, String name) { + SessionType type = descriptor.getType(); + String typeStr = Ascii.toLowerCase(type.name().replace("SESSION_TYPE_", "")); + String logName = String.format("%s(%s)", typeStr, name); + + return new AutoValue_SessionPoolInfo(clientInfo, type, typeStr, name, logName); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java new file mode 100644 index 000000000000..ab0313468a03 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.SessionProto; +import com.google.bigtable.v2.SessionType; +import com.google.common.base.Preconditions; +import com.google.protobuf.Message; +import com.google.protobuf.util.Durations; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoMethodDescriptorSupplier; +import java.time.Duration; + +final class SessionUtil { + private SessionUtil() {} + + static SessionType extractSessionTypeFromMethod(MethodDescriptor desc) { + ProtoMethodDescriptorSupplier schemaDescriptor = + (ProtoMethodDescriptorSupplier) desc.getSchemaDescriptor(); + + SessionType sessionType = + schemaDescriptor + .getMethodDescriptor() + .getOptions() + .getExtension(SessionProto.rpcSessionType); + + Preconditions.checkNotNull(sessionType, "%s missing rpc_session_type annotation", desc); + Preconditions.checkState( + sessionType != SessionType.SESSION_TYPE_UNSET, + "%s missing rpc_session_type annotation", + desc); + + return sessionType; + } + + static SessionType extractOpenSessionTypeFromOpenMsg(Message openReq) { + SessionType sessionType = + openReq.getDescriptorForType().getOptions().getExtension(SessionProto.openSessionType); + Preconditions.checkNotNull( + sessionType, "%s missing open_session_type annotation", openReq.getDescriptorForType()); + Preconditions.checkState( + sessionType != SessionType.SESSION_TYPE_UNSET, + "%s missing rpc_session_type annotation", + openReq.getDescriptorForType()); + return sessionType; + } + + static Duration toJavaDuration(com.google.protobuf.Duration duration) { + return Duration.ofMillis(Durations.toMillis(duration)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java new file mode 100644 index 000000000000..5a0acfb83bcc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.AfeHandle; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.List; +import java.util.Optional; +import java.util.Random; + +class SimplePicker extends Picker { + private final SessionList sessionList; + private final LoadBalancingOptions.Random options; + private final Random random = new Random(); + + public SimplePicker(SessionList sessionList, LoadBalancingOptions.Random options) { + this.sessionList = sessionList; + this.options = options; + } + + @Override + Optional pickSession() { + List readyAfes = sessionList.getAfesWithReadySessions(); + if (readyAfes.isEmpty()) { + return Optional.empty(); + } + + AfeHandle afeHandle = readyAfes.get(random.nextInt(readyAfes.size())); + return sessionList.checkoutSession(afeHandle); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java new file mode 100644 index 000000000000..bffb3259d3ad --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java @@ -0,0 +1,330 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.AuthorizedViewRequest; +import com.google.bigtable.v2.AuthorizedViewResponse; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.MaterializedViewRequest; +import com.google.bigtable.v2.MaterializedViewResponse; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowSet; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.SessionType; +import com.google.bigtable.v2.TableRequest; +import com.google.bigtable.v2.TableResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; +import io.grpc.MethodDescriptor; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Function; + +/** + * Static descriptor for virtual RPCs. + * + *

Contains a const for each supported vRPC. The descriptors help ensure vRPC are statically + * typed and provide encoding/decoding. + * + *

The structure of the descriptor is to have a constant for each vRPC and the constant is + * defined using a pair of encoder/decoder factories for that vRPC family. + */ +public final class VRpcDescriptor { + public static final SessionDescriptor TABLE_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenTableMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_TABLE, + r.getTableName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.table_name", r.getTableName(), + "open_session.payload.app_profile_id", r.getAppProfileId(), + "open_session.payload.permission", r.getPermission().name())); + + public static final SessionDescriptor AUTHORIZED_VIEW_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenAuthorizedViewMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_AUTHORIZED_VIEW, + r.getAuthorizedViewName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.authorized_view_name", + r.getAuthorizedViewName(), + "open_session.payload.app_profile_id", + r.getAppProfileId(), + "open_session.payload.permission", + r.getPermission().name())); + + public static final SessionDescriptor MATERIALIZED_VIEW_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenMaterializedViewMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_MATERIALIZED_VIEW, + r.getMaterializedViewName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.materialized_view_name", + r.getMaterializedViewName(), + "open_session.payload.app_profile_id", + r.getAppProfileId(), + "open_session.payload.permission", + r.getPermission().name())); + + // region vRPC definitions + public static final VRpcDescriptor< + OpenTableRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW = + new VRpcDescriptor<>( + TABLE_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createTableEncoder(TableRequest.Builder::setReadRow), + createTableDecoder(TableResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setTableName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + public static final VRpcDescriptor< + OpenTableRequest, SessionMutateRowRequest, SessionMutateRowResponse> + MUTATE_ROW = + new VRpcDescriptor<>( + TABLE_SESSION, + MethodInfo.of("Bigtable.MutateRow", false), + createTableEncoder(TableRequest.Builder::setMutateRow), + createTableDecoder(TableResponse::getMutateRow), + (name, appProfileId, req) -> + MutateRowRequest.newBuilder() + .setTableName(name) + .setAppProfileId(appProfileId) + .setRowKey(req.getKey()) + .addAllMutations(req.getMutationsList()) + .build()); + + public static final VRpcDescriptor< + OpenAuthorizedViewRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW_AUTH_VIEW = + new VRpcDescriptor<>( + AUTHORIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createAuthViewEncoder(AuthorizedViewRequest.Builder::setReadRow), + createAuthViewDecoder(AuthorizedViewResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setAuthorizedViewName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + public static final VRpcDescriptor< + OpenAuthorizedViewRequest, SessionMutateRowRequest, SessionMutateRowResponse> + MUTATE_ROW_AUTH_VIEW = + new VRpcDescriptor<>( + AUTHORIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.MutateRow", false), + createAuthViewEncoder(AuthorizedViewRequest.Builder::setMutateRow), + createAuthViewDecoder(AuthorizedViewResponse::getMutateRow), + (name, appProfileId, req) -> + MutateRowRequest.newBuilder() + .setAuthorizedViewName(name) + .setAppProfileId(appProfileId) + .setRowKey(req.getKey()) + .addAllMutations(req.getMutationsList()) + .build()); + + public static final VRpcDescriptor< + OpenMaterializedViewRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW_MAT_VIEW = + new VRpcDescriptor<>( + MATERIALIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createMatViewEncoder(MaterializedViewRequest.Builder::setReadRow), + createMatViewDecoder(MaterializedViewResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setMaterializedViewName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + // endregion + + // region vRPC family encoder/decoder factories + private static Encoder createTableEncoder( + BiConsumer subEncoder) { + return req -> { + TableRequest.Builder builder = TableRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createTableDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(TableResponse.parseFrom(bytes)); + } + + private static Encoder createAuthViewEncoder( + BiConsumer subEncoder) { + return req -> { + AuthorizedViewRequest.Builder builder = AuthorizedViewRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createAuthViewDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(AuthorizedViewResponse.parseFrom(bytes)); + } + + private static Encoder createMatViewEncoder( + BiConsumer subEncoder) { + return req -> { + MaterializedViewRequest.Builder builder = MaterializedViewRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createMatViewDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(MaterializedViewResponse.parseFrom(bytes)); + } + + // endregion + + private final SessionDescriptor session; + private final MethodInfo methodInfo; + private final Encoder encoder; + private final Decoder decoder; + private final LegacyConverter legacyConverter; + + VRpcDescriptor( + SessionDescriptor session, + MethodInfo methodInfo, + Encoder encoder, + Decoder decoder, + LegacyConverter legacyConverter) { + this.session = session; + this.methodInfo = methodInfo; + this.encoder = encoder; + this.decoder = decoder; + this.legacyConverter = legacyConverter; + } + + public SessionDescriptor getSessionDescriptor() { + return session; + } + + public MethodInfo getMethodInfo() { + return methodInfo; + } + + public RespT decode(ByteString bytes) throws InvalidProtocolBufferException { + return decoder.decode(bytes); + } + + public ByteString encode(ReqT req) { + return encoder.encode(req); + } + + public Message toLegacyProto(String name, String appProfileId, ReqT sessionRequest) { + return legacyConverter.convert(name, appProfileId, sessionRequest); + } + + interface Decoder { + RespT decode(ByteString bytes) throws InvalidProtocolBufferException; + } + + interface Encoder { + ByteString encode(ReqT req); + } + + @FunctionalInterface + interface LegacyConverter { + Message convert(String name, String appProfileId, ReqT sessionRequest); + } + + public static final class SessionDescriptor { + private final SessionType type; + private final MethodDescriptor methodDescriptor; + private final Function> headerPopulator; + private final Function logNameExtractor; + + public SessionDescriptor( + MethodDescriptor methodDescriptor, + Function logNameExtractor, + Function> headerPopulator) { + this.type = SessionUtil.extractSessionTypeFromMethod(methodDescriptor); + this.methodDescriptor = methodDescriptor; + this.logNameExtractor = logNameExtractor; + this.headerPopulator = headerPopulator; + } + + public SessionType getType() { + return type; + } + + public MethodDescriptor getMethodDescriptor() { + return methodDescriptor; + } + + public Map extractHeaderParams(OpenReqT req) { + Preconditions.checkArgument(SessionUtil.extractOpenSessionTypeFromOpenMsg(req) == type); + return headerPopulator.apply(req); + } + + public String getLogName(OpenReqT req) { + return logNameExtractor.apply(req); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java new file mode 100644 index 000000000000..38ecc75db900 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java @@ -0,0 +1,208 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcRequest.Metadata; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import com.google.protobuf.MessageLite; +import com.google.protobuf.util.Durations; +import io.grpc.Status; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * This class is the intermediary between a user and a {@link SessionImpl}. + * + *

    + *
  • {@link #start(MessageLite, VRpcCallContext, VRpcListener)} must be the first method called + * by the user + *
  • {@link #cancel(String, Throwable)} and {@link #requestNext()} can be called by any thread + *
  • {@link #requestNext()} can only be called after {@link + * com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener#onMessage} is + * invoked with a {@link VirtualRpcResponse} indicating that there is more data. + *
  • All {@code handle*} methods are expected to be called sequentially by {@link SessionImpl} + *
+ * + *

The expectation is that all happens-before state transitions are conducted via the {@link + * SessionImpl}/gRPC's executor and no synchronization has to occur here. + */ +class VRpcImpl + implements VRpc { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(VRpcImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + // Narrow view of SessionImpl + interface VRpcSessionApi { + Status startRpc(VRpcImpl rpc, VirtualRpcRequest payload); + + void cancelRpc(long rpcId, @Nullable String message, @Nullable Throwable cause); + } + + private enum State { + NEW, + STARTED, + CLOSED + } + + private final VRpcSessionApi session; + private final VRpcDescriptor desc; + final long rpcId; + private VRpcListener listener; + private PeerInfo peerInfo; + + private AtomicReference state; + + private final DebugTagTracer debugTagTracer; + + public VRpcImpl( + VRpcSessionApi session, + VRpcDescriptor desc, + long rpcId, + PeerInfo peerInfo, + DebugTagTracer debugTagTracer) { + this.session = session; + this.desc = desc; + this.rpcId = rpcId; + this.state = new AtomicReference<>(State.NEW); + this.peerInfo = peerInfo; + this.debugTagTracer = debugTagTracer; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + this.listener = listener; + + Status status; + boolean retryable = true; + + if (state.get() != State.NEW) { + status = Status.INTERNAL.withDescription("VRpc already started in state: " + state.get()); + retryable = false; + } else if (ctx.getOperationInfo().getDeadline().timeRemaining(TimeUnit.MICROSECONDS) + < TimeUnit.MILLISECONDS.toMicros(1)) { + // transitioning to the close state is handled below + state.set(State.STARTED); + // Don't send RPCs that don't have any hope of succeeding + status = + Status.DEADLINE_EXCEEDED.withDescription("Remaining deadline is too short to send RPC"); + retryable = false; + } else { + state.set(State.STARTED); + Metadata vRpcMetadata = + Metadata.newBuilder() + .setAttemptNumber(ctx.getOperationInfo().getAttemptNumber()) + .setTraceparent(ctx.getTraceParent()) + .build(); + ctx.getTracer().onRequestSent(peerInfo); + status = + session.startRpc( + this, + VirtualRpcRequest.newBuilder() + .setRpcId(rpcId) + .setMetadata(vRpcMetadata) + .setDeadline( + Durations.fromNanos( + ctx.getOperationInfo().getDeadline().timeRemaining(TimeUnit.NANOSECONDS))) + .setPayload(desc.encode(req)) + .build()); + // if status is not OK, the session might not be ready and the vRPC can be retried on a + // different session + } + + if (!status.isOk()) { + debugTagTracer.checkPrecondition( + state.compareAndSet(State.STARTED, State.CLOSED), + "vrpc_incorrect_start_state", + "VRpc has incorrect state. Expected to be started but was %s", + state); + // TODO: loop through the session executor + if (retryable) { + listener.onClose(VRpcResult.createUncommitedError(status)); + } else { + listener.onClose(VRpcResult.createRejectedError(status)); + } + } + } + + void handleSessionClose(VRpcResult result) { + if (!state.compareAndSet(State.STARTED, State.CLOSED)) { + logger.warning("tried to close a vRPC after it was already closed state: " + state.get()); + return; + } + + listener.onClose(result); + } + + void handleResponse(VirtualRpcResponse response) { + if (!state.compareAndSet(State.STARTED, State.CLOSED)) { + // This can happen if the call was cancelled just before the response arrived. + // Silently ignore it. + return; + } + // TODO: handle streaming + + RespT resp; + try { + resp = desc.decode(response.getPayload()); + } catch (Throwable e) { + // TODO: notify Session to cancel the vRPC + // Right now, vrpc streaming & cancellation is not supported, so notifying SessionImpl is + // unnecessary. In the future handleResponse will need to notify that Session that the user + // was already notified of the error and no further notifications should be delivered + VRpcResult result = + VRpcResult.createLocalTransportError( + Status.INTERNAL.withDescription("Failed to decode VRpc payload").withCause(e)); + listener.onClose(result); + return; + } + + try { + listener.onMessage(resp); + } catch (Throwable e) { + VRpcResult result = VRpcResult.createUserError(e); + listener.onClose(result); + return; + } + + listener.onClose(VRpcResult.createServerOk(response)); + } + + void handleError(VRpcResult result) { + if (state.getAndSet(State.CLOSED) == State.CLOSED) { + return; + } + + listener.onClose(result); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + session.cancelRpc(rpcId, message, cause); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException("streamed RPCs are not supported yet"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java new file mode 100644 index 000000000000..c367d5c6443b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java @@ -0,0 +1,542 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.util; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.ClientConfiguration.PollingCase; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ClientCall.Listener; +import io.grpc.Deadline; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** + * ClientConfiguration controls how the data client should behave. For example, it controls how much + * of the traffic should go through jetstream vs unary. It also controls how frequent the client + * should poll for a new configuration and how long the configuration is valid for. + */ +public class ClientConfigurationManager implements AutoCloseable { + private static final Logger logger = Logger.getLogger(ClientConfigurationManager.class.getName()); + + public static final String OVERRIDE_SYS_PROP_KEY = "bigtable.internal.client-config-override"; + + public interface ConfigListener { + void onChange(T newValue); + } + + public interface ListenerHandle extends Closeable { + @Override + void close(); + } + + private class ListenerEntry implements ListenerHandle { + private final Function extractor; + private final ConfigListener listener; + + private ListenerEntry(Function extractor, ConfigListener listener) { + this.extractor = extractor; + this.listener = listener; + } + + private void maybeNotify(ClientConfiguration oldConfig, ClientConfiguration newConfig) { + T oldValue = extractor.apply(oldConfig); + T newValue = extractor.apply(newConfig); + if (Objects.equals(oldValue, newValue)) { + return; + } + listener.onChange(newValue); + } + + @Override + public void close() { + synchronized (ClientConfigurationManager.this) { + if (notifying) { + pendingListenerRemovals.add(this); + } else { + listeners.remove(this); + } + } + } + } + + private final Metadata metadata; + private final GetClientConfigurationRequest request; + private final ChannelProvider channelProvider; + + @GuardedBy("this") + private ManagedChannel channel; + + private final DebugTagTracer debugTagTracer; + private final ScheduledExecutorService executor; + + private final ClientConfiguration defaultConfig; + private final Optional overrideConfig; + + private final Duration defaultDeadline = Duration.ofSeconds(5); + + @GuardedBy("this") + @Nonnull + private ClientConfiguration clientConfiguration; + + @GuardedBy("this") + @Nonnull + private Instant validUntil = Instant.MAX; + + @GuardedBy("this") + private final List> listeners = new ArrayList<>(); + + @GuardedBy("this") + private boolean notifying = false; + + @GuardedBy("this") + private final Set> pendingListenerRemovals = new HashSet<>(); + + @GuardedBy("this") + @Nullable + private ScheduledFuture nextPoll = null; + + @GuardedBy("this") + private boolean closing = false; + + public ClientConfigurationManager( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + DebugTagTracer tracer, + ScheduledExecutorService executor) + throws IOException { + this(System.getProperties(), featureFlags, clientInfo, channelProvider, tracer, executor); + } + + ClientConfigurationManager( + Properties sysProps, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + DebugTagTracer tracer, + ScheduledExecutorService executor) + throws IOException { + this.defaultConfig = loadDefault(); + this.overrideConfig = + Optional.ofNullable(sysProps.getProperty(OVERRIDE_SYS_PROP_KEY)) + .map( + str -> { + try { + return TextFormat.parse(str, ClientConfiguration.class); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse bigtable.internal.client-config-override", e); + } + }); + + if (overrideConfig.isPresent()) { + logger.log( + Level.INFO, + () -> + "Local client config override: " + + TextFormat.printer() + .emittingSingleLine(true) + .printToString(overrideConfig.get())); + } + featureFlags = channelProvider.updateFeatureFlags(featureFlags); + this.clientConfiguration = defaultConfig; + + this.metadata = + Util.composeMetadata( + featureFlags, + ImmutableMap.of( + "instance_name", clientInfo.getInstanceName().toString(), + "app_profile_id", clientInfo.getAppProfileId())); + this.request = + GetClientConfigurationRequest.newBuilder() + .setInstanceName(clientInfo.getInstanceName().toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .build(); + + this.channelProvider = channelProvider; + this.channel = channelProvider.newChannelBuilder().build(); + this.debugTagTracer = tracer; + this.executor = executor; + } + + public static ClientConfiguration loadDefault() throws IOException { + try (InputStream is = + ClientConfiguration.class.getResourceAsStream( + "/bigtable-default-client-config.textproto")) { + Preconditions.checkNotNull(is, "Failed to load default config"); + + try (Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { + ClientConfiguration.Builder builder = ClientConfiguration.newBuilder(); + TextFormat.getParser().merge(reader, builder); + return builder.build(); + } + } + } + + /** + * Start polling client configuration. The first poll should be blocking and client should fall + * back to unary if it fails. + */ + public CompletableFuture start() { + CompletableFuture f = startPolling(); + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = + f.whenComplete( + (cfg, error) -> { + if (error != null) { + debugTagTracer.record( + TelemetryConfiguration.Level.ERROR, "client_config_fetch_failed"); + logger.log(Level.WARNING, "Failed to fetch initial config", error); + } else { + logger.log(Level.CONFIG, "Got initial config: {0}", cfg); + } + }); + return f; + } + + @Override + public synchronized void close() { + closing = true; + if (nextPoll != null) { + nextPoll.cancel(true); + } + channel.shutdown(); + } + + /** Gets the client configuration. */ + @Nonnull + public synchronized ClientConfiguration getClientConfiguration() { + return this.clientConfiguration; + } + + ClientConfiguration getDefaultConfig() { + return defaultConfig; + } + + public synchronized ListenerHandle addListener( + Function extractor, ConfigListener listener) { + ListenerEntry entry = new ListenerEntry<>(extractor, listener); + listeners.add(entry); + return entry; + } + + private CompletableFuture startPolling() { + CompletableFuture result = new CompletableFuture<>(); + sendRequestWithRetries(0, result); + return result; + } + + private synchronized void sendRequestWithRetries( + int attemptCount, CompletableFuture finalResult) { + if (closing) { + finalResult.completeExceptionally(new RuntimeException("Client is closing")); + return; + } + + CompletableFuture currentRequest = sendRequest(); + // We only schedule the next poll after successfully getting a client config + // from the server. + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = + currentRequest.whenComplete( + (result, throwable) -> { + // Config updated + if (throwable == null) { + setClientConfiguration(result); + scheduleNextPoll(); + finalResult.complete(result); + return; + } + + // Handle failure and retry if necessary + if (handleFailedFetch(throwable, attemptCount)) { + debugTagTracer.record( + TelemetryConfiguration.Level.ERROR, "client_config_fetch_failed"); + replaceChannel(); + long delay = getRetryDelay(attemptCount); + @SuppressWarnings("UnusedVariable") + ScheduledFuture ignored2 = + executor.schedule( + () -> sendRequestWithRetries(attemptCount + 1, finalResult), + delay, + TimeUnit.MILLISECONDS); + } else { + scheduleNextPoll(); + finalResult.completeExceptionally(throwable); + } + }); + } + + @GuardedBy("this") + private CompletableFuture sendRequest() { + CompletableFuture future = new CompletableFuture<>(); + + ClientCall call = + channel.newCall( + BigtableGrpc.getGetClientConfigurationMethod(), + CallOptions.DEFAULT.withDeadline( + Deadline.after(defaultDeadline.toMillis(), TimeUnit.MILLISECONDS))); + call.start( + new Listener() { + @Override + public void onMessage(ClientConfiguration cfg) { + cfg = normalizeConfig(cfg); + future.complete(cfg); + } + + @Override + public void onClose(Status status, Metadata trailers) { + if (!status.isOk()) { + future.completeExceptionally(status.asRuntimeException()); + } + } + }, + metadata); + call.sendMessage(request); + call.halfClose(); + call.request(1); + + return future; + } + + @SuppressWarnings("deprecation") + private ClientConfiguration normalizeConfig(ClientConfiguration cfg) { + ClientConfiguration.Builder builder = cfg.toBuilder(); + + // TODO: remove this once server is updated + // Patch PollingConfiguration (migrating PollingInterval) + if (!cfg.hasPollingConfiguration()) { + builder.setPollingConfiguration( + defaultConfig.getPollingConfiguration().toBuilder() + .setPollingInterval(cfg.getPollingInterval())); + } + + // TODO: remove this once server is updated + // Patch SessionPoolConfiguration (migrating LoadBalancingOptions) + if (!cfg.getSessionConfiguration().hasSessionPoolConfiguration()) { + builder + .getSessionConfigurationBuilder() + .clearLoadBalancingOptions() + .setSessionPoolConfiguration( + defaultConfig.getSessionConfiguration().getSessionPoolConfiguration().toBuilder() + .setLoadBalancingOptions(cfg.getSessionConfiguration().getLoadBalancingOptions()) + .build()); + } else { + // ignore LoadBalancing options when we migrated to SessionPoolConfig + builder.getSessionConfigurationBuilder().clearLoadBalancingOptions(); + } + // TODO: remove this once server is updated + // Patch ChannelPoolConfiguration + if (!cfg.getSessionConfiguration().hasChannelConfiguration()) { + builder + .getSessionConfigurationBuilder() + .setChannelConfiguration( + defaultConfig.getSessionConfiguration().getChannelConfiguration()); + } + + // Patch debug tag level + switch (cfg.getTelemetryConfiguration().getDebugTagLevel()) { + case UNRECOGNIZED: + case LEVEL_UNSPECIFIED: + builder + .getTelemetryConfigurationBuilder() + .setDebugTagLevel(defaultConfig.getTelemetryConfiguration().getDebugTagLevel()); + } + + // Inject overrides + overrideConfig.ifPresent(builder::mergeFrom); + + // When sessions are disabled make sure to clear out the config + if (cfg.getSessionConfiguration().getSessionLoad() == 0) { + builder.clearSessionConfiguration(); + return builder.build(); + } + + return builder.build(); + } + + public boolean areSessionsRequired() { + return overrideConfig.map(c -> c.getSessionConfiguration().getSessionLoad() > 0).orElse(false); + } + + private long getRetryDelay(int attempt) { + // the attempt is the total number of attempts starting from 0. The first request + // is sent immediately, and the second request is sent after 2 ^ 0 ms (with jitter) etc. + // Initial delay is 1 ms. + return ThreadLocalRandom.current().nextLong((long) Math.pow(2, attempt)); + } + + private synchronized void scheduleNextPoll() { + if (closing) { + return; + } + + if (!clientConfiguration.hasPollingConfiguration()) { + return; + } + long delayMs = + Durations.toMillis(clientConfiguration.getPollingConfiguration().getPollingInterval()); + + this.nextPoll = + executor.schedule( + () -> { + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = startPolling(); + }, + delayMs, + TimeUnit.MILLISECONDS); + } + + private synchronized void setClientConfiguration(ClientConfiguration result) { + ClientConfiguration old = this.clientConfiguration; + + clientConfiguration = result; + if (clientConfiguration.hasPollingConfiguration()) { + this.validUntil = + Instant.now() + .plus( + toJavaDuration( + clientConfiguration.getPollingConfiguration().getValidityDuration())); + } else if (clientConfiguration.getStopPolling()) { + this.validUntil = Instant.MAX; + } + + maybeLogConfigChange(old, result); + notifyListeners(old, clientConfiguration); + } + + private void maybeLogConfigChange(ClientConfiguration oldCfg, ClientConfiguration newCfg) { + if (shouldLogConfigChange(oldCfg, newCfg)) { + logger.log(Level.CONFIG, "ClientConfig changed to: {0}", newCfg); + } + } + + private boolean shouldLogConfigChange(ClientConfiguration oldCfg, ClientConfiguration newCfg) { + if (oldCfg.getPollingCase() != newCfg.getPollingCase()) { + return true; + } + // round down interval to minimize noise from jitter + if (oldCfg.getPollingCase() == PollingCase.POLLING_CONFIGURATION) { + long oldInterval = Durations.toMinutes(oldCfg.getPollingConfiguration().getPollingInterval()); + long newInterval = Durations.toMinutes(newCfg.getPollingConfiguration().getPollingInterval()); + if (oldInterval == newInterval) { + ClientConfiguration.Builder roundedOldCfgBuilder = oldCfg.toBuilder(); + roundedOldCfgBuilder + .getPollingConfigurationBuilder() + .setPollingInterval(newCfg.getPollingConfiguration().getPollingInterval()); + oldCfg = roundedOldCfgBuilder.build(); + } + } + return oldCfg.equals(newCfg); + } + + @GuardedBy("this") + private void notifyListeners(ClientConfiguration oldConfig, ClientConfiguration newConfig) { + notifying = true; + // Snapshot the listeners so that new listeners added this cycle dont get notified + List> snapshot = new ArrayList<>(listeners); + + for (ListenerEntry e : snapshot) { + if (pendingListenerRemovals.contains(e)) { + continue; + } + e.maybeNotify(oldConfig, newConfig); + } + + listeners.removeAll(pendingListenerRemovals); + pendingListenerRemovals.clear(); + notifying = false; + } + + private synchronized boolean handleFailedFetch(Throwable throwable, int attempt) { + if (validUntil.isBefore(Instant.now())) { + setClientConfiguration(defaultConfig); + } + + // Figure out if we should retry + if (!(throwable instanceof StatusRuntimeException)) { + return false; + } + Code statusCode = Status.fromThrowable(throwable).getCode(); + // do not retry non-retryable errors + switch (statusCode) { + case PERMISSION_DENIED: + case UNAUTHENTICATED: + logger.warning("instance.ping permission is required"); + return false; + case NOT_FOUND: + case INVALID_ARGUMENT: + return false; + default: + if (closing) { + return false; + } + return attempt < getClientConfiguration().getPollingConfiguration().getMaxRpcRetryCount(); + } + } + + private synchronized void replaceChannel() { + channel.shutdownNow(); + channel = channelProvider.newChannelBuilder().build(); + } + + private static Duration toJavaDuration(com.google.protobuf.Duration protobufDuration) { + return Duration.ofMillis(Durations.toMillis(protobufDuration)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AddToCell.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AddToCell.java new file mode 100644 index 000000000000..75ba6a192df9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AddToCell.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Representation of an AddToCell mod in a data change. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class AddToCell implements Entry, Serializable { + public static AddToCell create( + @Nonnull String family, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + return new AutoValue_AddToCell(family, qualifier, timestamp, input); + } + + @Nonnull + public abstract String getFamily(); + + @Nonnull + public abstract Value getQualifier(); + + @Nonnull + public abstract Value getTimestamp(); + + @Nonnull + public abstract Value getInput(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java new file mode 100644 index 000000000000..a090b2117db7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.common.base.Preconditions; + +/** + * An implementation of a {@link TargetId} for authorized views. + * + *

See {@link com.google.cloud.bigtable.admin.v2.models.AuthorizedView} for more details about an + * authorized view. + */ +@AutoValue +public abstract class AuthorizedViewId implements TargetId { + /** Constructs a new AuthorizedViewId object from the specified tableId and authorizedViewId. */ + public static AuthorizedViewId of(String tableId, String authorizedViewId) { + Preconditions.checkNotNull(tableId, "table id can't be null."); + Preconditions.checkNotNull(authorizedViewId, "authorized view id can't be null."); + return new AutoValue_AuthorizedViewId(tableId, authorizedViewId); + } + + public static AuthorizedViewId of(TableId tableId, String authorizedViewId) { + Preconditions.checkNotNull(tableId, "table id can't be null."); + Preconditions.checkNotNull(authorizedViewId, "authorized view id can't be null."); + return new AutoValue_AuthorizedViewId(tableId.getTableId(), authorizedViewId); + } + + public abstract String getTableId(); + + public abstract String getAuthorizedViewId(); + + @Override + @InternalApi + public String toResourceName(String projectId, String instanceId) { + return NameUtil.formatAuthorizedViewName( + projectId, instanceId, getTableId(), getAuthorizedViewId()); + } + + @Override + @InternalApi + public boolean scopedForAuthorizedView() { + return true; + } + + @Override + @InternalApi + public boolean scopedForMaterializedView() { + return false; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java new file mode 100644 index 000000000000..fb7b04269f07 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java @@ -0,0 +1,174 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.cloud.bigtable.data.v2.models.RowMutationEntry.MAX_MUTATION; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Represents a list of mutations for multiple rows. Each mutation contains multiple changes that + * will be atomically applied to each row. However, ordering between rows is not guaranteed. + * + *

This class is meant for manual batching. + */ +public final class BulkMutation implements Serializable, Cloneable { + private static final long serialVersionUID = 3522061250439399088L; + private final TargetId targetId; + private transient MutateRowsRequest.Builder builder; + + private long mutationCountSum = 0; + + /** + * @deprecated Please use {@link BulkMutation#create(TargetId)} instead. + */ + @Deprecated + public static BulkMutation create(String tableId) { + return new BulkMutation(TableId.of(tableId)); + } + + /** + * Creates a new instance of the bulk mutation builder for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static BulkMutation create(TargetId targetId) { + return new BulkMutation(targetId); + } + + private BulkMutation(TargetId targetId) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; + this.builder = MutateRowsRequest.newBuilder(); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + builder = MutateRowsRequest.newBuilder().mergeFrom(input); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + builder.build().writeTo(output); + } + + /** + * Add mutation for a particular row. The changes in the mutation will be applied atomically. + * However there is no guarantees about the relative ordering between mutations affecting + * different rows. + */ + public BulkMutation add(@Nonnull String rowKey, @Nonnull Mutation mutation) { + Preconditions.checkNotNull(rowKey); + Preconditions.checkNotNull(mutation); + + return add(ByteString.copyFromUtf8(rowKey), mutation); + } + + /** + * Add mutation for a particular row. The changes in the mutation will be applied atomic. However + * there is no guarantees about the relative ordering between mutations affecting different rows. + */ + public BulkMutation add(@Nonnull ByteString rowKey, @Nonnull Mutation mutation) { + Preconditions.checkNotNull(rowKey); + Preconditions.checkNotNull(mutation); + + long mutationCount = mutation.getMutations().size(); + Preconditions.checkArgument( + mutationCountSum + mutationCount <= MAX_MUTATION, + "Too many mutations, got %s, limit is %s", + mutationCountSum + mutationCount, + MAX_MUTATION); + this.mutationCountSum += mutationCount; + + builder.addEntries( + MutateRowsRequest.Entry.newBuilder() + .setRowKey(rowKey) + .addAllMutations(mutation.getMutations()) + .build()); + return this; + } + + /** + * Add mutation for a particular row. The changes in the mutation will be applied atomic. However + * there is no guarantees about the relative ordering between mutations affecting different rows. + */ + public BulkMutation add(@Nonnull RowMutationEntry entry) { + Preconditions.checkNotNull(entry, "Row mutation entry can't be null"); + builder.addEntries(entry.toProto()); + return this; + } + + public int getEntryCount() { + return builder.getEntriesCount(); + } + + @InternalApi + public MutateRowsRequest toProto(RequestContext requestContext) { + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); + } + + /** + * Wraps the protobuf {@link MutateRowsRequest}. + * + *

This is meant for advanced usage only. Please ensure that the MutateRowsRequest does not use + * server side timestamps. The BigtableDataClient assumes that mutation present in BulkMutation + * are idempotent and is configured to enable retries by default. If serverside timestamps are + * enabled then that can lead to duplicate mutations. + * + *

WARNING: when applied, the resulting mutation object will ignore the project id and instance + * id in the table_name and instead apply the configuration in the client. + */ + @BetaApi + public static BulkMutation fromProto(@Nonnull MutateRowsRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + + BulkMutation bulkMutation = + BulkMutation.create(NameUtil.extractTargetId(tableName, authorizedViewName)); + bulkMutation.builder = request.toBuilder(); + + return bulkMutation; + } + + /** Creates a copy of {@link BulkMutation}. */ + @Override + public BulkMutation clone() { + BulkMutation bulkMutation = BulkMutation.create(targetId); + bulkMutation.builder = this.builder.clone(); + return bulkMutation; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationToken.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationToken.java new file mode 100644 index 000000000000..f619d9dae0ae --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationToken.java @@ -0,0 +1,88 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** A simple wrapper for {@link StreamContinuationToken}. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class ChangeStreamContinuationToken implements Serializable { + private static final long serialVersionUID = 524679926247095L; + + private static ChangeStreamContinuationToken create(@Nonnull StreamContinuationToken tokenProto) { + return new AutoValue_ChangeStreamContinuationToken(tokenProto); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public static ChangeStreamContinuationToken create( + @Nonnull ByteStringRange byteStringRange, @Nonnull String token) { + return create( + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(byteStringRange.getStart()) + .setEndKeyOpen(byteStringRange.getEnd()) + .build()) + .build()) + .setToken(token) + .build()); + } + + /** Wraps the protobuf {@link StreamContinuationToken}. */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + static ChangeStreamContinuationToken fromProto( + @Nonnull StreamContinuationToken streamContinuationToken) { + return create(streamContinuationToken); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public static ChangeStreamContinuationToken fromByteString(ByteString byteString) + throws InvalidProtocolBufferException { + return create(StreamContinuationToken.newBuilder().mergeFrom(byteString).build()); + } + + @Nonnull + public abstract StreamContinuationToken getTokenProto(); + + /** + * Get the partition of the current continuation token, represented by a {@link ByteStringRange}. + */ + public ByteStringRange getPartition() { + return ByteStringRange.create( + getTokenProto().getPartition().getRowRange().getStartKeyClosed(), + getTokenProto().getPartition().getRowRange().getEndKeyOpen()); + } + + public String getToken() { + return getTokenProto().getToken(); + } + + public ByteString toByteString() { + return getTokenProto().toByteString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java new file mode 100644 index 000000000000..7ca9deeaee2e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java @@ -0,0 +1,284 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; + +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.cloud.bigtable.data.v2.stub.changestream.ChangeStreamRecordMerger; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * A ChangeStreamMutation represents a list of mods(represented by List<{@link Entry}>) targeted at + * a single row, which is concatenated by {@link ChangeStreamRecordMerger}. It represents a logical + * row mutation and can be converted to the original write request(i.e. {@link RowMutation} or + * {@link RowMutationEntry}. + * + *

A ChangeStreamMutation can be constructed in two ways, depending on whether it's a user + * initiated mutation or a Garbage Collection mutation. Either way, the caller should explicitly set + * `token` and `estimatedLowWatermark` before build(), otherwise it'll raise an error. + * + *

Case 1) User initiated mutation. + * + *

{@code
+ * ChangeStreamMutation.Builder builder = ChangeStreamMutation.createUserMutation(...);
+ * builder.setCell(...);
+ * builder.deleteFamily(...);
+ * builder.deleteCells(...);
+ * ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
+ * }
+ * + * Case 2) Garbage Collection mutation. + * + *
{@code
+ * ChangeStreamMutation.Builder builder = ChangeStreamMutation.createGcMutation(...);
+ * builder.setCell(...);
+ * builder.deleteFamily(...);
+ * builder.deleteCells(...);
+ * ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
+ * }
+ */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class ChangeStreamMutation implements ChangeStreamRecord, Serializable { + private static final long serialVersionUID = 8419520253162024218L; + + public enum MutationType { + USER, + GARBAGE_COLLECTION + } + + /** + * Creates a new instance of a user initiated mutation. It returns a builder instead of a + * ChangeStreamMutation because `token` and `loWatermark` must be set later when we finish + * building the logical mutation. + */ + static Builder createUserMutation( + @Nonnull ByteString rowKey, + @Nonnull String sourceClusterId, + java.time.Instant commitTimestamp, + int tieBreaker) { + return builder() + .setRowKey(rowKey) + .setType(MutationType.USER) + .setSourceClusterId(sourceClusterId) + .setCommitTime(commitTimestamp) + .setTieBreaker(tieBreaker); + } + + /** + * Creates a new instance of a GC mutation. It returns a builder instead of a ChangeStreamMutation + * because `token` and `loWatermark` must be set later when we finish building the logical + * mutation. + */ + static Builder createGcMutation( + @Nonnull ByteString rowKey, java.time.Instant commitTimestamp, int tieBreaker) { + return builder() + .setRowKey(rowKey) + .setType(MutationType.GARBAGE_COLLECTION) + .setSourceClusterId("") + .setCommitTime(commitTimestamp) + .setTieBreaker(tieBreaker); + } + + /** Get the row key of the current mutation. */ + @Nonnull + public abstract ByteString getRowKey(); + + /** Get the type of the current mutation. */ + @Nonnull + public abstract MutationType getType(); + + /** Get the source cluster id of the current mutation. */ + @Nonnull + public abstract String getSourceClusterId(); + + /** This method is obsolete. Use {@link #getCommitTime()} instead. */ + @ObsoleteApi("Use getCommitTime() instead") + public org.threeten.bp.Instant getCommitTimestamp() { + return toThreetenInstant(getCommitTime()); + } + + /** Get the commit timestamp of the current mutation. */ + public abstract java.time.Instant getCommitTime(); + + /** + * Get the tie breaker of the current mutation. This is used to resolve conflicts when multiple + * mutations are applied to different clusters at the same time. + */ + public abstract int getTieBreaker(); + + /** Get the token of the current mutation, which can be used to resume the changestream. */ + @Nonnull + public abstract String getToken(); + + /** This method is obsolete. Use {@link #getEstimatedLowWatermarkTime()} instead. */ + @ObsoleteApi("Use getEstimatedLowWatermarkTime() instead") + public org.threeten.bp.Instant getEstimatedLowWatermark() { + return toThreetenInstant(getEstimatedLowWatermarkTime()); + } + + /** Get the low watermark of the current mutation. */ + public abstract java.time.Instant getEstimatedLowWatermarkTime(); + + /** Get the list of mods of the current mutation. */ + @Nonnull + public abstract ImmutableList getEntries(); + + /** Returns a new builder for this class. */ + static Builder builder() { + return new AutoValue_ChangeStreamMutation.Builder(); + } + + /** Helper class to create a ChangeStreamMutation. */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + @AutoValue.Builder + abstract static class Builder { + abstract Builder setRowKey(ByteString rowKey); + + abstract Builder setType(MutationType type); + + abstract Builder setSourceClusterId(String sourceClusterId); + + abstract Builder setCommitTime(java.time.Instant commitTimestamp); + + abstract Builder setTieBreaker(int tieBreaker); + + abstract ImmutableList.Builder entriesBuilder(); + + abstract Builder setToken(String token); + + abstract Builder setEstimatedLowWatermarkTime(java.time.Instant estimatedLowWatermark); + + Builder setCell( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value) { + this.entriesBuilder().add(SetCell.create(familyName, qualifier, timestamp, value)); + return this; + } + + Builder deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange) { + this.entriesBuilder().add(DeleteCells.create(familyName, qualifier, timestampRange)); + return this; + } + + Builder deleteFamily(@Nonnull String familyName) { + this.entriesBuilder().add(DeleteFamily.create(familyName)); + return this; + } + + Builder addToCell(@Nonnull String familyName, Value qualifier, Value timestamp, Value input) { + this.entriesBuilder().add(AddToCell.create(familyName, qualifier, timestamp, input)); + return this; + } + + Builder mergeToCell(@Nonnull String familyName, Value qualifier, Value timestamp, Value input) { + this.entriesBuilder().add(MergeToCell.create(familyName, qualifier, timestamp, input)); + return this; + } + + abstract ChangeStreamMutation build(); + } + + public RowMutation toRowMutation(@Nonnull String tableId) { + RowMutation rowMutation = RowMutation.create(TableId.of(tableId), getRowKey()); + for (Entry entry : getEntries()) { + if (entry instanceof DeleteFamily) { + rowMutation.deleteFamily(((DeleteFamily) entry).getFamilyName()); + } else if (entry instanceof DeleteCells) { + DeleteCells deleteCells = (DeleteCells) entry; + rowMutation.deleteCells( + deleteCells.getFamilyName(), + deleteCells.getQualifier(), + deleteCells.getTimestampRange()); + } else if (entry instanceof SetCell) { + SetCell setCell = (SetCell) entry; + rowMutation.setCell( + setCell.getFamilyName(), + setCell.getQualifier(), + setCell.getTimestamp(), + setCell.getValue()); + } else if (entry instanceof AddToCell) { + AddToCell addToCell = (AddToCell) entry; + rowMutation.addToCell( + addToCell.getFamily(), + addToCell.getQualifier(), + addToCell.getTimestamp(), + addToCell.getInput()); + } else if (entry instanceof MergeToCell) { + MergeToCell mergeToCell = (MergeToCell) entry; + rowMutation.mergeToCell( + mergeToCell.getFamily(), + mergeToCell.getQualifier(), + mergeToCell.getTimestamp(), + mergeToCell.getInput()); + } else { + throw new IllegalArgumentException("Unexpected Entry type."); + } + } + return rowMutation; + } + + public RowMutationEntry toRowMutationEntry() { + RowMutationEntry rowMutationEntry = RowMutationEntry.create(getRowKey()); + for (Entry entry : getEntries()) { + if (entry instanceof DeleteFamily) { + rowMutationEntry.deleteFamily(((DeleteFamily) entry).getFamilyName()); + } else if (entry instanceof DeleteCells) { + DeleteCells deleteCells = (DeleteCells) entry; + rowMutationEntry.deleteCells( + deleteCells.getFamilyName(), + deleteCells.getQualifier(), + deleteCells.getTimestampRange()); + } else if (entry instanceof SetCell) { + SetCell setCell = (SetCell) entry; + rowMutationEntry.setCell( + setCell.getFamilyName(), + setCell.getQualifier(), + setCell.getTimestamp(), + setCell.getValue()); + } else if (entry instanceof AddToCell) { + AddToCell addToCell = (AddToCell) entry; + rowMutationEntry.addToCell( + addToCell.getFamily(), + addToCell.getQualifier(), + addToCell.getTimestamp(), + addToCell.getInput()); + } else if (entry instanceof MergeToCell) { + MergeToCell mergeToCell = (MergeToCell) entry; + rowMutationEntry.mergeToCell( + mergeToCell.getFamily(), + mergeToCell.getQualifier(), + mergeToCell.getTimestamp(), + mergeToCell.getInput()); + } else { + throw new IllegalArgumentException("Unexpected Entry type."); + } + } + return rowMutationEntry; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecord.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecord.java new file mode 100644 index 000000000000..2f0233e180f6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecord.java @@ -0,0 +1,26 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import java.io.Serializable; + +/** + * Default representation of a change stream record, which can be a Heartbeat, a CloseStream, or a + * logical mutation. + */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +public interface ChangeStreamRecord extends Serializable {} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter.java new file mode 100644 index 000000000000..9b892b14ea07 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter.java @@ -0,0 +1,185 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.protobuf.ByteString; +import java.time.Instant; +import javax.annotation.Nonnull; + +/** + * An extension point that allows end users to plug in a custom implementation of logical change + * stream records. This is useful in cases where the user would like to apply advanced client side + * filtering(for example, only keep DeleteFamily in the mutations). This adapter acts like a factory + * for a SAX style change stream record builder. + */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +public interface ChangeStreamRecordAdapter { + /** Creates a new instance of a {@link ChangeStreamRecordBuilder}. */ + ChangeStreamRecordBuilder createChangeStreamRecordBuilder(); + + /** Checks if the given change stream record is a Heartbeat. */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + boolean isHeartbeat(ChangeStreamRecordT record); + + /** + * Get the token from the given Heartbeat record. If the given record is not a Heartbeat, it will + * throw an Exception. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + String getTokenFromHeartbeat(ChangeStreamRecordT heartbeatRecord); + + /** Checks if the given change stream record is a ChangeStreamMutation. */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + boolean isChangeStreamMutation(ChangeStreamRecordT record); + + /** + * Get the token from the given ChangeStreamMutation record. If the given record is not a + * ChangeStreamMutation, it will throw an Exception. + */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + String getTokenFromChangeStreamMutation(ChangeStreamRecordT record); + + /** + * A SAX style change stream record factory. It is responsible for creating one of the three types + * of change stream record: heartbeat, close stream, and a change stream mutation. + * + *

State management is handled external to the implementation of this class: + * + *

    + * Case 1: Heartbeat + *
  1. Exactly 1 {@code onHeartbeat}. + *
+ * + *
    + * Case 2: CloseStream + *
  1. Exactly 1 {@code onCloseStream}. + *
+ * + *
    + * Case 3: ChangeStreamMutation. A change stream mutation consists of one or more mods, where + * the SetCells might be chunked. There are 3 different types of mods that a ReadChangeStream + * response can have: + *
  1. DeleteFamily -> Exactly 1 {@code deleteFamily} + *
  2. DeleteCell -> Exactly 1 {@code deleteCell} + *
  3. SetCell -> Exactly 1 {@code startCell}, At least 1 {@code CellValue}, Exactly 1 {@code + * finishCell}. + *
+ * + *

The whole flow of constructing a ChangeStreamMutation is: + * + *

    + *
  1. Exactly 1 {@code startUserMutation} or {@code startGcMutation}. + *
  2. At least 1 DeleteFamily/DeleteCell/SetCell mods. + *
  3. Exactly 1 {@code finishChangeStreamMutation}. + *
+ * + *

Note: For a non-chunked SetCell, only 1 {@code CellValue} will be called. For a chunked + * SetCell, more than 1 {@code CellValue}s will be called. + * + *

Note: DeleteRow's won't appear in data changes since they'll be converted to multiple + * DeleteFamily's. + */ + interface ChangeStreamRecordBuilder { + /** + * Called to create a heartbeat. This will be called at most once. If called, the current change + * stream record must not include any data changes or close stream messages. + */ + ChangeStreamRecordT onHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat); + + /** + * Called to create a close stream message. This will be called at most once. If called, the + * current change stream record must not include any data changes or heartbeats. + */ + ChangeStreamRecordT onCloseStream(ReadChangeStreamResponse.CloseStream closeStream); + + /** + * Called to start a new user initiated ChangeStreamMutation. This will be called at most once. + * If called, the current change stream record must not include any close stream message or + * heartbeat. + */ + void startUserMutation( + @Nonnull ByteString rowKey, + @Nonnull String sourceClusterId, + Instant commitTimestamp, + int tieBreaker); + + /** + * Called to start a new Garbage Collection ChangeStreamMutation. This will be called at most + * once. If called, the current change stream record must not include any close stream message + * or heartbeat. + */ + void startGcMutation(@Nonnull ByteString rowKey, Instant commitTimestamp, int tieBreaker); + + /** Called to add a DeleteFamily mod. */ + void deleteFamily(@Nonnull String familyName); + + /** Called to add a DeleteCell mod. */ + void deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange); + + void addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value value); + + void mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value value); + + /** + * Called to start a SetCell. + * + *

    + * In case of a non-chunked cell, the following order is guaranteed: + *
  1. Exactly 1 {@code startCell}. + *
  2. Exactly 1 {@code cellValue}. + *
  3. Exactly 1 {@code finishCell}. + *
+ * + *
    + * In case of a chunked cell, the following order is guaranteed: + *
  1. Exactly 1 {@code startCell}. + *
  2. At least 2 {@code cellValue}. + *
  3. Exactly 1 {@code finishCell}. + *
+ */ + void startCell(String family, ByteString qualifier, long timestampMicros); + + /** + * Called once per non-chunked cell, or at least twice per chunked cell to concatenate the cell + * value. + */ + void cellValue(ByteString value); + + /** Called once per cell to signal the end of the value (unless reset). */ + void finishCell(); + + /** Called once per stream record to signal that all mods have been processed (unless reset). */ + ChangeStreamRecordT finishChangeStreamMutation( + @Nonnull String token, Instant estimatedLowWatermark); + + /** Called when the current in progress change stream record should be dropped */ + void reset(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/CloseStream.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/CloseStream.java new file mode 100644 index 000000000000..344ed06c3c1e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/CloseStream.java @@ -0,0 +1,87 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.common.Status; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import java.io.Serializable; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * A simple wrapper for {@link ReadChangeStreamResponse.CloseStream}. This message is received when + * the stream reading is finished(i.e. read past the stream end time), or an error has occurred. + */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class CloseStream implements ChangeStreamRecord, Serializable { + private static final long serialVersionUID = 7316215828353608505L; + + private static CloseStream create( + com.google.rpc.Status status, + List changeStreamContinuationTokens, + List newPartitions) { + if (status.getCode() == 0) { + Preconditions.checkState( + changeStreamContinuationTokens.isEmpty(), + "An OK CloseStream should not have continuation tokens."); + } else { + Preconditions.checkState( + !changeStreamContinuationTokens.isEmpty(), + "A non-OK CloseStream should have continuation token(s)."); + Preconditions.checkState( + newPartitions.size() == 0 + || changeStreamContinuationTokens.size() == newPartitions.size(), + "Number of continuation tokens does not match number of new partitions."); + } + return new AutoValue_CloseStream( + Status.fromProto(status), changeStreamContinuationTokens, newPartitions); + } + + /** Wraps the protobuf {@link ReadChangeStreamResponse.CloseStream}. */ + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public static CloseStream fromProto(@Nonnull ReadChangeStreamResponse.CloseStream closeStream) { + return create( + closeStream.getStatus(), + closeStream.getContinuationTokensList().stream() + .map(ChangeStreamContinuationToken::fromProto) + .collect(ImmutableList.toImmutableList()), + closeStream.getNewPartitionsList().stream() + .map( + newPartition -> + ByteStringRange.create( + newPartition.getRowRange().getStartKeyClosed(), + newPartition.getRowRange().getEndKeyOpen())) + .collect(ImmutableList.toImmutableList())); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + @Nonnull + public abstract Status getStatus(); + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + @Nonnull + public abstract List getChangeStreamContinuationTokens(); + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + @Nonnull + public abstract List getNewPartitions(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java new file mode 100644 index 000000000000..aa3d17096a63 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java @@ -0,0 +1,191 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Mutates a row atomically based on the output of a condition filter. */ +public final class ConditionalRowMutation implements Serializable { + private static final long serialVersionUID = -3699904745621909502L; + + private final TargetId targetId; + private transient CheckAndMutateRowRequest.Builder builder = + CheckAndMutateRowRequest.newBuilder(); + + private ConditionalRowMutation(TargetId targetId, ByteString rowKey) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; + builder.setRowKey(rowKey); + } + + /** + * @deprecated Please use {@link ConditionalRowMutation#create(TargetId, String)} instead. + */ + @Deprecated + public static ConditionalRowMutation create(String tableId, String rowKey) { + return create(tableId, ByteString.copyFromUtf8(rowKey)); + } + + /** + * Creates a new instance of the mutation builder for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static ConditionalRowMutation create(TargetId targetId, String rowKey) { + return create(targetId, ByteString.copyFromUtf8(rowKey)); + } + + /** + * @deprecated Please use {@link ConditionalRowMutation#create(TargetId, ByteString)} instead. + */ + @Deprecated + public static ConditionalRowMutation create(String tableId, ByteString rowKey) { + Validations.validateTableId(tableId); + + return new ConditionalRowMutation(TableId.of(tableId), rowKey); + } + + /** + * Creates a new instance of the mutation builder for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static ConditionalRowMutation create(TargetId targetId, ByteString rowKey) { + return new ConditionalRowMutation(targetId, rowKey); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + builder = CheckAndMutateRowRequest.newBuilder().mergeFrom(input); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + builder.build().writeTo(output); + } + + /** + * The filter to be applied to the contents of the specified row. Depending on whether or not any + * results are yielded, either the mutations added via {@link #then(Mutation)} or {@link + * #otherwise(Mutation)} will be executed. If unset, checks that the row contains any values at + * all. + * + *

Unlike {@link #then(Mutation)} and {@link #otherwise(Mutation)}, only a single condition can + * be set. However that filter can be a {@link Filters#chain()} or {@link Filters#interleave()}, + * which can wrap multiple other filters. + * + *

WARNING: {@link Filters#condition(Filter)} is not supported. + */ + public ConditionalRowMutation condition(@Nonnull Filter condition) { + Preconditions.checkNotNull(condition); + Preconditions.checkState( + !builder.hasPredicateFilter(), + "Can only have a single condition, please use a Filters#chain or Filters#interleave filter" + + " instead"); + // TODO: verify that the condition does not use any FILTERS.condition() filters + + builder.setPredicateFilter(condition.toProto()); + + return this; + } + + /** + * Adds changes to be atomically applied to the specified row if the condition yields at least one + * cell when applied to the row. + * + *

Each {@code mutation} can specify multiple changes and the changes are accumulated each time + * this method is called. Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. Must contain at least one entry if {@link #otherwise(Mutation)} is empty, + * and at most 100000. + */ + public ConditionalRowMutation then(@Nonnull Mutation mutation) { + Preconditions.checkNotNull(mutation); + builder.addAllTrueMutations(mutation.getMutations()); + return this; + } + + /** + * Adds changes to be atomically applied to the specified row if the condition does not yields any + * cells when applied to the row. + * + *

Each {@code mutation} can specify multiple changes and the changes are accumulated each time + * this method is called. Mutations are applied in order, meaning that earlier mutations can be + * masked by later ones. Must contain at least one entry if {@link #then(Mutation)} is empty, and + * at most 100000. + */ + public ConditionalRowMutation otherwise(@Nonnull Mutation mutation) { + Preconditions.checkNotNull(mutation); + builder.addAllFalseMutations(mutation.getMutations()); + return this; + } + + /** + * Creates the underlying {@link CheckAndMutateRowRequest} protobuf. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public CheckAndMutateRowRequest toProto(RequestContext requestContext) { + Preconditions.checkState( + !builder.getTrueMutationsList().isEmpty() || !builder.getFalseMutationsList().isEmpty(), + "ConditionalRowMutations must have `then` or `otherwise` mutations."); + + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); + } + + /** + * Wraps the protobuf {@link CheckAndMutateRowRequest}. + * + *

WARNING: Please note that the table_name will be overwritten by the configuration in the + * BigtableDataClient. + */ + @BetaApi + public static ConditionalRowMutation fromProto(@Nonnull CheckAndMutateRowRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + + ConditionalRowMutation rowMutation = + ConditionalRowMutation.create( + NameUtil.extractTargetId(tableName, authorizedViewName), request.getRowKey()); + rowMutation.builder = request.toBuilder(); + + return rowMutation; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java new file mode 100644 index 000000000000..ffed83e6f950 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java @@ -0,0 +1,196 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.time.Instant; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Default implementation of a {@link ChangeStreamRecordAdapter} that uses {@link + * ChangeStreamRecord}s to represent change stream records. + */ +@InternalApi +public class DefaultChangeStreamRecordAdapter + implements ChangeStreamRecordAdapter { + + /** {@inheritDoc} */ + @Override + public ChangeStreamRecordBuilder createChangeStreamRecordBuilder() { + return new DefaultChangeStreamRecordBuilder(); + } + + /** {@inheritDoc} */ + @Override + public boolean isHeartbeat(ChangeStreamRecord record) { + return record instanceof Heartbeat; + } + + /** {@inheritDoc} */ + @Override + public String getTokenFromHeartbeat(ChangeStreamRecord record) { + Preconditions.checkArgument(isHeartbeat(record), "record is not a Heartbeat."); + return ((Heartbeat) record).getChangeStreamContinuationToken().getToken(); + } + + /** {@inheritDoc} */ + @Override + public boolean isChangeStreamMutation(ChangeStreamRecord record) { + return record instanceof ChangeStreamMutation; + } + + /** {@inheritDoc} */ + @Override + public String getTokenFromChangeStreamMutation(ChangeStreamRecord record) { + Preconditions.checkArgument( + isChangeStreamMutation(record), "record is not a ChangeStreamMutation."); + return ((ChangeStreamMutation) record).getToken(); + } + + /** {@inheritDoc} */ + static class DefaultChangeStreamRecordBuilder + implements ChangeStreamRecordBuilder { + private ChangeStreamMutation.Builder changeStreamMutationBuilder = null; + + // For the current SetCell. + @Nullable private String family; + @Nullable private ByteString qualifier; + private long timestampMicros; + @Nullable private ByteString value; + + public DefaultChangeStreamRecordBuilder() { + reset(); + } + + /** {@inheritDoc} */ + @Override + public ChangeStreamRecord onHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + Preconditions.checkState( + this.changeStreamMutationBuilder == null, + "Can not create a Heartbeat when there is an existing ChangeStreamMutation being built."); + return Heartbeat.fromProto(heartbeat); + } + + /** {@inheritDoc} */ + @Override + public ChangeStreamRecord onCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + Preconditions.checkState( + this.changeStreamMutationBuilder == null, + "Can not create a CloseStream when there is an existing ChangeStreamMutation being" + + " built."); + return CloseStream.fromProto(closeStream); + } + + /** {@inheritDoc} */ + @Override + public void startUserMutation( + @Nonnull ByteString rowKey, + @Nonnull String sourceClusterId, + Instant commitTimestamp, + int tieBreaker) { + this.changeStreamMutationBuilder = + ChangeStreamMutation.createUserMutation( + rowKey, sourceClusterId, commitTimestamp, tieBreaker); + } + + /** {@inheritDoc} */ + @Override + public void startGcMutation(ByteString rowKey, Instant commitTimestamp, int tieBreaker) { + this.changeStreamMutationBuilder = + ChangeStreamMutation.createGcMutation(rowKey, commitTimestamp, tieBreaker); + } + + /** {@inheritDoc} */ + @Override + public void deleteFamily(@Nonnull String familyName) { + this.changeStreamMutationBuilder.deleteFamily(familyName); + } + + /** {@inheritDoc} */ + @Override + public void deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange) { + this.changeStreamMutationBuilder.deleteCells(familyName, qualifier, timestampRange); + } + + @Override + public void addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + this.changeStreamMutationBuilder.addToCell(familyName, qualifier, timestamp, input); + } + + @Override + public void mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + this.changeStreamMutationBuilder.mergeToCell(familyName, qualifier, timestamp, input); + } + + /** {@inheritDoc} */ + @Override + public void startCell(String family, ByteString qualifier, long timestampMicros) { + this.family = family; + this.qualifier = qualifier; + this.timestampMicros = timestampMicros; + this.value = ByteString.EMPTY; + } + + /** {@inheritDoc} */ + @Override + public void cellValue(ByteString value) { + this.value = this.value.concat(value); + } + + /** {@inheritDoc} */ + @Override + public void finishCell() { + this.changeStreamMutationBuilder.setCell( + this.family, this.qualifier, this.timestampMicros, this.value); + } + + /** {@inheritDoc} */ + @Override + public ChangeStreamRecord finishChangeStreamMutation( + String token, Instant estimatedLowWatermark) { + this.changeStreamMutationBuilder.setToken(token); + this.changeStreamMutationBuilder.setEstimatedLowWatermarkTime(estimatedLowWatermark); + return this.changeStreamMutationBuilder.build(); + } + + /** {@inheritDoc} */ + @Override + public void reset() { + changeStreamMutationBuilder = null; + + family = null; + qualifier = null; + timestampMicros = 0; + value = null; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java new file mode 100644 index 000000000000..d722bcbe6e66 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java @@ -0,0 +1,179 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.Cell; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.List; +import java.util.Objects; +import java.util.TreeMap; + +/** + * Default implementation of a {@link RowAdapter} that uses {@link Row}s to represent logical rows. + */ +public class DefaultRowAdapter implements RowAdapter { + /** {@inheritDoc} */ + @Override + public boolean isScanMarkerRow(Row row) { + return row.getCells().isEmpty(); + } + + /** {@inheritDoc} */ + @Override + public RowBuilder createRowBuilder() { + return new DefaultRowBuilder(); + } + + /** {@inheritDoc} */ + @Override + public ByteString getKey(Row row) { + return row.getKey(); + } + + /** + * Helper to convert a proto Row to a model Row. + * + *

For internal use only. + */ + @InternalApi + public Row createRowFromProto(com.google.bigtable.v2.Row row) { + RowBuilder builder = createRowBuilder(); + builder.startRow(row.getKey()); + + for (Family family : row.getFamiliesList()) { + for (Column column : family.getColumnsList()) { + for (Cell cell : column.getCellsList()) { + builder.startCell( + family.getName(), + column.getQualifier(), + cell.getTimestampMicros(), + cell.getLabelsList(), + cell.getValue().size()); + builder.cellValue(cell.getValue()); + builder.finishCell(); + } + } + } + + return builder.finishRow(); + } + + /** Internal implementation detail for {@link DefaultRowAdapter}. */ + @InternalApi() + public static class DefaultRowBuilder implements RowBuilder { + private ByteString currentKey; + private TreeMap> cellsByFamily; + private ImmutableList.Builder currentFamilyCells; + private String previousFamily; + + private String family; + private ByteString qualifier; + private List labels; + private long timestamp; + private ByteString value; + + public DefaultRowBuilder() { + reset(); + } + + /** {@inheritDoc} */ + @Override + public Row createScanMarkerRow(ByteString key) { + return Row.create(key, ImmutableList.of()); + } + + /** {@inheritDoc} */ + @Override + public void startRow(ByteString key) { + currentKey = key; + } + + /** {@inheritDoc} */ + @Override + public void startCell( + String family, ByteString qualifier, long timestamp, List labels, long size) { + this.family = family; + this.qualifier = qualifier; + this.timestamp = timestamp; + this.labels = labels; + this.value = ByteString.EMPTY; + } + + /** {@inheritDoc} */ + @Override + public void cellValue(ByteString value) { + this.value = this.value.concat(value); + } + + /** {@inheritDoc} */ + @Override + public void finishCell() { + if (!Objects.equals(family, previousFamily)) { + previousFamily = family; + currentFamilyCells = ImmutableList.builder(); + cellsByFamily.put(family, currentFamilyCells); + } + + RowCell rowCell = RowCell.create(family, qualifier, timestamp, labels, value); + currentFamilyCells.add(rowCell); + } + + /** {@inheritDoc} */ + @Override + public Row finishRow() { + final ImmutableList sortedCells; + + // Optimization: If there are no cells, then just return the static empty list. + if (cellsByFamily.isEmpty()) { + sortedCells = ImmutableList.of(); + } else if (cellsByFamily.size() == 1) { + // Optimization: If there is a single family, avoid copies and return that one list. + sortedCells = currentFamilyCells.build(); + } else { + // Normal path: concatenate the cells order by family. + // TODO: use builderWithExpectedSize(totalCellCount) when it stabilizes + ImmutableList.Builder sortedCellsBuilder = ImmutableList.builder(); + + for (ImmutableList.Builder familyCells : cellsByFamily.values()) { + sortedCellsBuilder.addAll(familyCells.build()); + } + sortedCells = sortedCellsBuilder.build(); + } + + return Row.create(currentKey, sortedCells); + } + + /** {@inheritDoc} */ + @Override + public void reset() { + currentKey = null; + + cellsByFamily = new TreeMap<>(); + currentFamilyCells = null; + previousFamily = null; + + family = null; + qualifier = null; + labels = null; + timestamp = 0; + value = null; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteCells.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteCells.java new file mode 100644 index 000000000000..26fcdd108340 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteCells.java @@ -0,0 +1,49 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Representation of a DeleteCells mod in a data change. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class DeleteCells implements Entry, Serializable { + private static final long serialVersionUID = 851772158721462017L; + + public static DeleteCells create( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange) { + return new AutoValue_DeleteCells(familyName, qualifier, timestampRange); + } + + /** Get the column family of the current DeleteCells. */ + @Nonnull + public abstract String getFamilyName(); + + /** Get the column qualifier of the current DeleteCells. */ + @Nonnull + public abstract ByteString getQualifier(); + + /** Get the timestamp range of the current DeleteCells. */ + @Nonnull + public abstract TimestampRange getTimestampRange(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteFamily.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteFamily.java new file mode 100644 index 000000000000..367811c38653 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteFamily.java @@ -0,0 +1,36 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Representation of a DeleteFamily mod in a data change. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class DeleteFamily implements Entry, Serializable { + private static final long serialVersionUID = 81806775917145615L; + + public static DeleteFamily create(@Nonnull String familyName) { + return new AutoValue_DeleteFamily(familyName); + } + + /** Get the column family of the current DeleteFamily. */ + @Nonnull + public abstract String getFamilyName(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Entry.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Entry.java new file mode 100644 index 000000000000..44abf53d5f5b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Entry.java @@ -0,0 +1,26 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; + +/** + * Default representation of a mod in a data change, which can be a {@link DeleteFamily}, a {@link + * DeleteCells}, or a {@link SetCell} This class will be used by {@link ChangeStreamMutation} to + * represent a list of mods in a logical change stream mutation. + */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +public interface Entry {} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java new file mode 100644 index 000000000000..4c82608545a0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java @@ -0,0 +1,795 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.bigtable.v2.ColumnRange; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.ValueRange; +import com.google.cloud.bigtable.data.v2.internal.RegexUtil; +import com.google.cloud.bigtable.data.v2.models.Range.AbstractByteStringRange; +import com.google.cloud.bigtable.data.v2.models.Range.AbstractTimestampRange; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * A Fluent DSL to create a hierarchy of filters for the CheckAndMutateRow RPCs and ReadRows Query. + * + *

Intended usage is to statically import, or in case of conflict, assign the static variable + * FILTERS and use its fluent API to build filters. + * + *

Sample code: + * + *

{@code
+ * import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;
+ *
+ * void main() {
+ *   // Build the filter expression
+ *   RowFilter filter = FILTERS.chain()
+ *     .filter(FILTERS.qualifier().regex("prefix.*"))
+ *     .filter(FILTERS.limit().cellsPerRow(10));
+ *
+ *   // Use it in a Query
+ *   Query query = Query.create("[TABLE]")
+ *     .filter(filter);
+ * }
+ *
+ * }
+ */ +public final class Filters { + /** Entry point into the DSL. */ + @SuppressWarnings("WeakerAccess") + public static final Filters FILTERS = new Filters(); + + private static final SimpleFilter PASS = + new SimpleFilter(RowFilter.newBuilder().setPassAllFilter(true).build()); + private static final SimpleFilter BLOCK = + new SimpleFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()); + private static final SimpleFilter SINK = + new SimpleFilter(RowFilter.newBuilder().setSink(true).build()); + private static final SimpleFilter STRIP_VALUE = + new SimpleFilter(RowFilter.newBuilder().setStripValueTransformer(true).build()); + + private Filters() {} + + /** + * Creates an empty chain filter list. Filters can be added to the chain by invoking {@link + * ChainFilter#filter(Filters.Filter)}. + * + *

The elements of "filters" are chained together to process the input row: + * + *

{@code in row -> filter0 -> intermediate row -> filter1 -> ... -> filterN -> out row}
+   * 
+ * + * The full chain is executed atomically. + */ + public ChainFilter chain() { + return new ChainFilter(); + } + + /** + * Creates an empty interleave filter list. Filters can be added to the interleave by invoking + * {@link InterleaveFilter#filter(Filters.Filter)}. + * + *

The elements of "filters" all process a copy of the input row, and the results are pooled, + * sorted, and combined into a single output row. If multiple cells are produced with the same + * column and timestamp, they will all appear in the output row in an unspecified mutual order. + * The full chain is executed atomically. + */ + public InterleaveFilter interleave() { + return new InterleaveFilter(); + } + + /** + * Creates an empty condition filter. The filter results of the predicate can be configured by + * invoking {@link ConditionFilter#then(Filters.Filter)} and {@link + * ConditionFilter#otherwise(Filters.Filter)}. + * + *

A RowFilter which evaluates one of two possible RowFilters, depending on whether or not a + * predicate RowFilter outputs any cells from the input row. + * + *

IMPORTANT NOTE: The predicate filter does not execute atomically with the {@link + * ConditionFilter#then(Filters.Filter)} and {@link ConditionFilter#otherwise(Filters.Filter)} + * (Filter)} filters, which may lead to inconsistent or unexpected results. Additionally, {@link + * ConditionFilter} may have poor performance, especially when filters are set for the {@link + * ConditionFilter#otherwise(Filters.Filter)}. + */ + public ConditionFilter condition(@Nonnull Filter predicate) { + Preconditions.checkNotNull(predicate); + return new ConditionFilter(predicate); + } + + /** Returns the builder for row key related filters. */ + public KeyFilter key() { + return new KeyFilter(); + } + + /** Returns the builder for column family related filters. */ + public FamilyFilter family() { + return new FamilyFilter(); + } + + /** Returns the builder for column qualifier related filters. */ + public QualifierFilter qualifier() { + return new QualifierFilter(); + } + + /** Returns the builder for timestamp related filters. */ + public TimestampFilter timestamp() { + return new TimestampFilter(); + } + + /** Returns the builder for value related filters. */ + public ValueFilter value() { + return new ValueFilter(); + } + + /** Returns the builder for offset related filters. */ + public OffsetFilter offset() { + return new OffsetFilter(); + } + + /** Returns the builder for limit related filters. */ + public LimitFilter limit() { + return new LimitFilter(); + } + + // Miscellaneous filters without a clear target. + /** + * Wraps protobuf representation of a filter. + * + *

For advanced use only. + */ + public Filter fromProto(RowFilter rowFilter) { + return new SimpleFilter(rowFilter); + } + + /** Matches all cells, regardless of input. Functionally equivalent to having no filter. */ + public Filter pass() { + return PASS; + } + + /** + * Does not match any cells, regardless of input. Useful for temporarily disabling just part of a + * filter. + */ + public Filter block() { + return BLOCK; + } + + /** + * Outputs all cells directly to the output of the read rather than to any parent filter. For + * advanced usage, see comments in + * https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto for more + * details. + */ + public Filter sink() { + return SINK; + } + + /** + * Applies the given label to all cells in the output row. This allows the caller to determine + * which results were produced from which part of the filter. + * + *

Due to a technical limitation, it is not currently possible to apply multiple labels to a + * cell. As a result, a {@link ChainFilter} may have no more than one sub-filter which contains a + * label. It is okay for an {@link InterleaveFilter} to contain multiple labels, as they will be + * applied to separate copies of the input. This may be relaxed in the future. + */ + public Filter label(@Nonnull String label) { + Preconditions.checkNotNull(label); + return new SimpleFilter(RowFilter.newBuilder().setApplyLabelTransformer(label).build()); + } + + // Implementations of target specific filters. + /** DSL for adding filters to a chain. */ + public static final class ChainFilter implements Filter { + private static final long serialVersionUID = -6756759448656768478L; + private transient RowFilter.Chain.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Chain chain = (RowFilter.Chain) s.readObject(); + this.builder = chain.toBuilder(); + } + + private ChainFilter() { + this.builder = RowFilter.Chain.newBuilder(); + } + + /** Add a filter to chain. */ + public ChainFilter filter(@Nonnull Filter filter) { + Preconditions.checkNotNull(filter); + builder.addFilters(filter.toProto()); + return this; + } + + @InternalApi + @Override + public RowFilter toProto() { + switch (builder.getFiltersCount()) { + case 0: + return PASS.toProto(); + case 1: + return builder.getFilters(0); + default: + return RowFilter.newBuilder().setChain(builder.build()).build(); + } + } + + /** Makes a deep copy of the Chain. */ + @Override + public ChainFilter clone() { + try { + ChainFilter clone = (ChainFilter) super.clone(); + clone.builder = builder.clone(); + return clone; + } catch (CloneNotSupportedException | ClassCastException e) { + throw new RuntimeException("should never happen"); + } + } + } + + /** DSL for adding filters to the interleave list. */ + public static final class InterleaveFilter implements Filter { + private static final long serialVersionUID = -6356151037337889421L; + private transient RowFilter.Interleave.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Interleave interleave = (RowFilter.Interleave) s.readObject(); + this.builder = interleave.toBuilder(); + } + + private InterleaveFilter() { + builder = RowFilter.Interleave.newBuilder(); + } + + /** Adds a {@link Filter} to the interleave list. */ + public InterleaveFilter filter(@Nonnull Filter filter) { + Preconditions.checkNotNull(filter); + builder.addFilters(filter.toProto()); + return this; + } + + @InternalApi + @Override + public RowFilter toProto() { + switch (builder.getFiltersCount()) { + case 0: + return PASS.toProto(); + case 1: + return builder.getFilters(0); + default: + return RowFilter.newBuilder().setInterleave(builder.build()).build(); + } + } + + @Override + public InterleaveFilter clone() { + try { + InterleaveFilter clone = (InterleaveFilter) super.clone(); + clone.builder = builder.clone(); + return clone; + } catch (CloneNotSupportedException | ClassCastException e) { + throw new RuntimeException("should never happen"); + } + } + } + + /** DSL for configuring a conditional filter. */ + public static final class ConditionFilter implements Filter { + private static final long serialVersionUID = -2720899822014446776L; + private transient RowFilter.Condition.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Condition condition = (RowFilter.Condition) s.readObject(); + this.builder = condition.toBuilder(); + } + + private ConditionFilter(@Nonnull Filter predicate) { + Preconditions.checkNotNull(predicate); + builder = RowFilter.Condition.newBuilder().setPredicateFilter(predicate.toProto()); + } + + /** Sets (replaces) the filter to apply when the predicate is true. */ + public ConditionFilter then(@Nonnull Filter filter) { + Preconditions.checkNotNull(filter); + builder.setTrueFilter(filter.toProto()); + return this; + } + + /** Sets (replaces) the filter to apply when the predicate is false. */ + public ConditionFilter otherwise(@Nonnull Filter filter) { + Preconditions.checkNotNull(filter); + builder.setFalseFilter(filter.toProto()); + return this; + } + + @InternalApi + @Override + public RowFilter toProto() { + Preconditions.checkState( + builder.hasTrueFilter() || builder.hasFalseFilter(), + "ConditionFilter must have either a then or otherwise filter."); + return RowFilter.newBuilder().setCondition(builder.build()).build(); + } + + @Override + public ConditionFilter clone() { + try { + ConditionFilter clone = (ConditionFilter) super.clone(); + clone.builder = builder.clone(); + return clone; + } catch (CloneNotSupportedException | ClassCastException e) { + throw new RuntimeException("should never happen"); + } + } + } + + public static final class KeyFilter implements Serializable { + private static final long serialVersionUID = 5137765114285539458L; + + private KeyFilter() {} + + /** + * Matches only cells from rows whose keys satisfy the given RE2 regex. In other words, passes + * through the entire row when the key matches, and otherwise produces an empty row. Note that, + * since row keys can contain arbitrary bytes, the `\C` escape sequence must be used if a true + * wildcard is desired. The `.` character will not match the new line character `\n`, which may + * be present in a binary key. + */ + public Filter regex(@Nonnull String regex) { + Preconditions.checkNotNull(regex); + return regex(ByteString.copyFromUtf8(regex)); + } + + /** + * Matches only cells from rows whose keys satisfy the given RE2 regex. In other words, passes + * through the entire row when the key matches, and otherwise produces an empty row. Note that, + * since row keys can contain arbitrary bytes, the `\C` escape sequence must be used if a true + * wildcard is desired. The `.` character will not match the new line character `\n`, which may + * be present in a binary key. + */ + public Filter regex(@Nonnull ByteString regex) { + Preconditions.checkNotNull(regex); + return new SimpleFilter(RowFilter.newBuilder().setRowKeyRegexFilter(regex).build()); + } + + /** + * Matches only cells from rows whose keys equal the value. In other words, passes through the + * entire row when the key matches, and otherwise produces an empty row. + */ + public Filter exactMatch(@Nonnull String value) { + Preconditions.checkNotNull(value); + return exactMatch(ByteString.copyFromUtf8(value)); + } + + /** + * Matches only cells from rows whose keys equal the value. In other words, passes through the + * entire row when the key matches, and otherwise produces an empty row. + */ + public Filter exactMatch(@Nonnull ByteString value) { + Preconditions.checkNotNull(value); + + return regex(RegexUtil.literalRegex(value)); + } + + /** + * Matches all cells from a row with `probability`, and matches no cells from the row with + * probability 1-`probability`. + */ + public Filter sample(double probability) { + Preconditions.checkArgument(0 <= probability, "Probability must be positive"); + Preconditions.checkArgument(probability <= 1.0, "Probability must be less than 1.0"); + + return new SimpleFilter(RowFilter.newBuilder().setRowSampleFilter(probability).build()); + } + } + + public static final class FamilyFilter implements Serializable { + private static final long serialVersionUID = -4470936841191831553L; + + private FamilyFilter() {} + + /** + * Matches only cells from columns whose families satisfy the given RE2 regex. For technical reasons, the + * regex must not contain the `:` character, even if it is not being used as a literal. Note + * that, since column families cannot contain the new line character `\n`, it is sufficient to + * use `.` as a full wildcard when matching column family names. + */ + public Filter regex(@Nonnull String regex) { + Preconditions.checkNotNull(regex); + return new SimpleFilter(RowFilter.newBuilder().setFamilyNameRegexFilter(regex).build()); + } + + /** Matches only cells from columns whose families match the value. */ + public Filter exactMatch(@Nonnull String value) { + Preconditions.checkNotNull(value); + return regex(RegexUtil.literalRegex(value)); + } + } + + public static final class QualifierFilter implements Serializable { + private static final long serialVersionUID = -1274850022909506559L; + + private QualifierFilter() {} + + /** + * Matches only cells from columns whose qualifiers satisfy the given RE2 regex. Note that, since column + * qualifiers can contain arbitrary bytes, the `\C` escape sequence must be used if a true + * wildcard is desired. The `.` character will not match the new line character `\n`, which may + * be present in a binary qualifier. + */ + public Filter regex(@Nonnull String regex) { + Preconditions.checkNotNull(regex); + return regex(ByteString.copyFromUtf8(regex)); + } + + /** + * Matches only cells from columns whose qualifiers satisfy the given RE2 regex. Note that, since column + * qualifiers can contain arbitrary bytes, the `\C` escape sequence must be used if a true + * wildcard is desired. The `.` character will not match the new line character `\n`, which may + * be present in a binary qualifier. + */ + public Filter regex(@Nonnull ByteString regex) { + Preconditions.checkNotNull(regex); + + return new SimpleFilter(RowFilter.newBuilder().setColumnQualifierRegexFilter(regex).build()); + } + + /** Matches only cells from columns whose qualifiers equal the value. */ + public Filter exactMatch(@Nonnull String value) { + Preconditions.checkNotNull(value); + return exactMatch(ByteString.copyFromUtf8(value)); + } + + /** Matches only cells from columns whose qualifiers equal the value. */ + public Filter exactMatch(@Nonnull ByteString value) { + Preconditions.checkNotNull(value); + return regex(RegexUtil.literalRegex(value)); + } + + /** + * Construct a {@link QualifierRangeFilter} that can create a {@link ColumnRange} oriented + * {@link Filter}. + * + * @return a new {@link QualifierRangeFilter} + */ + public QualifierRangeFilter rangeWithinFamily(@Nonnull String family) { + Preconditions.checkNotNull(family); + return new QualifierRangeFilter(family); + } + } + + /** Matches only cells from columns within the given range. */ + public static final class QualifierRangeFilter + extends AbstractByteStringRange implements Filter { + private static final long serialVersionUID = -1909319911147913630L; + private final String family; + + private QualifierRangeFilter(String family) { + this.family = family; + } + + @InternalApi + @Override + public RowFilter toProto() { + ColumnRange.Builder builder = ColumnRange.newBuilder().setFamilyName(family); + + switch (getStartBound()) { + case CLOSED: + builder.setStartQualifierClosed(getStart()); + break; + case OPEN: + builder.setStartQualifierOpen(getStart()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown start bound: " + getStartBound()); + } + switch (getEndBound()) { + case CLOSED: + builder.setEndQualifierClosed(getEnd()); + break; + case OPEN: + builder.setEndQualifierOpen(getEnd()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown end bound: " + getEndBound()); + } + + return RowFilter.newBuilder().setColumnRangeFilter(builder.build()).build(); + } + + @Override + public QualifierRangeFilter clone() { + return super.clone(); + } + } + + public static final class TimestampFilter implements Serializable { + private static final long serialVersionUID = 5284219722591464991L; + + private TimestampFilter() {} + + /** + * Matches only cells with timestamps within the given range. + * + * @return a {@link TimestampRangeFilter} on which start / end timestamps can be specified. + */ + public TimestampRangeFilter range() { + return new TimestampRangeFilter(); + } + + /** + * Matches cells with exact given timestamp. + * + * @return a {@link TimestampRangeFilter} with start/end closed timestamp. + */ + public TimestampRangeFilter exact(Long exactTimestamp) { + return new TimestampRangeFilter().startClosed(exactTimestamp).endClosed(exactTimestamp); + } + } + + /** Matches only cells with microsecond timestamps within the given range. */ + public static final class TimestampRangeFilter + extends AbstractTimestampRange implements Filter { + private static final long serialVersionUID = 8410980338603335276L; + + private TimestampRangeFilter() {} + + @InternalApi + @Override + public RowFilter toProto() { + com.google.bigtable.v2.TimestampRange.Builder builder = + com.google.bigtable.v2.TimestampRange.newBuilder(); + + switch (getStartBound()) { + case CLOSED: + builder.setStartTimestampMicros(getStart()); + break; + case OPEN: + builder.setStartTimestampMicros(getStart() + 1); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown start bound: " + getStartBound()); + } + switch (getEndBound()) { + case CLOSED: + builder.setEndTimestampMicros(getEnd() + 1); + break; + case OPEN: + builder.setEndTimestampMicros(getEnd()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown end bound: " + getEndBound()); + } + return RowFilter.newBuilder().setTimestampRangeFilter(builder.build()).build(); + } + + @Override + public TimestampRangeFilter clone() { + return super.clone(); + } + } + + public static final class ValueFilter implements Serializable { + private static final long serialVersionUID = 6722715229238811179L; + + private ValueFilter() {} + + /** + * Matches only cells with values that satisfy the given RE2 regex. Note that, since cell values + * can contain arbitrary bytes, the `\C` escape sequence must be used if a true wildcard is + * desired. The `.` character will not match the new line character `\n`, which may be present + * in a binary value. + */ + public Filter regex(@Nonnull String regex) { + Preconditions.checkNotNull(regex); + return regex(ByteString.copyFromUtf8(regex)); + } + + /** Matches only cells with values that match the given value. */ + public Filter exactMatch(@Nonnull String value) { + Preconditions.checkNotNull(value); + return exactMatch(ByteString.copyFromUtf8(value)); + } + + /** Matches only cells with values that match the given value. */ + public Filter exactMatch(@Nonnull ByteString value) { + Preconditions.checkNotNull(value); + return regex(RegexUtil.literalRegex(value)); + } + + /** + * Matches only cells with values that satisfy the given RE2 regex. Note that, since cell values + * can contain arbitrary bytes, the `\C` escape sequence must be used if a true wildcard is + * desired. The `.` character will not match the new line character `\n`, which may be present + * in a binary value. + */ + public Filter regex(@Nonnull ByteString regex) { + Preconditions.checkNotNull(regex); + return new SimpleFilter(RowFilter.newBuilder().setValueRegexFilter(regex).build()); + } + + /** + * Construct a {@link ValueRangeFilter} that can create a {@link ValueRange} oriented {@link + * Filter}. + * + * @return a new {@link ValueRangeFilter} + */ + public ValueRangeFilter range() { + return new ValueRangeFilter(); + } + + /** Replaces each cell's value with the empty string. */ + public Filter strip() { + return STRIP_VALUE; + } + } + + /** Matches only cells with values that fall within the given value range. */ + public static final class ValueRangeFilter extends AbstractByteStringRange + implements Filter { + private static final long serialVersionUID = -2452360677825047088L; + + private ValueRangeFilter() {} + + @InternalApi + @Override + public RowFilter toProto() { + ValueRange.Builder builder = ValueRange.newBuilder(); + switch (getStartBound()) { + case CLOSED: + builder.setStartValueClosed(getStart()); + break; + case OPEN: + builder.setStartValueOpen(getStart()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown start bound: " + getStartBound()); + } + switch (getEndBound()) { + case CLOSED: + builder.setEndValueClosed(getEnd()); + break; + case OPEN: + builder.setEndValueOpen(getEnd()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalStateException("Unknown end bound: " + getEndBound()); + } + return RowFilter.newBuilder().setValueRangeFilter(builder.build()).build(); + } + + @Override + public ValueRangeFilter clone() { + return super.clone(); + } + } + + public static final class OffsetFilter implements Serializable { + private static final long serialVersionUID = 3228791236971884041L; + + private OffsetFilter() {} + + /** + * Skips the first N cells of each row, matching all subsequent cells. If duplicate cells are + * present, as is possible when using an {@link InterleaveFilter}, each copy of the cell is + * counted separately. + */ + public Filter cellsPerRow(int count) { + return new SimpleFilter(RowFilter.newBuilder().setCellsPerRowOffsetFilter(count).build()); + } + } + + public static final class LimitFilter implements Serializable { + private static final long serialVersionUID = -794915549003008940L; + + private LimitFilter() {} + + /** + * Matches only the first N cells of each row. If duplicate cells are present, as is possible + * when using an Interleave, each copy of the cell is counted separately. + */ + public Filter cellsPerRow(int count) { + return new SimpleFilter(RowFilter.newBuilder().setCellsPerRowLimitFilter(count).build()); + } + + /** + * Matches only the most recent `count` cells within each column. For example, if count=2, this + * filter would match column `foo:bar` at timestamps 10 and 9 skip all earlier cells in + * `foo:bar`, and then begin matching again in column `foo:bar2`. If duplicate cells are + * present, as is possible when using an {@link InterleaveFilter}, each copy of the cell is + * counted separately. + */ + public Filter cellsPerColumn(int count) { + return new SimpleFilter(RowFilter.newBuilder().setCellsPerColumnLimitFilter(count).build()); + } + } + + private static final class SimpleFilter implements Filter { + private static final long serialVersionUID = 3595911451325189833L; + private final RowFilter proto; + + private SimpleFilter(@Nonnull RowFilter proto) { + Preconditions.checkNotNull(proto); + this.proto = proto; + } + + @InternalApi + @Override + public RowFilter toProto() { + return proto; + } + + @Override + public SimpleFilter clone() { + try { + return (SimpleFilter) super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException("should never happen", e); + } + } + } + + @InternalExtensionOnly + public interface Filter extends Cloneable, Serializable { + @InternalApi + RowFilter toProto(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java new file mode 100644 index 000000000000..ae5507ae752e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java @@ -0,0 +1,59 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; + +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** A simple wrapper for {@link ReadChangeStreamResponse.Heartbeat}. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class Heartbeat implements ChangeStreamRecord, Serializable { + private static final long serialVersionUID = 7316215828353608504L; + + private static Heartbeat create( + ChangeStreamContinuationToken changeStreamContinuationToken, + java.time.Instant estimatedLowWatermark) { + return new AutoValue_Heartbeat(changeStreamContinuationToken, estimatedLowWatermark); + } + + /** Wraps the protobuf {@link ReadChangeStreamResponse.Heartbeat}. */ + static Heartbeat fromProto(@Nonnull ReadChangeStreamResponse.Heartbeat heartbeat) { + return create( + ChangeStreamContinuationToken.fromProto(heartbeat.getContinuationToken()), + java.time.Instant.ofEpochSecond( + heartbeat.getEstimatedLowWatermark().getSeconds(), + heartbeat.getEstimatedLowWatermark().getNanos())); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public abstract ChangeStreamContinuationToken getChangeStreamContinuationToken(); + + /** This method is obsolete. Use {@link #getEstimatedLowWatermarkTime()} instead. */ + @ObsoleteApi("Use getEstimatedLowWatermarkTime() instead") + public org.threeten.bp.Instant getEstimatedLowWatermark() { + return toThreetenInstant(getEstimatedLowWatermarkTime()); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public abstract java.time.Instant getEstimatedLowWatermarkTime(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/KeyOffset.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/KeyOffset.java new file mode 100644 index 000000000000..bba22bb39287 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/KeyOffset.java @@ -0,0 +1,50 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.auto.value.AutoValue; +import com.google.protobuf.ByteString; +import java.io.Serializable; + +/** Represents the offset of a row key in a table. */ +@InternalExtensionOnly +@AutoValue +public abstract class KeyOffset implements Serializable { + @InternalApi + public static KeyOffset create(ByteString key, long offsetBytes) { + return new AutoValue_KeyOffset(key, offsetBytes); + } + + /** + * A row key value that is returned as part of the response of {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient#sampleRowKeysAsync(String)}. The key + * represents end boundary of one of the contiguous sections in a list of approximately equal + * sized sections. + * + *

Note that row key may not have ever been written to or read from, and users should therefore + * not make any assumptions about the row key structure that are specific to their use case. + */ + public abstract ByteString getKey(); + + /** + * Approximate total storage space used by all rows in the table which precede {@link #getKey()}. + * Buffering the contents of all rows between two subsequent samples would require space roughly + * equal to the difference in their {@link #getOffsetBytes()} fields. + */ + public abstract long getOffsetBytes(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewId.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewId.java new file mode 100644 index 000000000000..f6f08d441ab7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewId.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.common.base.Preconditions; + +/** + * An implementation of a {@link TargetId} for materialized views. + * + *

See {@link com.google.cloud.bigtable.admin.v2.models.MaterializedView} for more details about + * an materialized view. + */ +@AutoValue +public abstract class MaterializedViewId implements TargetId { + /** Constructs a new MaterializedViewId object from the specified materializedViewId. */ + public static MaterializedViewId of(String materializedViewId) { + Preconditions.checkNotNull(materializedViewId, "materialized view id can't be null."); + return new AutoValue_MaterializedViewId(materializedViewId); + } + + public abstract String getMaterializedViewId(); + + @Override + @InternalApi + public String toResourceName(String projectId, String instanceId) { + return NameUtil.formatMaterializedViewName(projectId, instanceId, getMaterializedViewId()); + } + + @Override + @InternalApi + public boolean scopedForAuthorizedView() { + return false; + } + + @Override + @InternalApi + public boolean scopedForMaterializedView() { + return true; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MergeToCell.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MergeToCell.java new file mode 100644 index 000000000000..cca3aee18295 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MergeToCell.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Representation of an MergeToCell mod in a data change. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class MergeToCell implements Entry, Serializable { + public static MergeToCell create( + @Nonnull String family, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + return new AutoValue_MergeToCell(family, qualifier, timestamp, input); + } + + @Nonnull + public abstract String getFamily(); + + @Nonnull + public abstract Value getQualifier(); + + @Nonnull + public abstract Value getTimestamp(); + + @Nonnull + public abstract Value getInput(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java new file mode 100644 index 000000000000..3eb6c6c7dde8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java @@ -0,0 +1,114 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.StatusCode; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.common.base.Preconditions; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Thrown by the MutateRows when at least one Mutation failed. If the last failure was caused by an + * RPC error (as opposed to a single entry failing), then this exception's cause will be set to that + * error and {@link #getFailedMutations()} will contain synthetic errors for all of the entries that + * were part of that RPC. + */ +public final class MutateRowsException extends ApiException { + private final List failedMutations; + + /** + * This constructor is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + public static MutateRowsException create( + @Nullable Throwable rpcError, + StatusCode status, + @Nonnull List failedMutations, + boolean retryable) { + ErrorDetails errorDetails = null; + if (rpcError instanceof ApiException) { + errorDetails = ((ApiException) rpcError).getErrorDetails(); + } + + return new MutateRowsException(rpcError, status, failedMutations, retryable, errorDetails); + } + + private MutateRowsException( + @Nullable Throwable rpcError, + StatusCode status, + @Nonnull List failedMutations, + boolean retryable, + @Nullable ErrorDetails errorDetails) { + super(rpcError, status, retryable, errorDetails); + Preconditions.checkNotNull(failedMutations); + Preconditions.checkArgument(!failedMutations.isEmpty(), "failedMutations can't be empty"); + this.failedMutations = failedMutations; + } + + // TODO: remove this after we add a ctor in gax to pass in a Throwable, a message and error + // details. + @Override + public String getMessage() { + return "Some mutations failed to apply"; + } + + /** + * Retrieve all of the failed mutations. This list will contain failures for all of the mutations + * that have failed across all of the retry attempts so far. + */ + @Nonnull + public List getFailedMutations() { + return failedMutations; + } + + /** + * Identifies which mutation failed and the reason it failed. The mutation is identified by it's + * index in the original request's {@link MutateRowsRequest#getEntriesList()}. + */ + @AutoValue + public abstract static class FailedMutation { + /** + * This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + @Nonnull + public static FailedMutation create(int index, ApiException error) { + return new AutoValue_MutateRowsException_FailedMutation(index, error); + } + + /** + * The index of the mutation in the original request's {@link + * MutateRowsRequest#getEntriesList()}. + */ + public abstract int getIndex(); + + /** + * The error that prevented this mutation from being applied. Please note, that if the entire + * RPC attempt failed, all mutations that were part of the attempt will have take on the same + * error. + */ + @Nonnull + public abstract ApiException getError(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java new file mode 100644 index 000000000000..dc55756241e9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java @@ -0,0 +1,354 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.Mutation.AddToCell; +import com.google.bigtable.v2.Mutation.DeleteFromColumn; +import com.google.bigtable.v2.Mutation.DeleteFromFamily; +import com.google.bigtable.v2.Mutation.DeleteFromRow; +import com.google.bigtable.v2.Mutation.MergeToCell; +import com.google.bigtable.v2.Mutation.SetCell; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * The concrete implementation of {@link MutationApi} that can be used to create and represent a + * list of mutations. It used by {@link RowMutation} and {@link ConditionalRowMutation} to + * encapsulate a list of mutations that will to be applied to a single row. + */ +public final class Mutation implements MutationApi, Serializable { + private static final long serialVersionUID = 5893216644683374340L; + + @InternalApi("Visible for testing") + static final int MAX_MUTATIONS = 100_000; + + @InternalApi("Visible for testing") + static final int MAX_BYTE_SIZE = 200 * 1024 * 1024; + + @InternalApi("Visible for testing") + static final long SERVER_SIDE_TIMESTAMP = -1; + + private final boolean allowServersideTimestamp; + + private transient ImmutableList.Builder mutations = + ImmutableList.builder(); + + private int numMutations; + private long byteSize; + + /** Creates new instance of Mutation object. */ + public static Mutation create() { + return new Mutation(false); + } + + /** + * Creates new instance of Mutation object which allows setCell operation to use server side + * timestamp. This is dangerous because mutations will no longer be idempotent, which might cause + * multiple duplicate values to be stored in Bigtable. This option should only be used for + * advanced usecases with extreme care. + */ + @BetaApi + public static Mutation createUnsafe() { + return new Mutation(true); + } + + /** + * Wraps the List of protobuf {@link com.google.bigtable.v2.Mutation}. This methods, like {@link + * #createUnsafe()}, allows setCell operation to use server side timestamp. This is dangerous + * because mutations will no longer be idempotent, which might cause multiple duplicate values to + * be stored in Bigtable. This option should only be used for advanced usecases with extreme care. + */ + @BetaApi + public static Mutation fromProtoUnsafe(List protos) { + Mutation mutation = new Mutation(true); + mutation.mutations.addAll(protos); + return mutation; + } + + /** + * Wraps the List of protobuf {@link com.google.bigtable.v2.Mutation}. This methods, like {@link + * #createUnsafe()}, allows setCell operation to use server side timestamp. This is dangerous + * because mutations will no longer be idempotent, which might cause multiple duplicate values to + * be stored in Bigtable. This option should only be used for advanced usecases with extreme care. + */ + @BetaApi + public static Mutation fromProtoUnsafe(Iterable protos) { + Mutation mutation = new Mutation(true); + mutation.mutations.addAll(protos); + return mutation; + } + + /** + * Constructs a row mutation from an existing protobuf object. + * + *

Callers must ensure that the protobuf argument is not using serverside timestamps. The + * client assumes that all mutations are idempotent and will retry in case of transient errors. + * This can lead to row duplication. + * + *

When applied, the resulting Mutation object will ignore the project id and instance id in + * the table_name and instead apply the configuration in the client + */ + static Mutation fromProto(List protos) { + Mutation mutation = new Mutation(false); + mutation.mutations.addAll(protos); + return mutation; + } + + private Mutation(boolean allowServersideTimestamp) { + this.allowServersideTimestamp = allowServersideTimestamp; + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + + @SuppressWarnings("unchecked") + ImmutableList deserialized = + (ImmutableList) input.readObject(); + this.mutations = ImmutableList.builder().addAll(deserialized); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + output.writeObject(mutations.build()); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value) { + return setCell(familyName, wrapByteString(qualifier), wrapByteString(value)); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, + @Nonnull String qualifier, + long timestamp, + @Nonnull String value) { + return setCell(familyName, wrapByteString(qualifier), timestamp, wrapByteString(value)); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value) { + long timestamp = System.currentTimeMillis() * 1_000; + + return setCell(familyName, qualifier, timestamp, value); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value) { + Validations.validateFamily(familyName); + Preconditions.checkNotNull(qualifier, "qualifier can't be null."); + Preconditions.checkNotNull(value, "value can't be null."); + if (!allowServersideTimestamp) { + Preconditions.checkArgument( + timestamp != SERVER_SIDE_TIMESTAMP, "Serverside timestamps are not supported"); + } + + addMutation( + com.google.bigtable.v2.Mutation.newBuilder() + .setSetCell( + SetCell.newBuilder() + .setFamilyName(familyName) + .setColumnQualifier(qualifier) + .setTimestampMicros(timestamp) + .setValue(value) + .build()) + .build()); + + return this; + } + + @Override + public Mutation setCell(@Nonnull String familyName, @Nonnull String qualifier, long value) { + return setCell(familyName, wrapByteString(qualifier), value); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value) { + + return setCell(familyName, wrapByteString(qualifier), timestamp, value); + } + + @Override + public Mutation setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long value) { + + return setCell(familyName, qualifier, ByteString.copyFrom(Longs.toByteArray(value))); + } + + @Override + public Mutation setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long value) { + + return setCell(familyName, qualifier, timestamp, ByteString.copyFrom(Longs.toByteArray(value))); + } + + @Override + public Mutation deleteCells(@Nonnull String familyName, @Nonnull String qualifier) { + return deleteCells(familyName, wrapByteString(qualifier)); + } + + @Override + public Mutation deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier) { + Validations.validateFamily(familyName); + Preconditions.checkNotNull(qualifier, "qualifier can't be null."); + + return deleteCells(familyName, qualifier, TimestampRange.unbounded()); + } + + @Override + public Mutation deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange) { + Validations.validateFamily(familyName); + Preconditions.checkNotNull(qualifier, "qualifier can't be null."); + Preconditions.checkNotNull(timestampRange, "timestampRange can't be null."); + + DeleteFromColumn.Builder builder = + DeleteFromColumn.newBuilder().setFamilyName(familyName).setColumnQualifier(qualifier); + + switch (timestampRange.getStartBound()) { + case CLOSED: + builder.getTimeRangeBuilder().setStartTimestampMicros(timestampRange.getStart()); + break; + case OPEN: + builder.getTimeRangeBuilder().setStartTimestampMicros(timestampRange.getStart() + 1); + break; + case UNBOUNDED: + break; + default: + throw new IllegalArgumentException( + "Unknown start bound: " + timestampRange.getStartBound()); + } + switch (timestampRange.getEndBound()) { + case CLOSED: + builder.getTimeRangeBuilder().setEndTimestampMicros(timestampRange.getEnd() + 1); + break; + case OPEN: + builder.getTimeRangeBuilder().setEndTimestampMicros(timestampRange.getEnd()); + break; + case UNBOUNDED: + break; + default: + throw new IllegalArgumentException("Unknown end bound: " + timestampRange.getEndBound()); + } + + addMutation( + com.google.bigtable.v2.Mutation.newBuilder().setDeleteFromColumn(builder.build()).build()); + + return this; + } + + @Override + public Mutation deleteFamily(@Nonnull String familyName) { + Validations.validateFamily(familyName); + + addMutation( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromFamily(DeleteFromFamily.newBuilder().setFamilyName(familyName).build()) + .build()); + + return this; + } + + @Override + public Mutation deleteRow() { + addMutation( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromRow(DeleteFromRow.getDefaultInstance()) + .build()); + + return this; + } + + @Override + public Mutation addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value value) { + com.google.bigtable.v2.Mutation.Builder builder = com.google.bigtable.v2.Mutation.newBuilder(); + AddToCell.Builder addToCellBuilder = builder.getAddToCellBuilder(); + addToCellBuilder.setFamilyName(familyName); + + qualifier.buildTo(addToCellBuilder.getColumnQualifierBuilder()); + timestamp.buildTo(addToCellBuilder.getTimestampBuilder()); + value.buildTo(addToCellBuilder.getInputBuilder()); + + addMutation(builder.build()); + return this; + } + + @Override + public Mutation mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value value) { + com.google.bigtable.v2.Mutation.Builder builder = com.google.bigtable.v2.Mutation.newBuilder(); + MergeToCell.Builder mergeToCellBuilder = builder.getMergeToCellBuilder(); + mergeToCellBuilder.setFamilyName(familyName); + + qualifier.buildTo(mergeToCellBuilder.getColumnQualifierBuilder()); + timestamp.buildTo(mergeToCellBuilder.getTimestampBuilder()); + value.buildTo(mergeToCellBuilder.getInputBuilder()); + + addMutation(builder.build()); + return this; + } + + private void addMutation(com.google.bigtable.v2.Mutation mutation) { + Preconditions.checkState(numMutations + 1 <= MAX_MUTATIONS, "Too many mutations per row"); + Preconditions.checkState( + byteSize + mutation.getSerializedSize() <= MAX_BYTE_SIZE, + "Byte size of mutations is too large"); + + numMutations++; + byteSize += mutation.getSerializedSize(); + + mutations.add(mutation); + } + + private static ByteString wrapByteString(String str) { + if (str == null) { + return null; + } else { + return ByteString.copyFromUtf8(str); + } + } + + /** Returns the mutation protos. */ + List getMutations() { + return mutations.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java new file mode 100644 index 000000000000..3a54f68748b6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java @@ -0,0 +1,215 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalExtensionOnly; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.protobuf.ByteString; +import javax.annotation.Nonnull; + +/** The API for creating mutations for a single row. */ +@InternalExtensionOnly +public interface MutationApi> { + /** + * Adds a mutation which sets the value of the specified cell. + * + *

This a convenience method that converts Strings to ByteStrings and uses microseconds since + * epoch as the timestamp. + */ + T setCell(@Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

This is a convenience override that converts Strings to ByteStrings. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T setCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, @Nonnull String value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

Uses microseconds since epoch as the timestamp. + */ + T setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T setCell( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

This a convenience method that converts Strings to ByteStrings and uses microseconds since + * epoch as the timestamp. Also it accepts long value. + */ + T setCell(@Nonnull String familyName, @Nonnull String qualifier, long value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

This is a convenience override that converts Strings to ByteStrings. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T setCell(@Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

Uses microseconds since epoch as the timestamp. + */ + T setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long value); + + /** + * Adds a mutation which sets the value of the specified cell. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long value); + + /** Adds a mutation which deletes cells from the specified column. */ + T deleteCells(@Nonnull String familyName, @Nonnull String qualifier); + + /** Adds a mutation which deletes cells from the specified column. */ + T deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier); + + /** + * Adds a mutation which deletes cells from the specified column, restricted to a given timestamp + * range. + * + * @param familyName The family name. + * @param qualifier The qualifier. + * @param timestampRange The timestamp range in microseconds. + */ + T deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange); + + /** Adds a mutation which deletes all cells from the specified column family. */ + T deleteFamily(@Nonnull String familyName); + + /** Adds a mutation which deletes all cells from the containing row. */ + T deleteRow(); + + /** + * Adds an int64 value to an aggregate cell. The column family must be an aggregate family and + * have an "int64" input type or this mutation will be rejected. + * + *

This is a convenience override that converts Strings to ByteStrings. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + default T addToCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value) { + return addToCell(familyName, ByteString.copyFromUtf8(qualifier), timestamp, value); + } + + /** + * Merges a ByteString accumulator value to a cell in an aggregate column family. + * + *

This is a convenience override that converts Strings to ByteStrings. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + default T mergeToCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, ByteString value) { + return mergeToCell(familyName, ByteString.copyFromUtf8(qualifier), timestamp, value); + } + + /** + * Adds an int64 value to an aggregate cell. The column family must be an aggregate family and + * have an "int64" input type or this mutation will be rejected. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + default T addToCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long input) { + return addToCell( + familyName, + Value.RawValue.create(qualifier), + Value.RawTimestamp.create(timestamp), + Value.IntValue.create(input)); + } + + /** + * Merges a ByteString accumulator value to a cell in an aggregate column family. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + default T mergeToCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, ByteString input) { + return mergeToCell( + familyName, + Value.RawValue.create(qualifier), + Value.RawTimestamp.create(timestamp), + Value.RawValue.create(input)); + } + + /** + * Adds a {@link Value} to an aggregate cell. The column family must be an aggregate family and + * have an input type matching the type of {@link Value} or this mutation will be rejected. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input); + + /** + * Merges a {@link Value} accumulator to an aggregate cell. The column family must be an aggregate + * family or this mutation will be rejected. + * + *

Note: The timestamp values are in microseconds but must match the granularity of the + * table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond + * granularity). For example: `1571902339435000`. + */ + T mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java new file mode 100644 index 000000000000..ffac399e7262 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java @@ -0,0 +1,486 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.RowSet; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.internal.RowSetUtil; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.List; +import java.util.SortedSet; +import javax.annotation.Nonnull; + +/** A simple wrapper to construct a query for the ReadRows RPC. */ +public final class Query implements Serializable { + private static final long serialVersionUID = -316972783499434755L; + + // bigtable can server the largest filter size of 20KB. + private static final int MAX_FILTER_SIZE = 20 * 1024; + + private final TargetId targetId; + private transient ReadRowsRequest.Builder builder = ReadRowsRequest.newBuilder(); + + /** + * @deprecated Please use {@link Query#create(TargetId)} instead. + */ + @Deprecated + public static Query create(String tableId) { + return new Query(TableId.of(tableId)); + } + + /** + * Constructs a new Query object for the given target with targetId. The target id will be + * combined with the instance name specified in the {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings}. + * + * @see AuthorizedViewId + * @see MaterializedViewId + * @see TableId + */ + public static Query create(TargetId targetId) { + return new Query(targetId); + } + + private Query(TargetId targetId) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + builder = ReadRowsRequest.newBuilder().mergeFrom(input); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + builder.build().writeTo(output); + } + + /** Adds a key to looked up */ + public Query rowKey(String key) { + Preconditions.checkNotNull(key, "Key can't be null."); + return rowKey(ByteString.copyFromUtf8(key)); + } + + /** Adds a key to looked up */ + public Query rowKey(ByteString key) { + Preconditions.checkNotNull(key, "Key can't be null."); + builder.getRowsBuilder().addRowKeys(key); + + return this; + } + + public Query prefix(ByteString prefix) { + return range(ByteStringRange.prefix(prefix)); + } + + public Query prefix(String prefix) { + return range(ByteStringRange.prefix(prefix)); + } + + /** + * Adds a range to be looked up. + * + * @param start The beginning of the range (inclusive). Can be null to represent negative + * infinity. + * @param end The end of the range (exclusive). Can be null to represent positive infinity. + */ + public Query range(String start, String end) { + return range(wrapKey(start), wrapKey(end)); + } + + /** + * Adds a range to be looked up. + * + * @param start The beginning of the range (inclusive). Can be null to represent negative + * infinity. + * @param end The end of the range (exclusive). Can be null to represent positive infinity. + */ + public Query range(ByteString start, ByteString end) { + RowRange.Builder rangeBuilder = RowRange.newBuilder(); + if (start != null) { + rangeBuilder.setStartKeyClosed(start); + } + if (end != null) { + rangeBuilder.setEndKeyOpen(end); + } + builder.getRowsBuilder().addRowRanges(rangeBuilder.build()); + return this; + } + + /** Adds a range to be looked up. */ + public Query range(ByteStringRange range) { + RowRange.Builder rangeBuilder = RowRange.newBuilder(); + + switch (range.getStartBound()) { + case OPEN: + rangeBuilder.setStartKeyOpen(range.getStart()); + break; + case CLOSED: + rangeBuilder.setStartKeyClosed(range.getStart()); + break; + case UNBOUNDED: + rangeBuilder.clearStartKey(); + break; + default: + throw new IllegalStateException("Unknown start bound: " + range.getStartBound()); + } + + switch (range.getEndBound()) { + case OPEN: + rangeBuilder.setEndKeyOpen(range.getEnd()); + break; + case CLOSED: + rangeBuilder.setEndKeyClosed(range.getEnd()); + break; + case UNBOUNDED: + rangeBuilder.clearEndKey(); + break; + default: + throw new IllegalStateException("Unknown end bound: " + range.getEndBound()); + } + + builder.getRowsBuilder().addRowRanges(rangeBuilder.build()); + + return this; + } + + /** + * Sets the filter to apply to each row. Only one filter can be set at a time. To use multiple + * filters, please use {@link Filters#interleave()} or {@link Filters#chain()}. + */ + public Query filter(Filters.Filter filter) { + Preconditions.checkNotNull(filter, "filter can't be null"); + + RowFilter rowFilter = filter.toProto(); + Preconditions.checkArgument( + rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20KB"); + + builder.setFilter(rowFilter); + return this; + } + + /** Limits the number of rows that can be returned */ + public Query limit(long limit) { + Preconditions.checkArgument(limit > 0, "Limit must be greater than 0."); + builder.setRowsLimit(limit); + return this; + } + + /** + * Return rows in reverse order. + * + *

The row will be streamed in reverse lexiographic order of the keys. The row key ranges are + * still expected to be oriented the same way as forwards. ie [a,c] where a <= c. The row content + * will remain unchanged from the ordering forward scans. This is particularly useful to get the + * last N records before a key: + * + *

{@code
+   * query
+   *   .range(ByteStringRange.unbounded().endOpen("key"))
+   *   .limit(10)
+   *   .reversed(true)
+   * }
+ */ + public Query reversed(boolean enable) { + builder.setReversed(enable); + return this; + } + + /** + * Split this query into multiple queries that can be evenly distributed across Bigtable nodes and + * be run in parallel. This method takes the results from {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient#sampleRowKeysAsync(String)} to divide this + * query into a set of disjoint queries that logically combine into form this query. + * + *

Expected Usage: + * + *

{@code
+   * List keyOffsets = dataClient.sampleRowKeysAsync("my-table").get();
+   * List queryShards = myQuery.shard(keyOffsets);
+   * List>> futures = new ArrayList();
+   * for (Query subQuery : queryShards) {
+   *   futures.add(dataClient.readRowsCallable().all().futureCall(subQuery));
+   * }
+   * List> results = ApiFutures.allAsList(futures).get();
+   * }
+ */ + public List shard(List sampledRowKeys) { + Preconditions.checkState(builder.getRowsLimit() == 0, "Can't shard query with row limits"); + + ImmutableSortedSet.Builder splitPoints = + ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE); + + for (KeyOffset keyOffset : sampledRowKeys) { + if (!keyOffset.getKey().isEmpty()) { + splitPoints.add(keyOffset.getKey()); + } + } + + return shard(splitPoints.build()); + } + + /** + * Split this query into multiple queries that logically combine into this query. This is intended + * to be used by map reduce style frameworks like Beam to split a query across multiple workers. + * + *

Expected Usage: + * + *

{@code
+   * List splitPoints = ...;
+   * List queryShards = myQuery.shard(splitPoints);
+   * List>> futures = new ArrayList();
+   * for (Query subQuery : queryShards) {
+   *   futures.add(dataClient.readRowsCallable().all().futureCall(subQuery));
+   * }
+   * List> results = ApiFutures.allAsList(futures).get();
+   * }
+ */ + public List shard(SortedSet splitPoints) { + Preconditions.checkState(builder.getRowsLimit() == 0, "Can't shard a query with a row limit"); + + List shardedRowSets = RowSetUtil.shard(builder.getRows(), splitPoints); + List shards = Lists.newArrayListWithCapacity(shardedRowSets.size()); + + for (RowSet rowSet : shardedRowSets) { + Query queryShard; + queryShard = new Query(targetId); + queryShard.builder.mergeFrom(this.builder.build()); + queryShard.builder.setRows(rowSet); + shards.add(queryShard); + } + + return shards; + } + + /** + * Create a query paginator that'll split the query into smaller chunks. + * + *

Example usage: + * + *

{@code
+   * Query query = Query.create(...).range("a", "z");
+   * Query.QueryPaginator paginator = query.createQueryPaginator(100);
+   * ByteString lastSeenRowKey = ByteString.EMPTY;
+   * do {
+   *     List rows = client.readRowsCallable().all().call(paginator.getNextQuery());
+   *     for (Row row : rows) {
+   *        // do some processing
+   *        lastSeenRow = row;
+   *     }
+   * } while (paginator.advance(lastSeenRowKey));
+   * }
+ */ + @BetaApi("This surface is stable yet it might be removed in the future.") + public QueryPaginator createPaginator(int pageSize) { + return new QueryPaginator(this, pageSize); + } + + /** Get the minimal range that encloses all of the row keys and ranges in this Query. */ + public ByteStringRange getBound() { + return RowSetUtil.getBound(builder.getRows()); + } + + @InternalApi + public TargetId getTargetId() { + return targetId; + } + + @InternalApi + public SessionReadRowRequest toSessionPointProto() { + return SessionReadRowRequest.newBuilder() + .setKey(this.builder.getRows().getRowKeysList().get(0)) + .setFilter(this.builder.getFilter()) + .build(); + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi + public ReadRowsRequest toProto(RequestContext requestContext) { + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForMaterializedView()) { + builder.setMaterializedViewName(resourceName); + } else if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); + } + + /** + * Wraps the protobuf {@link ReadRowsRequest}. + * + *

WARNING: Please note that the project id & instance id in the table name will be overwritten + * by the configuration in the BigtableDataClient. + */ + public static Query fromProto(@Nonnull ReadRowsRequest request) { + Preconditions.checkArgument(request != null, "ReadRowsRequest must not be null"); + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + String materializedViewName = request.getMaterializedViewName(); + + Query query = + new Query(NameUtil.extractTargetId(tableName, authorizedViewName, materializedViewName)); + query.builder = request.toBuilder(); + + return query; + } + + @Override + public Query clone() { + Query query = Query.create(targetId); + query.builder = this.builder.clone(); + return query; + } + + private static ByteString wrapKey(String key) { + if (key == null) { + return null; + } + return ByteString.copyFromUtf8(key); + } + + /** + * A Query Paginator that will split a query into small chunks. See {@link + * Query#createPaginator(int)} for example usage. + */ + public static class QueryPaginator { + + private final boolean hasOverallLimit; + private long remainingRows; + private Query query; + private final int pageSize; + private ByteString prevSplitPoint; + + QueryPaginator(@Nonnull Query query, int pageSize) { + this.hasOverallLimit = query.builder.getRowsLimit() > 0; + this.remainingRows = query.builder.getRowsLimit(); + this.query = query.limit(pageSize); + if (hasOverallLimit) { + remainingRows -= pageSize; + } + this.pageSize = pageSize; + this.prevSplitPoint = ByteString.EMPTY; + } + + /** Return the next query. */ + public Query getNextQuery() { + return query; + } + + /** + * Construct the next query. Return true if there are more queries to return. False if we've + * read everything. + */ + public boolean advance(@Nonnull ByteString lastSeenRowKey) { + Preconditions.checkNotNull( + lastSeenRowKey, "lastSeenRowKey cannot be null, use ByteString.EMPTY instead."); + // Full table scans don't have ranges or limits. Running the query again will return an empty + // list when we reach the end of the table. lastSeenRowKey won't be updated in this case, and + // we can break out of the loop. + if (lastSeenRowKey.equals(prevSplitPoint)) { + return false; + } + this.prevSplitPoint = lastSeenRowKey; + + // Set the query limit. If the original limit is set, return false if the new + // limit is <= 0 to avoid returning more rows than intended. + if (hasOverallLimit && remainingRows <= 0) { + return false; + } + if (hasOverallLimit) { + query.limit(Math.min(this.pageSize, remainingRows)); + remainingRows -= pageSize; + } else { + query.limit(pageSize); + } + + // Split the row ranges / row keys. Return false if there's nothing + // left on the right of the split point. + RowSet remaining = + RowSetUtil.erase(query.builder.getRows(), lastSeenRowKey, !query.builder.getReversed()); + if (remaining == null) { + return false; + } + query.builder.setRows(remaining); + return true; + } + + /** Get the page size of the current Pagniator. For internal use only. */ + @InternalApi + public int getPageSize() { + return this.pageSize; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Query query = (Query) o; + return Objects.equal(targetId, query.targetId) + && Objects.equal(builder.getRows(), query.builder.getRows()) + && Objects.equal(builder.getFilter(), query.builder.getFilter()) + && Objects.equal(builder.getRowsLimit(), query.builder.getRowsLimit()); + } + + @Override + public int hashCode() { + return Objects.hashCode( + targetId, builder.getRows(), builder.getFilter(), builder.getRowsLimit()); + } + + @Override + public String toString() { + ReadRowsRequest request = builder.build(); + + return MoreObjects.toStringHelper(this) + .add("targetId", targetId) + .add("keys", request.getRows().getRowKeysList()) + .add("ranges", request.getRows().getRowRangesList()) + .add("filter", request.getFilter()) + .add("limit", request.getRowsLimit()) + .toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java new file mode 100644 index 000000000000..a3cdff5912f6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java @@ -0,0 +1,448 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.bigtable.v2.RowRange; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Range API. + * + *

This base class represents the API for all ranges in the Cloud Bigtable client. Please note + * this mutable type. It's intended to support fluent DSLs.For example: + * + *

{@code
+ * // A Range that encloses all strings
+ * ByteStringRange.unbounded();
+ *
+ * // Range that includes all strings including "begin" up until "end"
+ * ByteStringRange.unbounded().of("start", "end");
+ *
+ * // Create a Bytestring range with an unbounded start and the inclusive end "end"
+ * ByteStringRange.unbounded().endClosed("end");
+ *
+ * // Ranges are mutable, so take care to clone them to get a new instance
+ * ByteStringRange r1 = ByteStringRange.of("a", "z");
+ * ByteStringRange r2 = r1.clone().endUnbounded();
+ * }
+ */ +@InternalExtensionOnly +public abstract class Range> implements Serializable { + public enum BoundType { + OPEN, + CLOSED, + UNBOUNDED + } + + private BoundType startBound; + private T start; + private BoundType endBound; + private T end; + + Range() { + this(BoundType.UNBOUNDED, null, BoundType.UNBOUNDED, null); + } + + Range(BoundType startBound, T start, BoundType endBound, T end) { + this.startBound = startBound; + this.start = start; + this.endBound = endBound; + this.end = end; + } + + /** + * Creates a new {@link Range} with the specified inclusive start and the specified exclusive end. + */ + public R of(@Nonnull T startClosed, @Nonnull T endOpen) { + return startClosed(startClosed).endOpen(endOpen); + } + + /** Creates a new {@link Range} with an unbounded start and the current end. */ + public R startUnbounded() { + this.start = null; + this.startBound = BoundType.UNBOUNDED; + return thisT(); + } + + /** Creates a new {@link Range} with the specified exclusive start and the current end. */ + public R startOpen(@Nonnull T start) { + this.start = Preconditions.checkNotNull(start, "Start can't be null"); + this.startBound = BoundType.OPEN; + return thisT(); + } + + /** Creates a new {@link Range} with the specified inclusive start and the current end. */ + public R startClosed(@Nonnull T start) { + this.start = Preconditions.checkNotNull(start, "Start can't be null"); + this.startBound = BoundType.CLOSED; + return thisT(); + } + + /** Creates a new {@link Range} with the current start and an unbounded end. */ + public R endUnbounded() { + this.end = null; + this.endBound = BoundType.UNBOUNDED; + return thisT(); + } + + /** Creates a new {@link Range} with the specified exclusive end and the current start. */ + public R endOpen(@Nonnull T end) { + this.end = Preconditions.checkNotNull(end, "End can't be null"); + this.endBound = BoundType.OPEN; + return thisT(); + } + + /** Creates a new {@link Range} with the specified inclusive end and the current start. */ + public R endClosed(@Nonnull T end) { + this.end = Preconditions.checkNotNull(end, "End can't be null"); + this.endBound = BoundType.CLOSED; + return thisT(); + } + + /** Gets the current start {@link BoundType}. */ + public BoundType getStartBound() { + return startBound; + } + + /** + * Gets the current start value. + * + * @throws IllegalStateException If the current {@link #getStartBound()} is {@link + * BoundType#UNBOUNDED}. + */ + public T getStart() { + Preconditions.checkState(startBound != BoundType.UNBOUNDED, "Start is unbounded"); + return start; + } + + /** Gets the current end {@link BoundType}. */ + public BoundType getEndBound() { + return endBound; + } + + /** + * Gets the current end value. + * + * @throws IllegalStateException If the current {@link #getEndBound()} is {@link + * BoundType#UNBOUNDED}. + */ + public T getEnd() { + Preconditions.checkState(endBound != BoundType.UNBOUNDED, "End is unbounded"); + return end; + } + + @SuppressWarnings("unchecked") + private R thisT() { + return (R) this; + } + + /** Abstract specialization of a {@link Range} for timestamps. */ + abstract static class AbstractTimestampRange> + extends Range implements Cloneable { + AbstractTimestampRange() { + super(); + } + + AbstractTimestampRange(BoundType startBound, Long start, BoundType endBound, Long end) { + super(startBound, start, endBound, end); + } + + @SuppressWarnings("unchecked") + @Override + protected R clone() { + try { + return (R) super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException("should never happen", e); + } + } + } + + /** + * Abstract specialization of a {@link Range} for {@link ByteString}s. Allows for easy interop + * with simple Strings. + */ + @InternalExtensionOnly + abstract static class AbstractByteStringRange> + extends Range implements Cloneable { + AbstractByteStringRange() { + this(BoundType.UNBOUNDED, null, BoundType.UNBOUNDED, null); + } + + AbstractByteStringRange( + BoundType startBound, ByteString start, BoundType endBound, ByteString end) { + super(startBound, start, endBound, end); + } + + /** + * Creates a new {@link Range} with the specified inclusive start and the specified exclusive + * end. + */ + public R of(String startClosed, String endOpen) { + return of(wrap(startClosed), wrap(endOpen)); + } + + /** Creates a new {@link Range} with the specified exclusive start and the current end. */ + public R startOpen(@Nonnull String start) { + return startOpen(wrap(start)); + } + + /** Creates a new {@link Range} with the specified inclusive start and the current end. */ + public R startClosed(@Nonnull String start) { + return startClosed(wrap(start)); + } + + /** Creates a new {@link Range} with the specified exclusive end and the current start. */ + public R endOpen(@Nonnull String end) { + return endOpen(wrap(end)); + } + + /** Creates a new {@link Range} with the specified inclusive end and the current start. */ + public R endClosed(@Nonnull String end) { + return endClosed(wrap(end)); + } + + @Override + public R startOpen(@Nonnull ByteString start) { + Preconditions.checkNotNull(start); + if (start.isEmpty()) { + return startUnbounded(); + } else { + return super.startOpen(start); + } + } + + @Override + public R startClosed(@Nonnull ByteString start) { + Preconditions.checkNotNull(start); + if (start.isEmpty()) { + return startUnbounded(); + } else { + return super.startClosed(start); + } + } + + @Override + public R endOpen(@Nonnull ByteString end) { + Preconditions.checkNotNull(end); + if (end.isEmpty()) { + return endUnbounded(); + } else { + return super.endOpen(end); + } + } + + @Override + public R endClosed(@Nonnull ByteString end) { + Preconditions.checkNotNull(end); + if (end.isEmpty()) { + return endUnbounded(); + } else { + return super.endClosed(end); + } + } + + @SuppressWarnings("unchecked") + @Override + protected R clone() { + try { + return (R) super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException("should never happen", e); + } + } + + static ByteString wrap(String str) { + return ByteString.copyFromUtf8(str); + } + } + + /** Concrete Range for timestamps */ + public static final class TimestampRange extends AbstractTimestampRange + implements Serializable { + private static final long serialVersionUID = 198219379354720855L; + + public static TimestampRange unbounded() { + return new TimestampRange(BoundType.UNBOUNDED, null, BoundType.UNBOUNDED, null); + } + + public static TimestampRange create(long closedStart, long openEnd) { + return new TimestampRange(BoundType.CLOSED, closedStart, BoundType.OPEN, openEnd); + } + + private TimestampRange(BoundType startBound, Long start, BoundType endBound, Long end) { + super(startBound, start, endBound, end); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimestampRange range = (TimestampRange) o; + + if (getStartBound() != range.getStartBound() || getEndBound() != range.getEndBound()) { + return false; + } + if (getStartBound() != BoundType.UNBOUNDED && !Objects.equal(getStart(), range.getStart())) { + return false; + } + if (getEndBound() != BoundType.UNBOUNDED && !Objects.equal(getEnd(), range.getEnd())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode( + getStartBound(), + getStartBound() == BoundType.UNBOUNDED ? null : getStart(), + getEndBound(), + getEndBound() == BoundType.UNBOUNDED ? null : getEnd()); + } + } + + /** Concrete Range for ByteStrings */ + public static final class ByteStringRange extends AbstractByteStringRange + implements Serializable { + private static final long serialVersionUID = 2199230324202930550L; + + public static ByteStringRange prefix(String prefix) { + return prefix(ByteString.copyFromUtf8(prefix)); + } + + public static ByteStringRange prefix(ByteString prefix) { + if (prefix.isEmpty()) { + return unbounded(); + } + + int offset = prefix.size() - 1; + int curByte = 0xFF; + + while (offset >= 0) { + curByte = prefix.byteAt(offset) & 0xFF; + if (curByte != 0xFF) { + break; + } + offset--; + } + + if (offset < 0) { + // We got an 0xFFFF... (only FFs) stopRow value which is + // the last possible prefix before the end of the table. + // So set it to stop at the 'end of the table' + return unbounded().startClosed(prefix); + } + + ByteString endPrefix = offset == 0 ? ByteString.EMPTY : prefix.substring(0, offset); + ByteString endSuffix = ByteString.copyFrom(new byte[] {(byte) (curByte + 1)}); + ByteString end = endPrefix.concat(endSuffix); + + ByteStringRange range = ByteStringRange.unbounded().startClosed(prefix); + if (!end.isEmpty()) { + range.endOpen(end); + } + return range; + } + + public static ByteStringRange unbounded() { + return new ByteStringRange(BoundType.UNBOUNDED, null, BoundType.UNBOUNDED, null); + } + + public static ByteStringRange create(ByteString closedStart, ByteString openEnd) { + return new ByteStringRange(BoundType.CLOSED, closedStart, BoundType.OPEN, openEnd); + } + + public static ByteStringRange create(String closedStart, String openEnd) { + return new ByteStringRange( + BoundType.CLOSED, wrap(closedStart), BoundType.OPEN, wrap(openEnd)); + } + + private ByteStringRange( + BoundType startBound, ByteString start, BoundType endBound, ByteString end) { + super(startBound, start, endBound, end); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public static ByteString serializeToByteString(ByteStringRange byteStringRange) { + return RowRange.newBuilder() + .setStartKeyClosed(byteStringRange.getStart()) + .setEndKeyOpen(byteStringRange.getEnd()) + .build() + .toByteString(); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public static ByteStringRange toByteStringRange(ByteString byteString) + throws InvalidProtocolBufferException { + RowRange rowRange = RowRange.newBuilder().mergeFrom(byteString).build(); + return ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ByteStringRange range = (ByteStringRange) o; + + if (getStartBound() != range.getStartBound() || getEndBound() != range.getEndBound()) { + return false; + } + if (getStartBound() != BoundType.UNBOUNDED && !Objects.equal(getStart(), range.getStart())) { + return false; + } + if (getEndBound() != BoundType.UNBOUNDED && !Objects.equal(getEnd(), range.getEnd())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode( + getStartBound(), + getStartBound() == BoundType.UNBOUNDED ? null : getStart(), + getEndBound(), + getEndBound() == BoundType.UNBOUNDED ? null : getEnd()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java new file mode 100644 index 000000000000..2c9cf543545a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java @@ -0,0 +1,301 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeInstant; + +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationTokens; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A simple wrapper to construct a query for the ReadChangeStream RPC. */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +public final class ReadChangeStreamQuery implements Serializable, Cloneable { + private static final long serialVersionUID = 948588515749969176L; + + private final String tableId; + private transient ReadChangeStreamRequest.Builder builder = ReadChangeStreamRequest.newBuilder(); + + /** + * Constructs a new ReadChangeStreamQuery object for the specified table id. The table id will be + * combined with the instance name specified in the {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings}. + */ + public static ReadChangeStreamQuery create(String tableId) { + return new ReadChangeStreamQuery(tableId); + } + + private ReadChangeStreamQuery(String tableId) { + this.tableId = tableId; + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + builder = ReadChangeStreamRequest.newBuilder().mergeFrom(input); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + builder.build().writeTo(output); + } + + /** + * Adds a partition. + * + * @param rowRange Represents the partition in the form [startKey, endKey). startKey can be null + * to represent negative infinity. endKey can be null to represent positive infinity. + */ + public ReadChangeStreamQuery streamPartition(@Nonnull RowRange rowRange) { + builder.setPartition(StreamPartition.newBuilder().setRowRange(rowRange).build()); + return this; + } + + /** + * Adds a partition. + * + * @param start The beginning of the range (inclusive). Can be null to represent negative + * infinity. + * @param end The end of the range (exclusive). Can be null to represent positive infinity. + */ + public ReadChangeStreamQuery streamPartition(String start, String end) { + return streamPartition(wrapKey(start), wrapKey(end)); + } + + /** + * Adds a partition. + * + * @param start The beginning of the range (inclusive). Can be null to represent negative + * infinity. + * @param end The end of the range (exclusive). Can be null to represent positive infinity. + */ + public ReadChangeStreamQuery streamPartition( + @Nullable ByteString start, @Nullable ByteString end) { + RowRange.Builder rangeBuilder = RowRange.newBuilder(); + if (start != null) { + rangeBuilder.setStartKeyClosed(start); + } + if (end != null) { + rangeBuilder.setEndKeyOpen(end); + } + return streamPartition(rangeBuilder.build()); + } + + /** Adds a partition. */ + public ReadChangeStreamQuery streamPartition(ByteStringRange range) { + RowRange.Builder rangeBuilder = RowRange.newBuilder(); + + switch (range.getStartBound()) { + case OPEN: + throw new IllegalStateException("Start bound should be closed."); + case CLOSED: + rangeBuilder.setStartKeyClosed(range.getStart()); + break; + case UNBOUNDED: + rangeBuilder.clearStartKey(); + break; + default: + throw new IllegalStateException("Unknown start bound: " + range.getStartBound()); + } + + switch (range.getEndBound()) { + case OPEN: + rangeBuilder.setEndKeyOpen(range.getEnd()); + break; + case CLOSED: + throw new IllegalStateException("End bound should be open."); + case UNBOUNDED: + rangeBuilder.clearEndKey(); + break; + default: + throw new IllegalStateException("Unknown end bound: " + range.getEndBound()); + } + + return streamPartition(rangeBuilder.build()); + } + + /** This method is obsolete. Use {@link #startTime(java.time.Instant)} instead. */ + @ObsoleteApi("Use startTime(java.time.Instant) instead") + public ReadChangeStreamQuery startTime(org.threeten.bp.Instant value) { + return startTime(toJavaTimeInstant(value)); + } + + /** Sets the startTime to read the change stream. */ + public ReadChangeStreamQuery startTime(java.time.Instant value) { + Preconditions.checkState( + !builder.hasContinuationTokens(), + "startTime and continuationTokens can't be specified together"); + builder.setStartTime( + Timestamp.newBuilder() + .setSeconds(value.getEpochSecond()) + .setNanos(value.getNano()) + .build()); + return this; + } + + /** This method is obsolete. Use {@link #endTime(java.time.Instant)} instead. */ + @ObsoleteApi("Use endTime(java.time.Instant) instead") + public ReadChangeStreamQuery endTime(org.threeten.bp.Instant value) { + return endTime(toJavaTimeInstant(value)); + } + + /** Sets the endTime to read the change stream. */ + public ReadChangeStreamQuery endTime(java.time.Instant value) { + builder.setEndTime( + Timestamp.newBuilder() + .setSeconds(value.getEpochSecond()) + .setNanos(value.getNano()) + .build()); + return this; + } + + /** Sets the stream continuation tokens to read the change stream. */ + public ReadChangeStreamQuery continuationTokens( + List changeStreamContinuationTokens) { + Preconditions.checkState( + !builder.hasStartTime(), "startTime and continuationTokens can't be specified together"); + StreamContinuationTokens.Builder streamContinuationTokensBuilder = + StreamContinuationTokens.newBuilder(); + for (ChangeStreamContinuationToken changeStreamContinuationToken : + changeStreamContinuationTokens) { + streamContinuationTokensBuilder.addTokens(changeStreamContinuationToken.getTokenProto()); + } + builder.setContinuationTokens(streamContinuationTokensBuilder); + return this; + } + + /** This method is obsolete. Use {@link #heartbeatDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use heartbeatDuration(java.time.Duration) instead") + public ReadChangeStreamQuery heartbeatDuration(org.threeten.bp.Duration duration) { + return heartbeatDuration(toJavaTimeDuration(duration)); + } + + /** Sets the heartbeat duration for the change stream. */ + public ReadChangeStreamQuery heartbeatDuration(java.time.Duration duration) { + builder.setHeartbeatDuration( + Duration.newBuilder() + .setSeconds(duration.getSeconds()) + .setNanos(duration.getNano()) + .build()); + return this; + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi("Used in Changestream beam pipeline.") + public ReadChangeStreamRequest toProto(RequestContext requestContext) { + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), requestContext.getInstanceId(), tableId); + + return builder + .setTableName(tableName) + .setAppProfileId(requestContext.getAppProfileId()) + .build(); + } + + /** + * Wraps the protobuf {@link ReadChangeStreamRequest}. + * + *

WARNING: Please note that the project id & instance id in the table name will be overwritten + * by the configuration in the BigtableDataClient. + */ + public static ReadChangeStreamQuery fromProto(@Nonnull ReadChangeStreamRequest request) { + ReadChangeStreamQuery query = + new ReadChangeStreamQuery(NameUtil.extractTableIdFromTableName(request.getTableName())); + query.builder = request.toBuilder(); + + return query; + } + + @Override + protected ReadChangeStreamQuery clone() { + ReadChangeStreamQuery query = ReadChangeStreamQuery.create(tableId); + query.builder = this.builder.clone(); + return query; + } + + @Nullable + private static ByteString wrapKey(@Nullable String key) { + if (key == null) { + return null; + } + return ByteString.copyFromUtf8(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadChangeStreamQuery query = (ReadChangeStreamQuery) o; + return Objects.equal(tableId, query.tableId) + && Objects.equal(builder.getPartition(), query.builder.getPartition()) + && Objects.equal(builder.getStartTime(), query.builder.getStartTime()) + && Objects.equal(builder.getEndTime(), query.builder.getEndTime()) + && Objects.equal(builder.getContinuationTokens(), query.builder.getContinuationTokens()) + && Objects.equal(builder.getHeartbeatDuration(), query.builder.getHeartbeatDuration()); + } + + @Override + public int hashCode() { + return Objects.hashCode( + tableId, + builder.getPartition(), + builder.getStartTime(), + builder.getEndTime(), + builder.getContinuationTokens(), + builder.getHeartbeatDuration()); + } + + @Override + public String toString() { + ReadChangeStreamRequest request = builder.build(); + + return MoreObjects.toStringHelper(this) + .add("tableId", tableId) + .add("partition", request.getPartition()) + .add("startTime", request.getStartTime()) + .add("endTime", request.getEndTime()) + .add("continuationTokens", request.getContinuationTokens()) + .add("heartbeatDuration", request.getHeartbeatDuration()) + .toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java new file mode 100644 index 000000000000..f51635f546f7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java @@ -0,0 +1,188 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Wraps a {@link ReadModifyWriteRowRequest}. */ +public final class ReadModifyWriteRow implements Serializable { + private static final long serialVersionUID = -8150045424541029193L; + + private final TargetId targetId; + private transient ReadModifyWriteRowRequest.Builder builder = + ReadModifyWriteRowRequest.newBuilder(); + + private ReadModifyWriteRow(TargetId targetId, ByteString key) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + Preconditions.checkNotNull(key, "key can't be null."); + this.targetId = targetId; + + builder.setRowKey(key); + } + + /** + * @deprecated Please use {@link ReadModifyWriteRow#create(TargetId, String)} instead. + */ + @Deprecated + public static ReadModifyWriteRow create(String tableId, String key) { + Preconditions.checkNotNull(key, "key can't be null."); + return new ReadModifyWriteRow(TableId.of(tableId), ByteString.copyFromUtf8(key)); + } + + /** + * Creates a new instance of the ReadModifyWriteRow for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static ReadModifyWriteRow create(TargetId targetId, String key) { + return new ReadModifyWriteRow(targetId, ByteString.copyFromUtf8(key)); + } + + /** + * @deprecated Please use {@link ReadModifyWriteRow#create(TargetId, ByteString)} instead. + */ + @Deprecated + public static ReadModifyWriteRow create(String tableId, ByteString key) { + return new ReadModifyWriteRow(TableId.of(tableId), key); + } + + /** + * Creates a new instance of the ReadModifyWriteRow for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static ReadModifyWriteRow create(TargetId targetId, ByteString key) { + return new ReadModifyWriteRow(targetId, key); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + builder = ReadModifyWriteRowRequest.newBuilder().mergeFrom(input); + } + + private void writeObject(ObjectOutputStream output) throws IOException { + output.defaultWriteObject(); + builder.build().writeTo(output); + } + + /** + * Appends the value to the existing value of the cell. If the targeted cell is unset, it will be + * treated as containing the empty string. + */ + public ReadModifyWriteRow append( + @Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value) { + return append(familyName, ByteString.copyFromUtf8(qualifier), ByteString.copyFromUtf8(value)); + } + + /** + * Appends the value to the existing value of the cell. If the targeted cell is unset, it will be + * treated as containing the empty string. + */ + public ReadModifyWriteRow append( + @Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value) { + Validations.validateFamily(familyName); + Preconditions.checkNotNull(qualifier, "Qualifier can't be null"); + Preconditions.checkNotNull(value, "Value can't be null"); + Preconditions.checkArgument(!value.isEmpty(), "Value can't be empty"); + + ReadModifyWriteRule rule = + ReadModifyWriteRule.newBuilder() + .setFamilyName(familyName) + .setColumnQualifier(qualifier) + .setAppendValue(value) + .build(); + + builder.addRules(rule); + + return this; + } + + /** + * Adds `amount` be added to the existing value. If the targeted cell is unset, it will be treated + * as containing a zero. Otherwise, the targeted cell must contain an 8-byte value (interpreted as + * a 64-bit big-endian signed integer), or the entire request will fail. + */ + public ReadModifyWriteRow increment( + @Nonnull String familyName, @Nonnull String qualifier, long amount) { + return increment(familyName, ByteString.copyFromUtf8(qualifier), amount); + } + + /** + * Adds `amount` be added to the existing value. If the targeted cell is unset, it will be treated + * as containing a zero. Otherwise, the targeted cell must contain an 8-byte value (interpreted as + * a 64-bit big-endian signed integer), or the entire request will fail. + */ + public ReadModifyWriteRow increment( + @Nonnull String familyName, @Nonnull ByteString qualifier, long amount) { + Validations.validateFamily(familyName); + Preconditions.checkNotNull(qualifier, "Qualifier can't be null"); + + ReadModifyWriteRule rule = + ReadModifyWriteRule.newBuilder() + .setFamilyName(familyName) + .setColumnQualifier(qualifier) + .setIncrementAmount(amount) + .build(); + + builder.addRules(rule); + return this; + } + + @InternalApi + public ReadModifyWriteRowRequest toProto(RequestContext requestContext) { + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); + } + + /** + * Wraps the protobuf {@link ReadModifyWriteRowRequest}. + * + *

WARNING: Please note that the table_name will be overwritten by the configuration in the + * BigtableDataClient. + */ + @BetaApi + public static ReadModifyWriteRow fromProto(@Nonnull ReadModifyWriteRowRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + + ReadModifyWriteRow row = + ReadModifyWriteRow.create( + NameUtil.extractTargetId(tableName, authorizedViewName), request.getRowKey()); + row.builder = request.toBuilder(); + + return row; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Row.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Row.java new file mode 100644 index 000000000000..83b71bf19e9d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Row.java @@ -0,0 +1,170 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import java.util.Comparator; +import java.util.List; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Default representation of a logical row. + * + *

The cells contained within, will be sorted by the native order. Please see {@link + * RowCell#compareByNative()} for details. + */ +@InternalExtensionOnly +@AutoValue +public abstract class Row implements Serializable { + /** + * Returns a comparator that compares two Row objects by comparing the result of {@link + * #getKey()}} for each. + */ + public static Comparator compareByKey() { + return new Comparator() { + @Override + public int compare(Row r1, Row r2) { + return ByteStringComparator.INSTANCE.compare(r1.getKey(), r2.getKey()); + } + }; + } + + /** Creates a new instance of the {@link Row}. */ + @InternalApi + public static Row create(ByteString key, List cells) { + return new AutoValue_Row(key, cells); + } + + /** Returns the row key */ + @Nonnull + public abstract ByteString getKey(); + + /** + * Returns a sorted list of cells. The cells will be sorted natively. + * + * @see RowCell#compareByNative() For details about the ordering. + */ + public abstract List getCells(); + + /** + * Returns a sublist of the cells that belong to the specified family. + * + * @see RowCell#compareByNative() For details about the ordering. + */ + public List getCells(@Nonnull String family) { + Preconditions.checkNotNull(family, "family"); + + int start = getFirst(family, null); + if (start < 0) { + return ImmutableList.of(); + } + + int end = getLast(family, null, start); + + return getCells().subList(start, end + 1); + } + + /** + * Returns a sublist of the cells that belong to the specified family and qualifier. + * + * @see RowCell#compareByNative() For details about the ordering. + */ + public List getCells(@Nonnull String family, @Nonnull String qualifier) { + Preconditions.checkNotNull(family, "family"); + Preconditions.checkNotNull(qualifier, "qualifier"); + + return getCells(family, ByteString.copyFromUtf8(qualifier)); + } + + /** + * Returns a sublist of the cells that belong to the specified family and qualifier. + * + * @see RowCell#compareByNative() For details about the ordering. + */ + public List getCells(@Nonnull String family, @Nonnull ByteString qualifier) { + Preconditions.checkNotNull(family, "family"); + Preconditions.checkNotNull(qualifier, "qualifier"); + + int start = getFirst(family, qualifier); + if (start < 0) { + return ImmutableList.of(); + } + + int end = getLast(family, qualifier, start); + + return getCells().subList(start, end + 1); + } + + private int getFirst(@Nonnull String family, @Nullable ByteString qualifier) { + int low = 0; + int high = getCells().size(); + int index = -1; + + while (low < high) { + int mid = (high + low) / 2; + RowCell midCell = getCells().get(mid); + + int c = midCell.getFamily().compareTo(family); + if (c == 0 && qualifier != null) { + c = ByteStringComparator.INSTANCE.compare(midCell.getQualifier(), qualifier); + } + + if (c < 0) { + low = mid + 1; + } else if (c == 0) { + index = mid; + high = mid; + } else { + high = mid; + } + } + return index; + } + + private int getLast(@Nonnull String family, @Nullable ByteString qualifier, int startIndex) { + int low = startIndex; + int high = getCells().size(); + int index = -1; + + while (low < high) { + int mid = (high + low) / 2; + RowCell midCell = getCells().get(mid); + + int c = midCell.getFamily().compareTo(family); + if (c == 0 && qualifier != null) { + c = ByteStringComparator.INSTANCE.compare(midCell.getQualifier(), qualifier); + } + + if (c < 0) { + low = mid + 1; + } else if (c == 0) { + index = mid; + low = mid + 1; + } else { + high = mid; + } + } + return index; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowAdapter.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowAdapter.java new file mode 100644 index 000000000000..874529bbe1c6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowAdapter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.protobuf.ByteString; +import java.util.List; + +/** + * An extension point that allows end users to plug in a custom implementation of logical rows. This + * useful in cases where the user would like to apply advanced client side filtering of cells. This + * adapter acts like a factory for a SAX style row builder. + */ +public interface RowAdapter { + /** Creates a new instance of a {@link RowBuilder}. */ + RowBuilder createRowBuilder(); + + /** + * Checks if the given row is a special marker row. Please the documentation for {@link + * RowBuilder} for more information + */ + boolean isScanMarkerRow(RowT row); + + ByteString getKey(RowT row); + + /** + * A SAX style row factory. It is responsible for creating two types of rows: standard data rows + * and special marker rows. Marker rows are emitted when skipping lots of rows due to filters. The + * server notifies the client of the last row it skipped to help client resume in case of error. + * + *

State management is handled external to the implementation of this class and guarantees the + * following order: + * + *

    + *
  1. Exactly 1 {@code startRow} for each row. + *
  2. Exactly 1 {@code startCell} for each cell. + *
  3. At least 1 {@code cellValue} for each cell. + *
  4. Exactly 1 {@code finishCell} for each cell. + *
  5. Exactly 1 {@code finishRow} for each row. + *
+ * + * {@code createScanMarkerRow} can be called one or more times between {@code finishRow} and + * {@code startRow}. {@code reset} can be called at any point and can be invoked multiple times in + * a row. + */ + interface RowBuilder { + /** Called to start a new row. This will be called once per row. */ + void startRow(ByteString key); + + /** Called to start a new cell in a row. */ + void startCell( + String family, ByteString qualifier, long timestamp, List labels, long size); + + /** Called multiple times per cell to concatenate the cell value. */ + void cellValue(ByteString value); + + /** Called once per cell to signal the end of the value (unless reset). */ + void finishCell(); + + /** Called once per row to signal that all cells have been processed (unless reset). */ + RowT finishRow(); + + /** Called when the current in progress row should be dropped */ + void reset(); + + /** Creates a special row to mark server progress before any data is received */ + RowT createScanMarkerRow(ByteString key); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java new file mode 100644 index 000000000000..e4f3c635d30d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java @@ -0,0 +1,97 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import java.util.Comparator; +import java.util.List; +import javax.annotation.Nonnull; + +/** Default representation of a cell in a {@link Row}. */ +@InternalExtensionOnly +@AutoValue +public abstract class RowCell implements Serializable { + /** + * A comparator that compares the cells by Bigtable native ordering: + * + *
    + *
  • Family lexicographically ascending + *
  • Qualifier lexicographically ascending + *
  • Timestamp in reverse chronological order + *
+ * + *

Labels and values are not included in the comparison. + */ + public static Comparator compareByNative() { + return new Comparator() { + @Override + public int compare(RowCell c1, RowCell c2) { + return ComparisonChain.start() + .compare(c1.getFamily(), c2.getFamily()) + .compare(c1.getQualifier(), c2.getQualifier(), ByteStringComparator.INSTANCE) + .compare(c2.getTimestamp(), c1.getTimestamp()) + .result(); + } + }; + } + + /** Creates a new instance of the {@link RowCell}. */ + @InternalApi + public static RowCell create( + @Nonnull String family, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull List labels, + @Nonnull ByteString value) { + // Ensure that the list is serializable and optimize for the common case + if (labels.isEmpty()) { + labels = ImmutableList.of(); + } else { + labels = ImmutableList.copyOf(labels); + } + return new AutoValue_RowCell(family, qualifier, timestamp, value, ImmutableList.copyOf(labels)); + } + + /** The cell's family */ + @Nonnull + public abstract String getFamily(); + + /** The cell's qualifier (column name) */ + @Nonnull + public abstract ByteString getQualifier(); + + /** The timestamp of the cell */ + public abstract long getTimestamp(); + + /** The value of the cell */ + @Nonnull + public abstract ByteString getValue(); + + /** + * The labels assigned to the cell + * + * @see Filters#label(String) + */ + @Nonnull + public abstract List getLabels(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java new file mode 100644 index 000000000000..3208fc4e5880 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java @@ -0,0 +1,333 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsRequest.Entry; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Represents a list of mutations targeted at a single row. It's meant to be used as an parameter + * for {@link com.google.cloud.bigtable.data.v2.BigtableDataClient#mutateRowAsync(RowMutation)}. + */ +public final class RowMutation implements MutationApi, Serializable { + private static final long serialVersionUID = 6529002234913236318L; + + private final TargetId targetId; + private final ByteString key; + private final Mutation mutation; + + private RowMutation(TargetId targetId, ByteString key, Mutation mutation) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; + this.key = key; + this.mutation = mutation; + } + + /** + * @deprecated Please use {@link RowMutation#create(TargetId, String)} instead. + */ + @Deprecated + public static RowMutation create(String tableId, String key) { + return create(tableId, ByteString.copyFromUtf8(key)); + } + + /** + * Creates a new instance of the mutation builder for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static RowMutation create(TargetId targetId, String key) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + return create(targetId, ByteString.copyFromUtf8(key)); + } + + /** + * @deprecated Please use {@link RowMutation#create(TargetId, ByteString)} instead. + */ + @Deprecated + public static RowMutation create(String tableId, ByteString key) { + return new RowMutation(TableId.of(tableId), key, Mutation.create()); + } + + /** + * Creates a new instance of the mutation builder for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static RowMutation create(TargetId targetId, ByteString key) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + return new RowMutation(targetId, key, Mutation.create()); + } + + /** + * @deprecated Please use {@link RowMutation#create(TargetId, String, Mutation)} instead. + */ + @Deprecated + public static RowMutation create(String tableId, String key, Mutation mutation) { + return create(tableId, ByteString.copyFromUtf8(key), mutation); + } + + /** + * Creates new instance of mutation builder for the given target with targetId by wrapping + * existing set of row mutations. The builder will be owned by this RowMutation and should not be + * used by the caller after this call. This functionality is intended for advanced usage. + * + *

Sample code: + * + *


+   * Mutation mutation = Mutation.create()
+   *     .setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
+   * RowMutation rowMutation = RowMutation.create(TableId.of("[TABLE]"), "[ROW_KEY]", mutation);
+   * 
+ * + * @see AuthorizedViewId + * @see TableId + */ + public static RowMutation create(TargetId targetId, String key, Mutation mutation) { + return create(targetId, ByteString.copyFromUtf8(key), mutation); + } + + /** + * @deprecated Please use {@link RowMutation#create(TargetId, ByteString, Mutation)} instead. + */ + @Deprecated + public static RowMutation create(String tableId, ByteString key, Mutation mutation) { + return new RowMutation(TableId.of(tableId), key, mutation); + } + + /** + * Creates new instance of mutation builder for the given target with targetId by wrapping + * existing set of row mutations. The builder will be owned by this RowMutation and should not be + * used by the caller after this call. This functionality is intended for advanced usage. + * + *

Sample code: + * + *


+   * Mutation mutation = Mutation.create()
+   *     .setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
+   * RowMutation rowMutation = RowMutation.create(TableId.of("[TABLE]"), [BYTE_STRING_ROW_KEY], mutation);
+   * 
+ * + * @see AuthorizedViewId + * @see TableId + */ + public static RowMutation create(TargetId targetId, ByteString key, Mutation mutation) { + return new RowMutation(targetId, key, mutation); + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, + @Nonnull String qualifier, + long timestamp, + @Nonnull String value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutation setCell(@Nonnull String familyName, @Nonnull String qualifier, long value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutation setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutation deleteCells(@Nonnull String familyName, @Nonnull String qualifier) { + mutation.deleteCells(familyName, qualifier); + return this; + } + + @Override + public RowMutation deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier) { + mutation.deleteCells(familyName, qualifier); + return this; + } + + @Override + public RowMutation deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull TimestampRange timestampRange) { + mutation.deleteCells(familyName, qualifier, timestampRange); + return this; + } + + @Override + public RowMutation deleteFamily(@Nonnull String familyName) { + mutation.deleteFamily(familyName); + return this; + } + + @Override + public RowMutation deleteRow() { + mutation.deleteRow(); + return this; + } + + @Override + public RowMutation addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + mutation.addToCell(familyName, qualifier, timestamp, input); + return this; + } + + @Override + public RowMutation mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + mutation.mergeToCell(familyName, qualifier, timestamp, input); + return this; + } + + @InternalApi + public TargetId getTargetId() { + return targetId; + } + + @InternalApi + public SessionMutateRowRequest toSessionProto() { + return SessionMutateRowRequest.newBuilder() + .setKey(key) + .addAllMutations(mutation.getMutations()) + .build(); + } + + @InternalApi + public MutateRowRequest toProto(RequestContext requestContext) { + MutateRowRequest.Builder builder = MutateRowRequest.newBuilder(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder + .setAppProfileId(requestContext.getAppProfileId()) + .setRowKey(key) + .addAllMutations(mutation.getMutations()) + .build(); + } + + /** + * Creates a single entry bulk {@link com.google.bigtable.v2.MutateRowsRequest}, which will be + * merged by the batching logic in the callable chain. + */ + @InternalApi + public MutateRowsRequest toBulkProto(RequestContext requestContext) { + MutateRowsRequest.Builder builder = MutateRowsRequest.newBuilder(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder + .setAppProfileId(requestContext.getAppProfileId()) + .addEntries( + Entry.newBuilder().setRowKey(key).addAllMutations(mutation.getMutations()).build()) + .build(); + } + + /** + * Wraps the protobuf {@link MutateRowRequest}. + * + *

This is meant for advanced usage only. Please ensure that the MutateRowRequest does not use + * server side timestamps. The BigtableDataClient assumes that RowMutations are idempotent and is + * configured to enable retries by default. If serverside timestamps are enabled, this can lead to + * duplicate mutations. + * + *

WARNING: when applied, the resulting mutation object will ignore the project id and instance + * id in the table_name and instead apply the configuration in the client. + */ + @BetaApi + public static RowMutation fromProto(@Nonnull MutateRowRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + + return RowMutation.create( + NameUtil.extractTargetId(tableName, authorizedViewName), + request.getRowKey(), + Mutation.fromProto(request.getMutationsList())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java new file mode 100644 index 000000000000..2cd2529d53ef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java @@ -0,0 +1,215 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Represents a list of mutations targeted at a single row. It is meant to be used as an parameter + * for {@link com.google.cloud.bigtable.data.v2.BigtableDataClient#newBulkMutationBatcher(String)}. + * + *

Note: The changes in the mutation will be applied atomically but the ordering between + * different RowMutationEntry instances is not guaranteed. + */ +public class RowMutationEntry implements MutationApi, Serializable { + private static final long serialVersionUID = 1974738836742298192L; + + static final int MAX_MUTATION = 100000; + + private final ByteString key; + private final Mutation mutation; + + private RowMutationEntry(@Nonnull ByteString key, @Nonnull Mutation mutation) { + Preconditions.checkNotNull(key, "Row key can't be null"); + Preconditions.checkNotNull(mutation, "Row mutation can't be null"); + + this.key = key; + this.mutation = mutation; + } + + /** Creates a new instance of the mutation builder. */ + public static RowMutationEntry create(@Nonnull String key) { + Preconditions.checkNotNull(key, "Row key can't be null"); + return create(ByteString.copyFromUtf8(key)); + } + + /** Creates a new instance of the mutation builder. */ + public static RowMutationEntry create(@Nonnull ByteString key) { + return new RowMutationEntry(key, Mutation.create()); + } + + /** Creates a new instance from existing mutation. */ + @BetaApi + public static RowMutationEntry createFromMutationUnsafe( + @Nonnull ByteString key, @Nonnull Mutation mutation) { + return new RowMutationEntry(key, mutation); + } + + /** + * Creates new instance of mutation builder which allows server timestamp for setCell operations. + * + *

NOTE: This functionality is intended for advanced usage. + * + * @see Mutation#createUnsafe() for more explanation. + */ + @InternalApi("For internal usage only") + public static RowMutationEntry createUnsafe(@Nonnull ByteString key) { + return new RowMutationEntry(key, Mutation.createUnsafe()); + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, + @Nonnull String qualifier, + long timestamp, + @Nonnull String value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull String qualifier, long value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long value) { + mutation.setCell(familyName, qualifier, value); + return this; + } + + @Override + public RowMutationEntry setCell( + @Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long value) { + mutation.setCell(familyName, qualifier, timestamp, value); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry deleteCells(@Nonnull String familyName, @Nonnull String qualifier) { + mutation.deleteCells(familyName, qualifier); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier) { + mutation.deleteCells(familyName, qualifier); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry deleteCells( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + @Nonnull Range.TimestampRange timestampRange) { + mutation.deleteCells(familyName, qualifier, timestampRange); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry deleteFamily(@Nonnull String familyName) { + mutation.deleteFamily(familyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public RowMutationEntry deleteRow() { + mutation.deleteRow(); + return this; + } + + @Override + public RowMutationEntry addToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + mutation.addToCell(familyName, qualifier, timestamp, input); + return this; + } + + @Override + public RowMutationEntry mergeToCell( + @Nonnull String familyName, + @Nonnull Value qualifier, + @Nonnull Value timestamp, + @Nonnull Value input) { + mutation.mergeToCell(familyName, qualifier, timestamp, input); + return this; + } + + @InternalApi + public MutateRowsRequest.Entry toProto() { + Preconditions.checkArgument( + mutation.getMutations().size() <= MAX_MUTATION, + "Too many mutations, got %s, limit is %s", + mutation.getMutations().size(), + MAX_MUTATION); + return MutateRowsRequest.Entry.newBuilder() + .setRowKey(key) + .addAllMutations(mutation.getMutations()) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java new file mode 100644 index 000000000000..78a444019cb6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** Wraps a {@link com.google.bigtable.v2.SampleRowKeysRequest}. */ +public final class SampleRowKeysRequest implements Serializable { + private final TargetId targetId; + + private SampleRowKeysRequest(TargetId targetId) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + this.targetId = targetId; + } + + /** Creates a new instance of the sample row keys builder for the given target with targetId */ + public static SampleRowKeysRequest create(TargetId targetId) { + return new SampleRowKeysRequest(targetId); + } + + @InternalApi + public com.google.bigtable.v2.SampleRowKeysRequest toProto(RequestContext requestContext) { + com.google.bigtable.v2.SampleRowKeysRequest.Builder builder = + com.google.bigtable.v2.SampleRowKeysRequest.newBuilder(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForMaterializedView()) { + builder.setMaterializedViewName(resourceName); + } else if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); + } + + /** + * Wraps the protobuf {@link com.google.bigtable.v2.SampleRowKeysRequest}. + * + *

WARNING: Please note that the project id & instance id in the table/authorized + * view/materialized view name will be overwritten by the configuration in the BigtableDataClient. + */ + @InternalApi + public static SampleRowKeysRequest fromProto( + @Nonnull com.google.bigtable.v2.SampleRowKeysRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + String materializedViewName = request.getMaterializedViewName(); + + SampleRowKeysRequest sampleRowKeysRequest = + SampleRowKeysRequest.create( + NameUtil.extractTargetId(tableName, authorizedViewName, materializedViewName)); + + return sampleRowKeysRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SampleRowKeysRequest sampleRowKeysRequest = (SampleRowKeysRequest) o; + return Objects.equal(targetId, sampleRowKeysRequest.targetId); + } + + @Override + public int hashCode() { + return Objects.hashCode(targetId); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SetCell.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SetCell.java new file mode 100644 index 000000000000..92f9b6d386d5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SetCell.java @@ -0,0 +1,56 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.stub.changestream.ChangeStreamRecordMerger; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Representation of a SetCell mod in a data change, whose value is concatenated by {@link + * ChangeStreamRecordMerger} in case of SetCell value chunking. + */ +@InternalApi("Intended for use by the BigtableIO in apache/beam only.") +@AutoValue +public abstract class SetCell implements Entry, Serializable { + private static final long serialVersionUID = 77123872266724154L; + + public static SetCell create( + @Nonnull String familyName, + @Nonnull ByteString qualifier, + long timestamp, + @Nonnull ByteString value) { + return new AutoValue_SetCell(familyName, qualifier, timestamp, value); + } + + /** Get the column family of the current SetCell. */ + @Nonnull + public abstract String getFamilyName(); + + /** Get the column qualifier of the current SetCell. */ + @Nonnull + public abstract ByteString getQualifier(); + + /** Get the timestamp of the current SetCell. */ + public abstract long getTimestamp(); + + /** Get the value of the current SetCell. */ + @Nonnull + public abstract ByteString getValue(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java new file mode 100644 index 000000000000..f74312821220 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.common.base.Preconditions; + +/** An implementation of a {@link TargetId} for tables. */ +@AutoValue +public abstract class TableId implements TargetId { + + /** Constructs a new TableId object for the specified table id. */ + public static TableId of(String tableId) { + Preconditions.checkNotNull(tableId, "table id can't be null."); + return new AutoValue_TableId(tableId); + } + + public abstract String getTableId(); + + @Override + @InternalApi + public String toResourceName(String projectId, String instanceId) { + return NameUtil.formatTableName(projectId, instanceId, getTableId()); + } + + @Override + @InternalApi + public boolean scopedForAuthorizedView() { + return false; + } + + @Override + @InternalApi + public boolean scopedForMaterializedView() { + return false; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java new file mode 100644 index 000000000000..73860dc1d8b4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.InternalApi; +import com.google.api.core.InternalExtensionOnly; +import java.io.Serializable; + +/** + * TargetId defines the scope a data operation can be applied to. + * + * @see AuthorizedViewId + * @see TableId + */ +@InternalExtensionOnly +public interface TargetId extends Serializable { + /** + * Combines the table or authorized view id with the projectId and instanceId to form the actual + * resource name in the request protobuf. + * + *

This method is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + String toResourceName(String projectId, String instanceId); + + /** + * Returns true if this TargetId object represents id for an authorized view (rather than a + * table/materialized view). + */ + @InternalApi + boolean scopedForAuthorizedView(); + + /** + * Returns true if this TargetId object represents id for an materialized view (rather than a + * table/authorized view). + */ + @InternalApi + boolean scopedForMaterializedView(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Validations.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Validations.java new file mode 100644 index 000000000000..c46cb24d14d0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Validations.java @@ -0,0 +1,38 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Miscellaneous helpers to validate input in the DSL. + * + *

Package-private for internal use. + */ +class Validations { + private Validations() {} + + static void validateFamily(@Nonnull String name) { + Preconditions.checkNotNull(name, "Family name can't be null"); + Preconditions.checkArgument(!name.isEmpty(), "Family name can't be empty"); + } + + static void validateTableId(@Nonnull String tableId) { + Preconditions.checkNotNull(tableId, "tableId can't be null"); + Preconditions.checkArgument(!tableId.isEmpty(), "tableId can't be empty"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java new file mode 100644 index 000000000000..a7ea9f0c5058 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java @@ -0,0 +1,134 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import com.google.api.core.BetaApi; +import com.google.auto.value.AutoValue; +import com.google.protobuf.ByteString; +import java.io.Serializable; +import javax.annotation.Nonnull; + +/** + * Wrapper class for the {@link com.google.bigtable.v2.Value} protobuf message. + * + * @see com.google.bigtable.v2.Value + */ +@BetaApi +public abstract class Value implements Serializable { + private Value() {} + + public enum ValueType { + Int64, + RawTimestamp, + RawValue + } + + /** Creates a "raw" value that simply passes through "value" as raw byres. */ + public static Value rawValue(@Nonnull ByteString value) { + return RawValue.create(value); + } + + /** Creates a "raw" timestamp value that simply passes through "timestamp" as a long. */ + public static Value rawTimestamp(long timestamp) { + return RawTimestamp.create(timestamp); + } + + /** Creates an int64 value. */ + public static Value intValue(long value) { + return IntValue.create(value); + } + + @AutoValue + public abstract static class IntValue extends Value { + public static IntValue create(long value) { + return new AutoValue_Value_IntValue(value); + } + + public abstract long getValue(); + + @Override + public ValueType getValueType() { + return ValueType.Int64; + } + + @Override + void buildTo(com.google.bigtable.v2.Value.Builder builder) { + builder.setIntValue(getValue()); + } + } + + @AutoValue + public abstract static class RawTimestamp extends Value { + public static RawTimestamp create(long value) { + return new AutoValue_Value_RawTimestamp(value); + } + + public abstract long getValue(); + + @Override + public ValueType getValueType() { + return ValueType.RawTimestamp; + } + + @Override + void buildTo(com.google.bigtable.v2.Value.Builder builder) { + builder.setRawTimestampMicros(getValue()); + } + } + + @AutoValue + public abstract static class RawValue extends Value { + public static RawValue create(@Nonnull ByteString value) { + return new AutoValue_Value_RawValue(value); + } + + @Nonnull + public abstract ByteString getValue(); + + @Override + public ValueType getValueType() { + return ValueType.RawValue; + } + + @Override + void buildTo(com.google.bigtable.v2.Value.Builder builder) { + builder.setRawValue(getValue()); + } + } + + com.google.bigtable.v2.Value toProto() { + com.google.bigtable.v2.Value.Builder builder = com.google.bigtable.v2.Value.newBuilder(); + buildTo(builder); + return builder.build(); + } + + abstract void buildTo(com.google.bigtable.v2.Value.Builder builder); + + public abstract ValueType getValueType(); + + public static Value fromProto(com.google.bigtable.v2.Value source) { + switch (source.getKindCase()) { + case INT_VALUE: + return IntValue.create(source.getIntValue()); + case RAW_VALUE: + return RawValue.create(source.getRawValue()); + case RAW_TIMESTAMP_MICROS: + return RawTimestamp.create(source.getRawTimestampMicros()); + default: + throw new UnsupportedOperationException(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatement.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatement.java new file mode 100644 index 000000000000..82c1084afd7e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatement.java @@ -0,0 +1,400 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.Type; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryVersion; +import com.google.cloud.bigtable.data.v2.internal.QueryParamUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import java.time.Instant; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * A bound SQL statement that can be executed by calling {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient#executeQuery(BoundStatement)}. + * + *

It is an error to bind a statement with unset parameters. + * + *

BoundStatements are constructed using a {@link Builder} and calling setTypeParam(String + * paramName, Type value) for the appropriate type. For example: + * + *

{@code
+ * BoundStatementt boundStatement = preparedStatement.bind()
+ *     .setBytesParam("qualifier", ByteString.copyFromUtf8("test"))
+ *     .setBytesParam("key", ByteString.copyFromUtf8("testKey"))
+ *     .build();
+ * }
+ */ +public class BoundStatement { + + private final PreparedStatementImpl preparedStatement; + private final Map params; + + private BoundStatement(PreparedStatementImpl preparedStatement, Map params) { + this.preparedStatement = preparedStatement; + this.params = params; + } + + /** + * Gets the most recent version of the PrepareResponse associated with this query. + * + *

This is considered an internal implementation detail and should not be used by applications. + */ + @InternalApi("For internal use only") + public PreparedQueryData getLatestPrepareResponse() { + return preparedStatement.getLatestPrepareResponse(); + } + + public static class Builder { + private final PreparedStatementImpl preparedStatement; + private final Map> paramTypes; + private final Map params; + + /** + * Creates a builder from a {@link PreparedStatement} + * + *

This is considered an internal implementation detail and should not be used by + * applications. + */ + @InternalApi("For internal use only") + public Builder(PreparedStatementImpl preparedStatement, Map> paramTypes) { + this.preparedStatement = preparedStatement; + this.paramTypes = paramTypes; + this.params = new HashMap<>(); + } + + /** Builds a {@link BoundStatement} from the builder */ + public BoundStatement build() { + for (Map.Entry> paramType : paramTypes.entrySet()) { + String paramName = paramType.getKey(); + if (!params.containsKey(paramName)) { + throw new IllegalArgumentException( + "Attempting to build BoundStatement without binding parameter: " + paramName); + } + } + return new BoundStatement(preparedStatement, ImmutableMap.copyOf(params)); + } + + /** + * Sets a query parameter with the name {@code paramName} and the String typed value {@code + * value} + */ + public Builder setStringParam(String paramName, @Nullable String value) { + validateMatchesParamTypes(paramName, SqlType.string()); + params.put(paramName, stringParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the Bytes typed value {@code + * value} + */ + public Builder setBytesParam(String paramName, @Nullable ByteString value) { + validateMatchesParamTypes(paramName, SqlType.bytes()); + params.put(paramName, bytesParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the INT64 typed value {@code + * value} + */ + public Builder setLongParam(String paramName, @Nullable Long value) { + validateMatchesParamTypes(paramName, SqlType.int64()); + params.put(paramName, int64ParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the FLOAT32 typed value {@code + * value} + */ + public Builder setFloatParam(String paramName, @Nullable Float value) { + validateMatchesParamTypes(paramName, SqlType.float32()); + params.put(paramName, float32ParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the FLOAT64 typed value {@code + * value} + */ + public Builder setDoubleParam(String paramName, @Nullable Double value) { + validateMatchesParamTypes(paramName, SqlType.float64()); + params.put(paramName, float64ParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the BOOL typed value {@code value} + */ + public Builder setBooleanParam(String paramName, @Nullable Boolean value) { + validateMatchesParamTypes(paramName, SqlType.bool()); + params.put(paramName, booleanParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the TIMESTAMP typed value {@code + * value} + */ + public Builder setTimestampParam(String paramName, @Nullable Instant value) { + validateMatchesParamTypes(paramName, SqlType.timestamp()); + params.put(paramName, timestampParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the DATE typed value {@code value} + */ + public Builder setDateParam(String paramName, @Nullable Date value) { + validateMatchesParamTypes(paramName, SqlType.date()); + params.put(paramName, dateParamOf(value)); + return this; + } + + /** + * Sets a query parameter with the name {@code paramName} and the ARRAY typed value {@code + * value}. The array element type is specified by {@code arrayType} and the List elements must + * be of the corresponding Java type. Null array elements are valid. + */ + public Builder setListParam( + String paramName, @Nullable List value, SqlType.Array arrayType) { + validateMatchesParamTypes(paramName, arrayType); + params.put(paramName, arrayParamOf(value, arrayType)); + return this; + } + + private void validateMatchesParamTypes(String paramName, SqlType expectedType) { + Preconditions.checkArgument( + paramTypes.containsKey(paramName), "No parameter named: " + paramName); + SqlType actualType = paramTypes.get(paramName); + Preconditions.checkArgument( + SqlType.typesMatch(expectedType, actualType), + "Invalid type passed for query param '" + + paramName + + "'. Expected: " + + expectedType + + " received: " + + actualType); + } + + private static Value stringParamOf(@Nullable String value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.string()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setStringValue(value); + } + return builder.build(); + } + + private static Value bytesParamOf(@Nullable ByteString value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.bytes()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setBytesValue(value); + } + return builder.build(); + } + + private static Value int64ParamOf(@Nullable Long value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.int64()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setIntValue(value); + } + return builder.build(); + } + + private static Value float32ParamOf(@Nullable Float value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.float32()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setFloatValue(value); + } + return builder.build(); + } + + private static Value float64ParamOf(@Nullable Double value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.float64()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setFloatValue(value); + } + return builder.build(); + } + + private static Value booleanParamOf(@Nullable Boolean value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.bool()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setBoolValue(value); + } + return builder.build(); + } + + private static Value timestampParamOf(@Nullable Instant value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.timestamp()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setTimestampValue(toTimestamp(value)); + } + return builder.build(); + } + + private static Value dateParamOf(@Nullable Date value) { + Type type = QueryParamUtil.convertToQueryParamProto(SqlType.date()); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setDateValue(toProtoDate(value)); + } + return builder.build(); + } + + private static Value arrayParamOf(@Nullable List value, SqlType.Array arrayType) { + Type type = QueryParamUtil.convertToQueryParamProto(arrayType); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setArrayValue(arrayValueOf(value, arrayType)); + } + return builder.build(); + } + + private static ArrayValue arrayValueOf(List value, SqlType.Array arrayType) { + ArrayValue.Builder valueBuilder = ArrayValue.newBuilder(); + for (Object element : value) { + if (element == null) { + valueBuilder.addValues(Value.getDefaultInstance()); + continue; + } + switch (arrayType.getElementType().getCode()) { + case BYTES: + ByteString bytesElem = (ByteString) element; + valueBuilder.addValues(Value.newBuilder().setBytesValue(bytesElem).build()); + break; + case STRING: + String stringElem = (String) element; + valueBuilder.addValues(Value.newBuilder().setStringValue(stringElem).build()); + break; + case INT64: + Long longElem = (Long) element; + valueBuilder.addValues(Value.newBuilder().setIntValue(longElem).build()); + break; + case FLOAT32: + Float floatElem = (Float) element; + valueBuilder.addValues(Value.newBuilder().setFloatValue(floatElem).build()); + break; + case FLOAT64: + Double doubleElem = (Double) element; + valueBuilder.addValues(Value.newBuilder().setFloatValue(doubleElem).build()); + break; + case BOOL: + Boolean boolElem = (Boolean) element; + valueBuilder.addValues(Value.newBuilder().setBoolValue(boolElem).build()); + break; + case TIMESTAMP: + Instant timestampElem = (Instant) element; + valueBuilder.addValues( + Value.newBuilder().setTimestampValue(toTimestamp(timestampElem)).build()); + break; + case DATE: + Date dateElem = (Date) element; + valueBuilder.addValues(Value.newBuilder().setDateValue(toProtoDate(dateElem)).build()); + break; + default: + throw new IllegalArgumentException( + "Unsupported query parameter Array element type: " + arrayType.getElementType()); + } + } + return valueBuilder.build(); + } + + private static Timestamp toTimestamp(Instant instant) { + return Timestamp.newBuilder() + .setSeconds(instant.getEpochSecond()) + .setNanos(instant.getNano()) + .build(); + } + + private static com.google.type.Date toProtoDate(Date date) { + return com.google.type.Date.newBuilder() + .setYear(date.getYear()) + .setMonth(date.getMonth()) + .setDay(date.getDayOfMonth()) + .build(); + } + + private static Value.Builder nullValueWithType(Type type) { + return Value.newBuilder().setType(type); + } + } + + /** + * Creates the request protobuf. This method is considered an internal implementation detail and + * not meant to be used by applications. + */ + @InternalApi("For internal use only") + public ExecuteQueryRequest toProto( + ByteString preparedQuery, RequestContext requestContext, @Nullable ByteString resumeToken) { + ExecuteQueryRequest.Builder requestBuilder = + ExecuteQueryRequest.newBuilder() + .setInstanceName( + NameUtil.formatInstanceName( + requestContext.getProjectId(), requestContext.getInstanceId())) + .setAppProfileId(requestContext.getAppProfileId()) + .setPreparedQuery(preparedQuery) + .putAllParams(params); + + if (resumeToken != null) { + requestBuilder.setResumeToken(resumeToken); + } + return requestBuilder.build(); + } + + @InternalApi("For internal use only") + public PreparedQueryData markExpiredAndStartRefresh( + PreparedQueryVersion expiredPreparedQueryVersion) { + return this.preparedStatement.markExpiredAndStartRefresh(expiredPreparedQueryVersion); + } + + /** + * Asserts that the given stub matches the stub used for plan refresh. This is necessary to ensure + * that the request comes from the same client and uses the same configuration. + * + *

This is considered an internal implementation detail and not meant to be used by + * applications + */ + @InternalApi + public void assertUsingSameStub(EnhancedBigtableStub stub) { + this.preparedStatement.assertUsingSameStub(stub); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java new file mode 100644 index 000000000000..20d063922cdc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +/** Represents the metadata for a column in a {@link ResultSet} */ +public interface ColumnMetadata { + /** The name of the column. Returns Empty string if the column has no name */ + String name(); + + /** The {@link SqlType} of the column */ + SqlType type(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatement.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatement.java new file mode 100644 index 000000000000..e54c86953bbc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatement.java @@ -0,0 +1,32 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.models.sql; + +/** + * The results of query preparation that can be used to create {@link BoundStatement}s to execute + * queries. + * + *

Whenever possible this should be shared across different instances of the same query, in order + * to amortize query preparation costs. + */ +public interface PreparedStatement { + + /** + * @return {@link BoundStatement.Builder} to bind query params to and pass to {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient#executeQuery(BoundStatement)} + */ + BoundStatement.Builder bind(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatementRefreshTimeoutException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatementRefreshTimeoutException.java new file mode 100644 index 000000000000..413997aff871 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatementRefreshTimeoutException.java @@ -0,0 +1,30 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.models.sql; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import io.grpc.Status.Code; + +/** + * Error thrown when an executeQuery attempt hits the attempt deadline waiting for {@link + * PreparedStatement} to refresh it's underlying plan. + */ +public class PreparedStatementRefreshTimeoutException extends ApiException { + public PreparedStatementRefreshTimeoutException(String message) { + super(message, null, GrpcStatusCode.of(Code.DEADLINE_EXCEEDED), true); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java new file mode 100644 index 000000000000..a149c03728b3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +/** + * A set of SQL data, generated as the result of an ExecuteQuery request. + * + *

This allows access to the data of one row at a time using the methods from the {@code + * StructReader} interface. The rows are read in the order of the query results. To advance to the + * next row call {@link #next}. This returns {@code false} once all the rows have been iterated + * over. The result set is initially positioned before the first row, so {@link #next} must be + * called before reading any data. + * + *

{@link #getMetadata()} may be called before calling next. It will block until the metadata has + * been received. + * + *

{@code ResultSet} implementations may buffer data ahead and/or maintain a persistent streaming + * connection to the remote service until all data has been returned or the resultSet closed. As + * such, it is important that all uses of {@code ResultSet} either fully consume it (that is, call + * {@code next()} until {@code false} is returned or it throws an exception) or explicitly call + * {@link #close()}: failure to do so may result in wasted work or leaked resources. + * + *

{@code ResultSet} implementations are not required to be thread-safe: the thread that asked + * for a ResultSet must be the one that interacts with it. + */ +public interface ResultSet extends StructReader, AutoCloseable { + + /** + * Advances the result set to the next row, returning {@code false} if no such row exists. Calls + * to data access methods will throw an exception after next has returned {@code False}. + */ + boolean next(); + + /** + * Returns the {@link ResultSetMetadata} for the ResultSet. Blocks until the underlying request + * receives the metadata. + */ + ResultSetMetadata getMetadata(); + + /** + * Closes the result set and cancels the underlying request if it is still open. This must always + * be called when disposing of a {@code ResultSet} before {@link #next()} has returned {@code + * false} or raised an exception. Calling {@code close()} is also allowed if the result set has + * been fully consumed, so a recommended practice is to unconditionally close the result set once + * it is done with, typically using a try-with-resources construct. + */ + @Override + void close(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSetMetadata.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSetMetadata.java new file mode 100644 index 000000000000..303c00928e32 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSetMetadata.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import java.util.List; + +/** Provides information about the schema of a {@link ResultSet}. */ +public interface ResultSetMetadata { + + /** + * @return full list of {@link ColumnMetadata} for each column in the {@link ResultSet}. + */ + List getColumns(); + + /** + * @param columnIndex index of the column + * @return the {@link SqlType} of the column at the given index + */ + SqlType getColumnType(int columnIndex); + + /** + * @param columnName name of the column + * @return the {@link SqlType} of the column with the given name + * @throws IllegalArgumentException if there is no column with the name *or* if there are multiple + * columns with the given name + */ + SqlType getColumnType(String columnName); + + /** + * @param columnName name of the column + * @return index of the column with the given name + * @throws IllegalArgumentException if there is no column with the name *or* if there are multiple + * columns with the given name + */ + int getColumnIndex(String columnName); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java new file mode 100644 index 000000000000..1307349c92d2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java @@ -0,0 +1,413 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.cloud.Date; +import com.google.cloud.bigtable.common.Type; +import com.google.cloud.bigtable.common.Type.SchemalessStruct; +import com.google.cloud.bigtable.common.Type.StructWithSchema; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Parser; +import com.google.protobuf.ProtocolMessageEnum; +import java.io.Serializable; +import java.time.Instant; +import java.util.List; +import java.util.function.Function; + +/** + * Represents a data type in a SQL query. + * + *

Complex types ({@link SqlType.Map}, {@link SqlType.Array}, & {@link SqlType.Struct} provide + * additional information about the schema of the type. + * + * @param the corresponding java type + */ +public interface SqlType extends Serializable { + + /* Enumeration of the types */ + enum Code { + BYTES, + STRING, + INT64, + FLOAT64, + FLOAT32, + BOOL, + TIMESTAMP, + DATE, + STRUCT, + ARRAY, + MAP, + PROTO, + ENUM + } + + /** + * @return {@link Code} enum for this type + */ + Code getCode(); + + /** + * Represents a map type in SQL. Provides access to the key and value types for the map. + * + * @param Java type of the Map key data + * @param Java type of the Map value data + */ + interface Map extends SqlType> { + /** + * @return {@link SqlType} of the map's key + */ + SqlType getKeyType(); + + /** + * @return {@link SqlType} of the map's value + */ + SqlType getValueType(); + } + + /** + * Represents an array type in SQL. Provides access to the element type of the array. + * + * @param Java type of the Array element data + */ + interface Array extends SqlType> { + /** + * @return {@link SqlType} of the array's elements + */ + SqlType getElementType(); + } + + /** + * Represents a struct type in SQL. A struct is an ordered collection of named and type fields. + */ + interface Struct extends SqlType { + // This extends ColumnMetadata so that we can reuse some helpers for both types + /** Represents a field in a struct */ + interface Field extends ColumnMetadata { + /** + * @return the name of the field. Returns an empty string for fields without names. + */ + @Override + String name(); + + /** + * @return the {@link SqlType} of the field + */ + @Override + SqlType type(); + } + + /** + * @return the ordered list of {@link Field}s for the struct + */ + List getFields(); + + /** + * @param fieldIndex index of the field + * @return the {@link SqlType} of the field at the given index + */ + SqlType getType(int fieldIndex); + + /** + * @param fieldName name of the field + * @return the {@link SqlType} of the field with the given name + * @throws IllegalArgumentException if there is no field with the name *or* if there are + * multiple columns with the given name + */ + SqlType getType(String fieldName); + + /** + * @param fieldName name of the field + * @return the field index of the field with the given name + * @throws IllegalArgumentException if there is no field with the name *or* if there are + * multiple columns with the given name + */ + int getColumnIndex(String fieldName); + } + + /** + * Represents a protobuf message type in SQL. + * + * @param Java type of the protobuf message + */ + @BetaApi("This feature is currently experimental and can change in the future") + interface Proto extends SqlType { + + /** + * @return the parser for the proto message. + */ + Parser getParserForType(); + + String getMessageName(); + } + + /** + * Represents a protobuf enum type in SQL. + * + * @param Java type of the protobuf enum + */ + @BetaApi("This feature is currently experimental and can change in the future") + @SuppressWarnings("JavaLangClash") + interface Enum extends SqlType { + + /** + * @return the function to convert an integer to the enum value. + */ + Function getForNumber(); + + String getEnumName(); + } + + /** returns a {@link SqlType} for the {@code BYTES} type. */ + static SqlType bytes() { + return Type.Bytes.create(); + } + + /** returns a {@link SqlType} for the {@code STRING} type. */ + static SqlType string() { + return Type.String.create(); + } + + /** returns a {@link SqlType} for the {@code INT64} type. */ + static SqlType int64() { + return Type.Int64.create(); + } + + /** returns a {@link SqlType} for the {@code FLOAT64} type. */ + static SqlType float64() { + return Type.Float64.create(); + } + + /** returns a {@link SqlType} for the {@code FLOAT32} type. */ + static SqlType float32() { + return Type.Float32.create(); + } + + /** returns a {@link SqlType} for the {@code BOOL} type. */ + static SqlType bool() { + return Type.Bool.create(); + } + + /** returns a {@link SqlType} for the {@code TIMESTAMP} type. */ + static SqlType timestamp() { + return Type.Timestamp.create(); + } + + /** returns a {@link SqlType} for the {@code DATE} type. */ + static SqlType date() { + return Type.Date.create(); + } + + /** + * returns a fake {@code STRUCT type} for use on in {@link StructReader} methods that require a + * {@link SqlType} to validate against. This does not specify a schema because the struct schem + * will be validated on calls to the structs data accessors. + * + *

Attempts to access the schema of a struct created this way will throw exceptions. + * + *

Example usage: + *

{@code
+   *   List structList = resultSet.getList("column", SqlType.arrayOf(SqlType.struct()));
+   * }
+   */
+  static SqlType.Struct struct() {
+    return SchemalessStruct.create();
+  }
+
+  /** returns a {@link SqlType} for an {@code ARRAY} with elements of type {@code elemType} */
+  static  SqlType.Array arrayOf(SqlType elemType) {
+    return Type.Array.create(elemType);
+  }
+
+  /**
+   * returns a {@link SqlType} for a @code MAP} with keys of type {@code keyType} and values of type
+   * {@code valType}
+   */
+  static  SqlType.Map mapOf(SqlType keyType, SqlType valType) {
+    return Type.Map.create(keyType, valType);
+  }
+
+  /**
+   * returns the {@link SqlType} for the type returned for column families in {@code with_history}
+   * queries. This is equivalent to {@code SqlType.mapOf(SqlType.bytes(),
+   * SqlType.arrayOf(SqlType.struct()))}
+   */
+  static SqlType.Map>
+      historicalMap() {
+    return mapOf(bytes(), arrayOf(struct()));
+  }
+
+  /**
+   * Returns a {@link SqlType} for a protobuf message.
+   *
+   * @param message an instance of the message. {@code MyMessage.getDefaultInstance()} can be used.
+   * @param  the message type
+   */
+  @BetaApi("This feature is currently experimental and can change in the future")
+  static  SqlType.Proto protoOf(T message) {
+    return Type.Proto.create(message);
+  }
+
+  /**
+   * Returns a {@link SqlType} for a protobuf enum.
+   *
+   * @param method a function to convert an integer to the enum value. This is usually {@code
+   *     MyEnum::forNumber}
+   * @param  the enum type
+   */
+  @BetaApi("This feature is currently experimental and can change in the future")
+  static  SqlType.Enum enumOf(Function method) {
+    return Type.Enum.create(method);
+  }
+
+  /**
+   * Extracts the unqualified name from a fully qualified proto message or enum name. For example,
+   * "my.package.MyMessage" becomes "MyMessage".
+   *
+   * 

This is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + static String getUnqualifiedName(String fullName) { + if (fullName == null || fullName.isEmpty()) { + return ""; + } + int lastDotIndex = fullName.lastIndexOf('.'); + return (lastDotIndex == -1) ? fullName : fullName.substring(lastDotIndex + 1); + } + + /** + * Creates a {@link SqlType} from the protobuf representation of Types. + * + *

This is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + static SqlType fromProto(com.google.bigtable.v2.Type proto) { + switch (proto.getKindCase()) { + case BYTES_TYPE: + return bytes(); + case STRING_TYPE: + return string(); + case INT64_TYPE: + return int64(); + case FLOAT64_TYPE: + return float64(); + case FLOAT32_TYPE: + return float32(); + case BOOL_TYPE: + return bool(); + case TIMESTAMP_TYPE: + return timestamp(); + case DATE_TYPE: + return date(); + case STRUCT_TYPE: + return StructWithSchema.fromProto(proto.getStructType()); + case ARRAY_TYPE: + return arrayOf(fromProto(proto.getArrayType().getElementType())); + case MAP_TYPE: + com.google.bigtable.v2.Type.Map mapType = proto.getMapType(); + return mapOf(fromProto(mapType.getKeyType()), fromProto(mapType.getValueType())); + case PROTO_TYPE: + return Type.SchemalessProto.fromProto(proto.getProtoType()); + case ENUM_TYPE: + return Type.SchemalessEnum.fromProto(proto.getEnumType()); + case KIND_NOT_SET: + throw new IllegalStateException("Unrecognized Type. You may need to update your client."); + default: + throw new IllegalStateException("Unexpected Type: " + proto.getKindCase().name()); + } + } + + /** + * This can be used to check whether {@link + * com.google.cloud.bigtable.data.v2.models.sql.StructReader} get calls are being called for the + * correct type when compared to the schema. This is different that equals because we do not + * require users to specify the full struct schema for struct get calls. This is safe because the + * struct schema will be validated on calls to the struct. + * + *

This is considered an internal implementation detail and not meant to be used by + * applications. + */ + @InternalApi + static boolean typesMatch(SqlType left, SqlType right) { + switch (left.getCode()) { + case BYTES: + case STRING: + case INT64: + case FLOAT64: + case FLOAT32: + case BOOL: + case TIMESTAMP: + case DATE: + return left.equals(right); + case PROTO: + { + if (!left.getCode().equals(right.getCode())) { + return false; + } + if (left instanceof Type.SchemalessProto && right instanceof Type.SchemalessProto) { + return left.equals(right); + } + if (left instanceof Type.Proto && right instanceof Type.Proto) { + return left.equals(right); + } + // Compares mixed SchemalessProto and Proto + return getUnqualifiedName(((SqlType.Proto) left).getMessageName()) + .equals(getUnqualifiedName(((SqlType.Proto) right).getMessageName())); + } + case ENUM: + { + if (!left.getCode().equals(right.getCode())) { + return false; + } + if (left instanceof Type.SchemalessEnum && right instanceof Type.SchemalessEnum) { + return left.equals(right); + } + if (left instanceof Type.Enum && right instanceof Type.Enum) { + return left.equals(right); + } + // Compares mixed SchemalessEnum and Enum + return getUnqualifiedName(((SqlType.Enum) left).getEnumName()) + .equals(getUnqualifiedName(((SqlType.Enum) right).getEnumName())); + } + case STRUCT: + // Don't validate fields since the field types will be validated on + // accessor calls to struct + return left.getCode().equals(right.getCode()); + case ARRAY: + if (!left.getCode().equals(right.getCode())) { + return false; + } + SqlType.Array leftArray = (SqlType.Array) left; + SqlType.Array rightArray = (SqlType.Array) right; + return typesMatch(leftArray.getElementType(), rightArray.getElementType()); + case MAP: + if (!left.getCode().equals(right.getCode())) { + return false; + } + SqlType.Map leftMap = (SqlType.Map) left; + SqlType.Map rightMap = (SqlType.Map) right; + boolean keysMatch = typesMatch(leftMap.getKeyType(), rightMap.getKeyType()); + boolean valuesMatch = typesMatch(leftMap.getValueType(), rightMap.getValueType()); + return keysMatch && valuesMatch; + default: + throw new IllegalStateException("Unexpected type: " + left); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java new file mode 100644 index 000000000000..a043e714f001 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import java.io.Serializable; + +/** + * The representation of a SQL Struct type. Data can be accessed using the methods from the {@code + * StructReader} interface. + */ +public interface Struct extends StructReader, Serializable {} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java new file mode 100644 index 000000000000..0af8b8017a36 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java @@ -0,0 +1,257 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import com.google.api.core.BetaApi; +import com.google.cloud.Date; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.ProtocolMessageEnum; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +/** + * An interface for reading the columns of a {@code Struct} or {@code + * com.google.cloud.bigtable.data.v2.models.sql.ResultSet}. + * + *

This provides accessors for each valid type in the form of {@code getTypeName()}. Attempting + * to call these methods for a column of another type will result in an {@code + * IllegalStateException}. Each method has an overload accepting both {@code int} column index and + * {@code String} column Name. Attempting to call an index-based method with a non-existent index + * will result in an {@code IndexOutOfBoundsException}. Attempting to call a columnName based getter + * with a column name that does not appear exactly once in the set of fields will result in an + * {@code IllegalArgumentException}. Attempting to access a column with a null value will result in + * a {@code NullPointerException}; {@link #isNull(int)} & {@link #isNull(String)} can be used to + * check for null values. + */ +public interface StructReader { + /** + * @param columnIndex index of the column + * @return {@code true} if the column contains a {@code NULL} value + */ + boolean isNull(int columnIndex); + + /** + * @param columnName name of the column + * @return {@code true} if the column contains a {@code NULL} value + * @throws IllegalArgumentException if there is not exactly one column with the given name + */ + boolean isNull(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link ByteString} type value of a non-{@code NULL} column + */ + ByteString getBytes(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link ByteString} type value of a non-{@code NULL} column + */ + ByteString getBytes(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link String} type value of a non-{@code NULL} column + */ + String getString(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link String} type value of a non-{@code NULL} column + */ + String getString(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link long} type value of a non-{@code NULL} column + */ + long getLong(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link long} type value of a non-{@code NULL} column + */ + long getLong(String columnName); + + /** + * Getter for FLOAT_64 type Sql data + * + * @param columnIndex index of the column + * @return {@link double} type value of a non-{@code NULL} column + */ + double getDouble(int columnIndex); + + /** + * Getter for FLOAT_64 type Sql data + * + * @param columnName name of the column + * @return {@link double} type value of a non-{@code NULL} column + */ + double getDouble(String columnName); + + /** + * Getter for FLOAT_32 type Sql data + * + * @param columnIndex index of the column + * @return {@link float} type value of a non-{@code NULL} column + */ + float getFloat(int columnIndex); + + /** + * Getter for FLOAT_32 type Sql data + * + * @param columnName name of the column + * @return {@link float} type value of a non-{@code NULL} column + */ + float getFloat(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link boolean} type value of a non-{@code NULL} column + */ + boolean getBoolean(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link boolean} type value of a non-{@code NULL} column + */ + boolean getBoolean(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link Instant} type value of a non-{@code NULL} column + */ + Instant getTimestamp(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link Instant} type value of a non-{@code NULL} column + */ + Instant getTimestamp(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link Date} type value of a non-{@code NULL} column + */ + Date getDate(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link Date} type value of a non-{@code NULL} column + */ + Date getDate(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link com.google.cloud.bigtable.data.v2.models.sql.Struct} type value of a non-{@code + * NULL} column + */ + Struct getStruct(int columnIndex); + + /** + * @param columnName name of the column + * @return {@link com.google.cloud.bigtable.data.v2.models.sql.Struct} type value of a non-{@code + * NULL} column + */ + Struct getStruct(String columnName); + + /** + * @param columnIndex index of the column + * @return {@link List} type value of a non-{@code NULL} column + * @param Java type of the list elements + */ + List getList(int columnIndex, SqlType.Array arrayType); + + /** + * @param columnName name of the column + * @return {@link List} type value of a non-{@code NULL} column + * @param Java type of the list elements + */ + List getList(String columnName, SqlType.Array arrayType); + + /** + * @param columnIndex index of the column + * @return {@link Map} type value of a non-{@code NULL} column + * @param Java type of the map keys + * @param Java type of the map values + */ + Map getMap(int columnIndex, SqlType.Map mapType); + + /** + * @param columnName name of the column + * @return {@link Map} type value of a non-{@code NULL} column + * @param Java type of the map keys + * @param Java type of the map values + */ + Map getMap(String columnName, SqlType.Map mapType); + + /** + * Returns the value of a non-{@code NULL} column with a protobuf message type. + * + * @param columnIndex index of the column. + * @param message an instance of the message. This is used to determine the message type and + * parser. {@code MyMessage.getDefaultInstance()} can be used. + * @param the message type. + * @see getDefaultInstance() + */ + @BetaApi("This feature is currently experimental and can change in the future") + MsgType getProtoMessage(int columnIndex, MsgType message); + + /** + * Returns the value of a non-{@code NULL} column with a protobuf message type. + * + * @param columnName name of the column. + * @param message an instance of the message. This is used to determine the message type and + * parser. {@code MyMessage.getDefaultInstance()} can be used. + * @param the message type. + * @see getDefaultInstance() + */ + @BetaApi("This feature is currently experimental and can change in the future") + MsgType getProtoMessage(String columnName, MsgType message); + + /** + * Returns the value of a non-{@code NULL} column with a protobuf enum type. + * + * @param columnIndex index of the column. + * @param forNumber a function to convert an integer to the enum value. This is usually {@code + * MyEnum::forNumber}. + * @param the enum type. + * @see forNumber() + */ + @BetaApi("This feature is currently experimental and can change in the future") + EnumType getProtoEnum( + int columnIndex, Function forNumber); + + /** + * Returns the value of a non-{@code NULL} column with a protobuf enum type. + * + * @param columnName name of the column. + * @param forNumber a function to convert an integer to the enum value. This is usually {@code + * MyEnum::forNumber}. + * @param the enum type. + * @see forNumber() + */ + @BetaApi("This feature is currently experimental and can change in the future") + EnumType getProtoEnum( + String columnName, Function forNumber); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java new file mode 100644 index 000000000000..5f4193d06365 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 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. + */ + +/** + * A client for the Cloud Bigtable data API. + * + * @see com.google.cloud.bigtable.data.v2.BigtableDataClient for usage. + */ +package com.google.cloud.bigtable.data.v2; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java new file mode 100644 index 000000000000..eea295074e41 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java @@ -0,0 +1,369 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.BatchingCallSettings; +import com.google.api.gax.batching.BatchingDescriptor; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.DynamicFlowControlSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsAttemptResult; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * This settings holds the batching thresholds as well as retry configuration. + * + *

Sample configuration: + * + *

{@code
+ * BigtableBatchingCallSettings defaultBatchingCallSettings =
+ *     bigtableDataCallSettings.getStubSettings().bulkMutateRowsSettings();
+ *
+ * BigtableBatchingCallSettings customBatchingCallSettings = defaultBatchingCallSettings.toBuilder()
+ *     .setBatchingSettings(
+ *         defaultBatchingCallSettings.getBatchingSettings().toBuilder()
+ *             .setDelayThreshold(Duration.ofSeconds(10))
+ *             .build())
+ *     .setRetryableCodes(Code.DEADLINE_EXCEEDED)
+ *     .setLatencyBasedThrottling(true, 1000L)
+ *     .build();
+ * }
+ * + * @see BatchingSettings for batching thresholds explantion. + * @see RetrySettings for retry configuration. + */ +@BetaApi("This surface is likely to change as the batching surface evolves.") +public final class BigtableBatchingCallSettings + extends UnaryCallSettings { + + // This settings is just a simple wrapper for BatchingCallSettings to allow us to add + // additional functionality. + private final BatchingCallSettings + batchingCallSettings; + private final boolean isLatencyBasedThrottlingEnabled; + private final Long targetRpcLatencyMs; + private final DynamicFlowControlSettings dynamicFlowControlSettings; + + private final boolean isServerInitiatedFlowControlEnabled; + + private BigtableBatchingCallSettings(Builder builder) { + super(builder); + batchingCallSettings = + BatchingCallSettings.newBuilder(builder.batchingDescriptor) + .setBatchingSettings(builder.batchingSettings) + .setRetrySettings(builder.getRetrySettings()) + .setRetryableCodes(builder.getRetryableCodes()) + .build(); + this.isLatencyBasedThrottlingEnabled = builder.isLatencyBasedThrottlingEnabled; + this.targetRpcLatencyMs = builder.targetRpcLatencyMs; + this.dynamicFlowControlSettings = builder.dynamicFlowControlSettings; + this.isServerInitiatedFlowControlEnabled = builder.isServerInitiatedFlowControlEnabled; + } + + /** Returns batching settings which contains multiple batch threshold levels. */ + public BatchingSettings getBatchingSettings() { + return batchingCallSettings.getBatchingSettings(); + } + + /** Returns an adapter that packs and unpacks batching elements. */ + BatchingDescriptor + getBatchingDescriptor() { + return batchingCallSettings.getBatchingDescriptor(); + } + + /** Gets if latency based throttling is enabled. */ + public boolean isLatencyBasedThrottlingEnabled() { + return isLatencyBasedThrottlingEnabled; + } + + /** Gets target rpc latency if latency based throttling is enabled. Otherwise returns null. */ + @Nullable + public Long getTargetRpcLatencyMs() { + return targetRpcLatencyMs; + } + + /** + * Gets {@link DynamicFlowControlSettings}. + * + * @see Builder#getDynamicFlowControlSettings() + */ + DynamicFlowControlSettings getDynamicFlowControlSettings() { + return dynamicFlowControlSettings; + } + + /** Gets if flow control is enabled. */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public boolean isServerInitiatedFlowControlEnabled() { + return isServerInitiatedFlowControlEnabled; + } + + static Builder newBuilder( + BatchingDescriptor + batchingDescriptor) { + return new Builder(batchingDescriptor); + } + + /** + * Get a builder with the same values as this object. See the class documentation of {@link + * BigtableBatchingCallSettings} for a sample settings configuration. + */ + @Override + public final Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("batchingCallSettings", batchingCallSettings) + .add("isLatencyBasedThrottlingEnabled", isLatencyBasedThrottlingEnabled) + .add("targetRpcLatency", targetRpcLatencyMs) + .add("dynamicFlowControlSettings", dynamicFlowControlSettings) + .add("isServerInitiatedFlowControlEnabled", isServerInitiatedFlowControlEnabled) + .toString(); + } + + /** + * A base builder class for {@link BigtableBatchingCallSettings}. See the class documentation of + * {@link BigtableBatchingCallSettings} for a description of the different values that can be set. + */ + public static class Builder + extends UnaryCallSettings.Builder { + + private BatchingDescriptor + batchingDescriptor; + private BatchingSettings batchingSettings; + private boolean isLatencyBasedThrottlingEnabled; + private Long targetRpcLatencyMs; + private DynamicFlowControlSettings dynamicFlowControlSettings; + + private boolean isServerInitiatedFlowControlEnabled; + + private Builder( + @Nonnull + BatchingDescriptor + batchingDescriptor) { + this.batchingDescriptor = + Preconditions.checkNotNull(batchingDescriptor, "batching descriptor can't be null"); + } + + private Builder(@Nonnull BigtableBatchingCallSettings settings) { + super(settings); + this.batchingDescriptor = settings.getBatchingDescriptor(); + this.batchingSettings = settings.getBatchingSettings(); + this.isLatencyBasedThrottlingEnabled = settings.isLatencyBasedThrottlingEnabled(); + this.targetRpcLatencyMs = settings.getTargetRpcLatencyMs(); + this.dynamicFlowControlSettings = settings.getDynamicFlowControlSettings(); + this.isServerInitiatedFlowControlEnabled = settings.isServerInitiatedFlowControlEnabled(); + } + + /** Sets the batching settings with various thresholds. */ + public Builder setBatchingSettings(@Nonnull BatchingSettings batchingSettings) { + Preconditions.checkNotNull(batchingSettings, "batching settings can't be null"); + this.batchingSettings = batchingSettings; + return this; + } + + /** Returns the {@link BatchingSettings}. */ + public BatchingSettings getBatchingSettings() { + return batchingSettings; + } + + /** Sets the rpc failure {@link StatusCode.Code code}, for which retries should be performed. */ + @Override + public Builder setRetryableCodes(StatusCode.Code... codes) { + super.setRetryableCodes(codes); + return this; + } + + /** Sets the rpc failure {@link StatusCode.Code code}, for which retries should be performed. */ + @Override + public Builder setRetryableCodes(Set retryableCodes) { + super.setRetryableCodes(retryableCodes); + return this; + } + + /** Sets the {@link RetrySettings} values for each retry attempts. */ + @Override + public Builder setRetrySettings(@Nonnull RetrySettings retrySettings) { + super.setRetrySettings(retrySettings); + return this; + } + + /** + * Enable latency based throttling. The number of allowed in-flight requests will be adjusted to + * reach the target rpc latency. + */ + public Builder enableLatencyBasedThrottling(long targetRpcLatency) { + Preconditions.checkArgument( + targetRpcLatency > 0, "target RPC latency must be greater than 0"); + this.isLatencyBasedThrottlingEnabled = true; + this.targetRpcLatencyMs = targetRpcLatency; + return this; + } + + /** Disable latency based throttling. */ + public Builder disableLatencyBasedThrottling() { + this.isLatencyBasedThrottlingEnabled = false; + this.targetRpcLatencyMs = null; + return this; + } + + /** Gets target rpc latency if latency based throttling is enabled. Otherwise returns null. */ + @Nullable + public Long getTargetRpcLatencyMs() { + return isLatencyBasedThrottlingEnabled ? targetRpcLatencyMs : null; + } + + /** Gets if latency based throttling is enabled. */ + public boolean isLatencyBasedThrottlingEnabled() { + return this.isLatencyBasedThrottlingEnabled; + } + + /** + * Gets the {@link DynamicFlowControlSettings} that'll be used to set up a {@link + * FlowController} for throttling. + * + *

By default, this will allow a maximum of 1000 entries per channel of {@link + * FlowControlSettings.Builder#setMaxOutstandingElementCount request count} and 100MB of {@link + * FlowControlSettings.Builder#setMaxOutstandingRequestBytes accumulated size} in-flight + * requests. Once the limits are reached, pending operations will by default be {@link + * FlowControlSettings.Builder#setLimitExceededBehavior blocked} until some of the in-flight + * requests are resolved. + * + *

If latency based throttling is enabled, number of entries allowed by {@link + * FlowController} will be adjusted to reach {@link Builder#getTargetRpcLatencyMs()}. + * + *

    + *
  • {@link FlowController} will be set to allow Math.max({@link BatchingSettings.Builder + * #setElementCountThreshold batch size}, {@link + * FlowControlSettings.Builder#setMaxOutstandingElementCount request count} / 4) entries + * to start with. + *
  • If bulk mutation rpc latency is higher than target latency, decrease allowed entries to + * a minimum of Math.max({@link BatchingSettings.Builder#setElementCountThreshold batch + * size}, {@link FlowControlSettings.Builder#setMaxOutstandingElementCount request count} + * / 100). + *
  • If bulk mutation rpc latency is lower than target latency and there was throttling, + * increase allowed entries to a maximum of {@link + * FlowControlSettings.Builder#setMaxOutstandingElementCount request count}. + *
+ * + * If latency based throttling is disabled, {@link FlowController} will always allow {@link + * FlowControlSettings.Builder#setMaxOutstandingElementCount request count}. + * + *

Latency based throttling only updates outstanding entries count. {@link FlowController} + * will always allow {@link FlowControlSettings.Builder#setMaxOutstandingRequestBytes + * accumulated size}. + */ + DynamicFlowControlSettings getDynamicFlowControlSettings() { + return this.dynamicFlowControlSettings; + } + + /** Configure flow control based on the current load of the Bigtable server. */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public Builder setServerInitiatedFlowControl(boolean isEnable) { + this.isServerInitiatedFlowControlEnabled = isEnable; + return this; + } + + /** Gets if flow control is enabled based on the load of the Bigtable server. */ + @InternalApi("Intended for use by the Bigtable dataflow connectors only") + public boolean isServerInitiatedFlowControlEnabled() { + return this.isServerInitiatedFlowControlEnabled; + } + + /** Builds the {@link BigtableBatchingCallSettings} object with provided configuration. */ + @Override + public BigtableBatchingCallSettings build() { + Preconditions.checkState(batchingSettings != null, "batchingSettings must be set"); + FlowControlSettings flowControlSettings = batchingSettings.getFlowControlSettings(); + Preconditions.checkState( + flowControlSettings.getMaxOutstandingElementCount() != null, + "maxOutstandingElementCount must be set in BatchingSettings#FlowControlSettings"); + Preconditions.checkState( + flowControlSettings.getMaxOutstandingRequestBytes() != null, + "maxOutstandingRequestBytes must be set in BatchingSettings#FlowControlSettings"); + Preconditions.checkArgument( + batchingSettings.getElementCountThreshold() == null + || flowControlSettings.getMaxOutstandingElementCount() + > batchingSettings.getElementCountThreshold(), + "if batch elementCountThreshold is set in BatchingSettings, flow control" + + " maxOutstandingElementCount must be > elementCountThreshold"); + Preconditions.checkArgument( + batchingSettings.getRequestByteThreshold() == null + || flowControlSettings.getMaxOutstandingRequestBytes() + > batchingSettings.getRequestByteThreshold(), + "if batch requestByteThreshold is set in BatchingSettings, flow control" + + " maxOutstandingRequestBytes must be > getRequestByteThreshold"); + // Combine static FlowControlSettings with latency based throttling settings to create + // DynamicFlowControlSettings. + if (isLatencyBasedThrottlingEnabled()) { + long maxThrottlingElementCount = flowControlSettings.getMaxOutstandingElementCount(); + long maxThrottlingRequestByteCount = flowControlSettings.getMaxOutstandingRequestBytes(); + // The maximum in flight element count is pretty high. Set the initial parallelism to 25% + // of the maximum and then work up or down. This reduction should reduce the + // impacts of a bursty job, such as those found in Dataflow. + long initialElementCount = maxThrottlingElementCount / 4; + // Decreases are floored at 1% of the maximum so that there is some level of + // throughput. + long minElementCount = maxThrottlingElementCount / 100; + // Make sure initialOutstandingElementCount and minOutstandingElementCount element count are + // greater or equal to batch size to avoid deadlocks. + if (batchingSettings.getElementCountThreshold() != null) { + initialElementCount = + Math.max(initialElementCount, batchingSettings.getElementCountThreshold()); + minElementCount = Math.max(minElementCount, batchingSettings.getElementCountThreshold()); + } + dynamicFlowControlSettings = + DynamicFlowControlSettings.newBuilder() + .setLimitExceededBehavior(flowControlSettings.getLimitExceededBehavior()) + .setInitialOutstandingElementCount(initialElementCount) + .setMaxOutstandingElementCount(maxThrottlingElementCount) + .setMinOutstandingElementCount(minElementCount) + .setInitialOutstandingRequestBytes(maxThrottlingRequestByteCount) + .setMinOutstandingRequestBytes(maxThrottlingRequestByteCount) + .setMaxOutstandingRequestBytes(maxThrottlingRequestByteCount) + .build(); + } else { + dynamicFlowControlSettings = + DynamicFlowControlSettings.newBuilder() + .setLimitExceededBehavior(flowControlSettings.getLimitExceededBehavior()) + .setInitialOutstandingElementCount( + flowControlSettings.getMaxOutstandingElementCount()) + .setMaxOutstandingElementCount(flowControlSettings.getMaxOutstandingElementCount()) + .setMinOutstandingElementCount(flowControlSettings.getMaxOutstandingElementCount()) + .setInitialOutstandingRequestBytes( + flowControlSettings.getMaxOutstandingRequestBytes()) + .setMinOutstandingRequestBytes(flowControlSettings.getMaxOutstandingRequestBytes()) + .setMaxOutstandingRequestBytes(flowControlSettings.getMaxOutstandingRequestBytes()) + .build(); + } + return new BigtableBatchingCallSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettings.java new file mode 100644 index 000000000000..f4852765db59 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettings.java @@ -0,0 +1,150 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.batching.BatchingCallSettings; +import com.google.api.gax.batching.BatchingDescriptor; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.util.List; +import java.util.Set; +import javax.annotation.Nonnull; + +/** + * This settings holds the batching thresholds as well as retry configuration for bulk read API. + * + *

Sample configuration: + * + *

{@code
+ * BigtableBulkReadRowsCallSettings defaultBulkReadCallSettings =
+ *     bigtableDataCallSettings.getStubSettings().bulkReadRowsSettings();
+ *
+ * BigtableBulkReadRowsCallSettings customBulkReadCallSettings = defaultBulkReadCallSettings
+ *     .toBuilder()
+ *     .setBatchingSettings(
+ *         defaultBulkReadCallSettings.getBatchingSettings().toBuilder()
+ *             .setDelayThreshold(Duration.ofSeconds(10))
+ *             .build())
+ *     .setRetryableCodes(Code.DEADLINE_EXCEEDED)
+ *     .build();
+ * }
+ * + * @see BatchingSettings for batching thresholds explantion. + * @see RetrySettings for retry configuration. + */ +@BetaApi("This surface is likely to change as the batching surface evolves.") +public class BigtableBulkReadRowsCallSettings extends UnaryCallSettings> { + + private final BatchingCallSettings> batchingCallSettings; + + private BigtableBulkReadRowsCallSettings(Builder builder) { + super(builder); + batchingCallSettings = + BatchingCallSettings.newBuilder(builder.batchingDescriptor) + .setBatchingSettings(builder.batchingSettings) + .setRetrySettings(builder.getRetrySettings()) + .setRetryableCodes(builder.getRetryableCodes()) + .build(); + } + + /** Returns batching settings which contains multiple batch threshold levels. */ + public BatchingSettings getBatchingSettings() { + return batchingCallSettings.getBatchingSettings(); + } + + /** Returns an adapter that packs and unpacks batching elements. */ + BatchingDescriptor> getBatchingDescriptor() { + return batchingCallSettings.getBatchingDescriptor(); + } + + static BigtableBulkReadRowsCallSettings.Builder newBuilder( + BatchingDescriptor> batchingDescriptor) { + return new Builder(batchingDescriptor); + } + + /** + * Get a builder with the same values as this object. See the class documentation of {@link + * BigtableBatchingCallSettings} for a sample settings configuration. + */ + @Override + public final BigtableBulkReadRowsCallSettings.Builder toBuilder() { + return new BigtableBulkReadRowsCallSettings.Builder(this); + } + + public static class Builder extends UnaryCallSettings.Builder> { + + private BatchingDescriptor> batchingDescriptor; + private BatchingSettings batchingSettings; + + private Builder( + @Nonnull BatchingDescriptor> batchingDescriptor) { + this.batchingDescriptor = + Preconditions.checkNotNull(batchingDescriptor, "batching descriptor can't be null"); + } + + private Builder(@Nonnull BigtableBulkReadRowsCallSettings settings) { + super(settings); + this.batchingDescriptor = settings.getBatchingDescriptor(); + this.batchingSettings = settings.getBatchingSettings(); + } + + /** Sets the batching settings with various thresholds. */ + public Builder setBatchingSettings(@Nonnull BatchingSettings batchingSettings) { + Preconditions.checkNotNull(batchingSettings, "batching settings can't be null"); + this.batchingSettings = batchingSettings; + return this; + } + + /** Returns the {@link BatchingSettings}. */ + public BatchingSettings getBatchingSettings() { + return batchingSettings; + } + + /** Sets the rpc failure {@link StatusCode.Code code}, for which retries should be performed. */ + @Override + public Builder setRetryableCodes(StatusCode.Code... codes) { + super.setRetryableCodes(codes); + return this; + } + + /** Sets the rpc failure {@link StatusCode.Code code}, for which retries should be performed. */ + @Override + public Builder setRetryableCodes(Set retryableCodes) { + super.setRetryableCodes(retryableCodes); + return this; + } + + /** Sets the {@link RetrySettings} values for each retry attempts. */ + @Override + public Builder setRetrySettings(@Nonnull RetrySettings retrySettings) { + super.setRetrySettings(retrySettings); + return this; + } + + /** Builds the {@link BigtableBulkReadRowsCallSettings} object with provided configuration. */ + @Override + public BigtableBulkReadRowsCallSettings build() { + return new BigtableBulkReadRowsCallSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java new file mode 100644 index 000000000000..2d5022900ed4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java @@ -0,0 +1,182 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.auth.Credentials; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import io.grpc.CallCredentials; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.Deadline; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * A channel warmer that ensures that a Bigtable channel is ready to be used before being added to + * the active {@link com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool}. + * + *

This implementation is subject to change in the future, but currently it will prime the + * channel by sending a ReadRow request for a hardcoded, non-existent row key. + */ +@InternalApi +public class BigtableChannelPrimer implements ChannelPrimer { + private static Logger LOG = Logger.getLogger(BigtableChannelPrimer.class.toString()); + + static final Metadata.Key REQUEST_PARAMS = + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER); + private final PingAndWarmRequest request; + private final CallCredentials callCredentials; + private final Map headers; + + static BigtableChannelPrimer create( + String projectId, + String instanceId, + String appProfileId, + Credentials credentials, + Map headers) { + return new BigtableChannelPrimer(projectId, instanceId, appProfileId, credentials, headers); + } + + BigtableChannelPrimer( + String projectId, + String instanceId, + String appProfileId, + Credentials credentials, + Map headers) { + if (credentials != null) { + callCredentials = MoreCallCredentials.from(credentials); + } else { + callCredentials = null; + } + + request = + PingAndWarmRequest.newBuilder() + .setName(InstanceName.of(projectId, instanceId).toString()) + .setAppProfileId(appProfileId) + .build(); + + this.headers = headers; + } + + @Override + public void primeChannel(Channel channel) { + try { + primeChannelUnsafe(channel); + } catch (IOException | RuntimeException e) { + LOG.log(Level.WARNING, "Unexpected error while trying to prime a channel", e); + } + } + + private void primeChannelUnsafe(Channel channel) throws IOException { + sendPrimeRequestsBlocking(channel); + } + + private void sendPrimeRequestsBlocking(Channel channel) { + try { + sendPrimeRequestsAsync(channel).get(1, TimeUnit.MINUTES); + } catch (Throwable e) { + // TODO: Not sure if we should swallow the error here. We are pre-emptively swapping + // channels if the new + // channel is bad. + LOG.log(Level.WARNING, "Failed to prime channel", e); + } + } + + @Override + public ApiFuture sendPrimeRequestsAsync(Channel managedChannel) { + ClientCall clientCall = + managedChannel.newCall( + BigtableGrpc.getPingAndWarmMethod(), + CallOptions.DEFAULT + .withCallCredentials(callCredentials) + .withDeadline(Deadline.after(1, TimeUnit.MINUTES))); + + SettableApiFuture future = SettableApiFuture.create(); + clientCall.start( + new ClientCall.Listener() { + private PingAndWarmResponse response; + + @Override + public void onMessage(PingAndWarmResponse message) { + response = message; + } + + @Override + public void onClose(Status status, Metadata trailers) { + if (status.isOk()) { + future.set(response); + } else { + // Propagate the gRPC error to the future. + future.setException(status.asException(trailers)); + } + } + }, + createMetadata(headers, request)); + + try { + // Send the request message. + clientCall.sendMessage(request); + // Signal that no more messages will be sent. + clientCall.halfClose(); + // Request the response from the server. + clientCall.request(Integer.MAX_VALUE); + } catch (Throwable t) { + // If sending fails, cancel the call and notify the future. + clientCall.cancel("Failed to send priming request", t); + future.setException(t); + } + + return future; + } + + // Internal headers (bigtable-features and user-agent) are merged in ClientContext and set on + // the transport channel. So when primeChannel is called from gax, the managed channel already has + // those headers. This is tested in EnhancedBigtableStubTest. + private static Metadata createMetadata(Map headers, PingAndWarmRequest request) { + Metadata metadata = new Metadata(); + + headers.forEach( + (k, v) -> metadata.put(Metadata.Key.of(k, Metadata.ASCII_STRING_MARSHALLER), v)); + try { + metadata.put( + REQUEST_PARAMS, + String.format( + "name=%s&app_profile_id=%s", + URLEncoder.encode(request.getName(), "UTF-8"), + URLEncoder.encode(request.getAppProfileId(), "UTF-8"))); + } catch (UnsupportedEncodingException e) { + LOG.log(Level.WARNING, "Failed to encode request params", e); + } + + return metadata; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java new file mode 100644 index 000000000000..a74c15613e0f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java @@ -0,0 +1,350 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.core.FixedExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.auth.Credentials; +import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; +import com.google.cloud.bigtable.data.v2.internal.JwtCredentialsWithAudience; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.compat.DisabledShim; +import com.google.cloud.bigtable.data.v2.internal.compat.Shim; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.dp.AlwaysEnabledDirectAccessChecker; +import com.google.cloud.bigtable.data.v2.internal.dp.ClassicDirectAccessChecker; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessChecker; +import com.google.cloud.bigtable.data.v2.internal.dp.NoopDirectAccessChecker; +import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; +import com.google.cloud.bigtable.gaxx.grpc.BigtableTransportChannelProvider; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import com.google.common.base.Preconditions; +import io.grpc.ManagedChannelBuilder; +import io.opencensus.stats.Stats; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.Tagger; +import io.opencensus.tags.Tags; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * This class wraps all state needed during the lifetime of the Bigtable client. This includes gax's + * {@link ClientContext} plus any additional state that Bigtable Client needs. + */ +@InternalApi +public class BigtableClientContext { + + private static final Logger logger = Logger.getLogger(BigtableClientContext.class.getName()); + + private final boolean isChild; + private final ClientInfo clientInfo; + private final Metrics metrics; + private final ClientContext clientContext; + // the background executor shared for OTEL instances and monitoring client and all other + // background tasks + private final ExecutorProvider backgroundExecutorProvider; + private final Shim sessionShim; + + public static BigtableClientContext create(EnhancedBigtableStubSettings settings) + throws IOException { + return create(settings, Tags.getTagger(), Stats.getStatsRecorder()); + } + + public static BigtableClientContext create( + EnhancedBigtableStubSettings settings, Tagger ocTagger, StatsRecorder ocRecorder) + throws IOException { + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of(settings.getProjectId(), settings.getInstanceId())) + .setAppProfileId(settings.getAppProfileId()) + .build(); + + EnhancedBigtableStubSettings.Builder builder = settings.toBuilder(); + + // Set up credentials + patchCredentials(builder); + + // Fix the credentials so that they can be shared + @Nullable Credentials credentials = null; + if (builder.getCredentialsProvider() != null) { + credentials = builder.getCredentialsProvider().getCredentials(); + } + builder.setCredentialsProvider(FixedCredentialsProvider.create(credentials)); + + String universeDomain = settings.getUniverseDomain(); + + boolean shouldAutoClose = settings.getBackgroundExecutorProvider().shouldAutoClose(); + ScheduledExecutorService backgroundExecutor = + settings.getBackgroundExecutorProvider().getExecutor(); + FixedExecutorProvider executorProvider = + FixedExecutorProvider.create(backgroundExecutor, shouldAutoClose); + builder.setBackgroundExecutorProvider(executorProvider); + + MetricRegistry metricRegistry = new MetricRegistry(); + // Set up OpenTelemetry + @Nullable OpenTelemetry userOtel = null; + if (settings.getMetricsProvider() instanceof CustomOpenTelemetryMetricsProvider) { + userOtel = + ((CustomOpenTelemetryMetricsProvider) settings.getMetricsProvider()).getOpenTelemetry(); + } + + @Nullable OpenTelemetrySdk builtinOtel = null; + try { + if (settings.areInternalMetricsEnabled()) { + builtinOtel = + MetricsImpl.createBuiltinOtel( + metricRegistry, + clientInfo, + credentials, + settings.getMetricsEndpoint(), + universeDomain, + backgroundExecutor); + } + } catch (Throwable t) { + logger.log(Level.WARNING, "Failed to get OTEL, will skip exporting client side metrics", t); + } + + Metrics metrics = + new MetricsImpl( + metricRegistry, + clientInfo, + settings.getTracerFactory(), + builtinOtel, + userOtel, + ocTagger, + ocRecorder, + backgroundExecutor); + + // Set up channel + InstantiatingGrpcChannelProvider.Builder transportProvider = + builder.getTransportChannelProvider() instanceof InstantiatingGrpcChannelProvider + ? ((InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider()).toBuilder() + : null; + + if (transportProvider != null) { + configureGrpcOtel(transportProvider, metrics); + + setupCookieHolder(transportProvider); + + ChannelPrimer channelPrimer = NoOpChannelPrimer.create(); + + // Inject channel priming if enabled + if (isRefreshingEnabled(builder)) { + channelPrimer = + BigtableChannelPrimer.create( + builder.getProjectId(), + builder.getInstanceId(), + builder.getAppProfileId(), + credentials, + builder.getHeaderProvider().getHeaders()); + } + + DirectAccessChecker directAccessChecker = null; + switch (settings.getDirectPathConfig()) { + case FORCED_ON: + directAccessChecker = AlwaysEnabledDirectAccessChecker.INSTANCE; + break; + case FORCED_OFF: + directAccessChecker = NoopDirectAccessChecker.INSTANCE; + break; + case DEFAULT: + default: + directAccessChecker = + new ClassicDirectAccessChecker( + metrics.getDirectPathCompatibleTracer(), channelPrimer, backgroundExecutor); + break; + } + + BigtableTransportChannelProvider btTransportProvider = + BigtableTransportChannelProvider.create( + transportProvider.build(), + channelPrimer, + metrics.getChannelPoolMetricsTracer(), + backgroundExecutor, + directAccessChecker); + + builder.setTransportChannelProvider(btTransportProvider); + } + + ClientContext clientContext = ClientContext.create(builder.build()); + + metrics.start(); + + Shim shim = + settings.isSessionsEnabled() + ? ShimImpl.create(clientInfo, credentials, metrics, backgroundExecutor, settings) + : new DisabledShim(); + + try { + return new BigtableClientContext( + false, shim, clientInfo, clientContext, metrics, executorProvider); + } catch (IOException | RuntimeException t) { + metrics.close(); + throw t; + } + } + + @SuppressWarnings("deprecation") + private static boolean isRefreshingEnabled(EnhancedBigtableStubSettings.Builder b) { + return b.isRefreshingChannel(); + } + + private static void configureGrpcOtel( + InstantiatingGrpcChannelProvider.Builder transportProvider, Metrics metrics) { + @SuppressWarnings("rawtypes") + ApiFunction oldConfigurator = + transportProvider.getChannelConfigurator(); + + transportProvider.setChannelConfigurator( + b -> { + if (oldConfigurator != null) { + b = oldConfigurator.apply(b); + } + return metrics.configureGrpcChannel(b); + }); + } + + private BigtableClientContext( + boolean isChild, + Shim shim, + ClientInfo clientInfo, + ClientContext clientContext, + Metrics metrics, + ExecutorProvider backgroundExecutorProvider) + throws IOException { + this.isChild = isChild; + this.sessionShim = shim; + this.clientInfo = clientInfo; + + this.metrics = metrics; + this.backgroundExecutorProvider = backgroundExecutorProvider; + + this.clientContext = + clientContext.toBuilder().setTracerFactory(metrics.createTracerFactory(clientInfo)).build(); + } + + public ClientInfo getClientInfo() { + return clientInfo; + } + + public Metrics getMetrics() { + return metrics; + } + + public ClientContext getClientContext() { + return this.clientContext; + } + + public BigtableClientContext createChild(InstanceName instanceName, String appProfileId) + throws IOException { + // TODO: either mark BigtableDataClientFactory as deprecated or figure out how to make it + // work with Sessions + Preconditions.checkState( + sessionShim instanceof DisabledShim, "Sessions don't support BigtableDataClientFactory"); + + return new BigtableClientContext( + true, + sessionShim, + clientInfo.toBuilder().setInstanceName(instanceName).setAppProfileId(appProfileId).build(), + clientContext, + metrics, + backgroundExecutorProvider); + } + + public void close() throws Exception { + if (isChild) { + return; + } + + sessionShim.close(); + + for (BackgroundResource resource : clientContext.getBackgroundResources()) { + resource.close(); + } + metrics.close(); + + if (backgroundExecutorProvider.shouldAutoClose()) { + backgroundExecutorProvider.getExecutor().shutdown(); + } + } + + private static void patchCredentials(EnhancedBigtableStubSettings.Builder settings) + throws IOException { + String audience = settings.getJwtAudience(); + + URI audienceUri = null; + try { + audienceUri = new URI(audience); + } catch (URISyntaxException e) { + throw new IllegalStateException("invalid JWT audience", e); + } + + CredentialsProvider credentialsProvider = settings.getCredentialsProvider(); + if (credentialsProvider == null) { + return; + } + + Credentials credentials = credentialsProvider.getCredentials(); + if (credentials == null) { + return; + } + + if (!(credentials instanceof ServiceAccountJwtAccessCredentials)) { + return; + } + + ServiceAccountJwtAccessCredentials jwtCreds = (ServiceAccountJwtAccessCredentials) credentials; + JwtCredentialsWithAudience patchedCreds = new JwtCredentialsWithAudience(jwtCreds, audienceUri); + settings.setCredentialsProvider(FixedCredentialsProvider.create(patchedCreds)); + } + + private static void setupCookieHolder( + InstantiatingGrpcChannelProvider.Builder transportProvider) { + ApiFunction oldChannelConfigurator = + transportProvider.getChannelConfigurator(); + transportProvider.setChannelConfigurator( + managedChannelBuilder -> { + managedChannelBuilder.intercept(new CookiesInterceptor()); + + if (oldChannelConfigurator != null) { + managedChannelBuilder = oldChannelConfigurator.apply(managedChannelBuilder); + } + return managedChannelBuilder; + }); + } + + public Shim getSessionShim() { + return sessionShim; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStreamResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStreamResumptionStrategy.java new file mode 100644 index 000000000000..8eb907d673a4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStreamResumptionStrategy.java @@ -0,0 +1,27 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.StreamResumptionStrategy; + +/** Expand StreamResumptionStrategy to also process the error. */ +@InternalApi +public abstract class BigtableStreamResumptionStrategy + implements StreamResumptionStrategy { + + public abstract Throwable processError(Throwable throwable); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java new file mode 100644 index 000000000000..d1faee376631 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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 javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** For internal use only. */ +@Generated("by gapic-generator") +@InternalApi +public abstract class BigtableStub implements BackgroundResource { + + public ServerStreamingCallable readRowsCallable() { + throw new UnsupportedOperationException("Not implemented: readRowsCallable()"); + } + + public ServerStreamingCallable + sampleRowKeysCallable() { + throw new UnsupportedOperationException("Not implemented: sampleRowKeysCallable()"); + } + + public UnaryCallable mutateRowCallable() { + throw new UnsupportedOperationException("Not implemented: mutateRowCallable()"); + } + + public ServerStreamingCallable mutateRowsCallable() { + throw new UnsupportedOperationException("Not implemented: mutateRowsCallable()"); + } + + public UnaryCallable + checkAndMutateRowCallable() { + throw new UnsupportedOperationException("Not implemented: checkAndMutateRowCallable()"); + } + + public UnaryCallable pingAndWarmCallable() { + throw new UnsupportedOperationException("Not implemented: pingAndWarmCallable()"); + } + + public UnaryCallable + readModifyWriteRowCallable() { + throw new UnsupportedOperationException("Not implemented: readModifyWriteRowCallable()"); + } + + public ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsCallable() { + throw new UnsupportedOperationException( + "Not implemented: generateInitialChangeStreamPartitionsCallable()"); + } + + public ServerStreamingCallable + readChangeStreamCallable() { + throw new UnsupportedOperationException("Not implemented: readChangeStreamCallable()"); + } + + public UnaryCallable prepareQueryCallable() { + throw new UnsupportedOperationException("Not implemented: prepareQueryCallable()"); + } + + public ServerStreamingCallable executeQueryCallable() { + throw new UnsupportedOperationException("Not implemented: executeQueryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java new file mode 100644 index 000000000000..b37017d38e7b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** For internal use only. */ +@Generated("by gapic-generator") +@InternalApi +public class BigtableStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigtable.data") + .add("https://www.googleapis.com/auth/bigtable.data.readonly") + .add("https://www.googleapis.com/auth/cloud-bigtable.data") + .add("https://www.googleapis.com/auth/cloud-bigtable.data.readonly") + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final ServerStreamingCallSettings readRowsSettings; + private final ServerStreamingCallSettings + sampleRowKeysSettings; + private final UnaryCallSettings mutateRowSettings; + private final ServerStreamingCallSettings + mutateRowsSettings; + private final UnaryCallSettings + checkAndMutateRowSettings; + private final UnaryCallSettings pingAndWarmSettings; + private final UnaryCallSettings + readModifyWriteRowSettings; + private final ServerStreamingCallSettings< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsSettings; + private final ServerStreamingCallSettings + readChangeStreamSettings; + private final UnaryCallSettings prepareQuerySettings; + private final ServerStreamingCallSettings + executeQuerySettings; + + /** Returns the object with the settings used for calls to readRows. */ + public ServerStreamingCallSettings readRowsSettings() { + return readRowsSettings; + } + + /** Returns the object with the settings used for calls to sampleRowKeys. */ + public ServerStreamingCallSettings + sampleRowKeysSettings() { + return sampleRowKeysSettings; + } + + /** Returns the object with the settings used for calls to mutateRow. */ + public UnaryCallSettings mutateRowSettings() { + return mutateRowSettings; + } + + /** Returns the object with the settings used for calls to mutateRows. */ + public ServerStreamingCallSettings mutateRowsSettings() { + return mutateRowsSettings; + } + + /** Returns the object with the settings used for calls to checkAndMutateRow. */ + public UnaryCallSettings + checkAndMutateRowSettings() { + 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() { + return readModifyWriteRowSettings; + } + + /** + * Returns the object with the settings used for calls to generateInitialChangeStreamPartitions. + */ + public ServerStreamingCallSettings< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsSettings() { + return generateInitialChangeStreamPartitionsSettings; + } + + /** Returns the object with the settings used for calls to readChangeStream. */ + public ServerStreamingCallSettings + readChangeStreamSettings() { + return readChangeStreamSettings; + } + + /** Returns the object with the settings used for calls to prepareQuery. */ + public UnaryCallSettings prepareQuerySettings() { + return prepareQuerySettings; + } + + /** Returns the object with the settings used for calls to executeQuery. */ + public ServerStreamingCallSettings + executeQuerySettings() { + return executeQuerySettings; + } + + public BigtableStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcBigtableStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "bigtable"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "bigtable.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "bigtable.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BigtableStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected BigtableStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + readRowsSettings = settingsBuilder.readRowsSettings().build(); + sampleRowKeysSettings = settingsBuilder.sampleRowKeysSettings().build(); + mutateRowSettings = settingsBuilder.mutateRowSettings().build(); + mutateRowsSettings = settingsBuilder.mutateRowsSettings().build(); + checkAndMutateRowSettings = settingsBuilder.checkAndMutateRowSettings().build(); + pingAndWarmSettings = settingsBuilder.pingAndWarmSettings().build(); + readModifyWriteRowSettings = settingsBuilder.readModifyWriteRowSettings().build(); + generateInitialChangeStreamPartitionsSettings = + settingsBuilder.generateInitialChangeStreamPartitionsSettings().build(); + readChangeStreamSettings = settingsBuilder.readChangeStreamSettings().build(); + prepareQuerySettings = settingsBuilder.prepareQuerySettings().build(); + executeQuerySettings = settingsBuilder.executeQuerySettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:google-cloud-bigtable") + .setRepository("googleapis/google-cloud-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for BigtableStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final ServerStreamingCallSettings.Builder + readRowsSettings; + private final ServerStreamingCallSettings.Builder + sampleRowKeysSettings; + private final UnaryCallSettings.Builder mutateRowSettings; + private final ServerStreamingCallSettings.Builder + mutateRowsSettings; + private final UnaryCallSettings.Builder + checkAndMutateRowSettings; + private final UnaryCallSettings.Builder + pingAndWarmSettings; + private final UnaryCallSettings.Builder + readModifyWriteRowSettings; + private final ServerStreamingCallSettings.Builder< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsSettings; + private final ServerStreamingCallSettings.Builder< + ReadChangeStreamRequest, ReadChangeStreamResponse> + readChangeStreamSettings; + private final UnaryCallSettings.Builder + prepareQuerySettings; + private final ServerStreamingCallSettings.Builder + executeQuerySettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_6_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_7_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setTotalTimeoutDuration(Duration.ofMillis(43200000L)) + .build(); + definitions.put("no_retry_3_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_5_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(20000L)) + .setTotalTimeoutDuration(Duration.ofMillis(20000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_6_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setTotalTimeoutDuration(Duration.ofMillis(43200000L)) + .build(); + definitions.put("no_retry_7_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(43200000L)) + .setTotalTimeoutDuration(Duration.ofMillis(43200000L)) + .build(); + definitions.put("retry_policy_4_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + readRowsSettings = ServerStreamingCallSettings.newBuilder(); + sampleRowKeysSettings = ServerStreamingCallSettings.newBuilder(); + mutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + mutateRowsSettings = ServerStreamingCallSettings.newBuilder(); + checkAndMutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pingAndWarmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + readModifyWriteRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateInitialChangeStreamPartitionsSettings = ServerStreamingCallSettings.newBuilder(); + readChangeStreamSettings = ServerStreamingCallSettings.newBuilder(); + prepareQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + executeQuerySettings = ServerStreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings, + prepareQuerySettings); + initDefaults(this); + } + + protected Builder(BigtableStubSettings settings) { + super(settings); + + readRowsSettings = settings.readRowsSettings.toBuilder(); + sampleRowKeysSettings = settings.sampleRowKeysSettings.toBuilder(); + mutateRowSettings = settings.mutateRowSettings.toBuilder(); + mutateRowsSettings = settings.mutateRowsSettings.toBuilder(); + checkAndMutateRowSettings = settings.checkAndMutateRowSettings.toBuilder(); + pingAndWarmSettings = settings.pingAndWarmSettings.toBuilder(); + readModifyWriteRowSettings = settings.readModifyWriteRowSettings.toBuilder(); + generateInitialChangeStreamPartitionsSettings = + settings.generateInitialChangeStreamPartitionsSettings.toBuilder(); + readChangeStreamSettings = settings.readChangeStreamSettings.toBuilder(); + prepareQuerySettings = settings.prepareQuerySettings.toBuilder(); + executeQuerySettings = settings.executeQuerySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings, + prepareQuerySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .readRowsSettings() + .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("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .mutateRowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .mutateRowsSettings() + .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("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("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .generateInitialChangeStreamPartitionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); + + builder + .readChangeStreamSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + + builder + .prepareQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .executeQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to readRows. */ + public ServerStreamingCallSettings.Builder + readRowsSettings() { + return readRowsSettings; + } + + /** Returns the builder for the settings used for calls to sampleRowKeys. */ + public ServerStreamingCallSettings.Builder + sampleRowKeysSettings() { + return sampleRowKeysSettings; + } + + /** Returns the builder for the settings used for calls to mutateRow. */ + public UnaryCallSettings.Builder mutateRowSettings() { + return mutateRowSettings; + } + + /** Returns the builder for the settings used for calls to mutateRows. */ + public ServerStreamingCallSettings.Builder + mutateRowsSettings() { + return mutateRowsSettings; + } + + /** Returns the builder for the settings used for calls to checkAndMutateRow. */ + public UnaryCallSettings.Builder + checkAndMutateRowSettings() { + 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() { + return readModifyWriteRowSettings; + } + + /** + * Returns the builder for the settings used for calls to generateInitialChangeStreamPartitions. + */ + public ServerStreamingCallSettings.Builder< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsSettings() { + return generateInitialChangeStreamPartitionsSettings; + } + + /** Returns the builder for the settings used for calls to readChangeStream. */ + public ServerStreamingCallSettings.Builder + readChangeStreamSettings() { + return readChangeStreamSettings; + } + + /** Returns the builder for the settings used for calls to prepareQuery. */ + public UnaryCallSettings.Builder + prepareQuerySettings() { + return prepareQuerySettings; + } + + /** Returns the builder for the settings used for calls to executeQuery. */ + public ServerStreamingCallSettings.Builder + executeQuerySettings() { + return executeQuerySettings; + } + + @Override + public BigtableStubSettings build() throws IOException { + return new BigtableStubSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallable.java new file mode 100644 index 000000000000..726ab4738137 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallable.java @@ -0,0 +1,215 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.AbstractApiFuture; +import com.google.api.core.ApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.Futures; +import io.grpc.Status; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Helper to convert a fake {@link ServerStreamingCallable} (ie only up to 1 response) into a {@link + * UnaryCallable}. It is intended to be the outermost callable of a chain. + * + *

Responsibilities: + * + *

    + *
  • Operation level metrics + *
  • Configuring the default call context + *
  • Converting the result to a future + */ +class BigtableUnaryOperationCallable extends UnaryCallable { + private static final Logger LOGGER = + Logger.getLogger(BigtableUnaryOperationCallable.class.getName()); + Logger logger = LOGGER; + + private final ServerStreamingCallable inner; + private final ApiCallContext defaultCallContext; + private final ApiTracerFactory tracerFactory; + private final SpanName spanName; + private final boolean allowNoResponse; + + public BigtableUnaryOperationCallable( + ServerStreamingCallable inner, + ApiCallContext defaultCallContext, + ApiTracerFactory tracerFactory, + SpanName spanName, + boolean allowNoResponse) { + this.inner = inner; + this.defaultCallContext = defaultCallContext; + this.tracerFactory = tracerFactory; + this.spanName = spanName; + this.allowNoResponse = allowNoResponse; + } + + @Override + public ApiFuture futureCall(ReqT req, ApiCallContext apiCallContext) { + apiCallContext = defaultCallContext.merge(apiCallContext); + + BigtableTracer apiTracer = + (BigtableTracer) + tracerFactory.newTracer( + apiCallContext.getTracer(), spanName, ApiTracerFactory.OperationType.Unary); + + apiCallContext = apiCallContext.withTracer(apiTracer); + + UnaryFuture f = new UnaryFuture(apiTracer, allowNoResponse); + inner.call(req, f, apiCallContext); + return f; + } + + class UnaryFuture extends AbstractApiFuture implements ResponseObserver { + private final BigtableTracer tracer; + private final boolean allowNoResponse; + + private StreamController controller; + private final AtomicBoolean upstreamCancelled = new AtomicBoolean(); + + private UnaryFuture(BigtableTracer tracer, boolean allowNoResponse) { + this.tracer = Preconditions.checkNotNull(tracer, "tracer can't be null"); + this.allowNoResponse = allowNoResponse; + } + + @Override + public void onStart(StreamController controller) { + this.controller = controller; + controller.disableAutoInboundFlowControl(); + // Request 2 to detect protocol bugs + controller.request(2); + } + + /** + * Immediately cancel the future state and try to cancel the underlying operation. Will return + * false if the future is already resolved. + */ + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + if (super.cancel(mayInterruptIfRunning)) { + cancelUpstream(); + return true; + } + return false; + } + + private void cancelUpstream() { + if (upstreamCancelled.compareAndSet(false, true)) { + controller.cancel(); + } + } + + @Override + public void onResponse(RespT resp) { + tracer.responseReceived(); + + if (set(resp)) { + tracer.operationFinishEarly(); + return; + } + + // At this point we are guaranteed that the future has been resolved. However we need to check + // why. + // We know it's not because it was resolved with the current response. Moreover, since the + // future + // is resolved, our only means to flag the error is to log. + // So there are 3 possibilities: + // 1. user cancelled the future + // 2. this is an extra response and the previous one resolved the future + // 3. we got a response after the rpc failed (this should never happen and would be a bad bug) + + if (isCancelled()) { + return; + } + + try { + RespT prev = Futures.getDone(this); + String msg = + String.format( + "Received response after future is resolved for a %s unary operation. previous: %s," + + " New response: %s", + spanName, prev, resp); + logger.log(Level.WARNING, msg); + } catch (ExecutionException e) { + // Should never happen + String msg = + String.format( + "Received response after future resolved as a failure for a %s unary operation. New" + + " response: %s", + spanName, resp); + logger.log(Level.WARNING, msg, e.getCause()); + } + + cancelUpstream(); + } + + @Override + public void onError(Throwable throwable) { + if (this.setException(throwable)) { + tracer.operationFailed(throwable); + } else if (isCancelled()) { + tracer.operationCancelled(); + } else { + // At this point the has been resolved, so we ignore the error + tracer.operationSucceeded(); + } + } + + @Override + public void onComplete() { + if (allowNoResponse && set(null)) { + tracer.operationSucceeded(); + return; + + // Under normal circumstances the future wouldve been resolved in onResponse or via + // set(null) if it expected for + // the rpc to not have a response. So if aren't done, the only reason is that we didn't get + // a response + // but were expecting one + } else if (!isDone()) { + String msg = spanName + " unary operation completed without a response message"; + InternalException e = + new InternalException(msg, null, GrpcStatusCode.of(Status.Code.INTERNAL), false); + + if (setException(e)) { + tracer.operationFailed(e); + return; + } + } + + // check cancellation race + if (isCancelled()) { + tracer.operationCancelled(); + return; + } + + tracer.operationSucceeded(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ClientOperationSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ClientOperationSettings.java new file mode 100644 index 000000000000..540eb08cc8bd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ClientOperationSettings.java @@ -0,0 +1,406 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor; +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import java.util.List; +import java.util.Set; +import org.threeten.bp.Duration; + +@InternalApi +public class ClientOperationSettings { + private static final Set IDEMPOTENT_RETRY_CODES = + ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE); + + // Copy of default retrying settings in the yaml + private static final RetrySettings IDEMPOTENT_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setInitialRpcTimeout(Duration.ofSeconds(20)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofSeconds(20)) + .setTotalTimeout(Duration.ofMinutes(10)) + .build(); + + // Allow retrying ABORTED statuses. These will be returned by the server when the client is + // too slow to read the rows. This makes sense for the java client because retries happen + // after the row merging logic. Which means that the retry will not be invoked until the + // current buffered chunks are consumed. + private static final Set READ_ROWS_RETRY_CODES = + ImmutableSet.builder() + .addAll(IDEMPOTENT_RETRY_CODES) + .add(StatusCode.Code.ABORTED) + .build(); + + // Priming request should have a shorter timeout + private static final Duration PRIME_REQUEST_TIMEOUT = Duration.ofSeconds(30); + + private static final RetrySettings READ_ROWS_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(10) + .setInitialRpcTimeout(Duration.ofMinutes(30)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMinutes(30)) + .setTotalTimeout(Duration.ofHours(12)) + .build(); + + private static final RetrySettings MUTATE_ROWS_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setInitialRpcTimeout(Duration.ofMinutes(1)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMinutes(1)) + .setTotalTimeout(Duration.ofMinutes(10)) + .build(); + + private static final Set GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS_RETRY_CODES = + ImmutableSet.builder() + .addAll(IDEMPOTENT_RETRY_CODES) + .add(StatusCode.Code.ABORTED) + .build(); + + private static final RetrySettings GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(10) + .setInitialRpcTimeout(Duration.ofMinutes(1)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMinutes(10)) + .setTotalTimeout(Duration.ofMinutes(60)) + .build(); + + // Allow retrying ABORTED statuses. These will be returned by the server when the client is + // too slow to read the change stream records. This makes sense for the java client because + // retries happen after the mutation merging logic. Which means that the retry will not be + // invoked until the current buffered change stream mutations are consumed. + private static final Set READ_CHANGE_STREAM_RETRY_CODES = + ImmutableSet.builder() + .addAll(IDEMPOTENT_RETRY_CODES) + .add(StatusCode.Code.ABORTED) + .build(); + + private static final RetrySettings READ_CHANGE_STREAM_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(10) + .setInitialRpcTimeout(Duration.ofMinutes(5)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMinutes(5)) + .setTotalTimeout(Duration.ofHours(12)) + .build(); + + // Allow retrying ABORTED statuses. These will be returned by the server when the client is + // too slow to read the responses. + private static final Set EXECUTE_QUERY_RETRY_CODES = + ImmutableSet.builder() + .addAll(IDEMPOTENT_RETRY_CODES) + .add(StatusCode.Code.ABORTED) + .build(); + + // We use the same configuration as READ_ROWS + private static final RetrySettings EXECUTE_QUERY_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(10) + .setInitialRpcTimeout(Duration.ofMinutes(30)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMinutes(30)) + .setTotalTimeout(Duration.ofHours(12)) + .build(); + + // Similar to IDEMPOTENT but with a lower initial rpc timeout since we expect + // these calls to be quick in most circumstances + private static final RetrySettings PREPARE_QUERY_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2) + .setMaxRetryDelay(Duration.ofMinutes(1)) + // TODO: fix the settings: initial attempt deadline: 5s, max is 20s but multiplier is 1 + .setInitialRpcTimeout(Duration.ofSeconds(5)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofSeconds(20)) + .setTotalTimeout(Duration.ofMinutes(10)) + .build(); + + final ServerStreamingCallSettings readRowsSettings; + final UnaryCallSettings readRowSettings; + final UnaryCallSettings> sampleRowKeysSettings; + final UnaryCallSettings mutateRowSettings; + final BigtableBatchingCallSettings bulkMutateRowsSettings; + final BigtableBulkReadRowsCallSettings bulkReadRowsSettings; + final UnaryCallSettings checkAndMutateRowSettings; + final UnaryCallSettings readModifyWriteRowSettings; + final ServerStreamingCallSettings + generateInitialChangeStreamPartitionsSettings; + final ServerStreamingCallSettings + readChangeStreamSettings; + final UnaryCallSettings pingAndWarmSettings; + final ServerStreamingCallSettings executeQuerySettings; + final UnaryCallSettings prepareQuerySettings; + + ClientOperationSettings(Builder builder) { + // Since point reads, streaming reads, bulk reads share the same base callable that converts + // grpc errors into ApiExceptions, they must have the same retry codes. + Preconditions.checkState( + builder + .readRowSettings + .getRetryableCodes() + .equals(builder.readRowsSettings.getRetryableCodes()), + "Single ReadRow retry codes must match ReadRows retry codes"); + Preconditions.checkState( + builder + .bulkReadRowsSettings + .getRetryableCodes() + .equals(builder.readRowsSettings.getRetryableCodes()), + "Bulk ReadRow retry codes must match ReadRows retry codes"); + + // Per method settings. + readRowsSettings = builder.readRowsSettings.build(); + readRowSettings = builder.readRowSettings.build(); + sampleRowKeysSettings = builder.sampleRowKeysSettings.build(); + mutateRowSettings = builder.mutateRowSettings.build(); + bulkMutateRowsSettings = builder.bulkMutateRowsSettings.build(); + bulkReadRowsSettings = builder.bulkReadRowsSettings.build(); + checkAndMutateRowSettings = builder.checkAndMutateRowSettings.build(); + readModifyWriteRowSettings = builder.readModifyWriteRowSettings.build(); + generateInitialChangeStreamPartitionsSettings = + builder.generateInitialChangeStreamPartitionsSettings.build(); + readChangeStreamSettings = builder.readChangeStreamSettings.build(); + pingAndWarmSettings = builder.pingAndWarmSettings.build(); + executeQuerySettings = builder.executeQuerySettings.build(); + prepareQuerySettings = builder.prepareQuerySettings.build(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("readRowsSettings", readRowsSettings) + .add("readRowSettings", readRowSettings) + .add("sampleRowKeysSettings", sampleRowKeysSettings) + .add("mutateRowSettings", mutateRowSettings) + .add("bulkMutateRowsSettings", bulkMutateRowsSettings) + .add("bulkReadRowsSettings", bulkReadRowsSettings) + .add("checkAndMutateRowSettings", checkAndMutateRowSettings) + .add("readModifyWriteRowSettings", readModifyWriteRowSettings) + .add( + "generateInitialChangeStreamPartitionsSettings", + generateInitialChangeStreamPartitionsSettings) + .add("readChangeStreamSettings", readChangeStreamSettings) + .add("pingAndWarmSettings", pingAndWarmSettings) + .add("executeQuerySettings", executeQuerySettings) + .add("prepareQuerySettings", prepareQuerySettings) + .toString(); + } + + static class Builder { + ServerStreamingCallSettings.Builder readRowsSettings; + UnaryCallSettings.Builder readRowSettings; + UnaryCallSettings.Builder> sampleRowKeysSettings; + UnaryCallSettings.Builder mutateRowSettings; + BigtableBatchingCallSettings.Builder bulkMutateRowsSettings; + BigtableBulkReadRowsCallSettings.Builder bulkReadRowsSettings; + UnaryCallSettings.Builder checkAndMutateRowSettings; + UnaryCallSettings.Builder readModifyWriteRowSettings; + ServerStreamingCallSettings.Builder + generateInitialChangeStreamPartitionsSettings; + ServerStreamingCallSettings.Builder + readChangeStreamSettings; + UnaryCallSettings.Builder pingAndWarmSettings; + ServerStreamingCallSettings.Builder executeQuerySettings; + UnaryCallSettings.Builder prepareQuerySettings; + + Builder() { + BigtableStubSettings.Builder baseDefaults = BigtableStubSettings.newBuilder(); + + readRowsSettings = ServerStreamingCallSettings.newBuilder(); + + readRowsSettings + .setRetryableCodes(READ_ROWS_RETRY_CODES) + .setRetrySettings(READ_ROWS_RETRY_SETTINGS) + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(Duration.ofMinutes(5)); + + readRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + readRowSettings + .setRetryableCodes(readRowsSettings.getRetryableCodes()) + .setRetrySettings(IDEMPOTENT_RETRY_SETTINGS); + + sampleRowKeysSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + sampleRowKeysSettings + .setRetryableCodes(IDEMPOTENT_RETRY_CODES) + .setRetrySettings( + IDEMPOTENT_RETRY_SETTINGS.toBuilder() + .setInitialRpcTimeout(Duration.ofMinutes(5)) + .setMaxRpcTimeout(Duration.ofMinutes(5)) + .build()); + + mutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyRetrySettings(baseDefaults.mutateRowSettings(), mutateRowSettings); + + long maxBulkMutateElementPerBatch = 100L; + long maxBulkMutateOutstandingElementCount = 20_000L; + + bulkMutateRowsSettings = + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) + .setRetryableCodes(IDEMPOTENT_RETRY_CODES) + .setRetrySettings(MUTATE_ROWS_RETRY_SETTINGS) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setIsEnabled(true) + .setElementCountThreshold(maxBulkMutateElementPerBatch) + .setRequestByteThreshold(20L * 1024 * 1024) + .setDelayThreshold(Duration.ofSeconds(1)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Block) + .setMaxOutstandingRequestBytes(100L * 1024 * 1024) + .setMaxOutstandingElementCount(maxBulkMutateOutstandingElementCount) + .build()) + .build()); + + long maxBulkReadElementPerBatch = 100L; + long maxBulkReadRequestSizePerBatch = 400L * 1024L; + long maxBulkReadOutstandingElementCount = 20_000L; + + bulkReadRowsSettings = + BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()) + .setRetryableCodes(readRowsSettings.getRetryableCodes()) + .setRetrySettings(IDEMPOTENT_RETRY_SETTINGS) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(maxBulkReadElementPerBatch) + .setRequestByteThreshold(maxBulkReadRequestSizePerBatch) + .setDelayThreshold(Duration.ofSeconds(1)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Block) + .setMaxOutstandingElementCount(maxBulkReadOutstandingElementCount) + .build()) + .build()); + + checkAndMutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyRetrySettings(baseDefaults.checkAndMutateRowSettings(), checkAndMutateRowSettings); + + readModifyWriteRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyRetrySettings(baseDefaults.readModifyWriteRowSettings(), readModifyWriteRowSettings); + + generateInitialChangeStreamPartitionsSettings = ServerStreamingCallSettings.newBuilder(); + generateInitialChangeStreamPartitionsSettings + .setRetryableCodes(GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS_RETRY_CODES) + .setRetrySettings(GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS_RETRY_SETTINGS) + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(Duration.ofMinutes(1)); + + readChangeStreamSettings = ServerStreamingCallSettings.newBuilder(); + readChangeStreamSettings + .setRetryableCodes(READ_CHANGE_STREAM_RETRY_CODES) + .setRetrySettings(READ_CHANGE_STREAM_RETRY_SETTINGS) + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(Duration.ofMinutes(1)); + + pingAndWarmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pingAndWarmSettings.setRetrySettings( + RetrySettings.newBuilder() + .setMaxAttempts(1) + .setInitialRpcTimeout(PRIME_REQUEST_TIMEOUT) + .setMaxRpcTimeout(PRIME_REQUEST_TIMEOUT) + .setTotalTimeout(PRIME_REQUEST_TIMEOUT) + .build()); + + executeQuerySettings = ServerStreamingCallSettings.newBuilder(); + executeQuerySettings + .setRetryableCodes(EXECUTE_QUERY_RETRY_CODES) + .setRetrySettings(EXECUTE_QUERY_RETRY_SETTINGS) + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(Duration.ofMinutes(5)); + + prepareQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + prepareQuerySettings + .setRetryableCodes(IDEMPOTENT_RETRY_CODES) + .setRetrySettings(PREPARE_QUERY_RETRY_SETTINGS); + } + + Builder(ClientOperationSettings settings) { + readRowsSettings = settings.readRowsSettings.toBuilder(); + readRowSettings = settings.readRowSettings.toBuilder(); + sampleRowKeysSettings = settings.sampleRowKeysSettings.toBuilder(); + mutateRowSettings = settings.mutateRowSettings.toBuilder(); + bulkMutateRowsSettings = settings.bulkMutateRowsSettings.toBuilder(); + bulkReadRowsSettings = settings.bulkReadRowsSettings.toBuilder(); + checkAndMutateRowSettings = settings.checkAndMutateRowSettings.toBuilder(); + readModifyWriteRowSettings = settings.readModifyWriteRowSettings.toBuilder(); + generateInitialChangeStreamPartitionsSettings = + settings.generateInitialChangeStreamPartitionsSettings.toBuilder(); + readChangeStreamSettings = settings.readChangeStreamSettings.toBuilder(); + pingAndWarmSettings = settings.pingAndWarmSettings.toBuilder(); + executeQuerySettings = settings.executeQuerySettings.toBuilder(); + prepareQuerySettings = settings.prepareQuerySettings.toBuilder(); + } + + /** + * Copies settings from unary RPC to another. This is necessary when modifying request and + * response types while trying to retain retry settings. + */ + private static void copyRetrySettings( + UnaryCallSettings.Builder source, UnaryCallSettings.Builder dest) { + dest.setRetryableCodes(source.getRetryableCodes()); + dest.setRetrySettings(source.getRetrySettings()); + } + + ClientOperationSettings build() { + return new ClientOperationSettings(this); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java new file mode 100644 index 000000000000..ca99ebd02b26 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java @@ -0,0 +1,112 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.common.base.Throwables; +import java.util.Locale; + +/** + * This callable converts the "Received rst stream" exception into a retryable {@link ApiException}. + */ +final class ConvertExceptionCallable + extends ServerStreamingCallable { + + private final ServerStreamingCallable innerCallable; + + public ConvertExceptionCallable(ServerStreamingCallable innerCallable) { + this.innerCallable = innerCallable; + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + ConvertExceptionResponseObserver observer = + new ConvertExceptionResponseObserver<>(responseObserver); + innerCallable.call(request, observer, context); + } + + private static class ConvertExceptionResponseObserver + extends SafeResponseObserver { + + private final ResponseObserver outerObserver; + + ConvertExceptionResponseObserver(ResponseObserver outerObserver) { + super(outerObserver); + this.outerObserver = outerObserver; + } + + @Override + protected void onStartImpl(StreamController controller) { + outerObserver.onStart(controller); + } + + @Override + protected void onResponseImpl(ResponseT response) { + outerObserver.onResponse(response); + } + + @Override + protected void onErrorImpl(Throwable t) { + outerObserver.onError(convertException(t)); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + } + + private static Throwable convertException(Throwable t) { + // Long lived connections sometimes are disconnected via an RST frame or a goaway. These errors + // are transient and should be retried. + if (isRstStreamError(t) || isGoAway(t) || isRetriableAuthError(t)) { + return new InternalException(t, ((InternalException) t).getStatusCode(), true); + } + return t; + } + + private static boolean isRetriableAuthError(Throwable t) { + if (t instanceof InternalException && t.getMessage() != null) { + String error = t.getMessage(); + return error.contains("Authentication backend internal server error. Please retry"); + } + return false; + } + + private static boolean isRstStreamError(Throwable t) { + if (t instanceof InternalException && t.getMessage() != null) { + String error = t.getMessage().toLowerCase(Locale.ENGLISH); + return error.contains("rst_stream") || error.contains("rst stream"); + } + return false; + } + + private static boolean isGoAway(Throwable t) { + if (t instanceof InternalException) { + Throwable rootCause = Throwables.getRootCause(t); + String rootCauseMessage = rootCause.getMessage(); + return rootCauseMessage != null + && rootCauseMessage.contains("Stream closed before write could take place"); + } + return false; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolder.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolder.java new file mode 100644 index 000000000000..7a153cfd5fb6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import io.grpc.CallOptions; +import io.grpc.Metadata; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +/** A cookie that holds information for retry or routing */ +class CookiesHolder { + + static final CallOptions.Key COOKIES_HOLDER_KEY = + CallOptions.Key.create("bigtable-cookies"); + + /** Routing cookie key prefix. */ + static final String COOKIE_KEY_PREFIX = "x-goog-cbt-cookie"; + + /** A map that stores all the routing cookies. */ + private final Map, String> cookies = new HashMap<>(); + + /** Returns CookiesHolder if presents in CallOptions, otherwise returns null. */ + @Nullable + static CookiesHolder fromCallOptions(CallOptions options) { + // CookiesHolder should be added by CookiesServerStreamingCallable and + // CookiesUnaryCallable for most methods. However, methods like PingAndWarm + // doesn't support routing cookie, in which case this will return null. + return options.getOption(COOKIES_HOLDER_KEY); + } + + /** Add all the routing cookies to headers if any. */ + Metadata injectCookiesInRequestHeaders(Metadata headers) { + for (Metadata.Key key : cookies.keySet()) { + headers.put(key, cookies.get(key)); + } + return headers; + } + + /** + * Iterate through all the keys in initial or trailing metadata, and add all the keys that match + * COOKIE_KEY_PREFIX to cookies. Values in trailers will override the value set in initial + * metadata for the same keys. + */ + void extractCookiesFromMetadata(@Nullable Metadata metadata) { + if (metadata == null) { + return; + } + for (String key : metadata.keys()) { + if (key.startsWith(COOKIE_KEY_PREFIX)) { + Metadata.Key metadataKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + String value = metadata.get(metadataKey); + cookies.put(metadataKey, value); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesInterceptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesInterceptor.java new file mode 100644 index 000000000000..77387851fabd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesInterceptor.java @@ -0,0 +1,96 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * A cookie interceptor that checks the cookie value from returned trailer, updates the cookie + * holder, and inject it in the header of the next request. + */ +class CookiesInterceptor implements ClientInterceptor { + + private static final Logger LOG = Logger.getLogger(CookiesInterceptor.class.getName()); + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + // Gets the CookiesHolder added from CookiesServerStreamingCallable and + // CookiesUnaryCallable. + // Add CookiesHolder content to request headers if there's any. + try { + CookiesHolder cookie = CookiesHolder.fromCallOptions(callOptions); + if (cookie != null) { + headers = cookie.injectCookiesInRequestHeaders(headers); + responseListener = new UpdateCookieListener<>(responseListener, cookie); + } + } catch (Throwable e) { + LOG.warning("Failed to inject cookie to request headers: " + e); + } finally { + super.start(responseListener, headers); + } + } + }; + } + + /** Add headers and trailers to CookiesHolder if there's any. * */ + static class UpdateCookieListener + extends ForwardingClientCallListener.SimpleForwardingClientCallListener { + + private final CookiesHolder cookie; + + UpdateCookieListener(ClientCall.Listener delegate, CookiesHolder cookiesHolder) { + super(delegate); + this.cookie = cookiesHolder; + } + + @Override + public void onHeaders(Metadata headers) { + try { + cookie.extractCookiesFromMetadata(headers); + } catch (Throwable e) { + LOG.log(Level.WARNING, "Failed to extract cookie from response headers.", e); + } finally { + super.onHeaders(headers); + } + } + + @Override + public void onClose(Status status, Metadata trailers) { + try { + cookie.extractCookiesFromMetadata(trailers); + } catch (Throwable e) { + LOG.log(Level.WARNING, "Failed to extract cookie from response trailers.", e); + } finally { + super.onClose(status, trailers); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesServerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesServerStreamingCallable.java new file mode 100644 index 000000000000..0d012b8ea061 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesServerStreamingCallable.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.stub.CookiesHolder.COOKIES_HOLDER_KEY; + +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; + +/** + * The cookie holder will act as operation scoped storage for all retry attempts. Each attempt's + * cookies will be merged into the value holder and will be sent out with the next retry attempt. + */ +class CookiesServerStreamingCallable + extends ServerStreamingCallable { + + private final ServerStreamingCallable callable; + + CookiesServerStreamingCallable(ServerStreamingCallable innerCallable) { + this.callable = innerCallable; + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + GrpcCallContext grpcCallContext = (GrpcCallContext) context; + callable.call( + request, + responseObserver, + grpcCallContext.withCallOptions( + grpcCallContext.getCallOptions().withOption(COOKIES_HOLDER_KEY, new CookiesHolder()))); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesUnaryCallable.java new file mode 100644 index 000000000000..b0d42d59552a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesUnaryCallable.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.stub.CookiesHolder.COOKIES_HOLDER_KEY; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; + +/** + * The cookie holder will act as operation scoped storage for all retry attempts. Each attempt's + * cookies will be merged into the value holder and will be sent out with the next retry attempt. + */ +class CookiesUnaryCallable extends UnaryCallable { + private final UnaryCallable innerCallable; + + CookiesUnaryCallable(UnaryCallable callable) { + this.innerCallable = callable; + } + + @Override + public ApiFuture futureCall(RequestT request, ApiCallContext context) { + GrpcCallContext grpcCallContext = (GrpcCallContext) context; + return innerCallable.futureCall( + request, + grpcCallContext.withCallOptions( + grpcCallContext.getCallOptions().withOption(COOKIES_HOLDER_KEY, new CookiesHolder()))); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java new file mode 100644 index 000000000000..8b89a0964732 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java @@ -0,0 +1,172 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import static java.lang.Math.round; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.gax.batching.FlowControlEventStats.FlowControlEvent; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.base.Stopwatch; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; + +/** + * A callable that records rpc latency and adjusts flow control thresholds for latency based + * throttling. + */ +final class DynamicFlowControlCallable extends UnaryCallable { + // Defining adjusting criteria and adjusting rates + // Latency thresholds multipliers that will trigger flow control changes + static final double VERY_HIGH_LATENCY_MULTIPLIER = 3; + // targeting roughly 20% around target latency so there isn't too much churn + static final double HIGH_LATENCY_MULTIPLIER = 1.2; + static final double LOW_LATENCY_MULTIPLIER = 0.8; + static final double LOW_CONCURRENCY_MULTIPLIER = 0.05; + static final double LOW_CONCURRENCY_LATENCY_MULTIPLIER = 2; + // Rate of change that corresponds to the the thresholds above + static final double VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE = 0.3; + static final double HIGH_LATENCY_DECREASE_CONCURRENCY_RATE = 0.1; + // Increase parallelism at a slower rate than decrease. The lower rate should help the system + // maintain stability. + static final double LOW_LATENCY_INCREASE_CONCURRENCY_RATE = 0.05; + static final double LOW_CONCURRENCY_INCREASE_CONCURRENCY_RATE = 0.02; + // only look for throttling events in the past 5 minutes + static final long THROTTLING_EVENT_TIME_RANGE_MS = TimeUnit.MINUTES.toMillis(5); + + private final FlowController flowController; + private final DynamicFlowControlStats dynamicFlowControlStats; + private final long targetLatencyMs; + private final long adjustingIntervalMs; + private final UnaryCallable innerCallable; + + DynamicFlowControlCallable( + @Nonnull UnaryCallable innerCallable, + @Nonnull FlowController flowController, + @Nonnull DynamicFlowControlStats stats, + long targetLatencyMs, + long adjustingIntervalMs) { + this.innerCallable = innerCallable; + this.flowController = flowController; + this.dynamicFlowControlStats = stats; + this.targetLatencyMs = targetLatencyMs; + this.adjustingIntervalMs = adjustingIntervalMs; + } + + @Override + public ApiFuture futureCall(Object request, ApiCallContext context) { + final Runnable flowControllerRunnable = new DynamicFlowControlRunnable(); + ApiFuture future = innerCallable.futureCall(request, context); + ApiFutures.addCallback( + future, + new ApiFutureCallback() { + @Override + public void onFailure(Throwable t) { + // If the deadline expired before the operation could complete, it could mean that the + // server side is slow, and we should record the latency so flow control limits can be + // adjusted. Other errors might be user errors and may return immediately, so we're + // skipping recording the latencies for those. + if (t instanceof DeadlineExceededException) { + flowControllerRunnable.run(); + } + } + + @Override + public void onSuccess(Object result) { + flowControllerRunnable.run(); + } + }, + MoreExecutors.directExecutor()); + return future; + } + + class DynamicFlowControlRunnable implements Runnable { + private final Stopwatch timer; + + DynamicFlowControlRunnable() { + timer = Stopwatch.createStarted(); + } + + @Override + public void run() { + dynamicFlowControlStats.updateLatency(timer.elapsed(TimeUnit.MILLISECONDS)); + long lastAdjustedTimestamp = dynamicFlowControlStats.getLastAdjustedTimestampMs(); + long now = System.currentTimeMillis(); + // Avoid adjusting the thresholds too frequently + if (now - lastAdjustedTimestamp < adjustingIntervalMs) { + return; + } + double meanLatency = dynamicFlowControlStats.getMeanLatency(); + FlowControlEvent flowControlEvent = + flowController.getFlowControlEventStats().getLastFlowControlEvent(); + boolean wasRecentlyThrottled = + flowControlEvent != null + && (now - flowControlEvent.getTimestampMs() <= THROTTLING_EVENT_TIME_RANGE_MS); + long maxElementLimit = flowController.getMaxElementCountLimit(); + if (meanLatency > targetLatencyMs * VERY_HIGH_LATENCY_MULTIPLIER) { + // Decrease at 30% of the maximum + decrease( + lastAdjustedTimestamp, + now, + round(maxElementLimit * VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE)); + } else if (meanLatency > targetLatencyMs * HIGH_LATENCY_MULTIPLIER) { + // Decrease at 10% of the maximum + decrease( + lastAdjustedTimestamp, + now, + round(maxElementLimit * HIGH_LATENCY_DECREASE_CONCURRENCY_RATE)); + } else if (wasRecentlyThrottled && meanLatency < targetLatencyMs * LOW_LATENCY_MULTIPLIER) { + // If latency is low, and there was throttling, then increase the parallelism so that new + // calls will not be throttled. + + // Increase parallelism at a slower than we decrease. The lower rate should help the + // system maintain stability. + increase( + lastAdjustedTimestamp, + now, + round(maxElementLimit * LOW_LATENCY_INCREASE_CONCURRENCY_RATE)); + } else if (wasRecentlyThrottled + && flowController.getCurrentElementCountLimit() + < maxElementLimit * LOW_CONCURRENCY_MULTIPLIER + && meanLatency < targetLatencyMs * LOW_CONCURRENCY_LATENCY_MULTIPLIER) { + // When parallelism is reduced latency tends to be artificially higher. + // Increase slowly to ensure that the system restabilizes. + increase( + lastAdjustedTimestamp, + now, + round(maxElementLimit * LOW_CONCURRENCY_INCREASE_CONCURRENCY_RATE)); + } + } + + private void decrease(long last, long now, long elementSteps) { + if (dynamicFlowControlStats.setLastAdjustedTimestampMs(last, now)) { + flowController.decreaseThresholds(elementSteps, 0); + } + } + + private void increase(long last, long now, long elementSteps) { + if (dynamicFlowControlStats.setLastAdjustedTimestampMs(last, now)) { + flowController.increaseThresholds(elementSteps, 0); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStats.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStats.java new file mode 100644 index 000000000000..6f656a1f92e5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStats.java @@ -0,0 +1,117 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiClock; +import com.google.api.core.InternalApi; +import com.google.api.core.NanoClock; +import com.google.api.gax.batching.FlowController; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Records stats used in dynamic flow control, the decaying average of recorded latencies and the + * last timestamp when the thresholds in {@link FlowController} are updated. + * + *
    Exponential decaying average = weightedSum / weightedCount, where
    + *   weightedSum(n) = weight(n) * value(n) + weightedSum(n - 1)
    + *   weightedCount(n) = weight(n) + weightedCount(n - 1),
    + * and weight(n) grows exponentially over elapsed time. Biased to the past 5 minutes.
    + */
    +final class DynamicFlowControlStats {
    +
    +  // Biased to the past 5 minutes (300 seconds), e^(-decay_constant * 300) = 0.01, decay_constant ~=
    +  // 0.015
    +  private static final double DEFAULT_DECAY_CONSTANT = 0.015;
    +  // Update decay cycle start time every 15 minutes so the values won't be infinite
    +  private static final long DECAY_CYCLE_SECOND = TimeUnit.MINUTES.toSeconds(15);
    +
    +  private final AtomicLong lastAdjustedTimestampMs;
    +  private final DecayingAverage meanLatency;
    +
    +  DynamicFlowControlStats() {
    +    this(DEFAULT_DECAY_CONSTANT, NanoClock.getDefaultClock());
    +  }
    +
    +  @InternalApi("visible for testing")
    +  DynamicFlowControlStats(double decayConstant, ApiClock clock) {
    +    this.lastAdjustedTimestampMs = new AtomicLong(0);
    +    this.meanLatency = new DecayingAverage(decayConstant, clock);
    +  }
    +
    +  void updateLatency(long latency) {
    +    meanLatency.update(latency);
    +  }
    +
    +  /** Return the mean calculated from the last update, will not decay over time. */
    +  double getMeanLatency() {
    +    return meanLatency.getMean();
    +  }
    +
    +  public long getLastAdjustedTimestampMs() {
    +    return lastAdjustedTimestampMs.get();
    +  }
    +
    +  boolean setLastAdjustedTimestampMs(long last, long now) {
    +    return lastAdjustedTimestampMs.compareAndSet(last, now);
    +  }
    +
    +  private static class DecayingAverage {
    +    private double decayConstant;
    +    private double mean;
    +    private double weightedCount;
    +    private long decayCycleStartEpoch;
    +    private final ApiClock clock;
    +
    +    DecayingAverage(double decayConstant, ApiClock clock) {
    +      this.decayConstant = decayConstant;
    +      this.mean = 0.0;
    +      this.weightedCount = 0.0;
    +      this.clock = clock;
    +      this.decayCycleStartEpoch = TimeUnit.MILLISECONDS.toSeconds(clock.millisTime());
    +    }
    +
    +    synchronized void update(long value) {
    +      long now = TimeUnit.MILLISECONDS.toSeconds(clock.millisTime());
    +      double weight = getWeight(now);
    +      // Using weighted count in case the sum overflows.
    +      mean =
    +          mean * (weightedCount / (weightedCount + weight))
    +              + weight * value / (weightedCount + weight);
    +      weightedCount += weight;
    +    }
    +
    +    synchronized double getMean() {
    +      return mean;
    +    }
    +
    +    private double getWeight(long now) {
    +      long elapsedSecond = now - decayCycleStartEpoch;
    +      double weight = Math.exp(decayConstant * elapsedSecond);
    +      // Decay mean, weightedCount and reset decay cycle start epoch every 15 minutes, so the
    +      // values won't be infinite
    +      if (elapsedSecond > DECAY_CYCLE_SECOND) {
    +        mean /= weight;
    +        weightedCount /= weight;
    +        decayCycleStartEpoch = now;
    +        // After resetting start time, weight = e^0 = 1
    +        return 1;
    +      } else {
    +        return weight;
    +      }
    +    }
    +  }
    +}
    diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
    new file mode 100644
    index 000000000000..56b7d634f11a
    --- /dev/null
    +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
    @@ -0,0 +1,1326 @@
    +/*
    + * Copyright 2018 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.cloud.bigtable.data.v2.stub;
    +
    +import com.google.api.core.ApiFuture;
    +import com.google.api.core.BetaApi;
    +import com.google.api.core.InternalApi;
    +import com.google.api.gax.batching.Batcher;
    +import com.google.api.gax.batching.BatcherImpl;
    +import com.google.api.gax.batching.FlowController;
    +import com.google.api.gax.grpc.GrpcCallContext;
    +import com.google.api.gax.grpc.GrpcCallSettings;
    +import com.google.api.gax.grpc.GrpcRawCallableFactory;
    +import com.google.api.gax.retrying.BasicResultRetryAlgorithm;
    +import com.google.api.gax.retrying.ExponentialRetryAlgorithm;
    +import com.google.api.gax.retrying.RetryAlgorithm;
    +import com.google.api.gax.retrying.RetryingExecutorWithContext;
    +import com.google.api.gax.retrying.ScheduledRetryingExecutor;
    +import com.google.api.gax.retrying.SimpleStreamResumptionStrategy;
    +import com.google.api.gax.retrying.StreamResumptionStrategy;
    +import com.google.api.gax.rpc.ApiCallContext;
    +import com.google.api.gax.rpc.Callables;
    +import com.google.api.gax.rpc.ClientContext;
    +import com.google.api.gax.rpc.RequestParamsExtractor;
    +import com.google.api.gax.rpc.ServerStreamingCallSettings;
    +import com.google.api.gax.rpc.ServerStreamingCallable;
    +import com.google.api.gax.rpc.UnaryCallSettings;
    +import com.google.api.gax.rpc.UnaryCallable;
    +import com.google.api.gax.tracing.SpanName;
    +import com.google.api.gax.tracing.TracedServerStreamingCallable;
    +import com.google.api.gax.tracing.TracedUnaryCallable;
    +import com.google.bigtable.v2.BigtableGrpc;
    +import com.google.bigtable.v2.CheckAndMutateRowResponse;
    +import com.google.bigtable.v2.ExecuteQueryRequest;
    +import com.google.bigtable.v2.ExecuteQueryResponse;
    +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest;
    +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse;
    +import com.google.bigtable.v2.MutateRowsRequest;
    +import com.google.bigtable.v2.MutateRowsResponse;
    +import com.google.bigtable.v2.ReadChangeStreamRequest;
    +import com.google.bigtable.v2.ReadChangeStreamResponse;
    +import com.google.bigtable.v2.ReadRowsRequest;
    +import com.google.bigtable.v2.ReadRowsResponse;
    +import com.google.bigtable.v2.RowRange;
    +import com.google.bigtable.v2.SampleRowKeysResponse;
    +import com.google.cloud.bigtable.data.v2.internal.NameUtil;
    +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest;
    +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse;
    +import com.google.cloud.bigtable.data.v2.internal.RequestContext;
    +import com.google.cloud.bigtable.data.v2.internal.SqlRow;
    +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BigtableTracerStreamingCallable;
    +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BigtableTracerUnaryCallable;
    +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.TracedBatcherUnaryCallable;
    +import com.google.cloud.bigtable.data.v2.models.BulkMutation;
    +import com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation;
    +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord;
    +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter;
    +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
    +import com.google.cloud.bigtable.data.v2.models.DefaultChangeStreamRecordAdapter;
    +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter;
    +import com.google.cloud.bigtable.data.v2.models.KeyOffset;
    +import com.google.cloud.bigtable.data.v2.models.Query;
    +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange;
    +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery;
    +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
    +import com.google.cloud.bigtable.data.v2.models.Row;
    +import com.google.cloud.bigtable.data.v2.models.RowAdapter;
    +import com.google.cloud.bigtable.data.v2.models.RowMutation;
    +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry;
    +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest;
    +import com.google.cloud.bigtable.data.v2.models.TableId;
    +import com.google.cloud.bigtable.data.v2.models.TargetId;
    +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement;
    +import com.google.cloud.bigtable.data.v2.stub.changestream.ChangeStreamRecordMergingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.changestream.GenerateInitialChangeStreamPartitionsUserCallable;
    +import com.google.cloud.bigtable.data.v2.stub.changestream.ReadChangeStreamResumptionStrategy;
    +import com.google.cloud.bigtable.data.v2.stub.changestream.ReadChangeStreamUserCallable;
    +import com.google.cloud.bigtable.data.v2.stub.metrics.StatsHeadersServerStreamingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.metrics.StatsHeadersUnaryCallable;
    +import com.google.cloud.bigtable.data.v2.stub.mutaterows.BulkMutateRowsUserFacingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsAttemptResult;
    +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor;
    +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsPartialErrorRetryAlgorithm;
    +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsRetryingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.FilterMarkerRowsCallable;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.LargeReadRowsResumptionStrategy;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsResumptionStrategy;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsRetryCompletedCallable;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsUserCallable;
    +import com.google.cloud.bigtable.data.v2.stub.readrows.RowMergingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallContext;
    +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable;
    +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryResumptionStrategy;
    +import com.google.cloud.bigtable.data.v2.stub.sql.MetadataErrorHandlingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.sql.PlanRefreshingCallable;
    +import com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMergingCallable;
    +import com.google.cloud.bigtable.gaxx.retrying.RetryInfoRetryAlgorithm;
    +import com.google.common.base.Functions;
    +import com.google.common.base.MoreObjects;
    +import com.google.common.base.Preconditions;
    +import com.google.common.collect.ImmutableMap;
    +import com.google.protobuf.ByteString;
    +import io.grpc.MethodDescriptor;
    +import java.io.IOException;
    +import java.time.Duration;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.concurrent.TimeUnit;
    +import java.util.function.Function;
    +import javax.annotation.Nonnull;
    +import javax.annotation.Nullable;
    +
    +/**
    + * The core client that converts method calls to RPCs.
    + *
    + * 

    This class consists of a set of Callable chains that represent RPC methods. There is a chain + * for each RPC method. Each chain starts with a transformation that takes a protobuf wrapper and + * terminates in a Callable that a gax gRPC callable. This class is meant to be a semantically + * complete facade for the Bigtable data API. However it is not meant to be consumed directly, + * please use {@link com.google.cloud.bigtable.data.v2.BigtableDataClient}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class EnhancedBigtableStub implements AutoCloseable { + + private static final String CLIENT_NAME = "Bigtable"; + private static final long FLOW_CONTROL_ADJUSTING_INTERVAL_MS = TimeUnit.SECONDS.toMillis(20); + private final ClientOperationSettings perOpSettings; + private final BigtableClientContext bigtableClientContext; + + private final RequestContext requestContext; + private final FlowController bulkMutationFlowController; + private final DynamicFlowControlStats bulkMutationDynamicFlowControlStats; + + private final ServerStreamingCallable readRowsCallable; + + private final ServerStreamingCallable skipLargeRowsCallable; + + private final UnaryCallable readRowCallable; + private final UnaryCallable> bulkReadRowsCallable; + @Deprecated private final UnaryCallable> sampleRowKeysCallable; + private final UnaryCallable> + sampleRowKeysCallableWithRequest; + private final UnaryCallable mutateRowCallable; + private final UnaryCallable bulkMutateRowsCallable; + private final UnaryCallable externalBulkMutateRowsCallable; + private final UnaryCallable checkAndMutateRowCallable; + private final UnaryCallable readModifyWriteRowCallable; + + private final ServerStreamingCallable + generateInitialChangeStreamPartitionsCallable; + + private final ServerStreamingCallable + readChangeStreamCallable; + + private final ExecuteQueryCallable executeQueryCallable; + private final UnaryCallable prepareQueryCallable; + + public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings) + throws IOException { + BigtableClientContext bigtableClientContext = BigtableClientContext.create(settings); + return new EnhancedBigtableStub(settings.getPerOpSettings(), bigtableClientContext); + } + + public EnhancedBigtableStub( + ClientOperationSettings perOpSettings, BigtableClientContext clientContext) { + this.perOpSettings = perOpSettings; + this.bigtableClientContext = clientContext; + this.requestContext = RequestContext.create(clientContext.getClientInfo()); + this.bulkMutationFlowController = + new FlowController(perOpSettings.bulkMutateRowsSettings.getDynamicFlowControlSettings()); + this.bulkMutationDynamicFlowControlStats = new DynamicFlowControlStats(); + + readRowsCallable = createReadRowsCallable(new DefaultRowAdapter()); + skipLargeRowsCallable = createSkipLargeRowsCallable(new DefaultRowAdapter()); + readRowCallable = createReadRowCallable(new DefaultRowAdapter()); + bulkReadRowsCallable = createBulkReadRowsCallable(new DefaultRowAdapter()); + sampleRowKeysCallable = createSampleRowKeysCallable(); + sampleRowKeysCallableWithRequest = createSampleRowKeysCallableWithRequest(); + mutateRowCallable = createMutateRowCallable(); + bulkMutateRowsCallable = createMutateRowsBaseCallable(); + externalBulkMutateRowsCallable = + new MutateRowsErrorConverterUnaryCallable(bulkMutateRowsCallable); + checkAndMutateRowCallable = createCheckAndMutateRowCallable(); + readModifyWriteRowCallable = createReadModifyWriteRowCallable(); + generateInitialChangeStreamPartitionsCallable = + createGenerateInitialChangeStreamPartitionsCallable(); + readChangeStreamCallable = + createReadChangeStreamCallable(new DefaultChangeStreamRecordAdapter()); + executeQueryCallable = createExecuteQueryCallable(); + prepareQueryCallable = createPrepareQueryCallable(); + } + + // + + /** + * Creates a callable chain to handle ReadRows RPCs. The chain will: + * + *

      + *
    • Dispatch the RPC with {@link ReadRowsRequest}. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured by the {@code rowAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Filter out marker rows. + *
    + * + *

    NOTE: the caller is responsible for adding tracing & metrics. + */ + @BetaApi("This surface is stable yet it might be removed in the future.") + public ServerStreamingCallable createReadRowsRawCallable( + RowAdapter rowAdapter) { + return createReadRowsBaseCallable(perOpSettings.readRowsSettings, rowAdapter) + .withDefaultCallContext(bigtableClientContext.getClientContext().getDefaultCallContext()); + } + + /** + * Creates a callable chain to handle streaming ReadRows RPCs. The chain will: + * + *

      + *
    • Convert a {@link Query} into a {@link com.google.bigtable.v2.ReadRowsRequest} and + * dispatch the RPC. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured in by the {@code rowAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Filter out marker rows. + *
    • Add tracing & metrics. + *
    + */ + public ServerStreamingCallable createReadRowsCallable( + RowAdapter rowAdapter) { + ServerStreamingCallable readRowsCallable = + createReadRowsBaseCallable(perOpSettings.readRowsSettings, rowAdapter); + + ServerStreamingCallable readRowsUserCallable = + new ReadRowsUserCallable<>(readRowsCallable, requestContext); + + SpanName span = getSpanName("ReadRows"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>( + readRowsUserCallable, + bigtableClientContext.getClientContext().getTracerFactory(), + span); + + return traced.withDefaultCallContext( + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readRowsSettings.getRetrySettings())); + } + + /** + * Creates a callable chain to handle point ReadRows RPCs. The chain will: + * + *
      + *
    • Convert a {@link Query} into a {@link com.google.bigtable.v2.ReadRowsRequest} and + * dispatch the RPC. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured in by the {@code rowAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Filter out marker rows. + *
    • Add tracing & metrics. + *
    + */ + public UnaryCallable createReadRowCallable(RowAdapter rowAdapter) { + ClientContext clientContext = bigtableClientContext.getClientContext(); + + ServerStreamingCallable readRowsCallable = + createReadRowsBaseCallable( + ServerStreamingCallSettings.newBuilder() + .setRetryableCodes(perOpSettings.readRowSettings.getRetryableCodes()) + .setRetrySettings(perOpSettings.readRowSettings.getRetrySettings()) + .setIdleTimeoutDuration(Duration.ZERO) + .setWaitTimeoutDuration(Duration.ZERO) + .build(), + rowAdapter, + new SimpleStreamResumptionStrategy<>()); + ServerStreamingCallable readRowCallable = + new TransformingServerStreamingCallable<>( + readRowsCallable, + (query) -> query.limit(1).toProto(requestContext), + Functions.identity()); + + BigtableUnaryOperationCallable classic = + new BigtableUnaryOperationCallable<>( + readRowCallable, + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readRowSettings.getRetrySettings()), + clientContext.getTracerFactory(), + getSpanName("ReadRow"), + /* allowNoResponse= */ true); + + return bigtableClientContext + .getSessionShim() + .decorateReadRow(classic, rowAdapter, perOpSettings.readRowSettings); + } + + private ServerStreamingCallable createReadRowsBaseCallable( + ServerStreamingCallSettings readRowsSettings, RowAdapter rowAdapter) { + return createReadRowsBaseCallable( + readRowsSettings, rowAdapter, new ReadRowsResumptionStrategy(rowAdapter)); + } + + /** + * Creates a callable chain to handle ReadRows RPCs. The chain will: + * + *
      + *
    • Dispatch the RPC with {@link ReadRowsRequest}. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured by the {@code rowAdapter} parameter. + *
    • Add bigtable tracer for tracking bigtable specific metrics. + *
    • Retry/resume on failure. + *
    • Filter out marker rows. + *
    + * + *

    NOTE: the caller is responsible for adding tracing & metrics. + */ + private ServerStreamingCallable createReadRowsBaseCallable( + ServerStreamingCallSettings readRowsSettings, + RowAdapter rowAdapter, + StreamResumptionStrategy resumptionStrategy) { + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getReadRowsMethod()) + .setParamsExtractor( + r -> + composeRequestParams( + r.getAppProfileId(), r.getTableName(), r.getAuthorizedViewName())) + .build(), + readRowsSettings.getRetryableCodes()); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(base); + + // Sometimes ReadRows connections are disconnected via an RST frame. This error is transient and + // should be treated similar to UNAVAILABLE. However, this exception has an INTERNAL error code + // which by default is not retryable. Convert the exception so it can be retried in the client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(withStatsHeaders); + + ServerStreamingCallable merging = + new RowMergingCallable<>(convertException, rowAdapter); + + // Copy settings for the middle ReadRowsRequest -> RowT callable (as opposed to the inner + // ReadRowsRequest -> ReadRowsResponse callable). + ServerStreamingCallSettings innerSettings = + ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy(resumptionStrategy) + .setRetryableCodes(readRowsSettings.getRetryableCodes()) + .setRetrySettings(readRowsSettings.getRetrySettings()) + .setIdleTimeout(readRowsSettings.getIdleTimeout()) + .setWaitTimeout(readRowsSettings.getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(merging, innerSettings, bigtableClientContext.getClientContext()); + + ServerStreamingCallable withBigtableTracer = + new BigtableTracerStreamingCallable<>(watched); + + // Retry logic is split into 2 parts to workaround a rare edge case described in + // ReadRowsRetryCompletedCallable + ServerStreamingCallable retrying1 = + new ReadRowsRetryCompletedCallable<>(withBigtableTracer); + + ServerStreamingCallable retrying2 = + withRetries(retrying1, innerSettings); + + return new FilterMarkerRowsCallable<>(retrying2, rowAdapter); + } + + /** + * Creates a callable chain to handle streaming ReadRows RPCs. This chain skips the large rows + * internally. The chain will: + * + *

      + *
    • Convert a {@link Query} into a {@link com.google.bigtable.v2.ReadRowsRequest}. + *
    • Dispatch the RPC with {@link ReadRowsRequest}. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured in by the {@code rowAdapter} parameter. + *
    • Add bigtable tracer for tracking bigtable specific metrics. + *
    • Retry/resume on failure (retries for retryable error codes, connection errors and skip + * large row keys) + *
    • Filter out marker rows. + *
    • Add tracing & metrics. + *
    + */ + public ServerStreamingCallable createSkipLargeRowsCallable( + RowAdapter rowAdapter) { + + ServerStreamingCallSettings readRowsSettings = + (ServerStreamingCallSettings) perOpSettings.readRowsSettings; + + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getReadRowsMethod()) + .setParamsExtractor( + r -> + composeRequestParams( + r.getAppProfileId(), r.getTableName(), r.getAuthorizedViewName())) + .build(), + readRowsSettings.getRetryableCodes()); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(base); + + // Sometimes ReadRows connections are disconnected via an RST frame. This error is transient and + // should be treated similar to UNAVAILABLE. However, this exception has an INTERNAL error code + // which by default is not retryable. Convert the exception so it can be retried in the client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(withStatsHeaders); + + ServerStreamingCallable merging = + new RowMergingCallable<>(convertException, rowAdapter); + + // Copy settings for the middle ReadRowsRequest -> RowT callable (as opposed to the inner + // ReadRowsRequest -> ReadRowsResponse callable). + // We override the resumption strategy to use LargeReadRowsResumptionStrategy here (which skips + // the large rows) instead of ReadRowResumptionStrategy + ServerStreamingCallSettings innerSettings = + ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy(new LargeReadRowsResumptionStrategy<>(rowAdapter)) + .setRetryableCodes(readRowsSettings.getRetryableCodes()) + .setRetrySettings(readRowsSettings.getRetrySettings()) + .setIdleTimeout(readRowsSettings.getIdleTimeout()) + .setWaitTimeout(readRowsSettings.getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(merging, innerSettings, bigtableClientContext.getClientContext()); + + ServerStreamingCallable withBigtableTracer = + new BigtableTracerStreamingCallable<>(watched); + + // Retry logic is split into 2 parts to workaround a rare edge case described in + // ReadRowsRetryCompletedCallable + ServerStreamingCallable retrying1 = + new ReadRowsRetryCompletedCallable<>(withBigtableTracer); + + ServerStreamingCallable retrying2 = + largeRowWithRetries(retrying1, innerSettings); + + ServerStreamingCallable readRowsCallable = + new FilterMarkerRowsCallable<>(retrying2, rowAdapter); + + ServerStreamingCallable readRowsUserCallable = + new ReadRowsUserCallable<>(readRowsCallable, requestContext); + + SpanName span = getSpanName("ReadRows"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>( + readRowsUserCallable, + bigtableClientContext.getClientContext().getTracerFactory(), + span); + + return traced.withDefaultCallContext( + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(readRowsSettings.getRetrySettings())); + } + + /** + * Creates a callable chain to handle bulk ReadRows RPCs. This is meant to be used in ReadRows + * batcher. The chain will: + * + *
      + *
    • Convert a {@link Query} into a {@link com.google.bigtable.v2.ReadRowsRequest}. + *
    • Upon receiving the response stream, it will merge the {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row + * implementation can be configured in by the {@code rowAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Filter out marker rows. + *
    • Construct a {@link UnaryCallable} that will buffer the entire stream into memory before + * completing. If the stream is empty, then the list will be empty. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable> createBulkReadRowsCallable( + RowAdapter rowAdapter) { + ServerStreamingCallable readRowsCallable = + createReadRowsBaseCallable(perOpSettings.readRowsSettings, rowAdapter); + + ServerStreamingCallable readRowsUserCallable = + new ReadRowsUserCallable<>(readRowsCallable, requestContext); + + SpanName span = getSpanName("ReadRows"); + + // The TracedBatcherUnaryCallable has to be wrapped by the TracedUnaryCallable, so that + // TracedUnaryCallable can inject a tracer for the TracedBatcherUnaryCallable to interact with + UnaryCallable> tracedBatcher = + new TracedBatcherUnaryCallable<>(readRowsUserCallable.all()); + + UnaryCallable> traced = + new TracedUnaryCallable<>( + tracedBatcher, bigtableClientContext.getClientContext().getTracerFactory(), span); + + return traced.withDefaultCallContext( + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readRowsSettings.getRetrySettings())); + } + + /** + * Simple wrapper around {@link #createSampleRowKeysCallableWithRequest()} to provide backwards + * compatibility + * + * @deprecated Please use {@link #createSampleRowKeysCallableWithRequest()} + */ + @Deprecated + private UnaryCallable> createSampleRowKeysCallable() { + UnaryCallable> baseCallable = + createSampleRowKeysCallableWithRequest(); + return new UnaryCallable>() { + @Override + public ApiFuture> futureCall(String s, ApiCallContext apiCallContext) { + return baseCallable.futureCall(SampleRowKeysRequest.create(TableId.of(s)), apiCallContext); + } + }; + } + + /** + * Creates a callable chain to handle SampleRowKeys RPcs. The chain will: + * + *
      + *
    • Convert a {@link SampleRowKeysRequest} to a {@link + * com.google.bigtable.v2.SampleRowKeysRequest}. + *
    • Dispatch the request to the GAPIC's {@link BigtableStub#sampleRowKeysCallable()}. + *
    • Spool responses into a list. + *
    • Retry on failure. + *
    • Convert the responses into {@link KeyOffset}s. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable> + createSampleRowKeysCallableWithRequest() { + String methodName = "SampleRowKeys"; + + ServerStreamingCallable + base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(BigtableGrpc.getSampleRowKeysMethod()) + .setParamsExtractor( + r -> + composeRequestParams( + r.getAppProfileId(), r.getTableName(), r.getAuthorizedViewName())) + .build(), + perOpSettings.sampleRowKeysSettings.getRetryableCodes()); + + UnaryCallable> + spoolable = base.all(); + + UnaryCallable> + withStatsHeaders = new StatsHeadersUnaryCallable<>(spoolable); + + UnaryCallable> + withAttemptTracer = new BigtableTracerUnaryCallable<>(withStatsHeaders); + + UnaryCallable> + retryable = withRetries(withAttemptTracer, perOpSettings.sampleRowKeysSettings); + + return createUserFacingUnaryCallable( + methodName, + new SampleRowKeysCallableWithRequest(retryable, requestContext) + .withDefaultCallContext( + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(perOpSettings.sampleRowKeysSettings.getRetrySettings()))); + } + + /** + * Creates a callable chain to handle MutateRow RPCs. The chain will: + * + *
      + *
    • Convert a {@link RowMutation} into a {@link com.google.bigtable.v2.MutateRowRequest}. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable createMutateRowCallable() { + UnaryCallable classic = + createUnaryCallable( + BigtableGrpc.getMutateRowMethod(), + req -> + composeRequestParams( + req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), + perOpSettings.mutateRowSettings, + req -> req.toProto(requestContext), + resp -> null); + + return bigtableClientContext + .getSessionShim() + .decorateMutateRow(classic, perOpSettings.mutateRowSettings); + } + + /** + * Creates a callable chain to handle MutatesRows RPCs. This is meant to be used for manual + * batching. The chain will: + * + *
      + *
    • Convert a {@link BulkMutation} into a {@link MutateRowsRequest}. + *
    • Process the response and schedule retries. At the end of each attempt, entries that have + * been applied, are filtered from the next attempt. Also, any entries that failed with a + * nontransient error, are filtered from the next attempt. This will continue until there + * are no more entries or there are no more retry attempts left. + *
    • Wrap batch failures in a {@link MutateRowsAttemptResult}. + *
    • Add tracing & metrics. + *
    + * + * This callable returns an internal type {@link MutateRowsAttemptResult}. + * + *

    This function should not be exposed to external users, as it could cause a data loss. + */ + private UnaryCallable createMutateRowsBaseCallable() { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getMutateRowsMethod()) + .setParamsExtractor( + r -> + composeRequestParams( + r.getAppProfileId(), r.getTableName(), r.getAuthorizedViewName())) + .build(), + perOpSettings.bulkMutateRowsSettings.getRetryableCodes()); + + ServerStreamingCallable callable = + new StatsHeadersServerStreamingCallable<>(base); + + if (perOpSettings.bulkMutateRowsSettings.isServerInitiatedFlowControlEnabled()) { + callable = new RateLimitingServerStreamingCallable(callable); + } + + // Sometimes MutateRows connections are disconnected via an RST frame. This error is transient + // and + // should be treated similar to UNAVAILABLE. However, this exception has an INTERNAL error code + // which by default is not retryable. Convert the exception so it can be retried in the client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(callable); + + ServerStreamingCallable withAttemptTracer = + new BigtableTracerStreamingCallable<>(convertException); + + BasicResultRetryAlgorithm resultRetryAlgorithm = + new RetryInfoRetryAlgorithm<>(); + + MutateRowsPartialErrorRetryAlgorithm mutateRowsPartialErrorRetryAlgorithm = + new MutateRowsPartialErrorRetryAlgorithm(resultRetryAlgorithm); + + RetryAlgorithm retryAlgorithm = + new RetryAlgorithm<>( + mutateRowsPartialErrorRetryAlgorithm, + new ExponentialRetryAlgorithm( + perOpSettings.bulkMutateRowsSettings.getRetrySettings(), clientContext.getClock())); + + RetryingExecutorWithContext retryingExecutor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + UnaryCallable baseCallable = + new MutateRowsRetryingCallable( + clientContext.getDefaultCallContext(), + withAttemptTracer, + retryingExecutor, + perOpSettings.bulkMutateRowsSettings.getRetryableCodes(), + retryAlgorithm); + + UnaryCallable withCookie = + new CookiesUnaryCallable<>(baseCallable); + + UnaryCallable flowControlCallable = null; + if (perOpSettings.bulkMutateRowsSettings.isLatencyBasedThrottlingEnabled()) { + flowControlCallable = + new DynamicFlowControlCallable( + withCookie, + bulkMutationFlowController, + bulkMutationDynamicFlowControlStats, + perOpSettings.bulkMutateRowsSettings.getTargetRpcLatencyMs(), + FLOW_CONTROL_ADJUSTING_INTERVAL_MS); + } + UnaryCallable userFacing = + new BulkMutateRowsUserFacingCallable( + flowControlCallable != null ? flowControlCallable : withCookie, requestContext); + + SpanName spanName = getSpanName("MutateRows"); + + UnaryCallable tracedBatcherUnaryCallable = + new TracedBatcherUnaryCallable<>(userFacing); + + UnaryCallable traced = + new TracedUnaryCallable<>( + tracedBatcherUnaryCallable, clientContext.getTracerFactory(), spanName); + + return traced.withDefaultCallContext( + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.bulkMutateRowsSettings.getRetrySettings())); + } + + /** + * Creates a {@link BatcherImpl} to handle {@link MutateRowsRequest.Entry} mutations. This is + * meant to be used for automatic batching with flow control. + * + *

      + *
    • Uses {@link MutateRowsBatchingDescriptor} to spool the {@link RowMutationEntry} mutations + * and send them out as {@link BulkMutation}. + *
    • Uses {@link #bulkMutateRowsCallable()} to perform RPC. + *
    • Batching thresholds can be configured from {@link + * EnhancedBigtableStubSettings#bulkMutateRowsSettings()}. + *
    • Process the response and schedule retries. At the end of each attempt, entries that have + * been applied, are filtered from the next attempt. Also, any entries that failed with a + * nontransient error, are filtered from the next attempt. This will continue until there + * are no more entries or there are no more retry attempts left. + *
    • Wrap batch failures in a {@link + * com.google.cloud.bigtable.data.v2.models.MutateRowsException}. + *
    • Split the responses using {@link MutateRowsBatchingDescriptor}. + *
    + * + * @deprecated Please use {@link #newMutateRowsBatcher(TargetId, GrpcCallContext)} + */ + @Deprecated + public Batcher newMutateRowsBatcher( + @Nonnull String tableId, @Nullable GrpcCallContext ctx) { + return new BatcherImpl<>( + perOpSettings.bulkMutateRowsSettings.getBatchingDescriptor(), + bulkMutateRowsCallable, + BulkMutation.create(tableId), + perOpSettings.bulkMutateRowsSettings.getBatchingSettings(), + bigtableClientContext.getClientContext().getExecutor(), + bulkMutationFlowController, + MoreObjects.firstNonNull( + ctx, bigtableClientContext.getClientContext().getDefaultCallContext())); + } + + /** + * Creates a {@link BatcherImpl} to handle {@link MutateRowsRequest.Entry} mutations. This is + * meant to be used for automatic batching with flow control. + * + *
      + *
    • Uses {@link MutateRowsBatchingDescriptor} to spool the {@link RowMutationEntry} mutations + * and send them out as {@link BulkMutation}. + *
    • Uses {@link #bulkMutateRowsCallable()} to perform RPC. + *
    • Batching thresholds can be configured from {@link + * EnhancedBigtableStubSettings#bulkMutateRowsSettings()}. + *
    • Process the response and schedule retries. At the end of each attempt, entries that have + * been applied, are filtered from the next attempt. Also, any entries that failed with a + * nontransient error, are filtered from the next attempt. This will continue until there + * are no more entries or there are no more retry attempts left. + *
    • Wrap batch failures in a {@link + * com.google.cloud.bigtable.data.v2.models.MutateRowsException}. + *
    • Split the responses using {@link MutateRowsBatchingDescriptor}. + *
    + */ + public Batcher newMutateRowsBatcher( + TargetId targetId, @Nullable GrpcCallContext ctx) { + return new BatcherImpl<>( + perOpSettings.bulkMutateRowsSettings.getBatchingDescriptor(), + bulkMutateRowsCallable, + BulkMutation.create(targetId), + perOpSettings.bulkMutateRowsSettings.getBatchingSettings(), + bigtableClientContext.getClientContext().getExecutor(), + bulkMutationFlowController, + MoreObjects.firstNonNull( + ctx, bigtableClientContext.getClientContext().getDefaultCallContext())); + } + + /** + * Creates a {@link BatcherImpl} to handle {@link Query#rowKey(String)}. This is meant for bulk + * read with flow control. + * + *
      + *
    • Uses {@link ReadRowsBatchingDescriptor} to merge the row-keys and send them out as {@link + * Query}. + *
    • Uses {@link #readRowsCallable()} to perform RPC. + *
    • Batching thresholds can be configured from {@link + * EnhancedBigtableStubSettings#bulkReadRowsSettings()}. + *
    • Schedule retries for retryable exceptions until there are no more entries or there are no + * more retry attempts left. + *
    • Split the responses using {@link ReadRowsBatchingDescriptor}. + *
    + */ + public Batcher newBulkReadRowsBatcher( + @Nonnull Query query, @Nullable GrpcCallContext ctx) { + Preconditions.checkNotNull(query, "query cannot be null"); + return new BatcherImpl<>( + perOpSettings.bulkReadRowsSettings.getBatchingDescriptor(), + bulkReadRowsCallable, + query, + perOpSettings.bulkReadRowsSettings.getBatchingSettings(), + bigtableClientContext.getClientContext().getExecutor(), + null, + MoreObjects.firstNonNull( + ctx, bigtableClientContext.getClientContext().getDefaultCallContext())); + } + + /** + * Creates a callable chain to handle CheckAndMutateRow RPCs. THe chain will: + * + *
      + *
    • Convert {@link ConditionalRowMutation}s into {@link + * com.google.bigtable.v2.CheckAndMutateRowRequest}s. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable createCheckAndMutateRowCallable() { + return createUnaryCallable( + BigtableGrpc.getCheckAndMutateRowMethod(), + req -> + composeRequestParams( + req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), + perOpSettings.checkAndMutateRowSettings, + req -> req.toProto(requestContext), + CheckAndMutateRowResponse::getPredicateMatched); + } + + /** + * Creates a callable chain to handle ReadModifyWriteRow RPCs. The chain will: + * + *
      + *
    • Convert {@link ReadModifyWriteRow}s into {@link + * com.google.bigtable.v2.ReadModifyWriteRowRequest}s. + *
    • Convert the responses into {@link Row}. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable createReadModifyWriteRowCallable() { + DefaultRowAdapter rowAdapter = new DefaultRowAdapter(); + + return createUnaryCallable( + BigtableGrpc.getReadModifyWriteRowMethod(), + req -> + composeRequestParams( + req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), + perOpSettings.readModifyWriteRowSettings, + req -> req.toProto(requestContext), + resp -> rowAdapter.createRowFromProto(resp.getRow())); + } + + /** + * Creates a callable chain to handle streaming GenerateInitialChangeStreamPartitions RPCs. The + * chain will: + * + *
      + *
    • Convert a String format tableId into a {@link + * GenerateInitialChangeStreamPartitionsRequest} and dispatch the RPC. + *
    • Upon receiving the response stream, it will convert the {@link + * com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse}s into {@link + * RowRange}. + *
    + */ + private ServerStreamingCallable + createGenerateInitialChangeStreamPartitionsCallable() { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor( + BigtableGrpc.getGenerateInitialChangeStreamPartitionsMethod()) + .setParamsExtractor( + r -> composeRequestParams(r.getAppProfileId(), r.getTableName(), "")) + .build(), + perOpSettings.generateInitialChangeStreamPartitionsSettings.getRetryableCodes()); + + ServerStreamingCallable userCallable = + new GenerateInitialChangeStreamPartitionsUserCallable(base, requestContext); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(userCallable); + + // Sometimes GenerateInitialChangeStreamPartitions connections are disconnected via an RST + // frame. This error is transient and should be treated similar to UNAVAILABLE. However, this + // exception has an INTERNAL error code which by default is not retryable. Convert the exception + // so it can be retried in the client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(withStatsHeaders); + + // Copy idle timeout settings for watchdog. + ServerStreamingCallSettings innerSettings = + ServerStreamingCallSettings.newBuilder() + .setRetryableCodes( + perOpSettings.generateInitialChangeStreamPartitionsSettings.getRetryableCodes()) + .setRetrySettings( + perOpSettings.generateInitialChangeStreamPartitionsSettings.getRetrySettings()) + .setIdleTimeout( + perOpSettings.generateInitialChangeStreamPartitionsSettings.getIdleTimeout()) + .setWaitTimeout( + perOpSettings.generateInitialChangeStreamPartitionsSettings.getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(convertException, innerSettings, clientContext); + + ServerStreamingCallable withAttemptTracer = + new BigtableTracerStreamingCallable<>(watched); + + ServerStreamingCallable retrying = + withRetries(withAttemptTracer, innerSettings); + + SpanName span = getSpanName("GenerateInitialChangeStreamPartitions"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>(retrying, clientContext.getTracerFactory(), span); + + return traced.withDefaultCallContext( + clientContext + .getDefaultCallContext() + .withRetrySettings( + perOpSettings.generateInitialChangeStreamPartitionsSettings.getRetrySettings())); + } + + /** + * Creates a callable chain to handle streaming ReadChangeStream RPCs. The chain will: + * + *
      + *
    • Convert a {@link ReadChangeStreamQuery} into a {@link ReadChangeStreamRequest} and + * dispatch the RPC. + *
    • Upon receiving the response stream, it will produce a stream of ChangeStreamRecordT. In + * case of mutations, it will merge the {@link ReadChangeStreamResponse.DataChange}s into + * {@link ChangeStreamMutation}. The actual change stream record implementation can be + * configured by the {@code changeStreamRecordAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Add tracing & metrics. + *
    + */ + public + ServerStreamingCallable + createReadChangeStreamCallable( + ChangeStreamRecordAdapter changeStreamRecordAdapter) { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getReadChangeStreamMethod()) + .setParamsExtractor( + r -> composeRequestParams(r.getAppProfileId(), r.getTableName(), "")) + .build(), + perOpSettings.readChangeStreamSettings.getRetryableCodes()); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(base); + + // Sometimes ReadChangeStream connections are disconnected via an RST frame. This error is + // transient and should be treated similar to UNAVAILABLE. However, this exception has an + // INTERNAL error code which by default is not retryable. Convert the exception it can be + // retried in the client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(withStatsHeaders); + + ServerStreamingCallable merging = + new ChangeStreamRecordMergingCallable<>(convertException, changeStreamRecordAdapter); + + // Copy idle timeout settings for watchdog. + ServerStreamingCallSettings innerSettings = + ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy( + new ReadChangeStreamResumptionStrategy<>(changeStreamRecordAdapter)) + .setRetryableCodes(perOpSettings.readChangeStreamSettings.getRetryableCodes()) + .setRetrySettings(perOpSettings.readChangeStreamSettings.getRetrySettings()) + .setIdleTimeout(perOpSettings.readChangeStreamSettings.getIdleTimeout()) + .setWaitTimeout(perOpSettings.readChangeStreamSettings.getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(merging, innerSettings, clientContext); + + ServerStreamingCallable withAttemptTracer = + new BigtableTracerStreamingCallable<>(watched); + + ServerStreamingCallable readChangeStreamCallable = + withRetries(withAttemptTracer, innerSettings); + + ServerStreamingCallable + readChangeStreamUserCallable = + new ReadChangeStreamUserCallable<>(readChangeStreamCallable, requestContext); + + SpanName span = getSpanName("ReadChangeStream"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>( + readChangeStreamUserCallable, clientContext.getTracerFactory(), span); + + return traced.withDefaultCallContext( + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readChangeStreamSettings.getRetrySettings())); + } + + /** + * Creates a callable chain to handle streaming ExecuteQuery RPCs. The chain will: + * + *
      + *
    • Convert a {@link BoundStatement} into a {@link ExecuteQueryCallContext}, which passes the + * {@link BoundStatement} & a future for the {@link + * com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata} up the call chain. + *
    • Refresh expired {@link PrepareResponse} when the server returns a specific error} + *
    • Add retry/resume on failures + *
    • Upon receiving the first resume_token, it will set the metadata future and translate the + * {@link com.google.bigtable.v2.PartialResultSet}s into {@link SqlRow}s + *
    • Pass through non-retryable errors to the metadata future + *
    • Add tracing & metrics. + *
    • Wrap the metadata future & row stream into a {@link + * com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream} + *
    + */ + @InternalApi("For internal use only") + public ExecuteQueryCallable createExecuteQueryCallable() { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getExecuteQueryMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExecuteQueryRequest executeQueryRequest) { + return ImmutableMap.of( + "name", executeQueryRequest.getInstanceName(), + "app_profile_id", executeQueryRequest.getAppProfileId()); + } + }) + .build(), + perOpSettings.executeQuerySettings.getRetryableCodes()); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(base); + + ServerStreamingCallable withPlanRefresh = + new PlanRefreshingCallable(withStatsHeaders, requestContext); + + // Sometimes ExecuteQuery connections are disconnected via an RST frame. This error is transient + // and should be treated similar to UNAVAILABLE. However, this exception has an INTERNAL error + // code which by default is not retryable. Convert the exception, so it can be retried in the + // client. + ServerStreamingCallable convertException = + new ConvertExceptionCallable<>(withPlanRefresh); + + ServerStreamingCallable withAttemptTracer = + new BigtableTracerStreamingCallable<>(convertException); + + ServerStreamingCallSettings retrySettings = + ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy(new ExecuteQueryResumptionStrategy()) + .setRetryableCodes(perOpSettings.executeQuerySettings.getRetryableCodes()) + .setRetrySettings(perOpSettings.executeQuerySettings.getRetrySettings()) + .setIdleTimeout(perOpSettings.executeQuerySettings.getIdleTimeout()) + .setWaitTimeout(perOpSettings.executeQuerySettings.getWaitTimeout()) + .build(); + + // Retries need to happen before row merging, because the resumeToken is part + // of the ExecuteQueryResponse. This is okay because the first response in every + // attempt stream will have reset set to true, so any unyielded data from the previous + // attempt will be reset properly + ServerStreamingCallable retries = + withRetries(withAttemptTracer, retrySettings); + + ServerStreamingCallable merging = + new SqlRowMergingCallable(retries); + + ServerStreamingCallSettings watchdogSettings = + ServerStreamingCallSettings.newBuilder() + .setIdleTimeout(perOpSettings.executeQuerySettings.getIdleTimeout()) + .setWaitTimeout(perOpSettings.executeQuerySettings.getWaitTimeout()) + .build(); + + // Watchdog needs to stay above the metadata error handling so that watchdog errors + // are passed through to the metadata future. + ServerStreamingCallable watched = + Callables.watched(merging, watchdogSettings, clientContext); + + ServerStreamingCallable passingThroughErrorsToMetadata = + new MetadataErrorHandlingCallable(watched); + + SpanName span = getSpanName("ExecuteQuery"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>( + passingThroughErrorsToMetadata, clientContext.getTracerFactory(), span); + + return new ExecuteQueryCallable( + traced.withDefaultCallContext( + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.executeQuerySettings.getRetrySettings()))); + } + + private UnaryCallable createPrepareQueryCallable() { + return createUnaryCallable( + BigtableGrpc.getPrepareQueryMethod(), + req -> composeInstanceLevelRequestParams(req.getInstanceName(), req.getAppProfileId()), + perOpSettings.prepareQuerySettings, + req -> req.toProto(requestContext), + PrepareResponse::fromProto); + } + + /** + * Wraps a callable chain in a user presentable callable that will inject the default call context + * and trace the call. + */ + private UnaryCallable createUserFacingUnaryCallable( + String methodName, UnaryCallable inner) { + + UnaryCallable traced = + new TracedUnaryCallable<>( + inner, + bigtableClientContext.getClientContext().getTracerFactory(), + getSpanName(methodName)); + + return traced.withDefaultCallContext( + bigtableClientContext.getClientContext().getDefaultCallContext()); + } + + private Map composeRequestParams( + String appProfileId, String tableName, String authorizedViewName) { + if (tableName.isEmpty() && !authorizedViewName.isEmpty()) { + tableName = NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } + return ImmutableMap.of("table_name", tableName, "app_profile_id", appProfileId); + } + + private Map composeInstanceLevelRequestParams( + String instanceName, String appProfileId) { + return ImmutableMap.of("name", instanceName, "app_profile_id", appProfileId); + } + + private UnaryCallable createUnaryCallable( + MethodDescriptor methodDescriptor, + RequestParamsExtractor headerParamsFn, + UnaryCallSettings callSettings, + Function requestTransformer, + Function responseTranformer) { + + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(methodDescriptor) + .setParamsExtractor(headerParamsFn) + .build(), + callSettings.getRetryableCodes()); + + base = new StatsHeadersServerStreamingCallable<>(base); + + base = new BigtableTracerStreamingCallable<>(base); + + base = withRetries(base, convertUnaryToServerStreamingSettings(callSettings)); + + ServerStreamingCallable transformed = + new TransformingServerStreamingCallable<>(base, requestTransformer, responseTranformer); + + return new BigtableUnaryOperationCallable<>( + transformed, + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(callSettings.getRetrySettings()), + bigtableClientContext.getClientContext().getTracerFactory(), + getSpanName(methodDescriptor.getBareMethodName()), + /* allowNoResponse= */ false); + } + + private static + ServerStreamingCallSettings convertUnaryToServerStreamingSettings( + UnaryCallSettings unarySettings) { + return ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy(new SimpleStreamResumptionStrategy<>()) + .setRetryableCodes(unarySettings.getRetryableCodes()) + .setRetrySettings(unarySettings.getRetrySettings()) + .setIdleTimeoutDuration(Duration.ZERO) + .setWaitTimeoutDuration(Duration.ZERO) + .build(); + } + + private UnaryCallable withRetries( + UnaryCallable innerCallable, UnaryCallSettings unaryCallSettings) { + UnaryCallable retrying = + com.google.cloud.bigtable.gaxx.retrying.Callables.retrying( + innerCallable, unaryCallSettings, bigtableClientContext.getClientContext()); + return new CookiesUnaryCallable<>(retrying); + } + + private ServerStreamingCallable withRetries( + ServerStreamingCallable innerCallable, + ServerStreamingCallSettings serverStreamingCallSettings) { + + ServerStreamingCallable retrying = + com.google.cloud.bigtable.gaxx.retrying.Callables.retrying( + innerCallable, serverStreamingCallSettings, bigtableClientContext.getClientContext()); + + return new CookiesServerStreamingCallable<>(retrying); + } + + private ServerStreamingCallable largeRowWithRetries( + ServerStreamingCallable innerCallable, + ServerStreamingCallSettings serverStreamingCallSettings) { + + ServerStreamingCallable retrying = + com.google.cloud.bigtable.gaxx.retrying.Callables.retryingForLargeRows( + innerCallable, serverStreamingCallSettings, bigtableClientContext.getClientContext()); + return new CookiesServerStreamingCallable<>(retrying); + } + + // + + // + /** Returns a streaming read rows callable */ + public ServerStreamingCallable readRowsCallable() { + return readRowsCallable; + } + + /** Returns a streaming read rows callable that skips large rows */ + public ServerStreamingCallable skipLargeRowsCallable() { + return skipLargeRowsCallable; + } + + /** Return a point read callable */ + public UnaryCallable readRowCallable() { + return readRowCallable; + } + + /** Deprecated, please use {@link #sampleRowKeysCallableWithRequest} */ + @Deprecated + public UnaryCallable> sampleRowKeysCallable() { + return sampleRowKeysCallable; + } + + public UnaryCallable> sampleRowKeysCallableWithRequest() { + return sampleRowKeysCallableWithRequest; + } + + public UnaryCallable mutateRowCallable() { + return mutateRowCallable; + } + + /** + * Returns the callable chain created in {@link #createMutateRowsBaseCallable()} during stub + * construction. + */ + public UnaryCallable bulkMutateRowsCallable() { + return externalBulkMutateRowsCallable; + } + + @InternalApi + public UnaryCallable internalBulkMutateRowsCallable() { + return bulkMutateRowsCallable; + } + + /** + * Returns the callable chain created in {@link #createCheckAndMutateRowCallable()} during stub + * construction. + */ + public UnaryCallable checkAndMutateRowCallable() { + return checkAndMutateRowCallable; + } + + /** + * Returns the callable chain created in {@link #createReadModifyWriteRowCallable()} ()} during + * stub construction. + */ + public UnaryCallable readModifyWriteRowCallable() { + return readModifyWriteRowCallable; + } + + /** Returns a streaming generate initial change stream partitions callable */ + public ServerStreamingCallable + generateInitialChangeStreamPartitionsCallable() { + return generateInitialChangeStreamPartitionsCallable; + } + + /** Returns a streaming read change stream callable. */ + public ServerStreamingCallable + readChangeStreamCallable() { + return readChangeStreamCallable; + } + + /** Returns an {@link com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable} */ + public ExecuteQueryCallable executeQueryCallable() { + return executeQueryCallable; + } + + @InternalApi + public UnaryCallable prepareQueryCallable() { + return prepareQueryCallable; + } + + // + + private SpanName getSpanName(String methodName) { + return SpanName.of(CLIENT_NAME, methodName); + } + + @Override + public void close() { + try { + bigtableClientContext.close(); + } catch (Exception e) { + throw new IllegalStateException("failed to close client context", e); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java new file mode 100644 index 000000000000..1b3d4f2dee14 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.BatchingCallSettings; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.threeten.bp.Duration; + +/** + * Settings class to configure an instance of {@link EnhancedBigtableStub}. + * + *

    Sane defaults are provided for most settings: + * + *

      + *
    • The default service address (bigtable.googleapis.com) and default port (443) are used. + *
    • Credentials are acquired automatically through Application Default Credentials. + *
    • Retries are configured for idempotent methods but not for non-idempotent methods. + *
    + * + *

    The only required setting is the instance name. + * + *

    The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

    {@code
    + * BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder()
    + *   .setProjectId("my-project-id")
    + *   .setInstanceId("my-instance-id")
    + *   .setAppProfileId("default");
    + *
    + * settingsBuilder.stubSettings().readRowsSettings()
    + *  .setRetryableCodes(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE);
    + *
    + * BigtableDataSettings settings = builder.build();
    + * }
    + */ +public class EnhancedBigtableStubSettings extends StubSettings { + // The largest message that can be received is a 256 MB ReadRowsResponse. + private static final int MAX_MESSAGE_SIZE = 256 * 1024 * 1024; + private static final String SERVER_DEFAULT_APP_PROFILE_ID = ""; + + // TODO change this to true when enabling directpath by default + // For now, Only runs Direct Access Checker if user explicitly sets CBT_ENABLE_DIRECTPATH=true + private static DirectPathConfig DIRECT_PATH_CONFIG = + Optional.ofNullable( + Optional.ofNullable(System.getenv("CBT_ENABLE_DIRECTPATH")) + .orElse(System.getProperty("bigtable.internal.enable-directpath"))) + .map(Boolean::parseBoolean) + .map(b -> b ? DirectPathConfig.FORCED_ON : DirectPathConfig.FORCED_OFF) + .orElse(DirectPathConfig.DEFAULT); + + // If true, disable the bound-token-by-default feature for DirectPath. + private static final boolean DIRECT_PATH_BOUND_TOKEN_DISABLED = + Boolean.parseBoolean(System.getenv("CBT_DISABLE_DIRECTPATH_BOUND_TOKEN")); + + private static final boolean SESSIONS_DISABLE_ENV_VAR = + Boolean.parseBoolean(System.getenv("CBT_DISABLE_SESSIONS")); + + /** + * Scopes that are equivalent to JWT's audience. + * + *

    When the credentials provider contains any of these scopes (default behavior) and the + * application default credentials point to a service account, then OAuth2 tokens will be replaced + * with JWT tokens. This removes the need for access token refreshes. + */ + private static final ImmutableList JWT_ENABLED_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigtable.data") + .add("https://www.googleapis.com/auth/cloud-bigtable.data") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + /** + * Default jwt audience is always the service name unless it's override to test / staging for + * testing. + */ + private static final String DEFAULT_DATA_JWT_AUDIENCE = "https://bigtable.googleapis.com/"; + + private final String projectId; + private final String instanceId; + private final String appProfileId; + private final boolean isRefreshingChannel; + + private final ClientOperationSettings perOpSettings; + + private final FeatureFlags featureFlags; + + private final MetricsProvider metricsProvider; + @Nullable private final String metricsEndpoint; + private final boolean areInternalMetricsEnabled; + private final String jwtAudience; + + @InternalApi + public enum DirectPathConfig { + DEFAULT, + FORCED_ON, + FORCED_OFF, + } + + private final DirectPathConfig directPathConfig; + + private final boolean sessionsEnabled; + + private EnhancedBigtableStubSettings(Builder builder) { + super(builder); + + directPathConfig = builder.directPathConfig; + projectId = builder.projectId; + instanceId = builder.instanceId; + appProfileId = builder.appProfileId; + isRefreshingChannel = builder.isRefreshingChannel; + metricsProvider = builder.metricsProvider; + metricsEndpoint = builder.metricsEndpoint; + areInternalMetricsEnabled = builder.areInternalMetricsEnabled; + jwtAudience = builder.jwtAudience; + + this.sessionsEnabled = builder.sessionsEnabled; + + perOpSettings = new ClientOperationSettings(builder.perOpSettings); + featureFlags = builder.featureFlags.build(); + } + + /** Create a new builder. */ + public static Builder newBuilder() { + return new Builder(); + } + + /** Returns the project id of the target instance. */ + public String getProjectId() { + return projectId; + } + + @InternalApi + public DirectPathConfig getDirectPathConfig() { + return this.directPathConfig; + } + + /** Returns the target instance id. */ + public String getInstanceId() { + return instanceId; + } + + /** Returns the configured AppProfile to use */ + public String getAppProfileId() { + return appProfileId; + } + + /** + * Returns if channels will gracefully refresh connections to Cloud Bigtable service + * + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public boolean isRefreshingChannel() { + return isRefreshingChannel; + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public List getPrimedTableIds() { + return ImmutableList.of(); + } + + /** + * @deprecated This is a no op and will always return an empty map. Audience is always set to + * bigtable service name. + */ + @InternalApi("Used for internal testing") + @Deprecated + public Map getJwtAudienceMapping() { + return ImmutableMap.of(); + } + + public MetricsProvider getMetricsProvider() { + return metricsProvider; + } + + /** + * @deprecated routing cookies are always on. + */ + @Deprecated + public boolean getEnableRoutingCookie() { + return true; + } + + /** + * @deprecated RetryInfo is now always on. + */ + @Deprecated + public boolean getEnableRetryInfo() { + return true; + } + + /** + * Gets the Google Cloud Monitoring endpoint for publishing client side metrics. If it's null, + * client will publish metrics to the default monitoring endpoint. + */ + @Nullable + public String getMetricsEndpoint() { + return metricsEndpoint; + } + + public boolean areInternalMetricsEnabled() { + return areInternalMetricsEnabled; + } + + @InternalApi + public ClientOperationSettings getPerOpSettings() { + return perOpSettings; + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + InstantiatingGrpcChannelProvider.Builder grpcTransportProviderBuilder = + BigtableStubSettings.defaultGrpcTransportProviderBuilder(); + return grpcTransportProviderBuilder + .setChannelPoolSettings( + ChannelPoolSettings.builder() + .setInitialChannelCount(10) + .setMinRpcsPerChannel(1) + // Keep it conservative as we scale the channel size every 1min + // and delta is 2 channels. + .setMaxRpcsPerChannel(25) + .setPreemptiveRefreshEnabled(true) + .build()) + .setMaxInboundMessageSize(MAX_MESSAGE_SIZE) + .setKeepAliveTime(Duration.ofSeconds(30)) // sends ping in this interval + .setKeepAliveTimeout( + Duration.ofSeconds(10)); // wait this long before considering the connection dead + } + + boolean isSessionsEnabled() { + return sessionsEnabled; + } + + /** Applies Direct Access traits to an existing builder. */ + @InternalApi + public static InstantiatingGrpcChannelProvider.Builder applyDirectAccessTraitsInternal( + InstantiatingGrpcChannelProvider.Builder builder) { + builder + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + .setAllowNonDefaultServiceAccount(true); + + if (!DIRECT_PATH_BOUND_TOKEN_DISABLED) { + builder.setAllowHardBoundTokenTypes( + Collections.singletonList(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS)); + } + + return builder; + } + + @SuppressWarnings("WeakerAccess") + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return BigtableStubSettings.defaultCredentialsProviderBuilder() + .setJwtEnabledScopes(JWT_ENABLED_SCOPES); + } + + @Override + public String getServiceName() { + return "bigtable"; + } + + /** + * Returns the object with the settings used for calls to ReadRows. + * + *

    This is idempotent and streaming operation. + * + *

    Default retry and timeout settings: + * + *

      + *
    • {@link ServerStreamingCallSettings.Builder#setIdleTimeout Default idle timeout} is set to + * 5 mins. Idle timeout is how long to wait before considering the stream orphaned by the + * user and closing it. + *
    • {@link ServerStreamingCallSettings.Builder#setWaitTimeout Default wait timeout} is set to + * 5 mins. Wait timeout is the maximum amount of time to wait for the next message from the + * server. + *
    • Retry {@link ServerStreamingCallSettings.Builder#setRetryableCodes error codes} are: + * {@link Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} + * is 30 minutes with {@link RetrySettings.Builder#setMaxAttempts maximum attempt} count of + * 10 times and the timeout to read the {@link RetrySettings.Builder#setTotalTimeout entire + * stream} is 12 hours. + *
    + */ + public ServerStreamingCallSettings readRowsSettings() { + return perOpSettings.readRowsSettings; + } + + /** + * Returns the object with the settings used for calls to SampleRowKeys. + * + *

    This is idempotent and non-streaming operation. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 5 + * minutes and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + */ + public UnaryCallSettings> sampleRowKeysSettings() { + return perOpSettings.sampleRowKeysSettings; + } + + /** + * Returns the object with the settings used for point reads via ReadRows. + * + *

    This is an idempotent and non-streaming operation. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 + * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + * + * @see RetrySettings for more explanation. + */ + public UnaryCallSettings readRowSettings() { + return perOpSettings.readRowSettings; + } + + /** + * Returns the object with the settings used for calls to MutateRow. + * + *

    This is an idempotent and non-streaming operation. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 60 seconds. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 + * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + * + * @see RetrySettings for more explanation. + */ + public UnaryCallSettings mutateRowSettings() { + return perOpSettings.mutateRowSettings; + } + + /** + * Returns the object with the settings used for calls to MutateRows. + * + *

    Please note that these settings will affect both manually batched calls + * (bulkMutateRowsCallable) and automatic batched calls (bulkMutateRowsBatchingCallable). The + * {@link RowMutation} request signature is ignored for the manual batched calls. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link BatchingCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 1 + * minute and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + * + *

    On breach of certain triggers, the operation initiates processing of accumulated request for + * which the default settings are: + * + *

      + *
    • When the {@link BatchingSettings.Builder#setElementCountThreshold request count} reaches + * 100. + *
    • When accumulated {@link BatchingSettings.Builder#setRequestByteThreshold request size} + * reaches to 20MB. + *
    • When an {@link BatchingSettings.Builder#setDelayThreshold interval of} 1 second passes + * after batching initialization or last processed batch. + *
    + * + *

    A {@link FlowController} will be set up with {@link BigtableBatchingCallSettings.Builder + * #getDynamicFlowControlSettings()} for throttling in-flight requests. When the pending request + * count or accumulated request size reaches {@link FlowController} thresholds, then this + * operation will be throttled until some of the pending batches are resolved. + * + * @see RetrySettings for more explanation. + * @see BatchingSettings for batch related configuration explanation. + * @see BigtableBatchingCallSettings.Builder#getDynamicFlowControlSettings() for flow control + * related configuration explanation. + */ + public BigtableBatchingCallSettings bulkMutateRowsSettings() { + return perOpSettings.bulkMutateRowsSettings; + } + + /** + * Returns the call settings used for bulk read rows. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link BatchingCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}. + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 5 + * minute and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + * + *

    On breach of certain triggers, the operation initiates processing of accumulated request for + * which the default settings are: + * + *

      + *
    • When the {@link BatchingSettings.Builder#setElementCountThreshold request count} reaches + * 100. + *
    • When accumulated {@link BatchingSettings.Builder#setRequestByteThreshold request size} + * reaches to 400KB. + *
    • When an {@link BatchingSettings.Builder#setDelayThreshold interval of} 1 second passes + * after batching initialization or last processed batch. + *
    + * + *

    When the pending {@link FlowControlSettings.Builder#setMaxOutstandingElementCount request + * count} reaches a default of 1000 outstanding row keys per channel then this operation will by + * default be {@link FlowControlSettings.Builder#setLimitExceededBehavior blocked} until some of + * the pending batch are resolved. + * + * @see RetrySettings for more explanation. + * @see BatchingSettings for batch related configuration explanation. + */ + public BigtableBulkReadRowsCallSettings bulkReadRowsSettings() { + return perOpSettings.bulkReadRowsSettings; + } + + /** + * Returns the object with the settings used for calls to CheckAndMutateRow. + * + *

    This is a non-idempotent and non-streaming operation. + * + *

    By default this operation does not reattempt in case of RPC failure. The default timeout for + * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 20 seconds. + * + * @see RetrySettings for more explanation. + */ + public UnaryCallSettings checkAndMutateRowSettings() { + return perOpSettings.checkAndMutateRowSettings; + } + + /** + * Returns the object with the settings used for calls to ReadModifyWriteRow. + * + *

    This is a non-idempotent and non-streaming operation. + * + *

    By default this operation does not reattempt in case of RPC failure. The default timeout for + * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 20 seconds. + * + * @see RetrySettings for more explanation. + */ + public UnaryCallSettings readModifyWriteRowSettings() { + return perOpSettings.readModifyWriteRowSettings; + } + + public ServerStreamingCallSettings + generateInitialChangeStreamPartitionsSettings() { + return perOpSettings.generateInitialChangeStreamPartitionsSettings; + } + + public ServerStreamingCallSettings + readChangeStreamSettings() { + return perOpSettings.readChangeStreamSettings; + } + + public ServerStreamingCallSettings executeQuerySettings() { + return perOpSettings.executeQuerySettings; + } + + /** + * Returns the object with the settings used for a PrepareQuery request. This is used by + * PreparedStatement to manage PreparedQueries. + * + *

    This is an idempotent and non-streaming operation. + * + *

    Default retry and timeout settings: + * + *

      + *
    • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link + * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE} + *
    • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
    • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 5 + * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * operation} across all of the attempts is 10 mins. + *
    + * + * @see RetrySettings for more explanation. + */ + public UnaryCallSettings prepareQuerySettings() { + return perOpSettings.prepareQuerySettings; + } + + /** + * Returns the object with the settings used for calls to PingAndWarm. + * + *

    By default the retries are disabled for PingAndWarm and deadline is set to 30 seconds. + */ + UnaryCallSettings pingAndWarmSettings() { + return perOpSettings.pingAndWarmSettings; + } + + /** Returns a builder containing all the values of this settings class. */ + @Override + public Builder toBuilder() { + return new Builder(this); + } + + /** Builder for BigtableDataSettings. */ + public static class Builder extends StubSettings.Builder { + private DirectPathConfig directPathConfig; + private String projectId; + private String instanceId; + private String appProfileId; + private boolean isRefreshingChannel; + private String jwtAudience; + private boolean sessionsEnabled = true; + + private final ClientOperationSettings.Builder perOpSettings; + + private final FeatureFlags.Builder featureFlags; + + private MetricsProvider metricsProvider; + @Nullable private String metricsEndpoint; + private boolean areInternalMetricsEnabled; + + /** + * Initializes a new Builder with sane defaults for all settings. + * + *

    Most defaults are extracted from BaseBigtableDataSettings, however some of the more + * complex defaults are configured explicitly here. Once the overlayed defaults are configured, + * the base settings are augmented to work with overlayed functionality (like disabling retries + * in the underlying GAPIC client for batching). + */ + private Builder() { + // TODO(enable this by default) + // Only runs Direct Access Checker if it is DIRECTPATH_ENABLED_BY_DEFAULT + this.directPathConfig = DIRECT_PATH_CONFIG; + this.appProfileId = SERVER_DEFAULT_APP_PROFILE_ID; + this.isRefreshingChannel = true; + setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + metricsProvider = DefaultMetricsProvider.INSTANCE; + this.areInternalMetricsEnabled = true; + this.jwtAudience = DEFAULT_DATA_JWT_AUDIENCE; + this.sessionsEnabled = !SESSIONS_DISABLE_ENV_VAR; + + // Defaults provider + BigtableStubSettings.Builder baseDefaults = BigtableStubSettings.newBuilder(); + + setEndpoint(baseDefaults.getEndpoint()); + setTransportChannelProvider(defaultTransportChannelProvider()); + setStreamWatchdogCheckInterval(baseDefaults.getStreamWatchdogCheckInterval()); + setStreamWatchdogProvider(baseDefaults.getStreamWatchdogProvider()); + + perOpSettings = new ClientOperationSettings.Builder(); + + // TODO: flip the bit setDirectAccessRequested and setTrafficDirectorEnabled once we make + // client compatible by default. + boolean isDirectPathRequested = directPathConfig != DirectPathConfig.FORCED_OFF; + featureFlags = + FeatureFlags.newBuilder() + .setReverseScans(true) + .setLastScannedRowResponses(true) + .setDirectAccessRequested(isDirectPathRequested) + .setTrafficDirectorEnabled(isDirectPathRequested) + .setPeerInfo(true) + .setSessionsCompatible(true); + } + + private Builder(EnhancedBigtableStubSettings settings) { + super(settings); + projectId = settings.projectId; + instanceId = settings.instanceId; + appProfileId = settings.appProfileId; + isRefreshingChannel = settings.isRefreshingChannel; + metricsProvider = settings.metricsProvider; + metricsEndpoint = settings.getMetricsEndpoint(); + areInternalMetricsEnabled = settings.areInternalMetricsEnabled; + jwtAudience = settings.jwtAudience; + this.directPathConfig = settings.getDirectPathConfig(); + sessionsEnabled = settings.sessionsEnabled; + + this.perOpSettings = new ClientOperationSettings.Builder(settings.perOpSettings); + + featureFlags = settings.featureFlags.toBuilder(); + } + + // + /** + * Sets the project id of that target instance. This setting is required. All RPCs will be made + * in the context of this setting. + */ + public Builder setProjectId(@Nonnull String projectId) { + Preconditions.checkNotNull(projectId); + this.projectId = projectId; + return this; + } + + /** Gets the project id of the target instance that was previously set on this Builder. */ + public String getProjectId() { + return projectId; + } + + /** + * Sets the target instance id. This setting is required. All RPCs will be made in the context + * of this setting. + */ + public Builder setInstanceId(@Nonnull String instanceId) { + Preconditions.checkNotNull(instanceId); + this.instanceId = instanceId; + return this; + } + + /** Gets the target instance id that was previously set on this Builder. */ + public String getInstanceId() { + return instanceId; + } + + /** + * Sets the AppProfile to use. An application profile (sometimes also shortened to "app + * profile") is a group of configuration parameters for an individual use case. A client will + * identify itself with an application profile ID at connection time, and the requests will be + * handled according to that application profile. + */ + public Builder setAppProfileId(@Nonnull String appProfileId) { + Preconditions.checkNotNull(appProfileId, "AppProfileId can't be null"); + this.appProfileId = appProfileId; + return this; + } + + /** + * Resets the AppProfile id to the default for the instance. + * + *

    An application profile (sometimes also shortened to "app profile") is a group of + * configuration parameters for an individual use case. A client will identify itself with an + * application profile ID at connection time, and the requests will be handled according to that + * application profile. + * + *

    Every Bigtable Instance has a default application profile associated with it, this method + * configures the client to use it. + */ + public Builder setDefaultAppProfileId() { + setAppProfileId(SERVER_DEFAULT_APP_PROFILE_ID); + return this; + } + + /** Gets the app profile id that was previously set on this Builder. */ + public String getAppProfileId() { + return appProfileId; + } + + /** + * Sets if channels will gracefully refresh connections to Cloud Bigtable service. + * + *

    When enabled, this will wait for the connection to complete the SSL handshake and warm up + * serverside caches for all the tables of the instance. This feature is enabled by default. + * + * @see com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder#setRefreshingChannel + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public Builder setRefreshingChannel(boolean isRefreshingChannel) { + this.isRefreshingChannel = isRefreshingChannel; + return this; + } + + @InternalApi("For internal use only.") + public Builder setDirectPathConfig(DirectPathConfig directPathConfig) { + this.directPathConfig = directPathConfig; + return this; + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public Builder setPrimedTableIds(String... tableIds) { + return this; + } + + /** + * Gets if channels will gracefully refresh connections to Cloud Bigtable service. + * + * @deprecated Channel refreshing is enabled by default and this method will be deprecated. + */ + @Deprecated + public boolean isRefreshingChannel() { + return isRefreshingChannel; + } + + /** + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. + */ + @Deprecated + public List getPrimedTableIds() { + return ImmutableList.of(); + } + + /** + * @deprecated This is a no op. Audience is always set to bigtable service name. + * @see #setJwtAudience(String) to override the audience. + */ + @InternalApi("Used for internal testing") + @Deprecated + public Builder setJwtAudienceMapping(Map jwtAudienceMapping) { + return this; + } + + /** Set the jwt audience override. */ + @InternalApi("Used for internal testing") + public Builder setJwtAudience(String audience) { + this.jwtAudience = audience; + return this; + } + + @InternalApi + public Builder setSessionsEnabled(boolean enabled) { + this.sessionsEnabled = enabled; + return this; + } + + /** + * Sets the {@link MetricsProvider}. + * + *

    By default, this is set to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider#INSTANCE} which will + * collect and export client side metrics. + * + *

    To disable client side metrics, set it to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider#INSTANCE}. + * + *

    To use a custom OpenTelemetry instance, refer to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider} on how to + * set it up. + */ + public Builder setMetricsProvider(MetricsProvider metricsProvider) { + this.metricsProvider = Preconditions.checkNotNull(metricsProvider); + return this; + } + + /** Gets the {@link MetricsProvider}. */ + public MetricsProvider getMetricsProvider() { + return this.metricsProvider; + } + + /** + * Built-in client side metrics are published through Google Cloud Monitoring endpoint. This + * setting overrides the default endpoint for publishing the metrics. + */ + public Builder setMetricsEndpoint(String endpoint) { + this.metricsEndpoint = endpoint; + return this; + } + + /** + * Get the Google Cloud Monitoring endpoint for publishing client side metrics. If it's null, + * client will publish metrics to the default monitoring endpoint. + */ + @Nullable + public String getMetricsEndpoint() { + return metricsEndpoint; + } + + /** Disable collection of internal metrics that help google detect issues accessing Bigtable. */ + public Builder disableInternalMetrics() { + this.areInternalMetricsEnabled = false; + return this; + } + + /** Checks if internal metrics are disabled */ + public boolean areInternalMetricsEnabled() { + return areInternalMetricsEnabled; + } + + /** + * @deprecated This is a no op and will always return an empty map. Audience is always set to + * bigtable service name. + * @see #getJwtAudience() to get the audience. + */ + @InternalApi("Used for internal testing") + @Deprecated + public Map getJwtAudienceMapping() { + return ImmutableMap.of(); + } + + /** Return the jwt audience override. */ + String getJwtAudience() { + return this.jwtAudience; + } + + /** + * @deprecated this now a no-op as routing cookies are always on. + */ + @Deprecated + public Builder setEnableRoutingCookie(boolean enableRoutingCookie) { + return this; + } + + /** + * @deprecated routing cookies are always on. + */ + @Deprecated + public boolean getEnableRoutingCookie() { + return true; + } + + /** + * @deprecated This is a no-op, RetryInfo is always used now. + */ + @Deprecated + public Builder setEnableRetryInfo(boolean enableRetryInfo) { + return this; + } + + /** + * @deprecated RetryInfo is always on. + */ + @Deprecated + public boolean getEnableRetryInfo() { + return true; + } + + /** Returns the builder for the settings used for calls to readRows. */ + public ServerStreamingCallSettings.Builder readRowsSettings() { + return perOpSettings.readRowsSettings; + } + + /** Returns the builder for the settings used for point reads using readRow. */ + public UnaryCallSettings.Builder readRowSettings() { + return perOpSettings.readRowSettings; + } + + /** Returns the builder for the settings used for calls to SampleRowKeysSettings. */ + public UnaryCallSettings.Builder> sampleRowKeysSettings() { + return perOpSettings.sampleRowKeysSettings; + } + + /** Returns the builder for the settings used for calls to MutateRow. */ + public UnaryCallSettings.Builder mutateRowSettings() { + return perOpSettings.mutateRowSettings; + } + + /** Returns the builder for the settings used for calls to MutateRows. */ + public BigtableBatchingCallSettings.Builder bulkMutateRowsSettings() { + return perOpSettings.bulkMutateRowsSettings; + } + + /** Returns the builder for the settings used for calls to MutateRows. */ + public BigtableBulkReadRowsCallSettings.Builder bulkReadRowsSettings() { + return perOpSettings.bulkReadRowsSettings; + } + + /** Returns the builder for the settings used for calls to CheckAndMutateRow. */ + public UnaryCallSettings.Builder checkAndMutateRowSettings() { + return perOpSettings.checkAndMutateRowSettings; + } + + /** Returns the builder with the settings used for calls to ReadModifyWriteRow. */ + public UnaryCallSettings.Builder readModifyWriteRowSettings() { + return perOpSettings.readModifyWriteRowSettings; + } + + /** Returns the builder for the settings used for calls to ReadChangeStream. */ + public ServerStreamingCallSettings.Builder + readChangeStreamSettings() { + return perOpSettings.readChangeStreamSettings; + } + + /** + * Returns the builder for the settings used for calls to GenerateInitialChangeStreamPartitions. + */ + public ServerStreamingCallSettings.Builder + generateInitialChangeStreamPartitionsSettings() { + return perOpSettings.generateInitialChangeStreamPartitionsSettings; + } + + /** Returns the builder with the settings used for calls to PingAndWarm. */ + public UnaryCallSettings.Builder pingAndWarmSettings() { + return perOpSettings.pingAndWarmSettings; + } + + /** + * Returns the builder for the settings used for calls to ExecuteQuery + * + *

    Note that this will currently ignore any retry settings other than deadlines. ExecuteQuery + * requests will not be retried currently. + */ + @BetaApi + public ServerStreamingCallSettings.Builder executeQuerySettings() { + return perOpSettings.executeQuerySettings; + } + + /** Returns the builder with the settings used for calls to PrepareQuery */ + @BetaApi + public UnaryCallSettings.Builder prepareQuerySettings() { + return perOpSettings.prepareQuerySettings; + } + + @SuppressWarnings("unchecked") + @Override + public EnhancedBigtableStubSettings build() { + Preconditions.checkState(projectId != null, "Project id must be set"); + Preconditions.checkState(instanceId != null, "Instance id must be set"); + + if (this.bulkMutateRowsSettings().isServerInitiatedFlowControlEnabled()) { + // only set mutate rows feature flag when this feature is enabled + featureFlags.setMutateRowsRateLimit(true); + featureFlags.setMutateRowsRateLimit2(true); + } + + featureFlags.setRoutingCookie(true); + featureFlags.setRetryInfo(true); + // client_Side_metrics_enabled feature flag is only set when a user is running with a + // DefaultMetricsProvider. This may cause false negatives when a user registered the + // metrics on their CustomOpenTelemetryMetricsProvider. + featureFlags.setClientSideMetricsEnabled( + this.getMetricsProvider() instanceof DefaultMetricsProvider); + + // Serialize the web64 encode the bigtable feature flags + ByteArrayOutputStream boas = new ByteArrayOutputStream(); + try { + featureFlags.build().writeTo(boas); + } catch (IOException e) { + throw new IllegalStateException( + "Unexpected IOException while serializing feature flags", e); + } + byte[] serializedFlags = boas.toByteArray(); + byte[] encodedFlags = Base64.getUrlEncoder().encode(serializedFlags); + + // Inject the UserAgent in addition to api-client header + Map headers = + ImmutableMap.builder() + .putAll( + BigtableStubSettings.defaultApiClientHeaderProviderBuilder().build().getHeaders()) + // GrpcHeaderInterceptor treats the `user-agent` as a magic string + .put("user-agent", "bigtable-java/" + Version.VERSION) + .put("bigtable-features", new String(encodedFlags, StandardCharsets.UTF_8)) + .build(); + setInternalHeaderProvider(FixedHeaderProvider.create(headers)); + + return new EnhancedBigtableStubSettings(this); + } + // + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("projectId", projectId) + .add("instanceId", instanceId) + .add("appProfileId", appProfileId) + .add("isRefreshingChannel", isRefreshingChannel) + .add("perOpSettings", perOpSettings) + .add("metricsProvider", metricsProvider) + .add("metricsEndpoint", metricsEndpoint) + .add("areInternalMetricsEnabled", areInternalMetricsEnabled) + .add("jwtAudience", jwtAudience) + .add("directPathConfig", getDirectPathConfig().toString()) + .add("sessionsEnabled", sessionsEnabled) + .add("parent", super.toString()) + .toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java new file mode 100644 index 000000000000..3e7bedaa9b12 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** For internal use only. */ +@Generated("by gapic-generator") +@InternalApi +public class GrpcBigtableCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java new file mode 100644 index 000000000000..089bbb8a25dc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java @@ -0,0 +1,632 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +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.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** For internal use only. */ +@Generated("by gapic-generator") +@InternalApi +public class GrpcBigtableStub extends BigtableStub { + private static final MethodDescriptor + readRowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.bigtable.v2.Bigtable/ReadRows") + .setRequestMarshaller(ProtoUtils.marshaller(ReadRowsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReadRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + sampleRowKeysMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.bigtable.v2.Bigtable/SampleRowKeys") + .setRequestMarshaller( + ProtoUtils.marshaller(SampleRowKeysRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SampleRowKeysResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + mutateRowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/MutateRow") + .setRequestMarshaller(ProtoUtils.marshaller(MutateRowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MutateRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + mutateRowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.bigtable.v2.Bigtable/MutateRows") + .setRequestMarshaller(ProtoUtils.marshaller(MutateRowsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(MutateRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + checkAndMutateRowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/CheckAndMutateRow") + .setRequestMarshaller( + ProtoUtils.marshaller(CheckAndMutateRowRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CheckAndMutateRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + readModifyWriteRowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/ReadModifyWriteRow") + .setRequestMarshaller( + ProtoUtils.marshaller(ReadModifyWriteRowRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReadModifyWriteRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + "google.bigtable.v2.Bigtable/GenerateInitialChangeStreamPartitions") + .setRequestMarshaller( + ProtoUtils.marshaller( + GenerateInitialChangeStreamPartitionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + GenerateInitialChangeStreamPartitionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + readChangeStreamMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.bigtable.v2.Bigtable/ReadChangeStream") + .setRequestMarshaller( + ProtoUtils.marshaller(ReadChangeStreamRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReadChangeStreamResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + prepareQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/PrepareQuery") + .setRequestMarshaller(ProtoUtils.marshaller(PrepareQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PrepareQueryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + executeQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.bigtable.v2.Bigtable/ExecuteQuery") + .setRequestMarshaller(ProtoUtils.marshaller(ExecuteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ExecuteQueryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final ServerStreamingCallable readRowsCallable; + private final ServerStreamingCallable + sampleRowKeysCallable; + private final UnaryCallable mutateRowCallable; + private final ServerStreamingCallable mutateRowsCallable; + private final UnaryCallable + checkAndMutateRowCallable; + private final UnaryCallable pingAndWarmCallable; + private final UnaryCallable + readModifyWriteRowCallable; + private final ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsCallable; + private final ServerStreamingCallable + readChangeStreamCallable; + private final UnaryCallable prepareQueryCallable; + private final ServerStreamingCallable + executeQueryCallable; + + private final BackgroundResource backgroundResources; + 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 READ_ROWS_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + private static final PathTemplate READ_ROWS_3_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}/**"); + 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 SAMPLE_ROW_KEYS_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + private static final PathTemplate SAMPLE_ROW_KEYS_3_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}/**"); + 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_ROW_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + 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 MUTATE_ROWS_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + 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 CHECK_AND_MUTATE_ROW_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + 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=**}"); + private static final PathTemplate READ_MODIFY_WRITE_ROW_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}/**"); + private static final PathTemplate PREPARE_QUERY_0_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}"); + private static final PathTemplate PREPARE_QUERY_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate EXECUTE_QUERY_0_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}"); + private static final PathTemplate EXECUTE_QUERY_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + + public static final GrpcBigtableStub create(BigtableStubSettings settings) throws IOException { + return new GrpcBigtableStub(settings, ClientContext.create(settings)); + } + + public static final GrpcBigtableStub create(ClientContext clientContext) throws IOException { + return new GrpcBigtableStub(BigtableStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcBigtableStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcBigtableStub( + BigtableStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcBigtableStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcBigtableStub(BigtableStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcBigtableCallableFactory()); + } + + /** + * Constructs an instance of GrpcBigtableStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcBigtableStub( + BigtableStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings readRowsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readRowsMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), "table_name", READ_ROWS_2_PATH_TEMPLATE); + builder.add(request.getMaterializedViewName(), "name", READ_ROWS_3_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings sampleRowKeysTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sampleRowKeysMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), + "table_name", + SAMPLE_ROW_KEYS_2_PATH_TEMPLATE); + builder.add( + request.getMaterializedViewName(), "name", SAMPLE_ROW_KEYS_3_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings mutateRowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(mutateRowMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), "table_name", MUTATE_ROW_2_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings mutateRowsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(mutateRowsMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), "table_name", MUTATE_ROWS_2_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings + checkAndMutateRowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(checkAndMutateRowMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), + "table_name", + CHECK_AND_MUTATE_ROW_2_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .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(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + readModifyWriteRowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readModifyWriteRowMethodDescriptor) + .setParamsExtractor( + request -> { + 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); + builder.add( + request.getAuthorizedViewName(), + "table_name", + READ_MODIFY_WRITE_ROW_2_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(generateInitialChangeStreamPartitionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table_name", String.valueOf(request.getTableName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings + readChangeStreamTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readChangeStreamMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table_name", String.valueOf(request.getTableName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getTableName()) + .build(); + GrpcCallSettings prepareQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(prepareQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getInstanceName(), "name", PREPARE_QUERY_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", PREPARE_QUERY_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getInstanceName()) + .build(); + GrpcCallSettings executeQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(executeQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getInstanceName(), "name", EXECUTE_QUERY_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", EXECUTE_QUERY_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getInstanceName()) + .build(); + + this.readRowsCallable = + callableFactory.createServerStreamingCallable( + readRowsTransportSettings, settings.readRowsSettings(), clientContext); + this.sampleRowKeysCallable = + callableFactory.createServerStreamingCallable( + sampleRowKeysTransportSettings, settings.sampleRowKeysSettings(), clientContext); + this.mutateRowCallable = + callableFactory.createUnaryCallable( + mutateRowTransportSettings, settings.mutateRowSettings(), clientContext); + this.mutateRowsCallable = + callableFactory.createServerStreamingCallable( + mutateRowsTransportSettings, settings.mutateRowsSettings(), clientContext); + this.checkAndMutateRowCallable = + callableFactory.createUnaryCallable( + checkAndMutateRowTransportSettings, + settings.checkAndMutateRowSettings(), + clientContext); + this.pingAndWarmCallable = + callableFactory.createUnaryCallable( + pingAndWarmTransportSettings, settings.pingAndWarmSettings(), clientContext); + this.readModifyWriteRowCallable = + callableFactory.createUnaryCallable( + readModifyWriteRowTransportSettings, + settings.readModifyWriteRowSettings(), + clientContext); + this.generateInitialChangeStreamPartitionsCallable = + callableFactory.createServerStreamingCallable( + generateInitialChangeStreamPartitionsTransportSettings, + settings.generateInitialChangeStreamPartitionsSettings(), + clientContext); + this.readChangeStreamCallable = + callableFactory.createServerStreamingCallable( + readChangeStreamTransportSettings, settings.readChangeStreamSettings(), clientContext); + this.prepareQueryCallable = + callableFactory.createUnaryCallable( + prepareQueryTransportSettings, settings.prepareQuerySettings(), clientContext); + this.executeQueryCallable = + callableFactory.createServerStreamingCallable( + executeQueryTransportSettings, settings.executeQuerySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public ServerStreamingCallable readRowsCallable() { + return readRowsCallable; + } + + @Override + public ServerStreamingCallable + sampleRowKeysCallable() { + return sampleRowKeysCallable; + } + + @Override + public UnaryCallable mutateRowCallable() { + return mutateRowCallable; + } + + @Override + public ServerStreamingCallable mutateRowsCallable() { + return mutateRowsCallable; + } + + @Override + public UnaryCallable + checkAndMutateRowCallable() { + return checkAndMutateRowCallable; + } + + @Override + public UnaryCallable pingAndWarmCallable() { + return pingAndWarmCallable; + } + + @Override + public UnaryCallable + readModifyWriteRowCallable() { + return readModifyWriteRowCallable; + } + + @Override + public ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitionsCallable() { + return generateInitialChangeStreamPartitionsCallable; + } + + @Override + public ServerStreamingCallable + readChangeStreamCallable() { + return readChangeStreamCallable; + } + + @Override + public UnaryCallable prepareQueryCallable() { + return prepareQueryCallable; + } + + @Override + public ServerStreamingCallable executeQueryCallable() { + return executeQueryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java new file mode 100644 index 000000000000..ef3aad4cbfd2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java @@ -0,0 +1,252 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.ResponseParams; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.common.base.Strings; +import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.Attributes; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ClientInterceptors; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import io.grpc.alts.AltsContextUtil; +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.time.Duration; +import java.util.Base64; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.annotation.Nullable; + +@InternalApi +public class MetadataExtractorInterceptor implements ClientInterceptor { + private final SidebandData sidebandData = new SidebandData(); + + public GrpcCallContext injectInto(GrpcCallContext ctx) { + // TODO: migrate to using .withTransportChannel + // This will require a change on gax's side to expose the underlying ManagedChannel in + // GrpcTransportChannel (its currently package private). + return ctx.withChannel(ClientInterceptors.intercept(ctx.getChannel(), this)) + .withCallOptions(ctx.getCallOptions().withOption(SidebandData.KEY, sidebandData)); + } + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + sidebandData.reset(); + + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onHeaders(Metadata headers) { + sidebandData.onResponseHeaders(headers, getAttributes()); + super.onHeaders(headers); + } + + @Override + public void onClose(Status status, Metadata trailers) { + sidebandData.onClose(status, trailers, getAttributes()); + super.onClose(status, trailers); + } + }, + headers); + } + }; + } + + public SidebandData getSidebandData() { + return sidebandData; + } + + public static class SidebandData { + private static final CallOptions.Key KEY = + CallOptions.Key.create("bigtable-sideband"); + + @Nullable + public static SidebandData from(CallOptions callOptions) { + return callOptions.getOption(KEY); + } + + private static final Metadata.Key SERVER_TIMING_HEADER_KEY = + Metadata.Key.of("server-timing", Metadata.ASCII_STRING_MARSHALLER); + private static final Pattern SERVER_TIMING_HEADER_PATTERN = + Pattern.compile(".*dur=(?\\d+)"); + private static final Metadata.Key LOCATION_METADATA_KEY = + Metadata.Key.of("x-goog-ext-425905942-bin", Metadata.BINARY_BYTE_MARSHALLER); + private static final Metadata.Key PEER_INFO_KEY = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + + @Nullable private volatile ClusterInformation clusterInfo; + @Nullable private volatile PeerInfo peerInfo; + @Nullable private volatile Duration gfeTiming; + @Nullable private volatile Util.IpProtocol ipProtocol; + private volatile boolean isAlts = false; + + @Nullable + public ClusterInformation getClusterInfo() { + return clusterInfo; + } + + @Nullable + public PeerInfo getPeerInfo() { + return peerInfo; + } + + @Nullable + public Duration getGfeTiming() { + return gfeTiming; + } + + @Nullable + public Util.IpProtocol getIpProtocol() { + return ipProtocol; + } + + public boolean isAlts() { + return isAlts; + } + + private void reset() { + clusterInfo = null; + peerInfo = null; + gfeTiming = null; + ipProtocol = Util.IpProtocol.UNKNOWN; + } + + void onResponseHeaders(Metadata md, Attributes attributes) { + clusterInfo = extractClusterInfo(md); + gfeTiming = extractGfeLatency(md); + peerInfo = extractPeerInfo(md, gfeTiming, attributes); + ipProtocol = extractIpProtocol(attributes); + } + + void onClose(Status status, Metadata trailers, Attributes attributes) { + isAlts = AltsContextUtil.check(attributes); + if (ipProtocol == null) { + ipProtocol = extractIpProtocol(attributes); + } + if (clusterInfo == null) { + clusterInfo = extractClusterInfo(trailers); + } + } + + private static Util.IpProtocol extractIpProtocol(Attributes attributes) { + SocketAddress remoteAddr = attributes.get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + if (remoteAddr instanceof InetSocketAddress) { + InetSocketAddress inetAddr = (InetSocketAddress) remoteAddr; + if (inetAddr.getAddress() instanceof Inet4Address) { + return Util.IpProtocol.IPV4; + } else if (inetAddr.getAddress() instanceof Inet6Address) { + return Util.IpProtocol.IPV6; + } + } + return Util.IpProtocol.UNKNOWN; + } + + @Nullable + private static Duration extractGfeLatency(Metadata metadata) { + String serverTiming = metadata.get(SERVER_TIMING_HEADER_KEY); + if (serverTiming == null) { + return null; + } + Matcher matcher = SERVER_TIMING_HEADER_PATTERN.matcher(serverTiming); + // this should always be true + if (matcher.find()) { + return Duration.ofMillis(Long.parseLong(matcher.group("dur"))); + } + return null; + } + + @Nullable + private static PeerInfo extractPeerInfo( + Metadata metadata, Duration gfeTiming, Attributes attributes) { + String encodedStr = metadata.get(PEER_INFO_KEY); + PeerInfo peerInfo = PeerInfo.newBuilder().build(); + if (!Strings.isNullOrEmpty(encodedStr)) { + try { + byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); + peerInfo = PeerInfo.parseFrom(decoded); + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to parse " + + PEER_INFO_KEY.name() + + " from the response header value: " + + encodedStr); + } + } + + // TODO: remove this once transport_type is being sent by the server + // This is a temporary workaround to detect directpath until its available from + // the server + if (peerInfo.getTransportType() == PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { + peerInfo = + peerInfo.toBuilder() + .setTransportType(inferTransportType(gfeTiming, attributes)) + .build(); + } + + return peerInfo; + } + + private static PeerInfo.TransportType inferTransportType( + Duration gfeTiming, Attributes attributes) { + boolean isAlts = AltsContextUtil.check(attributes); + if (isAlts) { + return PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS; + } else if (gfeTiming != null) { + return PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH; + } + return PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN; + } + + @Nullable + private static ClusterInformation extractClusterInfo(Metadata metadata) { + byte[] encoded = metadata.get(LOCATION_METADATA_KEY); + if (encoded != null) { + try { + ResponseParams responseParams = ResponseParams.parseFrom(encoded); + return ClusterInformation.newBuilder() + .setZoneId(responseParams.getZoneId()) + .setClusterId(responseParams.getClusterId()) + .build(); + } catch (InvalidProtocolBufferException e) { + // Fail silently and return null + } + } + return null; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowsErrorConverterUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowsErrorConverterUnaryCallable.java new file mode 100644 index 000000000000..2b118df61e23 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowsErrorConverterUnaryCallable.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsAttemptResult; +import com.google.common.util.concurrent.MoreExecutors; +import io.grpc.Status; + +/** + * This callable converts partial batch failures into an exception. This is necessary to make sure + * that the caller properly handles issues and avoids possible data loss on partial failures + */ +@InternalApi +public class MutateRowsErrorConverterUnaryCallable extends UnaryCallable { + + private final UnaryCallable innerCallable; + + public MutateRowsErrorConverterUnaryCallable( + UnaryCallable callable) { + this.innerCallable = callable; + } + + @Override + public ApiFuture futureCall(BulkMutation request, ApiCallContext context) { + ApiFuture future = innerCallable.futureCall(request, context); + return ApiFutures.transform( + future, + result -> { + if (!result.getFailedMutations().isEmpty()) { + throw MutateRowsException.create( + null, + GrpcStatusCode.of(Status.Code.OK), + result.getFailedMutations(), + result.getIsRetryable()); + } + return null; + }, + MoreExecutors.directExecutor()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java new file mode 100644 index 000000000000..86c564bcc00a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import io.grpc.Channel; + +@InternalApi +public class NoOpChannelPrimer implements ChannelPrimer { + static NoOpChannelPrimer create() { + return new NoOpChannelPrimer(); + } + + private NoOpChannelPrimer() {} + + @Override + public void primeChannel(Channel channel) { + // No op + } + + @Override + public ApiFuture sendPrimeRequestsAsync(Channel channel) { + return ApiFutures.immediateFuture(PingAndWarmResponse.getDefaultInstance()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java new file mode 100644 index 000000000000..121a581101ab --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java @@ -0,0 +1,330 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.extractStatus; + +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.ResourceExhaustedException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.api.gax.rpc.UnavailableException; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.RateLimitInfo; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Stopwatch; +import com.google.common.util.concurrent.RateLimiter; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +class RateLimitingServerStreamingCallable + extends ServerStreamingCallable { + + private static final Logger logger = + Logger.getLogger(RateLimitingServerStreamingCallable.class.getName()); + + // When the mutation size is large, starting with a higher QPS will make + // the dataflow job fail very quickly. Start with lower QPS and increase + // the QPS gradually if the server doesn't push back + private static final long DEFAULT_QPS = 10; + + // Default interval before changing the QPS on error responses + private static final Duration DEFAULT_PERIOD = Duration.ofSeconds(10); + + // Minimum QPS to make sure the job is not stuck + private static final double MIN_QPS = 0.1; + private static final double MAX_QPS = 100_000; + + // QPS can be lowered to at most MIN_FACTOR * currentQps. When server returned + // an error, use MIN_FACTOR to calculate the new QPS. This is the same as + // the server side cap. + @VisibleForTesting static final double MIN_FACTOR = 0.7; + + // QPS can be increased to at most MAX_FACTOR * currentQps. This is the same + // as the server side cap + private static final double MAX_FACTOR = 1.3; + + private final ConditionalRateLimiter limiter; + + private final ServerStreamingCallable innerCallable; + + private BigtableTracer bigtableTracer; + + RateLimitingServerStreamingCallable( + @Nonnull ServerStreamingCallable innerCallable) { + this.limiter = new ConditionalRateLimiter(DEFAULT_QPS); + this.innerCallable = Preconditions.checkNotNull(innerCallable, "Inner callable must be set"); + } + + @Override + public void call( + MutateRowsRequest request, + ResponseObserver responseObserver, + ApiCallContext context) { + Stopwatch stopwatch = Stopwatch.createStarted(); + limiter.acquire(); + stopwatch.stop(); + if (context.getTracer() instanceof BigtableTracer) { + bigtableTracer = (BigtableTracer) context.getTracer(); + bigtableTracer.batchRequestThrottled(stopwatch.elapsed(TimeUnit.NANOSECONDS)); + } + RateLimitingResponseObserver innerObserver = new RateLimitingResponseObserver(responseObserver); + innerCallable.call(request, innerObserver, context); + } + + /** A rate limiter wrapper class that can be disabled. */ + static class ConditionalRateLimiter { + + private final AtomicBoolean enabled = new AtomicBoolean(false); + + private final RateLimiter limiter; + + // This is the next time allowed to change QPS or disable rate limiting. + private final AtomicReference nextRateUpdateTime = + new AtomicReference<>(Instant.now()); + + @SuppressWarnings("LongDoubleConversion") + public ConditionalRateLimiter(long defaultQps) { + limiter = RateLimiter.create(defaultQps); + logger.info( + "Batch write flow control: rate limiter is initiated (but disabled) with rate of " + + defaultQps + + " QPS."); + } + + /** + * Works the same way with {@link RateLimiter#acquire()} except that when the rate limiter is + * disabled, {@link ConditionalRateLimiter#acquire()} always returns immediately. + */ + public void acquire() { + if (enabled.get()) { + limiter.acquire(); + } + } + + /** + * Disables the rate limier if the current time exceeded the next rate update time. When + * disabled, the rate is retained and will be re-used if re-enabled later. + */ + public void tryDisable() { + // Only disable after the rate update time. + Instant nextTime = nextRateUpdateTime.get(); + Instant now = Instant.now(); + if (now.isAfter(nextTime)) { + boolean wasEnabled = this.enabled.getAndSet(false); + if (wasEnabled) { + logger.info("Batch write flow control: rate limiter is disabled."); + } + // No need to update nextRateUpdateTime, any new RateLimitInfo can enable rate limiting and + // update the rate again. + } + } + + /** Enables the rate limiter immediately. */ + public void enable() { + boolean wasEnabled = this.enabled.getAndSet(true); + if (!wasEnabled) { + logger.info("Batch write flow control: rate limiter is enabled."); + } + } + + public boolean isEnabled() { + return this.enabled.get(); + } + + public double getRate() { + return limiter.getRate(); + } + + /** + * Sets the rate and the next rate update time based on period, if the current time exceeds the + * next rate update time. Otherwise, no-op. + * + * @param rate The new rate of the rate limiter. + * @param period The period during which rate should not be updated again and the rate limiter + * should not be disabled. + * @param bigtableTracer The tracer for exporting client-side metrics. + * @param factor The capped factor that we're trying to apply. + * @param status The status of the response from which the factor is retrieved or derived. + */ + public void trySetRate( + double rate, + Duration period, + @Nullable BigtableTracer bigtableTracer, + double factor, + @Nullable Throwable status) { + Instant nextTime = nextRateUpdateTime.get(); + Instant now = Instant.now(); + + if (now.isBefore(nextTime)) { + if (bigtableTracer != null) { + bigtableTracer.addBatchWriteFlowControlFactor(factor, status, false); + } + return; + } + + Instant newNextTime = now.plusSeconds(period.getSeconds()); + + if (!nextRateUpdateTime.compareAndSet(nextTime, newNextTime)) { + // Someone else updated it already. + if (bigtableTracer != null) { + bigtableTracer.addBatchWriteFlowControlFactor(factor, status, false); + } + return; + } + final double oldRate = limiter.getRate(); + limiter.setRate(rate); + logger.info( + "Batch write flow control: updated max rate from " + + oldRate + + " to " + + rate + + " applied factor " + + factor + + " with period " + + period.getSeconds() + + " seconds. Status=" + + extractStatus(status)); + if (bigtableTracer != null) { + bigtableTracer.setBatchWriteFlowControlTargetQps(rate); + bigtableTracer.addBatchWriteFlowControlFactor(factor, status, true); + } + } + + @VisibleForTesting + void setEnabled(boolean enabled) { + this.enabled.set(enabled); + } + + @VisibleForTesting + void setRate(double rate) { + limiter.setRate(rate); + } + } + + class RateLimitingResponseObserver extends SafeResponseObserver { + + private final ResponseObserver outerObserver; + + RateLimitingResponseObserver(ResponseObserver observer) { + super(observer); + this.outerObserver = observer; + } + + @Override + protected void onStartImpl(StreamController controller) { + outerObserver.onStart(controller); + } + + private boolean hasValidRateLimitInfo(MutateRowsResponse response) { + // RateLimitInfo is an optional field. However, proto3 sub-message field always + // have presence even thought it's marked as "optional". Check the factor and + // period to make sure they're not 0. + if (!response.hasRateLimitInfo()) { + logger.finest("Batch write flow control: response carries no RateLimitInfo"); + return false; + } + + if (response.getRateLimitInfo().getFactor() <= 0 + || response.getRateLimitInfo().getPeriod().getSeconds() <= 0) { + logger.finest( + "Batch write flow control: response carries invalid RateLimitInfo=" + + response.getRateLimitInfo()); + return false; + } + + logger.finest( + "Batch write flow control: response carries valid RateLimitInfo=" + + response.getRateLimitInfo()); + return true; + } + + @Override + protected void onResponseImpl(MutateRowsResponse response) { + if (hasValidRateLimitInfo(response)) { + limiter.enable(); + RateLimitInfo info = response.getRateLimitInfo(); + updateQps( + info.getFactor(), + Duration.ofSeconds(com.google.protobuf.util.Durations.toSeconds(info.getPeriod())), + null); + } else { + limiter.tryDisable(); + } + outerObserver.onResponse(response); + } + + @Override + protected void onErrorImpl(Throwable t) { + // When server returns DEADLINE_EXCEEDED, UNAVAILABLE or RESOURCE_EXHAUSTED, + // assume cbt server is overloaded + if (t instanceof DeadlineExceededException + || t instanceof UnavailableException + || t instanceof ResourceExhaustedException) { + updateQps(MIN_FACTOR, DEFAULT_PERIOD, t); + } + outerObserver.onError(t); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + + private void updateQps(double factor, Duration period, @Nullable Throwable status) { + double cappedFactor = Math.min(Math.max(factor, MIN_FACTOR), MAX_FACTOR); + double currentRate = limiter.getRate(); + double cappedRate = Math.min(Math.max(currentRate * cappedFactor, MIN_QPS), MAX_QPS); + limiter.trySetRate(cappedRate, period, bigtableTracer, cappedFactor, status); + } + } + + @VisibleForTesting + AtomicReference getNextRateUpdateTime() { + return limiter.nextRateUpdateTime; + } + + @VisibleForTesting + double getCurrentRate() { + return limiter.getRate(); + } + + @VisibleForTesting + void setRate(double rate) { + limiter.setRate(rate); + } + + @VisibleForTesting + boolean getLimiterEnabled() { + return limiter.isEnabled(); + } + + @VisibleForTesting + void setLimiterEnabled(boolean enabled) { + limiter.setEnabled(enabled); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java new file mode 100644 index 000000000000..0133dd3c2ba7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java @@ -0,0 +1,127 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Base implementation of {@link ResponseObserver} that checks the state and catches all the + * throwables. + */ +@InternalApi +public abstract class SafeResponseObserver implements ResponseObserver { + + private static final Logger LOGGER = Logger.getLogger(SafeResponseObserver.class.getName()); + private AtomicBoolean isStarted = new AtomicBoolean(false); + private AtomicBoolean isClosed = new AtomicBoolean(false); + private StreamController streamController; + private ResponseObserver outerObserver; + + public SafeResponseObserver(ResponseObserver outerObserver) { + this.outerObserver = outerObserver; + } + + @Override + public final void onStart(StreamController streamController) { + if (!isStarted.compareAndSet(false, true)) { + throw new IllegalStateException("A stream is already started"); + } + + this.streamController = streamController; + try { + onStartImpl(streamController); + } catch (Throwable t) { + if (!isClosed.compareAndSet(false, true)) { + logException("Tried to cancel a closed stream"); + return; + } + streamController.cancel(); + outerObserver.onError(t); + } + } + + @Override + public final void onResponse(ResponseT response) { + if (isClosed.get()) { + logException("Received a response after the stream is closed"); + return; + } + try { + onResponseImpl(response); + } catch (Throwable t1) { + try { + if (!isClosed.compareAndSet(false, true)) { + logException("Tried to cancel a closed stream"); + return; + } + streamController.cancel(); + } catch (Throwable t2) { + t1.addSuppressed(t2); + } + outerObserver.onError(t1); + } + } + + @Override + public final void onError(Throwable throwable) { + if (!isClosed.compareAndSet(false, true)) { + logException("Received error after the stream is closed", throwable); + return; + } + + try { + onErrorImpl(throwable); + } catch (Throwable t) { + throwable.addSuppressed(t); + outerObserver.onError(throwable); + } + } + + @Override + public final void onComplete() { + if (!isClosed.compareAndSet(false, true)) { + logException("Tried to double close the stream"); + return; + } + + try { + onCompleteImpl(); + } catch (Throwable t) { + outerObserver.onError(t); + } + } + + private void logException(String message) { + LOGGER.log(Level.WARNING, message, new IllegalStateException(message)); + } + + private void logException(String message, Throwable cause) { + LOGGER.log(Level.WARNING, message, new IllegalStateException(message, cause)); + } + + protected abstract void onStartImpl(StreamController streamController); + + protected abstract void onResponseImpl(ResponseT response); + + protected abstract void onErrorImpl(Throwable throwable); + + protected abstract void onCompleteImpl(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java new file mode 100644 index 000000000000..034a4048d043 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.List; + +/** Simple wrapper for SampleRowKeys to wrap the request and response protobufs. */ +class SampleRowKeysCallableWithRequest + extends UnaryCallable> { + private final RequestContext requestContext; + private final UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> + inner; + + SampleRowKeysCallableWithRequest( + UnaryCallable> inner, + RequestContext requestContext) { + + this.requestContext = requestContext; + this.inner = inner; + } + + @Override + public ApiFuture> futureCall( + SampleRowKeysRequest request, ApiCallContext context) { + ApiFuture> rawResponse = + inner.futureCall(request.toProto(requestContext), context); + + return ApiFutures.transform( + rawResponse, + new ApiFunction, List>() { + @Override + public List apply(List rawResponse) { + return convert(rawResponse); + } + }, + MoreExecutors.directExecutor()); + } + + private static List convert(List rawResponse) { + ImmutableList.Builder results = ImmutableList.builder(); + + for (SampleRowKeysResponse element : rawResponse) { + results.add(KeyOffset.create(element.getRowKey(), element.getOffsetBytes())); + } + + return results.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallable.java new file mode 100644 index 000000000000..29b104965ed8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallable.java @@ -0,0 +1,72 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import java.util.function.Function; + +/** Callable to help crossing api boundary lines between models and protos */ +class TransformingServerStreamingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final Function requestTransformer; + private final Function responseTransformer; + + public TransformingServerStreamingCallable( + ServerStreamingCallable inner, + Function requestTransformer, + Function responseTransformer) { + this.inner = inner; + this.requestTransformer = requestTransformer; + this.responseTransformer = responseTransformer; + } + + @Override + public void call( + OuterReqT outerReqT, + ResponseObserver outerObserver, + ApiCallContext apiCallContext) { + InnerReqT innerReq = requestTransformer.apply(outerReqT); + + inner.call( + innerReq, + new SafeResponseObserver(outerObserver) { + @Override + public void onStartImpl(StreamController streamController) { + outerObserver.onStart(streamController); + } + + @Override + public void onResponseImpl(InnerRespT innerResp) { + outerObserver.onResponse(responseTransformer.apply(innerResp)); + } + + @Override + public void onErrorImpl(Throwable throwable) { + outerObserver.onError(throwable); + } + + @Override + public void onCompleteImpl() { + outerObserver.onComplete(); + } + }, + apiCallContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/Version.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/Version.java new file mode 100644 index 000000000000..1dac2fed0abb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:google-cloud-bigtable:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMerger.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMerger.java new file mode 100644 index 000000000000..30c6eb94b621 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMerger.java @@ -0,0 +1,118 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter; +import com.google.cloud.bigtable.gaxx.reframing.Reframer; +import com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver; +import com.google.common.base.Preconditions; +import java.util.ArrayDeque; +import java.util.Queue; + +/** + * An implementation of a {@link Reframer} that feeds the change stream record merging {@link + * ChangeStreamStateMachine}. + * + *

    {@link ReframingResponseObserver} pushes {@link ReadChangeStreamResponse}s into this class and + * pops a change stream record containing one of the following: 1) Heartbeat. 2) CloseStream. 3) + * ChangeStreamMutation(a representation of a fully merged logical mutation). + * + *

    Example usage: + * + *

    {@code
    + * ChangeStreamRecordMerger changeStreamRecordMerger =
    + *     new ChangeStreamRecordMerger<>(myChangeStreamRecordAdaptor);
    + *
    + * while(responseIterator.hasNext()) {
    + *   ReadChangeStreamResponse response = responseIterator.next();
    + *
    + *   if (changeStreamRecordMerger.hasFullFrame()) {
    + *     ChangeStreamRecord changeStreamRecord = changeStreamRecordMerger.pop();
    + *     // Do something with change stream record.
    + *   } else {
    + *     changeStreamRecordMerger.push(response);
    + *   }
    + * }
    + *
    + * if (changeStreamRecordMerger.hasPartialFrame()) {
    + *   throw new RuntimeException("Incomplete stream");
    + * }
    + *
    + * }
    + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + * + *

    Package-private for internal use. + * + * @see ReframingResponseObserver for more details + */ +@InternalApi +public class ChangeStreamRecordMerger + implements Reframer { + private final ChangeStreamStateMachine changeStreamStateMachine; + private final Queue changeStreamRecord; + + public ChangeStreamRecordMerger( + ChangeStreamRecordAdapter.ChangeStreamRecordBuilder + changeStreamRecordBuilder) { + changeStreamStateMachine = new ChangeStreamStateMachine<>(changeStreamRecordBuilder); + changeStreamRecord = new ArrayDeque<>(); + } + + @Override + public void push(ReadChangeStreamResponse response) { + switch (response.getStreamRecordCase()) { + case HEARTBEAT: + changeStreamStateMachine.handleHeartbeat(response.getHeartbeat()); + break; + case CLOSE_STREAM: + changeStreamStateMachine.handleCloseStream(response.getCloseStream()); + break; + case DATA_CHANGE: + changeStreamStateMachine.handleDataChange(response.getDataChange()); + break; + case STREAMRECORD_NOT_SET: + throw new IllegalStateException("Illegal stream record."); + } + if (changeStreamStateMachine.hasCompleteChangeStreamRecord()) { + changeStreamRecord.add(changeStreamStateMachine.consumeChangeStreamRecord()); + } + } + + @Override + public boolean hasFullFrame() { + return !changeStreamRecord.isEmpty(); + } + + @Override + public boolean hasPartialFrame() { + // Check if buffer in this class contains data. If an assembled is still not available, then + // that means `buffer` has been fully consumed. The last place to check is the + // ChangeStreamStateMachine buffer, to see if it's holding on to an incomplete change + // stream record. + return hasFullFrame() || changeStreamStateMachine.isChangeStreamRecordInProgress(); + } + + @Override + public ChangeStreamRecordT pop() { + return Preconditions.checkNotNull( + changeStreamRecord.poll(), + "ChangeStreamRecordMerger.pop() called when there are no change stream records."); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallable.java new file mode 100644 index 000000000000..5c6c07451b08 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallable.java @@ -0,0 +1,63 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter; +import com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver; + +/** + * A ServerStreamingCallable that consumes {@link ReadChangeStreamResponse}s and produces change + * stream records. + * + *

    This class delegates all the work to gax's {@link ReframingResponseObserver} and the logic to + * {@link ChangeStreamRecordMerger}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class ChangeStreamRecordMergingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final ChangeStreamRecordAdapter changeStreamRecordAdapter; + + public ChangeStreamRecordMergingCallable( + ServerStreamingCallable inner, + ChangeStreamRecordAdapter changeStreamRecordAdapter) { + this.inner = inner; + this.changeStreamRecordAdapter = changeStreamRecordAdapter; + } + + @Override + public void call( + ReadChangeStreamRequest request, + ResponseObserver responseObserver, + ApiCallContext context) { + ChangeStreamRecordAdapter.ChangeStreamRecordBuilder + changeStreamRecordBuilder = changeStreamRecordAdapter.createChangeStreamRecordBuilder(); + ChangeStreamRecordMerger merger = + new ChangeStreamRecordMerger<>(changeStreamRecordBuilder); + ReframingResponseObserver innerObserver = + new ReframingResponseObserver<>(responseObserver, merger); + inner.call(request, innerObserver, context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java new file mode 100644 index 000000000000..976992a25559 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java @@ -0,0 +1,625 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.ReadChangeStreamResponse.DataChange; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter.ChangeStreamRecordBuilder; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.cloud.bigtable.data.v2.models.Value; +import com.google.common.base.Preconditions; + +/** + * A state machine to produce change stream records from a stream of {@link + * ReadChangeStreamResponse}. A change stream record can be a Heartbeat, a CloseStream or a + * ChangeStreamMutation. + * + *

    There could be two types of chunking for a ChangeStreamMutation: + * + *

      + *
    • Non-SetCell chunking. For example, a ChangeStreamMutation has two mods, DeleteFamily and + * DeleteColumn. DeleteFamily is sent in the first {@link ReadChangeStreamResponse} and + * DeleteColumn is sent in the second {@link ReadChangeStreamResponse}. + *
    • {@link ReadChangeStreamResponse.MutationChunk} has a chunked {@link + * com.google.bigtable.v2.Mutation.SetCell} mutation. For example, a logical mutation has one + * big {@link Mutation.SetCell} mutation which is chunked into two {@link + * ReadChangeStreamResponse}s. The first {@link ReadChangeStreamResponse.DataChange} has the + * first half of the cell value, and the second {@link ReadChangeStreamResponse.DataChange} + * has the second half. + *
    + * + * This state machine handles both types of chunking. + * + *

    Building of the actual change stream record object is delegated to a {@link + * ChangeStreamRecordBuilder}. This class is not thread safe. + * + *

    The inputs are: + * + *

      + *
    • {@link ReadChangeStreamResponse.Heartbeat}s. + *
    • {@link ReadChangeStreamResponse.CloseStream}s. + *
    • {@link ReadChangeStreamResponse.DataChange}s, that must be merged to a + * ChangeStreamMutation. + *
    • ChangeStreamRecord consumption events that reset the state machine for the next change + * stream record. + *
    + * + *

    The outputs are: + * + *

      + *
    • Heartbeat records. + *
    • CloseStream records. + *
    • ChangeStreamMutation records. + *
    + * + *

    Expected Usage: + * + *

    {@code
    + * ChangeStreamStateMachine changeStreamStateMachine = new ChangeStreamStateMachine<>(myChangeStreamRecordAdapter);
    + * while(responseIterator.hasNext()) {
    + *   ReadChangeStreamResponse response = responseIterator.next();
    + *   switch (response.getStreamRecordCase()) {
    + *     case HEARTBEAT:
    + *       changeStreamStateMachine.handleHeartbeat(response.getHeartbeat());
    + *       break;
    + *     case CLOSE_STREAM:
    + *       changeStreamStateMachine.handleCloseStream(response.getCloseStream());
    + *       break;
    + *     case DATA_CHANGE:
    + *       changeStreamStateMachine.handleDataChange(response.getDataChange());
    + *       break;
    + *     case STREAMRECORD_NOT_SET:
    + *       throw new IllegalStateException("Illegal stream record.");
    + *   }
    + *   if (changeStreamStateMachine.hasCompleteChangeStreamRecord()) {
    + *       MyChangeStreamRecord = changeStreamStateMachine.consumeChangeStreamRecord();
    + *       // do something with the change stream record.
    + *   }
    + * }
    + * }
    + * + *

    Package-private for internal use. + * + * @param The type of row the adapter will build + */ +final class ChangeStreamStateMachine { + private final ChangeStreamRecordBuilder builder; + private State currentState; + // debug stats + private int numHeartbeats = 0; + private int numCloseStreams = 0; + private int numDataChanges = 0; + private int numNonCellMods = 0; + private int numCellChunks = 0; // 1 for non-chunked cell. + + /** + * Expected total size of a chunked SetCell value, given by the {@link + * ReadChangeStreamResponse.MutationChunk.ChunkInfo}. This value should be the same for all chunks + * of a SetCell. + */ + private int expectedTotalSizeOfChunkedSetCell = 0; + + private int actualTotalSizeOfChunkedSetCell = 0; + private ChangeStreamRecordT completeChangeStreamRecord; + + /** + * Initialize a new state machine that's ready for a new change stream record. + * + * @param builder The builder that will build the final change stream record. + */ + ChangeStreamStateMachine(ChangeStreamRecordBuilder builder) { + this.builder = builder; + reset(); + } + + /** + * Handle heartbeat events from the server. + * + *

    + *
    Valid states: + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_STREAM_RECORD} + *
    Resulting states: + *
    {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME} + *
    + */ + void handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + try { + numHeartbeats++; + currentState = currentState.handleHeartbeat(heartbeat); + } catch (RuntimeException e) { + currentState = ERROR; + throw e; + } + } + + /** + * Handle CloseStream events from the server. + * + *
    + *
    Valid states: + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_STREAM_RECORD} + *
    Resulting states: + *
    {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME} + *
    + */ + void handleCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + try { + numCloseStreams++; + currentState = currentState.handleCloseStream(closeStream); + } catch (RuntimeException e) { + currentState = ERROR; + throw e; + } + } + + /** + * Feeds a new dataChange into the state machine. If the dataChange is invalid, the state machine + * will throw an exception and should not be used for further input. + * + *
    + *
    Valid states: + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_STREAM_RECORD} + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_DATA_CHANGE} + *
    Resulting states: + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_DATA_CHANGE} + *
    {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME} + *
    + * + * @param dataChange The new chunk to process. + * @throws ChangeStreamStateMachine.InvalidInputException When the chunk is not applicable to the + * current state. + * @throws IllegalStateException When the internal state is inconsistent + */ + void handleDataChange(ReadChangeStreamResponse.DataChange dataChange) { + try { + numDataChanges++; + currentState = currentState.handleDataChange(dataChange); + } catch (RuntimeException e) { + currentState = ERROR; + throw e; + } + } + + /** + * Returns the completed change stream record and transitions to {@link + * ChangeStreamStateMachine#AWAITING_NEW_STREAM_RECORD}. + * + * @return The completed change stream record. + * @throws IllegalStateException If the last dataChange did not complete a change stream record. + */ + ChangeStreamRecordT consumeChangeStreamRecord() { + Preconditions.checkState( + completeChangeStreamRecord != null, "No change stream record to consume."); + Preconditions.checkState( + currentState == AWAITING_STREAM_RECORD_CONSUME, + "Change stream record is not ready to consume: " + currentState); + ChangeStreamRecordT changeStreamRecord = completeChangeStreamRecord; + reset(); + return changeStreamRecord; + } + + /** Checks if there is a complete change stream record to be consumed. */ + boolean hasCompleteChangeStreamRecord() { + return completeChangeStreamRecord != null && currentState == AWAITING_STREAM_RECORD_CONSUME; + } + + /** + * Checks if the state machine is in the middle of processing a change stream record. + * + * @return True If there is a change stream record in progress. + */ + boolean isChangeStreamRecordInProgress() { + return currentState != AWAITING_NEW_STREAM_RECORD; + } + + private void reset() { + currentState = AWAITING_NEW_STREAM_RECORD; + numHeartbeats = 0; + numCloseStreams = 0; + numDataChanges = 0; + numNonCellMods = 0; + numCellChunks = 0; + expectedTotalSizeOfChunkedSetCell = 0; + actualTotalSizeOfChunkedSetCell = 0; + completeChangeStreamRecord = null; + + builder.reset(); + } + + /** + * Base class for all the state machine's internal states. + * + *

    Each state can consume 3 events: Heartbeat, CloseStream and a Mod. By default, the default + * implementation will just throw an IllegalStateException unless the subclass adds explicit + * handling for these events. + */ + abstract static class State { + /** + * Accepts a Heartbeat by the server. And completes the current change stream record. + * + * @throws IllegalStateException If the subclass can't handle heartbeat events. + */ + ChangeStreamStateMachine.State handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + throw new IllegalStateException(); + } + + /** + * Accepts a CloseStream by the server. And completes the current change stream record. + * + * @throws IllegalStateException If the subclass can't handle CloseStream events. + */ + ChangeStreamStateMachine.State handleCloseStream( + ReadChangeStreamResponse.CloseStream closeStream) { + throw new IllegalStateException(); + } + + /** + * Accepts a new DataChange and transitions to the next state. A DataChange can have multiple + * mods, where each mod could be a DeleteFamily, a DeleteColumn, or a SetCell. + * + * @param dataChange The DataChange that holds the new mod to process. + * @return The next state. + * @throws IllegalStateException If the subclass can't handle the DataChange. + * @throws ChangeStreamStateMachine.InvalidInputException If the subclass determines that this + * dataChange is invalid. + */ + ChangeStreamStateMachine.State handleDataChange( + ReadChangeStreamResponse.DataChange dataChange) { + throw new IllegalStateException(); + } + } + + /** + * The default state when the state machine is awaiting a ReadChangeStream response to start a new + * change stream record. It will notify the builder of the new change stream record and transits + * to one of the following states: + * + *

    + *
    {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME}, in case of a Heartbeat + * or a CloseStream. + *
    Same as {@link ChangeStreamStateMachine#AWAITING_NEW_DATA_CHANGE}, depending on the + * DataChange. + *
    + */ + private final State AWAITING_NEW_STREAM_RECORD = + new State() { + @Override + State handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + validate( + completeChangeStreamRecord == null, + "AWAITING_NEW_STREAM_RECORD: Existing ChangeStreamRecord not consumed yet."); + completeChangeStreamRecord = builder.onHeartbeat(heartbeat); + return AWAITING_STREAM_RECORD_CONSUME; + } + + @Override + State handleCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + validate( + completeChangeStreamRecord == null, + "AWAITING_NEW_STREAM_RECORD: Existing ChangeStreamRecord not consumed yet."); + completeChangeStreamRecord = builder.onCloseStream(closeStream); + return AWAITING_STREAM_RECORD_CONSUME; + } + + @Override + State handleDataChange(ReadChangeStreamResponse.DataChange dataChange) { + validate( + completeChangeStreamRecord == null, + "AWAITING_NEW_STREAM_RECORD: Existing ChangeStreamRecord not consumed yet."); + validate( + !dataChange.getRowKey().isEmpty(), + "AWAITING_NEW_STREAM_RECORD: First data change missing rowKey."); + validate( + dataChange.hasCommitTimestamp(), + "AWAITING_NEW_STREAM_RECORD: First data change missing commit timestamp."); + validate( + dataChange.getChunksCount() > 0, + "AWAITING_NEW_STREAM_RECORD: First data change missing mods."); + if (dataChange.getType() == DataChange.Type.GARBAGE_COLLECTION) { + validate( + dataChange.getSourceClusterId().isEmpty(), + "AWAITING_NEW_STREAM_RECORD: GC mutation shouldn't have source cluster id."); + builder.startGcMutation( + dataChange.getRowKey(), + java.time.Instant.ofEpochSecond( + dataChange.getCommitTimestamp().getSeconds(), + dataChange.getCommitTimestamp().getNanos()), + dataChange.getTiebreaker()); + } else if (dataChange.getType() == DataChange.Type.USER) { + validate( + !dataChange.getSourceClusterId().isEmpty(), + "AWAITING_NEW_STREAM_RECORD: User initiated data change missing source cluster" + + " id."); + builder.startUserMutation( + dataChange.getRowKey(), + dataChange.getSourceClusterId(), + java.time.Instant.ofEpochSecond( + dataChange.getCommitTimestamp().getSeconds(), + dataChange.getCommitTimestamp().getNanos()), + dataChange.getTiebreaker()); + } else { + validate(false, "AWAITING_NEW_STREAM_RECORD: Unexpected type: " + dataChange.getType()); + } + return AWAITING_NEW_DATA_CHANGE.handleDataChange(dataChange); + } + }; + + /** + * A state to handle the next DataChange. + * + *
    + *
    Valid exit states: + *
    {@link ChangeStreamStateMachine#AWAITING_NEW_DATA_CHANGE}. All mods from the current + * DataChange are added, and we have more DataChange to expect. + *
    {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME}. Current DataChange is + * the last DataChange of the current logical mutation. + *
    + */ + private final State AWAITING_NEW_DATA_CHANGE = + new State() { + @Override + State handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + throw new IllegalStateException( + "AWAITING_NEW_DATA_CHANGE: Can't handle a Heartbeat in the middle of building a" + + " ChangeStreamMutation."); + } + + @Override + State handleCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + throw new IllegalStateException( + "AWAITING_NEW_DATA_CHANGE: Can't handle a CloseStream in the middle of building a" + + " ChangeStreamMutation."); + } + + @Override + State handleDataChange(ReadChangeStreamResponse.DataChange dataChange) { + // Iterate over all mods. + for (int index = 0; index < dataChange.getChunksCount(); ++index) { + ReadChangeStreamResponse.MutationChunk chunk = dataChange.getChunks(index); + Mutation mod = chunk.getMutation(); + // Case 1: SetCell + if (mod.hasSetCell()) { + Mutation.SetCell setCell = chunk.getMutation().getSetCell(); + // Case 1_1: Current SetCell is NOT chunked, in which case there is no ChunkInfo. + if (!chunk.hasChunkInfo()) { + builder.startCell( + setCell.getFamilyName(), + setCell.getColumnQualifier(), + setCell.getTimestampMicros()); + numCellChunks++; + builder.cellValue(setCell.getValue()); + builder.finishCell(); + continue; + } else { + // Case 1_2: This chunk is from a chunked SetCell, which must be one of the + // following: + // Case 1_2_1: The first chunk of a chunked SetCell. For example: SetCell_chunk_1 + // in + // [ReadChangeStreamResponse1: {..., SetCell_chunk_1}, ReadChangeStreamResponse2: + // {SetCell_chunk_2, ...}]. + // Case 1_2_2: A non-first chunk from a chunked SetCell. For example: + // SetCell_chunk_2 in + // [ReadChangeStreamResponse1: {..., SetCell_chunk_1}, ReadChangeStreamResponse2: + // {SetCell_chunk_2, ...}]. Note that in this case this chunk must be the first + // chunk for the current DataChange, because a SetCell can NOT be chunked within + // the same DataChange, i.e. there is no such DataChange as + // [ReadChangeStreamResponse: {SetCell_chunk_1, SetCell_chunk_2}]. + if (chunk.getChunkInfo().getChunkedValueOffset() == 0) { + // Case 1_2_1 + validate( + chunk.getChunkInfo().getChunkedValueSize() > 0, + "AWAITING_NEW_DATA_CHANGE: First chunk of a chunked cell must have a positive" + + " chunked value size."); + expectedTotalSizeOfChunkedSetCell = chunk.getChunkInfo().getChunkedValueSize(); + actualTotalSizeOfChunkedSetCell = 0; + builder.startCell( + setCell.getFamilyName(), + setCell.getColumnQualifier(), + setCell.getTimestampMicros()); + } else { + // Case 1_2_2 + validate( + index == 0, + "AWAITING_NEW_DATA_CHANGE: Non-first chunked SetCell must be the first mod of" + + " a DataChange."); + } + // Concatenate the cell value of this mod into the builder. + validate( + chunk.getChunkInfo().getChunkedValueSize() == expectedTotalSizeOfChunkedSetCell, + "AWAITING_NEW_DATA_CHANGE: Chunked cell value size must be the same for all" + + " chunks."); + numCellChunks++; + builder.cellValue(setCell.getValue()); + actualTotalSizeOfChunkedSetCell += setCell.getValue().size(); + // If it's the last chunk of the chunked SetCell, finish the cell. + if (chunk.getChunkInfo().getLastChunk()) { + builder.finishCell(); + validate( + actualTotalSizeOfChunkedSetCell == expectedTotalSizeOfChunkedSetCell, + "Chunked value size in ChunkInfo doesn't match the actual total size. " + + "Expected total size: " + + expectedTotalSizeOfChunkedSetCell + + "; actual total size: " + + actualTotalSizeOfChunkedSetCell); + continue; + } else { + // If this is not the last chunk of a chunked SetCell, then this must be the last + // mod of the current response, and we're expecting the rest of the chunked cells + // in the following ReadChangeStream response. + validate( + index == dataChange.getChunksCount() - 1, + "AWAITING_NEW_DATA_CHANGE: Current mod is a chunked SetCell but not the last" + + " chunk, but it's not the last mod of the current response."); + return AWAITING_NEW_DATA_CHANGE; + } + } + } + // Case 2: DeleteFamily + if (mod.hasDeleteFromFamily()) { + numNonCellMods++; + builder.deleteFamily(mod.getDeleteFromFamily().getFamilyName()); + continue; + } + // Case 3: DeleteCell + if (mod.hasDeleteFromColumn()) { + numNonCellMods++; + builder.deleteCells( + mod.getDeleteFromColumn().getFamilyName(), + mod.getDeleteFromColumn().getColumnQualifier(), + TimestampRange.create( + mod.getDeleteFromColumn().getTimeRange().getStartTimestampMicros(), + mod.getDeleteFromColumn().getTimeRange().getEndTimestampMicros())); + continue; + } + // Case 4: AddToCell + if (mod.hasAddToCell()) { + builder.addToCell( + mod.getAddToCell().getFamilyName(), + Value.fromProto(mod.getAddToCell().getColumnQualifier()), + Value.fromProto(mod.getAddToCell().getTimestamp()), + Value.fromProto(mod.getAddToCell().getInput())); + continue; + } + // Case 5: MergeToCell + if (mod.hasMergeToCell()) { + builder.mergeToCell( + mod.getMergeToCell().getFamilyName(), + Value.fromProto(mod.getMergeToCell().getColumnQualifier()), + Value.fromProto(mod.getMergeToCell().getTimestamp()), + Value.fromProto(mod.getMergeToCell().getInput())); + continue; + } + throw new IllegalStateException( + "Received unknown mod type. You may need to upgrade your Bigtable client."); + } + + // After adding all mods from this DataChange to the state machine, finish the current + // logical mutation, or wait for the next DataChange response. + return checkAndFinishMutationIfNeeded(dataChange); + } + }; + + /** + * A state that represents a completed change stream record. It prevents new change stream records + * from being read until the current one has been consumed. The caller is supposed to consume the + * change stream record by calling {@link ChangeStreamStateMachine#consumeChangeStreamRecord()} + * which will reset the state to {@link ChangeStreamStateMachine#AWAITING_NEW_STREAM_RECORD}. + */ + private final State AWAITING_STREAM_RECORD_CONSUME = + new State() { + @Override + State handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + throw new IllegalStateException( + "AWAITING_STREAM_RECORD_CONSUME: Skipping completed change stream record."); + } + + @Override + State handleCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + throw new IllegalStateException( + "AWAITING_STREAM_RECORD_CONSUME: Skipping completed change stream record."); + } + + @Override + State handleDataChange(ReadChangeStreamResponse.DataChange dataChange) { + throw new IllegalStateException( + "AWAITING_STREAM_RECORD_CONSUME: Skipping completed change stream record."); + } + }; + + /** + * A state that represents a broken state of the state machine. Any method called on this state + * will get an exception. + */ + private final State ERROR = + new State() { + @Override + State handleHeartbeat(ReadChangeStreamResponse.Heartbeat heartbeat) { + throw new IllegalStateException("ERROR: Failed to handle Heartbeat."); + } + + @Override + State handleCloseStream(ReadChangeStreamResponse.CloseStream closeStream) { + throw new IllegalStateException("ERROR: Failed to handle CloseStream."); + } + + @Override + State handleDataChange(ReadChangeStreamResponse.DataChange dataChange) { + throw new IllegalStateException("ERROR: Failed to handle DataChange."); + } + }; + + /** + * Check if we should continue handling DataChanges in the following responses or wrap up. There + * are 2 cases: + * + *
      + *
    • 1) dataChange.done == true -> current change stream mutation is complete. Wrap it up and + * return {@link ChangeStreamStateMachine#AWAITING_STREAM_RECORD_CONSUME}. + *
    • 2) dataChange.done != true -> current change stream mutation isn't complete. Return + * {@link ChangeStreamStateMachine#AWAITING_NEW_DATA_CHANGE} to wait for more mods in the + * next ReadChangeStreamResponse. + *
    + */ + private State checkAndFinishMutationIfNeeded(ReadChangeStreamResponse.DataChange dataChange) { + // This function is called when all the mods in this DataChange have been handled. We should + // finish up the logical mutation or wait for more mods in the next ReadChangeStreamResponse, + // depending on whether the current response is the last response for the logical mutation. + if (dataChange.getDone()) { + // Case 1: Current change stream mutation is complete. + validate(!dataChange.getToken().isEmpty(), "Last data change missing token"); + validate(dataChange.hasEstimatedLowWatermark(), "Last data change missing lowWatermark"); + completeChangeStreamRecord = + builder.finishChangeStreamMutation( + dataChange.getToken(), + java.time.Instant.ofEpochSecond( + dataChange.getEstimatedLowWatermark().getSeconds(), + dataChange.getEstimatedLowWatermark().getNanos())); + return AWAITING_STREAM_RECORD_CONSUME; + } + // Case 2: The current DataChange itself is chunked, so wait for the next + // ReadChangeStreamResponse. Note that we should wait for the new data change instead + // of for the new change stream record since the current record hasn't finished yet. + return AWAITING_NEW_DATA_CHANGE; + } + + private void validate(boolean condition, String message) { + if (!condition) { + throw new ChangeStreamStateMachine.InvalidInputException( + message + + ". numHeartbeats: " + + numHeartbeats + + ", numCloseStreams: " + + numCloseStreams + + ", numDataChanges: " + + numDataChanges + + ", numNonCellMods: " + + numNonCellMods + + ", numCellChunks: " + + numCellChunks + + ", expectedTotalSizeOfChunkedSetCell: " + + expectedTotalSizeOfChunkedSetCell + + ", actualTotalSizeOfChunkedSetCell: " + + actualTotalSizeOfChunkedSetCell); + } + } + + static class InvalidInputException extends RuntimeException { + InvalidInputException(String message) { + super(message); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallable.java new file mode 100644 index 000000000000..ce07018c5277 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallable.java @@ -0,0 +1,98 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.changestream; + +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; + +/** + * Simple wrapper for GenerateInitialChangeStreamPartitions to wrap the request and response + * protobufs. + */ +public class GenerateInitialChangeStreamPartitionsUserCallable + extends ServerStreamingCallable { + private final RequestContext requestContext; + private final ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + inner; + + public GenerateInitialChangeStreamPartitionsUserCallable( + ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + inner, + RequestContext requestContext) { + this.requestContext = requestContext; + this.inner = inner; + } + + @Override + public void call( + String tableId, ResponseObserver responseObserver, ApiCallContext context) { + String tableName = + NameUtil.formatTableName( + requestContext.getProjectId(), requestContext.getInstanceId(), tableId); + GenerateInitialChangeStreamPartitionsRequest request = + GenerateInitialChangeStreamPartitionsRequest.newBuilder() + .setTableName(tableName) + .setAppProfileId(requestContext.getAppProfileId()) + .build(); + + inner.call(request, new ConvertPartitionToRangeObserver(responseObserver), context); + } + + private static class ConvertPartitionToRangeObserver + implements ResponseObserver { + + private final ResponseObserver outerObserver; + + ConvertPartitionToRangeObserver(ResponseObserver observer) { + this.outerObserver = observer; + } + + @Override + public void onStart(final StreamController controller) { + outerObserver.onStart(controller); + } + + @Override + public void onResponse(GenerateInitialChangeStreamPartitionsResponse response) { + ByteStringRange byteStringRange = + ByteStringRange.create( + response.getPartition().getRowRange().getStartKeyClosed(), + response.getPartition().getRowRange().getEndKeyOpen()); + outerObserver.onResponse(byteStringRange); + } + + @Override + public void onError(Throwable t) { + outerObserver.onError(t); + } + + @Override + public void onComplete() { + outerObserver.onComplete(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java new file mode 100644 index 000000000000..716e9eaf0c88 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java @@ -0,0 +1,105 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamContinuationTokens; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter; + +/** + * An implementation of a {@link StreamResumptionStrategy} for change stream records. This class + * tracks the continuation token and upon retry can build a request to resume the stream from where + * it left off. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class ReadChangeStreamResumptionStrategy + implements StreamResumptionStrategy { + private final ChangeStreamRecordAdapter changeStreamRecordAdapter; + private String token = null; + + public ReadChangeStreamResumptionStrategy( + ChangeStreamRecordAdapter changeStreamRecordAdapter) { + this.changeStreamRecordAdapter = changeStreamRecordAdapter; + } + + @Override + public boolean canResume() { + return true; + } + + @Override + public StreamResumptionStrategy createNew() { + return new ReadChangeStreamResumptionStrategy<>(changeStreamRecordAdapter); + } + + @Override + public ChangeStreamRecordT processResponse(ChangeStreamRecordT response) { + // Update the token from a Heartbeat or a ChangeStreamMutation. + // We don't worry about resumption after CloseStream, since the server + // will close the stream with an OK status right after sending a CloseStream, + // no matter what status the CloseStream.Status is: + // 1) ... => CloseStream.Ok => final OK. This means the read finishes successfully. + // 2) ... => CloseStream.Error => final OK. This means the client should start + // a new ReadChangeStream call with the continuation tokens specified in + // CloseStream. + // Either case, we don't need to retry after receiving a CloseStream. + if (changeStreamRecordAdapter.isHeartbeat(response)) { + this.token = changeStreamRecordAdapter.getTokenFromHeartbeat(response); + } else if (changeStreamRecordAdapter.isChangeStreamMutation(response)) { + this.token = changeStreamRecordAdapter.getTokenFromChangeStreamMutation(response); + } + return response; + } + + /** + * {@inheritDoc} + * + *

    Given a request, this implementation will narrow that request to include data changes that + * come after {@link #token}. + */ + @Override + public ReadChangeStreamRequest getResumeRequest(ReadChangeStreamRequest originalRequest) { + // A null token means that we have not successfully read a Heartbeat nor a ChangeStreamMutation, + // so start from the beginning. + if (this.token == null) { + return originalRequest; + } + + ReadChangeStreamRequest.Builder builder = originalRequest.toBuilder(); + // We need to clear the start_from and use the updated continuation_tokens + // to resume the request. + // The partition should always be the same as the one from the original request, + // otherwise we would receive a CloseStream with different + // partitions(which indicates tablet split/merge events). + builder.clearStartFrom(); + builder.setContinuationTokens( + StreamContinuationTokens.newBuilder() + .addTokens( + StreamContinuationToken.newBuilder() + .setPartition(originalRequest.getPartition()) + .setToken(this.token) + .build()) + .build()); + + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallable.java new file mode 100644 index 000000000000..0c78199ccdae --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallable.java @@ -0,0 +1,51 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; + +/** + * A ServerStreamingCallable that converts a {@link ReadChangeStreamQuery} to a {@link + * ReadChangeStreamRequest}. + */ +@InternalApi("Used in Changestream beam pipeline.") +public class ReadChangeStreamUserCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final RequestContext requestContext; + + public ReadChangeStreamUserCallable( + ServerStreamingCallable inner, + RequestContext requestContext) { + this.inner = inner; + this.requestContext = requestContext; + } + + @Override + public void call( + ReadChangeStreamQuery request, + ResponseObserver responseObserver, + ApiCallContext context) { + ReadChangeStreamRequest innerRequest = request.toProto(requestContext); + inner.call(innerRequest, responseObserver, context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java new file mode 100644 index 000000000000..df27fbd8429c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java @@ -0,0 +1,121 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.BaseApiTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BigtableTracerStreamingCallable; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BigtableTracerUnaryCallable; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import java.time.Duration; +import javax.annotation.Nullable; + +/** + * A Bigtable specific {@link ApiTracer} that includes additional contexts. This class is a base + * implementation that does nothing. + */ +// NOTE: this class was part of the public surface so can't move to +// com.google.cloud.bigtable.data.v2.internal.csm with the rest of the metrics. +@BetaApi("This surface is not stable yet it might be removed in the future.") +public class BigtableTracer extends BaseApiTracer { + + private volatile int attempt = 0; + + @Override + public void attemptStarted(int attemptNumber) { + this.attempt = attemptNumber; + } + + /** annotate when onRequest is called. This will be called in BuiltinMetricsTracer. */ + public void onRequest(int requestCount) { + // noop + } + + /** + * annotate when automatic flow control is disabled. This will be called in BuiltinMetricsTracer. + */ + public void disableFlowControl() { + // noop + } + + /** annotate after the callback from onResponse. This will be called in BuiltinMetricsTracer. */ + public void afterResponse(long applicationLatency) { + // noop + } + + /** + * Used by BigtableUnaryOperationCallable to signal that the user visible portion of the RPC is + * complete and that metrics should freeze the timers and then publish the frozen values when the + * internal portion of the operation completes. + */ + public void operationFinishEarly() {} + + /** + * Get the attempt number of the current call. Attempt number for the current call is passed in + * and should be recorded in {@link #attemptStarted(int)}. With the getter we can access it from + * {@link ApiCallContext}. Attempt number starts from 0. + */ + public int getAttempt() { + return attempt; + } + + /** Adds an annotation of the total throttled time of a batch. */ + public void batchRequestThrottled(long throttledTimeMs) { + // noop + } + + public void setSidebandData(MetadataExtractorInterceptor.SidebandData sidebandData) { + // noop + } + + /** Called when the message is sent on a grpc channel. */ + public void grpcMessageSent() { + // noop + } + + /** + * Record the operation timeout from user settings for calculating remaining deadline. Currently, + * it's called in BuiltinMetricsTracer on attempt start from {@link BigtableTracerUnaryCallable} + * and {@link BigtableTracerStreamingCallable}. + */ + public void setTotalTimeoutDuration(Duration totalTimeoutDuration) { + // noop + } + + /** + * Record the target QPS for batch write flow control. + * + * @param targetQps The new target QPS for the client. + */ + @InternalApi + public void setBatchWriteFlowControlTargetQps(double targetQps) {} + + /** + * Record the factors received from server-side for batch write flow control. The factors are + * capped by min and max allowed factor values. Status and whether the factor was actually applied + * are also recorded. + * + * @param factor Capped factor from server-side. For non-OK response, min factor is used. + * @param status The status of the response from which the factor is retrieved or derived. + * @param applied Whether the factor was actually applied. + */ + @InternalApi + public void addBatchWriteFlowControlFactor( + double factor, @Nullable Throwable status, boolean applied) {} +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java new file mode 100644 index 000000000000..2ec4fdfed441 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java @@ -0,0 +1,73 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.auth.Credentials; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import java.io.IOException; +import java.util.concurrent.ScheduledExecutorService; +import javax.annotation.Nullable; + +/** + * @deprecated this class is no longer used and is empty. It only exists because it's symbols were + * part of the public surface. + */ +@Deprecated +public class BuiltinMetricsView { + private BuiltinMetricsView() {} + + @Deprecated + public static void registerBuiltinMetrics(String projectId, SdkMeterProviderBuilder builder) + throws IOException {} + + @Deprecated + public static void registerBuiltinMetrics(SdkMeterProviderBuilder builder) throws IOException {} + + @Deprecated + public static void registerBuiltinMetrics( + String projectId, @Nullable Credentials credentials, SdkMeterProviderBuilder builder) + throws IOException {} + + @Deprecated + public static void registerBuiltinMetrics( + String projectId, + @Nullable Credentials credentials, + SdkMeterProviderBuilder builder, + @Nullable String endpoint) + throws IOException {} + + @Deprecated + public static void registerBuiltinMetrics( + @Nullable Credentials credentials, SdkMeterProviderBuilder builder, @Nullable String endpoint) + throws IOException {} + + @Deprecated + public static void registerBuiltinMetrics( + @Nullable Credentials credentials, + SdkMeterProviderBuilder builder, + @Nullable String endpoint, + @Nullable ScheduledExecutorService executorService) + throws IOException {} + + @Deprecated + static void registerBuiltinMetricsWithUniverseDomain( + @Nullable Credentials credentials, + SdkMeterProviderBuilder builder, + @Nullable String endpoint, + String universeDomain, + @Nullable ScheduledExecutorService executorService) + throws IOException {} +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java new file mode 100644 index 000000000000..66041e8aca13 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.auth.Credentials; +import com.google.common.base.MoreObjects; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import java.io.IOException; +import java.util.concurrent.ScheduledExecutorService; + +/** + * Set a custom OpenTelemetry instance. + * + *

    To register client side metrics on the custom OpenTelemetry: + * + *

    {@code
    + * SdkMeterProviderBuilder sdkMeterProvider = SdkMeterProvider.builder();
    + *
    + * // Override MetricsProvider in BigtableDataSettings
    + * BigtableDataSettings settings = BigtableDataSettings.newBuilder()
    + *   .setProjectId("my-project")
    + *   .setInstanceId("my-instance-id")
    + *   .setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)
    + *   .build();
    + * }
    + */ +public final class CustomOpenTelemetryMetricsProvider implements MetricsProvider { + + private final OpenTelemetry otel; + + public static CustomOpenTelemetryMetricsProvider create(OpenTelemetry otel) { + return new CustomOpenTelemetryMetricsProvider(otel); + } + + private CustomOpenTelemetryMetricsProvider(OpenTelemetry otel) { + this.otel = otel; + } + + public OpenTelemetry getOpenTelemetry() { + return otel; + } + + /** + * @deprecated this is no longer needed and is now a no-op + */ + @Deprecated + public static void setupSdkMeterProvider(SdkMeterProviderBuilder builder) throws IOException {} + + /** + * @deprecated this is no longer needed and is now a no-op + */ + @Deprecated + public static void setupSdkMeterProvider(SdkMeterProviderBuilder builder, Credentials credentials) + throws IOException {} + + /** + * @deprecated this is no longer needed and is now a no-op + */ + @Deprecated + public static void setupSdkMeterProvider(SdkMeterProviderBuilder builder, String endpoint) + throws IOException {} + + /** + * @deprecated this is no longer needed and is now a no-op + */ + @Deprecated + public static void setupSdkMeterProvider( + SdkMeterProviderBuilder builder, Credentials credentials, String endpoint) + throws IOException {} + + /** + * @deprecated this is no longer needed and is now a no-op + */ + @Deprecated + public static void setupSdkMeterProvider( + SdkMeterProviderBuilder builder, + Credentials credentials, + String endpoint, + ScheduledExecutorService executor) + throws IOException {} + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("openTelemetry", otel).toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java new file mode 100644 index 000000000000..02cdf7c257e7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java @@ -0,0 +1,35 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.metrics; + +/** + * Set {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)}, + * to {@link DefaultMetricsProvider#INSTANCE} to enable collecting and export client side metrics + * https://cloud.google.com/bigtable/docs/client-side-metrics. This is the default setting in {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings}. + */ +public final class DefaultMetricsProvider implements MetricsProvider { + + public static DefaultMetricsProvider INSTANCE = new DefaultMetricsProvider(); + + private DefaultMetricsProvider() {} + + @Override + public String toString() { + return "DefaultMetricsProvider"; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsProvider.java new file mode 100644 index 000000000000..251bb41619d6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsProvider.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.InternalExtensionOnly; + +/** + * Provide client side metrics https://cloud.google.com/bigtable/docs/client-side-metrics + * implementations. + */ +@InternalExtensionOnly +public interface MetricsProvider {} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java new file mode 100644 index 000000000000..66d0dfdcae9f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java @@ -0,0 +1,58 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; +import com.google.common.base.MoreObjects; + +/** + * Set {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)}, + * to {@link NoopMetricsProvider#INSTANCE} to disable collecting and export of client side metrics. + */ +public final class NoopMetricsProvider implements MetricsProvider { + + public static NoopMetricsProvider INSTANCE = new NoopMetricsProvider(); + + private NoopMetricsProvider() {} + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).toString(); + } + + /** A no-op implementation of {@link DirectPathCompatibleTracer}. */ + public static final class NoopDirectPathCompatibleTracer implements DirectPathCompatibleTracer { + + public static final NoopDirectPathCompatibleTracer INSTANCE = + new NoopDirectPathCompatibleTracer(); + + private NoopDirectPathCompatibleTracer() {} + + @Override + public void recordSuccess(Util.IpProtocol ipProtocol) { + // No-op + } + + @Override + public void recordFailure(DirectAccessInvestigator.FailureReason reason) { + // No-op + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java new file mode 100644 index 000000000000..c4948a20bf14 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java @@ -0,0 +1,69 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcViewConstants; +import com.google.common.annotations.VisibleForTesting; +import io.opencensus.stats.Stats; +import io.opencensus.stats.View; +import io.opencensus.stats.ViewManager; + +@Deprecated +public class RpcViews { + private static boolean gfeMetricsRegistered = false; + + /** Registers all Bigtable specific views. */ + public static void registerBigtableClientViews() { + registerBigtableClientViews(Stats.getViewManager()); + } + + /** + * Register views for GFE metrics, including gfe_latency and gfe_header_missing_count. gfe_latency + * measures the latency between Google's network receives an RPC and reads back the first byte of + * the response. gfe_header_missing_count is a counter of the number of RPC responses without a + * server-timing header. + */ + public static void registerBigtableClientGfeViews() { + registerBigtableClientGfeViews(Stats.getViewManager()); + } + + @InternalApi + @VisibleForTesting + public static void registerBigtableClientViews(ViewManager viewManager) { + for (View view : RpcViewConstants.BIGTABLE_CLIENT_VIEWS_SET) { + viewManager.registerView(view); + } + } + + @InternalApi + @VisibleForTesting + public static void registerBigtableClientGfeViews(ViewManager viewManager) { + for (View view : RpcViewConstants.GFE_VIEW_SET) { + viewManager.registerView(view); + } + gfeMetricsRegistered = true; + } + + static boolean isGfeMetricsRegistered() { + return gfeMetricsRegistered; + } + + @VisibleForTesting + static void setGfeMetricsRegistered(boolean gfeMetricsRegistered) { + RpcViews.gfeMetricsRegistered = gfeMetricsRegistered; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersServerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersServerStreamingCallable.java new file mode 100644 index 000000000000..edc794c230fc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersServerStreamingCallable.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; + +/** + * A callable that injects client timestamp and current attempt number to request headers. Attempt + * number starts from 0. + */ +@InternalApi("For internal use only") +public final class StatsHeadersServerStreamingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable innerCallable; + + public StatsHeadersServerStreamingCallable(ServerStreamingCallable innerCallable) { + this.innerCallable = innerCallable; + } + + @Override + public void call( + RequestT request, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + ApiCallContext newCallContext = + apiCallContext.withExtraHeaders(Util.createStatsHeaders(apiCallContext)); + innerCallable.call(request, responseObserver, newCallContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersUnaryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersUnaryCallable.java new file mode 100644 index 000000000000..1e7b67a6fb3c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersUnaryCallable.java @@ -0,0 +1,43 @@ +/* + * 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; + +/** + * A callable that injects client timestamp and current attempt number to request headers. Attempt + * number starts from 0. + */ +@InternalApi("For internal use only") +public final class StatsHeadersUnaryCallable + extends UnaryCallable { + private final UnaryCallable innerCallable; + + public StatsHeadersUnaryCallable(UnaryCallable innerCallable) { + this.innerCallable = innerCallable; + } + + @Override + public ApiFuture futureCall(RequestT request, ApiCallContext apiCallContext) { + ApiCallContext newCallContext = + apiCallContext.withExtraHeaders(Util.createStatsHeaders(apiCallContext)); + return innerCallable.futureCall(request, newCallContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java new file mode 100644 index 000000000000..a5e3ebea68c0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub.metrics; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.common.collect.ImmutableMap; +import io.grpc.Metadata; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** Utilities to help integrating with OpenCensus. */ +@InternalApi("For internal use only") +public class Util { + static final Metadata.Key ATTEMPT_HEADER_KEY = + Metadata.Key.of("bigtable-attempt", Metadata.ASCII_STRING_MARSHALLER); + static final Metadata.Key ATTEMPT_EPOCH_KEY = + Metadata.Key.of("bigtable-client-attempt-epoch-usec", Metadata.ASCII_STRING_MARSHALLER); + + /** + * Add attempt number and client timestamp from api call context to request headers. Attempt + * number starts from 0. + */ + static Map> createStatsHeaders(ApiCallContext apiCallContext) { + ImmutableMap.Builder> headers = ImmutableMap.builder(); + headers.put( + ATTEMPT_EPOCH_KEY.name(), + Arrays.asList(String.valueOf(Instant.EPOCH.until(Instant.now(), ChronoUnit.MICROS)))); + // This should always be true + if (apiCallContext.getTracer() instanceof BigtableTracer) { + int attemptCount = ((BigtableTracer) apiCallContext.getTracer()).getAttempt(); + headers.put(ATTEMPT_HEADER_KEY.name(), Arrays.asList(String.valueOf(attemptCount))); + } + return headers.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java new file mode 100644 index 000000000000..94980a80a225 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; + +/** + * A callable to convert user-facing {@link BulkMutation}s to {@link MutateRowsRequest}s. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public final class BulkMutateRowsUserFacingCallable + extends UnaryCallable { + + private final UnaryCallable innerCallable; + private final RequestContext requestContext; + + public BulkMutateRowsUserFacingCallable( + UnaryCallable innerCallable, + RequestContext requestContext) { + this.innerCallable = innerCallable; + this.requestContext = requestContext; + } + + @Override + public ApiFuture futureCall( + BulkMutation request, ApiCallContext context) { + return innerCallable.futureCall(request.toProto(requestContext), context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java new file mode 100644 index 000000000000..4796ad48a094 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java @@ -0,0 +1,377 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.MutateRowsResponse.Entry; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import com.google.cloud.bigtable.gaxx.retrying.NonCancellableFuture; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.primitives.Ints; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +// TODO: Try to generalize this using a BatchingDescriptor +/** + * A stateful {@link Callable} that can be used with gax's {@link + * com.google.api.gax.retrying.RetryingExecutor} and {@link RetryingFuture}. + * + *

    For every {@link #call()}, it will: + * + *

      + *
    • Send the current request to the {@link #innerCallable} + *
    • On RPC completion it will inspect the response. If any entries failed (including the whole + * RPC), it will update its internal state so that the next {@link #call()} will only contain + * entries that have transient failures. + *
    + * + *

    Expected usage: + * + *

    {@code
    + * MutateRowsAttemptCallable attemptCallable = new MutateRowsAttemptCallable(
    + *   stub.mutateRowsCallable().all(),
    + *   request,
    + *   clientContext.getDefaultCallContext(),
    + *   ImmutableSet.of(Code.UNAVAILABLE));
    + *
    + * RetryingExecutor retryingExecutor = ...;
    + * RetryingFuture retryingFuture = retryingExecutor.createFuture(attemptCallable);
    + * retryCallable.setExternalFuture(retryingFuture);
    + * retryCallable.call();
    + *
    + * try {
    + *   retryingFuture.get();
    + * } catch(ExecutionException executionError) {
    + *   MutateRowsException e = (MutateRowsException) executionError.getCause();
    + *
    + *   for (FailedMutation m : e.getFailedMutations() {
    + *     // handle permanent failures
    + *   }
    + * }
    + * }
    + * + *

    Package-private for internal use. + */ +class MutateRowsAttemptCallable implements Callable { + // Synthetic status for Mutations that didn't get a result (because the whole RPC failed). It will + // be exposed in MutateRowsException's FailedMutations. + private static final StatusCode LOCAL_UNKNOWN_STATUS = + new StatusCode() { + @Override + public StatusCode.Code getCode() { + return Code.UNKNOWN; + } + + @Override + public Object getTransportCode() { + return null; + } + }; + + // Everything needed to issue an RPC + @Nonnull private final UnaryCallable> innerCallable; + @Nonnull private final ApiCallContext callContext; + @Nonnull private MutateRowsRequest currentRequest; + + // Everything needed to build a retry request + @Nullable private List originalIndexes; + @Nonnull private final Set retryableCodes; + @Nonnull private final List permanentFailures; + @Nonnull private final RetryAlgorithm retryAlgorithm; + @Nonnull private TimedAttemptSettings attemptSettings; + + // Parent controller + private RetryingFuture externalFuture; + + // Simple wrappers for handling result futures + private final ApiFunction, MutateRowsAttemptResult> + attemptSuccessfulCallback = + new ApiFunction, MutateRowsAttemptResult>() { + @Override + public MutateRowsAttemptResult apply(List responses) { + return handleAttemptSuccess(responses); + } + }; + + private final ApiFunction> attemptFailedCallback = + new ApiFunction>() { + @Override + public List apply(Throwable throwable) { + handleAttemptError(throwable); + return null; + } + }; + + MutateRowsAttemptCallable( + @Nonnull UnaryCallable> innerCallable, + @Nonnull MutateRowsRequest originalRequest, + @Nonnull ApiCallContext callContext, + @Nonnull Set retryableCodes, + @Nonnull RetryAlgorithm retryAlgorithm) { + this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable"); + this.currentRequest = Preconditions.checkNotNull(originalRequest, "currentRequest"); + this.callContext = Preconditions.checkNotNull(callContext, "callContext"); + this.retryableCodes = Preconditions.checkNotNull(retryableCodes, "retryableCodes"); + this.retryAlgorithm = retryAlgorithm; + // TODO: pass in the callContext so that the retry setting can be overridden per call + this.attemptSettings = retryAlgorithm.createFirstAttempt(null); + + permanentFailures = Lists.newArrayList(); + } + + public void setExternalFuture(RetryingFuture externalFuture) { + this.externalFuture = externalFuture; + } + + /** + * Send the current request and the parent {@link RetryingFuture} with this attempt's future. + * + *

    On RPC completion this method will preprocess all errors (both RPC level and entry level) + * and wrap them in a {@link MutateRowsException}. Please note that the results of the RPC are + * only available in the attempt future that is set on the parent {@link RetryingFuture} and the + * return of this method should just be ignored. + */ + @Override + public MutateRowsAttemptResult call() { + try { + // externalFuture is set from MutateRowsRetryingCallable before invoking this method. It + // shouldn't be null unless the code changed + Preconditions.checkNotNull( + externalFuture, "External future must be set before starting an attempt"); + + // attemptStared should be called at the very start of the operation. This will initialize + // variables in ApiTracer and avoid exceptions when the tracer marks the attempt as finished + callContext + .getTracer() + .attemptStarted( + currentRequest, externalFuture.getAttemptSettings().getOverallAttemptCount()); + + Preconditions.checkState( + currentRequest.getEntriesCount() > 0, "Request doesn't have any mutations to send"); + + // Configure the deadline + ApiCallContext currentCallContext = callContext; + if (currentCallContext.getTimeout() == null + && !externalFuture.getAttemptSettings().getRpcTimeout().isZero()) { + currentCallContext = + currentCallContext.withTimeout(externalFuture.getAttemptSettings().getRpcTimeout()); + } + + // Handle concurrent cancellation + externalFuture.setAttemptFuture(new NonCancellableFuture<>()); + if (externalFuture.isDone()) { + return null; + } + + // Make the actual call + ApiFuture> innerFuture = + innerCallable.futureCall(currentRequest, currentCallContext); + + // Handle RPC level errors by wrapping them in a MutateRowsException + ApiFuture> catching = + ApiFutures.catching( + innerFuture, Throwable.class, attemptFailedCallback, MoreExecutors.directExecutor()); + + // Inspect the results and either propagate the success, or prepare to retry the failed + // mutations + ApiFuture transformed = + ApiFutures.transform(catching, attemptSuccessfulCallback, MoreExecutors.directExecutor()); + + // Notify the parent of the attempt + externalFuture.setAttemptFuture(transformed); + } catch (Throwable e) { + externalFuture.setAttemptFuture(ApiFutures.immediateFailedFuture(e)); + } + + return null; + } + + /** + * Handle an RPC level failure by generating a {@link FailedMutation} for each expected entry. The + * newly generated {@link FailedMutation}s will be combined with the permanentFailures to give the + * caller the whole picture since the first call. This method will always throw a {@link + * MutateRowsException}. + */ + private void handleAttemptError(Throwable rpcError) { + ApiException entryError = createSyntheticErrorForRpcFailure(rpcError); + ImmutableList.Builder allFailures = ImmutableList.builder(); + MutateRowsRequest lastRequest = currentRequest; + + allFailures.addAll(permanentFailures); + + MutateRowsRequest.Builder builder = lastRequest.toBuilder().clearEntries(); + List newOriginalIndexes = Lists.newArrayList(); + + attemptSettings = retryAlgorithm.createNextAttempt(null, entryError, null, attemptSettings); + + for (int i = 0; i < currentRequest.getEntriesCount(); i++) { + int origIndex = getOriginalIndex(i); + + FailedMutation failedMutation = FailedMutation.create(origIndex, entryError); + allFailures.add(failedMutation); + + if (!retryAlgorithm.shouldRetry(null, failedMutation.getError(), null, attemptSettings)) { + permanentFailures.add(failedMutation); + } else { + // Schedule the mutation entry for the next RPC by adding it to the request builder and + // recording its original index + newOriginalIndexes.add(origIndex); + builder.addEntries(lastRequest.getEntries(i)); + } + } + + currentRequest = builder.build(); + originalIndexes = newOriginalIndexes; + + throw MutateRowsException.create( + rpcError, entryError.getStatusCode(), allFailures.build(), builder.getEntriesCount() > 0); + } + + /** + * Handle entry level failures. All new response entries are inspected for failure. If any + * transient failures are found, their corresponding mutations are scheduled for the next RPC. The + * caller is notified of both new found errors and pre-existing permanent errors in the thrown + * {@link MutateRowsException}. If no errors exist, then the attempt future is successfully + * completed. We don't currently handle RetryInfo on entry level failures. + */ + private MutateRowsAttemptResult handleAttemptSuccess(List responses) { + List allFailures = Lists.newArrayList(permanentFailures); + MutateRowsRequest lastRequest = currentRequest; + + MutateRowsRequest.Builder builder = lastRequest.toBuilder().clearEntries(); + List newOriginalIndexes = Lists.newArrayList(); + boolean[] seenIndices = new boolean[currentRequest.getEntriesCount()]; + + for (MutateRowsResponse response : responses) { + for (Entry entry : response.getEntriesList()) { + seenIndices[Ints.checkedCast(entry.getIndex())] = true; + + if (entry.getStatus().getCode() == com.google.rpc.Code.OK_VALUE) { + continue; + } + + int origIndex = getOriginalIndex((int) entry.getIndex()); + + FailedMutation failedMutation = + FailedMutation.create(origIndex, createEntryError(entry.getStatus())); + + allFailures.add(failedMutation); + + if (!failedMutation.getError().isRetryable()) { + permanentFailures.add(failedMutation); + } else { + // Schedule the mutation entry for the next RPC by adding it to the request builder and + // recording it's original index + newOriginalIndexes.add(origIndex); + builder.addEntries(lastRequest.getEntries((int) entry.getIndex())); + } + } + } + + // Handle missing mutations + for (int i = 0; i < seenIndices.length; i++) { + if (seenIndices[i]) { + continue; + } + + int origIndex = getOriginalIndex(i); + FailedMutation failedMutation = + FailedMutation.create( + origIndex, + ApiExceptionFactory.createException( + "Missing entry response for entry " + origIndex, + null, + GrpcStatusCode.of(io.grpc.Status.Code.INTERNAL), + false)); + + allFailures.add(failedMutation); + permanentFailures.add(failedMutation); + } + + currentRequest = builder.build(); + originalIndexes = newOriginalIndexes; + + if (!allFailures.isEmpty()) { + boolean isRetryable = builder.getEntriesCount() > 0; + return MutateRowsAttemptResult.create(allFailures, isRetryable); + } + return MutateRowsAttemptResult.success(); + } + + /** + * Remap the entry index in the current attempt back to its original index in the first request. + */ + private int getOriginalIndex(int index) { + return (originalIndexes != null) ? originalIndexes.get(index) : index; + } + + /** Convert an entry's status from a protobuf to an {@link ApiException}. */ + private ApiException createEntryError(com.google.rpc.Status protoStatus) { + io.grpc.Status grpcStatus = + io.grpc.Status.fromCodeValue(protoStatus.getCode()) + .withDescription(protoStatus.getMessage()); + + StatusCode gaxStatusCode = GrpcStatusCode.of(grpcStatus.getCode()); + + return ApiExceptionFactory.createException( + grpcStatus.asRuntimeException(), + gaxStatusCode, + retryableCodes.contains(gaxStatusCode.getCode())); + } + + /** + * Create a synthetic {@link ApiException} for an individual entry. When the entire RPC fails, it + * implies that all entries failed as well. This helper is used to make that behavior explicit. + * The generated exception will have the overall error as its cause. + */ + private static ApiException createSyntheticErrorForRpcFailure(Throwable overallRequestError) { + if (overallRequestError instanceof ApiException) { + ApiException requestApiException = (ApiException) overallRequestError; + + return ApiExceptionFactory.createException( + overallRequestError, + requestApiException.getStatusCode(), + requestApiException.isRetryable(), + requestApiException.getErrorDetails()); + } + + return ApiExceptionFactory.createException( + "Didn't receive a result for this mutation entry", + overallRequestError, + LOCAL_UNKNOWN_STATUS, + false); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptResult.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptResult.java new file mode 100644 index 000000000000..d668c2a50f4b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptResult.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nonnull; + +/** + * This class represents the result of a MutateRows attempt. It contains a potentially empty list of + * failed mutations, along with an indicator whether these errors are retryable. + */ +@InternalApi +@AutoValue +public abstract class MutateRowsAttemptResult { + + public abstract List getFailedMutations(); + + public abstract boolean getIsRetryable(); + + @InternalApi + @Nonnull + public static MutateRowsAttemptResult create( + List failedMutations, boolean isRetryable) { + return new AutoValue_MutateRowsAttemptResult(failedMutations, isRetryable); + } + + @InternalApi + @Nonnull + public static MutateRowsAttemptResult success() { + return new AutoValue_MutateRowsAttemptResult(new ArrayList<>(), false); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchResource.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchResource.java new file mode 100644 index 000000000000..2702dcf64225 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchResource.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.gax.batching.BatchResource; +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; + +/** + * A custom implementation of {@link BatchResource} because MutateRowsRequest has a limit on number + * of mutations. + */ +@AutoValue +abstract class MutateRowsBatchResource implements BatchResource { + + static MutateRowsBatchResource create(long elementCount, long byteCount, long mutationCount) { + return new AutoValue_MutateRowsBatchResource(elementCount, byteCount, mutationCount); + } + + @Override + public BatchResource add(BatchResource batchResource) { + Preconditions.checkArgument( + batchResource instanceof MutateRowsBatchResource, + "Expected MutateRowsBatchResource, got " + batchResource.getClass()); + MutateRowsBatchResource mutateRowsResource = (MutateRowsBatchResource) batchResource; + + return new AutoValue_MutateRowsBatchResource( + getElementCount() + mutateRowsResource.getElementCount(), + getByteCount() + mutateRowsResource.getByteCount(), + getMutationCount() + mutateRowsResource.getMutationCount()); + } + + @Override + public abstract long getElementCount(); + + @Override + public abstract long getByteCount(); + + abstract long getMutationCount(); + + @Override + public boolean shouldFlush(long maxElementThreshold, long maxBytesThreshold) { + return getElementCount() > maxElementThreshold + || getByteCount() > maxBytesThreshold + || getMutationCount() > 100000; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java new file mode 100644 index 000000000000..87f5c88d3eb1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.BatchEntry; +import com.google.api.gax.batching.BatchResource; +import com.google.api.gax.batching.BatchingDescriptor; +import com.google.api.gax.batching.BatchingRequestBuilder; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; + +/** + * A custom implementation of a {@link BatchingDescriptor} to split batching response into + * individual row response and in a {@link MutateRowsException}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications directly. + */ +@InternalApi("For internal use only") +public class MutateRowsBatchingDescriptor + implements BatchingDescriptor { + + @Override + public BatchingRequestBuilder newRequestBuilder( + BulkMutation prototype) { + return new RequestBuilder(prototype); + } + + @Override + public void splitResponse( + MutateRowsAttemptResult response, List> entries) { + // For every failed mutation in the response, we set the exception on the matching requested + // mutation. It is important to set the correct error on the correct mutation. When the entry is + // later read, it resolves the exception first, and only later it goes to the value set by + // set(). + for (FailedMutation mutation : response.getFailedMutations()) { + entries.get(mutation.getIndex()).getResultFuture().setException(mutation.getError()); + } + for (BatchEntry batchResponse : entries) { + batchResponse.getResultFuture().set(null); + } + } + + /** + * Marks the entry future with received {@link Throwable}. + * + *

    In case throwable is {@link MutateRowsException}, then it only sets throwable for the + * entries whose index is mentioned {@link MutateRowsException#getFailedMutations()}. + */ + @Override + public void splitException( + Throwable throwable, List> entries) { + if (!(throwable instanceof MutateRowsException)) { + for (BatchEntry entry : entries) { + entry.getResultFuture().setException(throwable); + } + return; + } + + List failedMutations = ((MutateRowsException) throwable).getFailedMutations(); + Map entryErrors = Maps.newHashMap(); + + for (FailedMutation failure : failedMutations) { + entryErrors.put(failure.getIndex(), failure.getError()); + } + + int i = 0; + for (BatchEntry entry : entries) { + Throwable entryError = entryErrors.get(i++); + if (entryError == null) { + entry.getResultFuture().set(null); + } else { + entry.getResultFuture().setException(entryError); + } + } + } + + @Override + public long countBytes(RowMutationEntry entry) { + return entry.toProto().getSerializedSize(); + } + + @Override + public BatchResource createResource(RowMutationEntry element) { + long byteCount = countBytes(element); + return MutateRowsBatchResource.create(1, byteCount, element.toProto().getMutationsCount()); + } + + @Override + public BatchResource createEmptyResource() { + return MutateRowsBatchResource.create(0, 0, 0); + } + + /** + * A {@link BatchingRequestBuilder} that will spool mutations and send them out as a {@link + * BulkMutation}. + */ + static class RequestBuilder implements BatchingRequestBuilder { + private BulkMutation bulkMutation; + + RequestBuilder(BulkMutation prototype) { + this.bulkMutation = prototype.clone(); + } + + @Override + public void add(RowMutationEntry entry) { + bulkMutation.add(entry); + } + + @Override + public BulkMutation build() { + return bulkMutation; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsPartialErrorRetryAlgorithm.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsPartialErrorRetryAlgorithm.java new file mode 100644 index 000000000000..9c7035db9647 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsPartialErrorRetryAlgorithm.java @@ -0,0 +1,79 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.ResultRetryAlgorithmWithContext; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.retrying.TimedAttemptSettings; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * This algorithm will retry if there was a retryable failed mutation, or if there wasn't but the + * underlying algorithm allows a retry. + */ +@InternalApi +public class MutateRowsPartialErrorRetryAlgorithm + implements ResultRetryAlgorithmWithContext { + private final ResultRetryAlgorithmWithContext retryAlgorithm; + + public MutateRowsPartialErrorRetryAlgorithm( + ResultRetryAlgorithmWithContext retryAlgorithm) { + this.retryAlgorithm = retryAlgorithm; + } + + @Override + public boolean shouldRetry( + Throwable previousThrowable, MutateRowsAttemptResult previousResponse) { + // handle partial retryable failures + if (previousResponse != null && !previousResponse.getFailedMutations().isEmpty()) { + return previousResponse.getIsRetryable(); + } + // business as usual + return retryAlgorithm.shouldRetry(previousThrowable, previousResponse); + } + + @Override + public boolean shouldRetry( + @Nullable RetryingContext context, + Throwable previousThrowable, + MutateRowsAttemptResult previousResponse) { + // handle partial retryable failures + if (previousResponse != null && !previousResponse.getFailedMutations().isEmpty()) { + return previousResponse.getIsRetryable(); + } + // business as usual + return retryAlgorithm.shouldRetry(context, previousThrowable, previousResponse); + } + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable previousThrowable, + MutateRowsAttemptResult previousResponse, + TimedAttemptSettings previousSettings) { + return retryAlgorithm.createNextAttempt(previousThrowable, previousResponse, previousSettings); + } + + @Override + public TimedAttemptSettings createNextAttempt( + RetryingContext context, + Throwable previousThrowable, + MutateRowsAttemptResult previousResponse, + TimedAttemptSettings previousSettings) { + return retryAlgorithm.createNextAttempt( + context, previousThrowable, previousResponse, previousSettings); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java new file mode 100644 index 000000000000..354a5ea54ace --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java @@ -0,0 +1,83 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetryingExecutorWithContext; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import javax.annotation.Nonnull; + +/** + * A UnaryCallable wrapper around {@link MutateRowsAttemptCallable}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications directly. + * + * @see MutateRowsAttemptCallable for more details. + */ +@InternalApi +public class MutateRowsRetryingCallable + extends UnaryCallable { + private final ApiCallContext callContextPrototype; + private final ServerStreamingCallable callable; + private final RetryingExecutorWithContext executor; + private final ImmutableSet retryCodes; + private final RetryAlgorithm retryAlgorithm; + + public MutateRowsRetryingCallable( + @Nonnull ApiCallContext callContextPrototype, + @Nonnull ServerStreamingCallable callable, + @Nonnull RetryingExecutorWithContext executor, + @Nonnull Set retryCodes, + @Nonnull RetryAlgorithm retryAlgorithm) { + this.callContextPrototype = Preconditions.checkNotNull(callContextPrototype); + this.callable = Preconditions.checkNotNull(callable); + this.executor = Preconditions.checkNotNull(executor); + this.retryCodes = ImmutableSet.copyOf(retryCodes); + this.retryAlgorithm = retryAlgorithm; + } + + @Override + public RetryingFuture futureCall( + MutateRowsRequest request, ApiCallContext inputContext) { + ApiCallContext context = callContextPrototype.nullToSelf(inputContext); + MutateRowsAttemptCallable retryCallable = + new MutateRowsAttemptCallable(callable.all(), request, context, retryCodes, retryAlgorithm); + + RetryingFuture retryingFuture = + executor.createFuture(retryCallable, context); + retryCallable.setExternalFuture(retryingFuture); + retryCallable.call(); + + return retryingFuture; + } + + @Override + public String toString() { + return String.format("retrying(%s)", callable); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsUserFacingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsUserFacingCallable.java new file mode 100644 index 000000000000..ca9773ac99c8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsUserFacingCallable.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.RowMutation; + +/** + * Simple wrapper for BulkMutations to wrap the request and response protobufs. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class MutateRowsUserFacingCallable extends UnaryCallable { + private final UnaryCallable inner; + private final RequestContext requestContext; + + public MutateRowsUserFacingCallable( + UnaryCallable inner, RequestContext requestContext) { + + this.inner = inner; + this.requestContext = requestContext; + } + + @Override + public ApiFuture futureCall(RowMutation request, ApiCallContext context) { + return inner.futureCall(request.toBulkProto(requestContext), context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/package-info.java new file mode 100644 index 000000000000..d274ef02cd94 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/package-info.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 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. + */ +/** + * Implementation details for {@link + * com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub#bulkMutateRowsCallable()}. + * + *

    The implementation adapts gax's {@link com.google.api.gax.rpc.BatchingCallable} to work with + * Bigtable's MutateRows RPC. There are 3 customizations that are necessary: + * + *

      + *
    • BulkMutationsUserFacingCallable: Wraps request and response protobufs. + *
    • BulkMutationsSpoolingCallable: The Bigtable protocol streams results from the mutations as + * they are applied. However gax's {@link com.google.api.gax.rpc.BatchingCallable} is designed + * for {@link com.google.api.gax.rpc.UnaryCallable}s. This adapter spools the responses and + * presents the results as if they came from a {@link com.google.api.gax.rpc.UnaryCallable}. + *
    • BulkMutateRowsBatchingDescriptor: Each entry can fail independently from the overall + * request. The descriptor splits the results for each entry and notifies the responsible + * issuer. + *
    + * + *

    This package is considered an internal implementation detail and is not meant to be used by + * applications directly. + */ +package com.google.cloud.bigtable.data.v2.stub.mutaterows; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java new file mode 100644 index 000000000000..181006b6c371 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java @@ -0,0 +1,106 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; + +/** + * Remove the special marker rows generated by {@link RowMergingCallable}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class FilterMarkerRowsCallable extends ServerStreamingCallable { + private final ServerStreamingCallable innerCallable; + private final RowAdapter rowAdapter; + + public FilterMarkerRowsCallable( + ServerStreamingCallable inner, RowAdapter rowAdapter) { + this.rowAdapter = rowAdapter; + this.innerCallable = inner; + } + + @Override + public void call( + ReadRowsRequest request, ResponseObserver responseObserver, ApiCallContext context) { + FilteringResponseObserver innerObserver = new FilteringResponseObserver(responseObserver); + innerCallable.call(request, innerObserver, context); + } + + private class FilteringResponseObserver extends SafeResponseObserver { + private final ResponseObserver outerObserver; + private StreamController innerController; + private boolean autoFlowControl = true; + + FilteringResponseObserver(ResponseObserver outerObserver) { + super(outerObserver); + this.outerObserver = outerObserver; + } + + @Override + protected void onStartImpl(final StreamController controller) { + innerController = controller; + + outerObserver.onStart( + new StreamController() { + @Override + public void cancel() { + controller.cancel(); + } + + @Override + public void disableAutoInboundFlowControl() { + autoFlowControl = false; + controller.disableAutoInboundFlowControl(); + } + + @Override + public void request(int count) { + controller.request(count); + } + }); + } + + @Override + protected void onResponseImpl(RowT response) { + if (rowAdapter.isScanMarkerRow(response)) { + if (!autoFlowControl) { + innerController.request(1); + } + } else { + outerObserver.onResponse(response); + } + } + + @Override + protected void onErrorImpl(Throwable t) { + outerObserver.onError(t); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java new file mode 100644 index 000000000000..93b6b548ddcd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java @@ -0,0 +1,169 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.api.gax.rpc.ApiException; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowSet; +import com.google.cloud.bigtable.data.v2.internal.RowSetUtil; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.stub.BigtableStreamResumptionStrategy; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import java.util.Base64; +import java.util.logging.Logger; + +/** + * An implementation of a {@link StreamResumptionStrategy} for merged rows. This class tracks - + * + *

      + *
    • row key for the last row that was read successfully + *
    • row key for large-row that couldn't be read + *
    • list of all row keys for large-rows + *
    + * + * Upon retry this class builds a request to omit the large rows & retry from the last row key that + * was successfully read. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class LargeReadRowsResumptionStrategy + extends BigtableStreamResumptionStrategy { + private static final Logger LOGGER = + Logger.getLogger(LargeReadRowsResumptionStrategy.class.getName()); + private final RowAdapter rowAdapter; + private ByteString lastSuccessKey = ByteString.EMPTY; + // Number of rows processed excluding Marker row. + private long numProcessed; + private ByteString largeRowKey = ByteString.EMPTY; + // we modify the original request in the resumption strategy regardless of how many times it has + // failed, {@code previousFailedRequestRowset} is stored for the use case of continuous large rows + // row-keys + private RowSet previousFailedRequestRowset = null; + + public LargeReadRowsResumptionStrategy(RowAdapter rowAdapter) { + this.rowAdapter = rowAdapter; + } + + @Override + public boolean canResume() { + return true; + } + + @Override + public StreamResumptionStrategy createNew() { + return new LargeReadRowsResumptionStrategy<>(rowAdapter); + } + + @Override + public RowT processResponse(RowT response) { + // Last key can come from both the last processed row key and a synthetic row marker. The + // synthetic row marker is emitted when the server has read a lot of data that was filtered out. + // The row marker can be used to trim the start of the scan, but does not contribute to the row + // limit. + lastSuccessKey = rowAdapter.getKey(response); + + if (!rowAdapter.isScanMarkerRow(response)) { + // Only real rows count towards the rows limit. + numProcessed++; + } + return response; + } + + @Override + public Throwable processError(Throwable throwable) { + ByteString rowKeyExtracted = extractLargeRowKey(throwable); + if (rowKeyExtracted != null) { + LOGGER.warning("skipping large row " + rowKeyExtracted); + this.largeRowKey = rowKeyExtracted; + numProcessed = numProcessed + 1; + } + return throwable; + } + + private ByteString extractLargeRowKey(Throwable t) { + if (t instanceof ApiException + && ((ApiException) t).getReason() != null + && ((ApiException) t).getReason().equals("LargeRowReadError")) { + String rowKey = ((ApiException) t).getMetadata().get("rowKeyBase64Encoded"); + + byte[] decodedBytes = Base64.getDecoder().decode(rowKey); + return ByteString.copyFrom(decodedBytes); + } + return null; + } + + /** + * {@inheritDoc} + * + *

    This returns an updated request excluding all the rows keys & ranges till (including) {@link + * #lastSuccessKey} & also excludes the last encountered large row key ({@link #largeRowKey}). + * Also, this implementation takes care to update the row limit of the request to account for all + * of the received rows. + */ + @Override + public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest) { + + // An empty lastSuccessKey means that we have not successfully read the first row, + // so resume with the original request object. + if (lastSuccessKey.isEmpty() && largeRowKey.isEmpty()) { + return originalRequest; + } + + RowSet remaining; + if (previousFailedRequestRowset == null) { + remaining = originalRequest.getRows(); + } else { + remaining = previousFailedRequestRowset; + } + + if (!lastSuccessKey.isEmpty()) { + remaining = RowSetUtil.erase(remaining, lastSuccessKey, !originalRequest.getReversed()); + } + if (!largeRowKey.isEmpty()) { + remaining = RowSetUtil.eraseLargeRow(remaining, largeRowKey); + } + this.largeRowKey = ByteString.EMPTY; + + previousFailedRequestRowset = remaining; + + // Edge case: retrying a fulfilled request. + // A fulfilled request is one that has had all of its row keys and ranges fulfilled, or if it + // had a row limit, has seen enough rows. These requests are replaced with a marker request that + // will be handled by ReadRowsRetryCompletedCallable. See docs in ReadRowsRetryCompletedCallable + // for more details. + if (remaining == null + || (originalRequest.getRowsLimit() > 0 && originalRequest.getRowsLimit() == numProcessed)) { + return ReadRowsRetryCompletedCallable.FULFILLED_REQUEST_MARKER; + } + + ReadRowsRequest.Builder builder = originalRequest.toBuilder().setRows(remaining); + + if (originalRequest.getRowsLimit() > 0) { + Preconditions.checkState( + originalRequest.getRowsLimit() > numProcessed, + "Processed rows and number of large rows should not exceed the row limit in the original" + + " request"); + builder.setRowsLimit(originalRequest.getRowsLimit() - numProcessed); + } + + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptor.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptor.java new file mode 100644 index 000000000000..36a9dec1e783 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptor.java @@ -0,0 +1,86 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.batching.BatchEntry; +import com.google.api.gax.batching.BatchingDescriptor; +import com.google.api.gax.batching.BatchingRequestBuilder; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.protobuf.ByteString; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Implementation for {@link BatchingDescriptor} to split batch response or exception into + * individual row request. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications directly. + */ +@InternalApi("For internal use only") +public class ReadRowsBatchingDescriptor + implements BatchingDescriptor> { + + @Override + public BatchingRequestBuilder newRequestBuilder(Query query) { + return new BulkReadRequestBuilder(query); + } + + @Override + public void splitResponse(List rowsResponse, List> entries) { + Map rowKeys = new HashMap<>(); + for (Row row : rowsResponse) { + rowKeys.put(row.getKey(), row); + } + + for (BatchEntry entry : entries) { + entry.getResultFuture().set(rowKeys.get(entry.getElement())); + } + } + + @Override + public void splitException(Throwable throwable, List> entries) { + for (BatchEntry resultEntry : entries) { + resultEntry.getResultFuture().setException(throwable); + } + } + + @Override + public long countBytes(ByteString bytes) { + return bytes.size(); + } + + static class BulkReadRequestBuilder implements BatchingRequestBuilder { + private final Query query; + + BulkReadRequestBuilder(Query query) { + this.query = query.clone(); + } + + @Override + public void add(ByteString rowKey) { + query.rowKey(rowKey); + } + + @Override + public Query build() { + return query; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java new file mode 100644 index 000000000000..de5ef19cb111 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java @@ -0,0 +1,118 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowSet; +import com.google.cloud.bigtable.data.v2.internal.RowSetUtil; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.stub.BigtableStreamResumptionStrategy; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; + +/** + * An implementation of a {@link BigtableStreamResumptionStrategy} for merged rows. This class + * tracks the last complete row seen and upon retry can build a request to resume the stream from + * where it left off. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class ReadRowsResumptionStrategy + extends BigtableStreamResumptionStrategy { + private final RowAdapter rowAdapter; + private ByteString lastKey = ByteString.EMPTY; + // Number of rows processed excluding Marker row. + private long numProcessed; + + public ReadRowsResumptionStrategy(RowAdapter rowAdapter) { + this.rowAdapter = rowAdapter; + } + + @Override + public boolean canResume() { + return true; + } + + @Override + public StreamResumptionStrategy createNew() { + return new ReadRowsResumptionStrategy<>(rowAdapter); + } + + @Override + public RowT processResponse(RowT response) { + // Last key can come from both the last processed row key and a synthetic row marker. The + // synthetic row marker is emitted when the server has read a lot of data that was filtered out. + // The row marker can be used to trim the start of the scan, but does not contribute to the row + // limit. + lastKey = rowAdapter.getKey(response); + if (!rowAdapter.isScanMarkerRow(response)) { + // Only real rows count towards the rows limit. + numProcessed++; + } + return response; + } + + @Override + public Throwable processError(Throwable throwable) { + // Noop + return throwable; + } + + /** + * {@inheritDoc} + * + *

    Given a request, this implementation will narrow that request to exclude all row keys and + * ranges that would produce rows that come before {@link #lastKey}. Furthermore this + * implementation takes care to update the row limit of the request to account for all of the + * received rows. + */ + @Override + public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest) { + // An empty lastKey means that we have not successfully read the first row, + // so resume with the original request object. + if (lastKey.isEmpty()) { + return originalRequest; + } + + RowSet remaining = + RowSetUtil.erase(originalRequest.getRows(), lastKey, !originalRequest.getReversed()); + + // Edge case: retrying a fulfilled request. + // A fulfilled request is one that has had all of its row keys and ranges fulfilled, or if it + // had a row limit, has seen enough rows. These requests are replaced with a marker request that + // will be handled by ReadRowsRetryCompletedCallable. See docs in ReadRowsRetryCompletedCallable + // for more details. + if (remaining == null + || (originalRequest.getRowsLimit() > 0 && originalRequest.getRowsLimit() == numProcessed)) { + return ReadRowsRetryCompletedCallable.FULFILLED_REQUEST_MARKER; + } + + ReadRowsRequest.Builder builder = originalRequest.toBuilder().setRows(remaining); + + if (originalRequest.getRowsLimit() > 0) { + Preconditions.checkState( + originalRequest.getRowsLimit() > numProcessed, + "Detected too many rows for the current row limit during a retry."); + builder.setRowsLimit(originalRequest.getRowsLimit() - numProcessed); + } + + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java new file mode 100644 index 000000000000..c25eb4e01566 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java @@ -0,0 +1,73 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.ReadRowsRequest; + +/** + * This callable addresses edge case of a ReadRows stream receiving all of the rows, but receiving a + * retryable error status instead of an OK. If a retry attempt is scheduled, then it should return + * an OK response. + * + *

    This callable works in tandem with {@link ReadRowsResumptionStrategy}, which will send a + * {@link #FULFILLED_REQUEST_MARKER} to be processed by this callable. Upon receiving the {@link + * #FULFILLED_REQUEST_MARKER}, this callable will promptly notify the {@link ResponseObserver} that + * the stream has been successfully compeleted. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public final class ReadRowsRetryCompletedCallable + extends ServerStreamingCallable { + static final ReadRowsRequest FULFILLED_REQUEST_MARKER = + ReadRowsRequest.newBuilder().setRowsLimit(-1).build(); + + private final ServerStreamingCallable inner; + + public ReadRowsRetryCompletedCallable(ServerStreamingCallable inner) { + this.inner = inner; + } + + @Override + @SuppressWarnings("ReferenceEquality") + public void call( + ReadRowsRequest request, ResponseObserver responseObserver, ApiCallContext context) { + + if (request == FULFILLED_REQUEST_MARKER) { + responseObserver.onStart(new DummyController()); + responseObserver.onComplete(); + } else { + inner.call(request, responseObserver, context); + } + } + + private static class DummyController implements StreamController { + @Override + public void cancel() {} + + @Override + public void disableAutoInboundFlowControl() {} + + @Override + public void request(int count) {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java new file mode 100644 index 000000000000..3f1db6d0d84e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Query; + +/** + * Simple wrapper for ReadRows to wrap the request protobufs. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class ReadRowsUserCallable extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final RequestContext requestContext; + + public ReadRowsUserCallable( + ServerStreamingCallable inner, RequestContext requestContext) { + this.inner = inner; + this.requestContext = requestContext; + } + + @Override + public void call(Query request, ResponseObserver responseObserver, ApiCallContext context) { + ReadRowsRequest innerRequest = request.toProto(requestContext); + inner.call(innerRequest, responseObserver, context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java new file mode 100644 index 000000000000..54edf57a31c2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java @@ -0,0 +1,105 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.cloud.bigtable.gaxx.reframing.Reframer; +import com.google.common.base.Preconditions; +import java.util.ArrayDeque; +import java.util.Queue; + +/** + * An implementation of a {@link Reframer} that feeds the row merging {@link StateMachine}. + * + *

    {@link com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver} pushes {@link + * ReadRowsResponse.CellChunk}s into this class and pops fully merged logical rows. Example usage: + * + *

    {@code
    + * RowMerger rowMerger = new RowMerger<>(myRowBuilder);
    + *
    + * while(responseIterator.hasNext()) {
    + *   ReadRowsResponse response = responseIterator.next();
    + *
    + *   if (rowMerger.hasFullFrame()) {
    + *     Row row = rowMerger.pop();
    + *     // Do something with row.
    + *   } else {
    + *     rowMerger.push(response);
    + *   }
    + * }
    + *
    + * if (rowMerger.hasPartialFrame()) {
    + *   throw new RuntimeException("Incomplete stream");
    + * }
    + *
    + * }
    + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + * + *

    Package-private for internal use. + * + * @see com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver for more details + */ +@InternalApi +public class RowMerger implements Reframer { + private final StateMachine stateMachine; + private Queue mergedRows; + + public RowMerger(RowBuilder rowBuilder, boolean reversed) { + stateMachine = new StateMachine<>(rowBuilder, reversed); + mergedRows = new ArrayDeque<>(); + } + + @Override + public void push(ReadRowsResponse response) { + // If the server sends a scan heartbeat, notify the StateMachine. It will generate a synthetic + // row marker. See RowAdapter for more info. + if (!response.getLastScannedRowKey().isEmpty()) { + stateMachine.handleLastScannedRow(response.getLastScannedRowKey()); + if (stateMachine.hasCompleteRow()) { + mergedRows.add(stateMachine.consumeRow()); + } + } + for (ReadRowsResponse.CellChunk cellChunk : response.getChunksList()) { + stateMachine.handleChunk(cellChunk); + if (stateMachine.hasCompleteRow()) { + mergedRows.add(stateMachine.consumeRow()); + } + } + } + + @Override + public boolean hasFullFrame() { + return !mergedRows.isEmpty(); + } + + @Override + public boolean hasPartialFrame() { + // Check if buffer in this class contains data. If an assembled is still not available, then + // that means `buffer` has been fully consumed. The last place to check is the StateMachine + // buffer, to see if its holding on to an incomplete row. + return hasFullFrame() || stateMachine.isRowInProgress(); + } + + @Override + public RowT pop() { + return Preconditions.checkNotNull( + mergedRows.poll(), "RowMerger.pop() called when there are no rows"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java new file mode 100644 index 000000000000..6f4816620025 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver; + +/** + * A ServerStreamingCallable that will merge {@link + * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s into logical rows. This class delegates all + * of the work to gax's {@link ReframingResponseObserver} and the logic to {@link RowMerger}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class RowMergingCallable extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final RowAdapter rowAdapter; + + public RowMergingCallable( + ServerStreamingCallable inner, + RowAdapter rowAdapter) { + this.inner = inner; + this.rowAdapter = rowAdapter; + } + + @Override + public void call( + ReadRowsRequest request, ResponseObserver responseObserver, ApiCallContext context) { + RowBuilder rowBuilder = rowAdapter.createRowBuilder(); + RowMerger merger = new RowMerger<>(rowBuilder, request.getReversed()); + ReframingResponseObserver innerObserver = + new ReframingResponseObserver<>(responseObserver, merger); + inner.call(request, innerObserver, context); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java new file mode 100644 index 000000000000..9a6d1007a9f9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java @@ -0,0 +1,500 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.InternalException; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.common.base.Joiner; +import com.google.common.base.Preconditions; +import com.google.common.collect.EvictingQueue; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import java.util.List; + +/** + * A state machine to merge {@link com.google.bigtable.v2.ReadRowsResponse.CellChunk}s from a + * ReadRows response stream. Building of the actual row object is delegated to a {@link RowBuilder}. + * This class is not thread safe. + * + *

    The inputs are: + * + *

      + *
    • CellChunks that must be merged to form logical rows + *
    • Last scanned row notifications from the server to signal a more efficient resume point + *
    • Row consumption events that reset the state machine for the next row + *
    + * + *

    The outputs are: + * + *

      + *
    • Logical rows that were constructed using the {@link RowBuilder} + *
    • Special marker rows that represent resumption points that were sent by last scanned row + * notifications. + *
    + * + *

    Expected Usage: + * + *

    {@code
    + * StateMachine stateMachine = new StateMachine<>(myRowAdapter);
    + * while(responseIterator.hasNext()) {
    + *   ReadRowsResponse response = responseIterator.next();
    + *   if (!response.getLastScannedRowKey().isEmpty()) {
    + *     stateMachine.handleLastScannedRow(response.getLastScannedRowKey());
    + *   }
    + *
    + *   for(CellChunk chunk : response.getChunksList()) {
    + *     boolean hasCompleteRow = stateMachine.handleChunk(chunk);
    + *     if (hasCompleteRow) {
    + *       MyRow row = stateMachine.consumeRow();
    + *
    + *       if (myRowAdapter.isScanMarkerRow(row) {
    + *         // do something with marker
    + *       } else {
    + *         // do something with row
    + *       }
    + *     }
    + *   }
    + * }
    + * }
    + * + *

    Package-private for internal use. + * + * @param The type of row the adapter will build + */ +final class StateMachine { + private final RowBuilder adapter; + private boolean reversed; + private State currentState; + private ByteString lastCompleteRowKey; + + // debug stats + private int numScannedNotifications = 0; + private int numRowsCommitted = 0; + private int numChunksProcessed = 0; + private int numCellsInRow = 0; + private int numCellsInLastRow = 0; + private EvictingQueue lastSeenKeys = EvictingQueue.create(5); + + // Track current cell attributes: protocol omits them when they are repeated + private ByteString rowKey; + private String familyName; + private ByteString qualifier; + private long timestamp; + private List labels; + private long expectedCellSize; + private long remainingCellBytes; + + private RowT completeRow; + + /** + * Initialize a new state machine that's ready for a new row. + * + * @param adapter The adapter that will build the final row. + * @param reversed if the results will be streamed in reverse lexicographic order. + */ + StateMachine(RowBuilder adapter, boolean reversed) { + this.adapter = adapter; + this.reversed = reversed; + reset(); + } + + /** + * Handle last scanned row events from the server. + * + *

    The server might return the row key of the last row it has scanned. The client can use this + * to construct a more efficient retry request if needed: any row keys or portions of ranges less + * than this row key can be dropped from the request. The retry logic is implemented downstream + * from the logical rows produced by this class. To communicate this information to the retry + * logic, the state machine will encode the last scanned keys as scan marker rows using {@link + * RowBuilder#createScanMarkerRow(ByteString)}. It is the responsibility of the retry logic to + * filter out these marker before delivering the results to the user. + * + *

    The scan marker must be immediately consumed before any more events are processed. + * + *

    + *
    Valid states: + *
    {@link StateMachine#AWAITING_NEW_ROW} + *
    Resulting states: + *
    {@link StateMachine#AWAITING_ROW_CONSUME} + *
    + */ + void handleLastScannedRow(ByteString key) { + try { + numScannedNotifications++; + currentState = currentState.handleLastScannedRow(key); + } catch (RuntimeException e) { + currentState = null; + throw e; + } + } + + /** + * Feeds a new chunk into the sate machine. If the chunk is invalid, the state machine will throw + * an exception and should not be used for further input. + * + *
    + *
    Valid states: + *
    {@link StateMachine#AWAITING_NEW_ROW} + *
    {@link StateMachine#AWAITING_NEW_CELL} + *
    {@link StateMachine#AWAITING_CELL_VALUE} + *
    Resulting states: + *
    {@link StateMachine#AWAITING_NEW_CELL} + *
    {@link StateMachine#AWAITING_CELL_VALUE} + *
    {@link StateMachine#AWAITING_ROW_CONSUME} + *
    + * + * @param chunk The new chunk to process. + * @throws InvalidInputException When the chunk is not applicable to the current state. + * @throws IllegalStateException When the internal state is inconsistent + */ + void handleChunk(CellChunk chunk) { + try { + numChunksProcessed++; + currentState = currentState.handleChunk(chunk); + } catch (RuntimeException e) { + currentState = null; + throw e; + } + } + + /** + * Returns the last completed row and transitions to awaiting a new row. + * + * @return The last completed row. + * @throws IllegalStateException If the last chunk did not complete a row. + */ + RowT consumeRow() { + Preconditions.checkState(currentState == AWAITING_ROW_CONSUME, "No row to consume"); + RowT row = completeRow; + reset(); + return row; + } + + /** Checks if there is a complete to bew consumed. */ + boolean hasCompleteRow() { + return currentState == AWAITING_ROW_CONSUME; + } + + /** + * Checks if the state machine is in the middle of processing a row. + * + * @return True If there is a row in progress. + */ + boolean isRowInProgress() { + return currentState != AWAITING_NEW_ROW; + } + + private void reset() { + currentState = AWAITING_NEW_ROW; + rowKey = null; + familyName = null; + qualifier = null; + timestamp = 0; + labels = null; + expectedCellSize = 0; + remainingCellBytes = 0; + completeRow = null; + numCellsInRow = 0; + + adapter.reset(); + } + + /** + * Base class for all of the state machine's internal states. + * + *

    Each state can consume 2 events: lastScannedRowKey and a chunk. By default, the default + * implementation will just throw an IllegalStateException unless the subclass adds explicit + * handling for the event by overriding {@link #handleLastScannedRow(ByteString)} or {@link + * #handleChunk(CellChunk)}. + */ + abstract static class State { + /** + * Accepts the last row key scanned by the server. And set its as the last complete row. This + * row should be treated specially because it doesn't actually contain data. + * + * @throws IllegalStateException If the subclass can't handle last scanned row events. + */ + State handleLastScannedRow(ByteString rowKey) { + throw new IllegalStateException(); + } + + /** + * Accepts a new chunk and transitions to the next state. + * + * @param chunk The new chunk to process. + * @return The next state. + * @throws IllegalStateException If the subclass can't handle chunks. + * @throws InvalidInputException If the subclass determines that this chunk is invalid. + */ + State handleChunk(CellChunk chunk) { + throw new IllegalStateException(); + } + } + + /** + * The default state when the state machine is awaiting a chunk to start a new row. It will notify + * the adapter of the new row and delegate to the AWAITING_NEW_CELL state to process the first + * Cell in the Chunk. Exit states: same as AWAITING_NEW_CELL + */ + private final State AWAITING_NEW_ROW = + new State() { + @Override + State handleLastScannedRow(ByteString rowKey) { + if (lastCompleteRowKey != null) { + int cmp = ByteStringComparator.INSTANCE.compare(lastCompleteRowKey, rowKey); + String direction = "increasing"; + if (reversed) { + cmp *= -1; + direction = "decreasing"; + } + + validate( + cmp < 0, + "AWAITING_NEW_ROW: last scanned key must be strictly " + + direction + + ". New last scanned key=" + + rowKey); + } + completeRow = adapter.createScanMarkerRow(rowKey); + lastCompleteRowKey = rowKey; + return AWAITING_ROW_CONSUME; + } + + @Override + State handleChunk(CellChunk chunk) { + // Make sure to populate the rowKey before validations so that validation failures include + // the new key + rowKey = chunk.getRowKey(); + + validate(!chunk.getResetRow(), "AWAITING_NEW_ROW: can't reset"); + validate(!chunk.getRowKey().isEmpty(), "AWAITING_NEW_ROW: rowKey missing"); + validate(chunk.hasFamilyName(), "AWAITING_NEW_ROW: family missing"); + validate(chunk.hasQualifier(), "AWAITING_NEW_ROW: qualifier missing"); + if (lastCompleteRowKey != null) { + + int cmp = ByteStringComparator.INSTANCE.compare(lastCompleteRowKey, chunk.getRowKey()); + String direction = "increasing"; + if (reversed) { + cmp *= -1; + direction = "decreasing"; + } + + validate(cmp < 0, "AWAITING_NEW_ROW: key must be strictly " + direction); + } + + rowKey = chunk.getRowKey(); + adapter.startRow(rowKey); + + // The first chunk signals both the start of a new row and the start of a new cell, so + // force the chunk processing in the AWAITING_CELL_VALUE. + return AWAITING_NEW_CELL.handleChunk(chunk); + } + }; + + /** + * A state that represents a cell boundary in a row. It will notify the adapter of new cell. Valid + * exit states: all of them depending on the chunk. + */ + private final State AWAITING_NEW_CELL = + new State() { + /** + * Processes the next chunk. + * + * @param chunk The new chunk to process. + * @return AWAITING_NEW_CELL if the chunk completed a Cell, AWAITING_CELL_VALUE if the chunk + * left a partial Cell. + */ + @Override + State handleChunk(CellChunk chunk) { + // Handle row level logic + if (chunk.getResetRow()) { + return handleResetChunk(chunk); + } + + if (!chunk.getRowKey().isEmpty()) { + validate( + rowKey.equals(chunk.getRowKey()), "AWAITING_NEW_CELL: row keys must not change"); + } + + // Update cell identifier buffers + if (chunk.hasFamilyName()) { + familyName = chunk.getFamilyName().getValue(); + validate(chunk.hasQualifier(), "AWAITING_NEW_CELL: has familyName, but no qualifier"); + } + if (chunk.hasQualifier()) { + qualifier = chunk.getQualifier().getValue(); + } + timestamp = chunk.getTimestampMicros(); + labels = chunk.getLabelsList(); + + // Update value expectations + validate(chunk.getValueSize() >= 0, "AWAITING_NEW_CELL: valueSize can't be negative"); + + boolean isSplit = chunk.getValueSize() > 0; + if (isSplit) { + validate( + !chunk.getCommitRow(), + "AWAITING_NEW_CELL: can't commit when valueSize indicates more data"); + validate( + !chunk.getValue().isEmpty(), + "AWAITING_NEW_CELL: must have data when valueSize promises more data in the next" + + " chunk"); + + expectedCellSize = chunk.getValueSize(); + remainingCellBytes = expectedCellSize - chunk.getValue().size(); + } else { + expectedCellSize = chunk.getValue().size(); + remainingCellBytes = 0; + } + + // Start building cell + adapter.startCell(familyName, qualifier, timestamp, labels, expectedCellSize); + adapter.cellValue(chunk.getValue()); + + // Transitions + if (isSplit) { + return AWAITING_CELL_VALUE; + } + adapter.finishCell(); + numCellsInRow++; + + if (!chunk.getCommitRow()) { + return AWAITING_NEW_CELL; + } + + return handleCommit(); + } + }; + + /** + * A state that represents a cell's value continuation. Notifies the adapter to append more data + * to the cell's value. Valid exit states: all of them depending on the chunk. + */ + private final State AWAITING_CELL_VALUE = + new State() { + @Override + State handleChunk(CellChunk chunk) { + if (chunk.getResetRow()) { + return handleResetChunk(chunk); + } + + boolean isLast = chunk.getValueSize() == 0; + + validate(!chunk.hasFamilyName(), "AWAITING_CELL_VALUE: can't have a family"); + validate(!chunk.hasQualifier(), "AWAITING_CELL_VALUE: can't have a qualifier"); + validate(chunk.getTimestampMicros() == 0, "AWAITING_CELL_VALUE: can't have a timestamp"); + validate(chunk.getLabelsCount() == 0, "AWAITING_CELL_VALUE: can't have labels"); + if (isLast) { + long missingBytes = remainingCellBytes - chunk.getValue().size(); + validate( + missingBytes == 0, + "AWAITING_CELL_VALUE: terminal cell is missing " + missingBytes + " bytes"); + } else { + validate( + expectedCellSize == chunk.getValueSize(), + "AWAITING_CELL_VALUE: valueSizes should be identical for nonterminal chunks"); + validate( + !chunk.getCommitRow(), + "AWAITING_CELL_VALUE: can't commit with a nonterminal chunk"); + } + remainingCellBytes -= chunk.getValue().size(); + adapter.cellValue(chunk.getValue()); + + // Transitions + if (!isLast) { + return AWAITING_CELL_VALUE; + } + adapter.finishCell(); + numCellsInRow++; + + if (!chunk.getCommitRow()) { + return AWAITING_NEW_CELL; + } + + return handleCommit(); + } + }; + + /** + * A state that represents a completed row. It prevents new rows from being read until the current + * one has been consumed. Valid exit states: AWAITING_NEW_ROW. + */ + private static final State AWAITING_ROW_CONSUME = + new State() { + @Override + State handleChunk(CellChunk chunk) { + throw new IllegalStateException("AWAITING_ROW_CONSUME: Skipping completed row"); + } + }; + + // Helpers ------------------------ + /** + * Handles a special CellChunk that is marked with the reset flag. Will drop all buffers and + * transition to the {@link #AWAITING_NEW_ROW} state. + */ + private State handleResetChunk(CellChunk cellChunk) { + validate(cellChunk.getRowKey().isEmpty(), "Reset chunks can't have row keys"); + validate(!cellChunk.hasFamilyName(), "Reset chunks can't have families"); + validate(!cellChunk.hasQualifier(), "Reset chunks can't have qualifiers"); + validate(cellChunk.getTimestampMicros() == 0, "Reset chunks can't have timestamps"); + validate(cellChunk.getValueSize() == 0, "Reset chunks can't have value sizes"); + validate(cellChunk.getValue().isEmpty(), "Reset chunks can't have values"); + + reset(); + return currentState; // AWAITING_NEW_ROW + } + + private State handleCommit() { + validate(remainingCellBytes == 0, "Can't commit with remaining bytes"); + completeRow = adapter.finishRow(); + lastCompleteRowKey = rowKey; + + lastSeenKeys.add(rowKey); + numRowsCommitted++; + numCellsInLastRow = numCellsInRow; + return AWAITING_ROW_CONSUME; + } + + private void validate(boolean condition, String message) { + if (!condition) { + throw new InvalidInputException( + message + + ". numScannedNotifications: " + + numScannedNotifications + + ", numRowsCommitted: " + + numRowsCommitted + + ", numChunksProcessed: " + + numChunksProcessed + + ", numCellsInRow: " + + numCellsInRow + + ", numCellsInLastRow: " + + numCellsInLastRow + + ", rowKey: " + + rowKey + + ", last5Keys: " + + Joiner.on(",").join(lastSeenKeys)); + } + } + + static class InvalidInputException extends InternalException { + InvalidInputException(String message) { + super(message, null, GrpcStatusCode.of(Status.Code.INTERNAL), false); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/package-info.java new file mode 100644 index 000000000000..21a0186b49d5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/package-info.java @@ -0,0 +1,40 @@ +/* + * Copyright 2018 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. + */ +/** + * Implementation details for {@link + * com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub#readRowsCallable()}. + * + *

    The ReadRows protocol is optimized for transmission and is not designed to be consumed + * directly. This package implements significant customizations on top of the raw GAPIC generated + * stub to handle row merging and retries. + * + *

      + *
    • ReadRowsUserCallable: Creates protobuf {@link com.google.bigtable.v2.ReadRowsRequest}s from + * user facing wrappers. + *
    • RowMergingCallable (+ helpers): Implements a state machine that merges chunks into logical + * rows. The logical row representation is configurable via a RowAdapter. Please note that + * this will also emit special marker rows that help with retries in the next stage, but need + * to be filtered out. + *
    • RowMerger (+ helpers): Implements resuming retries for gax's Callables#retrying middleware. + *
    • FilterMarkerRowsCallable: Filters out marker rows that are used for efficient retry + * resumes. The marker is an internal implementation detail to communicate state to the + * RowMerger and should not be exposed to the caller. + *
    + * + *

    This package is considered an internal implementation detail and is not meant to be used by + * applications directly. + */ +package com.google.cloud.bigtable.data.v2.stub.readrows; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.java new file mode 100644 index 000000000000..09d3fc473e79 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.java @@ -0,0 +1,163 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.StatusCode; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatementRefreshTimeoutException; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import io.grpc.Deadline; +import io.grpc.Status.Code; +import java.time.Instant; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import javax.annotation.Nullable; + +/** + * Used to handle the state associated with an ExecuteQuery call. This includes plan refresh, resume + * tokens, and metadata resolution. + * + *

    This should only be constructed by {@link ExecuteQueryCallable} not directly by users. + * + *

    This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public class ExecuteQueryCallContext { + + private final BoundStatement boundStatement; + private final SettableApiFuture metadataFuture; + private PreparedQueryData latestPrepareResponse; + private @Nullable ByteString resumeToken; + private final Instant startTimeOfCall; + + private ExecuteQueryCallContext( + BoundStatement boundStatement, SettableApiFuture metadataFuture) { + this.boundStatement = boundStatement; + this.metadataFuture = metadataFuture; + this.latestPrepareResponse = boundStatement.getLatestPrepareResponse(); + this.startTimeOfCall = Instant.now(); + } + + public static ExecuteQueryCallContext create( + BoundStatement boundStatement, SettableApiFuture metadataFuture) { + return new ExecuteQueryCallContext(boundStatement, metadataFuture); + } + + /** + * Builds a request using the latest PrepareQuery data, blocking if necessary for prepare refresh + * to complete. If waiting on refresh, throws a {@link PreparedStatementRefreshTimeoutException} + * exception based on the passed deadline. + * + *

    translates all other exceptions to be retryable so that ExecuteQuery can refresh the plan + * and try again if it has not exhausted its retries + * + *

    If currentAttemptDeadline is null it times out after Long.MAX_VALUE nanoseconds + */ + ExecuteQueryRequest buildRequestWithDeadline( + RequestContext requestContext, @Nullable Deadline currentAttemptDeadline) + throws PreparedStatementRefreshTimeoutException { + // Use max Long as default timeout for simplicity if no deadline is set + long planRefreshWaitTimeoutNanos = Long.MAX_VALUE; + if (currentAttemptDeadline != null) { + planRefreshWaitTimeoutNanos = currentAttemptDeadline.timeRemaining(TimeUnit.NANOSECONDS); + } + try { + PrepareResponse response = + latestPrepareResponse + .prepareFuture() + .get(planRefreshWaitTimeoutNanos, TimeUnit.NANOSECONDS); + return boundStatement.toProto(response.preparedQuery(), requestContext, resumeToken); + } catch (TimeoutException e) { + throw new PreparedStatementRefreshTimeoutException( + "Exceeded deadline waiting for PreparedQuery to refresh"); + } catch (ExecutionException e) { + StatusCode retryStatusCode = GrpcStatusCode.of(Code.FAILED_PRECONDITION); + Throwable cause = e.getCause(); + if (cause instanceof ApiException) { + retryStatusCode = ((ApiException) cause).getStatusCode(); + } + throw ApiExceptionFactory.createException("Plan refresh error", cause, retryStatusCode, true); + } catch (InterruptedException e) { + throw ApiExceptionFactory.createException( + "Plan refresh error", e, GrpcStatusCode.of(Code.FAILED_PRECONDITION), true); + } + } + + /** + * Metadata can change as the plan is refreshed. Once a resume token or complete has been received + * from the stream we know that the {@link com.google.bigtable.v2.PrepareQueryResponse} can no + * longer change, so we can set the metadata. + */ + void finalizeMetadata() { + // We don't ever expect an exception here, since we've already received responses at the point + // this is called + try { + Preconditions.checkState( + latestPrepareResponse.prepareFuture().isDone(), + "Unexpected attempt to finalize metadata with unresolved prepare response. This should" + + " never as this is called after we receive ExecuteQuery responses, which requires" + + " the future to be resolved"); + PrepareResponse response = + ApiExceptions.callAndTranslateApiException(latestPrepareResponse.prepareFuture()); + metadataFuture.set(response.resultSetMetadata()); + } catch (Throwable t) { + metadataFuture.setException(t); + throw t; + } + } + + /** + * If the stream receives an error before receiving any response it needs to be passed through to + * the metadata future + */ + void setMetadataException(Throwable t) { + metadataFuture.setException(t); + } + + SettableApiFuture resultSetMetadataFuture() { + return this.metadataFuture; + } + + void setLatestResumeToken(ByteString resumeToken) { + this.resumeToken = resumeToken; + } + + boolean hasResumeToken() { + return this.resumeToken != null; + } + + void triggerImmediateRefreshOfPreparedQuery() { + latestPrepareResponse = + this.boundStatement.markExpiredAndStartRefresh(latestPrepareResponse.version()); + } + + Instant startTimeOfCall() { + return this.startTimeOfCall; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java new file mode 100644 index 000000000000..687bcdce3078 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java @@ -0,0 +1,68 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; + +/** + * Callable that creates {@link SqlServerStream}s from {@link ExecuteQueryRequest}s. + * + *

    This handles setting up the future that is used to allow users to access metadata. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. + */ +@InternalApi +public class ExecuteQueryCallable extends ServerStreamingCallable { + + private final ServerStreamingCallable inner; + + public ExecuteQueryCallable(ServerStreamingCallable inner) { + this.inner = inner; + } + + /** + * This should be used to create execute query calls. This replaces the typical API which allows + * passing of an {@link ApiCallContext}. + * + *

    This class is considered an internal implementation detail and not meant to be used by + * applications. Users should only use executeQuery through the {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient} + */ + public SqlServerStream call(BoundStatement boundStatement) { + SettableApiFuture metadataFuture = SettableApiFuture.create(); + ServerStream rowStream = + this.call(ExecuteQueryCallContext.create(boundStatement, metadataFuture)); + return SqlServerStreamImpl.create(metadataFuture, rowStream); + } + + @Override + public void call( + ExecuteQueryCallContext callContext, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + inner.call(callContext, responseObserver, apiCallContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategy.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategy.java new file mode 100644 index 000000000000..e6e2562c334d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategy.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.protobuf.ByteString; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@InternalApi +public class ExecuteQueryResumptionStrategy + implements StreamResumptionStrategy { + + private ByteString latestResumeToken = null; + + @Nonnull + @Override + public StreamResumptionStrategy createNew() { + return new ExecuteQueryResumptionStrategy(); + } + + @Nonnull + @Override + public ExecuteQueryResponse processResponse(ExecuteQueryResponse response) { + if (!response.getResults().getResumeToken().isEmpty()) { + latestResumeToken = response.getResults().getResumeToken(); + } + return response; + } + + @Nullable + @Override + public ExecuteQueryCallContext getResumeRequest(ExecuteQueryCallContext originalRequest) { + if (latestResumeToken != null) { + // ExecuteQueryCallContext can handle null token, but we don't bother setting it for + // clarity + originalRequest.setLatestResumeToken(latestResumeToken); + } + return originalRequest; + } + + @Override + public boolean canResume() { + return true; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallable.java new file mode 100644 index 000000000000..e36bfa57fc63 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallable.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; + +/** + * Callable that handles passing execeptions through to the metadata future. This needs to be used + * after all retries, so that non-retriable errors don't surface as errors to users accessing the + * metadata. + * + *

    In non-error cases the metadata future is resolved by the {@link PlanRefreshingCallable} + * because the metadata needs to resolve before the SqlRowMerger starts yielding rows + * + *

    This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public class MetadataErrorHandlingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + + public MetadataErrorHandlingCallable( + ServerStreamingCallable inner) { + this.inner = inner; + } + + @Override + public void call( + ExecuteQueryCallContext request, + ResponseObserver responseObserver, + ApiCallContext context) { + MetadataErrorHandlingObserver observer = + new MetadataErrorHandlingObserver(responseObserver, request); + inner.call(request, observer, context); + } + + static final class MetadataErrorHandlingObserver extends SafeResponseObserver { + private final ExecuteQueryCallContext callContext; + private final ResponseObserver outerObserver; + + MetadataErrorHandlingObserver( + ResponseObserver outerObserver, ExecuteQueryCallContext callContext) { + super(outerObserver); + this.outerObserver = outerObserver; + this.callContext = callContext; + } + + @Override + protected void onStartImpl(StreamController streamController) { + outerObserver.onStart(streamController); + } + + @Override + protected void onResponseImpl(SqlRow response) { + outerObserver.onResponse(response); + } + + @Override + protected void onErrorImpl(Throwable throwable) { + callContext.setMetadataException(throwable); + outerObserver.onError(throwable); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallable.java new file mode 100644 index 000000000000..c1d3d1c3a753 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallable.java @@ -0,0 +1,233 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatementRefreshTimeoutException; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; +import com.google.common.annotations.VisibleForTesting; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.PreconditionFailure.Violation; +import io.grpc.Deadline; +import io.grpc.Status; +import java.time.Duration; +import java.time.Instant; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +/** + * Callable that allows passing of {@link ResultSetMetadata} back to users throught the {@link + * ExecuteQueryCallContext}. + * + *

    This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public class PlanRefreshingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + private final RequestContext requestContext; + + public PlanRefreshingCallable( + ServerStreamingCallable inner, + RequestContext requestContext) { + this.inner = inner; + this.requestContext = requestContext; + } + + @Override + public void call( + ExecuteQueryCallContext executeQueryCallContext, + ResponseObserver responseObserver, + @Nullable ApiCallContext apiCallContext) { + PlanRefreshingObserver observer = + new PlanRefreshingObserver(responseObserver, executeQueryCallContext); + ExecuteQueryRequest request; + @Nullable GrpcCallContext grpcCallContext = (GrpcCallContext) apiCallContext; + // Convert timeout to an absolute deadline, so we can use it for both the plan refresh and + // the ExecuteQuery rpc + Deadline deadline = getDeadline(grpcCallContext, executeQueryCallContext.startTimeOfCall()); + try { + // TODO: this blocks. That is ok because ResultSet is synchronous. If we ever + // need to make this async that needs to change + request = executeQueryCallContext.buildRequestWithDeadline(requestContext, deadline); + } catch (PreparedStatementRefreshTimeoutException e) { + // If we timed out waiting for refresh, return the retryable error, but don't trigger a + // new refresh since one is ongoing + responseObserver.onError(e); + return; + } catch (Throwable throwable) { + // If we already have a resumeToken we can't refresh the plan, so we throw an error. + // This is not expected to happen, as the plan must be resolved in order for us to + // receive a token + if (executeQueryCallContext.hasResumeToken()) { + responseObserver.onError( + new IllegalStateException( + "Unexpected plan refresh attempt after first token", throwable)); + } + // We trigger refresh so the next attempt will use a fresh plan + executeQueryCallContext.triggerImmediateRefreshOfPreparedQuery(); + responseObserver.onError(throwable); + return; + } + ApiCallContext contextWithAbsoluteDeadline = + Optional.ofNullable(grpcCallContext) + .map(c -> c.withCallOptions(grpcCallContext.getCallOptions().withDeadline(deadline))) + .orElse(null); + inner.call(request, observer, contextWithAbsoluteDeadline); + } + + // Checks for an attempt timeout first, then a total timeout. If found, converts the timeout + // to an absolute deadline. Adjusts totalTimeout based on the time since startTimeOfOverallRequest + @VisibleForTesting + static @Nullable Deadline getDeadline( + GrpcCallContext grpcCallContext, Instant startTimeOfOverallRequest) { + Optional attemptDeadline = + Optional.ofNullable(grpcCallContext) + .flatMap(c -> Optional.ofNullable(c.getTimeoutDuration())) + .map(d -> Deadline.after(d.toNanos(), TimeUnit.NANOSECONDS)); + if (attemptDeadline.isPresent()) { + return attemptDeadline.get(); + } + return Optional.ofNullable(grpcCallContext) + .flatMap(c -> Optional.ofNullable(c.getRetrySettings())) + .map(RetrySettings::getTotalTimeoutDuration) + // TotalTimeout of zero means there is no timeout + .filter(duration -> !duration.isZero()) + .map( + d -> { + Duration elapsedTime = Duration.between(startTimeOfOverallRequest, Instant.now()); + Duration remaining = d.minus(elapsedTime); + // zero is treated as no deadline, so if full deadline is elapsed pass 1 nano + long adjusted = Math.max(remaining.toNanos(), 1); + return Deadline.after(adjusted, TimeUnit.NANOSECONDS); + }) + .orElse(null); + } + + @InternalApi + static boolean isPlanRefreshError(Throwable t) { + if (!(t instanceof ApiException)) { + return false; + } + ApiException e = (ApiException) t; + if (!e.getStatusCode().getCode().equals(Code.FAILED_PRECONDITION)) { + return false; + } + if (e.getErrorDetails() == null) { + return false; + } + PreconditionFailure preconditionFailure = e.getErrorDetails().getPreconditionFailure(); + if (preconditionFailure == null) { + return false; + } + for (Violation violation : preconditionFailure.getViolationsList()) { + if (violation.getType().contains("PREPARED_QUERY_EXPIRED")) { + return true; + } + } + return false; + } + + static final class PlanRefreshingObserver extends SafeResponseObserver { + + private final ExecuteQueryCallContext callContext; + private final ResponseObserver outerObserver; + // This doesn't need to be synchronized because this is called above the reframer + // so onResponse will be called sequentially + private boolean hasReceivedResumeToken; + + PlanRefreshingObserver( + ResponseObserver outerObserver, ExecuteQueryCallContext callContext) { + super(outerObserver); + this.outerObserver = outerObserver; + this.callContext = callContext; + this.hasReceivedResumeToken = false; + } + + @Override + protected void onStartImpl(StreamController streamController) { + outerObserver.onStart(streamController); + } + + @Override + protected void onResponseImpl(ExecuteQueryResponse response) { + // Defer finalizing metadata until we receive a resume token, because this is the + // only point we can guarantee it won't change. + // + // An example of why this is necessary, for query "SELECT * FROM table": + // - Make a request, table has one column family 'cf' + // - Return an incomplete batch + // - request fails with transient error + // - Meanwhile the table has had a second column family added 'cf2' + // - Retry the request, get an error indicating the `prepared_query` has expired + // - Refresh the prepared_query and retry the request, the new prepared_query + // contains both 'cf' & 'cf2' + // - It sends a new incomplete batch and resets the old outdated batch + // - It send the next chunk with a checksum and resume_token, closing the batch. + // In this case the row merger and the ResultSet should be using the updated schema from + // the refreshed prepare request. + if (!hasReceivedResumeToken && !response.getResults().getResumeToken().isEmpty()) { + callContext.finalizeMetadata(); + hasReceivedResumeToken = true; + } + outerObserver.onResponse(response); + } + + @Override + protected void onErrorImpl(Throwable throwable) { + boolean refreshPlan = isPlanRefreshError(throwable); + // If we've received a resume token we shouldn't receive this error. Safeguard against + // accidentally changing the schema mid-response though + if (refreshPlan && !hasReceivedResumeToken) { + callContext.triggerImmediateRefreshOfPreparedQuery(); + outerObserver.onError( + new ApiException(throwable, GrpcStatusCode.of(Status.Code.FAILED_PRECONDITION), true)); + } else if (refreshPlan) { + outerObserver.onError( + new IllegalStateException( + "Unexpected plan refresh attempt after first token", throwable)); + } else { + // Note that we do not set exceptions on the metadata future here. This + // needs to be done after the retries, so that retryable errors aren't set on + // the future + outerObserver.onError(throwable); + } + } + + @Override + protected void onCompleteImpl() { + if (!callContext.resultSetMetadataFuture().isDone()) { + // If stream succeeds with no responses, we can finalize the metadata + callContext.finalizeMetadata(); + } + outerObserver.onComplete(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java new file mode 100644 index 000000000000..351656dcd461 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java @@ -0,0 +1,271 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PartialResultSet; +import com.google.bigtable.v2.ProtoRows; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.hash.HashCode; +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Queue; +import java.util.function.Supplier; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * Used to transform a stream of {@link com.google.bigtable.v2.ProtoRowsBatch} bytes chunks into + * {@link ProtoSqlRow}s for the given schema. Each SqlRow represents a logical row for a sql + * response. + * + *

    The intended usage of this class is: + * + *

      + *
    • Add results with {@link #addPartialResultSet(PartialResultSet)} until {@link + * #hasCompleteBatches()} is true + *
    • Call {@link #populateQueue(Queue)} to materialize results from the complete batch. + *
    • Repeat until all {@link PartialResultSet}s have been processed + *
    • Ensure that there is no incomplete data using {@link #isBatchInProgress()} + *
    + * + *

    Package-private for internal use. This class is not thread safe. + */ +@InternalApi +final class ProtoRowsMergingStateMachine { + enum State { + /** Waiting for data to be added to the state machine */ + AWAITING_NEW_DATA, + /** Buffering a complete set of rows, waiting for populateQueue to be called */ + AWAITING_BATCH_CONSUME, + } + + private static final HashFunction CRC32C = Hashing.crc32c(); + + private final Supplier metadataSupplier; + private @Nullable ResultSetMetadata metadata; + private State state; + private ByteString batchBuffer; + private List> parsedBatches; + private boolean hasReceivedFirstResumeToken; + + ProtoRowsMergingStateMachine(Supplier metadataSupplier) { + this.metadataSupplier = metadataSupplier; + state = State.AWAITING_NEW_DATA; + batchBuffer = ByteString.empty(); + parsedBatches = new ArrayList<>(); + hasReceivedFirstResumeToken = false; + } + + /** + * Adds the bytes from the given PartialResultSet to the current buffer. If a resume token is + * present, attempts to parse the bytes to the underlying protobuf row format + * + *

    See the comments on {@link PartialResultSet} protobuf message definition for explanation of + * the protocol implemented below. + * + *

    Translated to use local variable names the expected logic is as follows:
    +   * if results.reset {
    +   *   reset batchBuffer
    +   *   reset parsedBatches
    +   * }
    +   * if results.proto_rows_batch is set {
    +   *   append result.proto_rows_batch.batch_data to batchBuffer
    +   * }
    +   * if results.batch_checksum is set {
    +   *   validate the checksum matches the crc32c hash of batchBuffer
    +   *   parse batchBuffer as a ProtoRows message, clearing batchBuffer
    +   *   add the parsed data to parsedBatches
    +   * }
    +   * if results.resume_token is set {
    +   *   yield the results in parsedBatches to the row merger.
    +   *   this is controlled by the AWAITING_BATCH_CONSUME state.
    +   * }
    +   * 
    + */ + void addPartialResultSet(PartialResultSet results) { + Preconditions.checkState( + state != State.AWAITING_BATCH_CONSUME, + "Attempting to add partial result set to state machine in state AWAITING_BATCH_CONSUME"); + // If the API indicates we should reset we need to clear buffered data + if (results.getReset()) { + batchBuffer = ByteString.EMPTY; + parsedBatches.clear(); + } + // ByteString has an efficient concat which generally involves no copying + batchBuffer = batchBuffer.concat(results.getProtoRowsBatch().getBatchData()); + if (results.hasBatchChecksum()) { + HashCode hash = CRC32C.hashBytes(batchBuffer.toByteArray()); + Preconditions.checkState( + hash.hashCode() == results.getBatchChecksum(), "Unexpected checksum mismatch"); + try { + ProtoRows completeBatch = ProtoRows.parseFrom(batchBuffer); + batchBuffer = ByteString.EMPTY; + parsedBatches.add(completeBatch.getValuesList()); + } catch (InvalidProtocolBufferException e) { + throw new InternalError("Unexpected exception parsing response protobuf", e); + } + } + boolean hasResumeToken = !results.getResumeToken().isEmpty(); + if (hasResumeToken) { + if (!hasReceivedFirstResumeToken) { + // Don't resolve the metadata until we receive the first resume token. + // This is safe because we only use the metadata in populateQueue, which can't be called + // until we receive a resume token. For details on why this is necessary, see + // MetadataResolvingCallable + metadata = metadataSupplier.get(); + hasReceivedFirstResumeToken = true; + } + Preconditions.checkState( + batchBuffer.isEmpty(), "Received resumeToken with buffered data and no checksum"); + state = State.AWAITING_BATCH_CONSUME; + } + } + + /** Returns true if there are complete batches, ready to yield. False otherwise */ + boolean hasCompleteBatches() { + return state == State.AWAITING_BATCH_CONSUME; + } + + /** Returns true if there is a partial or complete batch buffered, false otherwise */ + boolean isBatchInProgress() { + boolean hasBufferedData = !batchBuffer.isEmpty() || !parsedBatches.isEmpty(); + return hasCompleteBatches() || hasBufferedData; + } + + /** + * Populates the given queue with the currently buffered rows of rows + * + * @throws IllegalStateException if there is no yieldable data + */ + void populateQueue(Queue queue) { + Preconditions.checkState( + state == State.AWAITING_BATCH_CONSUME, + "Attempting to populate Queue from state machine without completed batch"); + Preconditions.checkState( + batchBuffer.isEmpty(), "Unexpected buffered partial batch while consuming rows."); + Preconditions.checkNotNull(metadata, "Unexpected empty metadata when parsing response"); + + Iterator valuesIterator = Iterables.concat(parsedBatches).iterator(); + while (valuesIterator.hasNext()) { + ImmutableList.Builder rowDataBuilder = ImmutableList.builder(); + for (ColumnMetadata c : metadata.getColumns()) { + Preconditions.checkState( + valuesIterator.hasNext(), "Incomplete row received with first missing column: %s", c); + Value v = valuesIterator.next(); + validateValueAndType(c.type(), v); + rowDataBuilder.add(v); + } + queue.add(ProtoSqlRow.create(metadata, rowDataBuilder.build())); + } + this.parsedBatches = new ArrayList<>(); + state = State.AWAITING_NEW_DATA; + } + + @InternalApi("VisibleForTestingOnly") + static void validateValueAndType(SqlType type, Value value) { + // Null is represented as a value with none of the kind fields set + if (value.getKindCase() == Value.KindCase.KIND_NOT_SET) { + return; + } + switch (type.getCode()) { + // Primitive types + case STRING: + checkExpectedKind(value, Value.KindCase.STRING_VALUE, type); + break; + case BYTES: + case PROTO: + checkExpectedKind(value, Value.KindCase.BYTES_VALUE, type); + break; + case INT64: + case ENUM: + checkExpectedKind(value, Value.KindCase.INT_VALUE, type); + break; + case FLOAT64: + case FLOAT32: + checkExpectedKind(value, Value.KindCase.FLOAT_VALUE, type); + break; + case BOOL: + checkExpectedKind(value, Value.KindCase.BOOL_VALUE, type); + break; + case TIMESTAMP: + checkExpectedKind(value, Value.KindCase.TIMESTAMP_VALUE, type); + break; + case DATE: + checkExpectedKind(value, Value.KindCase.DATE_VALUE, type); + break; + // Complex types + case ARRAY: + checkExpectedKind(value, Value.KindCase.ARRAY_VALUE, type); + SqlType.Array arrayType = (SqlType.Array) type; + SqlType elemType = arrayType.getElementType(); + for (Value element : value.getArrayValue().getValuesList()) { + validateValueAndType(elemType, element); + } + break; + case STRUCT: + checkExpectedKind(value, Value.KindCase.ARRAY_VALUE, type); + List fieldValues = value.getArrayValue().getValuesList(); + SqlType.Struct structType = (SqlType.Struct) type; + if (fieldValues.size() != structType.getFields().size()) { + throw new IllegalStateException( + String.format( + "Unexpected malformed struct data. Expected %s fields, received: %s", + structType.getFields().size(), fieldValues.size())); + } + for (int i = 0; i < fieldValues.size(); i++) { + validateValueAndType(structType.getType(i), fieldValues.get(i)); + } + break; + case MAP: + checkExpectedKind(value, Value.KindCase.ARRAY_VALUE, type); + SqlType.Map mapType = (SqlType.Map) type; + for (Value mapElement : value.getArrayValue().getValuesList()) { + Preconditions.checkState( + mapElement.getArrayValue().getValuesCount() == 2, + "Map elements must have exactly 2 elementss"); + validateValueAndType( + mapType.getKeyType(), mapElement.getArrayValue().getValuesList().get(0)); + validateValueAndType( + mapType.getValueType(), mapElement.getArrayValue().getValuesList().get(1)); + } + break; + default: + // This should be caught already at ResultSetMetadata creation + throw new IllegalStateException("Unrecognized type: " + type); + } + } + + private static void checkExpectedKind(Value value, Value.KindCase expectedKind, SqlType type) { + Preconditions.checkState( + value.getKindCase() == expectedKind, + "Value kind must be %s for columns of type: %s", + expectedKind.name(), + type); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.java new file mode 100644 index 000000000000..a4f2c618e9f1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.PartialResultSet; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.gaxx.reframing.Reframer; +import com.google.common.base.Preconditions; +import java.util.ArrayDeque; +import java.util.Queue; +import java.util.function.Supplier; + +/** + * Used to transform a stream of ExecuteQueryResponse objects into rows. This class is not thread + * safe. + */ +@InternalApi +public final class SqlRowMerger implements Reframer { + + private final Queue queue; + private final ProtoRowsMergingStateMachine stateMachine; + + /** + * @param metadataSupplier a supplier of {@link ResultSetMetadata}. This is expected to return + * successfully once the first call to push has been made. + *

    This exists to facilitate plan refresh that can happen after creation of the row merger. + */ + public SqlRowMerger(Supplier metadataSupplier) { + queue = new ArrayDeque<>(); + stateMachine = new ProtoRowsMergingStateMachine(metadataSupplier); + } + + /** + * Used to add responses to the SqlRowMerger as they are received. + * + * @param response the next response in the stream of query responses + */ + @Override + public void push(ExecuteQueryResponse response) { + Preconditions.checkState( + response.hasResults(), + "Expected results response, but received: %s", + response.getResponseCase().name()); + PartialResultSet results = response.getResults(); + processProtoRows(results); + } + + private void processProtoRows(PartialResultSet results) { + stateMachine.addPartialResultSet(results); + if (stateMachine.hasCompleteBatches()) { + stateMachine.populateQueue(queue); + } + } + + /** + * Check if the merger has consumable data + * + * @return true if there is a complete row, false otherwise. + */ + @Override + public boolean hasFullFrame() { + return !queue.isEmpty(); + } + + /** + * Check if the merger contains partially complete (or complete) data. + * + * @return true if there is a partial (or complete) batch, false otherwise. + */ + @Override + public boolean hasPartialFrame() { + return hasFullFrame() || stateMachine.isBatchInProgress(); + } + + /** pops a completed row from the FIFO queue built from the given responses. */ + @Override + public SqlRow pop() { + return Preconditions.checkNotNull( + queue.poll(), "SqlRowMerger.pop() called when there are no complete rows."); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.java new file mode 100644 index 000000000000..c788fe9230a1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.gaxx.reframing.ReframingResponseObserver; + +@InternalApi +public class SqlRowMergingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + + public SqlRowMergingCallable( + ServerStreamingCallable inner) { + this.inner = inner; + } + + @Override + public void call( + ExecuteQueryCallContext callContext, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + SqlRowMerger merger = + new SqlRowMerger( + () -> + ApiExceptions.callAndTranslateApiException(callContext.resultSetMetadataFuture())); + ReframingResponseObserver observer = + new ReframingResponseObserver<>(responseObserver, merger); + inner.call(callContext, observer, apiCallContext); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStream.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStream.java new file mode 100644 index 000000000000..1523e0923518 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStream.java @@ -0,0 +1,37 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; + +/** + * Wrapper for results of an ExecuteQuery call that includes both the stream of rows and a future to + * access {@link ResultSetMetadata}. + * + *

    This should only be created by {@link ExecuteQueryCallable}, never directly by users/ + * + *

    This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +public interface SqlServerStream { + ApiFuture metadataFuture(); + + ServerStream rows(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStreamImpl.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStreamImpl.java new file mode 100644 index 000000000000..caeb2e478802 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStreamImpl.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ServerStream; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; + +/** + * Implementation of {@link SqlServerStream} using AutoValue + * + *

    This is considered an internal implementation detail and should not be used by applications. + */ +@InternalApi("For internal use only") +@AutoValue +public abstract class SqlServerStreamImpl implements SqlServerStream { + + @InternalApi("Visible for testing") + public static SqlServerStreamImpl create( + ApiFuture metadataApiFuture, ServerStream rowServerStream) { + return new AutoValue_SqlServerStreamImpl(metadataApiFuture, rowServerStream); + } + + @Override + public abstract ApiFuture metadataFuture(); + + @Override + public abstract ServerStream rows(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelObserver.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelObserver.java new file mode 100644 index 000000000000..2230e14bf2e3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelObserver.java @@ -0,0 +1,37 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PeerInfo; + +/** Provides observability about a single channel in the channel pool. */ +@InternalApi +public interface BigtableChannelObserver { + /** Gets the current number of outstanding Unary RPCs on this channel. */ + int getOutstandingUnaryRpcs(); + + /** Gets the current number of outstanding Streaming RPCs on this channel. */ + int getOutstandingStreamingRpcs(); + + /** Get the current number of errors request count since the last observed period */ + long getAndResetErrorCount(); + + /** Get the current number of successful requests since the last observed period */ + long getAndResetSuccessCount(); + + PeerInfo.TransportType getTransportType(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java new file mode 100644 index 000000000000..4a127a55023f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -0,0 +1,816 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPoolHealthChecker.ProbeResult; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.io.IOException; +import java.time.Clock; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Random; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * A {@link ManagedChannel} that will send requests round-robin via a set of channels. + * + *

    Spreads over a set of child connections, and actively manages lifecycle of connections. + * Dynamically resizes pool based on number of outstanding connections. + * + *

    Internal API + */ +@InternalApi +public class BigtableChannelPool extends ManagedChannel implements BigtableChannelPoolObserver { + @VisibleForTesting + static final Logger LOG = Logger.getLogger(BigtableChannelPool.class.getName()); + + private static final java.time.Duration REFRESH_PERIOD = java.time.Duration.ofMinutes(50); + + private final BigtableChannelPoolSettings settings; + private final Supplier channelSupplier; + + private final ChannelPrimer channelPrimer; + private final Object entryWriteLock = new Object(); + @VisibleForTesting final AtomicReference> entries = new AtomicReference<>(); + private final AtomicInteger indexTicker = new AtomicInteger(); + private final String authority; + private final Random rng = new Random(); + private final Supplier picker; + private ScheduledFuture resizeFuture = null; + private ScheduledFuture refreshFuture = null; + + public static BigtableChannelPool create( + BigtableChannelPoolSettings settings, + Supplier channelSupplier, + ChannelPrimer channelPrimer, + ScheduledExecutorService backgroundExecutor) + throws IOException { + return new BigtableChannelPool(settings, channelSupplier, channelPrimer, backgroundExecutor); + } + + /** + * Initializes the channel pool. Assumes that all channels have the same authority. + * + * @param settings options for controling the ChannelPool sizing behavior + * @param channelFactory method to create the channels + * @param executor periodically refreshes the channels + */ + @VisibleForTesting + BigtableChannelPool( + BigtableChannelPoolSettings settings, + Supplier channelSupplier, + ChannelPrimer channelPrimer, + ScheduledExecutorService executor) + throws IOException { + this.settings = settings; + this.channelSupplier = channelSupplier; + this.channelPrimer = channelPrimer; + Clock systemClock = Clock.systemUTC(); + ChannelPoolHealthChecker channelPoolHealthChecker = + new ChannelPoolHealthChecker(entries::get, channelPrimer, executor, systemClock); + channelPoolHealthChecker.start(); + + ImmutableList.Builder initialListBuilder = ImmutableList.builder(); + + for (int i = 0; i < settings.getInitialChannelCount(); i++) { + ManagedChannel newChannel = channelSupplier.get(); + channelPrimer.primeChannel(newChannel); + initialListBuilder.add(new Entry(newChannel)); + } + + entries.set(initialListBuilder.build()); + authority = entries.get().get(0).channel.authority(); + + switch (settings.getLoadBalancingStrategy()) { + case ROUND_ROBIN: + picker = this::pickEntryIndexRoundRobin; + break; + case LEAST_IN_FLIGHT: + picker = this::pickEntryIndexLeastInFlight; + break; + case POWER_OF_TWO_LEAST_IN_FLIGHT: + picker = this::pickEntryIndexPowerOfTwoLeastInFlight; + break; + default: + throw new IllegalStateException( + String.format( + "Unknown load balancing strategy %s", settings.getLoadBalancingStrategy())); + } + + if (!settings.isStaticSize()) { + this.resizeFuture = + executor.scheduleAtFixedRate( + this::resizeSafely, + BigtableChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), + BigtableChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), + TimeUnit.SECONDS); + } + if (settings.isPreemptiveRefreshEnabled()) { + this.refreshFuture = + executor.scheduleAtFixedRate( + this::refreshSafely, + REFRESH_PERIOD.getSeconds(), + REFRESH_PERIOD.getSeconds(), + TimeUnit.SECONDS); + } + } + + /** {@inheritDoc} */ + @Override + public String authority() { + return authority; + } + + /** + * Create a {@link ClientCall} on a Channel from the pool to the remote operation specified by the + * given {@link MethodDescriptor}. The returned {@link ClientCall} does not trigger any remote + * behavior until {@link ClientCall#start(ClientCall.Listener, io.grpc.Metadata)} is invoked. + */ + @Override + public ClientCall newCall( + MethodDescriptor methodDescriptor, CallOptions callOptions) { + return new AffinityChannel(pickEntryIndex()).newCall(methodDescriptor, callOptions); + } + + /** + * Pick the index of an entry to use for the next call. The returned value *should* be within + * range, but callers should not assume that this is always the case as race conditions are + * possible. + */ + private int pickEntryIndex() { + return picker.get(); + } + + /** Pick an entry using the Round Robin algorithm. */ + private int pickEntryIndexRoundRobin() { + return Math.abs(indexTicker.getAndIncrement() % entries.get().size()); + } + + /** Pick an entry at random. */ + private int pickEntryIndexRandom() { + return rng.nextInt(entries.get().size()); + } + + /** Pick an entry using the least-in-flight algorithm. */ + private int pickEntryIndexLeastInFlight() { + List localEntries = entries.get(); + int minRpcs = Integer.MAX_VALUE; + List candidates = new ArrayList<>(); + + for (int i = 0; i < localEntries.size(); i++) { + Entry entry = localEntries.get(i); + int rpcs = entry.totalOutstandingRpcs(); + if (rpcs < minRpcs) { + minRpcs = rpcs; + candidates.clear(); + candidates.add(i); + } else if (rpcs == minRpcs) { + candidates.add(i); + } + } + // If there are multiple matching entries, pick one at random. + return candidates.get(rng.nextInt(candidates.size())); + } + + /** Pick an entry using the power-of-two algorithm. */ + private int pickEntryIndexPowerOfTwoLeastInFlight() { + List localEntries = entries.get(); + int choice1 = pickEntryIndexRandom(); + int choice2 = pickEntryIndexRandom(); + if (choice1 == choice2) { + // Try to pick two different entries. If this picks the same entry again, it's likely that + // there's only one healthy channel in the pool and we should proceed anyway. + choice2 = pickEntryIndexRandom(); + } + + Entry entry1 = localEntries.get(choice1); + Entry entry2 = localEntries.get(choice2); + return entry1.totalOutstandingRpcs() < entry2.totalOutstandingRpcs() ? choice1 : choice2; + } + + Channel getChannel(int index) { + return new AffinityChannel(index); + } + + /** {@inheritDoc} */ + @Override + public ManagedChannel shutdown() { + LOG.fine("Initiating graceful shutdown due to explicit request"); + + // Resize and refresh tasks can block on channel priming. We don't need + // to wait for the channels to be ready since we're shutting down the + // pool. Allowing interrupt to speed it up. + // Background executor lifecycle is managed by BigtableClientContext. + // Do not shut it down here. + if (resizeFuture != null) { + resizeFuture.cancel(true); + } + if (refreshFuture != null) { + refreshFuture.cancel(true); + } + List localEntries = entries.get(); + for (Entry entry : localEntries) { + entry.channel.shutdown(); + } + return this; + } + + /** {@inheritDoc} */ + @Override + public boolean isShutdown() { + List localEntries = entries.get(); + for (Entry entry : localEntries) { + if (!entry.channel.isShutdown()) { + return false; + } + } + return true; + } + + /** {@inheritDoc} */ + @Override + public boolean isTerminated() { + List localEntries = entries.get(); + for (Entry entry : localEntries) { + if (!entry.channel.isTerminated()) { + return false; + } + } + + return true; + } + + /** {@inheritDoc} */ + @Override + public ManagedChannel shutdownNow() { + LOG.fine("Initiating immediate shutdown due to explicit request"); + + if (resizeFuture != null) { + resizeFuture.cancel(true); + } + if (refreshFuture != null) { + refreshFuture.cancel(true); + } + + List localEntries = entries.get(); + for (Entry entry : localEntries) { + entry.channel.shutdownNow(); + } + + return this; + } + + /** {@inheritDoc} */ + @Override + public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { + long endTimeNanos = System.nanoTime() + unit.toNanos(timeout); + List localEntries = entries.get(); + for (Entry entry : localEntries) { + long awaitTimeNanos = endTimeNanos - System.nanoTime(); + if (awaitTimeNanos <= 0) { + break; + } + entry.channel.awaitTermination(awaitTimeNanos, TimeUnit.NANOSECONDS); + } + return isTerminated(); + } + + private void resizeSafely() { + try { + synchronized (entryWriteLock) { + resize(); + } + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to resize channel pool", e); + } + } + + /** + * Resize the number of channels based on the number of outstanding RPCs. + * + *

    This method is expected to be called on a fixed interval. On every invocation it will: + * + *

      + *
    • Get the maximum number of outstanding RPCs since last invocation + *
    • Determine a valid range of number of channels to handle that many outstanding RPCs + *
    • If the current number of channel falls outside of that range, add or remove at most + * {@link BigtableChannelPoolSettings#MAX_RESIZE_DELTA} to get closer to middle of that + * range. + *
    + * + *

    Not threadsafe, must be called under the entryWriteLock monitor + */ + @VisibleForTesting + void resize() { + List localEntries = entries.get(); + // Estimate the peak of RPCs in the last interval by summing the peak of RPCs per channel + int actualOutstandingRpcs = + localEntries.stream().mapToInt(Entry::getAndResetMaxOutstanding).sum(); + + // Number of channels if each channel operated at max capacity + int minChannels = + (int) Math.ceil(actualOutstandingRpcs / (double) settings.getMaxRpcsPerChannel()); + // Limit the threshold to absolute range + if (minChannels < settings.getMinChannelCount()) { + minChannels = settings.getMinChannelCount(); + } + + // Number of channels if each channel operated at minimum capacity + // Note: getMinRpcsPerChannel() can return 0, but division by 0 shouldn't cause a problem. + int maxChannels = + (int) Math.ceil(actualOutstandingRpcs / (double) settings.getMinRpcsPerChannel()); + // Limit the threshold to absolute range + if (maxChannels > settings.getMaxChannelCount()) { + maxChannels = settings.getMaxChannelCount(); + } + if (maxChannels < minChannels) { + maxChannels = minChannels; + } + + // If the pool were to be resized, try to aim for the middle of the bound, but limit rate of + // change. + int tentativeTarget = (maxChannels + minChannels) / 2; + int currentSize = localEntries.size(); + int delta = tentativeTarget - currentSize; + int dampenedTarget = tentativeTarget; + if (Math.abs(delta) > BigtableChannelPoolSettings.MAX_RESIZE_DELTA) { + dampenedTarget = + currentSize + (int) Math.copySign(BigtableChannelPoolSettings.MAX_RESIZE_DELTA, delta); + } + + // Only resize the pool when thresholds are crossed + if (localEntries.size() < minChannels) { + LOG.fine( + String.format( + "Detected throughput peak of %d, expanding channel pool size: %d -> %d.", + actualOutstandingRpcs, currentSize, dampenedTarget)); + + expand(dampenedTarget); + } else if (localEntries.size() > maxChannels) { + LOG.fine( + String.format( + "Detected throughput drop to %d, shrinking channel pool size: %d -> %d.", + actualOutstandingRpcs, currentSize, dampenedTarget)); + + shrink(dampenedTarget); + } + } + + /** Not threadsafe, must be called under the entryWriteLock monitor */ + private void shrink(int desiredSize) { + ImmutableList localEntries = entries.get(); + Preconditions.checkState( + localEntries.size() >= desiredSize, "current size is already smaller than the desired"); + + // Set the new list + entries.set(localEntries.subList(0, desiredSize)); + // clean up removed entries + List removed = localEntries.subList(desiredSize, localEntries.size()); + removed.forEach(Entry::requestShutdown); + } + + /** Not threadsafe, must be called under the entryWriteLock monitor */ + private void expand(int desiredSize) { + List localEntries = entries.get(); + Preconditions.checkState( + localEntries.size() <= desiredSize, "current size is already bigger than the desired"); + + ImmutableList.Builder newEntries = ImmutableList.builder().addAll(localEntries); + + for (int i = 0; i < desiredSize - localEntries.size(); i++) { + try { + ManagedChannel newChannel = channelSupplier.get(); + this.channelPrimer.primeChannel(newChannel); + newEntries.add(new Entry(newChannel)); + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to add channel", e); + } + } + + entries.set(newEntries.build()); + } + + private void refreshSafely() { + try { + refresh(); + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to pre-emptively refresh channnels", e); + } + } + + /** + * Replace all of the channels in the channel pool with fresh ones. This is meant to mitigate the + * hourly GFE disconnects by giving clients the ability to prime the channel on reconnect. + * + *

    This is done on a best effort basis. If the replacement channel fails to construct, the old + * channel will continue to be used. + */ + @InternalApi("Visible for testing") + void refresh() { + // Note: synchronization is necessary in case refresh is called concurrently: + // - thread1 fails to replace a single entry + // - thread2 succeeds replacing an entry + // - thread1 loses the race to replace the list + // - then thread2 will shut down channel that thread1 will put back into circulation (after it + // replaces the list) + synchronized (entryWriteLock) { + LOG.fine("Refreshing all channels"); + ArrayList newEntries = new ArrayList<>(entries.get()); + + for (int i = 0; i < newEntries.size(); i++) { + try { + ManagedChannel newChannel = channelSupplier.get(); + this.channelPrimer.primeChannel(newChannel); + newEntries.set(i, new Entry(newChannel)); + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to refresh channel, leaving old channel", e); + } + } + + ImmutableList replacedEntries = entries.getAndSet(ImmutableList.copyOf(newEntries)); + + // Shutdown the channels that were cycled out. + for (Entry e : replacedEntries) { + if (!newEntries.contains(e)) { + e.requestShutdown(); + } + } + } + } + + /** + * Get and retain a Channel Entry. The returned Entry will have its rpc count incremented, + * preventing it from getting recycled. + */ + private Entry getRetainedEntry(int affinity, boolean isStreaming) { + // If an entry is not retainable, that usually means that it's about to be replaced and if we + // retry we should get a new useable entry. + // The maximum number of concurrent calls to this method for any given time span is at most 2, + // so the loop can actually be 2 times. But going for 5 times for a safety margin for potential + // code evolving + for (int i = 0; i < 5; i++) { + Entry entry = getEntry(affinity); + if (entry.retain(isStreaming)) { + return entry; + } + } + // It is unlikely to reach here unless the pool code evolves to increase the maximum possible + // concurrent calls to this method. If it does, this is a bug in the channel pool implementation + // the number of retries above should be greater than the number of contending maintenance + // tasks. + throw new IllegalStateException("Bug: failed to retain a channel"); + } + + /** + * Returns one of the channels managed by this pool. The pool continues to "own" the channel, and + * the caller should not shut it down. + * + * @param affinity Two calls to this method with the same affinity returns the same channel most + * of the time, if the channel pool was refreshed since the last call, a new channel will be + * returned. The reverse is not true: Two calls with different affinities might return the + * same channel. However, the implementation should attempt to spread load evenly. + */ + private Entry getEntry(int affinity) { + List localEntries = entries.get(); + + int index = Math.abs(affinity % localEntries.size()); + + return localEntries.get(index); + } + + /** Gets the current list of BigtableChannelInsight objects. */ + @Override + public List getChannelInfos() { + return entries.get(); + } + + /** Bundles a gRPC {@link ManagedChannel} with some usage accounting. */ + static class Entry implements BigtableChannelObserver { + private final ManagedChannel channel; + + /** + * The primary purpose of keeping a count for outstanding RPCs is to track when a channel is + * safe to close. In grpc, initialization & starting of rpcs is split between 2 methods: + * Channel#newCall() and ClientCall#start. gRPC already has a mechanism to safely close channels + * that have rpcs that have been started. However, it does not protect calls that have been + * created but not started. In the sequence: Channel#newCall() Channel#shutdown() + * ClientCall#Start(), gRpc will error out the call telling the caller that the channel is + * shutdown. + * + *

    Hence, the increment of outstanding RPCs has to happen when the ClientCall is initialized, + * as part of Channel#newCall(), not after the ClientCall is started. The decrement of + * outstanding RPCs has to happen when the ClientCall is closed or the ClientCall failed to + * start. + */ + @VisibleForTesting final AtomicInteger errorCount = new AtomicInteger(0); + + @VisibleForTesting final AtomicInteger successCount = new AtomicInteger(0); + @VisibleForTesting final AtomicInteger outstandingUnaryRpcs = new AtomicInteger(0); + + @VisibleForTesting final AtomicInteger outstandingStreamingRpcs = new AtomicInteger(0); + + private final AtomicInteger maxOutstandingUnaryRpcs = new AtomicInteger(); + private final AtomicInteger maxOutstandingStreamingRpcs = new AtomicInteger(); + + /** this contains the PeerInfo field of the most recent rpc on this channel entry. */ + @VisibleForTesting + volatile PeerInfo.TransportType transportType = PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN; + + /** Queue storing the last 5 minutes of probe results */ + @VisibleForTesting + final ConcurrentLinkedQueue probeHistory = new ConcurrentLinkedQueue<>(); + + /** + * Keep both # of failed and # of successful probes so that we don't have to check size() on the + * ConcurrentLinkedQueue all the time + */ + final AtomicInteger failedProbesInWindow = new AtomicInteger(); + + final AtomicInteger successfulProbesInWindow = new AtomicInteger(); + + // Flag that the channel should be closed once all the outstanding RPCs complete. + private final AtomicBoolean shutdownRequested = new AtomicBoolean(); + // Flag that the channel has been closed. + private final AtomicBoolean shutdownInitiated = new AtomicBoolean(); + + @VisibleForTesting + Entry(ManagedChannel channel) { + this.channel = channel; + } + + void setTransportType(CallOptions callOptions) { + MetadataExtractorInterceptor.SidebandData sidebandData = + MetadataExtractorInterceptor.SidebandData.from(callOptions); + + // Set to the specific transport type if present, otherwise default to UNKNOWN + // we could check the Status and set it to unknown, but we might have PeerInfo with some non + // OK Status + transportType = + Optional.ofNullable(sidebandData) + .map(MetadataExtractorInterceptor.SidebandData::getPeerInfo) + .map(PeerInfo::getTransportType) + .orElse(PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN); + } + + ManagedChannel getManagedChannel() { + return this.channel; + } + + @VisibleForTesting + int totalOutstandingRpcs() { + return outstandingUnaryRpcs.get() + outstandingStreamingRpcs.get(); + } + + int getAndResetMaxOutstanding() { + int currentUnary = outstandingUnaryRpcs.get(); + int currentStreaming = outstandingStreamingRpcs.get(); + int prevMaxUnary = maxOutstandingUnaryRpcs.getAndSet(currentUnary); + int prevMaxStreaming = maxOutstandingStreamingRpcs.getAndSet(currentStreaming); + return prevMaxStreaming + prevMaxUnary; + } + + /** + * Try to increment the outstanding RPC count. The method will return false if the channel is + * closing and the caller should pick a different channel. If the method returned true, the + * channel has been successfully retained and it is the responsibility of the caller to release + * it. + */ + @VisibleForTesting + boolean retain(boolean isStreaming) { + AtomicInteger counter = isStreaming ? outstandingStreamingRpcs : outstandingUnaryRpcs; + AtomicInteger maxCounter = + isStreaming ? maxOutstandingStreamingRpcs : maxOutstandingUnaryRpcs; + int currentOutstanding = counter.incrementAndGet(); + maxCounter.accumulateAndGet(currentOutstanding, Math::max); + // abort if the channel is closing + if (shutdownRequested.get()) { + release(isStreaming); + return false; + } + return true; + } + + /** + * Notify the channel that the number of outstanding RPCs has decreased. If shutdown has been + * previously requested, this method will shutdown the channel if its the last outstanding RPC. + */ + void release(boolean isStreaming) { + int newCount = + isStreaming + ? outstandingStreamingRpcs.decrementAndGet() + : outstandingUnaryRpcs.decrementAndGet(); + if (newCount < 0) { + LOG.log(Level.WARNING, "Bug! Reference count is negative (" + newCount + ")!"); + } + + // Must check toalOutstandingRpcs after shutdownRequested (in reverse order of retain()) to + // ensure + // mutual exclusion. + if (shutdownRequested.get() && totalOutstandingRpcs() == 0) { + shutdown(); + } + } + + /** + * Request a shutdown. The actual shutdown will be delayed until there are no more outstanding + * RPCs. + */ + private void requestShutdown() { + shutdownRequested.set(true); + if (totalOutstandingRpcs() == 0) { + shutdown(); + } + } + + /** Ensure that shutdown is only called once. */ + private void shutdown() { + if (shutdownInitiated.compareAndSet(false, true)) { + channel.shutdown(); + } + } + + /** Gets the current number of outstanding Unary RPCs on this channel. */ + @Override + public int getOutstandingUnaryRpcs() { + return outstandingUnaryRpcs.get(); + } + + @Override + public int getOutstandingStreamingRpcs() { + return outstandingStreamingRpcs.get(); + } + + /** Get the current number of errors request count since the last observed period */ + @Override + public long getAndResetErrorCount() { + return errorCount.getAndSet(0); + } + + /** Get the current number of successful requests since the last observed period */ + @Override + public long getAndResetSuccessCount() { + return successCount.getAndSet(0); + } + + @Override + public PeerInfo.TransportType getTransportType() { + return transportType; + } + + void incrementErrorCount() { + errorCount.incrementAndGet(); + } + + void incrementSuccessCount() { + successCount.incrementAndGet(); + } + } + + /** Thin wrapper to ensure that new calls are properly reference counted. */ + private class AffinityChannel extends Channel { + private final int index; + + public AffinityChannel(int index) { + this.index = index; + } + + @Override + public String authority() { + return authority; + } + + @Override + public ClientCall newCall( + MethodDescriptor methodDescriptor, CallOptions callOptions) { + boolean isStreaming = + methodDescriptor.getType() == MethodDescriptor.MethodType.SERVER_STREAMING; + Entry entry = getRetainedEntry(index, isStreaming); + return new ReleasingClientCall<>( + entry.channel.newCall(methodDescriptor, callOptions), entry, isStreaming, callOptions); + } + } + + /** ClientCall wrapper that makes sure to decrement the outstanding RPC count on completion. */ + static class ReleasingClientCall extends SimpleForwardingClientCall { + @Nullable private CancellationException cancellationException; + final Entry entry; + private final boolean isStreaming; + private final CallOptions callOptions; + private final AtomicBoolean wasClosed = new AtomicBoolean(); + private final AtomicBoolean wasReleased = new AtomicBoolean(); + + public ReleasingClientCall( + ClientCall delegate, + Entry entry, + boolean isStreaming, + CallOptions callOptions) { + super(delegate); + this.entry = entry; + this.isStreaming = isStreaming; + this.callOptions = callOptions; + } + + @Override + public void start(Listener responseListener, Metadata headers) { + if (cancellationException != null) { + throw new IllegalStateException("Call is already cancelled", cancellationException); + } + try { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + super.onHeaders(headers); + entry.setTransportType(callOptions); + } + + @Override + public void onClose(Status status, Metadata trailers) { + if (!wasClosed.compareAndSet(false, true)) { + LOG.log( + Level.WARNING, + "Call is being closed more than once. Please make sure that onClose() is not" + + " being manually called."); + return; + } + try { + // status for increment success and error count + if (status.isOk()) { + entry.incrementSuccessCount(); + } else { + entry.incrementErrorCount(); + } + super.onClose(status, trailers); + } finally { + if (wasReleased.compareAndSet(false, true)) { + entry.release(isStreaming); + } else { + LOG.log( + Level.WARNING, + "Entry was released before the call is closed. This may be due to an" + + " exception on start of the call."); + } + } + } + }, + headers); + } catch (Exception e) { + // In case start failed, make sure to release + if (wasReleased.compareAndSet(false, true)) { + entry.release(isStreaming); + } else { + LOG.log( + Level.WARNING, + "The entry is already released. This indicates that onClose() has already been called" + + " previously"); + } + throw e; + } + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + this.cancellationException = new CancellationException(message); + super.cancel(message, cause); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolObserver.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolObserver.java new file mode 100644 index 000000000000..0b6d3c866405 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolObserver.java @@ -0,0 +1,26 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; +import java.util.List; + +@InternalApi +@FunctionalInterface +public interface BigtableChannelPoolObserver { + /** Gets the current list of BigtableChannelInfo objects. */ + List getChannelInfos(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java new file mode 100644 index 000000000000..c88e0f056a82 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java @@ -0,0 +1,237 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import java.time.Duration; +import java.util.Locale; +import java.util.logging.Logger; + +/** + * Settings to control {@link BigtableChannelPool} behavior. + * + *

    To facilitate low latency/high throughout applications, gax provides a {@link + * BigtableChannelPool}. The pool is meant to facilitate high throughput/low latency clients. By + * splitting load across multiple gRPC channels the client can spread load across multiple frontends + * and overcome gRPC's limit of 100 concurrent RPCs per channel. However oversizing the {@link + * BigtableChannelPool} can lead to underutilized channels which will lead to high tail latency due + * to GFEs disconnecting idle channels. + * + *

    The {@link BigtableChannelPool} is designed to adapt to varying traffic patterns by tracking + * outstanding RPCs and resizing the pool size. This class configures the behavior. In general + * clients should aim to have less than 50 concurrent RPCs per channel and at least 1 outstanding + * per channel per minute. + * + *

    The settings in this class will be applied every minute. + */ +@BetaApi("surface for channel pool sizing is not yet stable") +@AutoValue +public abstract class BigtableChannelPoolSettings { + @VisibleForTesting + static final Logger LOG = Logger.getLogger(BigtableChannelPoolSettings.class.getName()); + + /** How often to check and possibly resize the {@link BigtableChannelPool}. */ + static final Duration RESIZE_INTERVAL = Duration.ofMinutes(1); + + /** The maximum number of channels that can be added or removed at a time. */ + static final int MAX_RESIZE_DELTA = 2; + + /** Environment variable used to set load balancing strategy. */ + private static final String CBT_LOAD_BALANCING_STRATEGY_ENV_VAR = "CBT_LOAD_BALANCING_STRATEGY"; + + /** Load balancing strategy to use if environment variable is unset or invalid. */ + private static final LoadBalancingStrategy DEFAULT_LOAD_BALANCING_STRATEGY = + LoadBalancingStrategy.ROUND_ROBIN; + + /** Supported load-balancing strategies. */ + public enum LoadBalancingStrategy { + // Sequentially iterate across all channels. + ROUND_ROBIN, + // Pick the channel with the fewest in-flight requests. If multiple channels match, pick at + // random. + LEAST_IN_FLIGHT, + // Out of two random channels, pick the channel with the fewest in-flight requests. + POWER_OF_TWO_LEAST_IN_FLIGHT, + } + + /** + * Threshold to start scaling down the channel pool. + * + *

    When the average of the maximum number of outstanding RPCs in a single minute drop below + * this threshold, channels will be removed from the pool. + */ + public abstract int getMinRpcsPerChannel(); + + /** + * Threshold to start scaling up the channel pool. + * + *

    When the average of the maximum number of outstanding RPCs in a single minute surpass this + * threshold, channels will be added to the pool. For google services, gRPC channels will start + * locally queuing RPC when there are 100 concurrent RPCs. + */ + public abstract int getMaxRpcsPerChannel(); + + /** + * The absolute minimum size of the channel pool. + * + *

    Regardless of the current throughput, the number of channels will not drop below this limit + */ + public abstract int getMinChannelCount(); + + /** + * The absolute maximum size of the channel pool. + * + *

    Regardless of the current throughput, the number of channels will not exceed this limit + */ + public abstract int getMaxChannelCount(); + + /** + * The initial size of the channel pool. + * + *

    During client construction the client open this many connections. This will be scaled up or + * down in the next period. + */ + public abstract int getInitialChannelCount(); + + /** + * If all of the channels should be replaced on an hourly basis. + * + *

    The GFE will forcibly disconnect active channels after an hour. To minimize the cost of + * reconnects, this will create a new channel asynchronuously, prime it and then swap it with an + * old channel. + */ + public abstract boolean isPreemptiveRefreshEnabled(); + + /** The load balancing strategy to use for distributing RPCs across channels. */ + @InternalApi("Use CBT_LOAD_BALANCING_STRATEGY environment variable") + public abstract LoadBalancingStrategy getLoadBalancingStrategy(); + + /** + * Helper to check if the {@link BigtableChannelPool} implementation can skip dynamic size logic + */ + boolean isStaticSize() { + // When range is restricted to a single size + if (getMinChannelCount() == getMaxChannelCount()) { + return true; + } + // When the scaling threshold are not set + if (getMinRpcsPerChannel() == 0 && getMaxRpcsPerChannel() == Integer.MAX_VALUE) { + return true; + } + + return false; + } + + /** + * Use environment variable CBT_LOAD_BALANCING_STRATEGY to pick a load-balancing strategy. + * + * @return load-balancing strategy to use. + */ + private static LoadBalancingStrategy loadBalancingStrategyFromEnv() { + String strategyString = System.getenv(CBT_LOAD_BALANCING_STRATEGY_ENV_VAR); + if (Strings.isNullOrEmpty(strategyString)) { + return DEFAULT_LOAD_BALANCING_STRATEGY; + } + try { + return LoadBalancingStrategy.valueOf(strategyString.trim().toUpperCase(Locale.ENGLISH)); + } catch (IllegalArgumentException e) { + throw new IllegalStateException( + String.format("Invalid load-balancing strategy %s", strategyString)); + } + } + + public abstract Builder toBuilder(); + + public static BigtableChannelPoolSettings copyFrom(ChannelPoolSettings externalSettings) { + return BigtableChannelPoolSettings.builder() + .setMinRpcsPerChannel(externalSettings.getMinRpcsPerChannel()) + .setMaxRpcsPerChannel(externalSettings.getMaxRpcsPerChannel()) + .setMinChannelCount(externalSettings.getMinChannelCount()) + .setMaxChannelCount(externalSettings.getMaxChannelCount()) + .setInitialChannelCount(externalSettings.getInitialChannelCount()) + .setPreemptiveRefreshEnabled(externalSettings.isPreemptiveRefreshEnabled()) + .setLoadBalancingStrategy(loadBalancingStrategyFromEnv()) + .build(); + } + + public static BigtableChannelPoolSettings staticallySized(int size) { + return builder() + .setInitialChannelCount(size) + .setMinRpcsPerChannel(0) + .setMaxRpcsPerChannel(Integer.MAX_VALUE) + .setMinChannelCount(size) + .setMaxChannelCount(size) + .setLoadBalancingStrategy(loadBalancingStrategyFromEnv()) + .build(); + } + + public static Builder builder() { + return new AutoValue_BigtableChannelPoolSettings.Builder() + .setInitialChannelCount(1) + .setMinChannelCount(1) + .setMaxChannelCount(200) + .setMinRpcsPerChannel(0) + .setMaxRpcsPerChannel(Integer.MAX_VALUE) + .setPreemptiveRefreshEnabled(false) + .setLoadBalancingStrategy(loadBalancingStrategyFromEnv()); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setMinRpcsPerChannel(int count); + + public abstract Builder setMaxRpcsPerChannel(int count); + + public abstract Builder setMinChannelCount(int count); + + public abstract Builder setMaxChannelCount(int count); + + public abstract Builder setInitialChannelCount(int count); + + public abstract Builder setPreemptiveRefreshEnabled(boolean enabled); + + @InternalApi("Use CBT_LOAD_BALANCING_STRATEGY environment variable") + public abstract Builder setLoadBalancingStrategy(LoadBalancingStrategy strategy); + + abstract BigtableChannelPoolSettings autoBuild(); + + public BigtableChannelPoolSettings build() { + BigtableChannelPoolSettings s = autoBuild(); + + Preconditions.checkState( + s.getMinRpcsPerChannel() <= s.getMaxRpcsPerChannel(), "rpcsPerChannel range is invalid"); + Preconditions.checkState( + s.getMinChannelCount() > 0, "Minimum channel count must be at least 1"); + Preconditions.checkState( + s.getMinChannelCount() <= s.getMaxRpcsPerChannel(), "absolute channel range is invalid"); + Preconditions.checkState( + s.getMinChannelCount() <= s.getInitialChannelCount(), + "initial channel count be at least minChannelCount"); + Preconditions.checkState( + s.getInitialChannelCount() <= s.getMaxChannelCount(), + "initial channel count must be less than maxChannelCount"); + Preconditions.checkState( + s.getInitialChannelCount() > 0, "Initial channel count must be greater than 0"); + return s; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java new file mode 100644 index 000000000000..e0d120d27795 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java @@ -0,0 +1,264 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.TransportChannel; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.Credentials; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessChecker; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.common.base.Preconditions; +import io.grpc.ManagedChannel; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * An instance of TransportChannelProvider that provides a TransportChannel through a supplied + * InstantiatingGrpcChannelProvider. + */ +@InternalApi +public final class BigtableTransportChannelProvider implements TransportChannelProvider { + private static final Logger LOG = + Logger.getLogger(BigtableTransportChannelProvider.class.getName()); + private final InstantiatingGrpcChannelProvider delegate; + private final ChannelPrimer channelPrimer; + @Nullable private final ChannelPoolMetricsTracer channelPoolMetricsTracer; + @Nullable private final ScheduledExecutorService backgroundExecutor; + private final DirectAccessChecker directAccessChecker; + + private BigtableTransportChannelProvider( + InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider, + ChannelPrimer channelPrimer, + @Nullable ChannelPoolMetricsTracer channelPoolMetricsTracer, + @Nullable ScheduledExecutorService backgroundExecutor, + DirectAccessChecker directAccessChecker) { + delegate = Preconditions.checkNotNull(instantiatingGrpcChannelProvider); + this.channelPrimer = channelPrimer; + this.channelPoolMetricsTracer = channelPoolMetricsTracer; + this.backgroundExecutor = backgroundExecutor; + this.directAccessChecker = directAccessChecker; + } + + @Override + public boolean shouldAutoClose() { + return delegate.shouldAutoClose(); + } + + @SuppressWarnings("deprecation") + @Override + public boolean needsExecutor() { + return delegate.needsExecutor(); + } + + @Override + @Deprecated + public BigtableTransportChannelProvider withExecutor(ScheduledExecutorService executor) { + return withExecutor((Executor) executor); + } + + // This executor if set is for handling rpc callbacks so we can't use it as the background + // executor + @Override + public BigtableTransportChannelProvider withExecutor(Executor executor) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withExecutor(executor); + return new BigtableTransportChannelProvider( + newChannelProvider, + channelPrimer, + channelPoolMetricsTracer, + backgroundExecutor, + directAccessChecker); + } + + @Override + public boolean needsBackgroundExecutor() { + return delegate.needsBackgroundExecutor(); + } + + @Override + public TransportChannelProvider withBackgroundExecutor(ScheduledExecutorService executor) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withBackgroundExecutor(executor); + return new BigtableTransportChannelProvider( + newChannelProvider, channelPrimer, channelPoolMetricsTracer, executor, directAccessChecker); + } + + @Override + public boolean needsHeaders() { + return delegate.needsHeaders(); + } + + @Override + public BigtableTransportChannelProvider withHeaders(Map headers) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withHeaders(headers); + return new BigtableTransportChannelProvider( + newChannelProvider, + channelPrimer, + channelPoolMetricsTracer, + backgroundExecutor, + directAccessChecker); + } + + @Override + public boolean needsEndpoint() { + return delegate.needsEndpoint(); + } + + @Override + public TransportChannelProvider withEndpoint(String endpoint) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withEndpoint(endpoint); + return new BigtableTransportChannelProvider( + newChannelProvider, + channelPrimer, + channelPoolMetricsTracer, + backgroundExecutor, + directAccessChecker); + } + + @Deprecated + @Override + public boolean acceptsPoolSize() { + return delegate.acceptsPoolSize(); + } + + @Deprecated + @Override + public TransportChannelProvider withPoolSize(int size) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withPoolSize(size); + return new BigtableTransportChannelProvider( + newChannelProvider, + channelPrimer, + channelPoolMetricsTracer, + backgroundExecutor, + directAccessChecker); + } + + /** Expected to only be called once when BigtableClientContext is created */ + @Override + public TransportChannel getTransportChannel() throws IOException { + InstantiatingGrpcChannelProvider directAccessProvider = + EnhancedBigtableStubSettings.applyDirectAccessTraitsInternal(delegate.toBuilder()) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .build(); + + boolean isDirectAccessEligible = false; + + try { + GrpcTransportChannel grpcTransportChannel = + (GrpcTransportChannel) directAccessProvider.getTransportChannel(); + ManagedChannel directAccessChannel = (ManagedChannel) grpcTransportChannel.getChannel(); + isDirectAccessEligible = directAccessChecker.check(directAccessChannel); + } catch (Exception e) { + LOG.log(Level.WARNING, "Failed to check for direct access.", e); + directAccessChecker.investigateFailure(e); + } + + InstantiatingGrpcChannelProvider selectedProvider; + if (isDirectAccessEligible) { + selectedProvider = directAccessProvider; + } else { + selectedProvider = delegate; + } + + // This provider's main purpose is to replace the default GAX ChannelPool + // with a custom BigtableChannelPool, reusing the delegate's configuration. + + // To create our pool, we need a factory for raw gRPC channels. + // We achieve this by configuring our delegate to not use its own pooling + // (by setting pool size to 1) and then calling getTransportChannel() on it. + InstantiatingGrpcChannelProvider singleChannelProvider = + selectedProvider.toBuilder() + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .build(); + + Supplier channelSupplier = + () -> { + try { + GrpcTransportChannel channel = + (GrpcTransportChannel) singleChannelProvider.getTransportChannel(); + return (ManagedChannel) channel.getChannel(); + } catch (IOException e) { + throw new java.io.UncheckedIOException(e); + } + }; + + BigtableChannelPoolSettings btPoolSettings = + BigtableChannelPoolSettings.copyFrom(delegate.getChannelPoolSettings()); + + BigtableChannelPool btChannelPool = + BigtableChannelPool.create( + btPoolSettings, channelSupplier, channelPrimer, backgroundExecutor); + + if (channelPoolMetricsTracer != null) { + channelPoolMetricsTracer.registerChannelInsightsProvider(btChannelPool); + channelPoolMetricsTracer.registerLoadBalancingStrategy( + btPoolSettings.getLoadBalancingStrategy()); + } + + return GrpcTransportChannel.create(btChannelPool); + } + + @Override + public String getTransportName() { + return "bigtable"; + } + + @Override + public boolean needsCredentials() { + return delegate.needsCredentials(); + } + + @Override + public TransportChannelProvider withCredentials(Credentials credentials) { + InstantiatingGrpcChannelProvider newChannelProvider = + (InstantiatingGrpcChannelProvider) delegate.withCredentials(credentials); + return new BigtableTransportChannelProvider( + newChannelProvider, + channelPrimer, + channelPoolMetricsTracer, + backgroundExecutor, + directAccessChecker); + } + + /** Creates a BigtableTransportChannelProvider. */ + public static BigtableTransportChannelProvider create( + InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider, + ChannelPrimer channelPrimer, + ChannelPoolMetricsTracer outstandingRpcsMetricTracker, + ScheduledExecutorService backgroundExecutor, + DirectAccessChecker directAccessChecker) { + return new BigtableTransportChannelProvider( + instantiatingGrpcChannelProvider, + channelPrimer, + outstandingRpcsMetricTracker, + backgroundExecutor, + directAccessChecker); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java new file mode 100644 index 000000000000..9634b778ae16 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -0,0 +1,258 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.ApiFuture; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.data.v2.stub.NoOpChannelPrimer; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.MoreExecutors; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** Class that manages the health checking in the BigtableChannelPool */ +class ChannelPoolHealthChecker { + + private static final Logger logger = Logger.getLogger(ChannelPoolHealthChecker.class.getName()); + + // Configuration constants + // Window_Duration is the duration over which we keep probe results + private static final Duration WINDOW_DURATION = Duration.ofMinutes(5); + // Interval at which we probe channel health + private static final Duration PROBE_INTERVAL = Duration.ofSeconds(30); + // Timeout deadline for a probe + @VisibleForTesting static final Duration PROBE_DEADLINE = Duration.ofMillis(500); + // Minimum interval between new idle channel evictions + private static final Duration MIN_EVICTION_INTERVAL = Duration.ofMinutes(10); + // Minimum number of probes that must be sent to a channel before it will be considered for + // eviction + private static final int MIN_PROBES_FOR_EVALUATION = 4; + // Percentage of probes that must fail for a channel to be considered unhealthy + private static final int SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD = 60; + // "Circuitbreaker" - If this or a higher percentage of channels in a pool are bad, we will not + // evict any channels + private static final int POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT = 70; + + /** Inner class to represent the result of a single probe. */ + @AutoValue + abstract static class ProbeResult { + abstract Instant startTime(); + + abstract boolean isSuccessful(); + + static ProbeResult create(Instant startTime, boolean success) { + return new AutoValue_ChannelPoolHealthChecker_ProbeResult(startTime, success); + } + } + + private final Supplier> entrySupplier; + private volatile Instant lastEviction; + private final ScheduledExecutorService executor; + + private final ChannelPrimer channelPrimer; + + private ScheduledFuture probeTaskScheduledFuture; + private ScheduledFuture detectAndRemoveTaskScheduledFuture; + + private final Clock clock; + + /** Constructor for the pool health checker. */ + public ChannelPoolHealthChecker( + Supplier> entrySupplier, + ChannelPrimer channelPrimer, + ScheduledExecutorService executor, + Clock clock) { + this.entrySupplier = entrySupplier; + this.lastEviction = Instant.MIN; + this.channelPrimer = channelPrimer; + this.executor = executor; + this.clock = clock; + } + + void start() { + if (channelPrimer instanceof NoOpChannelPrimer) { + return; + } + + if (!(channelPrimer instanceof BigtableChannelPrimer)) { + logger.log( + Level.WARNING, + "Provided channelPrimer not an instance of BigtableChannelPrimer, not checking channel" + + " health."); + return; + } + + Duration initialDelayProbe = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.probeTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::runProbes, + initialDelayProbe.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + Duration initialDelayDetect = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.detectAndRemoveTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::detectAndRemoveOutlierEntries, + initialDelayDetect.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + } + + /** Stop running health checking */ + public void stop() { + if (probeTaskScheduledFuture != null) { + probeTaskScheduledFuture.cancel(false); + } + if (detectAndRemoveTaskScheduledFuture != null) { + detectAndRemoveTaskScheduledFuture.cancel(false); + } + } + + /** Runs probes on all the channels in the pool. */ + @VisibleForTesting + void runProbes() { + Preconditions.checkState( + channelPrimer instanceof BigtableChannelPrimer, + "Health checking can only be enabled with BigtableChannelPrimer, found %s", + channelPrimer); + BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; + + for (Entry entry : this.entrySupplier.get()) { + ApiFuture probeFuture = + primer.sendPrimeRequestsAsync(entry.getManagedChannel()); + probeFuture.addListener( + () -> onComplete(entry, clock.instant(), probeFuture), MoreExecutors.directExecutor()); + } + } + + /** Callback that will update Entry data on probe complete. */ + @VisibleForTesting + void onComplete(Entry entry, Instant startTime, ApiFuture probeFuture) { + boolean success; + try { + probeFuture.get(PROBE_DEADLINE.toMillis(), TimeUnit.MILLISECONDS); + success = true; + } catch (Exception e) { + success = false; + logger.log(Level.WARNING, "Probe failed", e); + } + addProbeResult(entry, ProbeResult.create(startTime, success)); + } + + @VisibleForTesting + void addProbeResult(Entry entry, ProbeResult result) { + entry.probeHistory.add(result); + if (result.isSuccessful()) { + entry.successfulProbesInWindow.incrementAndGet(); + } else { + entry.failedProbesInWindow.incrementAndGet(); + } + pruneHistory(entry); + } + + @VisibleForTesting + void pruneHistory(Entry entry) { + Instant windowStart = clock.instant().minus(WINDOW_DURATION); + while (!entry.probeHistory.isEmpty() + && entry.probeHistory.peek().startTime().isBefore(windowStart)) { + ProbeResult removedResult = entry.probeHistory.poll(); + if (removedResult.isSuccessful()) { + entry.successfulProbesInWindow.decrementAndGet(); + } else { + entry.failedProbesInWindow.decrementAndGet(); + } + } + } + + /** Checks if a single entry is currently healthy based on its probe history. */ + @VisibleForTesting + boolean isEntryHealthy(Entry entry) { + int failedProbes = entry.failedProbesInWindow.get(); + int totalProbes = failedProbes + entry.successfulProbesInWindow.get(); + + if (totalProbes < MIN_PROBES_FOR_EVALUATION) { + return true; // Not enough data, assume healthy. + } + + double failureRate = ((double) failedProbes / totalProbes) * 100.0; + return failureRate < SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD; + } + + /** + * Finds a channel that is an outlier in terms of health. + * + * @return the entry to be evicted. Returns null if nothing to evict. + */ + @Nullable + @VisibleForTesting + Entry findOutlierEntry() { + List unhealthyEntries = + this.entrySupplier.get().stream() + .filter(entry -> !isEntryHealthy(entry)) + .collect(Collectors.toList()); + + int poolSize = this.entrySupplier.get().size(); + if (unhealthyEntries.isEmpty() || poolSize == 0) { + return null; + } + + // If more than CIRCUITBREAKER_PERCENT of channels are unhealthy we won't evict + double unhealthyPercent = (double) unhealthyEntries.size() / poolSize * 100.0; + if (unhealthyPercent >= POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT) { + return null; + } + + return unhealthyEntries.stream() + .max(Comparator.comparingInt(entry -> entry.failedProbesInWindow.get())) + .orElse(null); + } + + /** Periodically detects and removes outlier channels from the pool. */ + @VisibleForTesting + void detectAndRemoveOutlierEntries() { + if (clock.instant().isBefore(lastEviction.plus(MIN_EVICTION_INTERVAL))) { + // Primitive but effective rate-limiting. + return; + } + Entry outlier = findOutlierEntry(); + if (outlier != null) { + this.lastEviction = clock.instant(); + outlier.failedProbesInWindow.set(0); + outlier.successfulProbesInWindow.set(0); + outlier.probeHistory.clear(); + outlier.getManagedChannel().enterIdle(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java new file mode 100644 index 000000000000..29dac62a51fb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; +import com.google.bigtable.v2.PingAndWarmResponse; +import io.grpc.Channel; +import io.grpc.ManagedChannel; + +@InternalApi("For internal use by google-cloud-java clients only") +public interface ChannelPrimer { + /** + * @deprecated Use {@link #primeChannel(Channel)} + */ + @Deprecated + default void primeChannel(ManagedChannel channel) { + primeChannel((Channel) channel); + } + + void primeChannel(Channel channel); + + /** + * @deprecated Use {@link #sendPrimeRequestsAsync(Channel)} + */ + @Deprecated + default ApiFuture sendPrimeRequestsAsync(ManagedChannel channel) { + return sendPrimeRequestsAsync((Channel) channel); + } + + ApiFuture sendPrimeRequestsAsync(Channel channel); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/package-info.java new file mode 100644 index 000000000000..d5f08a3976de --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/package-info.java @@ -0,0 +1,24 @@ +/* + * Copyright 2018 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. + */ +/** + * General purpose utilities that might be moved to gax at some point in the future. + * + *

    For internal use, public for technical reasons. + */ +@InternalApi +package com.google.cloud.bigtable.gaxx; + +import com.google.api.core.InternalApi; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/IncompleteStreamException.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/IncompleteStreamException.java new file mode 100644 index 000000000000..1382a608faa8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/IncompleteStreamException.java @@ -0,0 +1,26 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.reframing; + +/** + * Thrown by {@link ReframingResponseObserver} to signal that a stream closed prematurely, leaving + * behind a partial filled buffer. + */ +public class IncompleteStreamException extends RuntimeException { + IncompleteStreamException() { + super("Upstream closed too early, leaving an incomplete response."); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/Reframer.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/Reframer.java new file mode 100644 index 000000000000..b221ce8469d5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/Reframer.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.reframing; + +import com.google.api.core.InternalApi; + +/** + * Interface for the business logic of a stream transformation. All methods will be called in a + * synchronized block, so implementations don't need to be thread safe or be concerned with back + * pressure. + * + *

    The flow is: + * + *

    + * hasFullFrame?
    + *  -> true -> pop()
    + *  -> false
    + *    -> upstream complete?
    + *      -> true
    + *        -> hasPartialFrame?
    + *          -> true
    + *            => notify error
    + *          -> false
    + *            => notify complete
    + *      -> false
    + *        => push() and restart at hasFullFrame?
    + * 
    + * + * @param The type of responses coming from the inner ServerStreamingCallable. + * @param The type of responses the outer {@link com.google.api.gax.rpc.ResponseObserver} + * expects. + */ +@InternalApi +public interface Reframer { + /** + * Refill internal buffers with inner/upstream response. Should only be invoked if {@link + * #hasFullFrame} returns false. + */ + void push(InnerT response); + + /** + * Checks if there is a frame to be popped. + * + *

    Note that this method might update internal to buffer the next response. + */ + boolean hasFullFrame(); + + /** Checks if there is any incomplete data. Used to check if the stream closed prematurely. */ + boolean hasPartialFrame(); + + /** + * Returns and removes the current completed frame. Should only be called if hasFullFrame returns + * true. + */ + OuterT pop(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java new file mode 100644 index 000000000000..3a5458836fc2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java @@ -0,0 +1,386 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.reframing; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; +import com.google.common.base.Preconditions; +import com.google.common.math.IntMath; +import java.util.concurrent.CancellationException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Mediates message flow between two {@link ResponseObserver}s. It is intended for situations when a + * stream needs to be transformed in such a way where the incoming responses do not map 1:1 to the + * output responses. + * + *

    This class manages back pressure between M upstream responses and N downstream responses. It + * buffers responses when M > N and spools them when M < N. The downstream responses will be + * delivered via either the upstream thread or the downstream thread that called request(); in + * either case, the downstream methods will be invoked sequentially. Neither the downstream {@link + * ResponseObserver} nor the {@link Reframer} need to be threadsafe. + * + *

    Expected usage: + * + *

    {@code
    + *  class OuterStreamingCallable extends ServerStreamingCallable {
    + *    private final ServerStreamingCallable innerCallable;
    + *
    + *    OuterStreamingCallable(ServerStreamingCallable innerCallable) {
    + *      this.innerCallable = innerCallable;
    + *    }
    + *
    + *    public void call(Request request, ResponseObserver outerResponseObserver,
    + * ApiCallContext context) {
    + *      Reframer myReframer = new Reframer<>();
    + *      innerCallable.call(request, new ReframingResponseObserver(myReframer, outerResponseObserver),
    + * context);
    + *    }
    + *  }
    + * }
    + */ +@InternalApi +public class ReframingResponseObserver extends SafeResponseObserver { + // Used as a nonblocking mutex for deliver(). + // 0 means unlocked + // 1 means locked without contention + // > 1 means locked with contention (another thread tried to deliver concurrently) + private final AtomicInteger lock = new AtomicInteger(); + + private final ResponseObserver outerResponseObserver; + private final Reframer reframer; + + // Written in the initial calling thread. + private StreamController innerController; + private boolean hasStarted; + private boolean autoFlowControl = true; + + // Read and written by different threads w/o lock. + private final AtomicInteger numRequested = new AtomicInteger(); + // Written by an application thread and read under lock in delivery. + private final AtomicReference cancellation = new AtomicReference<>(); + + // Only written under lock + private volatile boolean awaitingInner; + // Written by multiple interleaved threads. It is the staging area for messages before they are + // fed to the Reframer. It protects the Reframer from having to worry about concurrency, by acting + // like a single item queue: a GRPC thread puts a value in, and then, after acquiring the lock, + // any thread can take the value out and feed it to the Reframer. + private final AtomicReference newItem = new AtomicReference<>(); + + // Written by a GRPC thread, and read by any thread after acquiring a lock + // Care must be to taken to read the volatile done before accessing error. + private Throwable error; + private volatile boolean done; + + // Always written and read by the same thread under lock. + // Safety flag set in the delivery loop before notifying the outer observer of termination. + // It's checked by error handling in delivery() to avoid double notifying the outer observer. + private boolean finished; + + public ReframingResponseObserver( + ResponseObserver observer, Reframer reframer) { + super(observer); + this.outerResponseObserver = observer; + this.reframer = reframer; + } + + /** + * Callback that will be notified when the inner/upstream callable starts. This will in turn + * notify the outer/downstreamObserver of stream start. Regardless of the + * outer/downstreamObserver, the upstream controller will be put into manual flow control. + * + * @param controller The controller for the upstream stream. + */ + @Override + protected void onStartImpl(StreamController controller) { + innerController = controller; + innerController.disableAutoInboundFlowControl(); + + outerResponseObserver.onStart( + new StreamController() { + @Override + public void disableAutoInboundFlowControl() { + Preconditions.checkState( + !hasStarted, "Can't disable automatic flow control once the stream has started"); + autoFlowControl = false; + numRequested.set(0); + } + + @Override + public void request(int count) { + // innerController.request(int) is indirectly invoked in deliver(). + ReframingResponseObserver.this.onRequest(count); + } + + @Override + public void cancel() { + ReframingResponseObserver.this.onCancel(); + } + }); + + hasStarted = true; + + if (autoFlowControl) { + numRequested.set(Integer.MAX_VALUE); + deliver(); + } + } + + /** + * Request n responses to be delivered to the outer/downstream {@link + * ResponseObserver#onResponse(Object)}. This method might synchronously deliver the messages if + * they have already been buffered. Or it will deliver them asynchronously if they need to be + * requested from upstream. + * + * @param count The maximum number of responses to deliver + */ + private void onRequest(int count) { + Preconditions.checkState(!autoFlowControl, "Auto flow control enabled"); + Preconditions.checkArgument(count > 0, "Count must be > 0"); + + while (true) { + int current = numRequested.get(); + if (current == Integer.MAX_VALUE) { + return; + } + + int newValue = IntMath.saturatedAdd(current, count); + if (numRequested.compareAndSet(current, newValue)) { + break; + } + } + + deliver(); + } + + /** + * Cancels the stream and notifies the downstream {@link ResponseObserver#onError(Throwable)}. + * This method can be called multiple times, but only the first time has any effect. Please note + * that there is a race condition between cancellation and the stream completing normally. + */ + private void onCancel() { + if (cancellation.compareAndSet(null, new CancellationException("User cancelled stream"))) { + innerController.cancel(); + } + + deliver(); + } + + /** + * Accept a new response from inner/upstream callable. This message will be processed by the + * {@link Reframer} in the delivery loop and the output will be delivered to the downstream {@link + * ResponseObserver}. + * + *

    If the delivery loop is stopped, this will restart it. + */ + @Override + protected void onResponseImpl(InnerT response) { + IllegalStateException error = null; + + // Guard against unsolicited notifications + if (!awaitingInner || !newItem.compareAndSet(null, response)) { + // Notify downstream if it's still open + error = new IllegalStateException("Received unsolicited response from upstream."); + cancellation.compareAndSet(null, error); + } + deliver(); + + // Notify upstream by throwing an exception + if (error != null) { + throw error; + } + } + + /** + * Process inner/upstream callable's onError notification. This will be queued to be delivered + * after the delegate exhausts its buffers. + * + *

    If the delivery loop is stopped, this will restart it. + */ + @Override + protected void onErrorImpl(Throwable t) { + // order of assignment matters + error = t; + done = true; + deliver(); + } + + /** + * Process inner/upstream callable's onComplete notification. This will be queued to be delivered + * after the delegate exhausts its buffers. + * + *

    If the delivery loop is stopped, this will restart it. + */ + @Override + protected void onCompleteImpl() { + done = true; + deliver(); + } + + /** Tries to kick off the delivery loop, wrapping it in error handling. */ + private void deliver() { + try { + deliverUnsafe(); + } catch (Throwable t) { + // This should never happen. If does, it means we are in an inconsistent state and should + // close the stream and further processing should be prevented. This is accomplished by + // purposefully leaving the lock non-zero and notifying the outerResponseObserver of the + // error. Care must be taken to avoid calling close twice in case the first invocation threw + // an error. + try { + innerController.cancel(); + } catch (Throwable cancelError) { + t.addSuppressed( + new IllegalStateException( + "Failed to cancel upstream while recovering from an unexpected error", + cancelError)); + } + if (!finished) { + outerResponseObserver.onError(t); + } + } + } + + /** + * Coordinates state transfer between inner/downstream callable and the outer/upstream. It + * orchestrates the flow of demand from downstream to upstream. The data flows from upstream + * through the Reframer to downstream. It is back pressure aware and will only send as many + * messages as were requested. However, it will send unsolicited onComplete & onError messages. + * + *

    This method is thread safe and performs all state changes (including interactions with the + * Reframer) using CAS mutex. + */ + private void deliverUnsafe() { + // Try to acquire the lock + if (lock.getAndIncrement() != 0) { + return; + } + + do { + // Optimization: the inner loop will eager process any accumulated state, so reset the lock + // for just this iteration. (If another event occurs during processing, it can increment the + // lock to enqueue another iteration). + lock.set(1); + + // Process the upstream message if one exists. + pollUpstream(); + + // Eagerly notify of onComplete/onError disregarding demand. + // NOTE: this will purposely leave wip set to avoid further deliveries. + if (maybeFinish()) { + return; + } + + // Deliver as many messages as possible + int demandSnapshot = numRequested.get(); + int delivered = 0; + + while (delivered < demandSnapshot) { + // Deliver a message if we can + if (reframer.hasFullFrame()) { + delivered++; + outerResponseObserver.onResponse(reframer.pop()); + } else { + // Otherwise request more from upstream (if we haven't done so already) + if (!awaitingInner) { + awaitingInner = true; + innerController.request(1); + } + break; + } + + if (maybeFinish()) { + return; + } + } + + // update the counter in bulk + if (delivered != 0) { + numRequested.addAndGet(-delivered); + } + } while (lock.decrementAndGet() != 0); + } + + /** + * Checks if the awaited upstream response is available. If it is, then feed it to the {@link + * Reframer} and update the {@link #awaitingInner} flag. Upon exit, if awaitingInner is not set, + * then done is guaranteed to reflect the current status of the upstream. + */ + private void pollUpstream() { + if (!awaitingInner) { + return; + } + + boolean localDone = this.done; + + // Try to move the new item into the reframer + InnerT newUpstreamItem = newItem.getAndSet(null); + if (newUpstreamItem != null) { + reframer.push(newUpstreamItem); + // and reset the awaiting flag, if the item arrived or upstream closed + awaitingInner = false; + } else if (localDone) { + awaitingInner = false; + } + } + + /** + * Completes the outer observer if appropriate. + * + *

    Grounds for completion: + * + *

      + *
    • Caller cancelled the stream + *
    • Upstream has been exhausted and there is no hope of completing another frame. + *
    + * + *

    Upon upstream exhaustion, the outer observer will be notified via onComplete only if all + * buffers have been consumed. Otherwise it will be notified with an IncompleteStreamException. + * + * @return true if the outer observer has been notified of completion. + */ + private boolean maybeFinish() { + // Check for cancellations + Throwable localError = this.cancellation.get(); + if (localError != null) { + finished = true; + + outerResponseObserver.onError(localError); + return true; + } + + // Check for upstream termination and exhaustion of local buffers + if (done && !reframer.hasFullFrame() && !awaitingInner) { + finished = true; + + if (error != null) { + outerResponseObserver.onError(error); + } else if (reframer.hasPartialFrame()) { + outerResponseObserver.onError(new IncompleteStreamException()); + } else { + outerResponseObserver.onComplete(); + } + return true; + } + + // No termination conditions found, go back to business as usual + return false; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/package-info.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/package-info.java new file mode 100644 index 000000000000..2c3157249a9f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/package-info.java @@ -0,0 +1,28 @@ +/* + * Copyright 2018 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. + */ +/** + * Mediates message flow between two {@link com.google.api.gax.rpc.ResponseObserver}s. + * + *

    It is intended for situations when a stream needs to be transformed in such a way where the + * incoming responses do not map 1:1 to the output responses. This is used to transform + * ReadRowsResponse chunks into logical rows, but is generic enough to be used for other purposes. + * + *

    For internal use, public for technical reasons. + */ +@InternalApi +package com.google.cloud.bigtable.gaxx.reframing; + +import com.google.api.core.InternalApi; diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java new file mode 100644 index 000000000000..d71a04423505 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java @@ -0,0 +1,53 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.rpc.ApiException; + +/** For internal use, public for technical reasons. */ +@InternalApi +public class ApiResultRetryAlgorithm extends BasicResultRetryAlgorithm { + + /** Returns true if previousThrowable is an {@link ApiException} that is retryable. */ + @Override + public boolean shouldRetry(Throwable previousThrowable, ResponseT previousResponse) { + return (previousThrowable instanceof ApiException) + && ((ApiException) previousThrowable).isRetryable(); + } + + /** + * If {@link RetryingContext#getRetryableCodes()} is not null: Returns true if the status code of + * previousThrowable is in the list of retryable code of the {@link RetryingContext}. + * + *

    Otherwise it returns the result of {@link #shouldRetry(Throwable, Object)}. + */ + @Override + public boolean shouldRetry( + RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) { + if (context.getRetryableCodes() != null) { + // Ignore the isRetryable() value of the throwable if the RetryingContext has a specific list + // of codes that should be retried. + return (previousThrowable instanceof ApiException) + && context + .getRetryableCodes() + .contains(((ApiException) previousThrowable).getStatusCode().getCode()); + } + return shouldRetry(previousThrowable, previousResponse); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java new file mode 100644 index 000000000000..6d5c75ea9969 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java @@ -0,0 +1,83 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.NonCancellableFuture; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.base.Preconditions; +import java.util.concurrent.Callable; + +// TODO: remove this once ApiResultRetryAlgorithm is added to gax. +/** + * A callable representing an attempt to make an RPC call. This class is used from {@link + * RetryingCallable}. + * + * @param request type + * @param response type + */ +@InternalApi +public class AttemptCallable implements Callable { + private final UnaryCallable callable; + private final RequestT request; + private final ApiCallContext originalCallContext; + + private volatile RetryingFuture externalFuture; + + AttemptCallable( + UnaryCallable callable, RequestT request, ApiCallContext callContext) { + this.callable = Preconditions.checkNotNull(callable); + this.request = Preconditions.checkNotNull(request); + this.originalCallContext = Preconditions.checkNotNull(callContext); + } + + public void setExternalFuture(RetryingFuture externalFuture) { + this.externalFuture = Preconditions.checkNotNull(externalFuture); + } + + @Override + public ResponseT call() { + ApiCallContext callContext = originalCallContext; + + try { + // Set the RPC timeout if the caller did not provide their own. + java.time.Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeoutDuration(); + if (!rpcTimeout.isZero() && callContext.getTimeout() == null) { + callContext = callContext.withTimeoutDuration(rpcTimeout); + } + + externalFuture.setAttemptFuture(new NonCancellableFuture()); + if (externalFuture.isDone()) { + return null; + } + + callContext + .getTracer() + .attemptStarted(request, externalFuture.getAttemptSettings().getOverallAttemptCount()); + + ApiFuture internalFuture = callable.futureCall(request, callContext); + externalFuture.setAttemptFuture(internalFuture); + } catch (Throwable e) { + externalFuture.setAttemptFuture(ApiFutures.immediateFailedFuture(e)); + } + + return null; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java new file mode 100644 index 000000000000..d25ec22a3ac0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java @@ -0,0 +1,96 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.ExponentialRetryAlgorithm; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.ScheduledRetryingExecutor; +import com.google.api.gax.retrying.StreamingRetryAlgorithm; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; + +// TODO: remove this once ApiResultRetryAlgorithm is added to gax. +/** + * Class with utility methods to create callable objects using provided settings. + * + *

    The callable objects wrap a given direct callable with features like retry and exception + * translation. + */ +@InternalApi +public class Callables { + + private Callables() {} + + public static UnaryCallable retrying( + UnaryCallable innerCallable, + UnaryCallSettings callSettings, + ClientContext clientContext) { + + UnaryCallSettings settings = callSettings; + + RetryAlgorithm retryAlgorithm = + new RetryAlgorithm<>( + new RetryInfoRetryAlgorithm<>(), + new ExponentialRetryAlgorithm(settings.getRetrySettings(), clientContext.getClock())); + ScheduledRetryingExecutor executor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + + return new RetryingCallable<>(clientContext.getDefaultCallContext(), innerCallable, executor); + } + + public static ServerStreamingCallable retrying( + ServerStreamingCallable innerCallable, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + + ServerStreamingCallSettings settings = callSettings; + + StreamingRetryAlgorithm retryAlgorithm = + new StreamingRetryAlgorithm<>( + new RetryInfoRetryAlgorithm<>(), + new ExponentialRetryAlgorithm(settings.getRetrySettings(), clientContext.getClock())); + + ScheduledRetryingExecutor retryingExecutor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + + return new RetryingServerStreamingCallable<>( + innerCallable, retryingExecutor, settings.getResumptionStrategy()); + } + + public static + ServerStreamingCallable retryingForLargeRows( + ServerStreamingCallable innerCallable, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + + ServerStreamingCallSettings settings = callSettings; + + StreamingRetryAlgorithm retryAlgorithm = + new StreamingRetryAlgorithm<>( + new LargeRowRetryAlgorithm<>(), + new ExponentialRetryAlgorithm(settings.getRetrySettings(), clientContext.getClock())); + + ScheduledRetryingExecutor retryingExecutor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + + return new RetryingServerStreamingCallable<>( + innerCallable, retryingExecutor, settings.getResumptionStrategy()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/LargeRowRetryAlgorithm.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/LargeRowRetryAlgorithm.java new file mode 100644 index 000000000000..2ec43cadd146 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/LargeRowRetryAlgorithm.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.ApiException; +import com.google.protobuf.util.Durations; +import com.google.rpc.RetryInfo; +import javax.annotation.Nullable; + +/** + * This retry algorithm checks the metadata of an exception for additional error details. It also + * allows to retry for {@link com.google.api.gax.rpc.FailedPreconditionException} with + * ErrorDetails.Reason as "LargeRowReadError" (for large rows). If the metadata has a RetryInfo + * field, use the retry delay to set the wait time between attempts. + */ +@InternalApi +public class LargeRowRetryAlgorithm extends BasicResultRetryAlgorithm { + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings) { + java.time.Duration retryDelay = extractRetryDelay(prevThrowable); + if (retryDelay != null) { + return prevSettings.toBuilder() + .setRandomizedRetryDelayDuration(retryDelay) + .setAttemptCount(prevSettings.getAttemptCount() + 1) + .setOverallAttemptCount(prevSettings.getAttemptCount() + 1) + .build(); + } + return null; + } + + /** Returns true if previousThrowable is an {@link ApiException} that is retryable. */ + @Override + public boolean shouldRetry(Throwable previousThrowable, ResponseT previousResponse) { + return shouldRetry(null, previousThrowable, previousResponse); + } + + /** + * If {@link RetryingContext#getRetryableCodes()} is not null: Returns true if the status code of + * previousThrowable is in the list of retryable code of the {@link RetryingContext}. + * + *

    Otherwise it returns the result of {@link #shouldRetry(Throwable, Object)}. + */ + @Override + public boolean shouldRetry( + @Nullable RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) { + if (extractRetryDelay(previousThrowable) != null) { + // First check if server wants us to retry + return true; + } + if (isLargeRowException(previousThrowable)) { + return true; + } + if (context != null && context.getRetryableCodes() != null) { + // Ignore the isRetryable() value of the throwable if the RetryingContext has a specific list + // of codes that should be retried. + return ((previousThrowable instanceof ApiException) + && context + .getRetryableCodes() + .contains(((ApiException) previousThrowable).getStatusCode().getCode())); + } + + // Server didn't have retry information and there's no retry context, use the local status + // code config. + return previousThrowable instanceof ApiException + && ((ApiException) previousThrowable).isRetryable(); + } + + public boolean isLargeRowException(Throwable previousThrowable) { + return (previousThrowable != null) + && (previousThrowable instanceof ApiException) + && ((ApiException) previousThrowable).getReason() != null + && ((ApiException) previousThrowable).getReason().equals("LargeRowReadError"); + } + + static java.time.Duration extractRetryDelay(@Nullable Throwable throwable) { + if (throwable == null) { + return null; + } + if (!(throwable instanceof ApiException)) { + return null; + } + ApiException exception = (ApiException) throwable; + if (exception.getErrorDetails() == null) { + return null; + } + if (exception.getErrorDetails().getRetryInfo() == null) { + return null; + } + RetryInfo retryInfo = exception.getErrorDetails().getRetryInfo(); + return java.time.Duration.ofMillis(Durations.toMillis(retryInfo.getRetryDelay())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/NonCancellableFuture.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/NonCancellableFuture.java new file mode 100644 index 000000000000..539695a1c32c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/NonCancellableFuture.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.AbstractApiFuture; +import com.google.api.core.InternalApi; + +// TODO: Remove this class once the gax version becomes public +/** + * A future which cannot be cancelled from the external package. Its a copy of {@link + * com.google.api.gax.retrying.NonCancellableFuture}, which is marked as {@link InternalApi}. + * + *

    For internal use, public for technical reasons. + * + * @param future response type + */ +@InternalApi +public final class NonCancellableFuture extends AbstractApiFuture { + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + return false; + } + + void cancelPrivately() { + super.cancel(false); + } + + boolean setPrivately(ResponseT value) { + return super.set(value); + } + + boolean setExceptionPrivately(Throwable throwable) { + return super.setException(throwable); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java new file mode 100644 index 000000000000..c02318fd2601 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.ApiException; +import com.google.protobuf.util.Durations; +import com.google.rpc.RetryInfo; +import javax.annotation.Nullable; + +// TODO move this algorithm to gax +/** + * This retry algorithm checks the metadata of an exception for additional error details. If the + * metadata has a RetryInfo field, use the retry delay to set the wait time between attempts. + */ +@InternalApi +public class RetryInfoRetryAlgorithm extends BasicResultRetryAlgorithm { + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings) { + java.time.Duration retryDelay = extractRetryDelay(prevThrowable); + if (retryDelay != null) { + return prevSettings.toBuilder() + .setRetryDelayDuration(retryDelay) + .setRandomizedRetryDelayDuration(retryDelay) + .setAttemptCount(prevSettings.getAttemptCount() + 1) + .setOverallAttemptCount(prevSettings.getAttemptCount() + 1) + .build(); + } + return null; + } + + /** Returns true if previousThrowable is an {@link ApiException} that is retryable. */ + @Override + public boolean shouldRetry(Throwable previousThrowable, ResponseT previousResponse) { + return shouldRetry(null, previousThrowable, previousResponse); + } + + /** + * If {@link RetryingContext#getRetryableCodes()} is not null: Returns true if the status code of + * previousThrowable is in the list of retryable code of the {@link RetryingContext}. + * + *

    Otherwise it returns the result of {@link #shouldRetry(Throwable, Object)}. + */ + @Override + public boolean shouldRetry( + @Nullable RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) { + if (extractRetryDelay(previousThrowable) != null) { + // First check if server wants us to retry + return true; + } + if (context != null && context.getRetryableCodes() != null) { + // Ignore the isRetryable() value of the throwable if the RetryingContext has a specific list + // of codes that should be retried. + return ((previousThrowable instanceof ApiException) + && context + .getRetryableCodes() + .contains(((ApiException) previousThrowable).getStatusCode().getCode())); + } + // Server didn't have retry information and there's no retry context, use the local status + // code config. + return previousThrowable instanceof ApiException + && ((ApiException) previousThrowable).isRetryable(); + } + + static java.time.Duration extractRetryDelay(@Nullable Throwable throwable) { + if (throwable == null) { + return null; + } + if (!(throwable instanceof ApiException)) { + return null; + } + ApiException exception = (ApiException) throwable; + if (exception.getErrorDetails() == null) { + return null; + } + if (exception.getErrorDetails().getRetryInfo() == null) { + return null; + } + RetryInfo retryInfo = exception.getErrorDetails().getRetryInfo(); + return java.time.Duration.ofMillis(Durations.toMillis(retryInfo.getRetryDelay())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java new file mode 100644 index 000000000000..d9cea20fcebc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.RetryingExecutorWithContext; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.base.Preconditions; + +// TODO: remove this once ApiResultRetryAlgorithm is added to gax. +/** + * A UnaryCallable that will keep issuing calls to an inner callable until it succeeds or times out. + */ +@InternalApi +public class RetryingCallable extends UnaryCallable { + private final ApiCallContext callContextPrototype; + private final UnaryCallable callable; + private final RetryingExecutorWithContext executor; + + public RetryingCallable( + ApiCallContext callContextPrototype, + UnaryCallable callable, + RetryingExecutorWithContext executor) { + this.callContextPrototype = Preconditions.checkNotNull(callContextPrototype); + this.callable = Preconditions.checkNotNull(callable); + this.executor = Preconditions.checkNotNull(executor); + } + + @Override + public RetryingFuture futureCall(RequestT request, ApiCallContext inputContext) { + ApiCallContext context = this.callContextPrototype.nullToSelf(inputContext); + AttemptCallable retryCallable = + new AttemptCallable<>(this.callable, request, context); + RetryingFuture retryingFuture = + this.executor.createFuture(retryCallable, inputContext); + retryCallable.setExternalFuture(retryingFuture); + retryCallable.call(); + return retryingFuture; + } + + @Override + public String toString() { + return String.format("retrying(%s)", this.callable); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingServerStreamingCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingServerStreamingCallable.java new file mode 100644 index 000000000000..504cf4f2b7fc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingServerStreamingCallable.java @@ -0,0 +1,99 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import static com.google.common.util.concurrent.MoreExecutors.directExecutor; + +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.ScheduledRetryingExecutor; +import com.google.api.gax.retrying.ServerStreamingAttemptException; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; + +// TODO: remove this once ApiResultRetryAlgorithm is added to gax. +/** + * A ServerStreamingCallable that implements resumable retries. + * + *

    Wraps a request, a {@link ResponseObserver} and an inner {@link ServerStreamingCallable} and + * coordinates retries between them. When the inner callable throws an error, this class will + * schedule retries using the configured {@link ScheduledRetryingExecutor}. + * + *

    Streams can be resumed using a {@link StreamResumptionStrategy}. The {@link + * StreamResumptionStrategy} is notified of incoming responses and is expected to track the progress + * of the stream. Upon receiving an error, the {@link StreamResumptionStrategy} is asked to modify + * the original request to resume the stream. + */ +@InternalApi +public final class RetryingServerStreamingCallable + extends ServerStreamingCallable { + + private final ServerStreamingCallable innerCallable; + private final ScheduledRetryingExecutor executor; + private final StreamResumptionStrategy resumptionStrategyPrototype; + + public RetryingServerStreamingCallable( + ServerStreamingCallable innerCallable, + ScheduledRetryingExecutor executor, + StreamResumptionStrategy resumptionStrategyPrototype) { + this.innerCallable = innerCallable; + this.executor = executor; + this.resumptionStrategyPrototype = resumptionStrategyPrototype; + } + + @Override + public void call( + RequestT request, + final ResponseObserver responseObserver, + ApiCallContext context) { + + ServerStreamingAttemptCallable attemptCallable = + new ServerStreamingAttemptCallable<>( + innerCallable, + resumptionStrategyPrototype.createNew(), + request, + context, + responseObserver); + + RetryingFuture retryingFuture = executor.createFuture(attemptCallable, context); + attemptCallable.setExternalFuture(retryingFuture); + attemptCallable.start(); + + // Bridge the future result back to the external responseObserver + ApiFutures.addCallback( + retryingFuture, + new ApiFutureCallback() { + @Override + public void onFailure(Throwable throwable) { + // Make sure to unwrap the underlying ApiException + if (throwable instanceof ServerStreamingAttemptException) { + throwable = throwable.getCause(); + } + responseObserver.onError(throwable); + } + + @Override + public void onSuccess(Void ignored) { + responseObserver.onComplete(); + } + }, + directExecutor()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java new file mode 100644 index 000000000000..7f5c39ec0a6e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java @@ -0,0 +1,370 @@ +/* + * Copyright 2023 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.cloud.bigtable.gaxx.retrying; + +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.ServerStreamingAttemptException; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StateCheckingResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.data.v2.stub.BigtableStreamResumptionStrategy; +import com.google.common.base.Preconditions; +import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; + +// TODO: remove this once ApiResultRetryAlgorithm is added to gax. +/** + * A callable that generates Server Streaming attempts. At any one time, it is responsible for at + * most a single outstanding attempt. During an attempt, it proxies all incoming message to the + * outer {@link ResponseObserver} and the {@link StreamResumptionStrategy}. Once the attempt + * completes, the external {@link RetryingFuture} future is notified. If the {@link RetryingFuture} + * decides to retry the attempt, it will invoke {@link #call()}. + * + *

    The lifecycle of this class is: + * + *

      + *
    1. The caller instantiates this class. + *
    2. The caller sets the {@link RetryingFuture} via {@link #setExternalFuture(RetryingFuture)}. + * The {@link RetryingFuture} will be responsible for scheduling future attempts. + *
    3. The caller calls {@link #start()}. This notifies the outer {@link ResponseObserver} that + * call is about to start. + *
    4. The outer {@link ResponseObserver} configures inbound flow control via the {@link + * StreamController} that it received in {@link ResponseObserver#onStart(StreamController)}. + *
    5. The attempt call is sent via the inner/upstream {@link ServerStreamingCallable}. + *
    6. A future representing the end state of the inner attempt is passed to the outer {@link + * RetryingFuture}. + *
    7. All messages received from the inner {@link ServerStreamingCallable} are recorded by the + * {@link StreamResumptionStrategy}. + *
    8. All messages received from the inner {@link ServerStreamingCallable} are forwarded to the + * outer {@link ResponseObserver}. + *
    9. Upon attempt completion (either success or failure) are communicated to the outer {@link + * RetryingFuture}. + *
    10. If the {@link RetryingFuture} decides to resume the RPC, it will invoke {@link #call()}, + * which will consult the {@link StreamResumptionStrategy} for the resuming request and + * restart the process at step 5. + *
    11. Once the {@link RetryingFuture} decides to stop the retry loop, it will notify the outer + * {@link ResponseObserver}. + *
    + * + *

    This class is meant to be used as middleware between an outer {@link ResponseObserver} and an + * inner {@link ServerStreamingCallable}. As such it follows the general threading model of {@link + * ServerStreamingCallable}s: + * + *

      + *
    • {@code onStart} must be called in the same thread that invoked {@code call()} + *
    • The outer {@link ResponseObserver} can call {@code request()} and {@code cancel()} on this + * class' {@link StreamController} from any thread + *
    • The inner callable will serialize calls to {@code onResponse()}, {@code onError()} and + * {@code onComplete} + *
    + * + *

    With this model in mind, this class only needs to synchronize access data that is shared + * between: the outer {@link ResponseObserver} (via this class' {@link StreamController}) and the + * inner {@link ServerStreamingCallable}: pendingRequests, cancellationCause and the current + * innerController. + * + * @param request type + * @param response type + */ +@InternalApi +public final class ServerStreamingAttemptCallable implements Callable { + private final Object lock = new Object(); + + private final ServerStreamingCallable innerCallable; + private final StreamResumptionStrategy resumptionStrategy; + private final RequestT initialRequest; + private ApiCallContext context; + private final ResponseObserver outerObserver; + + // Start state + private boolean autoFlowControl = true; + private boolean isStarted; + + // Outer state + private Throwable cancellationCause; + + private int pendingRequests; + + private RetryingFuture outerRetryingFuture; + + // Internal retry state + private int numAttempts; + + private StreamController innerController; + + private boolean seenSuccessSinceLastError; + private SettableApiFuture innerAttemptFuture; + + public ServerStreamingAttemptCallable( + ServerStreamingCallable innerCallable, + StreamResumptionStrategy resumptionStrategy, + RequestT initialRequest, + ApiCallContext context, + ResponseObserver outerObserver) { + this.innerCallable = innerCallable; + this.resumptionStrategy = resumptionStrategy; + this.initialRequest = initialRequest; + this.context = context; + this.outerObserver = outerObserver; + } + + /** Sets controlling {@link RetryingFuture}. Must be called be before {@link #start()}. */ + void setExternalFuture(RetryingFuture retryingFuture) { + Preconditions.checkState(!isStarted, "Can't change the RetryingFuture once the call has start"); + Preconditions.checkNotNull(retryingFuture, "RetryingFuture can't be null"); + + this.outerRetryingFuture = retryingFuture; + } + + /** + * Starts the initial call. The call is attempted on the caller's thread. Further call attempts + * will be scheduled by the {@link RetryingFuture}. + */ + public void start() { + Preconditions.checkState(!isStarted, "Already started"); + + // Initialize the outer observer + outerObserver.onStart( + new StreamController() { + @Override + public void disableAutoInboundFlowControl() { + Preconditions.checkState( + !isStarted, "Can't disable auto flow control once the stream is started"); + autoFlowControl = false; + } + + @Override + public void request(int count) { + onRequest(count); + } + + @Override + public void cancel() { + onCancel(); + } + }); + + if (autoFlowControl) { + synchronized (lock) { + pendingRequests = Integer.MAX_VALUE; + } + } + isStarted = true; + + // Call the inner callable + call(); + } + + /** + * Sends the actual RPC. The request being sent will first be transformed by the {@link + * StreamResumptionStrategy}. + * + *

    This method expects to be called by one thread at a time. Furthermore, it expects that the + * current RPC finished before the next time it's called. + */ + @Override + public Void call() { + Preconditions.checkState(isStarted, "Must be started first"); + + RequestT request = + (++numAttempts == 1) ? initialRequest : resumptionStrategy.getResumeRequest(initialRequest); + + // Should never happen. onAttemptError will check if ResumptionStrategy can create a resume + // request, + // which the RetryingFuture/StreamResumptionStrategy should respect. + Preconditions.checkState(request != null, "ResumptionStrategy returned a null request."); + + innerAttemptFuture = SettableApiFuture.create(); + seenSuccessSinceLastError = false; + + ApiCallContext attemptContext = context; + + if (!outerRetryingFuture.getAttemptSettings().getRpcTimeout().isZero() + && attemptContext.getTimeout() == null) { + attemptContext = + attemptContext.withTimeout(outerRetryingFuture.getAttemptSettings().getRpcTimeout()); + } + + attemptContext + .getTracer() + .attemptStarted(request, outerRetryingFuture.getAttemptSettings().getOverallAttemptCount()); + + innerCallable.call( + request, + new StateCheckingResponseObserver() { + @Override + public void onStartImpl(StreamController controller) { + onAttemptStart(controller); + } + + @Override + public void onResponseImpl(ResponseT response) { + onAttemptResponse(response); + } + + @Override + public void onErrorImpl(Throwable t) { + onAttemptError(t); + } + + @Override + public void onCompleteImpl() { + onAttemptComplete(); + } + }, + attemptContext); + + outerRetryingFuture.setAttemptFuture(innerAttemptFuture); + + return null; + } + + /** + * Called by the inner {@link ServerStreamingCallable} when the call is about to start. This will + * transfer unfinished state from the previous attempt. + * + * @see ResponseObserver#onStart(StreamController) + */ + private void onAttemptStart(StreamController controller) { + if (!autoFlowControl) { + controller.disableAutoInboundFlowControl(); + } + + Throwable localCancellationCause; + int numToRequest = 0; + + synchronized (lock) { + innerController = controller; + + localCancellationCause = this.cancellationCause; + + if (!autoFlowControl) { + numToRequest = pendingRequests; + } + } + + if (localCancellationCause != null) { + controller.cancel(); + } else if (numToRequest > 0) { + controller.request(numToRequest); + } + } + + /** + * Called when the outer {@link ResponseObserver} wants to prematurely cancel the stream. + * + * @see StreamController#cancel() + */ + private void onCancel() { + StreamController localInnerController; + + synchronized (lock) { + if (cancellationCause != null) { + return; + } + // NOTE: BasicRetryingFuture will replace j.u.c.CancellationExceptions with it's own, + // which will not have the current stacktrace, so a special wrapper has be used here. + cancellationCause = + new ServerStreamingAttemptException( + new CancellationException("User cancelled stream"), + resumptionStrategy.canResume(), + seenSuccessSinceLastError); + localInnerController = innerController; + } + + if (localInnerController != null) { + localInnerController.cancel(); + } + } + + /** + * Called when the outer {@link ResponseObserver} is ready for more data. + * + * @see StreamController#request(int) + */ + private void onRequest(int count) { + Preconditions.checkState(!autoFlowControl, "Automatic flow control is enabled"); + Preconditions.checkArgument(count > 0, "Count must be > 0"); + + final StreamController localInnerController; + + synchronized (lock) { + int maxInc = Integer.MAX_VALUE - pendingRequests; + count = Math.min(maxInc, count); + + pendingRequests += count; + localInnerController = this.innerController; + } + + // Note: there is a race condition here where the count might go to the previous attempt's + // StreamController after it failed. But it doesn't matter, because the controller will just + // ignore it and the current controller will pick it up onStart. + if (localInnerController != null) { + localInnerController.request(count); + } + } + + /** Called when the inner callable has responses to deliver. */ + private void onAttemptResponse(ResponseT message) { + if (!autoFlowControl) { + synchronized (lock) { + pendingRequests--; + } + } + // Update local state to allow for future resume. + seenSuccessSinceLastError = true; + message = resumptionStrategy.processResponse(message); + // Notify the outer observer. + outerObserver.onResponse(message); + } + + /** + * Called when the current RPC fails. The error will be bubbled up to the outer {@link + * RetryingFuture} via the {@link #innerAttemptFuture}. + */ + private void onAttemptError(Throwable throwable) { + Throwable localCancellationCause; + synchronized (lock) { + localCancellationCause = cancellationCause; + } + if (resumptionStrategy instanceof BigtableStreamResumptionStrategy) { + throwable = ((BigtableStreamResumptionStrategy) resumptionStrategy).processError(throwable); + } + + if (localCancellationCause != null) { + // Take special care to preserve the cancellation's stack trace. + innerAttemptFuture.setException(localCancellationCause); + } else { + // Wrap the original exception and provide more context for StreamingRetryAlgorithm. + innerAttemptFuture.setException( + new ServerStreamingAttemptException( + throwable, resumptionStrategy.canResume(), seenSuccessSinceLastError)); + } + } + + /** + * Called when the current RPC successfully completes. Notifies the outer {@link RetryingFuture} + * via {@link #innerAttemptFuture}. + */ + private void onAttemptComplete() { + innerAttemptFuture.set(null); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json b/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json new file mode 100644 index 000000000000..a2699060d164 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json @@ -0,0 +1,4970 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FlowControlLimitExceededBehaviorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$DataBoostIsolationReadOnly", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$DataBoostIsolationReadOnly$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$DataBoostIsolationReadOnly$ComputeBillingOwner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$MultiClusterRoutingUseAny", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$MultiClusterRoutingUseAny$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$MultiClusterRoutingUseAny$RowAffinity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$MultiClusterRoutingUseAny$RowAffinity$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$Priority", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$SingleClusterRouting", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$SingleClusterRouting$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$StandardIsolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AppProfile$StandardIsolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$FamilySubsets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$FamilySubsets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$ResponseView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$SubsetView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AuthorizedView$SubsetView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AutoscalingLimits", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AutoscalingLimits$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AutoscalingTargets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.AutoscalingTargets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Backup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Backup$BackupType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Backup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Backup$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.BackupInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.BackupInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ChangeStreamConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ChangeStreamConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CheckConsistencyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CheckConsistencyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CheckConsistencyResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CheckConsistencyResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$ClusterAutoscalingConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$ClusterAutoscalingConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$ClusterConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$ClusterConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$EncryptionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$EncryptionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$NodeScalingFactor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Cluster$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ColumnFamily", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ColumnFamily$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CopyBackupMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CopyBackupMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CopyBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CopyBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAppProfileRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAppProfileRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateAuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateBackupMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateBackupMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterMetadata$TableProgress", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterMetadata$TableProgress$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterMetadata$TableProgress$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateInstanceMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateInstanceMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateLogicalViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateLogicalViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateLogicalViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateLogicalViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateMaterializedViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateMaterializedViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateMaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateMaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateSchemaBundleMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateSchemaBundleMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateSchemaBundleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateSchemaBundleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableRequest$Split", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.CreateTableRequest$Split$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DataBoostReadLocalWrites", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DataBoostReadLocalWrites$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteAppProfileRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteAppProfileRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteLogicalViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteLogicalViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteMaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteMaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteSchemaBundleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteSchemaBundleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DeleteTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DropRowRangeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.DropRowRangeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.EncryptionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.EncryptionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.EncryptionInfo$EncryptionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule$Intersection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule$Intersection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule$Union", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GcRule$Union$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetAppProfileRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetAppProfileRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetAuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetAuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetLogicalViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetLogicalViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetMaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetMaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetSchemaBundleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetSchemaBundleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.GetTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.HotTablet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.HotTablet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Instance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Instance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Instance$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Instance$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Instance$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAppProfilesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAppProfilesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAppProfilesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAppProfilesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAuthorizedViewsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAuthorizedViewsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAuthorizedViewsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListAuthorizedViewsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListBackupsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListBackupsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListBackupsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListBackupsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListClustersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListClustersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListClustersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListClustersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListHotTabletsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListHotTabletsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListHotTabletsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListHotTabletsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListInstancesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListInstancesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListInstancesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListInstancesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListLogicalViewsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListLogicalViewsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListLogicalViewsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListLogicalViewsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListMaterializedViewsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListMaterializedViewsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListMaterializedViewsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListMaterializedViewsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSchemaBundlesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSchemaBundlesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSchemaBundlesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSchemaBundlesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSnapshotsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSnapshotsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSnapshotsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListSnapshotsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListTablesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListTablesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListTablesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ListTablesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.LogicalView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.LogicalView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.MaterializedView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.MaterializedView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest$Modification", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest$Modification$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.OperationProgress", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.OperationProgress$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateClusterMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateClusterMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.PartialUpdateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ProtoSchema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.ProtoSchema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreSourceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreTableMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreTableMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.RestoreTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SchemaBundle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SchemaBundle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Snapshot", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Snapshot$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Snapshot$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SnapshotTableMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SnapshotTableMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SnapshotTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.SnapshotTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.StandardReadRemoteWrites", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.StandardReadRemoteWrites$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.StorageType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$ClusterState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$ClusterState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$ClusterState$ReplicationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$TimestampGranularity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Table$View", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.TieredStorageConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.TieredStorageConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.TieredStorageRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.TieredStorageRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Max", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Max$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Min", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Min$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Sum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Aggregate$Sum$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Array", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Array$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bool", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bool$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes$Encoding$Raw", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Bytes$Encoding$Raw$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Enum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Enum$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Float32", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Float32$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Float64", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Float64$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding$BigEndianBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding$BigEndianBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding$OrderedCodeBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Int64$Encoding$OrderedCodeBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Map", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Map$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Proto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Proto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Bytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Bytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Raw", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Raw$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$DelimitedBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$DelimitedBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$OrderedCodeBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$OrderedCodeBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$Singleton", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Encoding$Singleton$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Field", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Struct$Field$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Timestamp$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.Type$Timestamp$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UndeleteTableMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UndeleteTableMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UndeleteTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UndeleteTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAppProfileMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAppProfileMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAppProfileRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAppProfileRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateBackupRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateBackupRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateClusterMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateClusterMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateInstanceMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateInstanceMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateLogicalViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateLogicalViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateLogicalViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateLogicalViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateMaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateMaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateSchemaBundleRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateSchemaBundleRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateTableMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateTableMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.admin.v2.UpdateTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json b/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json new file mode 100644 index 000000000000..21a24bbacaff --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json @@ -0,0 +1,4646 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FlowControlLimitExceededBehaviorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ArrayValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ArrayValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.AuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.AuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.AuthorizedViewResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.AuthorizedViewResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.BackendIdentifier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.BackendIdentifier$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Cell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Cell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClientConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClientConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClientConfiguration$PollingConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClientConfiguration$PollingConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CloseSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CloseSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CloseSessionRequest$CloseSessionReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClusterInformation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ClusterInformation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ErrorResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ErrorResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ExecuteQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ExecuteQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ExecuteQueryResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ExecuteQueryResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Family", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Family$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FeatureFlags", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FeatureFlags$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FullReadStatsView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FullReadStatsView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GetClientConfigurationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GetClientConfigurationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GoAwayResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.GoAwayResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.HeartbeatResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.HeartbeatResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Idempotency", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Idempotency$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$LeastInFlight", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$LeastInFlight$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$PeakEwma", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$PeakEwma$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$Random", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.LoadBalancingOptions$Random$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MaterializedViewResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MaterializedViewResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$AddToCell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$AddToCell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$MergeToCell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$MergeToCell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$SetCell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$SetCell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest$Permission", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenAuthorizedViewResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenAuthorizedViewResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest$Permission", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenMaterializedViewResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenMaterializedViewResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenSessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenSessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenTableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenTableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenTableRequest$Permission", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenTableResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.OpenTableResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PartialResultSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PartialResultSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PeerInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PeerInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PeerInfo$TransportType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PrepareQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PrepareQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PrepareQueryResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PrepareQueryResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoFormat$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoRows", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoRows$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoRowsBatch", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoRowsBatch$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoSchema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ProtoSchema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RateLimitInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RateLimitInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadIterationStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadIterationStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest$RequestStatsView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestLatencyStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestLatencyStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResponseParams", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResponseParams$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResultSetMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResultSetMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Row", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Row$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Chain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Chain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Condition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Condition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Interleave", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Interleave$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$CloudPathOnly", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$CloudPathOnly$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessOnly", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessOnly$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessWithFallback", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessWithFallback$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$SessionPoolConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionClientConfiguration$SessionPoolConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionMutateRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionMutateRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionMutateRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionMutateRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionParametersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionParametersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionReadRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionReadRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionReadRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionReadRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRefreshConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRefreshConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRefreshConfig$Metadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRefreshConfig$Metadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRequestStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionRequestStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SessionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamContinuationToken", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamContinuationToken$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamContinuationTokens", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamContinuationTokens$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamPartition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.StreamPartition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TableRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TableRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TableResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TableResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TelemetryConfiguration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TelemetryConfiguration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TelemetryConfiguration$Level", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TimestampRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TimestampRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Max", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Max$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Min", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Min$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Sum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Aggregate$Sum$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Array", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Array$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bool", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bool$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Enum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Enum$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Float32", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Float32$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Float64", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Float64$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Map", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Map$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Proto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Proto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Field", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Struct$Field$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Timestamp$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Type$Timestamp$Encoding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueBitmask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueBitmask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Metadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Metadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto b/java-bigtable/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto new file mode 100644 index 000000000000..44306311bb97 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto @@ -0,0 +1,49 @@ +# proto-file: google/bigtable/v2/bigtable.proto +# proto-message: google.bigtable.v2.ClientConfiguration + +polling_configuration { + polling_interval { + seconds: 300 + } + validity_duration { + seconds: 315576000000 + } + max_rpc_retry_count: 5 +} + +session_configuration { + session_load: 0 + + channel_configuration { + min_server_count: 2 + max_server_count: 25 + per_server_session_count: 10 + direct_access_with_fallback { + check_interval { + seconds: 60 + } + error_rate_threshold: 0.8 + } + } + + session_pool_configuration { + headroom: 0.5 + min_session_count: 5 + max_session_count: 400 + new_session_creation_budget: 50 + new_session_creation_penalty { + seconds: 60 + } + consecutive_session_failure_threshold: 10 + new_session_queue_length: 10 + load_balancing_options { + least_in_flight { + random_subset_size: 0 + } + } + } +} + +telemetry_configuration { + debug_tag_level: WARN +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java new file mode 100644 index 000000000000..2ee9d4014047 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java @@ -0,0 +1,33 @@ +/* + * 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.cloud.bigtable; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Smoke test to ensure that release tooling doesn't accidentally corrupt the version */ +@RunWith(JUnit4.class) +public class VersionTest { + @Test + public void testVersion() { + assertThat(Version.VERSION).matches("\\d+\\.\\d+\\.\\d(?:-session)?(?:-SNAPSHOT)?"); + + assertThat(Version.VERSION).isGreaterThan("1.22.0"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java new file mode 100644 index 000000000000..843e1a492624 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java @@ -0,0 +1,2720 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.AppProfileName; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.ClusterName; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.HotTablet; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LocationName; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.LogicalViewName; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.MaterializedViewName; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.ProjectName; +import com.google.bigtable.admin.v2.StorageType; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class BaseBigtableInstanceAdminClientTest { + private static MockBigtableInstanceAdmin mockBigtableInstanceAdmin; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private BaseBigtableInstanceAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockBigtableInstanceAdmin = new MockBigtableInstanceAdmin(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockBigtableInstanceAdmin)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + BaseBigtableInstanceAdminSettings settings = + BaseBigtableInstanceAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BaseBigtableInstanceAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + ProjectName parent = ProjectName.of("[PROJECT]"); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Map clusters = new HashMap<>(); + + Instance actualResponse = + client.createInstanceAsync(parent, instanceId, instance, clusters).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(clusters, actualRequest.getClustersMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Map clusters = new HashMap<>(); + client.createInstanceAsync(parent, instanceId, instance, clusters).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Map clusters = new HashMap<>(); + + Instance actualResponse = + client.createInstanceAsync(parent, instanceId, instance, clusters).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = ((CreateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(clusters, actualRequest.getClustersMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Map clusters = new HashMap<>(); + client.createInstanceAsync(parent, instanceId, instance, clusters).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = ((GetInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest() throws Exception { + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .addAllFailedLocations(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListInstancesResponse actualResponse = client.listInstances(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .addAllInstances(new ArrayList()) + .addAllFailedLocations(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInstancesResponse actualResponse = client.listInstances(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = ((ListInstancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + Instance request = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + + Instance actualResponse = client.updateInstance(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + Instance actualRequest = ((Instance) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getDisplayName(), actualRequest.getDisplayName()); + Assert.assertEquals(request.getState(), actualRequest.getState()); + Assert.assertEquals(request.getType(), actualRequest.getType()); + Assert.assertEquals(request.getEdition(), actualRequest.getEdition()); + Assert.assertEquals(request.getLabelsMap(), actualRequest.getLabelsMap()); + Assert.assertEquals(request.getCreateTime(), actualRequest.getCreateTime()); + Assert.assertEquals(request.getSatisfiesPzs(), actualRequest.getSatisfiesPzs()); + Assert.assertEquals(request.getSatisfiesPzi(), actualRequest.getSatisfiesPzi()); + Assert.assertEquals(request.getTagsMap(), actualRequest.getTagsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + Instance request = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + client.updateInstance(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void partialUpdateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) + .putAllTags(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("partialUpdateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.partialUpdateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PartialUpdateInstanceRequest actualRequest = + ((PartialUpdateInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void partialUpdateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.partialUpdateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + client.deleteInstance(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.deleteInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteInstance(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String clusterId = "clusterId561939637"; + Cluster cluster = Cluster.newBuilder().build(); + + Cluster actualResponse = client.createClusterAsync(parent, clusterId, cluster).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String clusterId = "clusterId561939637"; + Cluster cluster = Cluster.newBuilder().build(); + client.createClusterAsync(parent, clusterId, cluster).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String clusterId = "clusterId561939637"; + Cluster cluster = Cluster.newBuilder().build(); + + Cluster actualResponse = client.createClusterAsync(parent, clusterId, cluster).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClusterRequest actualRequest = ((CreateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(clusterId, actualRequest.getClusterId()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String clusterId = "clusterId561939637"; + Cluster cluster = Cluster.newBuilder().build(); + client.createClusterAsync(parent, clusterId, cluster).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClusterTest2() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest() throws Exception { + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .addAllClusters(new ArrayList()) + .addAllFailedLocations(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListClustersResponse actualResponse = client.listClusters(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClustersTest2() throws Exception { + ListClustersResponse expectedResponse = + ListClustersResponse.newBuilder() + .addAllClusters(new ArrayList()) + .addAllFailedLocations(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClustersResponse actualResponse = client.listClusters(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClustersRequest actualRequest = ((ListClustersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClustersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClusters(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + Cluster request = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + + Cluster actualResponse = client.updateClusterAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + Cluster actualRequest = ((Cluster) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getLocation(), actualRequest.getLocation()); + Assert.assertEquals(request.getState(), actualRequest.getState()); + Assert.assertEquals(request.getServeNodes(), actualRequest.getServeNodes()); + Assert.assertEquals(request.getNodeScalingFactor(), actualRequest.getNodeScalingFactor()); + Assert.assertEquals(request.getClusterConfig(), actualRequest.getClusterConfig()); + Assert.assertEquals(request.getDefaultStorageType(), actualRequest.getDefaultStorageType()); + Assert.assertEquals(request.getEncryptionConfig(), actualRequest.getEncryptionConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + Cluster request = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + client.updateClusterAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void partialUpdateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("partialUpdateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Cluster actualResponse = client.partialUpdateClusterAsync(cluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PartialUpdateClusterRequest actualRequest = + ((PartialUpdateClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void partialUpdateClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.partialUpdateClusterAsync(cluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + + client.deleteCluster(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + client.deleteCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteClusterTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteCluster(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClusterExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAppProfileTest() throws Exception { + AppProfile expectedResponse = + AppProfile.newBuilder() + .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()) + .setEtag("etag3123477") + .setDescription("description-1724546052") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String appProfileId = "appProfileId704923523"; + AppProfile appProfile = AppProfile.newBuilder().build(); + + AppProfile actualResponse = client.createAppProfile(parent, appProfileId, appProfile); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppProfileRequest actualRequest = ((CreateAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(appProfileId, actualRequest.getAppProfileId()); + Assert.assertEquals(appProfile, actualRequest.getAppProfile()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppProfileExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String appProfileId = "appProfileId704923523"; + AppProfile appProfile = AppProfile.newBuilder().build(); + client.createAppProfile(parent, appProfileId, appProfile); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAppProfileTest2() throws Exception { + AppProfile expectedResponse = + AppProfile.newBuilder() + .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()) + .setEtag("etag3123477") + .setDescription("description-1724546052") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String appProfileId = "appProfileId704923523"; + AppProfile appProfile = AppProfile.newBuilder().build(); + + AppProfile actualResponse = client.createAppProfile(parent, appProfileId, appProfile); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppProfileRequest actualRequest = ((CreateAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(appProfileId, actualRequest.getAppProfileId()); + Assert.assertEquals(appProfile, actualRequest.getAppProfile()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppProfileExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String appProfileId = "appProfileId704923523"; + AppProfile appProfile = AppProfile.newBuilder().build(); + client.createAppProfile(parent, appProfileId, appProfile); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppProfileTest() throws Exception { + AppProfile expectedResponse = + AppProfile.newBuilder() + .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()) + .setEtag("etag3123477") + .setDescription("description-1724546052") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + + AppProfile actualResponse = client.getAppProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppProfileRequest actualRequest = ((GetAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppProfileExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + client.getAppProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppProfileTest2() throws Exception { + AppProfile expectedResponse = + AppProfile.newBuilder() + .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()) + .setEtag("etag3123477") + .setDescription("description-1724546052") + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + AppProfile actualResponse = client.getAppProfile(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppProfileRequest actualRequest = ((GetAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppProfileExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getAppProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAppProfilesTest() throws Exception { + AppProfile responsesElement = AppProfile.newBuilder().build(); + ListAppProfilesResponse expectedResponse = + ListAppProfilesResponse.newBuilder() + .setNextPageToken("") + .addAllAppProfiles(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListAppProfilesPagedResponse pagedListResponse = client.listAppProfiles(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppProfilesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppProfilesRequest actualRequest = ((ListAppProfilesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppProfilesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.listAppProfiles(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAppProfilesTest2() throws Exception { + AppProfile responsesElement = AppProfile.newBuilder().build(); + ListAppProfilesResponse expectedResponse = + ListAppProfilesResponse.newBuilder() + .setNextPageToken("") + .addAllAppProfiles(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAppProfilesPagedResponse pagedListResponse = client.listAppProfiles(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppProfilesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppProfilesRequest actualRequest = ((ListAppProfilesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppProfilesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAppProfiles(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAppProfileTest() throws Exception { + AppProfile expectedResponse = + AppProfile.newBuilder() + .setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()) + .setEtag("etag3123477") + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAppProfileTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + AppProfile appProfile = AppProfile.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AppProfile actualResponse = client.updateAppProfileAsync(appProfile, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAppProfileRequest actualRequest = ((UpdateAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(appProfile, actualRequest.getAppProfile()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAppProfileExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + AppProfile appProfile = AppProfile.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAppProfileAsync(appProfile, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteAppProfileTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + + client.deleteAppProfile(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppProfileExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + client.deleteAppProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAppProfileTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteAppProfile(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppProfileExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteAppProfile(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAppProfileTest3() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + boolean ignoreWarnings = true; + + client.deleteAppProfile(name, ignoreWarnings); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(ignoreWarnings, actualRequest.getIgnoreWarnings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppProfileExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + boolean ignoreWarnings = true; + client.deleteAppProfile(name, ignoreWarnings); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAppProfileTest4() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + boolean ignoreWarnings = true; + + client.deleteAppProfile(name, ignoreWarnings); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(ignoreWarnings, actualRequest.getIgnoreWarnings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppProfileExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + boolean ignoreWarnings = true; + client.deleteAppProfile(name, ignoreWarnings); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHotTabletsTest() throws Exception { + HotTablet responsesElement = HotTablet.newBuilder().build(); + ListHotTabletsResponse expectedResponse = + ListHotTabletsResponse.newBuilder() + .setNextPageToken("") + .addAllHotTablets(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + + ListHotTabletsPagedResponse pagedListResponse = client.listHotTablets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHotTabletsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHotTabletsRequest actualRequest = ((ListHotTabletsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHotTabletsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + client.listHotTablets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHotTabletsTest2() throws Exception { + HotTablet responsesElement = HotTablet.newBuilder().build(); + ListHotTabletsResponse expectedResponse = + ListHotTabletsResponse.newBuilder() + .setNextPageToken("") + .addAllHotTablets(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListHotTabletsPagedResponse pagedListResponse = client.listHotTablets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHotTabletsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHotTabletsRequest actualRequest = ((ListHotTabletsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHotTabletsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listHotTablets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createLogicalViewTest() throws Exception { + LogicalView expectedResponse = + LogicalView.newBuilder() + .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLogicalViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + LogicalView logicalView = LogicalView.newBuilder().build(); + String logicalViewId = "logicalViewId-1408054263"; + + LogicalView actualResponse = + client.createLogicalViewAsync(parent, logicalView, logicalViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLogicalViewRequest actualRequest = ((CreateLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(logicalView, actualRequest.getLogicalView()); + Assert.assertEquals(logicalViewId, actualRequest.getLogicalViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLogicalViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + LogicalView logicalView = LogicalView.newBuilder().build(); + String logicalViewId = "logicalViewId-1408054263"; + client.createLogicalViewAsync(parent, logicalView, logicalViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createLogicalViewTest2() throws Exception { + LogicalView expectedResponse = + LogicalView.newBuilder() + .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLogicalViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + LogicalView logicalView = LogicalView.newBuilder().build(); + String logicalViewId = "logicalViewId-1408054263"; + + LogicalView actualResponse = + client.createLogicalViewAsync(parent, logicalView, logicalViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLogicalViewRequest actualRequest = ((CreateLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(logicalView, actualRequest.getLogicalView()); + Assert.assertEquals(logicalViewId, actualRequest.getLogicalViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLogicalViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + LogicalView logicalView = LogicalView.newBuilder().build(); + String logicalViewId = "logicalViewId-1408054263"; + client.createLogicalViewAsync(parent, logicalView, logicalViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getLogicalViewTest() throws Exception { + LogicalView expectedResponse = + LogicalView.newBuilder() + .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]"); + + LogicalView actualResponse = client.getLogicalView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLogicalViewRequest actualRequest = ((GetLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLogicalViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]"); + client.getLogicalView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLogicalViewTest2() throws Exception { + LogicalView expectedResponse = + LogicalView.newBuilder() + .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + LogicalView actualResponse = client.getLogicalView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLogicalViewRequest actualRequest = ((GetLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLogicalViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getLogicalView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogicalViewsTest() throws Exception { + LogicalView responsesElement = LogicalView.newBuilder().build(); + ListLogicalViewsResponse expectedResponse = + ListLogicalViewsResponse.newBuilder() + .setNextPageToken("") + .addAllLogicalViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListLogicalViewsPagedResponse pagedListResponse = client.listLogicalViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogicalViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogicalViewsRequest actualRequest = ((ListLogicalViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogicalViewsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.listLogicalViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogicalViewsTest2() throws Exception { + LogicalView responsesElement = LogicalView.newBuilder().build(); + ListLogicalViewsResponse expectedResponse = + ListLogicalViewsResponse.newBuilder() + .setNextPageToken("") + .addAllLogicalViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLogicalViewsPagedResponse pagedListResponse = client.listLogicalViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogicalViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogicalViewsRequest actualRequest = ((ListLogicalViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogicalViewsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLogicalViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLogicalViewTest() throws Exception { + LogicalView expectedResponse = + LogicalView.newBuilder() + .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateLogicalViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + LogicalView logicalView = LogicalView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogicalView actualResponse = client.updateLogicalViewAsync(logicalView, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateLogicalViewRequest actualRequest = ((UpdateLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(logicalView, actualRequest.getLogicalView()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateLogicalViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + LogicalView logicalView = LogicalView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateLogicalViewAsync(logicalView, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteLogicalViewTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]"); + + client.deleteLogicalView(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogicalViewRequest actualRequest = ((DeleteLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogicalViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]"); + client.deleteLogicalView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLogicalViewTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteLogicalView(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogicalViewRequest actualRequest = ((DeleteLogicalViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogicalViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteLogicalView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMaterializedViewTest() throws Exception { + MaterializedView expectedResponse = + MaterializedView.newBuilder() + .setName( + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]") + .toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMaterializedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + MaterializedView materializedView = MaterializedView.newBuilder().build(); + String materializedViewId = "materializedViewId682270903"; + + MaterializedView actualResponse = + client.createMaterializedViewAsync(parent, materializedView, materializedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMaterializedViewRequest actualRequest = + ((CreateMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(materializedView, actualRequest.getMaterializedView()); + Assert.assertEquals(materializedViewId, actualRequest.getMaterializedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMaterializedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + MaterializedView materializedView = MaterializedView.newBuilder().build(); + String materializedViewId = "materializedViewId682270903"; + client.createMaterializedViewAsync(parent, materializedView, materializedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createMaterializedViewTest2() throws Exception { + MaterializedView expectedResponse = + MaterializedView.newBuilder() + .setName( + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]") + .toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMaterializedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + MaterializedView materializedView = MaterializedView.newBuilder().build(); + String materializedViewId = "materializedViewId682270903"; + + MaterializedView actualResponse = + client.createMaterializedViewAsync(parent, materializedView, materializedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMaterializedViewRequest actualRequest = + ((CreateMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(materializedView, actualRequest.getMaterializedView()); + Assert.assertEquals(materializedViewId, actualRequest.getMaterializedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMaterializedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + MaterializedView materializedView = MaterializedView.newBuilder().build(); + String materializedViewId = "materializedViewId682270903"; + client.createMaterializedViewAsync(parent, materializedView, materializedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getMaterializedViewTest() throws Exception { + MaterializedView expectedResponse = + MaterializedView.newBuilder() + .setName( + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]") + .toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + MaterializedViewName name = + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]"); + + MaterializedView actualResponse = client.getMaterializedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMaterializedViewRequest actualRequest = ((GetMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMaterializedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + MaterializedViewName name = + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]"); + client.getMaterializedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMaterializedViewTest2() throws Exception { + MaterializedView expectedResponse = + MaterializedView.newBuilder() + .setName( + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]") + .toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + MaterializedView actualResponse = client.getMaterializedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMaterializedViewRequest actualRequest = ((GetMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMaterializedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getMaterializedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMaterializedViewsTest() throws Exception { + MaterializedView responsesElement = MaterializedView.newBuilder().build(); + ListMaterializedViewsResponse expectedResponse = + ListMaterializedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllMaterializedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListMaterializedViewsPagedResponse pagedListResponse = client.listMaterializedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaterializedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMaterializedViewsRequest actualRequest = + ((ListMaterializedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMaterializedViewsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.listMaterializedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMaterializedViewsTest2() throws Exception { + MaterializedView responsesElement = MaterializedView.newBuilder().build(); + ListMaterializedViewsResponse expectedResponse = + ListMaterializedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllMaterializedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListMaterializedViewsPagedResponse pagedListResponse = client.listMaterializedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaterializedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMaterializedViewsRequest actualRequest = + ((ListMaterializedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMaterializedViewsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listMaterializedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateMaterializedViewTest() throws Exception { + MaterializedView expectedResponse = + MaterializedView.newBuilder() + .setName( + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]") + .toString()) + .setQuery("query107944136") + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMaterializedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableInstanceAdmin.addResponse(resultOperation); + + MaterializedView materializedView = MaterializedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + MaterializedView actualResponse = + client.updateMaterializedViewAsync(materializedView, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateMaterializedViewRequest actualRequest = + ((UpdateMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(materializedView, actualRequest.getMaterializedView()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateMaterializedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + MaterializedView materializedView = MaterializedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMaterializedViewAsync(materializedView, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteMaterializedViewTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + MaterializedViewName name = + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]"); + + client.deleteMaterializedView(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMaterializedViewRequest actualRequest = + ((DeleteMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMaterializedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + MaterializedViewName name = + MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]"); + client.deleteMaterializedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteMaterializedViewTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableInstanceAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteMaterializedView(name); + + List actualRequests = mockBigtableInstanceAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMaterializedViewRequest actualRequest = + ((DeleteMaterializedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMaterializedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableInstanceAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteMaterializedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java new file mode 100644 index 000000000000..9f5a50c41ee5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java @@ -0,0 +1,3519 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSnapshotsPagedResponse; +import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.AuthorizedViewName; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.BackupName; +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.ClusterName; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.EncryptionInfo; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreInfo; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.SchemaBundleName; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotName; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.TableName; +import com.google.bigtable.admin.v2.TieredStorageConfig; +import com.google.bigtable.admin.v2.Type; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class BaseBigtableTableAdminClientTest { + private static MockBigtableTableAdmin mockBigtableTableAdmin; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private BaseBigtableTableAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockBigtableTableAdmin = new MockBigtableTableAdmin(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockBigtableTableAdmin)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + BaseBigtableTableAdminSettings settings = + BaseBigtableTableAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = BaseBigtableTableAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + Table table = Table.newBuilder().build(); + + Table actualResponse = client.createTable(parent, tableId, table); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableRequest actualRequest = ((CreateTableRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(table, actualRequest.getTable()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + Table table = Table.newBuilder().build(); + client.createTable(parent, tableId, table); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTableTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + Table table = Table.newBuilder().build(); + + Table actualResponse = client.createTable(parent, tableId, table); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableRequest actualRequest = ((CreateTableRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(table, actualRequest.getTable()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + Table table = Table.newBuilder().build(); + client.createTable(parent, tableId, table); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTableFromSnapshotTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTableFromSnapshotTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + SnapshotName sourceSnapshot = + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + + Table actualResponse = + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableFromSnapshotRequest actualRequest = + ((CreateTableFromSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(sourceSnapshot.toString(), actualRequest.getSourceSnapshot()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableFromSnapshotExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + SnapshotName sourceSnapshot = + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createTableFromSnapshotTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTableFromSnapshotTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + String sourceSnapshot = "sourceSnapshot-1078634753"; + + Table actualResponse = + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableFromSnapshotRequest actualRequest = + ((CreateTableFromSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(sourceSnapshot, actualRequest.getSourceSnapshot()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableFromSnapshotExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String tableId = "tableId-1552905847"; + String sourceSnapshot = "sourceSnapshot-1078634753"; + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createTableFromSnapshotTest3() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTableFromSnapshotTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + SnapshotName sourceSnapshot = + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + + Table actualResponse = + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableFromSnapshotRequest actualRequest = + ((CreateTableFromSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(sourceSnapshot.toString(), actualRequest.getSourceSnapshot()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableFromSnapshotExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + SnapshotName sourceSnapshot = + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createTableFromSnapshotTest4() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTableFromSnapshotTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + String sourceSnapshot = "sourceSnapshot-1078634753"; + + Table actualResponse = + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTableFromSnapshotRequest actualRequest = + ((CreateTableFromSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(tableId, actualRequest.getTableId()); + Assert.assertEquals(sourceSnapshot, actualRequest.getSourceSnapshot()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTableFromSnapshotExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String tableId = "tableId-1552905847"; + String sourceSnapshot = "sourceSnapshot-1078634753"; + client.createTableFromSnapshotAsync(parent, tableId, sourceSnapshot).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listTablesTest() throws Exception { + Table responsesElement = Table.newBuilder().build(); + ListTablesResponse expectedResponse = + ListTablesResponse.newBuilder() + .setNextPageToken("") + .addAllTables(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + ListTablesPagedResponse pagedListResponse = client.listTables(parent); + + List

resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTablesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTablesRequest actualRequest = ((ListTablesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTablesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.listTables(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTablesTest2() throws Exception { + Table responsesElement = Table.newBuilder().build(); + ListTablesResponse expectedResponse = + ListTablesResponse.newBuilder() + .setNextPageToken("") + .addAllTables(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTablesPagedResponse pagedListResponse = client.listTables(parent); + + List
resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTablesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTablesRequest actualRequest = ((ListTablesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTablesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTables(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + Table actualResponse = client.getTable(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTableRequest actualRequest = ((GetTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.getTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTableTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Table actualResponse = client.getTable(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTableRequest actualRequest = ((GetTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + Table table = Table.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Table actualResponse = client.updateTableAsync(table, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateTableRequest actualRequest = ((UpdateTableRequest) actualRequests.get(0)); + + Assert.assertEquals(table, actualRequest.getTable()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + Table table = Table.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateTableAsync(table, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTableTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + client.deleteTable(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.deleteTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTableTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteTable(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void undeleteTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + Table actualResponse = client.undeleteTableAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.undeleteTableAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteTableTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Table actualResponse = client.undeleteTableAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.undeleteTableAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + + AuthorizedView actualResponse = + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizedViewRequest actualRequest = + ((CreateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(authorizedViewId, actualRequest.getAuthorizedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createAuthorizedViewTest2() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + + AuthorizedView actualResponse = + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizedViewRequest actualRequest = + ((CreateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(authorizedViewId, actualRequest.getAuthorizedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listAuthorizedViewsTest() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + ListAuthorizedViewsPagedResponse pagedListResponse = client.listAuthorizedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizedViewsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.listAuthorizedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAuthorizedViewsTest2() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAuthorizedViewsPagedResponse pagedListResponse = client.listAuthorizedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizedViewsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAuthorizedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + + AuthorizedView actualResponse = client.getAuthorizedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.getAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizedViewTest2() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + AuthorizedView actualResponse = client.getAuthorizedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AuthorizedView actualResponse = + client.updateAuthorizedViewAsync(authorizedView, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAuthorizedViewRequest actualRequest = + ((UpdateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAuthorizedViewAsync(authorizedView, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteAuthorizedViewTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + + client.deleteAuthorizedView(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAuthorizedViewRequest actualRequest = + ((DeleteAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.deleteAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAuthorizedViewTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteAuthorizedView(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAuthorizedViewRequest actualRequest = + ((DeleteAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAuthorizedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void modifyColumnFamiliesTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + List modifications = new ArrayList<>(); + + Table actualResponse = client.modifyColumnFamilies(name, modifications); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ModifyColumnFamiliesRequest actualRequest = + ((ModifyColumnFamiliesRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(modifications, actualRequest.getModificationsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void modifyColumnFamiliesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + List modifications = new ArrayList<>(); + client.modifyColumnFamilies(name, modifications); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void modifyColumnFamiliesTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + List modifications = new ArrayList<>(); + + Table actualResponse = client.modifyColumnFamilies(name, modifications); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ModifyColumnFamiliesRequest actualRequest = + ((ModifyColumnFamiliesRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(modifications, actualRequest.getModificationsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void modifyColumnFamiliesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + List modifications = new ArrayList<>(); + client.modifyColumnFamilies(name, modifications); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void dropRowRangeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + DropRowRangeRequest request = + DropRowRangeRequest.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .build(); + + client.dropRowRange(request); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DropRowRangeRequest actualRequest = ((DropRowRangeRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getRowKeyPrefix(), actualRequest.getRowKeyPrefix()); + Assert.assertEquals( + request.getDeleteAllDataFromTable(), actualRequest.getDeleteAllDataFromTable()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void dropRowRangeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + DropRowRangeRequest request = + DropRowRangeRequest.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .build(); + client.dropRowRange(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateConsistencyTokenTest() throws Exception { + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder() + .setConsistencyToken("consistencyToken-1985152319") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + GenerateConsistencyTokenResponse actualResponse = client.generateConsistencyToken(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateConsistencyTokenRequest actualRequest = + ((GenerateConsistencyTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateConsistencyTokenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.generateConsistencyToken(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateConsistencyTokenTest2() throws Exception { + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder() + .setConsistencyToken("consistencyToken-1985152319") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + GenerateConsistencyTokenResponse actualResponse = client.generateConsistencyToken(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateConsistencyTokenRequest actualRequest = + ((GenerateConsistencyTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateConsistencyTokenExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.generateConsistencyToken(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void checkConsistencyTest() throws Exception { + CheckConsistencyResponse expectedResponse = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String consistencyToken = "consistencyToken-1985152319"; + + CheckConsistencyResponse actualResponse = client.checkConsistency(name, consistencyToken); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CheckConsistencyRequest actualRequest = ((CheckConsistencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(consistencyToken, actualRequest.getConsistencyToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void checkConsistencyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String consistencyToken = "consistencyToken-1985152319"; + client.checkConsistency(name, consistencyToken); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void checkConsistencyTest2() throws Exception { + CheckConsistencyResponse expectedResponse = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + String consistencyToken = "consistencyToken-1985152319"; + + CheckConsistencyResponse actualResponse = client.checkConsistency(name, consistencyToken); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CheckConsistencyRequest actualRequest = ((CheckConsistencyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(consistencyToken, actualRequest.getConsistencyToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void checkConsistencyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + String consistencyToken = "consistencyToken-1985152319"; + client.checkConsistency(name, consistencyToken); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void snapshotTableTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("snapshotTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + + Snapshot actualResponse = + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(cluster.toString(), actualRequest.getCluster()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); + Assert.assertEquals(description, actualRequest.getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void snapshotTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void snapshotTableTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("snapshotTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String cluster = "cluster872092154"; + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + + Snapshot actualResponse = + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); + Assert.assertEquals(description, actualRequest.getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void snapshotTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String cluster = "cluster872092154"; + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void snapshotTableTest3() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("snapshotTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String name = "name3373707"; + ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + + Snapshot actualResponse = + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(cluster.toString(), actualRequest.getCluster()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); + Assert.assertEquals(description, actualRequest.getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void snapshotTableExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + ClusterName cluster = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void snapshotTableTest4() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("snapshotTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String name = "name3373707"; + String cluster = "cluster872092154"; + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + + Snapshot actualResponse = + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(cluster, actualRequest.getCluster()); + Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); + Assert.assertEquals(description, actualRequest.getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void snapshotTableExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + String cluster = "cluster872092154"; + String snapshotId = "snapshotId-1113817601"; + String description = "description-1724546052"; + client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getSnapshotTest() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + + Snapshot actualResponse = client.getSnapshot(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSnapshotExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + client.getSnapshot(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSnapshotTest2() throws Exception { + Snapshot expectedResponse = + Snapshot.newBuilder() + .setName( + SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString()) + .setSourceTable(Table.newBuilder().build()) + .setDataSizeBytes(-2110122398) + .setCreateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Snapshot actualResponse = client.getSnapshot(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSnapshotExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getSnapshot(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSnapshotsTest() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() + .setNextPageToken("") + .addAllSnapshots(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSnapshotsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + client.listSnapshots(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSnapshotsTest2() throws Exception { + Snapshot responsesElement = Snapshot.newBuilder().build(); + ListSnapshotsResponse expectedResponse = + ListSnapshotsResponse.newBuilder() + .setNextPageToken("") + .addAllSnapshots(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSnapshotsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSnapshots(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSnapshotTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + + client.deleteSnapshot(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSnapshotExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + client.deleteSnapshot(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSnapshotTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSnapshot(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSnapshotExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteSnapshot(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + Backup backup = Backup.newBuilder().build(); + + Backup actualResponse = client.createBackupAsync(parent, backupId, backup).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + Backup backup = Backup.newBuilder().build(); + client.createBackupAsync(parent, backupId, backup).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + Backup backup = Backup.newBuilder().build(); + + Backup actualResponse = client.createBackupAsync(parent, backupId, backup).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + Backup backup = Backup.newBuilder().build(); + client.createBackupAsync(parent, backupId, backup).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + Backup actualResponse = client.getBackup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Backup actualResponse = client.updateBackup(backup, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + + client.deleteBackup(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBackup(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteBackup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() + .setNextPageToken("") + .addAllBackups(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBackupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBackups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void restoreTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .setTieredStorageConfig(TieredStorageConfig.newBuilder().build()) + .setRowKeySchema(Type.Struct.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("restoreTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + RestoreTableRequest request = + RestoreTableRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setTableId("tableId-1552905847") + .build(); + + Table actualResponse = client.restoreTableAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestoreTableRequest actualRequest = ((RestoreTableRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getTableId(), actualRequest.getTableId()); + Assert.assertEquals(request.getBackup(), actualRequest.getBackup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restoreTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + RestoreTableRequest request = + RestoreTableRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setTableId("tableId-1552905847") + .build(); + client.restoreTableAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup.toString(), actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup, actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest3() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup.toString(), actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest4() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup, actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSchemaBundleTest() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaBundleTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + + SchemaBundle actualResponse = + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSchemaBundleRequest actualRequest = ((CreateSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(schemaBundleId, actualRequest.getSchemaBundleId()); + Assert.assertEquals(schemaBundle, actualRequest.getSchemaBundle()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSchemaBundleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSchemaBundleTest2() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaBundleTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + + SchemaBundle actualResponse = + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSchemaBundleRequest actualRequest = ((CreateSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(schemaBundleId, actualRequest.getSchemaBundleId()); + Assert.assertEquals(schemaBundle, actualRequest.getSchemaBundle()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSchemaBundleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateSchemaBundleTest() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSchemaBundleTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + SchemaBundle actualResponse = client.updateSchemaBundleAsync(schemaBundle, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSchemaBundleRequest actualRequest = ((UpdateSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(schemaBundle, actualRequest.getSchemaBundle()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSchemaBundleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSchemaBundleAsync(schemaBundle, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getSchemaBundleTest() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + + SchemaBundle actualResponse = client.getSchemaBundle(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSchemaBundleRequest actualRequest = ((GetSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSchemaBundleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + client.getSchemaBundle(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSchemaBundleTest2() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + SchemaBundle actualResponse = client.getSchemaBundle(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSchemaBundleRequest actualRequest = ((GetSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSchemaBundleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getSchemaBundle(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemaBundlesTest() throws Exception { + SchemaBundle responsesElement = SchemaBundle.newBuilder().build(); + ListSchemaBundlesResponse expectedResponse = + ListSchemaBundlesResponse.newBuilder() + .setNextPageToken("") + .addAllSchemaBundles(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + ListSchemaBundlesPagedResponse pagedListResponse = client.listSchemaBundles(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemaBundlesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemaBundlesRequest actualRequest = ((ListSchemaBundlesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemaBundlesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.listSchemaBundles(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemaBundlesTest2() throws Exception { + SchemaBundle responsesElement = SchemaBundle.newBuilder().build(); + ListSchemaBundlesResponse expectedResponse = + ListSchemaBundlesResponse.newBuilder() + .setNextPageToken("") + .addAllSchemaBundles(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSchemaBundlesPagedResponse pagedListResponse = client.listSchemaBundles(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemaBundlesList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemaBundlesRequest actualRequest = ((ListSchemaBundlesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemaBundlesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSchemaBundles(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSchemaBundleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + + client.deleteSchemaBundle(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaBundleRequest actualRequest = ((DeleteSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaBundleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + client.deleteSchemaBundle(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSchemaBundleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSchemaBundle(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaBundleRequest actualRequest = ((DeleteSchemaBundleRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaBundleExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteSchemaBundle(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java new file mode 100644 index 000000000000..84ff97303347 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java @@ -0,0 +1,1997 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationFutures; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.testing.FakeOperationSnapshot; +import com.google.bigtable.admin.v2.AutoscalingLimits; +import com.google.bigtable.admin.v2.AutoscalingTargets; +import com.google.bigtable.admin.v2.CreateInstanceMetadata; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.UpdateClusterMetadata; +import com.google.bigtable.admin.v2.UpdateInstanceMetadata; +import com.google.cloud.Identity; +import com.google.cloud.Policy; +import com.google.cloud.Role; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListLogicalViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListMaterializedViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.MultiClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.Priority; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.admin.v2.models.ClusterAutoscalingConfig; +import com.google.cloud.bigtable.admin.v2.models.CreateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateClusterRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.Instance; +import com.google.cloud.bigtable.admin.v2.models.LogicalView; +import com.google.cloud.bigtable.admin.v2.models.MaterializedView; +import com.google.cloud.bigtable.admin.v2.models.PartialListClustersException; +import com.google.cloud.bigtable.admin.v2.models.PartialListInstancesException; +import com.google.cloud.bigtable.admin.v2.models.StaticClusterSize; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.admin.v2.models.UpdateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStub; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.io.BaseEncoding; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.Status.Code; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; +import org.mockito.stubbing.Answer; + +/** + * Tests for {@link BigtableInstanceAdminClient}. This test class uses Mockito so it has been + * explicitly excluded from Native Image testing by not following the naming convention of (IT* and + * *ClientTest). + */ +@RunWith(JUnit4.class) +public class BigtableInstanceAdminClientTests { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN); + + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String CLUSTER_ID = "my-cluster"; + private static final String APP_PROFILE_ID = "my-app-profile"; + private static final String MATERIALIZED_VIEW_ID = "my-materialized-view"; + private static final String LOGICAL_VIEW_ID = "my-logical-view"; + + private static final String PROJECT_NAME = NameUtil.formatProjectName(PROJECT_ID); + private static final String INSTANCE_NAME = NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID); + private static final String CLUSTER_NAME = + NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID); + private static final String APP_PROFILE_NAME = + NameUtil.formatAppProfileName(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + private static final String MATERIALIZED_VIEW_NAME = + NameUtil.formatMaterializedViewName(PROJECT_ID, INSTANCE_ID, MATERIALIZED_VIEW_ID); + private static final String LOGICAL_VIEW_NAME = + NameUtil.formatLogicalViewName(PROJECT_ID, INSTANCE_ID, LOGICAL_VIEW_ID); + + private BigtableInstanceAdminClient adminClient; + + private final com.google.bigtable.admin.v2.Cluster.ClusterConfig clusterConfig = + com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder() + .setClusterAutoscalingConfig( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.newBuilder() + .setAutoscalingLimits( + AutoscalingLimits.newBuilder() + .setMaxServeNodes(10) + .setMinServeNodes(2) + .build()) + .setAutoscalingTargets( + AutoscalingTargets.newBuilder() + .setCpuUtilizationPercent(22) + .setStorageUtilizationGibPerNode(3000) + .build())) + .build(); + + @Mock private BigtableInstanceAdminStub mockStub; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateInstanceRequest, + com.google.bigtable.admin.v2.Instance, + CreateInstanceMetadata> + mockCreateInstanceCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.bigtable.admin.v2.Instance, + UpdateInstanceMetadata> + mockUpdateInstanceCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetInstanceRequest, com.google.bigtable.admin.v2.Instance> + mockGetInstanceCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListInstancesRequest, + com.google.bigtable.admin.v2.ListInstancesResponse> + mockListInstancesCallable; + + @Mock + private UnaryCallable + mockDeleteInstanceCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateClusterRequest, + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.CreateClusterMetadata> + mockCreateClusterCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetClusterRequest, com.google.bigtable.admin.v2.Cluster> + mockGetClusterCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListClustersRequest, + com.google.bigtable.admin.v2.ListClustersResponse> + mockListClustersCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster, + UpdateClusterMetadata> + mockUpdateClusterCallable; + + @Mock + private OperationCallable< + PartialUpdateClusterRequest, + com.google.bigtable.admin.v2.Cluster, + PartialUpdateClusterMetadata> + mockPartialUpdateClusterCallable; + + @Mock + private UnaryCallable + mockDeleteClusterCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.CreateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + mockCreateAppProfileCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + mockGetAppProfileCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListAppProfilesRequest, ListAppProfilesPagedResponse> + mockListAppProfilesCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.UpdateAppProfileMetadata> + mockUpdateAppProfileCallable; + + @Mock + private UnaryCallable + mockDeleteAppProfileCallable; + + @Mock + private UnaryCallable + mockGetIamPolicyCallable; + + @Mock + private UnaryCallable + mockSetIamPolicyCallable; + + @Mock + private UnaryCallable< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + mockTestIamPermissionsCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata> + mockCreateMaterializedViewCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView> + mockGetMaterializedViewCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListMaterializedViewsRequest, + ListMaterializedViewsPagedResponse> + mockListMaterializedViewsCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata> + mockUpdateMaterializedViewCallable; + + @Mock + private UnaryCallable + mockDeleteMaterializedViewCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.CreateLogicalViewMetadata> + mockCreateLogicalViewCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView> + mockGetLogicalViewCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, ListLogicalViewsPagedResponse> + mockListLogicalViewsCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata> + mockUpdateLogicalViewCallable; + + @Mock + private UnaryCallable + mockDeleteLogicalViewCallable; + + @Before + public void setUp() { + adminClient = BigtableInstanceAdminClient.create(PROJECT_ID, mockStub); + } + + @Test + public void testProjectName() { + assertThat(adminClient.getProjectId()).isEqualTo(PROJECT_ID); + } + + @Test + public void testClose() { + adminClient.close(); + Mockito.verify(mockStub).close(); + } + + @Test + public void testCreateInstance() { + // Setup + Mockito.when(mockStub.createInstanceOperationCallable()).thenReturn(mockCreateInstanceCallable); + + com.google.bigtable.admin.v2.CreateInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(PROJECT_NAME) + .setInstanceId(INSTANCE_ID) + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setType(com.google.bigtable.admin.v2.Instance.Type.DEVELOPMENT) + .setDisplayName(INSTANCE_ID)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setServeNodes(1) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder().setName(INSTANCE_NAME).build(); + + mockOperationResult(mockCreateInstanceCallable, expectedRequest, expectedResponse); + + // Execute + Instance actualResult = + adminClient.createInstance( + CreateInstanceRequest.of(INSTANCE_ID) + .setType(Instance.Type.DEVELOPMENT) + .addCluster("cluster1", "us-east1-c", 1, StorageType.SSD)); + + // Verify + assertThat(actualResult).isEqualTo(Instance.fromProto(expectedResponse)); + } + + @Test + public void testCreateInstanceAutoscaling() { + Mockito.when(mockStub.createInstanceOperationCallable()).thenReturn(mockCreateInstanceCallable); + + // Setup + AutoscalingLimits autoscalingLimits = + AutoscalingLimits.newBuilder().setMaxServeNodes(5).setMinServeNodes(1).build(); + AutoscalingTargets autoscalingTargets = + AutoscalingTargets.newBuilder().setCpuUtilizationPercent(49).build(); + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig clusterAutoscalingConfig = + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.newBuilder() + .setAutoscalingLimits(autoscalingLimits) + .setAutoscalingTargets(autoscalingTargets) + .build(); + com.google.bigtable.admin.v2.CreateInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(PROJECT_NAME) + .setInstanceId(INSTANCE_ID) + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setType(com.google.bigtable.admin.v2.Instance.Type.DEVELOPMENT) + .setDisplayName(INSTANCE_ID)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setClusterConfig( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder() + .setClusterAutoscalingConfig(clusterAutoscalingConfig) + .build()) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder().setName(INSTANCE_NAME).build(); + + mockOperationResult(mockCreateInstanceCallable, expectedRequest, expectedResponse); + + // Execute + ClusterAutoscalingConfig autoscalingConfig = + ClusterAutoscalingConfig.of(INSTANCE_ID, "cluster1") + .setCpuUtilizationTargetPercent(49) + .setMaxNodes(5) + .setMinNodes(1); + Instance actualResult = + adminClient.createInstance( + CreateInstanceRequest.of(INSTANCE_ID) + .setType(Instance.Type.DEVELOPMENT) + .addCluster("cluster1", "us-east1-c", autoscalingConfig, StorageType.SSD)); + + // Verify + assertThat(actualResult).isEqualTo(Instance.fromProto(expectedResponse)); + } + + @Test + public void testUpdateInstance() { + // Setup + Mockito.when(mockStub.partialUpdateInstanceOperationCallable()) + .thenReturn(mockUpdateInstanceCallable); + + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().addPaths("display_name")) + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(INSTANCE_NAME) + .setDisplayName("new display name")) + .build(); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder().setName(INSTANCE_NAME).build(); + + mockOperationResult(mockUpdateInstanceCallable, expectedRequest, expectedResponse); + + // Execute + Instance actualResult = + adminClient.updateInstance( + UpdateInstanceRequest.of(INSTANCE_ID).setDisplayName("new display name")); + + // Verify + assertThat(actualResult).isEqualTo(Instance.fromProto(expectedResponse)); + } + + @Test + public void testUpdateCluster() { + Mockito.when(mockStub.partialUpdateInstanceOperationCallable()) + .thenReturn(mockUpdateInstanceCallable); + + // Setup + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().addPaths("display_name")) + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(INSTANCE_NAME) + .setDisplayName("new display name")) + .build(); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder().setName(INSTANCE_NAME).build(); + + mockOperationResult(mockUpdateInstanceCallable, expectedRequest, expectedResponse); + + // Execute + Instance actualResult = + adminClient.updateInstance( + UpdateInstanceRequest.of(INSTANCE_ID).setDisplayName("new display name")); + + // Verify + assertThat(actualResult).isEqualTo(Instance.fromProto(expectedResponse)); + } + + @Test + public void testGetInstance() { + // Setup + Mockito.when(mockStub.getInstanceCallable()).thenReturn(mockGetInstanceCallable); + + com.google.bigtable.admin.v2.GetInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder().setName(INSTANCE_NAME).build(); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder().setName(INSTANCE_NAME).build(); + + Mockito.when(mockGetInstanceCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Instance actualResult = adminClient.getInstance(INSTANCE_ID); + + // Verify + assertThat(actualResult).isEqualTo(Instance.fromProto(expectedResponse)); + } + + @Test + public void testListInstances() { + // Setup + Mockito.when(mockStub.listInstancesCallable()).thenReturn(mockListInstancesCallable); + + com.google.bigtable.admin.v2.ListInstancesRequest expectedRequest = + com.google.bigtable.admin.v2.ListInstancesRequest.newBuilder() + .setParent(PROJECT_NAME) + .build(); + + com.google.bigtable.admin.v2.ListInstancesResponse expectedResponse = + com.google.bigtable.admin.v2.ListInstancesResponse.newBuilder() + .addInstances( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(INSTANCE_NAME + "1") + .build()) + .addInstances( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(INSTANCE_NAME + "2") + .build()) + .build(); + + Mockito.when(mockListInstancesCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + List actualResult = adminClient.listInstances(); + + // Verify + assertThat(actualResult) + .containsExactly( + Instance.fromProto(expectedResponse.getInstances(0)), + Instance.fromProto(expectedResponse.getInstances(1))); + } + + @Test + public void testListInstancesFailedZone() { + // Setup + Mockito.when(mockStub.listInstancesCallable()).thenReturn(mockListInstancesCallable); + + com.google.bigtable.admin.v2.ListInstancesRequest expectedRequest = + com.google.bigtable.admin.v2.ListInstancesRequest.newBuilder() + .setParent(PROJECT_NAME) + .build(); + + com.google.bigtable.admin.v2.ListInstancesResponse expectedResponse = + com.google.bigtable.admin.v2.ListInstancesResponse.newBuilder() + .addInstances( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(INSTANCE_NAME + "1") + .build()) + .addFailedLocations(NameUtil.formatLocationName(PROJECT_ID, "us-east1-d")) + .build(); + + Mockito.when(mockListInstancesCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Exception actualError = null; + + try { + adminClient.listInstances(); + } catch (Exception e) { + actualError = e; + } + + // Verify + assertThat(actualError).isInstanceOf(PartialListInstancesException.class); + assert actualError != null; + PartialListInstancesException partialListError = (PartialListInstancesException) actualError; + + assertThat(partialListError.getInstances()) + .containsExactly(Instance.fromProto(expectedResponse.getInstances(0))); + assertThat(partialListError.getUnavailableZones()).containsExactly("us-east1-d"); + } + + @Test + public void testDeleteInstance() { + // Setup + Mockito.when(mockStub.deleteInstanceCallable()).thenReturn(mockDeleteInstanceCallable); + + com.google.bigtable.admin.v2.DeleteInstanceRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteInstanceRequest.newBuilder() + .setName(INSTANCE_NAME) + .build(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDeleteInstanceCallable.futureCall(expectedRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + wasCalled.set(true); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + // Execute + adminClient.deleteInstance(INSTANCE_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testCreateCluster() { + // Setup + Mockito.when(mockStub.createClusterOperationCallable()).thenReturn(mockCreateClusterCallable); + + com.google.bigtable.admin.v2.CreateClusterRequest expectedRequest = + com.google.bigtable.admin.v2.CreateClusterRequest.newBuilder() + .setParent(INSTANCE_NAME) + .setClusterId(CLUSTER_ID) + .setCluster( + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setServeNodes(3) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD)) + .build(); + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME).build(); + mockOperationResult(mockCreateClusterCallable, expectedRequest, expectedResponse); + + // Execute + Cluster actualResult = + adminClient.createCluster( + CreateClusterRequest.of(INSTANCE_ID, CLUSTER_ID) + .setZone("us-east1-c") + .setScalingMode(StaticClusterSize.of(3)) + .setStorageType(StorageType.SSD)); + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testCreateClusterAutoscaling() { + Mockito.when(mockStub.createClusterOperationCallable()).thenReturn(mockCreateClusterCallable); + + // Setup + com.google.bigtable.admin.v2.CreateClusterRequest expectedRequest = + com.google.bigtable.admin.v2.CreateClusterRequest.newBuilder() + .setParent(INSTANCE_NAME) + .setClusterId(CLUSTER_ID) + .setCluster( + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setClusterConfig(clusterConfig) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD)) + .build(); + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME).build(); + mockOperationResult(mockCreateClusterCallable, expectedRequest, expectedResponse); + + // Execute + Cluster actualResult = + adminClient.createCluster( + CreateClusterRequest.of(INSTANCE_ID, CLUSTER_ID) + .setZone("us-east1-c") + .setScalingMode( + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setMinNodes(2) + .setMaxNodes(10) + .setCpuUtilizationTargetPercent(22) + .setStorageUtilizationGibPerNode(3000)) + .setStorageType(StorageType.SSD)); + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testGetCluster() { + // Setup + Mockito.when(mockStub.getClusterCallable()).thenReturn(mockGetClusterCallable); + + com.google.bigtable.admin.v2.GetClusterRequest expectedRequest = + com.google.bigtable.admin.v2.GetClusterRequest.newBuilder().setName(CLUSTER_NAME).build(); + + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME).build(); + + Mockito.when(mockGetClusterCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Cluster actualResult = adminClient.getCluster(INSTANCE_ID, CLUSTER_ID); + + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testListClusters() { + // Setup + Mockito.when(mockStub.listClustersCallable()).thenReturn(mockListClustersCallable); + + com.google.bigtable.admin.v2.ListClustersRequest expectedRequest = + com.google.bigtable.admin.v2.ListClustersRequest.newBuilder() + .setParent(INSTANCE_NAME) + .build(); + + com.google.bigtable.admin.v2.ListClustersResponse expectedResponse = + com.google.bigtable.admin.v2.ListClustersResponse.newBuilder() + .addClusters( + com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME + "1")) + .addClusters( + com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME + "2")) + .build(); + + Mockito.when(mockListClustersCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + List actualResult = adminClient.listClusters(INSTANCE_ID); + + // Verify + assertThat(actualResult) + .containsExactly( + Cluster.fromProto(expectedResponse.getClusters(0)), + Cluster.fromProto(expectedResponse.getClusters(1))); + } + + @Test + public void testListClustersFailedZone() { + // Setup + Mockito.when(mockStub.listClustersCallable()).thenReturn(mockListClustersCallable); + + com.google.bigtable.admin.v2.ListClustersRequest expectedRequest = + com.google.bigtable.admin.v2.ListClustersRequest.newBuilder() + .setParent(INSTANCE_NAME) + .build(); + + com.google.bigtable.admin.v2.ListClustersResponse expectedResponse = + com.google.bigtable.admin.v2.ListClustersResponse.newBuilder() + .addClusters(com.google.bigtable.admin.v2.Cluster.newBuilder().setName(CLUSTER_NAME)) + .addFailedLocations(NameUtil.formatLocationName(PROJECT_ID, "us-east1-c")) + .build(); + + Mockito.when(mockListClustersCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Exception actualError = null; + + try { + adminClient.listClusters(INSTANCE_ID); + } catch (Exception e) { + actualError = e; + } + + // Verify + assertThat(actualError).isInstanceOf(PartialListClustersException.class); + assert actualError != null; + PartialListClustersException partialListError = (PartialListClustersException) actualError; + assertThat(partialListError.getClusters()) + .containsExactly(Cluster.fromProto(expectedResponse.getClusters(0))); + assertThat(partialListError.getUnavailableZones()).containsExactly("us-east1-c"); + } + + @Test + public void testResizeCluster() { + // Setup + Mockito.when(mockStub.updateClusterOperationCallable()).thenReturn(mockUpdateClusterCallable); + + com.google.bigtable.admin.v2.Cluster expectedRequest = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setServeNodes(30) + .build(); + + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setLocation(NameUtil.formatLocationName(PROJECT_ID, "us-east1-c")) + .setServeNodes(30) + .build(); + + mockOperationResult(mockUpdateClusterCallable, expectedRequest, expectedResponse); + + // Execute + Cluster actualResult = adminClient.resizeCluster(INSTANCE_ID, CLUSTER_ID, 30); + + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testDisableAutoscaling() { + Mockito.when(mockStub.partialUpdateClusterOperationCallable()) + .thenReturn(mockPartialUpdateClusterCallable); + + // Setup + com.google.bigtable.admin.v2.Cluster cluster = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setClusterConfig( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder().build()) + .setServeNodes(30) + .build(); + PartialUpdateClusterRequest expectedRequest = + PartialUpdateClusterRequest.newBuilder() + .setCluster(cluster) + .setUpdateMask( + FieldMask.newBuilder() + .addPaths("cluster_config.cluster_autoscaling_config") + .addPaths("serve_nodes") + .build()) + .build(); + + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setLocation(NameUtil.formatLocationName(PROJECT_ID, "us-east1-c")) + .setServeNodes(30) + .build(); + + mockOperationResult(mockPartialUpdateClusterCallable, expectedRequest, expectedResponse); + + // Execute + Cluster actualResult = adminClient.disableClusterAutoscaling(INSTANCE_ID, CLUSTER_ID, 30); + + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testPartialUpdateCluster() { + Mockito.when(mockStub.partialUpdateClusterOperationCallable()) + .thenReturn(mockPartialUpdateClusterCallable); + + // Setup + com.google.bigtable.admin.v2.Cluster cluster = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setClusterConfig(clusterConfig) + .build(); + + PartialUpdateClusterRequest expectedRequest = + PartialUpdateClusterRequest.newBuilder() + .setCluster(cluster) + .setUpdateMask( + FieldMask.newBuilder() + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes") + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes") + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent") + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_targets.storage_utilization_gib_per_node") + .build()) + .build(); + + com.google.bigtable.admin.v2.Cluster expectedResponse = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName(CLUSTER_NAME) + .setLocation(NameUtil.formatLocationName(PROJECT_ID, "us-east1-c")) + .setClusterConfig(clusterConfig) + .build(); + mockOperationResult(mockPartialUpdateClusterCallable, expectedRequest, expectedResponse); + + // Execute + Cluster actualResult = + adminClient.updateClusterAutoscalingConfig( + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setMaxNodes(10) + .setMinNodes(2) + .setStorageUtilizationGibPerNode(3000) + .setCpuUtilizationTargetPercent(22)); + + // Verify + assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); + } + + @Test + public void testDeleteCluster() { + // Setup + Mockito.when(mockStub.deleteClusterCallable()).thenReturn(mockDeleteClusterCallable); + + com.google.bigtable.admin.v2.DeleteClusterRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteClusterRequest.newBuilder() + .setName(CLUSTER_NAME) + .build(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDeleteClusterCallable.futureCall(expectedRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + wasCalled.set(true); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + // Execute + adminClient.deleteCluster(INSTANCE_ID, CLUSTER_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testCreateAppProfile() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance())) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.of())); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddSingleClusterId() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addClusterIds("cluster-id-1"))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addClusterIds("cluster-id-1")) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.of("cluster-id-1"))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddMultipleClusterIds() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addClusterIds("cluster-id-1") + .addClusterIds("cluster-id-2"))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addClusterIds("cluster-id-1") + .addClusterIds("cluster-id-2")) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.of("cluster-id-1", "cluster-id-2"))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddMultipleClusterIdsWithList() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2"))) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.of("cluster-id-1", "cluster-id-2"))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddPriority() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addClusterIds("cluster-id-1")) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addClusterIds("cluster-id-1")) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority(com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM)) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.of("cluster-id-1")) + .setIsolationPolicy(StandardIsolationPolicy.of(Priority.MEDIUM))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddRowAffinity() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build()))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build())) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.withRowAffinity())); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddRowAffinityAddMultipleClusterIds() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addClusterIds("cluster-id-1") + .addClusterIds("cluster-id-2") + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build()))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addClusterIds("cluster-id-1") + .addClusterIds("cluster-id-2") + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build())) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy( + MultiClusterRoutingPolicy.withRowAffinity("cluster-id-1", "cluster-id-2"))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testCreateAppProfileAddRowAffinityAddSetOfClusterIds() { + // Setup + Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); + + // We want to make sure the expected request has the same ordering as the request we build + // from CreateAppProfileRequest. Use a TreeSet to for stable ordering. + Set clusterIds = new TreeSet<>(); + clusterIds.add("cluster-id-1"); + clusterIds.add("cluster-id-2"); + + com.google.bigtable.admin.v2.CreateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .newBuilder() + .addAllClusterIds(clusterIds) + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build()))) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(clusterIds) + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build())) + .build(); + + Mockito.when(mockCreateAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = + adminClient.createAppProfile( + CreateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("my description") + .setRoutingPolicy(MultiClusterRoutingPolicy.withRowAffinity(clusterIds))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testGetAppProfile() { + // Setup + Mockito.when(mockStub.getAppProfileCallable()).thenReturn(mockGetAppProfileCallable); + + com.google.bigtable.admin.v2.GetAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.GetAppProfileRequest.newBuilder() + .setName(APP_PROFILE_NAME) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) + .build(); + + Mockito.when(mockGetAppProfileCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AppProfile actualResult = adminClient.getAppProfile(INSTANCE_ID, APP_PROFILE_ID); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testListAppProfiles() { + // Setup + Mockito.when(mockStub.listAppProfilesPagedCallable()).thenReturn(mockListAppProfilesCallable); + + com.google.bigtable.admin.v2.ListAppProfilesRequest expectedRequest = + com.google.bigtable.admin.v2.ListAppProfilesRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + + // 3 AppProfiles spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME + i) + .setDescription("profile" + i) + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) + .build()); + } + // 2 on the first page + ListAppProfilesPage page0 = Mockito.mock(ListAppProfilesPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListAppProfilesPage page1 = Mockito.mock(ListAppProfilesPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListAppProfilesPagedResponse response0 = Mockito.mock(ListAppProfilesPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListAppProfilesCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listAppProfiles(INSTANCE_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.AppProfile expectedProto : expectedProtos) { + expectedResults.add(AppProfile.fromProto(expectedProto)); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testUpdateAppProfile() { + // Setup + Mockito.when(mockStub.updateAppProfileOperationCallable()) + .thenReturn(mockUpdateAppProfileCallable); + + com.google.bigtable.admin.v2.UpdateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("updated description")) + .setUpdateMask(FieldMask.newBuilder().addPaths("description")) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setDescription("updated description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) + .build(); + + mockOperationResult(mockUpdateAppProfileCallable, expectedRequest, expectedResponse); + + // Execute + AppProfile actualResult = + adminClient.updateAppProfile( + UpdateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setDescription("updated description")); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testUpdateAppProfileStandardIsolation() { + // Setup + Mockito.when(mockStub.updateAppProfileOperationCallable()) + .thenReturn(mockUpdateAppProfileCallable); + + com.google.bigtable.admin.v2.UpdateAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_LOW))) + .setUpdateMask(FieldMask.newBuilder().addPaths("standard_isolation")) + .build(); + + com.google.bigtable.admin.v2.AppProfile expectedResponse = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(APP_PROFILE_NAME) + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority(com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_LOW)) + .build(); + + mockOperationResult(mockUpdateAppProfileCallable, expectedRequest, expectedResponse); + + // Execute + AppProfile actualResult = + adminClient.updateAppProfile( + UpdateAppProfileRequest.of(INSTANCE_ID, APP_PROFILE_ID) + .setIsolationPolicy(StandardIsolationPolicy.of(Priority.LOW))); + + // Verify + assertThat(actualResult).isEqualTo(AppProfile.fromProto(expectedResponse)); + } + + @Test + public void testDeleteAppProfile() throws Exception { + // Setup + Mockito.when(mockStub.deleteAppProfileCallable()).thenReturn(mockDeleteAppProfileCallable); + + com.google.bigtable.admin.v2.DeleteAppProfileRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteAppProfileRequest.newBuilder() + .setName(APP_PROFILE_NAME) + .build(); + + com.google.bigtable.admin.v2.DeleteAppProfileRequest forceDeleteRequest = + com.google.bigtable.admin.v2.DeleteAppProfileRequest.newBuilder() + .setName(APP_PROFILE_NAME) + .setIgnoreWarnings(true) + .build(); + + final AtomicInteger wasCalled = new AtomicInteger(0); + final AtomicInteger forcedDeleteCall = new AtomicInteger(0); + + Mockito.when(mockDeleteAppProfileCallable.futureCall(expectedRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + wasCalled.incrementAndGet(); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + Mockito.when(mockDeleteAppProfileCallable.futureCall(forceDeleteRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + forcedDeleteCall.incrementAndGet(); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + // Execute + adminClient.deleteAppProfile(INSTANCE_ID, APP_PROFILE_ID); + + adminClient.deleteAppProfileAsync(INSTANCE_ID, APP_PROFILE_ID).get(); + + // Forced app profile delete + adminClient.deleteAppProfile(INSTANCE_ID, APP_PROFILE_ID, true); + + adminClient.deleteAppProfileAsync(INSTANCE_ID, APP_PROFILE_ID, true).get(); + + // Verify + assertThat(wasCalled.get()).isEqualTo(2); + assertThat(forcedDeleteCall.get()).isEqualTo(2); + } + + private void mockOperationResult( + OperationCallable callable, ReqT request, RespT response) { + OperationSnapshot operationSnapshot = + FakeOperationSnapshot.newBuilder() + .setDone(true) + .setErrorCode(GrpcStatusCode.of(Code.OK)) + .setName("fake-name") + .setResponse(response) + .build(); + OperationFuture operationFuture = + OperationFutures.immediateOperationFuture(operationSnapshot); + Mockito.when(callable.futureCall(request)).thenReturn(operationFuture); + } + + @Test + public void testGetIamPolicy() { + // Setup + Mockito.when(mockStub.getIamPolicyCallable()).thenReturn(mockGetIamPolicyCallable); + + com.google.iam.v1.GetIamPolicyRequest expectedRequest = + com.google.iam.v1.GetIamPolicyRequest.newBuilder() + .setResource(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + + com.google.iam.v1.Policy expectedResponse = + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.user") + .addMembers("user:someone@example.com")) + .setEtag(ByteString.copyFromUtf8("my-etag")) + .build(); + + Mockito.when(mockGetIamPolicyCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Policy actualResult = adminClient.getIamPolicy(INSTANCE_ID); + + // Verify + assertThat(actualResult) + .isEqualTo( + Policy.newBuilder() + .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com")) + .setEtag(BaseEncoding.base64().encode("my-etag".getBytes(StandardCharsets.UTF_8))) + .build()); + } + + @Test + public void testSetIamPolicy() { + // Setup + Mockito.when(mockStub.setIamPolicyCallable()).thenReturn(mockSetIamPolicyCallable); + + com.google.iam.v1.SetIamPolicyRequest expectedRequest = + com.google.iam.v1.SetIamPolicyRequest.newBuilder() + .setResource(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setPolicy( + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.user") + .addMembers("user:someone@example.com"))) + .build(); + + com.google.iam.v1.Policy expectedResponse = + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.user") + .addMembers("user:someone@example.com")) + .setEtag(ByteString.copyFromUtf8("my-etag")) + .build(); + + Mockito.when(mockSetIamPolicyCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Policy actualResult = + adminClient.setIamPolicy( + INSTANCE_ID, + Policy.newBuilder() + .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com")) + .build()); + + // Verify + assertThat(actualResult) + .isEqualTo( + Policy.newBuilder() + .addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com")) + .setEtag(BaseEncoding.base64().encode("my-etag".getBytes(StandardCharsets.UTF_8))) + .build()); + } + + @Test + public void testTestIamPermissions() { + // Setup + Mockito.when(mockStub.testIamPermissionsCallable()).thenReturn(mockTestIamPermissionsCallable); + + com.google.iam.v1.TestIamPermissionsRequest expectedRequest = + com.google.iam.v1.TestIamPermissionsRequest.newBuilder() + .setResource(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .addPermissions("bigtable.tables.readRows") + .build(); + + com.google.iam.v1.TestIamPermissionsResponse expectedResponse = + com.google.iam.v1.TestIamPermissionsResponse.newBuilder() + .addPermissions("bigtable.tables.readRows") + .build(); + + Mockito.when(mockTestIamPermissionsCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + List actualResult = + adminClient.testIamPermission(INSTANCE_ID, "bigtable.tables.readRows"); + + // Verify + assertThat(actualResult).containsExactly("bigtable.tables.readRows"); + } + + @Test + public void testExistsTrue() { + // Setup + Mockito.when(mockStub.getInstanceCallable()).thenReturn(mockGetInstanceCallable); + + com.google.bigtable.admin.v2.Instance expectedResponse = + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + + Mockito.when(mockGetInstanceCallable.futureCall(ArgumentMatchers.any(GetInstanceRequest.class))) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + boolean found = adminClient.exists(INSTANCE_ID); + + // Verify + assertThat(found).isTrue(); + } + + @Test + public void testExistsFalse() { + // Setup + Mockito.when(mockStub.getInstanceCallable()).thenReturn(mockGetInstanceCallable); + + NotFoundException exception = + new NotFoundException("fake-error", null, GrpcStatusCode.of(Status.Code.NOT_FOUND), false); + + Mockito.when(mockGetInstanceCallable.futureCall(ArgumentMatchers.any(GetInstanceRequest.class))) + .thenReturn( + ApiFutures.immediateFailedFuture(exception)); + + // Execute + boolean found = adminClient.exists(INSTANCE_ID); + + // Verify + assertThat(found).isFalse(); + } + + @Test + public void testCreateMaterializedView() { + // Setup + Mockito.when(mockStub.createMaterializedViewOperationCallable()) + .thenReturn(mockCreateMaterializedViewCallable); + + com.google.bigtable.admin.v2.CreateMaterializedViewRequest expectedRequest = + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setMaterializedViewId(MATERIALIZED_VIEW_ID) + .setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table")) + .build(); + + com.google.bigtable.admin.v2.MaterializedView expectedResponse = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table") + .build(); + + mockOperationResult(mockCreateMaterializedViewCallable, expectedRequest, expectedResponse); + + // Execute + MaterializedView actualResult = + adminClient.createMaterializedView( + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table")); + + // Verify + assertThat(actualResult).isEqualTo(MaterializedView.fromProto(expectedResponse)); + } + + @Test + public void testGetMaterializedView() { + // Setup + Mockito.when(mockStub.getMaterializedViewCallable()) + .thenReturn(mockGetMaterializedViewCallable); + + com.google.bigtable.admin.v2.GetMaterializedViewRequest expectedRequest = + com.google.bigtable.admin.v2.GetMaterializedViewRequest.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .build(); + + com.google.bigtable.admin.v2.MaterializedView expectedResponse = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table") + .build(); + + Mockito.when(mockGetMaterializedViewCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + MaterializedView actualResult = + adminClient.getMaterializedView(INSTANCE_ID, MATERIALIZED_VIEW_ID); + + // Verify + assertThat(actualResult).isEqualTo(MaterializedView.fromProto(expectedResponse)); + } + + @Test + public void testListMaterializedViews() { + // Setup + Mockito.when(mockStub.listMaterializedViewsPagedCallable()) + .thenReturn(mockListMaterializedViewsCallable); + + com.google.bigtable.admin.v2.ListMaterializedViewsRequest expectedRequest = + com.google.bigtable.admin.v2.ListMaterializedViewsRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + + // 3 MaterializedViews spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(MATERIALIZED_VIEW_NAME + i) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table" + i) + .build()); + } + // 2 on the first page + ListMaterializedViewsPage page0 = Mockito.mock(ListMaterializedViewsPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListMaterializedViewsPage page1 = Mockito.mock(ListMaterializedViewsPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListMaterializedViewsPagedResponse response0 = + Mockito.mock(ListMaterializedViewsPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListMaterializedViewsCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listMaterializedViews(INSTANCE_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.MaterializedView expectedProto : expectedProtos) { + expectedResults.add(MaterializedView.fromProto(expectedProto)); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testUpdateMaterializedView() { + // Setup + Mockito.when(mockStub.updateMaterializedViewOperationCallable()) + .thenReturn(mockUpdateMaterializedViewCallable); + + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.newBuilder() + .setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .setDeletionProtection(false)) + .setUpdateMask(FieldMask.newBuilder().addPaths("deletion_protection")) + .build(); + + com.google.bigtable.admin.v2.MaterializedView expectedResponse = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .setDeletionProtection(false) + .build(); + + mockOperationResult(mockUpdateMaterializedViewCallable, expectedRequest, expectedResponse); + + // Execute + MaterializedView actualResult = + adminClient.updateMaterializedView( + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false)); + + // Verify + assertThat(actualResult).isEqualTo(MaterializedView.fromProto(expectedResponse)); + } + + @Test + public void testDeleteMaterializedView() throws Exception { + // Setup + Mockito.when(mockStub.deleteMaterializedViewCallable()) + .thenReturn(mockDeleteMaterializedViewCallable); + + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.newBuilder() + .setName(MATERIALIZED_VIEW_NAME) + .build(); + + final AtomicInteger wasCalled = new AtomicInteger(0); + + Mockito.when(mockDeleteMaterializedViewCallable.futureCall(expectedRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + wasCalled.incrementAndGet(); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + // Execute + adminClient.deleteMaterializedView(INSTANCE_ID, MATERIALIZED_VIEW_ID); + + adminClient.deleteMaterializedViewAsync(INSTANCE_ID, MATERIALIZED_VIEW_ID).get(); + + // Verify + assertThat(wasCalled.get()).isEqualTo(2); + } + + @Test + public void testCreateLogicalView() { + // Setup + Mockito.when(mockStub.createLogicalViewOperationCallable()) + .thenReturn(mockCreateLogicalViewCallable); + + com.google.bigtable.admin.v2.CreateLogicalViewRequest expectedRequest = + com.google.bigtable.admin.v2.CreateLogicalViewRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setLogicalViewId(LOGICAL_VIEW_ID) + .setLogicalView( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setQuery("SELECT 1 FROM Table")) + .build(); + + com.google.bigtable.admin.v2.LogicalView expectedResponse = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .setQuery("SELECT 1 FROM Table") + .build(); + + mockOperationResult(mockCreateLogicalViewCallable, expectedRequest, expectedResponse); + + // Execute + LogicalView actualResult = + adminClient.createLogicalView( + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("SELECT 1 FROM Table")); + + // Verify + assertThat(actualResult).isEqualTo(LogicalView.fromProto(expectedResponse)); + } + + @Test + public void testGetLogicalView() { + // Setup + Mockito.when(mockStub.getLogicalViewCallable()).thenReturn(mockGetLogicalViewCallable); + + com.google.bigtable.admin.v2.GetLogicalViewRequest expectedRequest = + com.google.bigtable.admin.v2.GetLogicalViewRequest.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .build(); + + com.google.bigtable.admin.v2.LogicalView expectedResponse = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .setQuery("SELECT 1 FROM Table") + .build(); + + Mockito.when(mockGetLogicalViewCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + LogicalView actualResult = adminClient.getLogicalView(INSTANCE_ID, LOGICAL_VIEW_ID); + + // Verify + assertThat(actualResult).isEqualTo(LogicalView.fromProto(expectedResponse)); + } + + @Test + public void testListLogicalViews() { + // Setup + Mockito.when(mockStub.listLogicalViewsPagedCallable()).thenReturn(mockListLogicalViewsCallable); + + com.google.bigtable.admin.v2.ListLogicalViewsRequest expectedRequest = + com.google.bigtable.admin.v2.ListLogicalViewsRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + + // 3 LogicalViews spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(LOGICAL_VIEW_NAME + i) + .setQuery("SELECT 1 FROM Table" + i) + .build()); + } + // 2 on the first page + ListLogicalViewsPage page0 = Mockito.mock(ListLogicalViewsPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListLogicalViewsPage page1 = Mockito.mock(ListLogicalViewsPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListLogicalViewsPagedResponse response0 = Mockito.mock(ListLogicalViewsPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListLogicalViewsCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listLogicalViews(INSTANCE_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.LogicalView expectedProto : expectedProtos) { + expectedResults.add(LogicalView.fromProto(expectedProto)); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testUpdateLogicalView() { + // Setup + Mockito.when(mockStub.updateLogicalViewOperationCallable()) + .thenReturn(mockUpdateLogicalViewCallable); + + com.google.bigtable.admin.v2.UpdateLogicalViewRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.newBuilder() + .setLogicalView( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .setQuery("SELECT 1 FROM Table")) + .setUpdateMask(FieldMask.newBuilder().addPaths("query")) + .build(); + + com.google.bigtable.admin.v2.LogicalView expectedResponse = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .setQuery("SELECT 1 FROM Table") + .build(); + + mockOperationResult(mockUpdateLogicalViewCallable, expectedRequest, expectedResponse); + + // Execute + LogicalView actualResult = + adminClient.updateLogicalView( + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("SELECT 1 FROM Table")); + + // Verify + assertThat(actualResult).isEqualTo(LogicalView.fromProto(expectedResponse)); + } + + @Test + public void testDeleteLogicalView() throws Exception { + // Setup + Mockito.when(mockStub.deleteLogicalViewCallable()).thenReturn(mockDeleteLogicalViewCallable); + + com.google.bigtable.admin.v2.DeleteLogicalViewRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteLogicalViewRequest.newBuilder() + .setName(LOGICAL_VIEW_NAME) + .build(); + + final AtomicInteger wasCalled = new AtomicInteger(0); + + Mockito.when(mockDeleteLogicalViewCallable.futureCall(expectedRequest)) + .thenAnswer( + new Answer>() { + @Override + public ApiFuture answer(InvocationOnMock invocationOnMock) { + wasCalled.incrementAndGet(); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }); + + // Execute + adminClient.deleteLogicalView(INSTANCE_ID, LOGICAL_VIEW_ID); + + adminClient.deleteLogicalViewAsync(INSTANCE_ID, LOGICAL_VIEW_ID).get(); + + // Verify + assertThat(wasCalled.get()).isEqualTo(2); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java new file mode 100644 index 000000000000..9337dcef9aa6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStubSettings; +import java.io.IOException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class BigtableInstanceAdminSettingsTest { + @Test + public void testProjectName() throws Exception { + String projectId = "my-project"; + BigtableInstanceAdminSettings.Builder builder = + BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId); + + assertThat(builder.getProjectId()).isEqualTo(projectId); + assertThat(builder.build().getProjectId()).isEqualTo(projectId); + assertThat(builder.build().toBuilder().getProjectId()).isEqualTo(projectId); + } + + @Test + public void testMissingProjectName() { + Exception actualException = null; + + BigtableInstanceAdminSettings.Builder settingsBuilder = + BigtableInstanceAdminSettings.newBuilder(); + assertThat(settingsBuilder.getProjectId()).isNull(); + + try { + settingsBuilder.build(); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(NullPointerException.class); + } + + @Test + public void testCredentials() throws IOException { + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + + BigtableInstanceAdminSettings settings = + BigtableInstanceAdminSettings.newBuilder() + .setProjectId("my-project") + .setCredentialsProvider(credentialsProvider) + .build(); + + assertThat(settings.getCredentialsProvider()).isSameInstanceAs(credentialsProvider); + assertThat(settings.getStubSettings().getCredentialsProvider()) + .isSameInstanceAs(credentialsProvider); + assertThat(settings.toBuilder().getCredentialsProvider()).isSameInstanceAs(credentialsProvider); + assertThat(settings.toBuilder().build().getCredentialsProvider()) + .isSameInstanceAs(credentialsProvider); + } + + @Test + public void testStubSettings() throws IOException { + String projectId = "my-project"; + + BigtableInstanceAdminSettings.Builder builder = + BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId); + + builder.stubSettings().createInstanceSettings().setRetryableCodes(Code.INVALID_ARGUMENT); + + assertThat(builder.build().getStubSettings().createInstanceSettings().getRetryableCodes()) + .containsExactly(Code.INVALID_ARGUMENT); + + assertThat( + builder.build().toBuilder() + .build() + .getStubSettings() + .createInstanceSettings() + .getRetryableCodes()) + .containsExactly(Code.INVALID_ARGUMENT); + } + + static final String[] SETTINGS_LIST = { + "createInstanceSettings", + "createInstanceOperationSettings", + "getInstanceSettings", + "listInstancesSettings", + "partialUpdateInstanceSettings", + "partialUpdateInstanceOperationSettings", + "deleteInstanceSettings", + "createClusterSettings", + "createClusterOperationSettings", + "getClusterSettings", + "listClustersSettings", + "updateClusterSettings", + "updateClusterOperationSettings", + "deleteClusterSettings", + "createAppProfileSettings", + "getAppProfileSettings", + "listAppProfilesSettings", + "updateAppProfileSettings", + "updateAppProfileOperationSettings", + "deleteAppProfileSettings", + "getIamPolicySettings", + "setIamPolicySettings", + "testIamPermissionsSettings", + "createMaterializedViewSettings", + "getMaterializedViewSettings", + "listMaterializedViewsSettings", + "updateMaterializedViewSettings", + "deleteMaterializedViewSettings", + "createLogicalViewSettings", + "getLogicalViewSettings", + "listLogicalViewsSettings", + "updateLogicalViewSettings", + "deleteLogicalViewSettings", + }; + + @Test + public void testToString() throws IOException { + BigtableInstanceAdminSettings defaultSettings = + BigtableInstanceAdminSettings.newBuilder().setProjectId("our-project-212").build(); + + checkToString(defaultSettings); + + BigtableInstanceAdminSettings.Builder builder = defaultSettings.toBuilder(); + BigtableInstanceAdminStubSettings.Builder stubSettings = + builder.stubSettings().setEndpoint("example.com:1234"); + + stubSettings + .getInstanceSettings() + .setRetrySettings( + RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(812)).build()); + + BigtableInstanceAdminSettings settings = builder.build(); + checkToString(settings); + assertThat(settings.toString()).contains("endpoint=example.com:1234"); + assertThat(settings.toString()).contains("totalTimeoutDuration=PT13H32M"); + } + + void checkToString(BigtableInstanceAdminSettings settings) { + String projectId = settings.getProjectId(); + String toString = settings.toString(); + assertThat(toString).isEqualTo(settings.toString()); // no variety + assertThat(toString).startsWith("BigtableInstanceAdminSettings{projectId=" + projectId); + for (String subSettings : SETTINGS_LIST) { + assertThat(toString).contains(subSettings + "="); + } + assertThat(toString).contains(settings.getStubSettings().toString()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java new file mode 100644 index 000000000000..8104ee146c2c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java @@ -0,0 +1,1765 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.longrunning.OperationFutures; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.testing.FakeOperationSnapshot; +import com.google.bigtable.admin.v2.AuthorizedViewName; +import com.google.bigtable.admin.v2.Backup.State; +import com.google.bigtable.admin.v2.BackupInfo; +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateBackupMetadata; +import com.google.bigtable.admin.v2.CreateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification; +import com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata; +import com.google.bigtable.admin.v2.RestoreSourceType; +import com.google.bigtable.admin.v2.RestoreTableMetadata; +import com.google.bigtable.admin.v2.SchemaBundleName; +import com.google.bigtable.admin.v2.Table.ClusterState; +import com.google.bigtable.admin.v2.Table.View; +import com.google.bigtable.admin.v2.TableName; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata; +import com.google.bigtable.admin.v2.UpdateTableMetadata; +import com.google.cloud.Identity; +import com.google.cloud.Policy; +import com.google.cloud.Role; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListAuthorizedViewsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListBackupsPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListSchemaBundlesPagedResponse; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPage; +import com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.Backup; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.admin.v2.models.CopyBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.EncryptionInfo; +import com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest; +import com.google.cloud.bigtable.admin.v2.models.OptimizeRestoredTableOperationToken; +import com.google.cloud.bigtable.admin.v2.models.RestoreTableRequest; +import com.google.cloud.bigtable.admin.v2.models.RestoredTableResult; +import com.google.cloud.bigtable.admin.v2.models.SchemaBundle; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.Type; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.stub.EnhancedBigtableTableAdminStub; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.io.BaseEncoding; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; +import io.grpc.Status; +import io.grpc.Status.Code; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.stubbing.Answer; +import org.threeten.bp.Instant; + +/** + * Tests for {@link BigtableTableAdminClient}. This test class uses Mockito so it has been + * explicitly excluded from Native Image testing by not following the naming convention of (IT* and + * *ClientTest). + */ +@RunWith(JUnit4.class) +public class BigtableTableAdminClientTests { + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String CLUSTER_ID = "my-cluster"; + private static final String BACKUP_ID = "my-backup"; + private static final String AUTHORIZED_VIEW_ID = "my-authorized-view"; + private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle"; + // Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb` + private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb"; + // Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb` + private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb"; + + private static final String INSTANCE_NAME = NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID); + private static final String TABLE_NAME = + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + + private BigtableTableAdminClient adminClient; + @Mock private EnhancedBigtableTableAdminStub mockStub; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.CreateTableRequest, com.google.bigtable.admin.v2.Table> + mockCreateTableCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateTableRequest, + com.google.bigtable.admin.v2.Table, + UpdateTableMetadata> + mockUpdateTableOperationCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, + com.google.bigtable.admin.v2.Table> + mockModifyTableCallable; + + @Mock private UnaryCallable mockDeleteTableCallable; + + @Mock + private UnaryCallable mockGetTableCallable; + + @Mock private UnaryCallable mockListTableCallable; + @Mock private UnaryCallable mockDropRowRangeCallable; + @Mock private UnaryCallable mockAwaitReplicationCallable; + + @Mock private UnaryCallable mockAwaitConsistencyCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateBackupRequest, + com.google.bigtable.admin.v2.Backup, + CreateBackupMetadata> + mockCreateBackupOperationCallable; + + @Mock + private UnaryCallable + mockGetBackupCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.UpdateBackupRequest, com.google.bigtable.admin.v2.Backup> + mockUpdateBackupCallable; + + @Mock private UnaryCallable mockListBackupCallable; + @Mock private UnaryCallable mockDeleteBackupCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.RestoreTableRequest, + com.google.bigtable.admin.v2.Table, + RestoreTableMetadata> + mockRestoreTableOperationCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CopyBackupRequest, + com.google.bigtable.admin.v2.Backup, + CopyBackupMetadata> + mockCopyBackupOperationCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView, + CreateAuthorizedViewMetadata> + mockCreateAuthorizedViewOperationCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView, + UpdateAuthorizedViewMetadata> + mockUpdateAuthorizedViewOperationCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView> + mockGetAuthorizedViewCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest, ListAuthorizedViewsPagedResponse> + mockListAuthorizedViewsCallable; + + @Mock + private UnaryCallable + mockDeleteAuthorizedViewCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle, + CreateSchemaBundleMetadata> + mockCreateSchemaBundleOperationCallable; + + @Mock + private OperationCallable< + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle, + UpdateSchemaBundleMetadata> + mockUpdateSchemaBundleOperationCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.GetSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle> + mockGetSchemaBundleCallable; + + @Mock + private UnaryCallable< + com.google.bigtable.admin.v2.ListSchemaBundlesRequest, ListSchemaBundlesPagedResponse> + mockListSchemaBundlesCallable; + + @Mock + private UnaryCallable + mockDeleteSchemaBundleCallable; + + @Mock + private UnaryCallable + mockGetIamPolicyCallable; + + @Mock + private UnaryCallable + mockSetIamPolicyCallable; + + @Mock + private UnaryCallable< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + mockTestIamPermissionsCallable; + + @Mock + private OperationCallable + mockOptimizeRestoredTableCallable; + + @Before + public void setUp() { + adminClient = BigtableTableAdminClient.create(PROJECT_ID, INSTANCE_ID, mockStub); + } + + @Test + public void testCreateTable() { + // Setup + Mockito.when(mockStub.createTableCallable()).thenReturn(mockCreateTableCallable); + + com.google.bigtable.admin.v2.CreateTableRequest expectedRequest = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setParent(INSTANCE_NAME) + .setTableId(TABLE_ID) + .setTable( + com.google.bigtable.admin.v2.Table.newBuilder() + .putColumnFamilies( + "cf1", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intSumType()) + .build()) + .putColumnFamilies( + "cf2", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intMinType()) + .build()) + .putColumnFamilies( + "cf3", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intMaxType()) + .build()) + .putColumnFamilies( + "cf4", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intHllType()) + .build())) + .build(); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(); + + Mockito.when(mockCreateTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Table result = + adminClient.createTable( + CreateTableRequest.of(TABLE_ID) + .addFamily("cf1", Type.int64Sum()) + .addFamily("cf2", Type.int64Min()) + .addFamily("cf3", Type.int64Max()) + .addFamily("cf4", Type.int64Hll())); + + // Verify + assertThat(result).isEqualTo(Table.fromProto(expectedResponse)); + } + + @Test + public void testCreateTableWithDeletionProtectionSet() { + // Setup + Mockito.when(mockStub.createTableCallable()).thenReturn(mockCreateTableCallable); + + com.google.bigtable.admin.v2.CreateTableRequest expectedRequest = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setParent(INSTANCE_NAME) + .setTableId(TABLE_ID) + .setTable( + com.google.bigtable.admin.v2.Table.newBuilder() + .setDeletionProtection(true) + .putColumnFamilies( + "cf1", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intSumType()) + .build())) + .build(); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(); + + Mockito.when(mockCreateTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Table result = + adminClient.createTable( + CreateTableRequest.of(TABLE_ID) + .addFamily("cf1", Type.int64Sum()) + .setDeletionProtection(true)); + + // Verify + assertThat(result).isEqualTo(Table.fromProto(expectedResponse)); + } + + @Test + public void testUpdateTable() { + // Setup + Mockito.when(mockStub.updateTableOperationCallable()) + .thenReturn(mockUpdateTableOperationCallable); + + com.google.cloud.bigtable.admin.v2.models.UpdateTableRequest request = + com.google.cloud.bigtable.admin.v2.models.UpdateTableRequest.of(TABLE_ID) + .addChangeStreamRetention(org.threeten.bp.Duration.ofHours(24)); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder() + .setName(TABLE_NAME) + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod(Duration.newBuilder().setSeconds(86400).build()) + .build()) + .build(); + + mockOperationResult( + mockUpdateTableOperationCallable, + request.toProto(PROJECT_ID, INSTANCE_ID), + expectedResponse, + UpdateTableMetadata.newBuilder().setName(TABLE_NAME).build()); + + // Execute + Table actualResult = adminClient.updateTable(request); + + // Verify + assertThat(actualResult.getId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getChangeStreamRetention()) + .isEqualTo(org.threeten.bp.Duration.ofHours(24)); + assertThat(actualResult.getChangeStreamRetention().toMillis()) + .isEqualTo(actualResult.getChangeStreamRetention().toMillis()); + } + + @Test + public void testModifyFamilies() { + // Setup + Mockito.when(mockStub.modifyColumnFamiliesCallable()).thenReturn(mockModifyTableCallable); + + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest expectedRequest = + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.newBuilder() + .setName(TABLE_NAME) + .addModifications( + Modification.newBuilder() + .setId("cf") + .setCreate(ColumnFamily.newBuilder().setGcRule(GcRule.getDefaultInstance()))) + .addModifications( + Modification.newBuilder() + .setId("cf2") + .setCreate( + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intSumType()))) + .build(); + + com.google.bigtable.admin.v2.Table fakeResponse = + com.google.bigtable.admin.v2.Table.newBuilder() + .setName(TABLE_NAME) + .putColumnFamilies( + "cf", ColumnFamily.newBuilder().setGcRule(GcRule.getDefaultInstance()).build()) + .putColumnFamilies( + "cf2", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(TypeProtos.intSumType()) + .build()) + .build(); + + Mockito.when(mockModifyTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(fakeResponse)); + + // Execute + Table actualResult = + adminClient.modifyFamilies( + ModifyColumnFamiliesRequest.of(TABLE_ID) + .addFamily("cf") + .addFamily("cf2", Type.int64Sum())); + + // Verify + assertThat(actualResult).isEqualTo(Table.fromProto(fakeResponse)); + } + + @Test + public void testDeleteTable() { + // Setup + Mockito.when(mockStub.deleteTableCallable()).thenReturn(mockDeleteTableCallable); + + DeleteTableRequest expectedRequest = + DeleteTableRequest.newBuilder().setName(TABLE_NAME).build(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDeleteTableCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + }); + + // Execute + adminClient.deleteTable(TABLE_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testGetTable() { + // Setup + Mockito.when(mockStub.getTableCallable()).thenReturn(mockGetTableCallable); + + GetTableRequest expectedRequest = + GetTableRequest.newBuilder().setName(TABLE_NAME).setView(View.SCHEMA_VIEW).build(); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(); + + Mockito.when(mockGetTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Table actualResult = adminClient.getTable(TABLE_ID); + + // Verify + assertThat(actualResult).isEqualTo(Table.fromProto(expectedResponse)); + } + + @Test + public void testGetEncryptionInfos() { + // Setup + Mockito.when(mockStub.getTableCallable()).thenReturn(mockGetTableCallable); + + GetTableRequest expectedRequest = + GetTableRequest.newBuilder().setName(TABLE_NAME).setView(View.ENCRYPTION_VIEW).build(); + + com.google.bigtable.admin.v2.EncryptionInfo expectedEncryptionInfo = + com.google.bigtable.admin.v2.EncryptionInfo.newBuilder() + .setKmsKeyVersion("some key") + .setEncryptionType( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType + .CUSTOMER_MANAGED_ENCRYPTION) + .setEncryptionStatus( + com.google.rpc.Status.newBuilder() + .setCode(Code.FAILED_PRECONDITION.value()) + .setMessage("something failed")) + .build(); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder() + .setName(TABLE_NAME) + .putClusterStates( + "cluster1", + ClusterState.newBuilder().addEncryptionInfo(expectedEncryptionInfo).build()) + .build(); + + Mockito.when(mockGetTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Map> actualResult = + adminClient.getEncryptionInfo(TABLE_ID); + + // Verify that the encryption info is transferred from the proto to the model. + assertThat(actualResult) + .containsExactly( + "cluster1", ImmutableList.of(EncryptionInfo.fromProto(expectedEncryptionInfo))); + } + + @Test + public void testListTables() { + // Setup + Mockito.when(mockStub.listTablesPagedCallable()).thenReturn(mockListTableCallable); + + com.google.bigtable.admin.v2.ListTablesRequest expectedRequest = + com.google.bigtable.admin.v2.ListTablesRequest.newBuilder() + .setParent(INSTANCE_NAME) + .build(); + + // 3 Tables spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME + i).build()); + } + // 2 on the first page + ListTablesPage page0 = Mockito.mock(ListTablesPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListTablesPage page1 = Mockito.mock(ListTablesPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListTablesPagedResponse response0 = Mockito.mock(ListTablesPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListTableCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listTables(); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.Table expectedProto : expectedProtos) { + expectedResults.add(TableName.parse(expectedProto.getName()).getTable()); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testDropRowRange() { + // Setup + Mockito.when(mockStub.dropRowRangeCallable()).thenReturn(mockDropRowRangeCallable); + + DropRowRangeRequest expectedRequest = + DropRowRangeRequest.newBuilder() + .setName(TABLE_NAME) + .setRowKeyPrefix(ByteString.copyFromUtf8("rowKeyPrefix")) + .build(); + + final Empty expectedResponse = Empty.getDefaultInstance(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDropRowRangeCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(expectedResponse); + }); + + // Execute + adminClient.dropRowRange(TABLE_ID, "rowKeyPrefix"); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + @Deprecated + public void testAwaitReplication() { + // Setup + Mockito.when(mockStub.awaitReplicationCallable()).thenReturn(mockAwaitReplicationCallable); + + TableName expectedRequest = TableName.parse(TABLE_NAME); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockAwaitReplicationCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(null); + }); + + // Execute + adminClient.awaitReplication(TABLE_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testAwaitConsistencyForDataBoost() { + // Setup + Mockito.when(mockStub.awaitConsistencyCallable()).thenReturn(mockAwaitConsistencyCallable); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(TABLE_ID); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockAwaitConsistencyCallable.futureCall(consistencyRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(null); + }); + + // Execute + adminClient.awaitConsistency(consistencyRequest); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testExistsTrue() { + // Setup + Mockito.when(mockStub.getTableCallable()).thenReturn(mockGetTableCallable); + + com.google.bigtable.admin.v2.Table expectedResponse = + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(); + + Mockito.when(mockGetTableCallable.futureCall(ArgumentMatchers.any(GetTableRequest.class))) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + boolean found = adminClient.exists(TABLE_ID); + + // Verify + assertThat(found).isTrue(); + } + + @Test + public void testExistsFalse() { + // Setup + Mockito.when(mockStub.getTableCallable()).thenReturn(mockGetTableCallable); + + NotFoundException exception = + new NotFoundException("fake error", null, GrpcStatusCode.of(Status.Code.NOT_FOUND), false); + + Mockito.when(mockGetTableCallable.futureCall(ArgumentMatchers.any(GetTableRequest.class))) + .thenReturn( + ApiFutures.immediateFailedFuture(exception)); + + // Execute + boolean found = adminClient.exists(TABLE_ID); + + // Verify + assertThat(found).isFalse(); + } + + @Test + public void testCreateBackup() { + // Setup + Mockito.when(mockStub.createBackupOperationCallable()) + .thenReturn(mockCreateBackupOperationCallable); + + String backupName = NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID); + Timestamp startTime = Timestamp.newBuilder().setSeconds(123).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(456).build(); + Timestamp expireTime = Timestamp.newBuilder().setSeconds(789).build(); + long sizeBytes = 123456789; + CreateBackupRequest req = + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + mockOperationResult( + mockCreateBackupOperationCallable, + req.toProto(PROJECT_ID, INSTANCE_ID), + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName(backupName) + .setSourceTable(TABLE_NAME) + .setStartTime(startTime) + .setEndTime(endTime) + .setExpireTime(expireTime) + .setSizeBytes(sizeBytes) + .build(), + CreateBackupMetadata.newBuilder() + .setName(backupName) + .setStartTime(startTime) + .setEndTime(endTime) + .setSourceTable(TABLE_NAME) + .build()); + // Execute + Backup actualResult = adminClient.createBackup(req); + + // Verify + assertThat(actualResult.getId()).isEqualTo(BACKUP_ID); + assertThat(actualResult.getSourceTableId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getStartTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(startTime))); + assertThat(actualResult.getEndTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(endTime))); + assertThat(actualResult.getExpireTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + assertThat(actualResult.getSizeBytes()).isEqualTo(sizeBytes); + } + + @Test + public void testCreateHotBackup() { + // Setup + Mockito.when(mockStub.createBackupOperationCallable()) + .thenReturn(mockCreateBackupOperationCallable); + + String backupName = NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID); + Timestamp startTime = Timestamp.newBuilder().setSeconds(123).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(456).build(); + Timestamp expireTime = Timestamp.newBuilder().setSeconds(789).build(); + Timestamp hotToStandardTime = Timestamp.newBuilder().setSeconds(500).build(); + long sizeBytes = 123456789; + CreateBackupRequest req = + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))) + .setBackupType(Backup.BackupType.HOT) + .setHotToStandardTime(Instant.ofEpochMilli(Timestamps.toMillis(hotToStandardTime))); + mockOperationResult( + mockCreateBackupOperationCallable, + req.toProto(PROJECT_ID, INSTANCE_ID), + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName(backupName) + .setSourceTable(TABLE_NAME) + .setStartTime(startTime) + .setEndTime(endTime) + .setExpireTime(expireTime) + .setSizeBytes(sizeBytes) + .setBackupType(com.google.bigtable.admin.v2.Backup.BackupType.HOT) + .setHotToStandardTime(hotToStandardTime) + .build(), + CreateBackupMetadata.newBuilder() + .setName(backupName) + .setStartTime(startTime) + .setEndTime(endTime) + .setSourceTable(TABLE_NAME) + .build()); + // Execute + Backup actualResult = adminClient.createBackup(req); + + // Verify + assertThat(actualResult.getId()).isEqualTo(BACKUP_ID); + assertThat(actualResult.getSourceTableId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getStartTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(startTime))); + assertThat(actualResult.getEndTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(endTime))); + assertThat(actualResult.getExpireTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + assertThat(actualResult.getBackupType()).isEqualTo(Backup.BackupType.HOT); + assertThat(actualResult.getHotToStandardTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(hotToStandardTime))); + assertThat(actualResult.getSizeBytes()).isEqualTo(sizeBytes); + } + + @Test + public void testGetBackup() { + // Setup + Mockito.when(mockStub.getBackupCallable()).thenReturn(mockGetBackupCallable); + + Timestamp expireTime = Timestamp.newBuilder().setSeconds(123456789).build(); + Timestamp startTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(5678).build(); + com.google.bigtable.admin.v2.Backup.State state = State.CREATING; + long sizeBytes = 12345L; + GetBackupRequest testRequest = + GetBackupRequest.newBuilder() + .setName(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .build(); + Mockito.when(mockGetBackupCallable.futureCall(testRequest)) + .thenReturn( + ApiFutures.immediateFuture( + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName( + NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setSourceTable(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setExpireTime(expireTime) + .setStartTime(startTime) + .setEndTime(endTime) + .setSizeBytes(sizeBytes) + .setState(state) + .setBackupType(com.google.bigtable.admin.v2.Backup.BackupType.STANDARD) + .build())); + + // Execute + Backup actualResult = adminClient.getBackup(CLUSTER_ID, BACKUP_ID); + + // Verify + assertThat(actualResult.getId()).isEqualTo(BACKUP_ID); + assertThat(actualResult.getSourceTableId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getExpireTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + assertThat(actualResult.getStartTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(startTime))); + assertThat(actualResult.getEndTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(endTime))); + assertThat(actualResult.getSizeBytes()).isEqualTo(sizeBytes); + assertThat(actualResult.getState()).isEqualTo(Backup.State.fromProto(state)); + assertThat(actualResult.getBackupType()).isEqualTo(Backup.BackupType.STANDARD); + } + + @Test + public void testUpdateBackup() { + // Setup + Mockito.when(mockStub.updateBackupCallable()).thenReturn(mockUpdateBackupCallable); + + Timestamp expireTime = Timestamp.newBuilder().setSeconds(123456789).build(); + Timestamp hotToStandardTime = Timestamp.newBuilder().setSeconds(123456789).build(); + long sizeBytes = 12345L; + UpdateBackupRequest req = UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID); + Mockito.when(mockUpdateBackupCallable.futureCall(req.toProto(PROJECT_ID, INSTANCE_ID))) + .thenReturn( + ApiFutures.immediateFuture( + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName( + NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setSourceTable(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setExpireTime(expireTime) + .setSizeBytes(sizeBytes) + .setHotToStandardTime(hotToStandardTime) + .build())); + + // Execute + Backup actualResult = adminClient.updateBackup(req); + + // Verify + assertThat(actualResult.getId()).isEqualTo(BACKUP_ID); + assertThat(actualResult.getSourceTableId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getExpireTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + assertThat(actualResult.getHotToStandardTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(hotToStandardTime))); + assertThat(actualResult.getSizeBytes()).isEqualTo(sizeBytes); + } + + @Test + public void testRestoreTable() throws ExecutionException, InterruptedException { + // Setup + Mockito.when(mockStub.restoreTableOperationCallable()) + .thenReturn(mockRestoreTableOperationCallable); + + Timestamp startTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(5678).build(); + String operationName = "my-operation"; + RestoreTableRequest req = RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + mockOperationResult( + mockRestoreTableOperationCallable, + req.toProto(PROJECT_ID, INSTANCE_ID), + com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(), + RestoreTableMetadata.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setOptimizeTableOperationName(operationName) + .setSourceType(RestoreSourceType.BACKUP) + .setBackupInfo( + BackupInfo.newBuilder() + .setBackup(BACKUP_ID) + .setSourceTable(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setStartTime(startTime) + .setEndTime(endTime) + .build()) + .build()); + // Execute + RestoredTableResult actualResult = adminClient.restoreTable(req); + + // Verify + assertThat(actualResult.getTable().getId()).isEqualTo(TABLE_ID); + } + + @Test + public void testRestoreTableCrossProject() throws ExecutionException, InterruptedException { + // Setup + Mockito.when(mockStub.restoreTableOperationCallable()) + .thenReturn(mockRestoreTableOperationCallable); + + Timestamp startTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(5678).build(); + String operationName = "my-operation"; + + // Use existing adminClient as destination project: + String dstProjectId = PROJECT_ID; + String dstInstanceId = INSTANCE_ID; + String dstTableName = TABLE_NAME; + + // Create RestoreTableRequest from different source project: + String srcProjectId = "src-project"; + String srcInstanceId = "src-instance"; + String srcClusterId = "src-cluster"; + + RestoreTableRequest req = + RestoreTableRequest.of(srcInstanceId, srcClusterId, BACKUP_ID, srcProjectId) + .setTableId(TABLE_ID); + mockOperationResult( + mockRestoreTableOperationCallable, + req.toProto(dstProjectId, dstInstanceId), + com.google.bigtable.admin.v2.Table.newBuilder().setName(dstTableName).build(), + RestoreTableMetadata.newBuilder() + .setName(dstTableName) + .setOptimizeTableOperationName(operationName) + .setSourceType(RestoreSourceType.BACKUP) + .setBackupInfo( + BackupInfo.newBuilder() + .setBackup(BACKUP_ID) + .setSourceTable(NameUtil.formatTableName(srcProjectId, srcInstanceId, TABLE_ID)) + .setStartTime(startTime) + .setEndTime(endTime) + .build()) + .build()); + + // Execute + RestoredTableResult actualResult = adminClient.restoreTable(req); + + // Verify + assertThat(actualResult.getTable().getId()).isEqualTo(TABLE_ID); + assertThat(actualResult.getTable().getInstanceId()).isEqualTo(dstInstanceId); + } + + @Test + public void testDeleteBackup() { + // Setup + Mockito.when(mockStub.deleteBackupCallable()).thenReturn(mockDeleteBackupCallable); + + DeleteBackupRequest testRequest = + DeleteBackupRequest.newBuilder() + .setName(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .build(); + Mockito.when(mockDeleteBackupCallable.futureCall(testRequest)) + .thenReturn(ApiFutures.immediateFuture(Empty.getDefaultInstance())); + + // Execute + adminClient.deleteBackup(CLUSTER_ID, BACKUP_ID); + + // Verify + Mockito.verify(mockDeleteBackupCallable, Mockito.times(1)).futureCall(testRequest); + } + + @Test + public void testListBackups() { + // Setup + Mockito.when(mockStub.listBackupsPagedCallable()).thenReturn(mockListBackupCallable); + + com.google.bigtable.admin.v2.ListBackupsRequest testRequest = + com.google.bigtable.admin.v2.ListBackupsRequest.newBuilder() + .setParent(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .build(); + + // 3 Backups spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName( + NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID + i)) + .build()); + } + + // 2 on the first page + ListBackupsPage page0 = Mockito.mock(ListBackupsPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListBackupsPage page1 = Mockito.mock(ListBackupsPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListBackupsPagedResponse response0 = Mockito.mock(ListBackupsPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListBackupCallable.futureCall(testRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listBackups(CLUSTER_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.Backup expectedProto : expectedProtos) { + expectedResults.add(NameUtil.extractBackupIdFromBackupName(expectedProto.getName())); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testCopyBackup() { + // Setup + Mockito.when(mockStub.copyBackupOperationCallable()) + .thenReturn(mockCopyBackupOperationCallable); + + Timestamp startTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(5678).build(); + + // Create CopyBackupRequest from different source project: + String srcProjectId = "src-project"; + String srcInstanceId = "src-instance"; + String srcTableId = "src-table"; + String srcClusterId = "src-cluster"; + String srcBackupId = "src-backup"; + + Instant expireTime = Instant.now().plus(org.threeten.bp.Duration.ofDays(15)); + long sizeBytes = 123456789; + + String dstBackupName = + NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID); + String srcBackupName = + NameUtil.formatBackupName(srcProjectId, srcProjectId, srcClusterId, srcBackupId); + String srcTableName = NameUtil.formatTableName(srcProjectId, srcInstanceId, srcTableId); + + CopyBackupRequest req = + CopyBackupRequest.of(srcClusterId, srcBackupId) + .setSourceInstance(srcProjectId, srcInstanceId) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(expireTime); + mockOperationResult( + mockCopyBackupOperationCallable, + req.toProto(PROJECT_ID, INSTANCE_ID), + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName(dstBackupName) + .setSourceTable(srcTableName) + .setSourceBackup(srcBackupName) + .setStartTime(startTime) + .setEndTime(endTime) + .setExpireTime(Timestamps.fromMillis(expireTime.toEpochMilli())) + .setSizeBytes(sizeBytes) + .build(), + CopyBackupMetadata.newBuilder() + .setName(dstBackupName) + .setSourceBackupInfo( + BackupInfo.newBuilder() + .setBackup(srcBackupId) + .setSourceTable(srcTableName) + .setStartTime(startTime) + .setEndTime(endTime) + .build()) + .build()); + + // Execute + Backup actualResult = adminClient.copyBackup(req); + + // Verify + assertThat(actualResult.getId()).isEqualTo(BACKUP_ID); + assertThat(actualResult.getSourceTableId()).isEqualTo(srcTableId); + assertThat(actualResult.getSourceBackupId()).isEqualTo(srcBackupId); + assertThat(actualResult.getStartTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(startTime))); + assertThat(actualResult.getEndTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(endTime))); + assertThat(actualResult.getExpireTime()).isEqualTo(expireTime); + assertThat(actualResult.getSizeBytes()).isEqualTo(sizeBytes); + } + + @Test + public void testCreateAuthorizedView() { + // Setup + Mockito.when(mockStub.createAuthorizedViewOperationCallable()) + .thenReturn(mockCreateAuthorizedViewOperationCallable); + + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest expectedRequest = + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAuthorizedViewId(AUTHORIZED_VIEW_ID) + .setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .build()) + .setDeletionProtection(true) + .build()) + .build(); + + com.google.bigtable.admin.v2.AuthorizedView expectedResponse = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .build()) + .setDeletionProtection(true) + .build(); + + mockOperationResult( + mockCreateAuthorizedViewOperationCallable, + expectedRequest, + expectedResponse, + CreateAuthorizedViewMetadata.newBuilder().setOriginalRequest(expectedRequest).build()); + + CreateAuthorizedViewRequest req = + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setDeletionProtection(true) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")); + + // Execute + AuthorizedView actualResult = adminClient.createAuthorizedView(req); + + // Verify + assertThat(actualResult).isEqualTo(AuthorizedView.fromProto(expectedResponse)); + } + + @Test + public void testUpdateAuthorizedView() { + // Setup + Mockito.when(mockStub.updateAuthorizedViewOperationCallable()) + .thenReturn(mockUpdateAuthorizedViewOperationCallable); + + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .build()) + .setDeletionProtection(true) + .build()) + .setUpdateMask( + FieldMask.newBuilder().addPaths("deletion_protection").addPaths("subset_view")) + .build(); + + com.google.bigtable.admin.v2.AuthorizedView expectedResponse = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .build()) + .setDeletionProtection(true) + .build(); + + mockOperationResult( + mockUpdateAuthorizedViewOperationCallable, + expectedRequest, + expectedResponse, + UpdateAuthorizedViewMetadata.newBuilder().setOriginalRequest(expectedRequest).build()); + + UpdateAuthorizedViewRequest req = + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setDeletionProtection(true) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")); + + // Execute + AuthorizedView actualResult = adminClient.updateAuthorizedView(req); + + // Verify + assertThat(actualResult).isEqualTo(AuthorizedView.fromProto(expectedResponse)); + } + + @Test + public void testGetAuthorizedView() { + // Setup + Mockito.when(mockStub.getAuthorizedViewCallable()).thenReturn(mockGetAuthorizedViewCallable); + + com.google.bigtable.admin.v2.GetAuthorizedViewRequest expectedRequest = + com.google.bigtable.admin.v2.GetAuthorizedViewRequest.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .build(); + + com.google.bigtable.admin.v2.AuthorizedView expectedResponse = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .build()) + .setDeletionProtection(true) + .build(); + + Mockito.when(mockGetAuthorizedViewCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + AuthorizedView actualResult = adminClient.getAuthorizedView(TABLE_ID, AUTHORIZED_VIEW_ID); + + // Verify + assertThat(actualResult).isEqualTo(AuthorizedView.fromProto(expectedResponse)); + } + + @Test + public void testListAuthorizedViews() { + // Setup + Mockito.when(mockStub.listAuthorizedViewsPagedCallable()) + .thenReturn(mockListAuthorizedViewsCallable); + + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest expectedRequest = + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .build(); + + // 3 AuthorizedViews spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID + i)) + .build()); + } + + // 2 on the first page + ListAuthorizedViewsPage page0 = Mockito.mock(ListAuthorizedViewsPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListAuthorizedViewsPage page1 = Mockito.mock(ListAuthorizedViewsPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListAuthorizedViewsPagedResponse response0 = + Mockito.mock(ListAuthorizedViewsPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListAuthorizedViewsCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listAuthorizedViews(TABLE_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.AuthorizedView expectedProto : expectedProtos) { + expectedResults.add(AuthorizedViewName.parse(expectedProto.getName()).getAuthorizedView()); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testDeleteAuthorizedView() { + // Setup + Mockito.when(mockStub.deleteAuthorizedViewCallable()) + .thenReturn(mockDeleteAuthorizedViewCallable); + + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .build(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDeleteAuthorizedViewCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + }); + + // Execute + adminClient.deleteAuthorizedView(TABLE_ID, AUTHORIZED_VIEW_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testCreateSchemaBundle() throws IOException, URISyntaxException { + // Setup + Mockito.when(mockStub.createSchemaBundleOperationCallable()) + .thenReturn(mockCreateSchemaBundleOperationCallable); + byte[] content = Files.readAllBytes(Paths.get(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + com.google.bigtable.admin.v2.CreateSchemaBundleRequest expectedRequest = + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setSchemaBundleId(SCHEMA_BUNDLE_ID) + .setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content)))) + .build(); + + com.google.bigtable.admin.v2.SchemaBundle expectedResponse = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content))) + .build(); + + mockOperationResult( + mockCreateSchemaBundleOperationCallable, + expectedRequest, + expectedResponse, + CreateSchemaBundleMetadata.newBuilder() + .setName(expectedRequest.getSchemaBundle().getName()) + .build()); + + CreateSchemaBundleRequest req = + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + // Execute + SchemaBundle actualResult = adminClient.createSchemaBundle(req); + + // Verify + assertThat(actualResult).isEqualTo(SchemaBundle.fromProto(expectedResponse)); + } + + @Test + public void testUpdateSchemaBundle() throws IOException, URISyntaxException { + // Setup + Mockito.when(mockStub.updateSchemaBundleOperationCallable()) + .thenReturn(mockUpdateSchemaBundleOperationCallable); + byte[] content = + Files.readAllBytes(Paths.get(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE))); + + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest expectedRequest = + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder() + .setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content))) + .build()) + .setUpdateMask(FieldMask.newBuilder().addPaths("proto_schema")) + .build(); + + com.google.bigtable.admin.v2.SchemaBundle expectedResponse = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content))) + .build(); + + mockOperationResult( + mockUpdateSchemaBundleOperationCallable, + expectedRequest, + expectedResponse, + UpdateSchemaBundleMetadata.newBuilder() + .setName(expectedRequest.getSchemaBundle().getName()) + .build()); + + UpdateSchemaBundleRequest req = + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)); + + // Execute + SchemaBundle actualResult = adminClient.updateSchemaBundle(req); + + // Verify + assertThat(actualResult).isEqualTo(SchemaBundle.fromProto(expectedResponse)); + } + + @Test + public void testGetSchemaBundle() { + // Setup + Mockito.when(mockStub.getSchemaBundleCallable()).thenReturn(mockGetSchemaBundleCallable); + + com.google.bigtable.admin.v2.GetSchemaBundleRequest expectedRequest = + com.google.bigtable.admin.v2.GetSchemaBundleRequest.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .build(); + + com.google.bigtable.admin.v2.SchemaBundle expectedResponse = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema"))) + .build(); + + Mockito.when(mockGetSchemaBundleCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + SchemaBundle actualResult = adminClient.getSchemaBundle(TABLE_ID, SCHEMA_BUNDLE_ID); + + // Verify + assertThat(actualResult).isEqualTo(SchemaBundle.fromProto(expectedResponse)); + } + + @Test + public void testListSchemaBundles() { + // Setup + Mockito.when(mockStub.listSchemaBundlesPagedCallable()) + .thenReturn(mockListSchemaBundlesCallable); + + com.google.bigtable.admin.v2.ListSchemaBundlesRequest expectedRequest = + com.google.bigtable.admin.v2.ListSchemaBundlesRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .build(); + + // 3 SchemaBundles spread across 2 pages + List expectedProtos = Lists.newArrayList(); + for (int i = 0; i < 3; i++) { + expectedProtos.add( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID + i)) + .build()); + } + + // 2 on the first page + ListSchemaBundlesPage page0 = Mockito.mock(ListSchemaBundlesPage.class); + Mockito.when(page0.getValues()).thenReturn(expectedProtos.subList(0, 2)); + Mockito.when(page0.hasNextPage()).thenReturn(true); + + // 1 on the last page + ListSchemaBundlesPage page1 = Mockito.mock(ListSchemaBundlesPage.class); + Mockito.when(page1.getValues()).thenReturn(expectedProtos.subList(2, 3)); + + // Link page0 to page1 + Mockito.when(page0.getNextPageAsync()).thenReturn(ApiFutures.immediateFuture(page1)); + + // Link page to the response + ListSchemaBundlesPagedResponse response0 = Mockito.mock(ListSchemaBundlesPagedResponse.class); + Mockito.when(response0.getPage()).thenReturn(page0); + + Mockito.when(mockListSchemaBundlesCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(response0)); + + // Execute + List actualResults = adminClient.listSchemaBundles(TABLE_ID); + + // Verify + List expectedResults = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.SchemaBundle expectedProto : expectedProtos) { + expectedResults.add(SchemaBundleName.parse(expectedProto.getName()).getSchemaBundle()); + } + + assertThat(actualResults).containsExactlyElementsIn(expectedResults); + } + + @Test + public void testDeleteSchemaBundle() { + // Setup + Mockito.when(mockStub.deleteSchemaBundleCallable()).thenReturn(mockDeleteSchemaBundleCallable); + + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest expectedRequest = + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .build(); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockDeleteSchemaBundleCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + }); + + // Execute + adminClient.deleteSchemaBundle(TABLE_ID, SCHEMA_BUNDLE_ID); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testGetBackupIamPolicy() { + // Setup + Mockito.when(mockStub.getIamPolicyCallable()).thenReturn(mockGetIamPolicyCallable); + + com.google.iam.v1.GetIamPolicyRequest expectedRequest = + com.google.iam.v1.GetIamPolicyRequest.newBuilder() + .setResource(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .build(); + + com.google.iam.v1.Policy expectedResponse = + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.viewer") + .addMembers("user:someone@example.com")) + .setEtag(ByteString.copyFromUtf8("my-etag")) + .build(); + + Mockito.when(mockGetIamPolicyCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Policy actualResult = adminClient.getBackupIamPolicy(CLUSTER_ID, BACKUP_ID); + + // Verify + assertThat(actualResult) + .isEqualTo( + Policy.newBuilder() + .addIdentity(Role.of("bigtable.viewer"), Identity.user("someone@example.com")) + .setEtag(BaseEncoding.base64().encode("my-etag".getBytes(StandardCharsets.UTF_8))) + .build()); + } + + @Test + public void testSetIamPolicy() { + // Setup + Mockito.when(mockStub.setIamPolicyCallable()).thenReturn(mockSetIamPolicyCallable); + + com.google.iam.v1.SetIamPolicyRequest expectedRequest = + com.google.iam.v1.SetIamPolicyRequest.newBuilder() + .setResource(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setPolicy( + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.viewer") + .addMembers("user:someone@example.com"))) + .build(); + + com.google.iam.v1.Policy expectedResponse = + com.google.iam.v1.Policy.newBuilder() + .addBindings( + com.google.iam.v1.Binding.newBuilder() + .setRole("roles/bigtable.viewer") + .addMembers("user:someone@example.com")) + .setEtag(ByteString.copyFromUtf8("my-etag")) + .build(); + + Mockito.when(mockSetIamPolicyCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + Policy actualResult = + adminClient.setBackupIamPolicy( + CLUSTER_ID, + BACKUP_ID, + Policy.newBuilder() + .addIdentity(Role.of("bigtable.viewer"), Identity.user("someone@example.com")) + .build()); + + // Verify + assertThat(actualResult) + .isEqualTo( + Policy.newBuilder() + .addIdentity(Role.of("bigtable.viewer"), Identity.user("someone@example.com")) + .setEtag(BaseEncoding.base64().encode("my-etag".getBytes(StandardCharsets.UTF_8))) + .build()); + } + + @Test + public void testTestIamPermissions() { + // Setup + Mockito.when(mockStub.testIamPermissionsCallable()).thenReturn(mockTestIamPermissionsCallable); + + com.google.iam.v1.TestIamPermissionsRequest expectedRequest = + com.google.iam.v1.TestIamPermissionsRequest.newBuilder() + .setResource(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .addPermissions("bigtable.backups.get") + .build(); + + com.google.iam.v1.TestIamPermissionsResponse expectedResponse = + com.google.iam.v1.TestIamPermissionsResponse.newBuilder() + .addPermissions("bigtable.backups.get") + .build(); + + Mockito.when(mockTestIamPermissionsCallable.futureCall(expectedRequest)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // Execute + List actualResult = + adminClient.testBackupIamPermission(CLUSTER_ID, BACKUP_ID, "bigtable.backups.get"); + + // Verify + assertThat(actualResult).containsExactly("bigtable.backups.get"); + } + + @Test + public void testWaitForConsistencyWithToken() { + // Setup + Mockito.when(mockStub.awaitConsistencyCallable()).thenReturn(mockAwaitConsistencyCallable); + + String token = "my-token"; + ConsistencyRequest expectedRequest = ConsistencyRequest.forReplication(TABLE_ID, token); + + final AtomicBoolean wasCalled = new AtomicBoolean(false); + + Mockito.when(mockAwaitConsistencyCallable.futureCall(expectedRequest)) + .thenAnswer( + (Answer>) + invocationOnMock -> { + wasCalled.set(true); + return ApiFutures.immediateFuture(null); + }); + + // Execute + adminClient.waitForConsistency(TABLE_ID, token); + + // Verify + assertThat(wasCalled.get()).isTrue(); + } + + @Test + public void testAwaitOptimizeRestoredTable() throws Exception { + // Setup + Mockito.when(mockStub.awaitOptimizeRestoredTableCallable()) + .thenReturn(mockOptimizeRestoredTableCallable); + + String optimizeToken = "my-optimization-token"; + + // 1. Mock the Token + OptimizeRestoredTableOperationToken mockToken = + Mockito.mock(OptimizeRestoredTableOperationToken.class); + Mockito.when(mockToken.getOperationName()).thenReturn(optimizeToken); + + // 2. Mock the Result (wrapping the token) + RestoredTableResult mockResult = Mockito.mock(RestoredTableResult.class); + Mockito.when(mockResult.getOptimizeRestoredTableOperationToken()).thenReturn(mockToken); + + // 3. Mock the Input Future (returning the result) + ApiFuture mockRestoreFuture = Mockito.mock(ApiFuture.class); + Mockito.when(mockRestoreFuture.get()).thenReturn(mockResult); + + // 4. Mock the Stub's behavior (resuming the Optimize Op) + OperationFuture mockOptimizeOp = + Mockito.mock(OperationFuture.class); + Mockito.when(mockOptimizeRestoredTableCallable.resumeFutureCall(optimizeToken)) + .thenReturn(mockOptimizeOp); + + // Execute + ApiFuture result = adminClient.awaitOptimizeRestoredTable(mockRestoreFuture); + + // Verify + assertThat(result).isEqualTo(mockOptimizeOp); + Mockito.verify(mockOptimizeRestoredTableCallable).resumeFutureCall(optimizeToken); + } + + @Ignore("TODO: fix this test") + @Test + public void testAwaitOptimizeRestoredTable_NoOp() throws Exception { + // Setup: Result with NO optimization token (null or empty) + RestoredTableResult mockResult = Mockito.mock(RestoredTableResult.class); + Mockito.when(mockResult.getOptimizeRestoredTableOperationToken()).thenReturn(null); + + // Mock the Input Future + ApiFuture mockRestoreFuture = Mockito.mock(ApiFuture.class); + Mockito.when(mockRestoreFuture.get()).thenReturn(mockResult); + + // Execute + ApiFuture result = adminClient.awaitOptimizeRestoredTable(mockRestoreFuture); + + // Verify: Returns immediate success (Empty) without calling the stub + assertThat(result.get()).isEqualTo(Empty.getDefaultInstance()); + } + + private void mockOperationResult( + OperationCallable callable, + ReqT request, + RespT response, + MetaT metadata) { + OperationSnapshot operationSnapshot = + FakeOperationSnapshot.newBuilder() + .setDone(true) + .setErrorCode(GrpcStatusCode.of(Code.OK)) + .setName("fake-name") + .setResponse(response) + .setMetadata(metadata) + .build(); + OperationFuture operationFuture = + OperationFutures.immediateOperationFuture(operationSnapshot); + Mockito.when(callable.futureCall(request)).thenReturn(operationFuture); + } + + private String getResourceFilePath(String filePath) throws URISyntaxException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL protoSchema = cl.getResource(filePath); + return Paths.get(protoSchema.toURI()).toAbsolutePath().toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java new file mode 100644 index 000000000000..0aac3b8c99d3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java @@ -0,0 +1,206 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; + +@RunWith(JUnit4.class) +public class BigtableTableAdminSettingsTest { + + @Test + public void testInstanceName() throws IOException { + BigtableTableAdminSettings.Builder builder = + BigtableTableAdminSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance"); + + assertThat(builder.getProjectId()).isEqualTo("my-project"); + assertThat(builder.getInstanceId()).isEqualTo("my-instance"); + assertThat(builder.build().getProjectId()).isEqualTo("my-project"); + assertThat(builder.build().getInstanceId()).isEqualTo("my-instance"); + assertThat(builder.build().toBuilder().getProjectId()).isEqualTo("my-project"); + assertThat(builder.build().toBuilder().getInstanceId()).isEqualTo("my-instance"); + } + + @Test + public void testMissingInstanceName() { + Exception actualException = null; + + try { + BigtableTableAdminSettings.newBuilder().build(); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(NullPointerException.class); + } + + @Test + public void testCredentials() throws IOException { + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + + BigtableTableAdminSettings settings = + BigtableTableAdminSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setCredentialsProvider(credentialsProvider) + .build(); + + assertThat(settings.getCredentialsProvider()).isSameInstanceAs(credentialsProvider); + assertThat(settings.getStubSettings().getCredentialsProvider()) + .isSameInstanceAs(credentialsProvider); + assertThat(settings.toBuilder().getCredentialsProvider()).isSameInstanceAs(credentialsProvider); + assertThat(settings.toBuilder().build().getCredentialsProvider()) + .isSameInstanceAs(credentialsProvider); + } + + @Test + public void testStubSettings() throws IOException { + BigtableTableAdminSettings.Builder builder = + BigtableTableAdminSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance"); + + builder.stubSettings().createTableSettings().setRetryableCodes(Code.INVALID_ARGUMENT); + + assertThat(builder.build().getStubSettings().createTableSettings().getRetryableCodes()) + .containsExactly(Code.INVALID_ARGUMENT); + + assertThat( + builder.build().toBuilder() + .build() + .getStubSettings() + .createTableSettings() + .getRetryableCodes()) + .containsExactly(Code.INVALID_ARGUMENT); + } + + static final String[] SETTINGS_LIST = { + "createTableSettings", + "createTableFromSnapshotSettings", + "createTableFromSnapshotOperationSettings", + "listTablesSettings", + "getTableSettings", + "deleteTableSettings", + "modifyColumnFamiliesSettings", + "dropRowRangeSettings", + "generateConsistencyTokenSettings", + "checkConsistencySettings", + "getIamPolicySettings", + "setIamPolicySettings", + "testIamPermissionsSettings", + "snapshotTableSettings", + "snapshotTableOperationSettings", + "getSnapshotSettings", + "listSnapshotsSettings", + "deleteSnapshotSettings", + "createBackupSettings", + "createBackupOperationSettings", + "getBackupSettings", + "listBackupsSettings", + "updateBackupSettings", + "deleteBackupSettings", + "restoreTableSettings", + "restoreTableOperationSettings", + "undeleteTableSettings", + "undeleteTableOperationSettings", + "updateTableSettings", + "updateTableOperationSettings", + "copyBackupSettings", + "copyBackupOperationSettings", + "createAuthorizedViewSettings", + "createAuthorizedViewOperationSettings", + "updateAuthorizedViewSettings", + "updateAuthorizedViewOperationSettings", + "deleteAuthorizedViewSettings", + "listAuthorizedViewsSettings", + "getAuthorizedViewSettings", + "createSchemaBundleSettings", + "createSchemaBundleOperationSettings", + "updateSchemaBundleSettings", + "updateSchemaBundleOperationSettings", + "getSchemaBundleSettings", + "listSchemaBundlesSettings", + "deleteSchemaBundleSettings" + }; + + @Test + public void testToString() throws IOException { + BigtableTableAdminSettings defaultSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId("our-project-85") + .setInstanceId("our-instance-06") + .build(); + + checkToString(defaultSettings); + + BigtableTableAdminSettings.Builder builder = defaultSettings.toBuilder(); + BigtableTableAdminStubSettings.Builder stubSettings = + builder.stubSettings().setEndpoint("example.com:1234"); + + stubSettings + .getBackupSettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMinutes(812)) + .build()); + + BigtableTableAdminSettings settings = builder.build(); + checkToString(settings); + assertThat(defaultSettings.toString()).doesNotContain("endpoint=example.com:1234"); + assertThat(settings.toString()).contains("endpoint=example.com:1234"); + assertThat(defaultSettings.toString()).doesNotContain("totalTimeoutDuration=PT13H32M"); + assertThat(settings.toString()).contains("totalTimeoutDuration=PT13H32M"); + + List nonStaticFields = + Arrays.stream(BigtableTableAdminStubSettings.class.getDeclaredFields()) + .filter(field -> !Modifier.isStatic(field.getModifiers())) + .map(Field::getName) + .collect(Collectors.toList()); + + // failure will signal about adding a new settings property + assertThat(nonStaticFields).containsExactlyElementsIn(SETTINGS_LIST); + } + + void checkToString(BigtableTableAdminSettings settings) { + String projectId = settings.getProjectId(); + String instanceId = settings.getInstanceId(); + String toString = settings.toString(); + assertThat(toString).isEqualTo(settings.toString()); // no variety + assertThat(toString) + .startsWith( + "BigtableTableAdminSettings{projectId=" + projectId + ", instanceId=" + instanceId); + for (String subSettings : SETTINGS_LIST) { + assertThat(toString).contains(subSettings + "="); + } + assertThat(toString).contains(settings.getStubSettings().toString()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java new file mode 100644 index 000000000000..643504c3c802 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockBigtableInstanceAdmin implements MockGrpcService { + private final MockBigtableInstanceAdminImpl serviceImpl; + + public MockBigtableInstanceAdmin() { + serviceImpl = new MockBigtableInstanceAdminImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java new file mode 100644 index 000000000000..7a1d8d08a092 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java @@ -0,0 +1,756 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.BetaApi; +import com.google.bigtable.admin.v2.AppProfile; +import com.google.bigtable.admin.v2.BigtableInstanceAdminGrpc.BigtableInstanceAdminImplBase; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateAppProfileRequest; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.CreateLogicalViewRequest; +import com.google.bigtable.admin.v2.CreateMaterializedViewRequest; +import com.google.bigtable.admin.v2.DeleteAppProfileRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.DeleteLogicalViewRequest; +import com.google.bigtable.admin.v2.DeleteMaterializedViewRequest; +import com.google.bigtable.admin.v2.GetAppProfileRequest; +import com.google.bigtable.admin.v2.GetClusterRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.GetLogicalViewRequest; +import com.google.bigtable.admin.v2.GetMaterializedViewRequest; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListAppProfilesRequest; +import com.google.bigtable.admin.v2.ListAppProfilesResponse; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListHotTabletsRequest; +import com.google.bigtable.admin.v2.ListHotTabletsResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.ListLogicalViewsRequest; +import com.google.bigtable.admin.v2.ListLogicalViewsResponse; +import com.google.bigtable.admin.v2.ListMaterializedViewsRequest; +import com.google.bigtable.admin.v2.ListMaterializedViewsResponse; +import com.google.bigtable.admin.v2.LogicalView; +import com.google.bigtable.admin.v2.MaterializedView; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.bigtable.admin.v2.UpdateAppProfileRequest; +import com.google.bigtable.admin.v2.UpdateLogicalViewRequest; +import com.google.bigtable.admin.v2.UpdateMaterializedViewRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockBigtableInstanceAdminImpl extends BigtableInstanceAdminImplBase { + private List requests; + private Queue responses; + + public MockBigtableInstanceAdminImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createInstance( + CreateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext(((ListInstancesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListInstances, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateInstance(Instance request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext(((Instance) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void partialUpdateInstance( + PartialUpdateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PartialUpdateInstance, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstance, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCluster( + CreateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCluster(GetClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Cluster) { + requests.add(request); + responseObserver.onNext(((Cluster) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Cluster.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listClusters( + ListClustersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClustersResponse) { + requests.add(request); + responseObserver.onNext(((ListClustersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListClusters, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClustersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCluster(Cluster request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void partialUpdateCluster( + PartialUpdateClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PartialUpdateCluster, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCluster(DeleteClusterRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCluster, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAppProfile( + CreateAppProfileRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AppProfile) { + requests.add(request); + responseObserver.onNext(((AppProfile) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAppProfile, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AppProfile.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAppProfile( + GetAppProfileRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AppProfile) { + requests.add(request); + responseObserver.onNext(((AppProfile) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAppProfile, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AppProfile.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAppProfiles( + ListAppProfilesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAppProfilesResponse) { + requests.add(request); + responseObserver.onNext(((ListAppProfilesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAppProfiles, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAppProfilesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAppProfile( + UpdateAppProfileRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateAppProfile, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAppProfile( + DeleteAppProfileRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAppProfile, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listHotTablets( + ListHotTabletsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListHotTabletsResponse) { + requests.add(request); + responseObserver.onNext(((ListHotTabletsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListHotTablets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListHotTabletsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createLogicalView( + CreateLogicalViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateLogicalView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLogicalView( + GetLogicalViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogicalView) { + requests.add(request); + responseObserver.onNext(((LogicalView) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLogicalView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogicalView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listLogicalViews( + ListLogicalViewsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLogicalViewsResponse) { + requests.add(request); + responseObserver.onNext(((ListLogicalViewsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLogicalViews, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLogicalViewsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateLogicalView( + UpdateLogicalViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateLogicalView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteLogicalView( + DeleteLogicalViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteLogicalView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createMaterializedView( + CreateMaterializedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateMaterializedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getMaterializedView( + GetMaterializedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof MaterializedView) { + requests.add(request); + responseObserver.onNext(((MaterializedView) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetMaterializedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + MaterializedView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMaterializedViews( + ListMaterializedViewsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMaterializedViewsResponse) { + requests.add(request); + responseObserver.onNext(((ListMaterializedViewsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListMaterializedViews, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + ListMaterializedViewsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateMaterializedView( + UpdateMaterializedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateMaterializedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteMaterializedView( + DeleteMaterializedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteMaterializedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java new file mode 100644 index 000000000000..384f5a2d8750 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockBigtableTableAdmin implements MockGrpcService { + private final MockBigtableTableAdminImpl serviceImpl; + + public MockBigtableTableAdmin() { + serviceImpl = new MockBigtableTableAdminImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java new file mode 100644 index 000000000000..a2fe476ea70c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java @@ -0,0 +1,844 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2; + +import com.google.api.core.BetaApi; +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.bigtable.admin.v2.Backup; +import com.google.bigtable.admin.v2.BigtableTableAdminGrpc.BigtableTableAdminImplBase; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.CreateBackupRequest; +import com.google.bigtable.admin.v2.CreateSchemaBundleRequest; +import com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest; +import com.google.bigtable.admin.v2.DeleteBackupRequest; +import com.google.bigtable.admin.v2.DeleteSchemaBundleRequest; +import com.google.bigtable.admin.v2.DeleteSnapshotRequest; +import com.google.bigtable.admin.v2.DeleteTableRequest; +import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.GetAuthorizedViewRequest; +import com.google.bigtable.admin.v2.GetBackupRequest; +import com.google.bigtable.admin.v2.GetSchemaBundleRequest; +import com.google.bigtable.admin.v2.GetSnapshotRequest; +import com.google.bigtable.admin.v2.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsResponse; +import com.google.bigtable.admin.v2.ListBackupsRequest; +import com.google.bigtable.admin.v2.ListBackupsResponse; +import com.google.bigtable.admin.v2.ListSchemaBundlesRequest; +import com.google.bigtable.admin.v2.ListSchemaBundlesResponse; +import com.google.bigtable.admin.v2.ListSnapshotsRequest; +import com.google.bigtable.admin.v2.ListSnapshotsResponse; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ListTablesResponse; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.RestoreTableRequest; +import com.google.bigtable.admin.v2.SchemaBundle; +import com.google.bigtable.admin.v2.Snapshot; +import com.google.bigtable.admin.v2.SnapshotTableRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.bigtable.admin.v2.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; +import com.google.bigtable.admin.v2.UpdateBackupRequest; +import com.google.bigtable.admin.v2.UpdateSchemaBundleRequest; +import com.google.bigtable.admin.v2.UpdateTableRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockBigtableTableAdminImpl extends BigtableTableAdminImplBase { + private List requests; + private Queue responses; + + public MockBigtableTableAdminImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createTable(CreateTableRequest request, StreamObserver
responseObserver) { + Object response = responses.poll(); + if (response instanceof Table) { + requests.add(request); + responseObserver.onNext(((Table) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createTableFromSnapshot( + CreateTableFromSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTableFromSnapshot, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTables( + ListTablesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTablesResponse) { + requests.add(request); + responseObserver.onNext(((ListTablesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTables, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTablesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTable(GetTableRequest request, StreamObserver
responseObserver) { + Object response = responses.poll(); + if (response instanceof Table) { + requests.add(request); + responseObserver.onNext(((Table) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateTable(UpdateTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTable(DeleteTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeleteTable( + UndeleteTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeleteTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAuthorizedView( + CreateAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAuthorizedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAuthorizedViews( + ListAuthorizedViewsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAuthorizedViewsResponse) { + requests.add(request); + responseObserver.onNext(((ListAuthorizedViewsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAuthorizedViews, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAuthorizedViewsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAuthorizedView( + GetAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AuthorizedView) { + requests.add(request); + responseObserver.onNext(((AuthorizedView) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAuthorizedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AuthorizedView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAuthorizedView( + UpdateAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateAuthorizedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAuthorizedView( + DeleteAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAuthorizedView, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void modifyColumnFamilies( + ModifyColumnFamiliesRequest request, StreamObserver
responseObserver) { + Object response = responses.poll(); + if (response instanceof Table) { + requests.add(request); + responseObserver.onNext(((Table) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ModifyColumnFamilies, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void dropRowRange(DropRowRangeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DropRowRange, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateConsistencyToken( + GenerateConsistencyTokenRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateConsistencyTokenResponse) { + requests.add(request); + responseObserver.onNext(((GenerateConsistencyTokenResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateConsistencyToken, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + GenerateConsistencyTokenResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void checkConsistency( + CheckConsistencyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CheckConsistencyResponse) { + requests.add(request); + responseObserver.onNext(((CheckConsistencyResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CheckConsistency, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CheckConsistencyResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void snapshotTable( + SnapshotTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SnapshotTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSnapshot(GetSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Snapshot) { + requests.add(request); + responseObserver.onNext(((Snapshot) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Snapshot.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSnapshots( + ListSnapshotsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSnapshotsResponse) { + requests.add(request); + responseObserver.onNext(((ListSnapshotsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSnapshots, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSnapshotsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSnapshot( + DeleteSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSnapshot, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBackup( + CreateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBackup(UpdateBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Backup) { + requests.add(request); + responseObserver.onNext(((Backup) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBackup(DeleteBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBackups( + ListBackupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBackupsResponse) { + requests.add(request); + responseObserver.onNext(((ListBackupsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListBackups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void restoreTable( + RestoreTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void copyBackup(CopyBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CopyBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSchemaBundle( + CreateSchemaBundleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSchemaBundle, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSchemaBundle( + UpdateSchemaBundleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateSchemaBundle, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSchemaBundle( + GetSchemaBundleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SchemaBundle) { + requests.add(request); + responseObserver.onNext(((SchemaBundle) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSchemaBundle, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SchemaBundle.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSchemaBundles( + ListSchemaBundlesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSchemaBundlesResponse) { + requests.add(request); + responseObserver.onNext(((ListSchemaBundlesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSchemaBundles, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSchemaBundlesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSchemaBundle( + DeleteSchemaBundleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSchemaBundle, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/TypeProtos.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/TypeProtos.java new file mode 100644 index 000000000000..f8fd3549f830 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/TypeProtos.java @@ -0,0 +1,79 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2; + +public class TypeProtos { + public static com.google.bigtable.admin.v2.Type.Bytes bytesType() { + return com.google.bigtable.admin.v2.Type.Bytes.newBuilder() + .setEncoding( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.newBuilder() + .setRaw(com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) + .build()) + .build(); + } + + public static com.google.bigtable.admin.v2.Type int64Type() { + return com.google.bigtable.admin.v2.Type.newBuilder() + .setInt64Type( + com.google.bigtable.admin.v2.Type.Int64.newBuilder() + .setEncoding( + com.google.bigtable.admin.v2.Type.Int64.Encoding.newBuilder() + .setBigEndianBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .newBuilder() + .build()) + .build())) + .build(); + } + + public static com.google.bigtable.admin.v2.Type intSumType() { + return com.google.bigtable.admin.v2.Type.newBuilder() + .setAggregateType( + com.google.bigtable.admin.v2.Type.Aggregate.newBuilder() + .setInputType(TypeProtos.int64Type()) + .setSum(com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance())) + .build(); + } + + public static com.google.bigtable.admin.v2.Type intMinType() { + return com.google.bigtable.admin.v2.Type.newBuilder() + .setAggregateType( + com.google.bigtable.admin.v2.Type.Aggregate.newBuilder() + .setInputType(TypeProtos.int64Type()) + .setMin(com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance())) + .build(); + } + + public static com.google.bigtable.admin.v2.Type intMaxType() { + return com.google.bigtable.admin.v2.Type.newBuilder() + .setAggregateType( + com.google.bigtable.admin.v2.Type.Aggregate.newBuilder() + .setInputType(TypeProtos.int64Type()) + .setMax(com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance())) + .build(); + } + + public static com.google.bigtable.admin.v2.Type intHllType() { + return com.google.bigtable.admin.v2.Type.newBuilder() + .setAggregateType( + com.google.bigtable.admin.v2.Type.Aggregate.newBuilder() + .setInputType(TypeProtos.int64Type()) + .setHllppUniqueCount( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance())) + .build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java new file mode 100644 index 000000000000..c2d83214071a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java @@ -0,0 +1,222 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.internal; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.MaterializedViewId; +import com.google.cloud.bigtable.data.v2.models.TableId; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class NameUtilTest { + @Test + public void extractBackupIdFromBackupNameTest() { + String testBackupName = + "projects/my-project/instances/my-instance/clusters/my-cluster/backups/my-backup"; + assertThat(NameUtil.extractBackupIdFromBackupName(testBackupName)).isEqualTo("my-backup"); + + assertThrows( + IllegalArgumentException.class, () -> NameUtil.extractBackupIdFromBackupName("bad-format")); + } + + @Test + public void formatBackupNameTest() { + String testBackupName = + "projects/my-project/instances/my-instance/clusters/my-cluster/backups/my-backup"; + + assertThat(NameUtil.formatBackupName("my-project", "my-instance", "my-cluster", "my-backup")) + .isEqualTo(testBackupName); + } + + @Test + public void formatAuthorizedViewNameTest() { + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + + assertThat( + NameUtil.formatAuthorizedViewName( + "my-project", "my-instance", "my-table", "my-authorized-view")) + .isEqualTo(testAuthorizedViewName); + } + + @Test + public void formatSchemabundleNameTest() { + String testSchemaBundleName = + "projects/my-project/instances/my-instance/tables/my-table/schemaBundles/my-schema-bundle"; + + assertThat( + NameUtil.formatSchemaBundleName( + "my-project", "my-instance", "my-table", "my-schema-bundle")) + .isEqualTo(testSchemaBundleName); + } + + @Test + public void formatMaterializedViewNameTest() { + String testMaterializedViewName = + "projects/my-project/instances/my-instance/materializedViews/my-materialized-view"; + + assertThat( + NameUtil.formatMaterializedViewName( + "my-project", "my-instance", "my-materialized-view")) + .isEqualTo(testMaterializedViewName); + } + + @Test + public void formatLogicalViewNameTest() { + String testLogicalViewName = + "projects/my-project/instances/my-instance/logicalViews/my-logical-view"; + + assertThat(NameUtil.formatLogicalViewName("my-project", "my-instance", "my-logical-view")) + .isEqualTo(testLogicalViewName); + } + + @Test + public void extractAuthorizedViewIdFromAuthorizedViewNameTest() { + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + + assertThat(NameUtil.extractAuthorizedViewIdFromAuthorizedViewName(testAuthorizedViewName)) + .isEqualTo("my-authorized-view"); + + assertThrows( + IllegalArgumentException.class, + () -> NameUtil.extractAuthorizedViewIdFromAuthorizedViewName("bad-format")); + } + + @Test + public void extractSchemaBundleIdFromSchemaBundleNameTest() { + String testSchemaBundleName = + "projects/my-project/instances/my-instance/tables/my-table/schemaBundles/my-schema-bundle"; + + assertThat(NameUtil.extractSchemaBundleIdFromSchemaBundleName(testSchemaBundleName)) + .isEqualTo("my-schema-bundle"); + + assertThrows( + IllegalArgumentException.class, + () -> NameUtil.extractSchemaBundleIdFromSchemaBundleName("bad-format")); + } + + @Test + public void extractTableIdFromAuthorizedViewNameTest() { + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil + .extractTableIdFromAuthorizedViewName(testAuthorizedViewName)) + .isEqualTo("my-table"); + + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil + .extractTableIdFromAuthorizedViewName("bad-format")); + } + + @Test + public void extractTableNameFromAuthorizedViewNameTest() { + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil + .extractTableNameFromAuthorizedViewName(testAuthorizedViewName)) + .isEqualTo("projects/my-project/instances/my-instance/tables/my-table"); + + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil + .extractTableNameFromAuthorizedViewName("bad-format")); + } + + @Test + public void testExtractTargetId2() { + String testTableName = "projects/my-project/instances/my-instance/tables/my-table"; + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, "", "")) + .isEqualTo(TableId.of("my-table")); + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + "", testAuthorizedViewName, "")) + .isEqualTo(AuthorizedViewId.of("my-table", "my-authorized-view")); + + // No name is provided + assertThrows( + IllegalArgumentException.class, + () -> com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId("", "")); + + // Multiple names are provided + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, testAuthorizedViewName)); + } + + @Test + public void testExtractTargetId3() { + String testTableName = "projects/my-project/instances/my-instance/tables/my-table"; + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + String testMaterializedViewName = + "projects/my-project/instances/my-instance/materializedViews/my-materialized-view"; + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, "", "")) + .isEqualTo(TableId.of("my-table")); + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + "", testAuthorizedViewName, "")) + .isEqualTo(AuthorizedViewId.of("my-table", "my-authorized-view")); + assertThat( + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + "", "", testMaterializedViewName)) + .isEqualTo(MaterializedViewId.of("my-materialized-view")); + + // No name is provided + assertThrows( + IllegalArgumentException.class, + () -> com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId("", "", "")); + + // Multiple names are provided + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, testAuthorizedViewName, "")); + + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, "", testMaterializedViewName)); + + assertThrows( + IllegalArgumentException.class, + () -> + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + "", testAuthorizedViewName, testMaterializedViewName)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java new file mode 100644 index 000000000000..2a351fc83160 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java @@ -0,0 +1,280 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.Policy; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.FamilySubsets; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import io.grpc.StatusRuntimeException; +import java.util.List; +import java.util.Random; +import java.util.logging.Logger; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableAuthorizedViewIT { + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + private static final Logger LOGGER = Logger.getLogger(BigtableAuthorizedViewIT.class.getName()); + private static final long[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; + + private static BigtableTableAdminClient tableAdmin; + private static BigtableDataClient dataClient; + private static Table testTable; + + @BeforeClass + public static void setUpClass() throws InterruptedException { + assume() + .withMessage("BigtableInstanceAdminClient is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + tableAdmin = testEnvRule.env().getTableAdminClient(); + dataClient = testEnvRule.env().getDataClient(); + + testTable = createAndPopulateTestTable(tableAdmin, dataClient); + } + + @AfterClass + public static void tearDownClass() { + if (testTable != null) { + try { + tableAdmin.deleteTable(testTable.getId()); + } catch (Exception e) { + // Ignore. + } + } + } + + @Test + public void createAuthorizedViewAndGetAuthorizedViewTest() { + String authorizedViewId = prefixGenerator.newPrefix(); + + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(testTable.getId(), authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("row#") + .setFamilySubsets( + "cf1", + FamilySubsets.create() + .addQualifier("qualifier") + .addQualifierPrefix("prefix#"))) + .setDeletionProtection(false); + try { + AuthorizedView response = tableAdmin.createAuthorizedView(request); + assertWithMessage("Got wrong authorized view Id in CreateAuthorizedView") + .that(response.getId()) + .isEqualTo(authorizedViewId); + assertWithMessage("Got wrong deletion protection in CreateAuthorizedView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong subset view in CreateAuthorizedView") + .that(((SubsetView) response.getAuthorizedViewType()).getRowPrefixes()) + .containsExactly(ByteString.copyFromUtf8("row#")); + assertWithMessage("Got wrong family subsets in CreateAuthorizedView") + .that(((SubsetView) response.getAuthorizedViewType()).getFamilySubsets()) + .containsExactly( + "cf1", + FamilySubsets.create().addQualifier("qualifier").addQualifierPrefix("prefix#")); + + response = tableAdmin.getAuthorizedView(testTable.getId(), authorizedViewId); + assertWithMessage("Got wrong authorized view Id in getAuthorizedView") + .that(response.getId()) + .isEqualTo(authorizedViewId); + assertWithMessage("Got wrong deletion protection in getAuthorizedView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong subset view in getAuthorizedView") + .that(((SubsetView) response.getAuthorizedViewType()).getRowPrefixes()) + .containsExactly(ByteString.copyFromUtf8("row#")); + assertWithMessage("Got wrong family subsets in getAuthorizedView") + .that(((SubsetView) response.getAuthorizedViewType()).getFamilySubsets()) + .containsExactly( + "cf1", + FamilySubsets.create().addQualifier("qualifier").addQualifierPrefix("prefix#")); + } finally { + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId); + } + } + + @Test + public void listAuthorizedViewsTest() { + String authorizedViewId1 = prefixGenerator.newPrefix(); + String authorizedViewId2 = prefixGenerator.newPrefix(); + + try { + tableAdmin.createAuthorizedView(createAuthorizedViewRequest(authorizedViewId1)); + tableAdmin.createAuthorizedView(createAuthorizedViewRequest(authorizedViewId2)); + + List response = tableAdmin.listAuthorizedViews(testTable.getId()); + // Concurrent tests running may cause flakiness. Use containsAtLeast instead of + // containsExactly. + assertWithMessage("Got wrong authorized view Ids in listAuthorizedViews") + .that(response) + .containsAtLeast( + tableAdmin.getAuthorizedView(testTable.getId(), authorizedViewId1).getId(), + tableAdmin.getAuthorizedView(testTable.getId(), authorizedViewId2).getId()); + } finally { + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId1); + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId2); + } + } + + @Test + public void updateAuthorizedViewAndDeleteAuthorizedViewTest() throws InterruptedException { + String authorizedViewId = prefixGenerator.newPrefix(); + + // Create a deletion-protected authorized view. + CreateAuthorizedViewRequest request = + createAuthorizedViewRequest(authorizedViewId).setDeletionProtection(true); + + AuthorizedView response = tableAdmin.createAuthorizedView(request); + assertWithMessage("Got wrong deletion protection in CreateAuthorizedView") + .that(response.isDeletionProtected()) + .isTrue(); + + // We should not be able to delete the authorized view. + try { + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId); + fail("A delete-protected authorized view should not have been able to be deleted"); + } catch (FailedPreconditionException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + + // Update the deletion protection bit of the authorized view. + UpdateAuthorizedViewRequest updateRequest = + UpdateAuthorizedViewRequest.of(testTable.getId(), authorizedViewId) + .setDeletionProtection(false); + response = tableAdmin.updateAuthorizedView(updateRequest); + assertWithMessage("Got wrong deletion protection in UpdateAuthorizedView") + .that(response.isDeletionProtected()) + .isFalse(); + + // Now we should be able to successfully delete the AuthorizedView. + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId); + try { + for (int i = 0; i < BACKOFF_DURATION.length; i++) { + tableAdmin.getAuthorizedView(testTable.getId(), authorizedViewId); + + LOGGER.info( + "Wait for " + + BACKOFF_DURATION[i] + + " seconds for deleting authorized view " + + authorizedViewId); + Thread.sleep(BACKOFF_DURATION[i] * 1000); + } + fail("AuthorizedView was not deleted."); + } catch (NotFoundException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + } + + @Test + public void authorizedViewIamTest() { + String authorizedViewId = prefixGenerator.newPrefix(); + + try { + tableAdmin.createAuthorizedView(createAuthorizedViewRequest(authorizedViewId)); + Policy policy = tableAdmin.getAuthorizedViewIamPolicy(testTable.getId(), authorizedViewId); + assertThat(policy).isNotNull(); + + Exception actualEx = null; + try { + assertThat( + tableAdmin.setAuthorizedViewIamPolicy(testTable.getId(), authorizedViewId, policy)) + .isNotNull(); + } catch (Exception iamException) { + actualEx = iamException; + } + assertThat(actualEx).isNull(); + + List permissions = + tableAdmin.testAuthorizedViewIamPermission( + testTable.getId(), + authorizedViewId, + "bigtable.authorizedViews.get", + "bigtable.authorizedViews.update", + "bigtable.authorizedViews.delete"); + assertThat(permissions).hasSize(3); + } finally { + tableAdmin.deleteAuthorizedView(testTable.getId(), authorizedViewId); + } + } + + private CreateAuthorizedViewRequest createAuthorizedViewRequest(String authorizedViewId) { + return CreateAuthorizedViewRequest.of(testTable.getId(), authorizedViewId) + .setAuthorizedViewType(SubsetView.create()); + } + + private static Table createAndPopulateTestTable( + BigtableTableAdminClient tableAdmin, BigtableDataClient dataClient) + throws InterruptedException { + TableId tableId = + TableId.of( + PrefixGenerator.newPrefix("BigtableAuthorizedViewIT#createAndPopulateTestTable")); + Table testTable = + tableAdmin.createTable(CreateTableRequest.of(tableId.getTableId()).addFamily("cf1")); + + // Populate test data. + byte[] rowBytes = new byte[1024]; + Random random = new Random(); + random.nextBytes(rowBytes); + + try (Batcher batcher = dataClient.newBulkMutationBatcher(tableId)) { + for (int i = 0; i < 10; i++) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("test-row-" + i) + .setCell("cf1", ByteString.EMPTY, ByteString.copyFrom(rowBytes))); + } + } + return testTable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java new file mode 100644 index 000000000000..eabaa128bc49 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java @@ -0,0 +1,566 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.Policy; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.Backup; +import com.google.cloud.bigtable.admin.v2.models.CopyBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest; +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.RestoreTableRequest; +import com.google.cloud.bigtable.admin.v2.models.RestoredTableResult; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.base.Stopwatch; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.util.List; +import java.util.Random; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class BigtableBackupIT { + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + + private static final Logger LOGGER = Logger.getLogger(BigtableBackupIT.class.getName()); + + private static BigtableTableAdminClient tableAdmin; + private static BigtableTableAdminClient tableAdminHot; + private static BigtableInstanceAdminClient instanceAdmin; + private static BigtableDataClient dataClient; + + private static String targetCluster; + private static String targetClusterHot; + private static Table testTable; + private static Table testTableHot; + private static Instance testInstance; + + @BeforeClass + public static void setUpClass() throws InterruptedException, IOException { + assume() + .withMessage("BigtableInstanceAdminClient is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + tableAdmin = testEnvRule.env().getTableAdminClient(); + instanceAdmin = testEnvRule.env().getInstanceAdminClient(); + dataClient = testEnvRule.env().getDataClient(); + + targetCluster = testEnvRule.env().getPrimaryClusterId(); + testTable = createAndPopulateTestTable(tableAdmin, dataClient); + + String newInstanceId = PrefixGenerator.newPrefix("backupIT"); + targetClusterHot = newInstanceId + "-c1"; + + testInstance = + instanceAdmin.createInstance( + CreateInstanceRequest.of(newInstanceId) + .setDisplayName("BigtableBackupIT") + .addCluster( + targetClusterHot, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD)); + + tableAdminHot = + BigtableTableAdminClient.create( + testEnvRule.env().getTableAdminSettings().toBuilder() + .setInstanceId(newInstanceId) + .build()); + + testTableHot = + tableAdminHot.createTable( + CreateTableRequest.of(PrefixGenerator.newPrefix("hot-table")).addFamily("cf")); + } + + @AfterClass + public static void tearDownClass() { + if (testTable != null) { + try { + tableAdmin.deleteTable(testTable.getId()); + } catch (Exception e) { + // Ignore. + } + } + if (testInstance != null) { + try { + instanceAdmin.deleteInstance(testInstance.getId()); + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Failed to clean up instance ", e); + } + } + } + + private static void deleteBackupIgnoreErrors( + BigtableTableAdminClient tableAdmin, String clusterId, String backupId) { + try { + tableAdmin.deleteBackup(clusterId, backupId); + } catch (DeadlineExceededException ex) { + LOGGER.log(Level.WARNING, "Error deleting backup", ex); + // Don't rethrow + } + } + + private void deleteBackupIgnoreErrors(String clusterId, String backupId) { + deleteBackupIgnoreErrors(tableAdmin, clusterId, backupId); + } + + @Test + public void createAndGetBackupTest() { + String backupId = prefixGenerator.newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(6)); + + CreateBackupRequest request = + CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(expireTime); + try { + Backup response = tableAdmin.createBackup(request); + assertWithMessage("Got wrong backup Id in CreateBackup") + .that(response.getId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong source table name in CreateBackup") + .that(response.getSourceTableId()) + .isEqualTo(testTable.getId()); + assertWithMessage("Got wrong expire time in CreateBackup") + .that(response.getExpireTime()) + .isEqualTo(expireTime); + + Backup result = tableAdmin.getBackup(targetCluster, backupId); + assertWithMessage("Got wrong backup Id in GetBackup API") + .that(result.getId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong source table name in GetBackup API") + .that(result.getSourceTableId()) + .isEqualTo(testTable.getId()); + assertWithMessage("Got wrong expire time in GetBackup API") + .that(result.getExpireTime()) + .isEqualTo(expireTime); + assertWithMessage("Got empty start time in GetBackup API") + .that(result.getStartTime()) + .isNotNull(); + assertWithMessage("Got wrong size bytes in GetBackup API") + .that(result.getSizeBytes()) + .isEqualTo(0L); + assertWithMessage("Got wrong state in GetBackup API") + .that(result.getState()) + .isAnyOf(Backup.State.CREATING, Backup.State.READY); + + } finally { + deleteBackupIgnoreErrors(targetCluster, backupId); + } + } + + @Test + public void createAndGetHotBackupTest() { + String backupId = prefixGenerator.newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(24)); + Instant hotToStandardTime = Instant.now().plus(Duration.ofHours(24)); + + CreateBackupRequest request = + CreateBackupRequest.of(targetClusterHot, backupId) + .setSourceTableId(testTableHot.getId()) + .setExpireTime(expireTime) + .setBackupType(Backup.BackupType.HOT) + .setHotToStandardTime(hotToStandardTime); + try { + Backup response = tableAdminHot.createBackup(request); + assertWithMessage("Got wrong backup Id in CreateBackup") + .that(response.getId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong source table name in CreateBackup") + .that(response.getSourceTableId()) + .isEqualTo(testTableHot.getId()); + assertWithMessage("Got wrong expire time in CreateBackup") + .that(response.getExpireTime()) + .isEqualTo(expireTime); + assertWithMessage("Got wrong backup type in CreateBackup") + .that(response.getBackupType()) + .isEqualTo(Backup.BackupType.HOT); + assertWithMessage("Got wrong hot to standard time in CreateBackup") + .that(response.getHotToStandardTime()) + .isEqualTo(hotToStandardTime); + + Backup result = tableAdminHot.getBackup(targetClusterHot, backupId); + assertWithMessage("Got wrong backup Id in GetBackup API") + .that(result.getId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong source table name in GetBackup API") + .that(result.getSourceTableId()) + .isEqualTo(testTableHot.getId()); + assertWithMessage("Got wrong expire time in GetBackup API") + .that(result.getExpireTime()) + .isEqualTo(expireTime); + assertWithMessage("Got wrong hot to standard time in GetBackup API") + .that(result.getHotToStandardTime()) + .isEqualTo(hotToStandardTime); + assertWithMessage("Got empty start time in GetBackup API") + .that(result.getStartTime()) + .isNotNull(); + assertWithMessage("Got wrong size bytes in GetBackup API") + .that(result.getSizeBytes()) + .isEqualTo(0L); + assertWithMessage("Got wrong state in GetBackup API") + .that(result.getState()) + .isAnyOf(Backup.State.CREATING, Backup.State.READY); + assertWithMessage("Got wrong backup type in GetBackup API") + .that(result.getBackupType()) + .isEqualTo(Backup.BackupType.HOT); + } finally { + deleteBackupIgnoreErrors(tableAdminHot, targetClusterHot, backupId); + } + } + + @Test + public void listBackupTest() { + String backupId1 = prefixGenerator.newPrefix(); + String backupId2 = prefixGenerator.newPrefix(); + + try { + tableAdmin.createBackup(createBackupRequest(backupId1)); + tableAdmin.createBackup(createBackupRequest(backupId2)); + + List response = tableAdmin.listBackups(targetCluster); + // Concurrent tests running may cause flakiness. Use containsAtLeast instead of + // containsExactly. + assertWithMessage("Incorrect backup name") + .that(response) + .containsAtLeast(backupId1, backupId2); + } finally { + deleteBackupIgnoreErrors(targetCluster, backupId1); + deleteBackupIgnoreErrors(targetCluster, backupId2); + } + } + + @Test + public void updateBackupTest() { + String backupId = prefixGenerator.newPrefix(); + tableAdminHot.createBackup( + CreateBackupRequest.of(targetClusterHot, backupId) + .setSourceTableId(testTableHot.getId()) + .setExpireTime(Instant.now().plus(Duration.ofDays(15))) + .setBackupType(Backup.BackupType.HOT) + .setHotToStandardTime(Instant.now().plus(Duration.ofDays(10)))); + + Instant expireTime = Instant.now().plus(Duration.ofDays(20)); + UpdateBackupRequest req = + UpdateBackupRequest.of(targetClusterHot, backupId) + .setExpireTime(expireTime) + .clearHotToStandardTime(); + try { + Backup backup = tableAdminHot.updateBackup(req); + assertWithMessage("Incorrect expire time").that(backup.getExpireTime()).isEqualTo(expireTime); + assertWithMessage("Incorrect hot to standard time") + .that(backup.getHotToStandardTime()) + .isNull(); + } finally { + deleteBackupIgnoreErrors(tableAdminHot, targetClusterHot, backupId); + } + } + + @Test + public void deleteBackupTest() { + String backupId = prefixGenerator.newPrefix(); + + tableAdmin.createBackup(createBackupRequest(backupId)); + tableAdmin.deleteBackup(targetCluster, backupId); + + assertThrows(NotFoundException.class, () -> tableAdmin.getBackup(targetCluster, backupId)); + } + + @Test + public void restoreTableTest() throws InterruptedException, ExecutionException { + String backupId = prefixGenerator.newPrefix(); + String restoredTableId = prefixGenerator.newPrefix(); + tableAdmin.createBackup(createBackupRequest(backupId)); + + // Wait 2 minutes so that the RestoreTable API will trigger an optimize restored + // table operation. + Thread.sleep(120 * 1000); + + try { + RestoreTableRequest req = + RestoreTableRequest.of(targetCluster, backupId).setTableId(restoredTableId); + RestoredTableResult result = tableAdmin.restoreTable(req); + assertWithMessage("Incorrect restored table id") + .that(result.getTable().getId()) + .isEqualTo(restoredTableId); + + if (result.getOptimizeRestoredTableOperationToken() != null) { + // The assertion might be missing if the test is running against a HDD cluster or an + // optimization is not necessary. + tableAdmin.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken()); + Table restoredTable = tableAdmin.getTable(restoredTableId); + assertWithMessage("Incorrect restored table id") + .that(restoredTable.getId()) + .isEqualTo(restoredTableId); + } + } finally { + deleteBackupIgnoreErrors(targetCluster, backupId); + tableAdmin.deleteTable(restoredTableId); + } + } + + @Test + public void crossInstanceRestoreTest() + throws InterruptedException, IOException, ExecutionException, TimeoutException { + String backupId = prefixGenerator.newPrefix(); + String restoredTableId = prefixGenerator.newPrefix(); + + // Create the backup + tableAdmin.createBackup( + CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(Instant.now().plus(Duration.ofHours(6)))); + + Stopwatch stopwatch = Stopwatch.createStarted(); + + // Set up a new instance to test cross-instance restore. The backup will be restored here + String targetInstance = prefixGenerator.newPrefix(); + instanceAdmin.createInstance( + CreateInstanceRequest.of(targetInstance) + .addCluster(targetInstance, testEnvRule.env().getSecondaryZone(), 1, StorageType.SSD) + .setDisplayName("backups-dest-test-instance") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try (BigtableTableAdminClient destTableAdmin = + testEnvRule.env().getTableAdminClientForInstance(targetInstance)) { + + // Wait 2 minutes so that the RestoreTable API will trigger an optimize restored + // table operation. + Thread.sleep( + Duration.ofMinutes(2) + .minus(Duration.ofMillis(stopwatch.elapsed(TimeUnit.MILLISECONDS))) + .toMillis()); + + try { + RestoreTableRequest req = + RestoreTableRequest.of(testEnvRule.env().getInstanceId(), targetCluster, backupId) + .setTableId(restoredTableId); + RestoredTableResult result = destTableAdmin.restoreTable(req); + assertWithMessage("Incorrect restored table id") + .that(result.getTable().getId()) + .isEqualTo(restoredTableId); + assertWithMessage("Incorrect instance id") + .that(result.getTable().getInstanceId()) + .isEqualTo(targetInstance); + + // The assertion might be missing if the test is running against a HDD cluster or an + // optimization is not necessary. + assertWithMessage("Empty OptimizeRestoredTable token") + .that(result.getOptimizeRestoredTableOperationToken()) + .isNotNull(); + destTableAdmin.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken()); + destTableAdmin.getTable(restoredTableId); + } finally { + deleteBackupIgnoreErrors(targetCluster, backupId); + instanceAdmin.deleteInstance(targetInstance); + } + } + } + + @Test + public void copyBackupTest() + throws InterruptedException, IOException, ExecutionException, TimeoutException { + String backupId = prefixGenerator.newPrefix(); + String copiedBackupId = prefixGenerator.newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(36)); + + // Create the backup + tableAdmin.createBackup( + CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(expireTime)); + + try { + CopyBackupRequest req = + CopyBackupRequest.of(targetCluster, backupId) + .setDestination(targetCluster, copiedBackupId) + .setExpireTime(expireTime); + Backup result = tableAdmin.copyBackup(req); + assertWithMessage("Got wrong copied backup id in CopyBackup API") + .that(result.getId()) + .isEqualTo(copiedBackupId); + assertWithMessage("Got wrong source backup id in CopyBackup API") + .that(result.getSourceBackupId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong expire time in CopyBackup API") + .that(result.getExpireTime()) + .isEqualTo(expireTime); + assertWithMessage("Got empty start time in CopyBackup API") + .that(result.getStartTime()) + .isNotNull(); + assertWithMessage("Got wrong state in CopyBackup API") + .that(result.getState()) + .isAnyOf(Backup.State.CREATING, Backup.State.READY); + + } finally { + deleteBackupIgnoreErrors(targetCluster, copiedBackupId); + deleteBackupIgnoreErrors(targetCluster, backupId); + } + } + + @Test + public void crossInstanceCopyBackupTest() + throws InterruptedException, IOException, ExecutionException, TimeoutException { + String backupId = prefixGenerator.newPrefix(); + String copiedBackupId = prefixGenerator.newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(36)); + + // Create the backup + tableAdmin.createBackup( + CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(expireTime)); + + // Set up a new instance to test cross-instance copy. The backup will be copied here + String destInstance = prefixGenerator.newPrefix(); + String destCluster = prefixGenerator.newPrefix(); + instanceAdmin.createInstance( + CreateInstanceRequest.of(destInstance) + .addCluster(destCluster, testEnvRule.env().getSecondaryZone(), 1, StorageType.SSD) + .setDisplayName("backups-dest-test-instance") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try (BigtableTableAdminClient destTableAdmin = + testEnvRule.env().getTableAdminClientForInstance(destInstance)) { + + try { + CopyBackupRequest req = + CopyBackupRequest.of(targetCluster, backupId) + .setSourceInstance(testEnvRule.env().getInstanceId()) + .setDestination(destCluster, copiedBackupId) + .setExpireTime(expireTime); + Backup result = destTableAdmin.copyBackup(req); + assertWithMessage("Got wrong copied backup id in CopyBackup API") + .that(result.getId()) + .isEqualTo(copiedBackupId); + assertWithMessage("Got wrong source backup id in CopyBackup API") + .that(result.getSourceBackupId()) + .isEqualTo(backupId); + assertWithMessage("Got wrong expire time in CopyBackup API") + .that(result.getExpireTime()) + .isEqualTo(expireTime); + assertWithMessage("Got empty start time in CopyBackup API") + .that(result.getStartTime()) + .isNotNull(); + assertWithMessage("Got wrong state in CopyBackup API") + .that(result.getState()) + .isAnyOf(Backup.State.CREATING, Backup.State.READY); + + } finally { + deleteBackupIgnoreErrors(destTableAdmin, destCluster, copiedBackupId); + deleteBackupIgnoreErrors(targetCluster, backupId); + instanceAdmin.deleteInstance(destInstance); + } + } + } + + @Test + public void backupIamTest() { + String backupId = prefixGenerator.newPrefix(); + + try { + tableAdmin.createBackup(createBackupRequest(backupId)); + + Policy policy = tableAdmin.getBackupIamPolicy(targetCluster, backupId); + assertThat(policy).isNotNull(); + + Exception actualEx = null; + try { + assertThat(tableAdmin.setBackupIamPolicy(targetCluster, backupId, policy)).isNotNull(); + } catch (Exception iamException) { + actualEx = iamException; + } + assertThat(actualEx).isNull(); + + List permissions = + tableAdmin.testBackupIamPermission( + targetCluster, + backupId, + "bigtable.backups.get", + "bigtable.backups.delete", + "bigtable.backups.update", + "bigtable.backups.restore"); + assertThat(permissions).hasSize(4); + } finally { + deleteBackupIgnoreErrors(targetCluster, backupId); + } + } + + private CreateBackupRequest createBackupRequest(String backupId) { + return CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(Instant.now().plus(Duration.ofDays(15))); + } + + private static Table createAndPopulateTestTable( + BigtableTableAdminClient tableAdmin, BigtableDataClient dataClient) + throws InterruptedException { + TableId tableId = + TableId.of(PrefixGenerator.newPrefix("BigtableBackupIT#createAndPopulateTestTable")); + Table testTable = + tableAdmin.createTable(CreateTableRequest.of(tableId.getTableId()).addFamily("cf1")); + + // Populate test data. + byte[] rowBytes = new byte[1024]; + Random random = new Random(); + random.nextBytes(rowBytes); + + try (Batcher batcher = dataClient.newBulkMutationBatcher(tableId)) { + for (int i = 0; i < 10; i++) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("test-row-" + i) + .setCell("cf1", ByteString.EMPTY, ByteString.copyFrom(rowBytes))); + } + } + return testTable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java new file mode 100644 index 000000000000..4d3d05f5b4db --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java @@ -0,0 +1,248 @@ +/* + * 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.Backup; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateClusterRequest; +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.EncryptionInfo; +import com.google.cloud.bigtable.admin.v2.models.StaticClusterSize; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.common.Status; +import com.google.cloud.bigtable.common.Status.Code; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * Tests our CMEK offering. It can take up to 5 mins after a CMEK-protected table is created for the + * key version and status fields to be populated. Set the `bigtable.wait-for-cmek-key-status` system + * property to `true` when running the test in order to poll until the final state can be asserted. + */ +@RunWith(JUnit4.class) +public class BigtableCmekIT { + + private static final long[] BACKOFF_DURATION = {5, 10, 50, 100, 150, 200, 250, 300}; + private static final Logger LOGGER = Logger.getLogger(BigtableCmekIT.class.getName()); + private static final String TEST_TABLE_ID = "test-table-for-cmek-it"; + private static final String BACKUP_ID = "test-table-for-cmek-it-backup"; + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + + private static String instanceId; + private static String clusterId1; + private static String clusterId2; + private static String clusterId3; + private static String kmsKeyName; + private static List zones; + private static String otherZone; + + private static BigtableInstanceAdminClient instanceAdmin; + private static BigtableTableAdminClient tableAdmin; + + @BeforeClass + public static void validatePlatform() throws IOException { + assume() + .withMessage("Emulator doesn't support CMEK") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + kmsKeyName = testEnvRule.env().getKmsKeyName(); + assertThat(kmsKeyName).isNotNull(); + assertThat(kmsKeyName).isNotEmpty(); + + instanceId = PrefixGenerator.newPrefix("BigtableCmekIT#validatePlatform"); + clusterId1 = instanceId + "-c1"; + clusterId2 = instanceId + "-c2"; + clusterId3 = instanceId + "-c3"; + zones = testEnvRule.env().getMultipleZonesInSameRegion(); + otherZone = + Sets.difference( + ImmutableSet.of( + testEnvRule.env().getPrimaryZone(), testEnvRule.env().getSecondaryZone()), + ImmutableSet.copyOf(zones)) + .iterator() + .next(); + + instanceAdmin = testEnvRule.env().getInstanceAdminClient(); + tableAdmin = + BigtableTableAdminClient.create( + testEnvRule.env().getTableAdminSettings().toBuilder() + .setInstanceId(instanceId) + .build()); + + LOGGER.info("Creating cluster in zone: " + zones.get(0)); + instanceAdmin.createInstance( + CreateInstanceRequest.of(instanceId) + .setDisplayName("BigtableCmekIT") + .addCmekCluster(clusterId1, zones.get(0), 1, StorageType.SSD, kmsKeyName)); + // Create a table. Key is inherited from the cluster configuration + tableAdmin.createTable(CreateTableRequest.of(TEST_TABLE_ID).addFamily("cf")); + } + + @AfterClass + public static void teardown() { + if (tableAdmin != null) { + tableAdmin.deleteBackup(clusterId1, BACKUP_ID); + tableAdmin.deleteTable(TEST_TABLE_ID); + tableAdmin.close(); + } + if (instanceAdmin != null) { + instanceAdmin.deleteInstance(instanceId); + instanceAdmin.close(); + } + } + + @Test + public void instanceAndClusterTest() { + // Keys are specified per-cluster with each cluster requesting the same key and the cluster's + // zone must be within the region of the key + Cluster cluster = instanceAdmin.getCluster(instanceId, clusterId1); + assertThat(cluster.getKmsKeyName()).isEqualTo(kmsKeyName); + + LOGGER.info("Creating cluster in zone: " + zones.get(1)); + instanceAdmin.createCluster( + CreateClusterRequest.of(instanceId, clusterId2) + .setZone(zones.get(1)) + .setScalingMode(StaticClusterSize.of(1)) + .setStorageType(StorageType.SSD) + .setKmsKeyName(kmsKeyName)); + + Cluster secondCluster = instanceAdmin.getCluster(instanceId, clusterId2); + assertThat(secondCluster.getKmsKeyName()).isEqualTo(kmsKeyName); + + LOGGER.info("Trying to create cluster in zone: " + otherZone); + try { + instanceAdmin.createCluster( + CreateClusterRequest.of(instanceId, clusterId3) + .setZone(otherZone) + .setScalingMode(StaticClusterSize.of(1)) + .setStorageType(StorageType.SSD) + .setKmsKeyName(kmsKeyName)); + Assert.fail("should have thrown an error"); + } catch (com.google.api.gax.rpc.FailedPreconditionException e) { + assertThat(e.getMessage()) + .contains( + "FAILED_PRECONDITION: Error in field 'cluster' : " + + "Error in field 'encryption_config.kms_key_name' : CMEK key " + + kmsKeyName + + " cannot be used to protect a cluster in zone " + + NameUtil.formatLocationName(testEnvRule.env().getProjectId(), otherZone)); + } + } + + @Test + public void tableTest() throws Exception { + // Confirm that table is CMEK-protected + if (testEnvRule.env().shouldWaitForCmekKeyStatusUpdate()) { + waitForCmekStatus(TEST_TABLE_ID, clusterId1); + } + Map> encryptionInfos = tableAdmin.getEncryptionInfo(TEST_TABLE_ID); + assertThat(encryptionInfos).hasSize(1); + assertThat(encryptionInfos.get(clusterId1)).hasSize(1); + EncryptionInfo encryptionInfo = encryptionInfos.get(clusterId1).get(0); + assertThat(encryptionInfo.getType()).isEqualTo(EncryptionInfo.Type.CUSTOMER_MANAGED_ENCRYPTION); + assertThat(encryptionInfo.getStatus().getCode()).isAnyOf(Status.Code.OK, Status.Code.UNKNOWN); + if (testEnvRule.env().shouldWaitForCmekKeyStatusUpdate()) { + assertThat(encryptionInfo.getStatus().getCode()).isEqualTo(Status.Code.OK); + } + // For up to 5 minutes after a table is newly created, the key version and status fields are + // not + // populated. + // Set the `bigtable.wait-for-cmek-key-status` system property to `true` when running the test + // in order to poll until the final state can be asserted. + if (encryptionInfo.getStatus().getCode() == Code.UNKNOWN) { + assertThat(encryptionInfo.getKmsKeyVersion()).isEmpty(); + assertThat(encryptionInfo.getStatus().getMessage()) + .isEqualTo("Key version is not yet known."); + } else { + assertThat(encryptionInfo.getKmsKeyVersion()).startsWith(kmsKeyName); + assertThat(encryptionInfo.getStatus().getMessage()).isEqualTo(""); + } + } + + @Test + public void backupTest() { + // Create a backup. + // Backups are pinned to the primary version of their table's CMEK key at the time they are + // taken + tableAdmin.createBackup( + CreateBackupRequest.of(clusterId1, BACKUP_ID) + .setExpireTime(Instant.now().plus(6, ChronoUnit.HOURS)) + .setSourceTableId(TEST_TABLE_ID)); + + Backup backup = tableAdmin.getBackup(clusterId1, BACKUP_ID); + + // Confirm encryption details for an existing backup + // The backup will be returned with the CMEK key version that the backup is pinned to. + // The status of that key version will always be UNKNOWN. + assertThat(backup.getEncryptionInfo().getKmsKeyVersion()).startsWith(kmsKeyName); + assertThat(backup.getEncryptionInfo().getStatus().getCode()).isEqualTo(Status.Code.UNKNOWN); + assertThat(backup.getEncryptionInfo().getType()) + .isEqualTo(EncryptionInfo.Type.CUSTOMER_MANAGED_ENCRYPTION); + assertThat(backup.getEncryptionInfo().getStatus().getMessage()) + .isEqualTo("Status of the associated key version is not tracked."); + } + + private void waitForCmekStatus(String tableId, String clusterId) throws InterruptedException { + for (int i = 0; i < BACKOFF_DURATION.length; i++) { + try { + EncryptionInfo encryptionInfo = tableAdmin.getEncryptionInfo(tableId).get(clusterId).get(0); + if (encryptionInfo.getStatus().getCode() == Code.OK) { + return; + } + } catch (ApiException ex) { + LOGGER.info( + "Wait for " + + BACKOFF_DURATION[i] + + " seconds for key status for table " + + tableId + + " and cluster " + + clusterId); + } + Thread.sleep(BACKOFF_DURATION[i] * 1000); + } + fail("CMEK key status failed to return"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java new file mode 100644 index 000000000000..0adc7462a70e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java @@ -0,0 +1,683 @@ +/* + * Copyright 2019 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.cloud.Policy; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.admin.v2.models.ClusterAutoscalingConfig; +import com.google.cloud.bigtable.admin.v2.models.CreateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateClusterRequest; +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.StaticClusterSize; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.admin.v2.models.UpdateAppProfileRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateInstanceRequest; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import java.time.Duration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableInstanceAdminClientIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + private static final Logger logger = + Logger.getLogger(BigtableInstanceAdminClientIT.class.getName()); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + + private String instanceId = testEnvRule.env().getInstanceId(); + private BigtableInstanceAdminClient client; + + // TODO: Update this test once emulator supports InstanceAdmin operation + // https://github.com/googleapis/google-cloud-go/issues/1069 + @BeforeClass + public static void validatePlatform() { + assume() + .withMessage("BigtableInstanceAdminClient doesn't support on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + } + + @Before + public void setUp() { + client = testEnvRule.env().getInstanceAdminClient(); + } + + @Test + public void appProfileTest() { + String testAppProfile = prefixGenerator.newPrefix(); + + AppProfile newlyCreatedAppProfile = + client.createAppProfile( + CreateAppProfileRequest.of(instanceId, testAppProfile) + .setRoutingPolicy(AppProfile.MultiClusterRoutingPolicy.of()) + .setDescription("This is to test app profile")); + + AppProfile updated = + client.updateAppProfile( + UpdateAppProfileRequest.of(newlyCreatedAppProfile) + .setDescription("This is to app profile operation")); + + AppProfile freshAppProfile = client.getAppProfile(instanceId, testAppProfile); + assertThat(freshAppProfile.getDescription()).isEqualTo(updated.getDescription()); + + assertThat(client.listAppProfiles(instanceId)).contains(freshAppProfile); + + Exception actualEx = null; + try { + client.deleteAppProfile(instanceId, testAppProfile, true); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isNull(); + } + + @Test + public void appProfileTestMultiClusterWithIds() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + String newClusterId2 = newInstanceId + "-c2"; + + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .addCluster(newClusterId2, testEnvRule.env().getSecondaryZone(), 1, StorageType.SSD) + .setDisplayName("Multi-Cluster-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try { + assertThat(client.exists(newInstanceId)).isTrue(); + + String testAppProfile = "test-app-profile"; + + CreateAppProfileRequest request = + CreateAppProfileRequest.of(newInstanceId, testAppProfile) + .setRoutingPolicy(AppProfile.MultiClusterRoutingPolicy.of(newClusterId)) + .setDescription("This is to test app profile"); + + AppProfile newlyCreatedAppProfile = client.createAppProfile(request); + + AppProfile updated = + client.updateAppProfile( + UpdateAppProfileRequest.of(newlyCreatedAppProfile).setDescription("new description")); + + AppProfile freshAppProfile = client.getAppProfile(newInstanceId, testAppProfile); + assertThat(freshAppProfile.getDescription()).isEqualTo(updated.getDescription()); + + AppProfile.MultiClusterRoutingPolicy freshAppProfilePolicy = + (AppProfile.MultiClusterRoutingPolicy) freshAppProfile.getPolicy(); + AppProfile.MultiClusterRoutingPolicy updatedAppProfilePolicy = + (AppProfile.MultiClusterRoutingPolicy) updated.getPolicy(); + + assertThat(freshAppProfilePolicy.getClusterIds()).containsExactly(newClusterId); + assertThat(freshAppProfilePolicy.getClusterIds()) + .isEqualTo(updatedAppProfilePolicy.getClusterIds()); + assertThat(freshAppProfilePolicy).isEqualTo(updatedAppProfilePolicy); + + assertThat(client.listAppProfiles(newInstanceId)).contains(freshAppProfile); + + // update again with routing policy + AppProfile updated2 = + client.updateAppProfile( + UpdateAppProfileRequest.of(updated) + .setRoutingPolicy(AppProfile.MultiClusterRoutingPolicy.of(newClusterId2))); + + AppProfile freshAppProfile2 = client.getAppProfile(newInstanceId, testAppProfile); + assertThat(freshAppProfile2.getDescription()).isEqualTo(updated2.getDescription()); + + AppProfile.MultiClusterRoutingPolicy freshAppProfilePolicy2 = + (AppProfile.MultiClusterRoutingPolicy) freshAppProfile2.getPolicy(); + AppProfile.MultiClusterRoutingPolicy updatedAppProfilePolicy2 = + (AppProfile.MultiClusterRoutingPolicy) updated2.getPolicy(); + + assertThat(freshAppProfilePolicy2.getClusterIds()).containsExactly(newClusterId2); + assertThat(freshAppProfilePolicy2.getClusterIds()) + .isEqualTo(updatedAppProfilePolicy2.getClusterIds()); + assertThat(freshAppProfilePolicy2).isEqualTo(updatedAppProfilePolicy2); + + assertThat(client.listAppProfiles(newInstanceId)).contains(freshAppProfile2); + + // update to single routing policy + AppProfile updated3 = + client.updateAppProfile( + UpdateAppProfileRequest.of(updated) + .setRoutingPolicy(AppProfile.SingleClusterRoutingPolicy.of(newClusterId))); + + AppProfile freshAppProfile3 = client.getAppProfile(newInstanceId, testAppProfile); + assertThat(freshAppProfile3.getDescription()).isEqualTo(updated3.getDescription()); + + AppProfile.SingleClusterRoutingPolicy freshAppProfilePolicy3 = + (AppProfile.SingleClusterRoutingPolicy) freshAppProfile3.getPolicy(); + AppProfile.SingleClusterRoutingPolicy updatedAppProfilePolicy3 = + (AppProfile.SingleClusterRoutingPolicy) updated3.getPolicy(); + + assertThat(freshAppProfilePolicy3.getClusterId()).isEqualTo(newClusterId); + assertThat(freshAppProfilePolicy3.getClusterId()) + .isEqualTo(updatedAppProfilePolicy3.getClusterId()); + assertThat(freshAppProfilePolicy3).isEqualTo(updatedAppProfilePolicy3); + + assertThat(client.listAppProfiles(newInstanceId)).contains(freshAppProfile3); + } finally { + if (client.exists(newInstanceId)) { + client.deleteInstance(newInstanceId); + } + } + } + + @Test + public void appProfileTestPriority() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .setDisplayName("Priority-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try { + assertThat(client.exists(newInstanceId)).isTrue(); + + String testAppProfile = prefixGenerator.newPrefix(); + + // This should be created with HIGH priority. + CreateAppProfileRequest request = + CreateAppProfileRequest.of(newInstanceId, testAppProfile) + .setRoutingPolicy(AppProfile.SingleClusterRoutingPolicy.of(newClusterId)) + .setDescription("This is to test app profile"); + + AppProfile newlyCreatedAppProfile = client.createAppProfile(request); + AppProfile.StandardIsolationPolicy newlyCreatedAppProfilePolicy = + (AppProfile.StandardIsolationPolicy) newlyCreatedAppProfile.getIsolationPolicy(); + assertThat(newlyCreatedAppProfilePolicy.getPriority()).isEqualTo(AppProfile.Priority.HIGH); + + AppProfile updated = + client.updateAppProfile( + UpdateAppProfileRequest.of(newlyCreatedAppProfile) + .setIsolationPolicy( + AppProfile.StandardIsolationPolicy.of(AppProfile.Priority.LOW))); + + AppProfile freshAppProfile = client.getAppProfile(newInstanceId, testAppProfile); + AppProfile.StandardIsolationPolicy freshAppProfilePolicy = + (AppProfile.StandardIsolationPolicy) freshAppProfile.getIsolationPolicy(); + AppProfile.StandardIsolationPolicy updatedAppProfilePolicy = + (AppProfile.StandardIsolationPolicy) updated.getIsolationPolicy(); + + assertThat(freshAppProfilePolicy.getPriority()).isEqualTo(AppProfile.Priority.LOW); + assertThat(freshAppProfilePolicy).isEqualTo(updatedAppProfilePolicy); + + assertThat(client.listAppProfiles(newInstanceId)).contains(freshAppProfile); + } finally { + if (client.exists(newInstanceId)) { + client.deleteInstance(newInstanceId); + } + } + } + + @Test + public void appProfileTestDataBoost() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .setDisplayName("Priority-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try { + assertThat(client.exists(newInstanceId)).isTrue(); + + String testAppProfile = prefixGenerator.newPrefix(); + + CreateAppProfileRequest request = + CreateAppProfileRequest.of(newInstanceId, testAppProfile) + .setRoutingPolicy(AppProfile.SingleClusterRoutingPolicy.of(newClusterId)) + .setIsolationPolicy( + AppProfile.DataBoostIsolationReadOnlyPolicy.of( + AppProfile.ComputeBillingOwner.HOST_PAYS)) + .setDescription("databoost app profile"); + + AppProfile newlyCreateAppProfile = client.createAppProfile(request); + AppProfile.ComputeBillingOwner computeBillingOwner = + ((AppProfile.DataBoostIsolationReadOnlyPolicy) newlyCreateAppProfile.getIsolationPolicy()) + .getComputeBillingOwner(); + assertThat(computeBillingOwner).isEqualTo(AppProfile.ComputeBillingOwner.HOST_PAYS); + } finally { + if (client.exists(newInstanceId)) { + client.deleteInstance(newInstanceId); + } + } + } + + @Test + public void appProfileTestRowAffinity() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + String newClusterId2 = newInstanceId + "-c2"; + + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .addCluster(newClusterId2, testEnvRule.env().getSecondaryZone(), 1, StorageType.SSD) + .setDisplayName("Row-Affinity-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try { + assertThat(client.exists(newInstanceId)).isTrue(); + + String testAppProfile = prefixGenerator.newPrefix(); + + CreateAppProfileRequest request = + CreateAppProfileRequest.of(newInstanceId, testAppProfile) + .setRoutingPolicy( + AppProfile.MultiClusterRoutingPolicy.withRowAffinity(newClusterId, newClusterId2)) + .setDescription("row affinity app profile"); + + AppProfile newlyCreateAppProfile = client.createAppProfile(request); + AppProfile.RoutingPolicy routingPolicy = newlyCreateAppProfile.getPolicy(); + assertThat(routingPolicy) + .isEqualTo( + AppProfile.MultiClusterRoutingPolicy.withRowAffinity(newClusterId, newClusterId2)); + } finally { + if (client.exists(newInstanceId)) { + client.deleteInstance(newInstanceId); + } + } + } + + @Test + public void iamUpdateTest() { + Policy policy = client.getIamPolicy(instanceId); + assertThat(policy).isNotNull(); + + Exception actualEx = null; + try { + assertThat(client.setIamPolicy(instanceId, policy)).isNotNull(); + } catch (Exception iamException) { + actualEx = iamException; + } + assertThat(actualEx).isNull(); + + List permissions = + client.testIamPermission( + instanceId, "bigtable.tables.readRows", "bigtable.tables.mutateRows"); + assertThat(permissions).hasSize(2); + } + + /** To optimize test run time, instance & cluster creation is tested at the same time */ + @Test + public void instanceAndClusterCreationDeletionTest() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId; + + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 3, StorageType.SSD) + .setDisplayName("Fresh-Instance-Name") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + try { + assertThat(client.exists(newInstanceId)).isTrue(); + + client.updateInstance( + UpdateInstanceRequest.of(newInstanceId).setDisplayName("Test-Instance-Name")); + + Instance instance = client.getInstance(newInstanceId); + assertThat(instance.getDisplayName()).isEqualTo("Test-Instance-Name"); + + assertThat(client.listInstances()).contains(instance); + + clusterCreationDeletionTestHelper(newInstanceId); + basicClusterOperationTestHelper(newInstanceId, newClusterId); + + client.deleteInstance(newInstanceId); + assertThat(client.exists(newInstanceId)).isFalse(); + } finally { + if (client.exists(newInstanceId)) { + client.deleteInstance(newInstanceId); + } + } + } + + // To improve test runtime, piggyback off the instance creation/deletion test's fresh instance. + // This will avoid the need to copy any existing tables and will also reduce flakiness in case a + // previous run failed to clean up a cluster in the secondary zone. + private void clusterCreationDeletionTestHelper(String newInstanceId) { + String newClusterId = prefixGenerator.newPrefix(); + boolean isClusterDeleted = false; + client.createCluster( + CreateClusterRequest.of(newInstanceId, newClusterId) + .setZone(testEnvRule.env().getSecondaryZone()) + .setStorageType(StorageType.SSD) + .setScalingMode(StaticClusterSize.of(3))); + try { + assertThat(client.getCluster(newInstanceId, newClusterId)).isNotNull(); + + client.deleteCluster(newInstanceId, newClusterId); + isClusterDeleted = true; + } finally { + if (!isClusterDeleted) { + client.deleteCluster(newInstanceId, newClusterId); + } + } + } + + /* As cluster creation is very expensive operation, so reusing existing clusters to verify rest + of the operation.*/ + @Test + public void basicInstanceOperationTest() { + assertThat(client.exists(instanceId)).isTrue(); + + client.updateInstance( + UpdateInstanceRequest.of(instanceId).setDisplayName("Updated-Instance-Name")); + + Instance instance = client.getInstance(instanceId); + assertThat(instance.getDisplayName()).isEqualTo("Updated-Instance-Name"); + + assertThat(client.listInstances()).contains(instance); + } + + @Test + public void createClusterWithAutoscalingTest() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + + try { + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.HDD) + .setDisplayName("Multi-Cluster-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + String clusterId = prefixGenerator.newPrefix(); + CreateClusterRequest createClusterRequest = + CreateClusterRequest.of(newInstanceId, clusterId) + .setZone(testEnvRule.env().getSecondaryZone()) + .setStorageType(StorageType.HDD) + .setScalingMode( + ClusterAutoscalingConfig.of(newInstanceId, clusterId) + .setMaxNodes(4) + .setMinNodes(1) + .setCpuUtilizationTargetPercent(20) + .setStorageUtilizationGibPerNode(9200)); + + Cluster cluster = client.createCluster(createClusterRequest); + assertThat(cluster.getId()).contains(clusterId); + assertThat(cluster.getServeNodes()).isEqualTo(0); + assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(4); + assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(9200); + } finally { + client.deleteInstance(newInstanceId); + } + } + + @Test + public void createClusterWithAutoscalingAndPartialUpdateTest() throws Exception { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + + try { + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .setDisplayName("Multi-Cluster-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + String clusterId = prefixGenerator.newPrefix(); + CreateClusterRequest createClusterRequest = + CreateClusterRequest.of(newInstanceId, clusterId) + .setZone(testEnvRule.env().getSecondaryZone()) + .setScalingMode( + ClusterAutoscalingConfig.of("ignored", clusterId) + .setMaxNodes(4) + .setMinNodes(1) + .setStorageUtilizationGibPerNode(2561) + .setCpuUtilizationTargetPercent(20)); + + Cluster cluster = client.createCluster(createClusterRequest); + assertThat(cluster.getId()).contains(clusterId); + assertThat(cluster.getServeNodes()).isEqualTo(0); + assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(4); + assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + Cluster retrievedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedCluster.getId()).contains(clusterId); + assertThat(retrievedCluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(retrievedCluster.getAutoscalingMaxServeNodes()).isEqualTo(4); + assertThat(retrievedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(retrievedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + // The test might trigger cluster autoscaling, which races against the update cluster calls in + // this test and causing the update cluster calls to fail with "FAILED_PRECONDITION: Cannot + // update cluster that is currently being modified" error. + // In order to avoid test flakiness due to this race condition, we wrap all the update cluster + // call with a retry loop. + // TODO: After we have a proper fix for the issue, remove the + // updateClusterAutoScalingConfigWithRetry function and all the calls to it. + + Cluster updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId).setMaxNodes(3)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + Cluster retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId).setMinNodes(2)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId) + .setCpuUtilizationTargetPercent(40)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(40); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(3); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(40); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId) + .setCpuUtilizationTargetPercent(45) + .setMaxNodes(5)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2561); + + updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId) + .setStorageUtilizationGibPerNode(2777)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2777); + + retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2777); + + updatedCluster = + updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig.of(newInstanceId, clusterId) + // testing default case + .setStorageUtilizationGibPerNode(0)); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2560); + + retrievedUpdatedCluster = client.getCluster(newInstanceId, clusterId); + assertThat(retrievedUpdatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); + assertThat(retrievedUpdatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); + assertThat(retrievedUpdatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); + assertThat(retrievedUpdatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(2560); + } finally { + client.deleteInstance(newInstanceId); + } + } + + @Test + public void createClusterWithManualScalingTest() { + String newInstanceId = prefixGenerator.newPrefix(); + String newClusterId = newInstanceId + "-c1"; + + try { + client.createInstance( + CreateInstanceRequest.of(newInstanceId) + .addCluster(newClusterId, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD) + .setDisplayName("Multi-Cluster-Instance-Test") + .addLabel("state", "readytodelete") + .setType(Instance.Type.PRODUCTION)); + + String clusterId = prefixGenerator.newPrefix(); + CreateClusterRequest createClusterRequest = + CreateClusterRequest.of(newInstanceId, clusterId) + .setZone(testEnvRule.env().getSecondaryZone()) + .setScalingMode(StaticClusterSize.of(5)); + + Cluster cluster = client.createCluster(createClusterRequest); + assertThat(cluster.getId()).contains(clusterId); + assertThat(cluster.getServeNodes()).isEqualTo(5); + assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(0); + assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(0); + assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(0); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(0); + } finally { + client.deleteInstance(newInstanceId); + } + } + + // To improve test runtime, piggyback off the instance creation/deletion test's fresh instance. + private void basicClusterOperationTestHelper(String targetInstanceId, String targetClusterId) { + List clusters = client.listClusters(targetInstanceId); + + Cluster targetCluster = null; + for (Cluster cluster : clusters) { + if (cluster.getId().equals(targetClusterId)) { + targetCluster = cluster; + } + } + assertWithMessage("Failed to find target cluster id in listClusters") + .that(targetCluster) + .isNotNull(); + + assertThat(client.getCluster(targetInstanceId, targetClusterId)).isEqualTo(targetCluster); + + int freshNumOfNodes = targetCluster.getServeNodes() + 1; + + Cluster resizeCluster = + client.resizeCluster(targetInstanceId, targetClusterId, freshNumOfNodes); + assertThat(resizeCluster.getServeNodes()).isEqualTo(freshNumOfNodes); + + ClusterAutoscalingConfig autoscalingConfig = + ClusterAutoscalingConfig.of(targetInstanceId, targetClusterId) + .setMinNodes(1) + .setMaxNodes(4) + .setStorageUtilizationGibPerNode(2877) + .setCpuUtilizationTargetPercent(40); + Cluster cluster = client.updateClusterAutoscalingConfig(autoscalingConfig); + assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(4); + assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(1); + assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(40); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(2877); + + Cluster updatedCluster = client.disableClusterAutoscaling(targetInstanceId, targetClusterId, 3); + assertThat(updatedCluster.getServeNodes()).isEqualTo(3); + assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(0); + assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(0); + assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(0); + assertThat(updatedCluster.getStorageUtilizationGibPerNode()).isEqualTo(0); + } + + private Cluster updateClusterAutoScalingConfigWithRetry( + ClusterAutoscalingConfig clusterAutoscalingConfig) throws Exception { + int retryCount = 0; + int maxRetries = 10; + while (true) { + try { + return client.updateClusterAutoscalingConfig(clusterAutoscalingConfig); + } catch (FailedPreconditionException e) { + if (++retryCount == maxRetries) throw e; + logger.log( + Level.INFO, "Retrying updateClusterAutoscalingConfig, retryCount: " + retryCount); + Thread.sleep(Duration.ofMinutes(1).toMillis()); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableLogicalViewIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableLogicalViewIT.java new file mode 100644 index 000000000000..89da11da3a0a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableLogicalViewIT.java @@ -0,0 +1,204 @@ +/* + * Copyright 2025 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.LogicalView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateLogicalViewRequest; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import io.grpc.StatusRuntimeException; +import java.util.List; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableLogicalViewIT { + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + private static final Logger LOGGER = Logger.getLogger(BigtableLogicalViewIT.class.getName()); + private static final long[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; + + private static BigtableInstanceAdminClient client; + private static Table testTable; + + private final String instanceId = testEnvRule.env().getInstanceId(); + + // TODO: Update this test once emulator supports InstanceAdmin operation + // https://github.com/googleapis/google-cloud-go/issues/1069 + @BeforeClass + public static void validatePlatform() { + assume() + .withMessage("BigtableInstanceAdminClient doesn't support on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + } + + @Before + public void setUp() throws InterruptedException { + client = testEnvRule.env().getInstanceAdminClient(); + testTable = createTestTable(testEnvRule.env().getTableAdminClient()); + } + + @After + public void tearDown() throws InterruptedException { + if (testTable != null) { + testEnvRule.env().getTableAdminClient().deleteTable(testTable.getId()); + } + } + + @Test + public void createLogicalViewAndGetLogicalViewTest() { + String logicalViewId = prefixGenerator.newPrefix(); + + CreateLogicalViewRequest request = + CreateLogicalViewRequest.of(instanceId, logicalViewId) + .setQuery(getQuery()) + .setDeletionProtection(false); + try { + LogicalView response = client.createLogicalView(request); + assertWithMessage("Got wrong logical view Id in CreateLogicalView") + .that(response.getId()) + .isEqualTo(logicalViewId); + assertWithMessage("Got wrong deletion protection in CreateLogicalView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong query in CreateLogicalView") + .that(response.getQuery()) + .isEqualTo(getQuery()); + + response = client.getLogicalView(instanceId, logicalViewId); + assertWithMessage("Got wrong logical view Id in getLogicalView") + .that(response.getId()) + .isEqualTo(logicalViewId); + assertWithMessage("Got wrong deletion protection in getLogicalView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong query in getLogicalView") + .that(response.getQuery()) + .isEqualTo(getQuery()); + } finally { + client.deleteLogicalView(instanceId, logicalViewId); + } + } + + @Test + public void listLogicalViewsTest() { + String logicalViewId = prefixGenerator.newPrefix(); + + try { + LogicalView logicalView = client.createLogicalView(createLogicalViewRequest(logicalViewId)); + + List response = client.listLogicalViews(instanceId); + assertWithMessage("Got wrong logical view Ids in listLogicalViews") + .that(response) + .contains(logicalView); + } finally { + client.deleteLogicalView(instanceId, logicalViewId); + } + } + + @Test + public void updateLogicalViewAndDeleteLogicalViewTest() throws InterruptedException { + String logicalViewId = prefixGenerator.newPrefix(); + + // Create a deletion-protected logical view. + CreateLogicalViewRequest request = + createLogicalViewRequest(logicalViewId).setDeletionProtection(true); + + LogicalView response = client.createLogicalView(request); + assertWithMessage("Got wrong deletion protection in CreateLogicalView") + .that(response.isDeletionProtected()) + .isTrue(); + + // We should not be able to delete the logical view. + try { + client.deleteLogicalView(instanceId, logicalViewId); + fail("A delete-protected logical view should not have been able to be deleted"); + } catch (FailedPreconditionException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + + // Update the deletion protection bit and query of the logical view. + String query = "SELECT 1 AS value"; + UpdateLogicalViewRequest updateRequest = + UpdateLogicalViewRequest.of(response).setQuery(query).setDeletionProtection(false); + response = client.updateLogicalView(updateRequest); + assertWithMessage("Got wrong deletion protection in UpdateLogicalView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong query in UpdateLogicalView") + .that(response.getQuery()) + .isEqualTo(query); + + // Now we should be able to successfully delete the LogicalView. + client.deleteLogicalView(instanceId, logicalViewId); + try { + for (int i = 0; i < BACKOFF_DURATION.length; i++) { + client.getLogicalView(instanceId, logicalViewId); + + LOGGER.info( + "Wait for " + + BACKOFF_DURATION[i] + + " seconds for deleting logical view " + + logicalViewId); + Thread.sleep(BACKOFF_DURATION[i] * 1000); + } + fail("LogicalView was not deleted."); + } catch (NotFoundException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + } + + private CreateLogicalViewRequest createLogicalViewRequest(String logicalViewId) { + return CreateLogicalViewRequest.of(instanceId, logicalViewId).setQuery(getQuery()); + } + + private String getQuery() { + return "SELECT _key, cf1['column'] as column FROM `" + testTable.getId() + "`"; + } + + private static Table createTestTable(BigtableTableAdminClient tableAdmin) + throws InterruptedException { + String tableId = PrefixGenerator.newPrefix("BigtableLogicalViewIT#createTestTable"); + Table testTable = tableAdmin.createTable(CreateTableRequest.of(tableId).addFamily("cf1")); + + return testTable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableMaterializedViewIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableMaterializedViewIT.java new file mode 100644 index 000000000000..1ae8c7bd9432 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableMaterializedViewIT.java @@ -0,0 +1,203 @@ +/* + * Copyright 2025 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.MaterializedView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableMaterializedViewIT { + + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + private static final Logger LOGGER = Logger.getLogger(BigtableMaterializedViewIT.class.getName()); + private static final long[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; + + private BigtableInstanceAdminClient client; + private Table testTable; + private final String instanceId = testEnvRule.env().getInstanceId(); + + // TODO: Update this test once emulator supports InstanceAdmin operation + // https://github.com/googleapis/google-cloud-go/issues/1069 + @BeforeClass + public static void validatePlatform() throws IOException { + assume() + .withMessage("BigtableInstanceAdminClient doesn't support on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + } + + @Before + public void setUp() throws InterruptedException, IOException { + client = testEnvRule.env().getInstanceAdminClient(); + testTable = createTestTable(testEnvRule.env().getTableAdminClient()); + } + + @After + public void tearDown() throws InterruptedException { + if (testTable != null) { + testEnvRule.env().getTableAdminClient().deleteTable(testTable.getId()); + } + } + + @Test + public void createMaterializedViewAndGetMaterializedViewTest() { + String materializedViewId = prefixGenerator.newPrefix(); + + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.of(instanceId, materializedViewId) + .setQuery(getQuery()) + .setDeletionProtection(false); + try { + MaterializedView response = client.createMaterializedView(request); + assertWithMessage("Got wrong materialized view Id in CreateMaterializedView") + .that(response.getId()) + .isEqualTo(materializedViewId); + assertWithMessage("Got wrong deletion protection in CreateMaterializedView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong deletion protection in CreateMaterializedView") + .that(response.getQuery()) + .isEqualTo(getQuery()); + + response = client.getMaterializedView(instanceId, materializedViewId); + assertWithMessage("Got wrong materialized view Id in getMaterializedView") + .that(response.getId()) + .isEqualTo(materializedViewId); + assertWithMessage("Got wrong deletion protection in getMaterializedView") + .that(response.isDeletionProtected()) + .isFalse(); + assertWithMessage("Got wrong deletion protection in getMaterializedView") + .that(response.getQuery()) + .isEqualTo(getQuery()); + } finally { + client.deleteMaterializedView(instanceId, materializedViewId); + } + } + + @Test + public void listMaterializedViewsTest() { + String materializedViewId = prefixGenerator.newPrefix(); + + try { + MaterializedView materializedView = + client.createMaterializedView(createMaterializedViewRequest(materializedViewId)); + + List response = client.listMaterializedViews(instanceId); + assertWithMessage("Got wrong materialized view Ids in listMaterializedViews") + .that(response) + .contains(materializedView); + } finally { + client.deleteMaterializedView(instanceId, materializedViewId); + } + } + + @Test + public void updateMaterializedViewAndDeleteMaterializedViewTest() throws InterruptedException { + String materializedViewId = prefixGenerator.newPrefix(); + + // Create a deletion-protected materialized view. + CreateMaterializedViewRequest request = + createMaterializedViewRequest(materializedViewId).setDeletionProtection(true); + + MaterializedView response = client.createMaterializedView(request); + assertWithMessage("Got wrong deletion protection in CreateMaterializedView") + .that(response.isDeletionProtected()) + .isTrue(); + + // We should not be able to delete the materialized view. + try { + client.deleteMaterializedView(instanceId, materializedViewId); + fail("A delete-protected materialized view should not have been able to be deleted"); + } catch (FailedPreconditionException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + + // Update the deletion protection bit of the materialized view. + UpdateMaterializedViewRequest updateRequest = + UpdateMaterializedViewRequest.of(response).setDeletionProtection(false); + response = client.updateMaterializedView(updateRequest); + assertWithMessage("Got wrong deletion protection in UpdateMaterializedView") + .that(response.isDeletionProtected()) + .isFalse(); + + // Now we should be able to successfully delete the MaterializedView. + client.deleteMaterializedView(instanceId, materializedViewId); + try { + for (int i = 0; i < BACKOFF_DURATION.length; i++) { + client.getMaterializedView(instanceId, materializedViewId); + + LOGGER.info( + "Wait for " + + BACKOFF_DURATION[i] + + " seconds for deleting materialized view " + + materializedViewId); + Thread.sleep(BACKOFF_DURATION[i] * 1000); + } + fail("MaterializedView was not deleted."); + } catch (NotFoundException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + } + + private CreateMaterializedViewRequest createMaterializedViewRequest(String materializedViewId) { + return CreateMaterializedViewRequest.of(instanceId, materializedViewId).setQuery(getQuery()); + } + + private String getQuery() { + return "SELECT _key, MAX(cf1['column']) as column FROM `" + + testTable.getId() + + "` GROUP BY _key"; + } + + private Table createTestTable(BigtableTableAdminClient tableAdmin) throws InterruptedException { + String tableId = PrefixGenerator.newPrefix("BigtableMaterializedViewIT#createTestTable"); + Table testTable = tableAdmin.createTable(CreateTableRequest.of(tableId).addFamily("cf1")); + + return testTable; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableSchemaBundleIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableSchemaBundleIT.java new file mode 100644 index 000000000000..18473f2c36b4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableSchemaBundleIT.java @@ -0,0 +1,226 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.it; + +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.SchemaBundle; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateSchemaBundleRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.Random; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableSchemaBundleIT { + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + private static final Logger LOGGER = Logger.getLogger(BigtableSchemaBundleIT.class.getName()); + private static final long[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; + // Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb` + private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb"; + // Location: + // `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb` + private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb"; + + private static BigtableTableAdminClient tableAdmin; + private static BigtableDataClient dataClient; + private Table testTable; + + @BeforeClass + public static void setUpClass() throws InterruptedException { + assume() + .withMessage("BigtableInstanceAdminClient is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + tableAdmin = testEnvRule.env().getTableAdminClient(); + dataClient = testEnvRule.env().getDataClient(); + } + + @Before + public void setUp() throws InterruptedException { + testTable = createAndPopulateTestTable(tableAdmin, dataClient); + } + + @After + public void tearDown() { + if (testTable != null) { + try { + tableAdmin.deleteTable(testTable.getId()); + } catch (Exception e) { + // Ignore. + } + } + } + + @Test + public void createSchemaBundleAndGetSchemaBundleTest() throws IOException, URISyntaxException { + String SchemaBundleId = prefixGenerator.newPrefix(); + byte[] content = Files.readAllBytes(Paths.get(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.of(testTable.getId(), SchemaBundleId) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + try { + SchemaBundle response = tableAdmin.createSchemaBundle(request); + assertWithMessage("Got wrong schema bundle Id in createSchemaBundle") + .that(response.getId()) + .isEqualTo(SchemaBundleId); + assertWithMessage("Got wrong proto schema in createSchemaBundle") + .that(response.getProtoSchema()) + .isEqualTo(ByteString.copyFrom(content)); + + response = tableAdmin.getSchemaBundle(testTable.getId(), SchemaBundleId); + assertWithMessage("Got wrong schema bundle Id in getSchemaBundle") + .that(response.getId()) + .isEqualTo(SchemaBundleId); + assertWithMessage("Got wrong proto schema in getSchemaBundle") + .that(response.getProtoSchema()) + .isEqualTo(ByteString.copyFrom(content)); + } finally { + tableAdmin.deleteSchemaBundle(testTable.getId(), SchemaBundleId); + } + } + + @Test + public void listSchemaBundlesTest() throws IOException, URISyntaxException { + String SchemaBundleId1 = prefixGenerator.newPrefix(); + String SchemaBundleId2 = prefixGenerator.newPrefix(); + + tableAdmin.createSchemaBundle(createSchemaBundleRequest(SchemaBundleId1)); + tableAdmin.createSchemaBundle(createSchemaBundleRequest(SchemaBundleId2)); + + List response = tableAdmin.listSchemaBundles(testTable.getId()); + // Concurrent tests running may cause flakiness. Use containsAtLeast instead of + // containsExactly. + assertWithMessage("Got wrong schema bundle Ids in listSchemaBundles") + .that(response) + .containsAtLeast( + tableAdmin.getSchemaBundle(testTable.getId(), SchemaBundleId1).getId(), + tableAdmin.getSchemaBundle(testTable.getId(), SchemaBundleId2).getId()); + } + + @Test + public void updateSchemaBundleAndDeleteSchemaBundleTest() + throws InterruptedException, IOException, URISyntaxException { + String SchemaBundleId = prefixGenerator.newPrefix(); + + // Create a schema bundle. + CreateSchemaBundleRequest request = createSchemaBundleRequest(SchemaBundleId); + + SchemaBundle response; + + SchemaBundle ignored = tableAdmin.createSchemaBundle(request); + + // Update the schema bundle. + byte[] content = + Files.readAllBytes(Paths.get(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE))); + UpdateSchemaBundleRequest updateRequest = + UpdateSchemaBundleRequest.of(testTable.getId(), SchemaBundleId) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)); + response = tableAdmin.updateSchemaBundle(updateRequest); + assertWithMessage("Got wrong deletion protection in UpdateSchemaBundle") + .that(response.getProtoSchema()) + .isEqualTo(ByteString.copyFrom(content)); + + // Now we should be able to successfully delete the SchemaBundle. + tableAdmin.deleteSchemaBundle(testTable.getId(), SchemaBundleId); + try { + for (int i = 0; i < BACKOFF_DURATION.length; i++) { + tableAdmin.getSchemaBundle(testTable.getId(), SchemaBundleId); + + LOGGER.info( + "Wait for " + + BACKOFF_DURATION[i] + + " seconds for deleting schema bundle " + + SchemaBundleId); + Thread.sleep(BACKOFF_DURATION[i] * 1000); + } + fail("SchemaBundle was not deleted."); + } catch (NotFoundException e) { + assertWithMessage("Incorrect exception type") + .that(e.getCause()) + .isInstanceOf(StatusRuntimeException.class); + } + } + + private CreateSchemaBundleRequest createSchemaBundleRequest(String SchemaBundleId) + throws IOException, URISyntaxException { + return CreateSchemaBundleRequest.of(testTable.getId(), SchemaBundleId) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + } + + private static Table createAndPopulateTestTable( + BigtableTableAdminClient tableAdmin, BigtableDataClient dataClient) + throws InterruptedException { + TableId tableId = + TableId.of(PrefixGenerator.newPrefix("BigtableSchemaBundleIT#createAndPopulateTestTable")); + Table testTable = + tableAdmin.createTable(CreateTableRequest.of(tableId.getTableId()).addFamily("cf1")); + + // Populate test data. + byte[] rowBytes = new byte[1024]; + Random random = new Random(); + random.nextBytes(rowBytes); + + try (Batcher batcher = dataClient.newBulkMutationBatcher(tableId)) { + for (int i = 0; i < 10; i++) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("test-row-" + i) + .setCell("cf1", ByteString.EMPTY, ByteString.copyFrom(rowBytes))); + } + } + return testTable; + } + + private String getResourceFilePath(String filePath) throws URISyntaxException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL protoSchema = cl.getResource(filePath); + return Paths.get(protoSchema.toURI()).toAbsolutePath().toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java new file mode 100644 index 000000000000..e88ccbb9b693 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java @@ -0,0 +1,273 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.it; + +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.Policy; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.ColumnFamily; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.GCRules.DurationRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule; +import com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateTableRequest; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.Maps; +import com.google.protobuf.ByteString; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class BigtableTableAdminClientIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); + + private BigtableTableAdminClient tableAdmin; + private String tableId; + + @Before + public void setUp() { + tableAdmin = testEnvRule.env().getTableAdminClient(); + tableId = prefixGenerator.newPrefix(); + } + + @After + public void tearDown() { + try { + testEnvRule.env().getTableAdminClient().deleteTable(tableId); + } catch (NotFoundException e) { + // table was deleted in test or was never created. Carry on + } + } + + @Test + public void createTable() { + assume() + .withMessage("Emulator doesn't return proper responses for CreateTable") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + CreateTableRequest createTableReq = + CreateTableRequest.of(tableId) + .addFamily("cf1") + .addFamily("cf2", GCRULES.maxVersions(10)) + .addSplit(ByteString.copyFromUtf8("b")) + .addSplit(ByteString.copyFromUtf8("q")) + .addChangeStreamRetention(Duration.ofDays(2)); + + Table tableResponse = tableAdmin.createTable(createTableReq); + assertEquals(tableId, tableResponse.getId()); + + Map columnFamilyById = Maps.newHashMap(); + for (ColumnFamily columnFamily : tableResponse.getColumnFamilies()) { + columnFamilyById.put(columnFamily.getId(), columnFamily); + } + assertEquals(2, tableResponse.getColumnFamilies().size()); + assertFalse(columnFamilyById.get("cf1").hasGCRule()); + assertTrue(columnFamilyById.get("cf2").hasGCRule()); + assertEquals(10, ((VersionRule) columnFamilyById.get("cf2").getGCRule()).getMaxVersions()); + assertEquals(Duration.ofDays(2), tableResponse.getChangeStreamRetention()); + + // Disable change stream so the table can be deleted. + UpdateTableRequest updateTableRequest = + UpdateTableRequest.of(tableId).disableChangeStreamRetention(); + tableAdmin.updateTable(updateTableRequest); + } + + @Test + public void updateTable() { + assume() + .withMessage("Emulator doesn't return proper responses for CreateTable") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + CreateTableRequest createTableReq = + CreateTableRequest.of(tableId) + .addFamily("cf1") + .addChangeStreamRetention(Duration.ofDays(2)); + Table tableResponse = tableAdmin.createTable(createTableReq); + assertEquals(tableId, tableResponse.getId()); + assertEquals(Duration.ofDays(2), tableResponse.getChangeStreamRetention()); + + UpdateTableRequest updateTableRequest = + UpdateTableRequest.of(tableId).addChangeStreamRetention(Duration.ofDays(4)); + tableResponse = tableAdmin.updateTable(updateTableRequest); + assertEquals(tableId, tableResponse.getId()); + assertEquals(Duration.ofDays(4), tableResponse.getChangeStreamRetention()); + + updateTableRequest = UpdateTableRequest.of(tableId).disableChangeStreamRetention(); + tableResponse = tableAdmin.updateTable(updateTableRequest); + assertEquals(tableId, tableResponse.getId()); + assertNull(tableResponse.getChangeStreamRetention()); + } + + @Test + public void modifyFamilies() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + + ModifyColumnFamiliesRequest modifyFamiliesReq = + ModifyColumnFamiliesRequest.of(tableId) + .addFamily("mf1") + .addFamily("mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) + .updateFamily( + "mf1", + GCRULES + .union() + .rule(GCRULES.maxAge(Duration.ofSeconds(100))) + .rule(GCRULES.maxVersions(1))) + .addFamily( + "mf3", + GCRULES + .intersection() + .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) + .rule(GCRULES.maxVersions(10))) + .addFamily("mf4", GCRULES.intersection().rule(GCRULES.maxAge(Duration.ofSeconds(360)))) + .addFamily("mf5") + .addFamily("mf6") + .dropFamily("mf5") + .dropFamily("mf6") + .addFamily("mf7"); + + Table tableResponse = tableAdmin.modifyFamilies(modifyFamiliesReq); + + Map columnFamilyById = Maps.newHashMap(); + for (ColumnFamily columnFamily : tableResponse.getColumnFamilies()) { + columnFamilyById.put(columnFamily.getId(), columnFamily); + } + assertEquals(5, columnFamilyById.size()); + assertNotNull(columnFamilyById.get("mf1")); + assertNotNull(columnFamilyById.get("mf2")); + assertEquals(2, ((UnionRule) columnFamilyById.get("mf1").getGCRule()).getRulesList().size()); + assertEquals( + 1000, ((DurationRule) columnFamilyById.get("mf2").getGCRule()).getMaxAge().getSeconds()); + assertEquals( + 20000, ((DurationRule) columnFamilyById.get("mf2").getGCRule()).getMaxAge().getNano()); + assertEquals( + 2, ((IntersectionRule) columnFamilyById.get("mf3").getGCRule()).getRulesList().size()); + assertEquals( + 360, ((DurationRule) columnFamilyById.get("mf4").getGCRule()).getMaxAge().getSeconds()); + assertNotNull(columnFamilyById.get("mf7")); + } + + @Test + public void deleteTable() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + tableAdmin.deleteTable(tableId); + } + + @Test + public void getTable() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + Table tableResponse = tableAdmin.getTable(tableId); + assertNotNull(tableResponse); + assertEquals(tableId, tableResponse.getId()); + } + + @Test + public void listTables() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + List tables = tableAdmin.listTables(); + assertNotNull(tables); + assertFalse("List tables did not return any tables", tables.isEmpty()); + } + + @Test + public void listTablesAsync() throws Exception { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + List tables = tableAdmin.listTablesAsync().get(); + assertNotNull(tables); + assertFalse("List tables did not return any tables", tables.isEmpty()); + } + + @Test + public void dropRowRange() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + tableAdmin.dropRowRange(tableId, "rowPrefix"); + tableAdmin.dropAllRows(tableId); + } + + @Test + public void awaitConsistency() { + tableAdmin.createTable(CreateTableRequest.of(tableId)); + tableAdmin.awaitConsistency(ConsistencyRequest.forReplication(tableId)); + } + + /** + * Note: Data Boost consistency is essentially a check that the data you are trying to read was + * written at least 35 minutes ago. The test thus takes ~35 minutes, and we should add a separate + * profile to run this concurrently with the other tests. + */ + @Test + @Ignore + public void awaitDataBoostConsistency() { + assume() + .withMessage("Data Boost consistency not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + tableAdmin.createTable(CreateTableRequest.of(tableId)); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(tableId); + tableAdmin.awaitConsistency(consistencyRequest); + } + + @Test + public void iamUpdateTest() { + assume() + .withMessage("Emulator doesn't return proper responses for IAM Policy operations") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + tableAdmin.createTable(CreateTableRequest.of(tableId)); + Policy policy = tableAdmin.getIamPolicy(tableId); + assertThat(policy).isNotNull(); + + Exception actualEx = null; + try { + assertThat(tableAdmin.setIamPolicy(tableId, policy)).isNotNull(); + } catch (Exception iamException) { + actualEx = iamException; + } + assertThat(actualEx).isNull(); + + List permissions = + tableAdmin.testIamPermission( + tableId, "bigtable.tables.readRows", "bigtable.tables.mutateRows"); + assertThat(permissions).hasSize(2); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java new file mode 100644 index 000000000000..c0ad53b674d8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java @@ -0,0 +1,346 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting; +import com.google.bigtable.admin.v2.AppProfileName; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.Priority; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.SingleClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import com.google.common.collect.ImmutableList; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class AppProfileTest { + private static final com.google.bigtable.admin.v2.AppProfile TEST_PROTO = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true) + .build()) + .setEtag("my-etag") + .build(); + + @Test + public void testFromProto() { + AppProfile profile = AppProfile.fromProto(TEST_PROTO); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + assertThat(profile.getPolicy()).isEqualTo(SingleClusterRoutingPolicy.of("my-cluster", true)); + } + + @Test + public void testFromProtoWithMultiCluster() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .build()) + .setEtag("my-etag") + .build()); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + assertThat(profile.getPolicy()).isEqualTo(AppProfile.MultiClusterRoutingPolicy.of()); + } + + @Test + public void testFromProtoWithMultiClusterWithIds() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .build()) + .setEtag("my-etag") + .build()); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + assertThat(profile.getPolicy()) + .isEqualTo(AppProfile.MultiClusterRoutingPolicy.of("cluster-id-1", "cluster-id-2")); + } + + @Test + public void testFromProtoWithStandardIsolation() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true) + .build()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM) + .build()) + .setEtag("my-etag") + .build()); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + assertThat(profile.getPolicy()).isEqualTo(SingleClusterRoutingPolicy.of("my-cluster", true)); + assertThat(profile.getIsolationPolicy()).isEqualTo(StandardIsolationPolicy.of(Priority.MEDIUM)); + } + + @Test + public void testNoNameError() { + Exception actualException = null; + + try { + AppProfile.fromProto(TEST_PROTO.toBuilder().setName("").build()); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testNoPolicyError() { + Exception actualException = null; + + try { + AppProfile.fromProto(TEST_PROTO.toBuilder().clearSingleClusterRouting().build()); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testEquals() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .build()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM) + .build()) + .setEtag("my-etag") + .build()); + + UpdateAppProfileRequest updateAppProfileRequest = UpdateAppProfileRequest.of(profile); + UpdateAppProfileRequest updateAppProfileRequest2 = UpdateAppProfileRequest.of(profile); + + assertThat(updateAppProfileRequest).isEqualTo(updateAppProfileRequest2); + + AppProfile profile2 = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project-2", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .build()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM) + .build()) + .setEtag("my-etag") + .build()); + UpdateAppProfileRequest updateAppProfileRequest3 = UpdateAppProfileRequest.of(profile2); + + assertThat(updateAppProfileRequest).isNotEqualTo(updateAppProfileRequest3); + } + + @Test + public void testHashCode() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .build()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM) + .build()) + .setEtag("my-etag") + .build()); + + UpdateAppProfileRequest updateAppProfileRequest = UpdateAppProfileRequest.of(profile); + UpdateAppProfileRequest updateAppProfileRequest2 = UpdateAppProfileRequest.of(profile); + + assertThat(updateAppProfileRequest.hashCode()).isEqualTo(updateAppProfileRequest2.hashCode()); + + AppProfile profile2 = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project-2", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .build()) + .setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_MEDIUM) + .build()) + .setEtag("my-etag") + .build()); + UpdateAppProfileRequest updateAppProfileRequest3 = UpdateAppProfileRequest.of(profile2); + + assertThat(updateAppProfileRequest.hashCode()) + .isNotEqualTo(updateAppProfileRequest3.hashCode()); + } + + @Test + public void testFromProtoWithDataBoostIsolation() { + AppProfile producer = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true) + .build()) + .setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.newBuilder() + .setComputeBillingOwner( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .ComputeBillingOwner.HOST_PAYS)) + .setEtag("my-etag") + .build()); + + assertThat(producer.getInstanceId()).isEqualTo("my-instance"); + assertThat(producer.getId()).isEqualTo("my-profile"); + assertThat(producer.getDescription()).isEqualTo("my description"); + assertThat(producer.getPolicy()).isEqualTo(SingleClusterRoutingPolicy.of("my-cluster", true)); + assertThat(producer.getIsolationPolicy()) + .isEqualTo( + AppProfile.DataBoostIsolationReadOnlyPolicy.of( + AppProfile.ComputeBillingOwner.HOST_PAYS)); + + AppProfile consumer = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true) + .build()) + .setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.newBuilder() + .setComputeBillingOwner( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .ComputeBillingOwner.COMPUTE_BILLING_OWNER_UNSPECIFIED)) + .setEtag("my-etag") + .build()); + + assertThat(consumer.getInstanceId()).isEqualTo("my-instance"); + assertThat(consumer.getId()).isEqualTo("my-profile"); + assertThat(consumer.getDescription()).isEqualTo("my description"); + assertThat(consumer.getPolicy()).isEqualTo(SingleClusterRoutingPolicy.of("my-cluster", true)); + assertThat(consumer.getIsolationPolicy()) + .isEqualTo( + AppProfile.DataBoostIsolationReadOnlyPolicy.of( + AppProfile.ComputeBillingOwner.UNSPECIFIED)); + } + + @Test + public void testFromProtoWithRowAffinityNoClusterGroup() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build()) + .build()) + .setEtag("my-etag") + .build()); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + System.out.println(profile.getPolicy()); + System.out.println(AppProfile.MultiClusterRoutingPolicy.withRowAffinity()); + assertThat(profile.getPolicy()) + .isEqualTo(AppProfile.MultiClusterRoutingPolicy.withRowAffinity()); + } + + @Test + public void testFromProtoWithRowAffinityClusterGroup() { + AppProfile profile = + AppProfile.fromProto( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName(AppProfileName.of("my-project", "my-instance", "my-profile").toString()) + .setDescription("my description") + .setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + .addAllClusterIds(ImmutableList.of("cluster-id-1", "cluster-id-2")) + .setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity.newBuilder() + .build()) + .build()) + .setEtag("my-etag") + .build()); + + assertThat(profile.getInstanceId()).isEqualTo("my-instance"); + assertThat(profile.getId()).isEqualTo("my-profile"); + assertThat(profile.getDescription()).isEqualTo("my description"); + assertThat(profile.getPolicy()) + .isEqualTo( + AppProfile.MultiClusterRoutingPolicy.withRowAffinity("cluster-id-1", "cluster-id-2")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java new file mode 100644 index 000000000000..d5a87c7cfa0e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java @@ -0,0 +1,185 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AuthorizedViewName; +import com.google.protobuf.ByteString; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class AuthorizedViewTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String AUTHORIZED_VIEW_ID = "my-authorized-view"; + + @Test + public void testFromProto() { + AuthorizedViewName authorizedViewName = + AuthorizedViewName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID); + + com.google.bigtable.admin.v2.AuthorizedView.SubsetView subsetViewProto = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row1#")) + .addRowPrefixes(ByteString.copyFromUtf8("row2#")) + .putFamilySubsets( + "family1", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column1")) + .addQualifiers(ByteString.copyFromUtf8("column2")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column3#")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column4#")) + .build()) + .putFamilySubsets( + "family2", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column5")) + .addQualifierPrefixes(ByteString.copyFromUtf8("")) + .build()) + .build(); + + com.google.bigtable.admin.v2.AuthorizedView authorizedViewProto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(true) + .setSubsetView(subsetViewProto) + .build(); + + AuthorizedView result = AuthorizedView.fromProto(authorizedViewProto); + + assertThat(result.getId()).isEqualTo(AUTHORIZED_VIEW_ID); + assertThat(result.getTableId()).isEqualTo(TABLE_ID); + assertThat(result.isDeletionProtected()).isTrue(); + SubsetView subsetViewResult = (SubsetView) result.getAuthorizedViewType(); + assertThat(subsetViewResult).isEqualTo(SubsetView.fromProto(subsetViewProto)); + assertThat(subsetViewResult.getRowPrefixes()) + .containsExactly(ByteString.copyFromUtf8("row1#"), ByteString.copyFromUtf8("row2#")); + + Map familySubsetsResult = subsetViewResult.getFamilySubsets(); + assertThat(familySubsetsResult) + .containsExactly( + "family1", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family1")), + "family2", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family2"))); + assertThat(familySubsetsResult.get("family1").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column1"), ByteString.copyFromUtf8("column2")); + assertThat(familySubsetsResult.get("family1").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("column3#"), ByteString.copyFromUtf8("column4#")); + assertThat(familySubsetsResult.get("family2").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column5")); + assertThat(familySubsetsResult.get("family2").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("")); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.AuthorizedView proto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder().build()) + .build(); + + Exception actualException = null; + + try { + AuthorizedView.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testRequiresAuthorizedViewType() { + AuthorizedViewName authorizedViewName = + AuthorizedViewName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID); + com.google.bigtable.admin.v2.AuthorizedView proto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(true) + .build(); + Exception actualException = null; + + try { + AuthorizedView.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testEquality() { + AuthorizedViewName authorizedViewName = + AuthorizedViewName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID); + com.google.bigtable.admin.v2.AuthorizedView proto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder().build()) + .build(); + AuthorizedView authorizedView = AuthorizedView.fromProto(proto); + + assertThat(authorizedView).isEqualTo(AuthorizedView.fromProto(proto)); + + assertThat(authorizedView) + .isNotEqualTo( + AuthorizedView.fromProto( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(false) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder().build()) + .build())); + } + + @Test + public void testHashCode() { + AuthorizedViewName authorizedViewName = + AuthorizedViewName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID); + com.google.bigtable.admin.v2.AuthorizedView proto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder().build()) + .build(); + AuthorizedView authorizedView = AuthorizedView.fromProto(proto); + + assertThat(authorizedView.hashCode()).isEqualTo(AuthorizedView.fromProto(proto).hashCode()); + + assertThat(authorizedView.hashCode()) + .isNotEqualTo( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName(authorizedViewName.toString()) + .setDeletionProtection(false) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder().build()) + .build() + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java new file mode 100644 index 000000000000..2fc9ad239033 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java @@ -0,0 +1,179 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType; +import com.google.cloud.bigtable.common.Status; +import com.google.common.collect.Lists; +import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; +import com.google.rpc.Code; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class BackupTest { + @Test + public void testBackupStateEnumUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.Backup.State.values()); + + List validModelValues = Lists.newArrayList(Backup.State.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.Backup.State protoValue : validProtoValues) { + Backup.State modelValue = Backup.State.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } + + @Test + public void testBackupTypeEnumUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.Backup.BackupType.values()); + + List validModelValues = Lists.newArrayList(Backup.BackupType.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.Backup.BackupType protoValue : validProtoValues) { + Backup.BackupType modelValue = Backup.BackupType.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } + + @Test + public void testFromProto() { + Timestamp expireTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp startTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp endTime = Timestamp.newBuilder().setSeconds(1234).build(); + Timestamp hotToStandardTime = Timestamp.newBuilder().setSeconds(1234).build(); + com.google.bigtable.admin.v2.Backup proto = + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName("projects/my-project/instances/instance1/clusters/cluster1/backups/backup1") + .setSourceTable("projects/my-project/instances/instance1/tables/table1") + .setSourceBackup( + "projects/my-project/instances/instance1/clusters/cluster1/backups/backup2") + .setExpireTime(expireTime) + .setStartTime(startTime) + .setEndTime(endTime) + .setHotToStandardTime(hotToStandardTime) + .setSizeBytes(123456) + .setState(com.google.bigtable.admin.v2.Backup.State.READY) + .setBackupType(com.google.bigtable.admin.v2.Backup.BackupType.HOT) + .build(); + + Backup result = Backup.fromProto(proto); + + assertThat(result.getId()).isEqualTo("backup1"); + assertThat(result.getSourceTableId()).isEqualTo("table1"); + assertThat(result.getSourceBackupId()).isEqualTo("backup2"); + assertThat(result.getExpireTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); + assertThat(result.getStartTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(startTime))); + assertThat(result.getEndTime()).isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(endTime))); + assertThat(result.getHotToStandardTime()) + .isEqualTo(Instant.ofEpochMilli(Timestamps.toMillis(hotToStandardTime))); + assertThat(result.getSizeBytes()).isEqualTo(123456); + assertThat(result.getState()).isEqualTo(Backup.State.READY); + assertThat(result.getBackupType()).isEqualTo(Backup.BackupType.HOT); + } + + @Test + public void testFromProtoCmek() { + com.google.bigtable.admin.v2.Backup proto = + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName("projects/my-project/instances/instance1/clusters/cluster1/backups/backup1") + .setSourceTable("projects/my-project/instances/instance1/tables/table1") + .setExpireTime(Timestamp.newBuilder().setSeconds(1234)) + .setStartTime(Timestamp.newBuilder().setSeconds(1234)) + .setEndTime(Timestamp.newBuilder().setSeconds(1234)) + .setSizeBytes(123456) + .setState(com.google.bigtable.admin.v2.Backup.State.READY) + .setEncryptionInfo( + com.google.bigtable.admin.v2.EncryptionInfo.newBuilder() + .setEncryptionType(EncryptionType.CUSTOMER_MANAGED_ENCRYPTION) + .setKmsKeyVersion("some key version") + .setEncryptionStatus( + com.google.rpc.Status.newBuilder().setCode(Code.OK.getNumber()).build()) + .build()) + .build(); + + Backup result = Backup.fromProto(proto); + + assertThat(result.getEncryptionInfo().getType()) + .isEqualTo(EncryptionInfo.Type.CUSTOMER_MANAGED_ENCRYPTION); + assertThat(result.getEncryptionInfo().getKmsKeyVersion()).isEqualTo("some key version"); + assertThat(result.getEncryptionInfo().getStatus().getCode()).isEqualTo(Status.Code.OK); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.Backup proto = + com.google.bigtable.admin.v2.Backup.newBuilder() + .setSourceTable("projects/my-project/instances/instance1/tables/table1") + .setExpireTime(Timestamp.newBuilder().setSeconds(1234).build()) + .setStartTime(Timestamp.newBuilder().setSeconds(123).build()) + .setEndTime(Timestamp.newBuilder().setSeconds(456).build()) + .setSizeBytes(123456) + .setState(com.google.bigtable.admin.v2.Backup.State.READY) + .build(); + + Exception actualException = null; + + try { + Backup.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testRequiresSourceTable() { + com.google.bigtable.admin.v2.Backup proto = + com.google.bigtable.admin.v2.Backup.newBuilder() + .setName("projects/my-project/instances/instance1/clusters/cluster1/backups/backup1") + .setExpireTime(Timestamp.newBuilder().setSeconds(1234).build()) + .setStartTime(Timestamp.newBuilder().setSeconds(123).build()) + .setEndTime(Timestamp.newBuilder().setSeconds(456).build()) + .setSizeBytes(123456) + .setState(com.google.bigtable.admin.v2.Backup.State.READY) + .build(); + + Exception actualException = null; + + try { + Backup.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfigTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfigTest.java new file mode 100644 index 000000000000..f36bacb675d7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfigTest.java @@ -0,0 +1,110 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AutoscalingLimits; +import com.google.bigtable.admin.v2.AutoscalingTargets; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.PartialUpdateClusterRequest; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ClusterAutoscalingConfigTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String CLUSTER_ID = "my-cluster"; + + @Test + public void testToProto() { + ClusterAutoscalingConfig request = + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setMaxNodes(10) + .setMinNodes(3) + .setCpuUtilizationTargetPercent(30); + + PartialUpdateClusterRequest partialUpdateClusterRequestProto = request.toProto(PROJECT_ID); + + AutoscalingTargets autoscalingTargets = + AutoscalingTargets.newBuilder().setCpuUtilizationPercent(30).build(); + AutoscalingLimits autoscalingLimits = + AutoscalingLimits.newBuilder().setMinServeNodes(3).setMaxServeNodes(10).build(); + Cluster.ClusterAutoscalingConfig clusterAutoscalingConfig = + Cluster.ClusterAutoscalingConfig.newBuilder() + .setAutoscalingTargets(autoscalingTargets) + .setAutoscalingLimits(autoscalingLimits) + .build(); + Cluster.ClusterConfig clusterConfig = + Cluster.ClusterConfig.newBuilder() + .setClusterAutoscalingConfig(clusterAutoscalingConfig) + .build(); + Cluster cluster = + Cluster.newBuilder() + .setName(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .setClusterConfig(clusterConfig) + .build(); + PartialUpdateClusterRequest requestProto = + PartialUpdateClusterRequest.newBuilder() + .setUpdateMask( + FieldMask.newBuilder() + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_limits.max_serve_nodes") + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_limits.min_serve_nodes") + .addPaths( + "cluster_config.cluster_autoscaling_config.autoscaling_targets.cpu_utilization_percent")) + .setCluster(cluster) + .build(); + assertThat(partialUpdateClusterRequestProto).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + ClusterAutoscalingConfig request = + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setCpuUtilizationTargetPercent(10) + .setMaxNodes(2) + .setMinNodes(1); + assertThat(request) + .isEqualTo( + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setCpuUtilizationTargetPercent(10) + .setMaxNodes(2) + .setMinNodes(1)); + assertThat(request) + .isNotEqualTo( + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) + .setCpuUtilizationTargetPercent(1) + .setMaxNodes(2) + .setMinNodes(1)); + } + + @Test + public void testHashCode() { + ClusterAutoscalingConfig request = + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID).setMaxNodes(10); + assertThat(request.hashCode()) + .isEqualTo(ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID).setMaxNodes(10).hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID).setMinNodes(50).hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java new file mode 100644 index 000000000000..f2f217ab56b5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java @@ -0,0 +1,113 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.Cluster.EncryptionConfig; +import com.google.bigtable.admin.v2.Cluster.State; +import com.google.common.collect.Lists; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ClusterTest { + + @Test + public void testFromProto() { + com.google.bigtable.admin.v2.Cluster proto = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName("projects/my-project/instances/my-instance/clusters/my-cluster") + .setLocation("projects/my-project/locations/us-east1-c") + .setState(State.READY) + .setServeNodes(30) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build(); + + Cluster result = Cluster.fromProto(proto); + + assertThat(result.getId()).isEqualTo("my-cluster"); + assertThat(result.getInstanceId()).isEqualTo("my-instance"); + assertThat(result.getZone()).isEqualTo("us-east1-c"); + assertThat(result.getState()).isEqualTo(Cluster.State.READY); + assertThat(result.getServeNodes()).isEqualTo(30); + assertThat(result.getStorageType()).isEqualTo(StorageType.SSD); + assertThat(result.getKmsKeyName()).isEqualTo(null); + } + + @Test + public void testFromProtoCmek() { + com.google.bigtable.admin.v2.Cluster proto = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setName("projects/my-project/instances/my-instance/clusters/my-cluster") + .setLocation("projects/my-project/locations/us-east1-c") + .setState(State.READY) + .setServeNodes(30) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .setEncryptionConfig( + EncryptionConfig.newBuilder() + .setKmsKeyName( + "projects/my-project/locations/us-east1-c/keyRings/my-key-ring/cryptoKeys/my-key") + .build()) + .build(); + + Cluster result = Cluster.fromProto(proto); + + assertThat(result.getKmsKeyName()) + .isEqualTo( + "projects/my-project/locations/us-east1-c/keyRings/my-key-ring/cryptoKeys/my-key"); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.Cluster proto = + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setState(com.google.bigtable.admin.v2.Cluster.State.READY) + .setServeNodes(30) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build(); + + Exception actualException = null; + + try { + Cluster.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testStateEnumUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.Cluster.State.values()); + + List validModelValues = Lists.newArrayList(Cluster.State.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.Cluster.State protoValue : validProtoValues) { + Cluster.State modelValue = Cluster.State.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.java new file mode 100644 index 000000000000..b05a1bbd1499 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ConsistencyRequestTest { + private final String PROJECT_ID = "my-project"; + private final String INSTANCE_ID = "my-instance"; + private final String TABLE_ID = "my-table"; + private final String CONSISTENCY_TOKEN = "my-token"; + + @Test + public void testToCheckConsistencyProtoWithStandard() { + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + + TableAdminRequestContext requestContext = + TableAdminRequestContext.create(PROJECT_ID, INSTANCE_ID); + + CheckConsistencyRequest checkConsistencyRequest = + consistencyRequest.toCheckConsistencyProto(requestContext, CONSISTENCY_TOKEN); + + assertThat(checkConsistencyRequest.getName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(checkConsistencyRequest.getConsistencyToken()).isEqualTo(CONSISTENCY_TOKEN); + assertThat(checkConsistencyRequest.getModeCase()) + .isEqualTo(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES); + } + + @Test + public void testToCheckConsistencyProtoWithDataBoost() { + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(TABLE_ID); + + TableAdminRequestContext requestContext = + TableAdminRequestContext.create(PROJECT_ID, INSTANCE_ID); + + CheckConsistencyRequest checkConsistencyRequest = + consistencyRequest.toCheckConsistencyProto(requestContext, CONSISTENCY_TOKEN); + + assertThat(checkConsistencyRequest.getName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(checkConsistencyRequest.getConsistencyToken()).isEqualTo(CONSISTENCY_TOKEN); + assertThat(checkConsistencyRequest.getModeCase()) + .isEqualTo(CheckConsistencyRequest.ModeCase.DATA_BOOST_READ_LOCAL_WRITES); + } + + @Test + public void testToGenerateTokenProto() { + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(TABLE_ID); + + TableAdminRequestContext requestContext = + TableAdminRequestContext.create(PROJECT_ID, INSTANCE_ID); + + GenerateConsistencyTokenRequest generateRequest = + consistencyRequest.toGenerateTokenProto(requestContext); + + assertThat(generateRequest.getName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + } + + @Test + public void testToCheckConsistencyProtoWithToken() { + ConsistencyRequest consistencyRequest = + ConsistencyRequest.forReplication(TABLE_ID, CONSISTENCY_TOKEN); + + TableAdminRequestContext requestContext = + TableAdminRequestContext.create(PROJECT_ID, INSTANCE_ID); + + CheckConsistencyRequest checkConsistencyRequest = + consistencyRequest.toCheckConsistencyProto(requestContext, CONSISTENCY_TOKEN); + + assertThat(checkConsistencyRequest.getName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(checkConsistencyRequest.getConsistencyToken()).isEqualTo(CONSISTENCY_TOKEN); + assertThat(checkConsistencyRequest.getModeCase()) + .isEqualTo(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES); + } + + @Test + public void testToCheckConsistencyProtoFromTableName() { + String fullTableName = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + ConsistencyRequest consistencyRequest = + ConsistencyRequest.forReplicationFromTableName(fullTableName); + + CheckConsistencyRequest checkConsistencyRequest = + consistencyRequest.toCheckConsistencyProto(CONSISTENCY_TOKEN); + + assertThat(checkConsistencyRequest.getName()).isEqualTo(fullTableName); + assertThat(checkConsistencyRequest.getConsistencyToken()).isEqualTo(CONSISTENCY_TOKEN); + assertThat(checkConsistencyRequest.getModeCase()) + .isEqualTo(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES); + } + + @Test + public void testToCheckConsistencyProtoFromTableNameWithToken() { + String fullTableName = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + ConsistencyRequest consistencyRequest = + ConsistencyRequest.forReplicationFromTableName(fullTableName, CONSISTENCY_TOKEN); + + CheckConsistencyRequest checkConsistencyRequest = + consistencyRequest.toCheckConsistencyProto(CONSISTENCY_TOKEN); + + assertThat(checkConsistencyRequest.getName()).isEqualTo(fullTableName); + assertThat(checkConsistencyRequest.getConsistencyToken()).isEqualTo(CONSISTENCY_TOKEN); + assertThat(checkConsistencyRequest.getModeCase()) + .isEqualTo(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES); + } + + @Test + public void testToGenerateTokenProtoFromTableName() { + String fullTableName = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + ConsistencyRequest consistencyRequest = + ConsistencyRequest.forReplicationFromTableName(fullTableName); + + GenerateConsistencyTokenRequest generateRequest = consistencyRequest.toGenerateTokenProto(); + + assertThat(generateRequest.getName()).isEqualTo(fullTableName); + } + + @Test(expected = IllegalArgumentException.class) + public void testForReplicationFromTableNameInvalid() { + ConsistencyRequest.forReplicationFromTableName(TABLE_ID); + } + + @Test(expected = IllegalArgumentException.class) + public void testForReplicationFromTableNameWithTokenInvalid() { + ConsistencyRequest.forReplicationFromTableName(TABLE_ID, CONSISTENCY_TOKEN); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequestTest.java new file mode 100644 index 000000000000..df8830da8e70 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequestTest.java @@ -0,0 +1,231 @@ +/* + * 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.google.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.util.Timestamps; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class CopyBackupRequestTest { + + private static final String BACKUP_ID = "my-backup"; + private static final String CLUSTER_ID = "my-cluster"; + private static final String INSTANCE_ID = "my-instance"; + private static final String PROJECT_ID = "my-project"; + private static final String SOURCE_BACKUP_ID = "source-backup-id"; + private static final String SOURCE_CLUSTER_ID = "source-cluster-id"; + private static final String SOURCE_INSTANCE_ID = "source-instance-id"; + private static final String SOURCE_PROJECT_ID = "source-project-id"; + private static final Instant EXPIRE_TIME = Instant.now().plus(Duration.ofDays(15)); + + @Test + public void testToProto() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + com.google.bigtable.admin.v2.CopyBackupRequest requestProto = + com.google.bigtable.admin.v2.CopyBackupRequest.newBuilder() + .setParent(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .setSourceBackup( + NameUtil.formatBackupName( + PROJECT_ID, INSTANCE_ID, SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID)) + .setExpireTime(Timestamps.fromMillis(EXPIRE_TIME.toEpochMilli())) + .setBackupId(BACKUP_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testToProtoCrossInstance() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + com.google.bigtable.admin.v2.CopyBackupRequest requestProto = + com.google.bigtable.admin.v2.CopyBackupRequest.newBuilder() + .setParent(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .setSourceBackup( + NameUtil.formatBackupName( + PROJECT_ID, SOURCE_INSTANCE_ID, SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID)) + .setExpireTime(Timestamps.fromMillis(EXPIRE_TIME.toEpochMilli())) + .setBackupId(BACKUP_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testToProtoCrossProject() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + com.google.bigtable.admin.v2.CopyBackupRequest requestProto = + com.google.bigtable.admin.v2.CopyBackupRequest.newBuilder() + .setParent(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .setSourceBackup( + NameUtil.formatBackupName( + SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID, SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID)) + .setExpireTime(Timestamps.fromMillis(EXPIRE_TIME.toEpochMilli())) + .setBackupId(BACKUP_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME)); + assertThat(request) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME)); + } + + @Test + public void testEqualityCrossInstance() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME)); + assertThat(request) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME)); + } + + @Test + public void testEqualityCrossProject() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME)); + assertThat(request) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME)); + } + + @Test + public void testHashCode() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request.hashCode()) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME) + .hashCode()); + } + + @Test + public void testHashCodeCrossInstance() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request.hashCode()) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME) + .hashCode()); + } + + @Test + public void testHashCodeCrossProject() { + CopyBackupRequest request = + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME); + + assertThat(request.hashCode()) + .isEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + CopyBackupRequest.of(SOURCE_CLUSTER_ID, SOURCE_BACKUP_ID) + .setSourceInstance(SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID) + .setDestination(CLUSTER_ID, "another-backup") + .setExpireTime(EXPIRE_TIME) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java new file mode 100644 index 000000000000..32f882b30fbc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java @@ -0,0 +1,117 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; +import com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; +import com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting; +import com.google.bigtable.admin.v2.AppProfile.StandardIsolation; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.MultiClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.SingleClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateAppProfileRequestTest { + @Test + public void testToProto() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setDescription("my description") + .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster", true)) + .setIgnoreWarnings(true); + + assertThat(wrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + .setParent(InstanceName.of("my-project", "my-instance").toString()) + .setAppProfileId("my-profile") + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true))) + .setIgnoreWarnings(true) + .build()); + } + + @Test + public void testMultiClusterRouting() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setRoutingPolicy(MultiClusterRoutingPolicy.of()); + + assertThat(wrapper.toProto("my-project").getAppProfile().getMultiClusterRoutingUseAny()) + .isEqualTo(MultiClusterRoutingUseAny.getDefaultInstance()); + } + + @Test + public void testDefaultDescription() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setRoutingPolicy(MultiClusterRoutingPolicy.of()); + + assertThat(wrapper.toProto("my-project").getAppProfile().getDescription()) + .isEqualTo("my-profile"); + } + + @Test + public void testStandardIsolation() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setRoutingPolicy(MultiClusterRoutingPolicy.of()) + .setIsolationPolicy(StandardIsolationPolicy.of()); + + assertThat(wrapper.toProto("my-project").getAppProfile().getStandardIsolation()) + .isEqualTo(StandardIsolation.getDefaultInstance()); + } + + @Test + public void testDataBoostIsolationReadOnly() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setRoutingPolicy(MultiClusterRoutingPolicy.of()) + .setIsolationPolicy( + AppProfile.DataBoostIsolationReadOnlyPolicy.of( + AppProfile.ComputeBillingOwner.HOST_PAYS)); + + assertThat(wrapper.toProto("my-project").getAppProfile().getDataBoostIsolationReadOnly()) + .isEqualTo( + DataBoostIsolationReadOnly.newBuilder() + .setComputeBillingOwner(DataBoostIsolationReadOnly.ComputeBillingOwner.HOST_PAYS) + .build()); + } + + @Test + public void testRowAffinity() { + CreateAppProfileRequest wrapper = + CreateAppProfileRequest.of("my-instance", "my-profile") + .setRoutingPolicy(MultiClusterRoutingPolicy.withRowAffinity()); + + assertThat(wrapper.toProto("my-project").getAppProfile().getMultiClusterRoutingUseAny()) + .isEqualTo( + MultiClusterRoutingUseAny.newBuilder() + .setRowAffinity(MultiClusterRoutingUseAny.RowAffinity.newBuilder().build()) + .build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequestTest.java new file mode 100644 index 000000000000..c661509cee5c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequestTest.java @@ -0,0 +1,108 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateAuthorizedViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String AUTHORIZED_VIEW_ID = "my-authorized-view"; + + @Test + public void testToProto() { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setDeletionProtection(true) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("row#") + .addRowPrefix("another-row#") + .setFamilySubsets( + "family", + FamilySubsets.create() + .addQualifier("column") + .addQualifierPrefix("column#"))); + + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest requestProto = + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAuthorizedViewId(AUTHORIZED_VIEW_ID) + .setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .addRowPrefixes(ByteString.copyFromUtf8("another-row#")) + .putFamilySubsets( + "family", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets + .newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column#")) + .build()))) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")) + .setDeletionProtection(false); + + assertThat(request) + .isEqualTo( + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#"))); + + assertThat(request) + .isNotEqualTo( + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("another-row#"))); + } + + @Test + public void testHashCode() { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")) + .setDeletionProtection(false); + + assertThat(request.hashCode()) + .isEqualTo( + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("another-row#")) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java new file mode 100644 index 000000000000..821919264e85 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java @@ -0,0 +1,136 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.Backup; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.admin.v2.models.Backup.BackupType; +import com.google.protobuf.util.Timestamps; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class CreateBackupRequestTest { + + private static final String TABLE_ID = "my-table"; + private static final String BACKUP_ID = "my-backup"; + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String CLUSTER_ID = "my-cluster"; + private static final Instant EXPIRE_TIME = Instant.now().plus(Duration.ofDays(15)); + private static final Instant HOT_TO_STANDARD_TIME = Instant.now().plus(Duration.ofDays(10)); + + @Test + public void testToProto() { + CreateBackupRequest request = + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + + com.google.bigtable.admin.v2.CreateBackupRequest requestProto = + com.google.bigtable.admin.v2.CreateBackupRequest.newBuilder() + .setBackupId(BACKUP_ID) + .setBackup( + Backup.newBuilder() + .setSourceTable(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setExpireTime(Timestamps.fromMillis(EXPIRE_TIME.toEpochMilli())) + .setBackupType(Backup.BackupType.HOT) + .setHotToStandardTime( + Timestamps.fromMillis(HOT_TO_STANDARD_TIME.toEpochMilli())) + .build()) + .setParent(NameUtil.formatClusterName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID)) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CreateBackupRequest request = + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + + assertThat(request) + .isEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME)); + + assertThat(request) + .isNotEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId("another-table") + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME)); + + assertThat(request) + .isNotEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.STANDARD) + .setHotToStandardTime(HOT_TO_STANDARD_TIME)); + } + + @Test + public void testHashCode() { + CreateBackupRequest request = + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + + assertThat(request.hashCode()) + .isEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId("another-table") + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.HOT) + .setHotToStandardTime(HOT_TO_STANDARD_TIME) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(EXPIRE_TIME) + .setBackupType(BackupType.BACKUP_TYPE_UNSPECIFIED) + .setHotToStandardTime(HOT_TO_STANDARD_TIME) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java new file mode 100644 index 000000000000..fe2894834705 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java @@ -0,0 +1,183 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; + +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.Cluster.EncryptionConfig; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateClusterRequestTest { + @Test + public void testProductionSingle() { + CreateInstanceRequest input = + CreateInstanceRequest.of("my-instance") + .setType(Instance.Type.PRODUCTION) + .addCluster("cluster1", "us-east1-c", 3, StorageType.SSD); + + com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project"); + + com.google.bigtable.admin.v2.CreateInstanceRequest expected = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(NameUtil.formatProjectName("my-project")) + .setInstanceId("my-instance") + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setDisplayName("my-instance") + .setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setServeNodes(3) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testProductionReplication() { + CreateInstanceRequest input = + CreateInstanceRequest.of("my-instance") + .setType(Instance.Type.PRODUCTION) + .addCluster("cluster1", "us-east1-c", 3, StorageType.SSD) + .addCluster("cluster2", "us-east1-a", 3, StorageType.SSD); + + com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project"); + + com.google.bigtable.admin.v2.CreateInstanceRequest expected = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(NameUtil.formatProjectName("my-project")) + .setInstanceId("my-instance") + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setDisplayName("my-instance") + .setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setServeNodes(3) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .putClusters( + "cluster2", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-a") + .setServeNodes(3) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testDevelopment() { + CreateInstanceRequest input = + CreateInstanceRequest.of("my-instance") + .setType(Instance.Type.DEVELOPMENT) + .addDevelopmentCluster("cluster1", "us-east1-c", StorageType.SSD); + + com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project"); + + com.google.bigtable.admin.v2.CreateInstanceRequest expected = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(NameUtil.formatProjectName("my-project")) + .setInstanceId("my-instance") + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setDisplayName("my-instance") + .setType(com.google.bigtable.admin.v2.Instance.Type.DEVELOPMENT)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testOptionalFields() { + CreateInstanceRequest input = + CreateInstanceRequest.of("my-instance") + .setDisplayName("custom display name") + .addLabel("my label", "with some value") + .addLabel("my other label", "with some value") + .addTag("tagKeys/123", "tagValues/456") + .setType(Instance.Type.DEVELOPMENT) + .addCluster("cluster1", "us-east1-c", 1, StorageType.SSD); + + com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project"); + + com.google.bigtable.admin.v2.CreateInstanceRequest expected = + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .setParent(NameUtil.formatProjectName("my-project")) + .setInstanceId("my-instance") + .setInstance( + com.google.bigtable.admin.v2.Instance.newBuilder() + .setDisplayName("custom display name") + .putLabels("my label", "with some value") + .putLabels("my other label", "with some value") + .putTags("tagKeys/123", "tagValues/456") + .setType(com.google.bigtable.admin.v2.Instance.Type.DEVELOPMENT)) + .putClusters( + "cluster1", + com.google.bigtable.admin.v2.Cluster.newBuilder() + .setLocation("projects/my-project/locations/us-east1-c") + .setServeNodes(1) + .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) + .build()) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testCmek() { + String kmsKeyName = + "projects/my-project/locations/us-east1-c/keyRings/my-key-ring/cryptoKeys/my-key"; + + CreateInstanceRequest input = + CreateInstanceRequest.of("my-instance") + .addCmekCluster("cluster1", "us-east1-c", 1, StorageType.SSD, kmsKeyName); + + com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project"); + + assertThat(actual) + .comparingExpectedFieldsOnly() + .isEqualTo( + com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + .putClusters( + "cluster1", + Cluster.newBuilder() + .setEncryptionConfig( + EncryptionConfig.newBuilder().setKmsKeyName(kmsKeyName).build()) + .build()) + .build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequestTest.java new file mode 100644 index 000000000000..eededde65bb3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequestTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateLogicalViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String LOGICAL_VIEW_ID = "my-logical-view"; + + @Test + public void testToProto() { + String query = "SELECT * FROM Table"; + CreateLogicalViewRequest request = + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery(query) + .setDeletionProtection(true); + + com.google.bigtable.admin.v2.CreateLogicalViewRequest requestProto = + com.google.bigtable.admin.v2.CreateLogicalViewRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setLogicalViewId(LOGICAL_VIEW_ID) + .setLogicalView( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setQuery(query) + .setDeletionProtection(true)) + .build(); + assertThat(request.toProto(PROJECT_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CreateLogicalViewRequest request = + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(true); + + assertThat(request) + .isEqualTo( + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(true)); + + assertThat(request) + .isNotEqualTo( + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 2") + .setDeletionProtection(true)); + } + + @Test + public void testHashCode() { + CreateLogicalViewRequest request = + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(true); + + assertThat(request.hashCode()) + .isEqualTo( + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(true) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("test 2") + .setDeletionProtection(true) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequestTest.java new file mode 100644 index 000000000000..1a116f40fdaa --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequestTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateMaterializedViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String MATERIALIZED_VIEW_ID = "my-materialized-view"; + + @Test + public void testToProto() { + String query = "SELECT * FROM Table"; + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(true) + .setQuery(query); + + com.google.bigtable.admin.v2.CreateMaterializedViewRequest requestProto = + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setMaterializedViewId(MATERIALIZED_VIEW_ID) + .setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setDeletionProtection(true) + .setQuery(query)) + .build(); + assertThat(request.toProto(PROJECT_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(false); + + assertThat(request) + .isEqualTo( + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(false)); + + assertThat(request) + .isNotEqualTo( + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 2") + .setDeletionProtection(false)); + } + + @Test + public void testHashCode() { + CreateMaterializedViewRequest request = + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(false); + + assertThat(request.hashCode()) + .isEqualTo( + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 1") + .setDeletionProtection(false) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setQuery("test 2") + .setDeletionProtection(false) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java new file mode 100644 index 000000000000..2d37eccff5b0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java @@ -0,0 +1,107 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CreateSchemaBundleRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle"; + // Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb` + private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb"; + // Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb` + private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb"; + + @Test + public void testToProto() throws IOException, URISyntaxException { + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + byte[] content = Files.readAllBytes(Paths.get(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + com.google.bigtable.admin.v2.CreateSchemaBundleRequest requestProto = + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.newBuilder() + .setParent(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setSchemaBundleId(SCHEMA_BUNDLE_ID) + .setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content)) + .build()) + .build()) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() throws IOException, URISyntaxException { + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + assertThat(request) + .isEqualTo( + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + assertThat(request) + .isNotEqualTo( + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE))); + } + + @Test + public void testHashCode() throws IOException, URISyntaxException { + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + assertThat(request.hashCode()) + .isEqualTo( + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + CreateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)) + .hashCode()); + } + + private String getResourceFilePath(String filePath) throws URISyntaxException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL protoSchema = cl.getResource(filePath); + return Paths.get(protoSchema.toURI()).toAbsolutePath().toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java new file mode 100644 index 000000000000..cbc85c9d32d2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java @@ -0,0 +1,183 @@ +/* + * Copyright 2019 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.cloud.bigtable.admin.v2.models; + +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.Table; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class CreateTableRequestTest { + + private static final String TABLE_ID = "my-table"; + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final ByteString splitKey = ByteString.copyFromUtf8("first-split"); + + @Test + public void testToProto() { + ByteString secondSplitKey = ByteString.copyFromUtf8("second-split"); + + CreateTableRequest request = + CreateTableRequest.of(TABLE_ID) + .addFamily("family-id") + .addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS)) + .addSplit(splitKey) + .addSplit(secondSplitKey) + .addChangeStreamRetention(Duration.ofHours(24)) + .setDeletionProtection(true) + .setAutomatedBackup(Duration.ofHours(24), Duration.ofHours(24)); + + com.google.bigtable.admin.v2.CreateTableRequest requestProto = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setTableId(TABLE_ID) + .setTable( + Table.newBuilder() + .putColumnFamilies("family-id", ColumnFamily.getDefaultInstance()) + .putColumnFamilies( + "another-family", + ColumnFamily.newBuilder() + .setGcRule( + GcRule.newBuilder() + .setMaxAge( + com.google.protobuf.Duration.newBuilder() + .setSeconds(100 * 60 * 60)) + .build()) + .build()) + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .build()) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder() + .setSeconds(86400) + .setNanos(0)) + .setFrequency( + com.google.protobuf.Duration.newBuilder() + .setSeconds(86400) + .setNanos(0)) + .build()) + .setDeletionProtection(true)) + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .addInitialSplits( + com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder().setKey(splitKey)) + .addInitialSplits( + com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder() + .setKey(secondSplitKey)) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testToProtoWithTypes() { + CreateTableRequest request = + CreateTableRequest.of(TABLE_ID) + .addFamily("family-id") + .addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS)) + .addFamily("int-sum-family", Type.int64Sum()) + .addFamily("int-sum-family-2", GCRULES.maxAge(100, TimeUnit.HOURS), Type.int64Sum()); + + com.google.bigtable.admin.v2.CreateTableRequest requestProto = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setTableId(TABLE_ID) + .setTable( + Table.newBuilder() + .putColumnFamilies("family-id", ColumnFamily.getDefaultInstance()) + .putColumnFamilies( + "another-family", + ColumnFamily.newBuilder() + .setGcRule( + GcRule.newBuilder() + .setMaxAge( + com.google.protobuf.Duration.newBuilder() + .setSeconds(100 * 60 * 60)) + .build()) + .build()) + .putColumnFamilies( + "int-sum-family", + ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(Type.int64Sum().toProto()) + .build()) + .putColumnFamilies( + "int-sum-family-2", + ColumnFamily.newBuilder() + .setGcRule( + GcRule.newBuilder() + .setMaxAge( + com.google.protobuf.Duration.newBuilder() + .setSeconds(100 * 60 * 60)) + .build()) + .setValueType(Type.int64Sum().toProto()) + .build())) + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + CreateTableRequest request = + CreateTableRequest.of(TABLE_ID) + .addFamily("family-id") + .addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS)) + .setAutomatedBackup(Duration.ofHours(100), Duration.ofHours(100)) + .addSplit(splitKey); + + assertThat(request) + .isEqualTo( + CreateTableRequest.of(TABLE_ID) + .addFamily("family-id") + .addFamily("another-family", GCRULES.maxAge(Duration.ofHours(100))) + .setAutomatedBackup(Duration.ofHours(100), Duration.ofHours(100)) + .addSplit(splitKey)); + + assertThat(request) + .isNotEqualTo( + CreateTableRequest.of(TABLE_ID) + .addFamily("family-id") + .addFamily("another-family") + .setAutomatedBackup(Duration.ofHours(100), Duration.ofHours(10)) + .addSplit(splitKey)); + } + + @Test + public void testHashCode() { + CreateTableRequest request = + CreateTableRequest.of(TABLE_ID).addFamily("family-id").addSplit(splitKey); + + assertThat(request.hashCode()) + .isEqualTo( + CreateTableRequest.of(TABLE_ID).addFamily("family-id").addSplit(splitKey).hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo(CreateTableRequest.of(TABLE_ID).addFamily("other-family").hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfoTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfoTest.java new file mode 100644 index 000000000000..d0d077be3da0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfoTest.java @@ -0,0 +1,72 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType; +import com.google.cloud.bigtable.common.Status; +import com.google.common.base.Objects; +import com.google.rpc.Code; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class EncryptionInfoTest { + + @Test + public void testAllTypes() { + for (EncryptionType protoValue : + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.values()) { + EncryptionInfo.Type modelValue = EncryptionInfo.Type.fromProto(protoValue); + + assertWithMessage("proto enum value %s should be wrapped", protoValue.toString()) + .that(modelValue.toString()) + .isEqualTo(protoValue.toString()); + } + + com.google.bigtable.admin.v2.EncryptionInfo randomEncryptionInfo = + com.google.bigtable.admin.v2.EncryptionInfo.newBuilder().setEncryptionTypeValue(14).build(); + assertWithMessage("Unrecognized proto enum value should be wrapped") + .that(EncryptionInfo.Type.fromProto(randomEncryptionInfo.getEncryptionType())) + .isEqualTo(EncryptionInfo.Type.UNRECOGNIZED); + } + + @Test + public void testFromProto() { + com.google.rpc.Status protoStatus = + com.google.rpc.Status.newBuilder() + .setCode(Code.UNAVAILABLE.getNumber()) + .setMessage("kms is unavailable") + .build(); + + com.google.bigtable.admin.v2.EncryptionInfo proto = + com.google.bigtable.admin.v2.EncryptionInfo.newBuilder() + .setEncryptionType(EncryptionType.CUSTOMER_MANAGED_ENCRYPTION) + .setKmsKeyVersion("some version") + .setEncryptionStatus(protoStatus) + .build(); + EncryptionInfo encryptionInfo = EncryptionInfo.fromProto(proto); + + assertThat(encryptionInfo.getStatus()).isEqualTo(Status.fromProto(protoStatus)); + assertThat(encryptionInfo.getType()).isEqualTo(EncryptionInfo.Type.CUSTOMER_MANAGED_ENCRYPTION); + assertThat(encryptionInfo.getKmsKeyVersion()).isEqualTo("some version"); + assertThat(encryptionInfo.toString()).isEqualTo(proto.toString()); + assertThat(encryptionInfo.hashCode()).isEqualTo(Objects.hashCode(proto)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsetsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsetsTest.java new file mode 100644 index 000000000000..bfcc62fe9c6d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsetsTest.java @@ -0,0 +1,82 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AuthorizedView; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class FamilySubsetsTest { + + @Test + public void testFromProto() { + AuthorizedView.FamilySubsets familySubsetsProto = + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column1")) + .addQualifiers(ByteString.copyFromUtf8("column2")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column3#")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column4#")) + .build(); + + FamilySubsets result = FamilySubsets.fromProto(familySubsetsProto); + + assertThat(result.getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column1"), ByteString.copyFromUtf8("column2")); + assertThat(result.getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("column3#"), ByteString.copyFromUtf8("column4#")); + } + + @Test + public void testEquality() { + AuthorizedView.FamilySubsets proto = + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column1")) + .build(); + FamilySubsets familySubsets = FamilySubsets.fromProto(proto); + + assertThat(familySubsets).isEqualTo(FamilySubsets.fromProto(proto)); + assertThat(familySubsets) + .isNotEqualTo( + FamilySubsets.fromProto( + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifierPrefixes(ByteString.copyFromUtf8("column1")) + .build())); + } + + @Test + public void testHashCode() { + AuthorizedView.FamilySubsets proto = + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column1")) + .build(); + FamilySubsets familySubsets = FamilySubsets.fromProto(proto); + + assertThat(familySubsets.hashCode()).isEqualTo(FamilySubsets.fromProto(proto).hashCode()); + assertThat(familySubsets.hashCode()) + .isNotEqualTo( + FamilySubsets.fromProto( + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifierPrefixes(ByteString.copyFromUtf8("column1")) + .build()) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java new file mode 100644 index 000000000000..b949851ca188 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java @@ -0,0 +1,374 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.GcRule.Intersection; +import com.google.bigtable.admin.v2.GcRule.Union; +import com.google.cloud.bigtable.admin.v2.models.GCRules.DurationRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule; +import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class GCRulesTest { + + @Test + public void duration() { + DurationRule actual = GCRULES.maxAge(Duration.ofSeconds(61, 9)); + GcRule expected = buildAgeRule(61, 9); + assertNotNull(actual.getMaxAge()); + assertThat(actual.toProto()).isEqualTo(expected); + } + + @Test + public void durationSeconds() { + GcRule actual = GCRULES.maxAge(Duration.ofSeconds(1)).toProto(); + GcRule expected = buildAgeRule(1, 0); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void durationNanos() { + GcRule actual = GCRULES.maxAge(Duration.ofNanos(11)).toProto(); + GcRule expected = buildAgeRule(0, 11); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void durationTimeUnitSeconds() { + GcRule actual = GCRULES.maxAge(1, TimeUnit.DAYS).toProto(); + GcRule expected = buildAgeRule(3600 * 24, 0); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void durationTimeUnitMinutes() { + GcRule actual = GCRULES.maxAge(1, TimeUnit.MINUTES).toProto(); + GcRule expected = buildAgeRule(60, 0); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void durationTimeUnitNanos() { + GcRule actual = GCRULES.maxAge(1, TimeUnit.NANOSECONDS).toProto(); + GcRule expected = buildAgeRule(0, 1); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void durationTimeUnitNegative() { + GcRule actual = GCRULES.maxAge(-1, TimeUnit.MINUTES).toProto(); + GcRule expected = buildAgeRule(-60, 0); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void versions() { + VersionRule actual = GCRULES.maxVersions(10); + GcRule expected = buildVersionsRule(10); + assertThat(actual.toProto()).isEqualTo(expected); + } + + @Test + public void unionEmpty() { + GcRule actual = GCRULES.union().toProto(); + GcRule expected = GcRule.newBuilder().build(); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void unionOne() { + GcRule actual = GCRULES.union().rule(GCRULES.maxVersions(1)).toProto(); + GcRule expected = buildVersionsRule(1); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void unionTwo() { + GcRule actual = + GCRULES + .union() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1))) + .toProto(); + + GcRule expected = + GcRule.newBuilder() + .setUnion( + Union.newBuilder().addRules(buildVersionsRule(1)).addRules(buildAgeRule(1, 0))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void unionThree() { + GcRule actual = + GCRULES + .union() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1))) + .rule(GCRULES.maxAge(Duration.ofNanos(1))) + .toProto(); + + GcRule expected = + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0)) + .addRules(buildAgeRule(0, 1))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void intersectionEmpty() { + GcRule actual = GCRULES.intersection().toProto(); + GcRule expected = GcRule.newBuilder().build(); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void intersectionOne() { + GcRule actual = GCRULES.intersection().rule(GCRULES.maxVersions(1)).toProto(); + GcRule expected = buildVersionsRule(1); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void intersectionTwo() { + GcRule actual = + GCRULES + .intersection() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1))) + .toProto(); + + GcRule expected = + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void intersectionThree() { + GcRule actual = + GCRULES + .intersection() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1))) + .rule(GCRULES.maxAge(Duration.ofNanos(1))) + .toProto(); + + GcRule expected = + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0)) + .addRules(buildAgeRule(0, 1))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void unionOfIntersections() { + UnionRule actual = + GCRULES + .union() + .rule( + GCRULES + .intersection() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1)))) + .rule( + GCRULES + .intersection() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1)))); + + GcRule expected = + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules( + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0)))) + .addRules( + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0))))) + .build(); + + assertEquals(2, actual.getRulesList().size()); + assertThat(actual.toProto()).isEqualTo(expected); + } + + @Test + public void intersectionOfUnions() { + IntersectionRule actual = + GCRULES + .intersection() + .rule( + GCRULES + .union() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1)))) + .rule( + GCRULES + .union() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1)))); + + GcRule expected = + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules( + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0)))) + .addRules( + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 0))))) + .build(); + + assertEquals(2, actual.getRulesList().size()); + assertThat(actual.toProto()).isEqualTo(expected); + } + + @Test + public void unionOfRules() { + GcRule protoGCRule = + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules(buildAgeRule(10, 0)) + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(20, 2))) + .build(); + + GCRules.GCRule modelGCRule = + GCRULES + .union() + .rule(GCRULES.maxAge(Duration.ofSeconds(10))) + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(20, 2))); + assertThat(GCRULES.fromProto(protoGCRule)).isEqualTo(modelGCRule); + } + + @Test + public void intersectionWithFromProto() { + GcRule protoGCRule = + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildAgeRule(10, 5)) + .addRules(buildVersionsRule(1)) + .addRules(buildVersionsRule(2))) + .build(); + + GCRules.GCRule modelGCRule = + GCRules.GCRULES + .intersection() + .rule(GCRULES.maxAge(org.threeten.bp.Duration.ofSeconds(10, 5))) + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxVersions(2)); + assertThat(GCRULES.fromProto(protoGCRule)).isEqualTo(modelGCRule); + } + + @Test + public void unionOfIntersectionFromProto() { + GcRule protoGCRule = + GcRule.newBuilder() + .setUnion( + Union.newBuilder() + .addRules( + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(10)) + .addRules(buildAgeRule(2, 4)) + .build()) + .build()) + .addRules( + GcRule.newBuilder() + .setIntersection( + Intersection.newBuilder() + .addRules(buildVersionsRule(1)) + .addRules(buildAgeRule(1, 1)) + .build()) + .build())) + .build(); + + GCRules.GCRule modelGCRule = + GCRULES + .union() + .rule( + GCRULES + .intersection() + .rule(GCRULES.maxVersions(10)) + .rule(GCRULES.maxAge(Duration.ofSeconds(2, 4)))) + .rule( + GCRULES + .intersection() + .rule(GCRULES.maxVersions(1)) + .rule(GCRULES.maxAge(Duration.ofSeconds(1, 1)))); + assertThat(GCRules.GCRULES.fromProto(protoGCRule)).isEqualTo(modelGCRule); + } + + public static GcRule buildAgeRule(long seconds, int nanos) { + com.google.protobuf.Duration.Builder duartionBuilder = + com.google.protobuf.Duration.newBuilder(); + duartionBuilder.setSeconds(seconds); + duartionBuilder.setNanos(nanos); + + return GcRule.newBuilder().setMaxAge(duartionBuilder).build(); + } + + public static GcRule buildVersionsRule(int maxVer) { + return GcRule.newBuilder().setMaxNumVersions(maxVer).build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java new file mode 100644 index 000000000000..aafcc7b1d4ac --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.GcRule; +import com.google.protobuf.util.Durations; +import java.time.Duration; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class GcRuleBuilderTest { + + @Test + public void maxAge_createsCorrectProto() { + GcRule rule = GcRuleBuilder.maxAge(Duration.ofHours(1)); + + assertThat(rule.hasMaxAge()).isTrue(); + assertThat(rule.getMaxAge()).isEqualTo(Durations.fromHours(1)); + } + + @Test + public void maxVersions_createsCorrectProto() { + GcRule rule = GcRuleBuilder.maxVersions(5); + + assertThat(rule.hasMaxNumVersions()).isTrue(); + assertThat(rule.getMaxNumVersions()).isEqualTo(5); + } + + @Test + public void intersection_buildsNestedRules() { + // Expected Proto structure + GcRule expected = + GcRule.newBuilder() + .setIntersection( + GcRule.Intersection.newBuilder() + .addRules(GcRule.newBuilder().setMaxNumVersions(1).build()) + .addRules(GcRule.newBuilder().setMaxAge(Durations.fromHours(2)).build())) + .build(); + + // Using the new Builder + GcRule actual = + GcRuleBuilder.intersection() + .add(GcRuleBuilder.maxVersions(1)) + .add(GcRuleBuilder.maxAge(Duration.ofHours(2))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void union_buildsNestedRules() { + // Expected Proto structure + GcRule expected = + GcRule.newBuilder() + .setUnion( + GcRule.Union.newBuilder() + .addRules(GcRule.newBuilder().setMaxNumVersions(10).build()) + .addRules(GcRule.newBuilder().setMaxAge(Durations.fromDays(5)).build())) + .build(); + + // Using the new Builder + GcRule actual = + GcRuleBuilder.union() + .add(GcRuleBuilder.maxVersions(10)) + .add(GcRuleBuilder.maxAge(Duration.ofDays(5))) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void nestedComplexRules_workCorrectly() { + // Expected Proto structure: Union of (Version(1) OR Intersection(Age(1h) AND Version(5))) + GcRule expected = + GcRule.newBuilder() + .setUnion( + GcRule.Union.newBuilder() + .addRules(GcRule.newBuilder().setMaxNumVersions(1).build()) + .addRules( + GcRule.newBuilder() + .setIntersection( + GcRule.Intersection.newBuilder() + .addRules( + GcRule.newBuilder() + .setMaxAge(Durations.fromHours(1)) + .build()) + .addRules(GcRule.newBuilder().setMaxNumVersions(5).build()) + .build()) + .build()) + .build()) + .build(); + + // Using the new Builder + GcRule actual = + GcRuleBuilder.union() + .add(GcRuleBuilder.maxVersions(1)) + .add( + GcRuleBuilder.intersection() + .add(GcRuleBuilder.maxAge(Duration.ofHours(1))) + .add(GcRuleBuilder.maxVersions(5)) + .build()) + .build(); + + // Verify the structure matches the raw proto construction + assertThat(actual).isEqualTo(expected); + + // Verify specific properties + assertThat(actual.getUnion().getRulesCount()).isEqualTo(2); + assertThat(actual.getUnion().getRules(1).getIntersection().getRulesCount()).isEqualTo(2); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java new file mode 100644 index 000000000000..35b776fbe454 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.Lists; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class InstanceTest { + + @Test + public void testFromProto() { + com.google.bigtable.admin.v2.Instance proto = + com.google.bigtable.admin.v2.Instance.newBuilder() + .setName("projects/my-project/instances/my-instance") + .setDisplayName("my display name") + .setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION) + .setState(com.google.bigtable.admin.v2.Instance.State.READY) + .putLabels("label1", "value1") + .putLabels("label2", "value2") + .putTags("tagKeys/123", "tagValues/456") + .putTags("tagKeys/234", "tagValues/567") + .build(); + + Instance result = Instance.fromProto(proto); + + assertThat(result.getId()).isEqualTo("my-instance"); + assertThat(result.getDisplayName()).isEqualTo("my display name"); + assertThat(result.getType()).isEqualTo(Instance.Type.PRODUCTION); + assertThat(result.getState()).isEqualTo(Instance.State.READY); + assertThat(result.getLabels()) + .containsExactly( + "label1", "value1", + "label2", "value2"); + assertThat(result.getTags()) + .containsExactly("tagKeys/123", "tagValues/456", "tagKeys/234", "tagValues/567"); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.Instance proto = + com.google.bigtable.admin.v2.Instance.newBuilder() + .setDisplayName("my display name") + .setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION) + .setState(com.google.bigtable.admin.v2.Instance.State.READY) + .putLabels("label1", "value1") + .putLabels("label2", "value2") + .putTags("tagKeys/123", "tagValues/456") + .build(); + + Exception actualException = null; + + try { + Instance.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testTypeEnumUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.Instance.Type.values()); + + // TYPE_UNSPECIFIED is not surfaced + validProtoValues.remove(com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED); + + Exception actualError = null; + try { + Instance.Type.fromProto(com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED); + } catch (Exception e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalArgumentException.class); + + List validModelValues = Lists.newArrayList(Instance.Type.values()); + + List actualModelValues = Lists.newArrayList(); + for (com.google.bigtable.admin.v2.Instance.Type protoValue : validProtoValues) { + actualModelValues.add(Instance.Type.fromProto(protoValue)); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } + + @Test + public void testStateEnumUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.Instance.State.values()); + + List validModelValues = Lists.newArrayList(Instance.State.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.Instance.State protoValue : validProtoValues) { + Instance.State modelValue = Instance.State.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/LogicalViewTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/LogicalViewTest.java new file mode 100644 index 000000000000..4e6111f3704a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/LogicalViewTest.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.LogicalViewName; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class LogicalViewTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String LOGICAL_VIEW_ID = "my-logical-view"; + + @Test + public void testFromProto() { + LogicalViewName logicalViewName = LogicalViewName.of(PROJECT_ID, INSTANCE_ID, LOGICAL_VIEW_ID); + + com.google.bigtable.admin.v2.LogicalView logicalViewProto = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(logicalViewName.toString()) + .setQuery("SELECT 1 from Table") + .setDeletionProtection(true) + .build(); + + LogicalView result = LogicalView.fromProto(logicalViewProto); + + assertThat(result.getId()).isEqualTo(LOGICAL_VIEW_ID); + assertThat(result.getQuery()).isEqualTo("SELECT 1 from Table"); + assertThat(result.isDeletionProtected()).isEqualTo(true); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.LogicalView proto = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setQuery("SELECT 1 FROM Table") + .build(); + + Exception actualException = null; + + try { + LogicalView.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testEquality() { + LogicalViewName logicalViewName = LogicalViewName.of(PROJECT_ID, INSTANCE_ID, LOGICAL_VIEW_ID); + com.google.bigtable.admin.v2.LogicalView proto = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(logicalViewName.toString()) + .setQuery("SELECT 1 FROM Table") + .setDeletionProtection(true) + .build(); + LogicalView logicalView = LogicalView.fromProto(proto); + + assertThat(logicalView).isEqualTo(LogicalView.fromProto(proto)); + + assertThat(logicalView) + .isNotEqualTo( + LogicalView.fromProto( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(logicalViewName.toString()) + .setQuery("SELECT 2 FROM Table") + .setDeletionProtection(true) + .build())); + } + + @Test + public void testHashCode() { + LogicalViewName logicalViewName = LogicalViewName.of(PROJECT_ID, INSTANCE_ID, LOGICAL_VIEW_ID); + com.google.bigtable.admin.v2.LogicalView proto = + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(logicalViewName.toString()) + .setQuery("SELECT 1 FROM Table") + .setDeletionProtection(true) + .build(); + LogicalView logicalView = LogicalView.fromProto(proto); + + assertThat(logicalView.hashCode()).isEqualTo(LogicalView.fromProto(proto).hashCode()); + + assertThat(logicalView.hashCode()) + .isNotEqualTo( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setName(logicalViewName.toString()) + .setQuery("SELECT 2 FROM Table") + .setDeletionProtection(true) + .build() + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/MaterializedViewTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/MaterializedViewTest.java new file mode 100644 index 000000000000..a7a3c017186e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/MaterializedViewTest.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.MaterializedViewName; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MaterializedViewTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String MATERIALIZED_VIEW_ID = "my-materialized-view"; + + @Test + public void testFromProto() { + MaterializedViewName materializedViewName = + MaterializedViewName.of(PROJECT_ID, INSTANCE_ID, MATERIALIZED_VIEW_ID); + + com.google.bigtable.admin.v2.MaterializedView materializedViewProto = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(materializedViewName.toString()) + .setDeletionProtection(true) + .setQuery("SELECT 1 from Table") + .build(); + + MaterializedView result = MaterializedView.fromProto(materializedViewProto); + + assertThat(result.getId()).isEqualTo(MATERIALIZED_VIEW_ID); + assertThat(result.isDeletionProtected()).isTrue(); + assertThat(result.getQuery()).isEqualTo("SELECT 1 from Table"); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.MaterializedView proto = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setDeletionProtection(true) + .setQuery("SELECT 1 FROM Table") + .build(); + + Exception actualException = null; + + try { + MaterializedView.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testEquality() { + MaterializedViewName materializedViewName = + MaterializedViewName.of(PROJECT_ID, INSTANCE_ID, MATERIALIZED_VIEW_ID); + com.google.bigtable.admin.v2.MaterializedView proto = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(materializedViewName.toString()) + .setDeletionProtection(true) + .setQuery("SELECT 1 FROM Table") + .build(); + MaterializedView materializedView = MaterializedView.fromProto(proto); + + assertThat(materializedView).isEqualTo(MaterializedView.fromProto(proto)); + + assertThat(materializedView) + .isNotEqualTo( + MaterializedView.fromProto( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(materializedViewName.toString()) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table") + .build())); + } + + @Test + public void testHashCode() { + MaterializedViewName materializedViewName = + MaterializedViewName.of(PROJECT_ID, INSTANCE_ID, MATERIALIZED_VIEW_ID); + com.google.bigtable.admin.v2.MaterializedView proto = + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(materializedViewName.toString()) + .setDeletionProtection(true) + .setQuery("SELECT 1 FROM Table") + .build(); + MaterializedView materializedView = MaterializedView.fromProto(proto); + + assertThat(materializedView.hashCode()).isEqualTo(MaterializedView.fromProto(proto).hashCode()); + + assertThat(materializedView.hashCode()) + .isNotEqualTo( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setName(materializedViewName.toString()) + .setDeletionProtection(false) + .setQuery("SELECT 1 FROM Table") + .build() + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java new file mode 100644 index 000000000000..30a2274c7e2c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java @@ -0,0 +1,176 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RestoreTableRequestTest { + + private static final String TABLE_ID = "my-table"; + private static final String BACKUP_ID = "my-backup"; + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String CLUSTER_ID = "my-cluster"; + private static final String SOURCE_INSTANCE_ID = "source-instance-id"; + private static final String SOURCE_PROJECT_ID = "source-project-id"; + + @Test + public void testToProto() { + RestoreTableRequest request = + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + + com.google.bigtable.admin.v2.RestoreTableRequest requestProto = + com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setBackup(NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setTableId(TABLE_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testToProtoCrossInstance() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + + com.google.bigtable.admin.v2.RestoreTableRequest requestProto = + com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setBackup( + NameUtil.formatBackupName(PROJECT_ID, SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setTableId(TABLE_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testToProtoCrossProject() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId(TABLE_ID); + + com.google.bigtable.admin.v2.RestoreTableRequest requestProto = + com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder() + .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setBackup( + NameUtil.formatBackupName( + SOURCE_PROJECT_ID, SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setTableId(TABLE_ID) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + RestoreTableRequest request = + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + + assertThat(request) + .isEqualTo(RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID)); + assertThat(request) + .isNotEqualTo(RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId("another-table")); + } + + @Test + public void testEqualityCrossInstance() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + + assertThat(request) + .isEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID)); + assertThat(request) + .isNotEqualTo(RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID)); + assertThat(request) + .isNotEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID) + .setTableId("another-table")); + } + + @Test + public void testEqualityCrossProject() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId(TABLE_ID); + + assertThat(request) + .isEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId(TABLE_ID)); + assertThat(request) + .isNotEqualTo(RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID)); + assertThat(request) + .isNotEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId("another-table")); + } + + @Test + public void testHashCode() { + RestoreTableRequest request = + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + assertThat(request.hashCode()) + .isEqualTo(RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID).hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId("another-table").hashCode()); + } + + @Test + public void testHashCodeCrossInstance() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID); + assertThat(request.hashCode()) + .isEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID) + .setTableId(TABLE_ID) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID).hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID) + .setTableId("another-table") + .hashCode()); + } + + @Test + public void testHashCodeCrossProject() { + RestoreTableRequest request = + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId(TABLE_ID); + assertThat(request.hashCode()) + .isEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId(TABLE_ID) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + RestoreTableRequest.of(CLUSTER_ID, BACKUP_ID).setTableId(TABLE_ID).hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + RestoreTableRequest.of(SOURCE_INSTANCE_ID, CLUSTER_ID, BACKUP_ID, SOURCE_PROJECT_ID) + .setTableId("another-table") + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundleTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundleTest.java new file mode 100644 index 000000000000..f83bc7dcc449 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundleTest.java @@ -0,0 +1,149 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.SchemaBundleName; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SchemaBundleTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle"; + + @Test + public void testFromProto() { + SchemaBundleName schemaBundleName = + SchemaBundleName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID); + + com.google.bigtable.admin.v2.SchemaBundle schemaBundleProto = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema")) + .build()) + .build(); + + SchemaBundle result = SchemaBundle.fromProto(schemaBundleProto); + + assertThat(result.getId()).isEqualTo(SCHEMA_BUNDLE_ID); + assertThat(result.getTableId()).isEqualTo(TABLE_ID); + assertThat(result.getProtoSchema()).isEqualTo(ByteString.copyFromUtf8("schema")); + } + + @Test + public void testRequiresName() { + com.google.bigtable.admin.v2.SchemaBundle proto = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema")) + .build()) + .build(); + Exception actualException = null; + + try { + SchemaBundle.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testRequiresSchemaBundleType() { + SchemaBundleName schemaBundleName = + SchemaBundleName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID); + com.google.bigtable.admin.v2.SchemaBundle proto = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .build(); + Exception actualException = null; + + try { + SchemaBundle.fromProto(proto); + } catch (Exception e) { + actualException = e; + } + + assertThat(actualException).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testEquality() { + SchemaBundleName schemaBundleName = + SchemaBundleName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID); + com.google.bigtable.admin.v2.SchemaBundle proto = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema")) + .build()) + .build(); + SchemaBundle schemaBundle = SchemaBundle.fromProto(proto); + + assertThat(schemaBundle).isEqualTo(SchemaBundle.fromProto(proto)); + + assertThat(schemaBundle) + .isNotEqualTo( + SchemaBundle.fromProto( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema2")) + .build()) + .build())); + } + + @Test + public void testHashCode() { + SchemaBundleName schemaBundleName = + SchemaBundleName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID); + com.google.bigtable.admin.v2.SchemaBundle proto = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema")) + .build()) + .build(); + SchemaBundle schemaBundle = SchemaBundle.fromProto(proto); + + assertThat(schemaBundle.hashCode()).isEqualTo(SchemaBundle.fromProto(proto).hashCode()); + + assertThat(schemaBundle.hashCode()) + .isNotEqualTo( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName(schemaBundleName.toString()) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFromUtf8("schema")) + .build()) + .build() + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSizeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSizeTest.java new file mode 100644 index 000000000000..71b1d1bc959b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSizeTest.java @@ -0,0 +1,28 @@ +/* + * 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.cloud.bigtable.admin.v2.models; + +import com.google.common.truth.Truth; +import org.junit.Test; + +public class StaticClusterSizeTest { + + @Test + public void testStaticClusterSize() { + StaticClusterSize staticClusterSize = StaticClusterSize.of(4); + Truth.assertThat(staticClusterSize.getClusterSize()).isEqualTo(4); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StorageTypeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StorageTypeTest.java new file mode 100644 index 000000000000..9c10836e8b85 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StorageTypeTest.java @@ -0,0 +1,55 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.Lists; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class StorageTypeTest { + @Test + public void testUpToDate() { + List validProtoValues = + Lists.newArrayList(com.google.bigtable.admin.v2.StorageType.values()); + + // TYPE_UNSPECIFIED is not surfaced + validProtoValues.remove(com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED); + + Exception actualError = null; + try { + StorageType.fromProto(com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED); + } catch (Exception e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalArgumentException.class); + + List validModelValues = Lists.newArrayList(StorageType.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.StorageType protoValue : validProtoValues) { + StorageType modelValue = StorageType.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SubsetViewTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SubsetViewTest.java new file mode 100644 index 000000000000..9f5ed078ee22 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SubsetViewTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.protobuf.ByteString; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SubsetViewTest { + + @Test + public void testFromProto() { + com.google.bigtable.admin.v2.AuthorizedView.SubsetView subsetViewProto = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row1#")) + .addRowPrefixes(ByteString.copyFromUtf8("row2#")) + .putFamilySubsets( + "family1", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column1")) + .addQualifiers(ByteString.copyFromUtf8("column2")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column3#")) + .addQualifierPrefixes(ByteString.copyFromUtf8("column4#")) + .build()) + .putFamilySubsets( + "family2", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column5")) + .addQualifierPrefixes(ByteString.copyFromUtf8("")) + .build()) + .build(); + + SubsetView result = SubsetView.fromProto(subsetViewProto); + + assertThat(result.getRowPrefixes()) + .containsExactly(ByteString.copyFromUtf8("row1#"), ByteString.copyFromUtf8("row2#")); + + Map familySubsetsResult = result.getFamilySubsets(); + assertThat(familySubsetsResult) + .containsExactly( + "family1", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family1")), + "family2", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family2"))); + assertThat(familySubsetsResult.get("family1").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column1"), ByteString.copyFromUtf8("column2")); + assertThat(familySubsetsResult.get("family1").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("column3#"), ByteString.copyFromUtf8("column4#")); + assertThat(familySubsetsResult.get("family2").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column5")); + assertThat(familySubsetsResult.get("family2").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("")); + } + + @Test + public void testToProto() { + SubsetView subsetView = + SubsetView.create() + .addRowPrefix("row1#") + .addRowPrefix("row2#") + .setFamilySubsets( + "family1", + FamilySubsets.create().addQualifier("column1").addQualifierPrefix("prefix1#")) + .setFamilySubsets( + "family1", + FamilySubsets.create().addQualifier("column2").addQualifierPrefix("prefix2#")) + .setFamilySubsets( + "family2", FamilySubsets.create().addQualifier("column").addQualifierPrefix("")); + + com.google.bigtable.admin.v2.AuthorizedView.SubsetView subsetViewProto = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row1#")) + .addRowPrefixes(ByteString.copyFromUtf8("row2#")) + .putFamilySubsets( + "family1", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column2")) + .addQualifierPrefixes(ByteString.copyFromUtf8("prefix2#")) + .build()) + .putFamilySubsets( + "family2", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("column")) + .addQualifierPrefixes(ByteString.copyFromUtf8("")) + .build()) + .build(); + + assertThat(subsetView.getRowPrefixes()) + .containsExactly(ByteString.copyFromUtf8("row1#"), ByteString.copyFromUtf8("row2#")); + Map familySubsetsResult = subsetView.getFamilySubsets(); + assertThat(familySubsetsResult) + .containsExactly( + "family1", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family1")), + "family2", + FamilySubsets.fromProto(subsetViewProto.getFamilySubsetsOrThrow("family2"))); + assertThat(familySubsetsResult.get("family1").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column2")); + assertThat(familySubsetsResult.get("family1").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("prefix2#")); + assertThat(familySubsetsResult.get("family2").getQualifiers()) + .containsExactly(ByteString.copyFromUtf8("column")); + assertThat(familySubsetsResult.get("family2").getQualifierPrefixes()) + .containsExactly(ByteString.copyFromUtf8("")); + + assertThat(subsetView.toProto()).isEqualTo(subsetViewProto); + } + + @Test + public void testEquality() { + com.google.bigtable.admin.v2.AuthorizedView.SubsetView proto = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row1#")) + .build(); + SubsetView subsetView = SubsetView.fromProto(proto); + + assertThat(subsetView).isEqualTo(SubsetView.fromProto(proto)); + assertThat(subsetView) + .isNotEqualTo( + SubsetView.fromProto( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row2#")) + .build())); + } + + @Test + public void testHashCode() { + com.google.bigtable.admin.v2.AuthorizedView.SubsetView proto = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row1#")) + .build(); + SubsetView subsetView = SubsetView.fromProto(proto); + + assertThat(subsetView.hashCode()).isEqualTo(SubsetView.fromProto(proto).hashCode()); + assertThat(subsetView.hashCode()) + .isNotEqualTo( + SubsetView.fromProto( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row2#")) + .build()) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java new file mode 100644 index 000000000000..ff5c40d4b411 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java @@ -0,0 +1,193 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.CreateTableRequest.Split; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.InstanceName; +import com.google.bigtable.admin.v2.Table; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TableAdminRequestsTest { + private final String PROJECT_ID = "project"; + private final String INSTANCE_ID = "instance"; + + @Test + public void createTable() { + com.google.bigtable.admin.v2.CreateTableRequest actual = + CreateTableRequest.of("tableId") + .addFamily("cf1") + .addFamily("cf2", GCRules.GCRULES.maxVersions(1)) + .addSplit(ByteString.copyFromUtf8("c")) + .toProto(PROJECT_ID, INSTANCE_ID); + + com.google.bigtable.admin.v2.CreateTableRequest expected = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setTableId("tableId") + .setParent(InstanceName.of("project", "instance").toString()) + .addInitialSplits(Split.newBuilder().setKey(ByteString.copyFromUtf8("c"))) + .setTable( + Table.newBuilder() + .putColumnFamilies( + "cf1", com.google.bigtable.admin.v2.ColumnFamily.newBuilder().build()) + .putColumnFamilies( + "cf2", + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) + .build())) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test(expected = NullPointerException.class) + public void createTableRequiredTableId() { + CreateTableRequest.of(null); + } + + @SuppressWarnings("ConstantConditions") + @Test(expected = NullPointerException.class) + public void createTableRequiredParent() { + CreateTableRequest.of("tableId").toProto(null, null); + } + + @Test + public void modifyFamilies() { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest actual = + ModifyColumnFamiliesRequest.of("tableId") + .addFamily("cf1") + .addFamily("cf2", GCRules.GCRULES.maxVersions(1)) + .addFamily("cf3") + .addFamily("cf4", Type.int64Sum()) + .addFamily("cf5", GCRules.GCRULES.maxVersions(1), Type.int64Sum()) + .addFamily("cf6", Type.int64Min()) + .addFamily("cf7", GCRules.GCRULES.maxVersions(1), Type.int64Min()) + .addFamily("cf8", Type.int64Max()) + .addFamily("cf9", GCRules.GCRULES.maxVersions(1), Type.int64Max()) + .addFamily("cf10", Type.int64Hll()) + .addFamily("cf11", GCRules.GCRULES.maxVersions(1), Type.int64Hll()) + .updateFamily("cf1", GCRules.GCRULES.maxVersions(5)) + .dropFamily("cf3") + .toProto(PROJECT_ID, INSTANCE_ID); + + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest expected = + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, "tableId")) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf1") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf2") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf3") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf4") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(Type.int64Sum().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf5") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) + .setValueType(Type.int64Sum().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf6") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(Type.int64Min().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf7") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) + .setValueType(Type.int64Min().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf8") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(Type.int64Max().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf9") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) + .setValueType(Type.int64Max().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf10") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GcRule.getDefaultInstance()) + .setValueType(Type.int64Hll().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf11") + .setCreate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(1).toProto()) + .setValueType(Type.int64Hll().toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf1") + .setUpdate( + com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + .setGcRule(GCRules.GCRULES.maxVersions(5).toProto()))) + .addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId("cf3") + .setDrop(true)) + .build(); + assertThat(actual).isEqualTo(expected); + } + + @Test(expected = NullPointerException.class) + public void modifyFamiliesRequiredTableId() { + ModifyColumnFamiliesRequest.of(null).toProto(PROJECT_ID, INSTANCE_ID); + } + + @Test(expected = NullPointerException.class) + public void modifyFamiliesRequiredParent() { + ModifyColumnFamiliesRequest.of("tableId").toProto(null, null); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java new file mode 100644 index 000000000000..c5821fb9ebad --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; + +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.Table.TimestampGranularity; +import com.google.bigtable.admin.v2.TableName; +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Map.Entry; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TableTest { + + @Test + public void testFromProto() { + TableName testName = TableName.of("my-project", "my-instance", "my-table"); + com.google.bigtable.admin.v2.Table proto = + com.google.bigtable.admin.v2.Table.newBuilder() + .setName(testName.toString()) + .setGranularity(TimestampGranularity.MILLIS) + .putClusterStates( + "cluster1", + com.google.bigtable.admin.v2.Table.ClusterState.newBuilder() + .setReplicationState( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.READY) + .build()) + .putClusterStates( + "cluster2", + com.google.bigtable.admin.v2.Table.ClusterState.newBuilder() + .setReplicationState( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState + .INITIALIZING) + .build()) + .putColumnFamilies("cf1", ColumnFamily.newBuilder().build()) + .putColumnFamilies( + "cf2", + ColumnFamily.newBuilder() + .setGcRule(GcRule.newBuilder().setMaxNumVersions(1)) + .build()) + .putColumnFamilies( + "cf3", + ColumnFamily.newBuilder() + .setGcRule( + GcRule.newBuilder() + .setMaxAge( + com.google.protobuf.Duration.newBuilder() + .setSeconds(1) + .setNanos(99))) + .build()) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(1).setNanos(99)) + .setFrequency( + com.google.protobuf.Duration.newBuilder().setSeconds(1).setNanos(99)) + .build()) + .setDeletionProtection(true) + .build(); + + Table result = Table.fromProto(proto); + + assertThat(result.getInstanceId()).isEqualTo("my-instance"); + assertThat(result.getId()).isEqualTo("my-table"); + assertThat(result.getReplicationStatesByClusterId()) + .containsExactly( + "cluster1", Table.ReplicationState.READY, + "cluster2", Table.ReplicationState.INITIALIZING); + assertThat(result.getColumnFamilies()).hasSize(3); + assertThat(result.isAutomatedBackupEnabled()).isTrue(); + assertEquals( + "AutomatedBackupPolicy{com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy.retention_period=seconds:" + + " 1\n" + + // + "nanos: 99\n" + + // + ", com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy.frequency=seconds: 1\n" + + // + "nanos: 99\n" + + // + "}", + result.getAutomatedBackupPolicy().viewConfig()); + assertThat(result.isDeletionProtected()).isTrue(); + + for (Entry entry : proto.getColumnFamiliesMap().entrySet()) { + assertThat(result.getColumnFamilies()) + .contains( + com.google.cloud.bigtable.admin.v2.models.ColumnFamily.fromProto( + entry.getKey(), entry.getValue())); + } + } + + @Test + public void testReplicationStateEnumUpToDate() { + List validProtoValues = + Lists.newArrayList( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.values()); + + List validModelValues = + Lists.newArrayList(Table.ReplicationState.values()); + + List actualModelValues = Lists.newArrayList(); + + for (com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState protoValue : + validProtoValues) { + Table.ReplicationState modelValue = Table.ReplicationState.fromProto(protoValue); + actualModelValues.add(modelValue); + } + + assertThat(actualModelValues).containsExactlyElementsIn(validModelValues); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TypeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TypeTest.java new file mode 100644 index 000000000000..c08415a5c13e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TypeTest.java @@ -0,0 +1,137 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.TypeProtos; +import com.google.cloud.bigtable.admin.v2.models.Type.Bytes; +import com.google.cloud.bigtable.admin.v2.models.Type.Int64; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TypeTest { + + @Test + public void rawBytes() { + Type type = Type.rawBytes(); + assertThat(type.toProto()) + .isEqualTo( + com.google.bigtable.admin.v2.Type.newBuilder() + .setBytesType(TypeProtos.bytesType()) + .build()); + } + + @Test + public void bytes() { + Type type = Type.bytes(Bytes.Encoding.raw()); + assertThat(type.toProto()) + .isEqualTo( + com.google.bigtable.admin.v2.Type.newBuilder() + .setBytesType(TypeProtos.bytesType()) + .build()); + } + + @Test + public void bigEndianInt64() { + Type type = Type.bigEndianInt64(); + assertThat(type.toProto()).isEqualTo(TypeProtos.int64Type()); + } + + @Test + public void int64WithEncoding() { + Type type = Type.int64(Int64.Encoding.BigEndianBytes.create()); + assertThat(type.toProto()).isEqualTo(TypeProtos.int64Type()); + } + + @Test + public void int64Sum() { + Type type = Type.int64Sum(); + assertThat(type.toProto()).isEqualTo(TypeProtos.intSumType()); + } + + @Test + public void sum() { + Type type = Type.sum(Type.bigEndianInt64()); + assertThat(type.toProto()).isEqualTo(TypeProtos.intSumType()); + } + + @Test + public void intSumFromProtoToProto() { + com.google.bigtable.admin.v2.Type proto = TypeProtos.intSumType(); + assertThat(Type.fromProto(proto)).isEqualTo(Type.int64Sum()); + assertThat(Type.fromProto(proto).toProto()).isEqualTo(proto); + } + + @Test + public void int64Min() { + Type type = Type.int64Min(); + assertThat(type.toProto()).isEqualTo(TypeProtos.intMinType()); + } + + @Test + public void min() { + Type type = Type.min(Type.bigEndianInt64()); + assertThat(type.toProto()).isEqualTo(TypeProtos.intMinType()); + } + + @Test + public void intMinFromProtoToProto() { + com.google.bigtable.admin.v2.Type proto = TypeProtos.intMinType(); + assertThat(Type.fromProto(proto)).isEqualTo(Type.int64Min()); + assertThat(Type.fromProto(proto).toProto()).isEqualTo(proto); + } + + @Test + public void int64Max() { + Type type = Type.int64Max(); + assertThat(type.toProto()).isEqualTo(TypeProtos.intMaxType()); + } + + @Test + public void max() { + Type type = Type.max(Type.bigEndianInt64()); + assertThat(type.toProto()).isEqualTo(TypeProtos.intMaxType()); + } + + @Test + public void intMaxFromProtoToProto() { + com.google.bigtable.admin.v2.Type proto = TypeProtos.intMaxType(); + assertThat(Type.fromProto(proto)).isEqualTo(Type.int64Max()); + assertThat(Type.fromProto(proto).toProto()).isEqualTo(proto); + } + + @Test + public void bytesHll() { + Type type = Type.int64Hll(); + assertThat(type.toProto()).isEqualTo(TypeProtos.intHllType()); + } + + @Test + public void hll() { + Type type = Type.hll(Type.bigEndianInt64()); + assertThat(type.toProto()).isEqualTo(TypeProtos.intHllType()); + } + + @Test + public void bytesHllFromProtoToProto() { + com.google.bigtable.admin.v2.Type proto = TypeProtos.intHllType(); + assertThat(Type.fromProto(proto)).isEqualTo(Type.int64Hll()); + assertThat(Type.fromProto(proto).toProto()).isEqualTo(proto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java new file mode 100644 index 000000000000..1ca24201ae9b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java @@ -0,0 +1,176 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly; +import com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny; +import com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting; +import com.google.bigtable.admin.v2.AppProfile.StandardIsolation; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.Priority; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.SingleClusterRoutingPolicy; +import com.google.cloud.bigtable.admin.v2.models.AppProfile.StandardIsolationPolicy; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateAppProfileRequestTest { + @Test + public void testToProto() { + UpdateAppProfileRequest wrapper = + UpdateAppProfileRequest.of("my-instance", "my-profile") + .setDescription("my description") + .setRoutingPolicy(SingleClusterRoutingPolicy.of("my-cluster", true)) + .setIgnoreWarnings(true); + + assertThat(wrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName("projects/my-project/instances/my-instance/appProfiles/my-profile") + .setDescription("my description") + .setSingleClusterRouting( + SingleClusterRouting.newBuilder() + .setClusterId("my-cluster") + .setAllowTransactionalWrites(true))) + .setIgnoreWarnings(true) + .setUpdateMask( + FieldMask.newBuilder() + .addPaths("description") + .addPaths("single_cluster_routing")) + .build()); + } + + @Test + public void testUpdateExisting() { + com.google.bigtable.admin.v2.AppProfile existingProto = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName("projects/my-project/instances/my-instance/appProfiles/my-profile") + .setEtag("my-etag") + .setDescription("description") + .setMultiClusterRoutingUseAny(MultiClusterRoutingUseAny.getDefaultInstance()) + .build(); + + AppProfile existingWrapper = AppProfile.fromProto(existingProto); + + UpdateAppProfileRequest updateWrapper = + UpdateAppProfileRequest.of(existingWrapper).setDescription("new description"); + + assertThat(updateWrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile(existingProto.toBuilder().setDescription("new description")) + .setUpdateMask(FieldMask.newBuilder().addPaths("description")) + .build()); + } + + @Test + public void testUpdateExistingStandardIsolation() { + com.google.bigtable.admin.v2.AppProfile existingProto = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName("projects/my-project/instances/my-instance/appProfiles/my-profile") + .setEtag("my-etag") + .setDescription("description") + .setMultiClusterRoutingUseAny(MultiClusterRoutingUseAny.getDefaultInstance()) + .setStandardIsolation(StandardIsolation.getDefaultInstance()) + .build(); + + AppProfile existingWrapper = AppProfile.fromProto(existingProto); + + UpdateAppProfileRequest updateWrapper = + UpdateAppProfileRequest.of(existingWrapper) + .setIsolationPolicy(StandardIsolationPolicy.of(Priority.LOW)); + + assertThat(updateWrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + existingProto.toBuilder() + .setStandardIsolation( + StandardIsolation.newBuilder() + .setPriority( + com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_LOW) + .build())) + .setUpdateMask(FieldMask.newBuilder().addPaths("standard_isolation")) + .build()); + } + + @Test + public void testUpdateExistingDataBoostIsolationReadOnly() { + com.google.bigtable.admin.v2.AppProfile existingProto = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName("projects/my-project/instances/my-instance/appProfiles/my-profile") + .setEtag("my-etag") + .setDescription("description") + .setMultiClusterRoutingUseAny(MultiClusterRoutingUseAny.getDefaultInstance()) + .setStandardIsolation(StandardIsolation.getDefaultInstance()) + .build(); + + AppProfile existingWrapper = AppProfile.fromProto(existingProto); + + UpdateAppProfileRequest updateWrapper = + UpdateAppProfileRequest.of(existingWrapper) + .setIsolationPolicy( + AppProfile.DataBoostIsolationReadOnlyPolicy.of( + AppProfile.ComputeBillingOwner.HOST_PAYS)); + + assertThat(updateWrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + existingProto.toBuilder() + .setDataBoostIsolationReadOnly( + DataBoostIsolationReadOnly.newBuilder() + .setComputeBillingOwner( + DataBoostIsolationReadOnly.ComputeBillingOwner.HOST_PAYS) + .build())) + .setUpdateMask(FieldMask.newBuilder().addPaths("data_boost_isolation_read_only")) + .build()); + } + + @Test + public void testUpdateRowAffinity() { + com.google.bigtable.admin.v2.AppProfile existingProto = + com.google.bigtable.admin.v2.AppProfile.newBuilder() + .setName("projects/my-project/instances/my-instance/appProfiles/my-profile") + .setEtag("my-etag") + .setDescription("description") + .setMultiClusterRoutingUseAny(MultiClusterRoutingUseAny.getDefaultInstance()) + .build(); + + AppProfile existingWrapper = AppProfile.fromProto(existingProto); + + UpdateAppProfileRequest updateWrapper = + UpdateAppProfileRequest.of(existingWrapper) + .setRoutingPolicy(AppProfile.MultiClusterRoutingPolicy.withRowAffinity()); + + assertThat(updateWrapper.toProto("my-project")) + .isEqualTo( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + .setAppProfile( + existingProto.toBuilder() + .setMultiClusterRoutingUseAny( + MultiClusterRoutingUseAny.newBuilder() + .setRowAffinity( + MultiClusterRoutingUseAny.RowAffinity.newBuilder().build()))) + .setUpdateMask(FieldMask.newBuilder().addPaths("multi_cluster_routing_use_any")) + .build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java new file mode 100644 index 000000000000..06c9a8353e63 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java @@ -0,0 +1,158 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateAuthorizedViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String AUTHORIZED_VIEW_ID = "my-authorized-view"; + + @Test + public void testToProto() { + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setDeletionProtection(true) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")) + .setIgnoreWarnings(true); + + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest requestProto = + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")))) + .setUpdateMask( + FieldMask.newBuilder().addPaths("deletion_protection").addPaths("subset_view")) + .setIgnoreWarnings(true) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testUpdateDeletionProtection() { + com.google.bigtable.admin.v2.AuthorizedView existingAuthorizedView = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setDeletionProtection(true) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#"))) + .build(); + + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(AuthorizedView.fromProto(existingAuthorizedView)) + .setDeletionProtection(false); + + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest requestProto = + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView(existingAuthorizedView.toBuilder().setDeletionProtection(false)) + .setUpdateMask(FieldMask.newBuilder().addPaths("deletion_protection")) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testUpdateSubsetView() { + com.google.bigtable.admin.v2.AuthorizedView authorizedViewProto = + com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + .setName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + .addRowPrefixes(ByteString.copyFromUtf8("row#")) + .putFamilySubsets( + "cf", + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + .addQualifiers(ByteString.copyFromUtf8("qualifier")) + .addQualifierPrefixes(ByteString.copyFromUtf8("prefix#")) + .build())) + .build(); + + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("row#") + .setFamilySubsets( + "cf", + FamilySubsets.create() + .addQualifier("qualifier") + .addQualifierPrefix("prefix#"))); + + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest requestProto = + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + .setAuthorizedView(authorizedViewProto) + .setUpdateMask(FieldMask.newBuilder().addPaths("subset_view")) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")); + + assertThat(request) + .isEqualTo( + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#"))); + + assertThat(request) + .isNotEqualTo( + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("another-row#"))); + } + + @Test + public void testHashCode() { + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")); + + assertThat(request.hashCode()) + .isEqualTo( + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("row#")) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateAuthorizedViewRequest.of(TABLE_ID, AUTHORIZED_VIEW_ID) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("another-row#")) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java new file mode 100644 index 000000000000..c2df69ca56e7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java @@ -0,0 +1,114 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.Backup; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.FieldMask; +import com.google.protobuf.util.Timestamps; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class UpdateBackupRequestTest { + private static final String BACKUP_ID = "my-backup"; + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String CLUSTER_ID = "my-cluster"; + private static final Instant EXPIRE_TIME = Instant.now().plus(Duration.ofDays(15)); + private static final Instant EXPIRE_TIME_2 = Instant.now().plus(Duration.ofDays(20)); + private static final Instant HOT_TO_STANDARD_TIME = Instant.now().plus(Duration.ofDays(10)); + + @Test + public void testToProto() { + UpdateBackupRequest request = + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + + com.google.bigtable.admin.v2.UpdateBackupRequest requestProto = + com.google.bigtable.admin.v2.UpdateBackupRequest.newBuilder() + .setBackup( + Backup.newBuilder() + .setName( + NameUtil.formatBackupName(PROJECT_ID, INSTANCE_ID, CLUSTER_ID, BACKUP_ID)) + .setExpireTime(Timestamps.fromMillis(EXPIRE_TIME.toEpochMilli())) + .setHotToStandardTime( + Timestamps.fromMillis(HOT_TO_STANDARD_TIME.toEpochMilli())) + .build()) + .setUpdateMask( + FieldMask.newBuilder() + .addPaths("expire_time") + .addPaths("hot_to_standard_time") + .build()) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + UpdateBackupRequest request = + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + assertThat(request) + .isEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .setHotToStandardTime(HOT_TO_STANDARD_TIME)); + assertThat(request) + .isNotEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME_2) + .setHotToStandardTime(HOT_TO_STANDARD_TIME)); + assertThat(request) + .isNotEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .clearHotToStandardTime()); + } + + @Test + public void testHashCode() { + UpdateBackupRequest request = + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .setHotToStandardTime(HOT_TO_STANDARD_TIME); + assertThat(request.hashCode()) + .isEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .setHotToStandardTime(HOT_TO_STANDARD_TIME) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME_2) + .setHotToStandardTime(HOT_TO_STANDARD_TIME) + .hashCode()); + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .clearHotToStandardTime() + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java new file mode 100644 index 000000000000..5793ce699333 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java @@ -0,0 +1,105 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateInstanceRequestTest { + @Test + public void testEmpty() { + UpdateInstanceRequest input = UpdateInstanceRequest.of("my-instance"); + + Exception actualError = null; + + try { + input.toProto("my-project"); + } catch (Exception e) { + actualError = e; + } + + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testDisplayName() { + UpdateInstanceRequest input = + UpdateInstanceRequest.of("my-instance").setDisplayName("my display name"); + + PartialUpdateInstanceRequest actual = input.toProto("my-project"); + + PartialUpdateInstanceRequest expected = + PartialUpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().addPaths("display_name")) + .setInstance( + Instance.newBuilder() + .setName("projects/my-project/instances/my-instance") + .setDisplayName("my display name")) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testLabels() { + UpdateInstanceRequest input = + UpdateInstanceRequest.of("my-instance") + .setAllLabels( + ImmutableMap.of( + "label1", "value1", + "label2", "value2")); + + PartialUpdateInstanceRequest actual = input.toProto("my-project"); + + PartialUpdateInstanceRequest expected = + PartialUpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().addPaths("labels")) + .setInstance( + Instance.newBuilder() + .setName("projects/my-project/instances/my-instance") + .putLabels("label1", "value1") + .putLabels("label2", "value2")) + .build(); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void testType() { + UpdateInstanceRequest input = UpdateInstanceRequest.of("my-instance").setProductionType(); + + PartialUpdateInstanceRequest actual = input.toProto("my-project"); + + PartialUpdateInstanceRequest expected = + PartialUpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().addPaths("type")) + .setInstance( + Instance.newBuilder() + .setName("projects/my-project/instances/my-instance") + .setType(Instance.Type.PRODUCTION)) + .build(); + + assertThat(actual).isEqualTo(expected); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequestTest.java new file mode 100644 index 000000000000..da54bb5ac1f6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequestTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateLogicalViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String LOGICAL_VIEW_ID = "my-logical-view"; + + @Test + public void testToProto() { + UpdateLogicalViewRequest request = + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 1") + .setDeletionProtection(true); + + com.google.bigtable.admin.v2.UpdateLogicalViewRequest requestProto = + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.newBuilder() + .setLogicalView( + com.google.bigtable.admin.v2.LogicalView.newBuilder() + .setQuery("query 1") + .setDeletionProtection(true) + .setName( + NameUtil.formatLogicalViewName(PROJECT_ID, INSTANCE_ID, LOGICAL_VIEW_ID))) + .setUpdateMask( + FieldMask.newBuilder().addPaths("deletion_protection").addPaths("query").build()) + .build(); + assertThat(request.toProto(PROJECT_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + UpdateLogicalViewRequest request = + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 1") + .setDeletionProtection(true); + + assertThat(request) + .isEqualTo( + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 1") + .setDeletionProtection(true)); + + assertThat(request) + .isNotEqualTo( + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 2") + .setDeletionProtection(true)); + } + + @Test + public void testHashCode() { + UpdateLogicalViewRequest request = + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 1") + .setDeletionProtection(true); + + assertThat(request.hashCode()) + .isEqualTo( + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 1") + .setDeletionProtection(true) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateLogicalViewRequest.of(INSTANCE_ID, LOGICAL_VIEW_ID) + .setQuery("query 2") + .setDeletionProtection(true) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequestTest.java new file mode 100644 index 000000000000..17cbecea9ae6 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequestTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateMaterializedViewRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String MATERIALIZED_VIEW_ID = "my-materialized-view"; + + @Test + public void testToProto() { + UpdateMaterializedViewRequest request = + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(true); + + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest requestProto = + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.newBuilder() + .setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.newBuilder() + .setDeletionProtection(true) + .setName( + NameUtil.formatMaterializedViewName( + PROJECT_ID, INSTANCE_ID, MATERIALIZED_VIEW_ID))) + .setUpdateMask(FieldMask.newBuilder().addPaths("deletion_protection").build()) + .build(); + assertThat(request.toProto(PROJECT_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() { + UpdateMaterializedViewRequest request = + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false); + + assertThat(request) + .isEqualTo( + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false)); + + assertThat(request) + .isNotEqualTo( + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(true)); + } + + @Test + public void testHashCode() { + UpdateMaterializedViewRequest request = + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false); + + assertThat(request.hashCode()) + .isEqualTo( + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(false) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateMaterializedViewRequest.of(INSTANCE_ID, MATERIALIZED_VIEW_ID) + .setDeletionProtection(true) + .hashCode()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java new file mode 100644 index 000000000000..994d56068aad --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2024 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.ProtoSchema; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class UpdateSchemaBundleRequestTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String SCHEMA_BUNDLE_ID = "my-schema-bundle"; + // Location: `google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb` + private static final String TEST_PROTO_SCHEMA_BUNDLE = "proto_schema_bundle.pb"; + // Location: `google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb` + private static final String TEST_UPDATED_PROTO_SCHEMA_BUNDLE = "updated_proto_schema_bundle.pb"; + + @Test + public void testToProto() throws IOException, URISyntaxException { + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)) + .setIgnoreWarnings(true); + byte[] content = Files.readAllBytes(Paths.get(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest requestProto = + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder() + .setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content)) + .build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().addPaths("proto_schema")) + .setIgnoreWarnings(true) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testUpdateProtoSchema() throws IOException, URISyntaxException { + byte[] content = Files.readAllBytes(Paths.get(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + byte[] updated_content = + Files.readAllBytes(Paths.get(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE))); + + com.google.bigtable.admin.v2.SchemaBundle existingSchemaBundle = + com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + .setName( + NameUtil.formatSchemaBundleName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, SCHEMA_BUNDLE_ID)) + .setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(content)) + .build()) + .build(); + + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.of(SchemaBundle.fromProto(existingSchemaBundle)) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)); + + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest requestProto = + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder() + .setSchemaBundle( + existingSchemaBundle.toBuilder() + .setProtoSchema( + ProtoSchema.newBuilder() + .setProtoDescriptors(ByteString.copyFrom(updated_content)))) + .setUpdateMask(FieldMask.newBuilder().addPaths("proto_schema")) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEquality() throws IOException, URISyntaxException { + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + assertThat(request) + .isEqualTo( + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE))); + + assertThat(request) + .isNotEqualTo( + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE))); + } + + @Test + public void testHashCode() throws IOException, URISyntaxException { + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)); + + assertThat(request.hashCode()) + .isEqualTo( + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_PROTO_SCHEMA_BUNDLE)) + .hashCode()); + + assertThat(request.hashCode()) + .isNotEqualTo( + UpdateSchemaBundleRequest.of(TABLE_ID, SCHEMA_BUNDLE_ID) + .setProtoSchemaFile(getResourceFilePath(TEST_UPDATED_PROTO_SCHEMA_BUNDLE)) + .hashCode()); + } + + private String getResourceFilePath(String filePath) throws URISyntaxException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL protoSchema = cl.getResource(filePath); + return Paths.get(protoSchema.toURI()).toAbsolutePath().toString(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java new file mode 100644 index 000000000000..059999210d46 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java @@ -0,0 +1,202 @@ +/* + * Copyright 2023 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.cloud.bigtable.admin.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.admin.v2.ChangeStreamConfig; +import com.google.bigtable.admin.v2.Table; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.protobuf.FieldMask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class UpdateTableRequestTest { + private static final String TABLE_ID = "my-table"; + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + + @Test + public void testEnableChangeStreamToProto() { + UpdateTableRequest request = + UpdateTableRequest.of(TABLE_ID).addChangeStreamRetention(Duration.ofHours(24)); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .build())) + .setUpdateMask( + FieldMask.newBuilder().addPaths("change_stream_config.retention_period").build()) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testDisableChangeStreamToProto() { + UpdateTableRequest request = + UpdateTableRequest.of(TABLE_ID).addChangeStreamRetention(Duration.ofHours(0)); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))) + .setUpdateMask(FieldMask.newBuilder().addPaths("change_stream_config").build()) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testNoChangeChangeStreamToProto() { + UpdateTableRequest request = UpdateTableRequest.of(TABLE_ID); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID))) + .build(); + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testEnableDeletionProtection() { + UpdateTableRequest request = UpdateTableRequest.of(TABLE_ID).setDeletionProtection(true); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setDeletionProtection(true)) + .setUpdateMask(FieldMask.newBuilder().addPaths("deletion_protection").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testDisableDeletionProtection() { + UpdateTableRequest request = UpdateTableRequest.of(TABLE_ID).setDeletionProtection(false); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setDeletionProtection(false)) + .setUpdateMask(FieldMask.newBuilder().addPaths("deletion_protection").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testDisableAutomatedBackup() { + UpdateTableRequest request = UpdateTableRequest.of(TABLE_ID).disableAutomatedBackup(); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .build())) + .setUpdateMask(FieldMask.newBuilder().addPaths("automated_backup_policy").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testSetAutomatedBackup() { + UpdateTableRequest request = + UpdateTableRequest.of(TABLE_ID) + .setAutomatedBackup(Duration.ofHours(24), Duration.ofHours(24)); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .setFrequency( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .build())) + .setUpdateMask(FieldMask.newBuilder().addPaths("automated_backup_policy").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testSetAutomatedBackupRetentionPeriod() { + UpdateTableRequest request = + UpdateTableRequest.of(TABLE_ID).setAutomatedBackupRetentionPeriod(Duration.ofHours(24)); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .build())) + .setUpdateMask( + FieldMask.newBuilder().addPaths("automated_backup_policy.retention_period").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } + + @Test + public void testSetAutomatedBackupFrequency() { + UpdateTableRequest request = + UpdateTableRequest.of(TABLE_ID).setAutomatedBackupFrequency(Duration.ofHours(24)); + + com.google.bigtable.admin.v2.UpdateTableRequest requestProto = + com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + .setTable( + Table.newBuilder() + .setName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + .setFrequency( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) + .build())) + .setUpdateMask( + FieldMask.newBuilder().addPaths("automated_backup_policy.frequency").build()) + .build(); + + assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java new file mode 100644 index 000000000000..52e8956a0dec --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java @@ -0,0 +1,363 @@ +/* + * Copyright 2018 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.cloud.bigtable.admin.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.retrying.PollException; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.testing.FakeApiException; +import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.bigtable.admin.v2.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; +import com.google.bigtable.admin.v2.StandardReadRemoteWrites; +import com.google.bigtable.admin.v2.TableName; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; +import com.google.cloud.bigtable.data.v2.internal.TableAdminRequestContext; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +@Deprecated +public class AwaitConsistencyCallableTest { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN); + + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final TableName TABLE_NAME = TableName.of(PROJECT_ID, INSTANCE_ID, TABLE_ID); + private static final ApiCallContext CALL_CONTEXT = FakeCallContext.createDefault(); + private static final TableAdminRequestContext REQUEST_CONTEXT = + TableAdminRequestContext.create(PROJECT_ID, INSTANCE_ID); + + @Mock + private UnaryCallable + mockGenerateConsistencyTokenCallable; + + @Mock + private UnaryCallable + mockCheckConsistencyCallable; + + private AwaitReplicationCallable awaitReplicationCallable; + + private AwaitConsistencyCallable awaitConsistencyCallable; + + @Before + public void setUp() { + ClientContext clientContext = + ClientContext.newBuilder().setDefaultCallContext(CALL_CONTEXT).build(); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(Duration.ofMillis(100)) + // Delay settings: 1 ms const + .setInitialRetryDelay(Duration.ofMillis(1)) + .setMaxRetryDelay(Duration.ofMillis(1)) + .setRetryDelayMultiplier(1.0) + // RPC timeout: ignored const 1 s + .setInitialRpcTimeout(Duration.ofSeconds(1)) + .setMaxRpcTimeout(Duration.ofSeconds(1)) + .setRpcTimeoutMultiplier(1.0) + .build(); + + awaitConsistencyCallable = + AwaitConsistencyCallable.create( + mockGenerateConsistencyTokenCallable, + mockCheckConsistencyCallable, + clientContext, + retrySettings, + REQUEST_CONTEXT); + awaitReplicationCallable = AwaitReplicationCallable.create(awaitConsistencyCallable); + } + + @Test + public void testGenerateFailure() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + FakeApiException fakeError = new FakeApiException("fake", null, Code.INTERNAL, false); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFailedFuture(fakeError)); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture future = awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + + Throwable actualError = null; + + try { + future.get(); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + + assertThat(actualError).isSameInstanceAs(fakeError); + } + + @Test + public void testCheckFailure() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + + FakeApiException expectedError = new FakeApiException("fake", null, Code.INTERNAL, false); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFailedFuture(expectedError)); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture future = awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + + Throwable actualError = null; + + try { + future.get(); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + + assertThat(actualError).isSameInstanceAs(expectedError); + } + + @Test + public void testImmediatelyConsistent() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + CheckConsistencyResponse expectedResponse2 = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse2)); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + + consistentFuture.get(1, TimeUnit.MILLISECONDS); + } + + @Test + public void testPolling() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + + CheckConsistencyResponse expectedResponse2 = + CheckConsistencyResponse.newBuilder().setConsistent(false).build(); + + CheckConsistencyResponse expectedResponse3 = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse2)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse3)); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + + consistentFuture.get(1, TimeUnit.SECONDS); + } + + @Test + public void testPollingTimeout() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + + CheckConsistencyResponse expectedResponse2 = + CheckConsistencyResponse.newBuilder().setConsistent(false).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse2)); + + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + + Throwable actualError = null; + try { + consistentFuture.get(1, TimeUnit.SECONDS); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + + assertThat(actualError).isInstanceOf(PollException.class); + } + + @Test + public void testAwaitReplicationCallableImmediatelyConsistent() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + CheckConsistencyResponse expectedResponse2 = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse2)); + + ApiFuture consistentFuture = + awaitReplicationCallable.futureCall(TABLE_NAME, CALL_CONTEXT); + + consistentFuture.get(1, TimeUnit.MILLISECONDS); + } + + @Test + public void testAwaitReplicationCallablePolling() throws Exception { + GenerateConsistencyTokenRequest expectedRequest = + GenerateConsistencyTokenRequest.newBuilder().setName(TABLE_NAME.toString()).build(); + + GenerateConsistencyTokenResponse expectedResponse = + GenerateConsistencyTokenResponse.newBuilder().setConsistencyToken("fake-token").build(); + + Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + CheckConsistencyRequest expectedRequest2 = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + + CheckConsistencyResponse expectedResponse2 = + CheckConsistencyResponse.newBuilder().setConsistent(false).build(); + + CheckConsistencyResponse expectedResponse3 = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse2)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse3)); + + ApiFuture consistentFuture = + awaitReplicationCallable.futureCall(TABLE_NAME, CALL_CONTEXT); + + consistentFuture.get(1, TimeUnit.SECONDS); + } + + @Test + public void testWithProvidedToken() throws Exception { + // 1. Setup: Request with a pre-existing token + String existingToken = "existing-token"; + ConsistencyRequest consistencyRequest = + ConsistencyRequest.forReplication(TABLE_ID, existingToken); + + // 2. Setup: Mock the check operation to succeed immediately + CheckConsistencyRequest expectedCheckRequest = + CheckConsistencyRequest.newBuilder() + .setName(TABLE_NAME.toString()) + .setConsistencyToken(existingToken) + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) + .build(); + CheckConsistencyResponse expectedResponse = + CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + + Mockito.when(mockCheckConsistencyCallable.futureCall(expectedCheckRequest, CALL_CONTEXT)) + .thenReturn(ApiFutures.immediateFuture(expectedResponse)); + + // 3. Execute + ApiFuture future = awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); + future.get(1, TimeUnit.SECONDS); + + // 4. Verify: Generate was NEVER called, Check WAS called + Mockito.verify(mockGenerateConsistencyTokenCallable, Mockito.never()) + .futureCall( + ArgumentMatchers.any(GenerateConsistencyTokenRequest.class), + ArgumentMatchers.any(ApiCallContext.class)); + Mockito.verify(mockCheckConsistencyCallable, Mockito.times(1)) + .futureCall(expectedCheckRequest, CALL_CONTEXT); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/StatusTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/StatusTest.java new file mode 100644 index 000000000000..3eb867d19975 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/StatusTest.java @@ -0,0 +1,116 @@ +/* + * 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.cloud.bigtable.common; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.rpc.Code; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class StatusTest { + + @Test + public void testAllCodes() { + for (Code protoValue : com.google.rpc.Code.values()) { + Status.Code modelValue = Status.Code.fromProto(protoValue); + + assertWithMessage("proto enum value %s should be wrapped", protoValue.toString()) + .that(modelValue.toString()) + .isEqualTo(protoValue.toString()); + } + + com.google.rpc.Status randomProto = + com.google.rpc.Status.newBuilder().setCode(49).setMessage("some message").build(); + assertWithMessage("Unrecognized proto value should be wrapped") + .that(Status.Code.fromProto(com.google.rpc.Code.forNumber(randomProto.getCode()))) + .isEqualTo(Status.Code.UNRECOGNIZED); + } + + @Test + public void testAllCodeNumbers() { + for (Code protoValue : com.google.rpc.Code.values()) { + if (protoValue == com.google.rpc.Code.UNRECOGNIZED) { + continue; + } + Status.Code modelValue = Status.Code.fromCodeNumber(protoValue.getNumber()); + + assertWithMessage("proto enum value %s should be wrapped", protoValue.toString()) + .that(modelValue.toString()) + .isEqualTo(protoValue.toString()); + } + + assertWithMessage("Unrecognized proto enum value should be wrapped") + .that(Status.Code.fromCodeNumber(-1)) + .isEqualTo(Status.Code.UNRECOGNIZED); + } + + @Test + public void testFromProto() { + com.google.rpc.Status proto = + com.google.rpc.Status.newBuilder() + .setCode(Code.UNAVAILABLE.getNumber()) + .setMessage("some message") + .build(); + + Status model = Status.fromProto(proto); + assertThat(model.getCode()).isEqualTo(Status.Code.UNAVAILABLE); + assertThat(model.getMessage()).isEqualTo("some message"); + } + + @Test + public void testToProto() { + com.google.rpc.Code code = Code.UNAVAILABLE; + com.google.rpc.Status proto = + com.google.rpc.Status.newBuilder() + .setCode(code.getNumber()) + .setMessage("some message") + .build(); + + Status model = Status.fromProto(proto); + assertThat(model.getCode().toProto()).isEqualTo(code); + assertThat(model.toProto()).isEqualTo(proto); + + assertThat(model.toString()).isEqualTo(proto.toString()); + } + + @Test + public void testSerialization() throws IOException, ClassNotFoundException { + com.google.rpc.Status proto = + com.google.rpc.Status.newBuilder() + .setCode(Code.UNAVAILABLE.getNumber()) + .setMessage("some message") + .build(); + + Status model = Status.fromProto(proto); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(model); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + Status actual = (Status) ois.readObject(); + assertThat(actual).isEqualTo(model); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java new file mode 100644 index 000000000000..543a08500828 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java @@ -0,0 +1,297 @@ +/* + * Copyright 2024 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.cloud.bigtable.common; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structField; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigtable.common.Type.SchemalessEnum; +import com.google.cloud.bigtable.common.Type.SchemalessProto; +import com.google.cloud.bigtable.common.Type.SchemalessStruct; +import com.google.cloud.bigtable.common.Type.StructWithSchema; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Album; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Format; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.common.testing.EqualsTester; +import com.google.protobuf.ByteString; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TypeTest { + + @Test + public void simpleTypes_TypeToString() { + assertThat(Type.String.create().toString()).isEqualTo("STRING"); + assertThat(Type.Bytes.create().toString()).isEqualTo("BYTES"); + assertThat(Type.Int64.create().toString()).isEqualTo("INT64"); + assertThat(Type.Float64.create().toString()).isEqualTo("FLOAT64"); + assertThat(Type.Float32.create().toString()).isEqualTo("FLOAT32"); + assertThat(Type.Bool.create().toString()).isEqualTo("BOOL"); + assertThat(Type.Timestamp.create().toString()).isEqualTo("TIMESTAMP"); + assertThat(Type.Date.create().toString()).isEqualTo("DATE"); + assertThat(Type.SchemalessStruct.create().toString()).isEqualTo("STRUCT"); + assertThat(Type.SchemalessProto.create("MyMessage", "my_bundle").toString()) + .isEqualTo("PROTO{messageName=MyMessage, schemaBundleId=my_bundle}"); + assertThat(Type.SchemalessEnum.create("MyEnum", "other_bundle").toString()) + .isEqualTo("ENUM{enumName=MyEnum, schemaBundleId=other_bundle}"); + } + + @Test + @SuppressWarnings("TruthIncompatibleType") + public void simpleTypes_equals() { + assertThat(Type.String.create()).isEqualTo(Type.String.create()); + assertThat(Type.Bytes.create()).isEqualTo(Type.Bytes.create()); + assertThat(Type.Int64.create()).isEqualTo(Type.Int64.create()); + assertThat(Type.Float32.create()).isEqualTo(Type.Float32.create()); + assertThat(Type.Float64.create()).isEqualTo(Type.Float64.create()); + assertThat(Type.Bool.create()).isEqualTo(Type.Bool.create()); + assertThat(Type.Timestamp.create()).isEqualTo(Type.Timestamp.create()); + assertThat(Type.Date.create()).isEqualTo(Type.Date.create()); + assertThat(Type.SchemalessStruct.create()).isEqualTo(Type.SchemalessStruct.create()); + + assertThat(Type.String.create()).isNotEqualTo(Type.Bytes.create()); + assertThat(Type.Bytes.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Int64.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Float32.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Float64.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Bool.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Timestamp.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.Date.create()).isNotEqualTo(Type.String.create()); + assertThat(Type.SchemalessStruct.create()).isNotEqualTo(Type.String.create()); + } + + @Test + @SuppressWarnings("TruthIncompatibleType") + public void array_equals() { + assertThat(Type.Array.create(Type.String.create())) + .isEqualTo(Type.Array.create(Type.String.create())); + assertThat(Type.Array.create(Type.String.create())) + .isNotEqualTo(Type.Array.create(Type.Bytes.create())); + // Nested arrays + assertThat(Type.Array.create(Type.Array.create(Type.String.create()))) + .isEqualTo(Type.Array.create(Type.Array.create(Type.String.create()))); + assertThat(Type.Array.create(Type.Array.create(Type.String.create()))) + .isNotEqualTo(Type.Array.create(Type.Array.create(Type.Bytes.create()))); + } + + @Test + @SuppressWarnings("TruthIncompatibleType") + public void map_equals() { + assertThat(Type.Map.create(Type.Bytes.create(), Type.String.create())) + .isEqualTo(Type.Map.create(Type.Bytes.create(), Type.String.create())); + assertThat(Type.Map.create(Type.Bytes.create(), Type.String.create())) + .isNotEqualTo(Type.Map.create(Type.String.create(), Type.String.create())); + assertThat(Type.Map.create(Type.Bytes.create(), Type.String.create())) + .isNotEqualTo(Type.Map.create(Type.Bytes.create(), Type.Bytes.create())); + // Nested Maps + assertThat( + Type.Map.create( + Type.Bytes.create(), Type.Map.create(Type.String.create(), Type.Bytes.create()))) + .isEqualTo( + Type.Map.create( + Type.Bytes.create(), Type.Map.create(Type.String.create(), Type.Bytes.create()))); + assertThat( + Type.Map.create( + Type.Bytes.create(), Type.Map.create(Type.String.create(), Type.Bytes.create()))) + .isNotEqualTo( + Type.Map.create( + Type.Bytes.create(), Type.Map.create(Type.String.create(), Type.String.create()))); + } + + @Test + @SuppressWarnings("TruthIncompatibleType") + public void proto_equals() { + assertThat(Type.SchemalessProto.create("MyMessage", "my_bundle")) + .isEqualTo(Type.SchemalessProto.create("MyMessage", "my_bundle")); + assertThat(Type.Proto.create(Singer.getDefaultInstance())) + .isEqualTo(Type.Proto.create(Singer.getDefaultInstance())); + + assertThat(Type.SchemalessProto.create("MyMessage", "my_bundle")) + .isNotEqualTo(Type.SchemalessProto.create("AnotherMessage", "my_bundle")); + assertThat(Type.SchemalessProto.create("MyMessage", "my_bundle")) + .isNotEqualTo(Type.SchemalessProto.create("MyMessage", "another_bundle")); + assertThat(Type.Proto.create(Singer.getDefaultInstance())) + .isNotEqualTo(Type.Proto.create(Album.getDefaultInstance())); + + assertThat( + Type.SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")) + .isNotEqualTo(Type.Proto.create(Singer.getDefaultInstance())); + assertThat(Type.Proto.create(Singer.getDefaultInstance())) + .isNotEqualTo( + Type.SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")); + } + + @Test + @SuppressWarnings("TruthIncompatibleType") + public void enum_equals() { + assertThat(Type.SchemalessEnum.create("MyEnum", "my_bundle")) + .isEqualTo(Type.SchemalessEnum.create("MyEnum", "my_bundle")); + assertThat(Type.Enum.create(Genre::forNumber)).isEqualTo(Type.Enum.create(Genre::forNumber)); + + assertThat(Type.SchemalessEnum.create("MyEnum", "my_bundle")) + .isNotEqualTo(Type.SchemalessEnum.create("AnotherEnum", "my_bundle")); + assertThat(Type.SchemalessEnum.create("MyEnum", "my_bundle")) + .isNotEqualTo(Type.SchemalessEnum.create("MyEnum", "another_bundle")); + assertThat(Type.Enum.create(Genre::forNumber)) + .isNotEqualTo(Type.Enum.create(Format::forNumber)); + + assertThat( + Type.SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")) + .isNotEqualTo(Type.Enum.create(Genre::forNumber)); + assertThat(Type.Enum.create(Genre::forNumber)) + .isNotEqualTo( + Type.SchemalessEnum.create( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")); + } + + @Test + public void structWithSchema_equals() { + com.google.bigtable.v2.Type structProto = + structType(structField("timestamp", timestampType()), structField("value", bytesType())); + com.google.bigtable.v2.Type complexStructProto = + structType( + structField("map", mapType(stringType(), bytesType())), + structField("array", arrayType(stringType()))); + new EqualsTester() + .addEqualityGroup( + StructWithSchema.fromProto(structProto.getStructType()), + StructWithSchema.fromProto(structProto.getStructType())) + .addEqualityGroup( + StructWithSchema.fromProto(complexStructProto.getStructType()), + StructWithSchema.fromProto(complexStructProto.getStructType())) + .testEquals(); + } + + @Test + public void structWithSchema_fields() { + StructWithSchema struct = + StructWithSchema.fromProto( + structType(structField("timestamp", timestampType()), structField("value", bytesType())) + .getStructType()); + assertThat(struct.getFields()).hasSize(2); + assertThat(struct.getFields().get(0).name()).isEqualTo("timestamp"); + assertThat(struct.getFields().get(0).type()).isEqualTo(Type.Timestamp.create()); + assertThat(struct.getType(0)).isEqualTo(Type.Timestamp.create()); + assertThat(struct.getType("timestamp")).isEqualTo(Type.Timestamp.create()); + assertThat(struct.getColumnIndex("timestamp")).isEqualTo(0); + + assertThat(struct.getFields().get(1).name()).isEqualTo("value"); + assertThat(struct.getFields().get(1).type()).isEqualTo(Type.Bytes.create()); + assertThat(struct.getType(1)).isEqualTo(Type.Bytes.create()); + assertThat(struct.getType("value")).isEqualTo(Type.Bytes.create()); + assertThat(struct.getColumnIndex("value")).isEqualTo(1); + } + + @Test + public void structWithSchema_handlesAmbiguousFields() { + StructWithSchema struct = + StructWithSchema.fromProto( + structType(structField("foo", timestampType()), structField("foo", bytesType())) + .getStructType()); + assertThat(struct.getFields()).hasSize(2); + assertThat(struct.getType(0)).isEqualTo(Type.Timestamp.create()); + assertThat(struct.getType(1)).isEqualTo(Type.Bytes.create()); + + assertThrows(IllegalArgumentException.class, () -> struct.getType("foo")); + assertThrows(IllegalArgumentException.class, () -> struct.getColumnIndex("foo")); + } + + @Test + public void structWithSchema_toString() { + StructWithSchema struct = + StructWithSchema.fromProto( + structType(structField("test", stringType()), structField("test2", int64Type())) + .getStructType()); + assertThat(struct.toString()) + .isEqualTo("STRUCT{fields=[Field{name=test, type=STRING}, Field{name=test2, type=INT64}]}"); + } + + @Test + public void schemalessStruct_throwsExceptionOnSchemaAccess() { + SchemalessStruct struct = Type.SchemalessStruct.create(); + + assertThrows(UnsupportedOperationException.class, () -> struct.getType("foo")); + assertThrows(UnsupportedOperationException.class, () -> struct.getType(0)); + assertThrows(UnsupportedOperationException.class, () -> struct.getColumnIndex("foo")); + assertThrows(UnsupportedOperationException.class, struct::getFields); + } + + @Test + public void schemalessProto_throwsExceptionOnGetParser() { + SchemalessProto proto = Type.SchemalessProto.create("MyMessage", "my_bundle"); + assertThrows(UnsupportedOperationException.class, proto::getParserForType); + } + + @Test + public void schemalessEnum_throwsExceptionOnGetForNumber() { + SchemalessEnum myEnum = Type.SchemalessEnum.create("MyEnum", "my_bundle"); + assertThrows(UnsupportedOperationException.class, myEnum::getForNumber); + } + + @Test + public void array_toString() { + Type array = Type.Array.create(Type.String.create()); + + assertThat(array.toString()).isEqualTo("ARRAY{elementType=STRING}"); + } + + @Test + public void simpleMap_toString() { + Type map = Type.Map.create(Type.Bytes.create(), Type.String.create()); + + assertThat(map.toString()).isEqualTo("MAP{keyType=BYTES, valueType=STRING}"); + } + + @Test + public void historicalMap_toString() { + SqlType.Map> historicalMap = SqlType.historicalMap(); + + assertThat(historicalMap.toString()) + .isEqualTo("MAP{keyType=BYTES, valueType=ARRAY{elementType=STRUCT}}"); + } + + @Test + public void proto_toString() { + SqlType.Proto proto = Type.Proto.create(Singer.getDefaultInstance()); + + assertThat(proto.toString()) + .isEqualTo("PROTO{message=com.google.cloud.bigtable.data.v2.test.Singer}"); + } + + @Test + public void enum_toString() { + SqlType.Enum myEnum = Type.Enum.create(Genre::forNumber); + + assertThat(myEnum.toString()) + .isEqualTo("ENUM{enum=com.google.cloud.bigtable.data.v2.test.Genre}"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java new file mode 100644 index 000000000000..30a4853a618d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java @@ -0,0 +1,509 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiClock; +import com.google.api.core.ApiFunction; +import com.google.api.gax.batching.BatcherImpl; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.WatchdogProvider; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.base.Preconditions; +import com.google.common.io.BaseEncoding; +import io.grpc.Attributes; +import io.grpc.Grpc; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.ServerTransportFilter; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.SocketAddress; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.LinkedBlockingDeque; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.stubbing.Answer; + +@RunWith(JUnit4.class) +public class BigtableDataClientFactoryTest { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); + + private static final String DEFAULT_PROJECT_ID = "fake-project"; + private static final String DEFAULT_INSTANCE_ID = "fake-instance"; + private static final String DEFAULT_APP_PROFILE_ID = "fake-app-profile"; + + private Server server; + private FakeBigtableService service; + + private TransportChannelProvider transportChannelProvider; + private CredentialsProvider credentialsProvider; + private ExecutorProvider executorProvider; + private WatchdogProvider watchdogProvider; + private BigtableDataSettings defaultSettings; + + private final BlockingQueue terminateAttributes = new LinkedBlockingDeque<>(); + private final BlockingQueue requestMetadata = new LinkedBlockingDeque<>(); + private final ConcurrentMap warmedChannels = new ConcurrentHashMap<>(); + + @Before + public void setUp() throws IOException { + service = new FakeBigtableService(); + server = + FakeServiceBuilder.create(service) + .intercept( + new ServerInterceptor() { + @Override + public Listener interceptCall( + ServerCall call, + Metadata headers, + ServerCallHandler next) { + requestMetadata.add(headers); + + // Check if the call is PingAndWarm and mark the channel address as warmed up. + if (BigtableGrpc.getPingAndWarmMethod().equals(call.getMethodDescriptor())) { + SocketAddress remoteAddr = + call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + if (remoteAddr != null) { + warmedChannels.put(remoteAddr, true); + } + } + return next.startCall(call, headers); + } + }) + .addTransportFilter( + new ServerTransportFilter() { + @Override + public void transportTerminated(Attributes transportAttrs) { + terminateAttributes.add(transportAttrs); + } + }) + .start(); + + BigtableDataSettings.Builder builder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(DEFAULT_PROJECT_ID) + .setInstanceId(DEFAULT_INSTANCE_ID) + .setAppProfileId(DEFAULT_APP_PROFILE_ID); + + transportChannelProvider = + Mockito.mock( + TransportChannelProvider.class, + new BuilderAnswer<>( + TransportChannelProvider.class, + builder.stubSettings().getTransportChannelProvider())); + + credentialsProvider = + Mockito.mock( + CredentialsProvider.class, + new BuilderAnswer<>( + CredentialsProvider.class, builder.stubSettings().getCredentialsProvider())); + + executorProvider = + Mockito.mock( + ExecutorProvider.class, + new BuilderAnswer<>( + ExecutorProvider.class, builder.stubSettings().getBackgroundExecutorProvider())); + + watchdogProvider = + Mockito.mock( + WatchdogProvider.class, + new BuilderAnswer<>( + WatchdogProvider.class, builder.stubSettings().getStreamWatchdogProvider())); + + ApiClock apiClock = builder.stubSettings().getClock(); + + builder + .stubSettings() + .setTransportChannelProvider(transportChannelProvider) + .setCredentialsProvider(credentialsProvider) + .setBackgroundExecutorProvider(executorProvider) + .setStreamWatchdogProvider(watchdogProvider) + .setClock(apiClock); + + defaultSettings = builder.build(); + } + + @After + public void tearDown() { + server.shutdown(); + } + + @Test + public void testNewClientsShareTransportChannel() throws Exception { + // Create 3 lightweight clients + try (BigtableDataClientFactory factory = + BigtableDataClientFactory.create( + defaultSettings.toBuilder() + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build()); + BigtableDataClient ignored1 = factory.createForInstance("project1", "instance1"); + BigtableDataClient ignored2 = factory.createForInstance("project2", "instance2"); + BigtableDataClient ignored3 = factory.createForInstance("project3", "instance3")) { + + // Make sure that only 1 instance is created by each provider + Mockito.verify(transportChannelProvider, Mockito.times(1)).getTransportChannel(); + // getCredentials was called twice, in patchCredentials and when creating the fixed + // credentials in BigtableClientContext + Mockito.verify(credentialsProvider, Mockito.times(2)).getCredentials(); + Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); + Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); + } + } + + @Test + public void testCreateDefaultKeepsSettings() throws Exception { + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + BigtableDataClient client = factory.createDefault()) { + + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); + } + + assertThat(service.lastRequest.getTableName()) + .isEqualTo(NameUtil.formatTableName(DEFAULT_PROJECT_ID, DEFAULT_INSTANCE_ID, "some-table")); + assertThat(service.lastRequest.getAppProfileId()).isEqualTo(DEFAULT_APP_PROFILE_ID); + } + + @Test + public void testCreateForAppProfileHasCorrectSettings() throws Exception { + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + BigtableDataClient client = factory.createForAppProfile("other-app-profile")) { + + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); + } + + assertThat(service.lastRequest.getTableName()) + .isEqualTo(NameUtil.formatTableName(DEFAULT_PROJECT_ID, DEFAULT_INSTANCE_ID, "some-table")); + assertThat(service.lastRequest.getAppProfileId()).isEqualTo("other-app-profile"); + } + + @Test + public void testCreateForInstanceHasCorrectSettings() throws Exception { + + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + BigtableDataClient client = factory.createForInstance("other-project", "other-instance")) { + + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); + } + + assertThat(service.lastRequest.getTableName()) + .isEqualTo(NameUtil.formatTableName("other-project", "other-instance", "some-table")); + // app profile should be reset to default + assertThat(service.lastRequest.getAppProfileId()).isEmpty(); + } + + @Test + public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Exception { + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + BigtableDataClient client = + factory.createForInstance("other-project", "other-instance", "other-app-profile")) { + + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); + } + + assertThat(service.lastRequest.getTableName()) + .isEqualTo(NameUtil.formatTableName("other-project", "other-instance", "some-table")); + // app profile should be reset to default + assertThat(service.lastRequest.getAppProfileId()).isEqualTo("other-app-profile"); + } + + @Test + public void testCreateWithRefreshingChannel() throws Exception { + int poolSize = 3; + // TODO: remove the suppression when setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + BigtableDataSettings.Builder builder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(DEFAULT_PROJECT_ID) + .setInstanceId(DEFAULT_INSTANCE_ID) + .setAppProfileId(DEFAULT_APP_PROFILE_ID) + .setRefreshingChannel(true); + builder + .stubSettings() + .setCredentialsProvider(credentialsProvider) + .setStreamWatchdogProvider(watchdogProvider) + .setBackgroundExecutorProvider(executorProvider); + InstantiatingGrpcChannelProvider channelProvider = + (InstantiatingGrpcChannelProvider) builder.stubSettings().getTransportChannelProvider(); + InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = channelProvider.toBuilder(); + channelProviderBuilder.setChannelPoolSettings(ChannelPoolSettings.staticallySized(poolSize)); + builder.stubSettings().setTransportChannelProvider(channelProviderBuilder.build()); + + BigtableDataClientFactory factory = BigtableDataClientFactory.create(builder.build()); + factory.createDefault(); + factory.createForAppProfile("other-appprofile"); + factory.createForInstance("other-project", "other-instance"); + + // Make sure that only 1 instance is created by each provider + // getCredentials was called twice, in patchCredentials and when creating the fixed credentials + // in BigtableClientContext + Mockito.verify(credentialsProvider, Mockito.times(2)).getCredentials(); + Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); + Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); + assertThat(warmedChannels).hasSize(poolSize + 1); + assertThat(warmedChannels.values()).doesNotContain(false); + + // Wait for all the connections to close asynchronously + factory.close(); + long sleepTimeMs = 1000; + Thread.sleep(sleepTimeMs); + // Verify that all the channels are closed + assertThat(terminateAttributes).hasSize(poolSize + 1); + } + + @Test + public void testCreateWithRefreshingChannelWithDirectAccessByDefault() throws Exception { + int poolSize = 3; + // TODO: remove the suppression when setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + BigtableDataSettings.Builder builder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(DEFAULT_PROJECT_ID) + .setInstanceId(DEFAULT_INSTANCE_ID) + .setAppProfileId(DEFAULT_APP_PROFILE_ID) + .setRefreshingChannel(true); + builder + .stubSettings() + .setCredentialsProvider(credentialsProvider) + .setStreamWatchdogProvider(watchdogProvider) + .setBackgroundExecutorProvider(executorProvider) + .setDirectPathConfig(EnhancedBigtableStubSettings.DirectPathConfig.DEFAULT); + InstantiatingGrpcChannelProvider channelProvider = + (InstantiatingGrpcChannelProvider) builder.stubSettings().getTransportChannelProvider(); + InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = channelProvider.toBuilder(); + channelProviderBuilder.setChannelPoolSettings(ChannelPoolSettings.staticallySized(poolSize)); + builder.stubSettings().setTransportChannelProvider(channelProviderBuilder.build()); + + BigtableDataClientFactory factory = BigtableDataClientFactory.create(builder.build()); + factory.createDefault(); + factory.createForAppProfile("other-appprofile"); + factory.createForInstance("other-project", "other-instance"); + + // Make sure that only 1 instance is created by each provider + // getCredentials was called twice, in patchCredentials and when creating the fixed credentials + // in BigtableClientContext + Mockito.verify(credentialsProvider, Mockito.times(2)).getCredentials(); + Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); + Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); + assertThat(warmedChannels).hasSize(poolSize + 1); + assertThat(warmedChannels.values()).doesNotContain(false); + + // Wait for all the connections to close asynchronously + factory.close(); + long sleepTimeMs = 1000; + Thread.sleep(sleepTimeMs); + // Verify that all the channels are closed + // If we have DEFAULT, it will add one channel temporily + assertThat(terminateAttributes).hasSize(poolSize + 1); + } + + @Test + public void testCreateWithRefreshingChannelDisableDirectAccess() throws Exception { + int poolSize = 3; + // TODO: remove the suppression when setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + BigtableDataSettings.Builder builder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(DEFAULT_PROJECT_ID) + .setInstanceId(DEFAULT_INSTANCE_ID) + .setAppProfileId(DEFAULT_APP_PROFILE_ID) + .setRefreshingChannel(true); + + builder + .stubSettings() + .setCredentialsProvider(credentialsProvider) + .setStreamWatchdogProvider(watchdogProvider) + .setBackgroundExecutorProvider(executorProvider) + .setDirectPathConfig(EnhancedBigtableStubSettings.DirectPathConfig.FORCED_OFF); + InstantiatingGrpcChannelProvider channelProvider = + (InstantiatingGrpcChannelProvider) builder.stubSettings().getTransportChannelProvider(); + InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = channelProvider.toBuilder(); + channelProviderBuilder.setChannelPoolSettings(ChannelPoolSettings.staticallySized(poolSize)); + builder.stubSettings().setTransportChannelProvider(channelProviderBuilder.build()); + + BigtableDataClientFactory factory = BigtableDataClientFactory.create(builder.build()); + factory.createDefault(); + factory.createForAppProfile("other-appprofile"); + factory.createForInstance("other-project", "other-instance"); + + // Make sure that only 1 instance is created by each provider + // getCredentials was called twice, in patchCredentials and when creating the fixed credentials + // in BigtableClientContext + Mockito.verify(credentialsProvider, Mockito.times(2)).getCredentials(); + Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); + Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); + assertThat(warmedChannels).hasSize(poolSize); + assertThat(warmedChannels.values()).doesNotContain(false); + + // Wait for all the connections to close asynchronously + factory.close(); + long sleepTimeMs = 1000; + Thread.sleep(sleepTimeMs); + // Verify that all the channels are closed + // If we have DEFAULT, it will add one channel temporily + assertThat(terminateAttributes).hasSize(poolSize); + } + + @Test + public void testFeatureFlags() throws Exception { + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + BigtableDataClient client = factory.createDefault()) { + + requestMetadata.clear(); + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); + } + + Metadata metadata = requestMetadata.take(); + String encodedValue = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(encodedValue).isNotNull(); + FeatureFlags featureFlags = + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedValue)); + + assertThat(featureFlags.getReverseScans()).isTrue(); + } + + @Test + public void testBulkMutationFlowControllerConfigured() throws Exception { + BigtableDataSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("my-project") + .setInstanceId("my-instance") + .setCredentialsProvider(credentialsProvider) + .enableBatchMutationLatencyBasedThrottling(10L) + .build(); + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(settings)) { + BigtableDataClient client1 = factory.createDefault(); + BigtableDataClient client2 = factory.createForAppProfile("app-profile"); + + try (BatcherImpl batcher1 = + (BatcherImpl) client1.newBulkMutationBatcher(TableId.of("my-table")); + BatcherImpl batcher2 = + (BatcherImpl) client1.newBulkMutationBatcher(TableId.of("my-table"))) { + assertThat(batcher1.getFlowController()).isSameInstanceAs(batcher2.getFlowController()); + } + + try (BatcherImpl batcher1 = + (BatcherImpl) client1.newBulkMutationBatcher(TableId.of("my-table")); + BatcherImpl batcher2 = + (BatcherImpl) client2.newBulkMutationBatcher(TableId.of("my-table"))) { + assertThat(batcher1.getFlowController()).isNotSameInstanceAs(batcher2.getFlowController()); + } + } + } + + private static class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + + volatile MutateRowRequest lastRequest; + + private final ApiFunction readRowsCallback = + readRowsRequest -> ReadRowsResponse.getDefaultInstance(); + + private final ApiFunction pingAndWarmCallback = + pingAndWarmRequest -> PingAndWarmResponse.getDefaultInstance(); + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + try { + responseObserver.onNext(readRowsCallback.apply(request)); + responseObserver.onCompleted(); + } catch (RuntimeException e) { + responseObserver.onError(e); + } + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + lastRequest = request; + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { + responseObserver.onNext(pingAndWarmCallback.apply(request)); + responseObserver.onCompleted(); + } + } + + private static class BuilderAnswer implements Answer { + + private final Class targetClass; + private T targetInstance; + + private BuilderAnswer(Class targetClass, T targetInstance) { + this.targetClass = targetClass; + this.targetInstance = targetInstance; + } + + @SuppressWarnings("unchecked") + @Override + public T answer(InvocationOnMock invocation) throws Throwable { + Method method = invocation.getMethod(); + Object r = invocation.getMethod().invoke(targetInstance, invocation.getArguments()); + + if (method.getName().startsWith("with") + && targetClass.isAssignableFrom(method.getReturnType())) { + this.targetInstance = castToTarget(r); + r = invocation.getMock(); + } + return (T) r; + } + + @SuppressWarnings("unchecked") + private T castToTarget(Object o) { + Preconditions.checkArgument( + targetClass.isAssignableFrom(targetClass), "Expected instance of " + targetClass); + return (T) o; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java new file mode 100644 index 000000000000..ec82f1c12c8a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +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.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Answers; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; +import org.mockito.stubbing.Answer; + +/** + * Tests for {@link BigtableDataClient}. This test class uses Mockito so it has been explicitly + * excluded from Native Image testing by not following the naming convention of (IT* and + * *ClientTest). + */ +@RunWith(JUnit4.class) +public class BigtableDataClientTests { + + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN); + + @Mock private EnhancedBigtableStub mockStub; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private ServerStreamingCallable mockReadRowsCallable; + + @Mock private UnaryCallable mockReadRowCallable; + @Mock private UnaryCallable> mockSampleRowKeysCallable; + + @Mock + private UnaryCallable> mockSampleRowKeysCallableWithRequest; + + @Mock private UnaryCallable mockMutateRowCallable; + @Mock private UnaryCallable mockCheckAndMutateRowCallable; + @Mock private UnaryCallable mockReadModifyWriteRowCallable; + @Mock private UnaryCallable mockBulkMutateRowsCallable; + @Mock private Batcher mockBulkMutationBatcher; + @Mock private Batcher mockBulkReadRowsBatcher; + @Mock private UnaryCallable mockPrepareQueryCallable; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private ServerStreamingCallable + mockGenerateInitialChangeStreamPartitionsCallable; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private ServerStreamingCallable + mockReadChangeStreamCallable; + + private BigtableDataClient bigtableDataClient; + + @Before + public void setUp() { + bigtableDataClient = new BigtableDataClient(mockStub); + } + + @Test + public void proxyCloseTest() { + bigtableDataClient.close(); + Mockito.verify(mockStub).close(); + } + + @Test + public void existsTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Query expectedQuery = + Query.create(TableId.of("fake-table")) + .rowKey("fake-row-key") + .filter( + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerRow(1)) + .filter(FILTERS.value().strip())); + Row row = Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when(mockReadRowCallable.futureCall(expectedQuery)) + .thenReturn(ApiFutures.immediateFuture(row)) + .thenReturn(ApiFutures.immediateFuture(null)); + + boolean result = bigtableDataClient.exists(TableId.of("fake-table"), "fake-row-key"); + boolean anotherResult = + bigtableDataClient.exists( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key")); + + assertThat(result).isTrue(); + assertThat(anotherResult).isFalse(); + + Mockito.verify(mockReadRowCallable, Mockito.times(2)).futureCall(expectedQuery); + } + + @Test + public void existsOnAuthorizedViewTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Query expectedQuery = + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter( + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerRow(1)) + .filter(FILTERS.value().strip())); + Row row = Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when(mockReadRowCallable.futureCall(expectedQuery)) + .thenReturn(ApiFutures.immediateFuture(row)) + .thenReturn(ApiFutures.immediateFuture(null)); + + boolean result = + bigtableDataClient.exists( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key"); + boolean anotherResult = + bigtableDataClient.exists( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key")); + + assertThat(result).isTrue(); + assertThat(anotherResult).isFalse(); + + Mockito.verify(mockReadRowCallable, Mockito.times(2)).futureCall(expectedQuery); + } + + @Test + public void existsAsyncTest() throws Exception { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Query expectedQuery = + Query.create(TableId.of("fake-table")) + .rowKey("fake-row-key") + .filter( + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerRow(1)) + .filter(FILTERS.value().strip())); + Row row = Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + + Mockito.when(mockReadRowCallable.futureCall(expectedQuery)) + .thenReturn(ApiFutures.immediateFuture(row)) + .thenReturn(ApiFutures.immediateFuture(null)); + + ApiFuture result = + bigtableDataClient.existsAsync( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key")); + assertThat(result.get()).isTrue(); + + ApiFuture anotherResult = + bigtableDataClient.existsAsync(TableId.of("fake-table"), "fake-row-key"); + assertThat(anotherResult.get()).isFalse(); + + Mockito.verify(mockReadRowCallable, Mockito.times(2)).futureCall(expectedQuery); + } + + @Test + public void existsOnAuthorizedViewAsyncTest() throws Exception { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Query expectedQuery = + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter( + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerRow(1)) + .filter(FILTERS.value().strip())); + Row row = Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + + Mockito.when(mockReadRowCallable.futureCall(expectedQuery)) + .thenReturn(ApiFutures.immediateFuture(row)) + .thenReturn(ApiFutures.immediateFuture(null)); + + ApiFuture result = + bigtableDataClient.existsAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key")); + assertThat(result.get()).isTrue(); + + ApiFuture anotherResult = + bigtableDataClient.existsAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key"); + assertThat(anotherResult.get()).isFalse(); + + Mockito.verify(mockReadRowCallable, Mockito.times(2)).futureCall(expectedQuery); + } + + @Test + public void proxyReadRowsCallableTest() { + Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); + assertThat(bigtableDataClient.readRowsCallable()).isSameInstanceAs(mockReadRowsCallable); + } + + @Test + public void proxyGenerateInitialChangeStreamPartitionsCallableTest() { + Mockito.when(mockStub.generateInitialChangeStreamPartitionsCallable()) + .thenReturn(mockGenerateInitialChangeStreamPartitionsCallable); + assertThat(bigtableDataClient.generateInitialChangeStreamPartitionsCallable()) + .isSameInstanceAs(mockGenerateInitialChangeStreamPartitionsCallable); + } + + @Test + public void proxyReadChangeStreamCallableTest() { + Mockito.when(mockStub.readChangeStreamCallable()).thenReturn(mockReadChangeStreamCallable); + assertThat(bigtableDataClient.readChangeStreamCallable()) + .isSameInstanceAs(mockReadChangeStreamCallable); + } + + @Test + public void proxyReadRowAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key")); + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create(TableId.of("fake-table")).rowKey("fake-row-key")); + } + + @Test + public void proxyReadRowOnAuthorizedViewAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key")); + Mockito.verify(mockReadRowCallable) + .futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key")); + } + + @Test + public void proxyReadRowStrAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync(TableId.of("fake-table"), "fake-row-key"); + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create(TableId.of("fake-table")).rowKey("fake-row-key")); + } + + @Test + public void proxyReadRowOnAuthorizedViewStrAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key"); + Mockito.verify(mockReadRowCallable) + .futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key")); + } + + @Test + public void readRowFilterAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key"), filter); + + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create(TableId.of("fake-table")).rowKey("fake-row-key").filter(filter)); + } + + @Test + public void readRowOnAuthorizedViewFilterAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key"), + filter); + + Mockito.verify(mockReadRowCallable) + .futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter(filter)); + } + + @Test + public void readRowFilterStrAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync(TableId.of("fake-table"), "fake-row-key", filter); + + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create(TableId.of("fake-table")).rowKey("fake-row-key").filter(filter)); + } + + @Test + public void readRowOnAuthorizedViewFilterStrAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.readRowAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key", filter); + + Mockito.verify(mockReadRowCallable) + .futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter(filter)); + } + + @Test + public void readRowTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(TableId.of("fake-table")).rowKey("fake-row-key"))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key")); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowOnAuthorizedViewTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key"))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key")); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowStrTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(TableId.of("fake-table")).rowKey("fake-row-key"))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = bigtableDataClient.readRow(TableId.of("fake-table"), "fake-row-key"); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowOnAuthorizedViewStrTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key"))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key"); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowFilterTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(TableId.of("fake-table")).rowKey("fake-row-key").filter(filter))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + TableId.of("fake-table"), ByteString.copyFromUtf8("fake-row-key"), filter); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowOnAuthorizedViewFilterTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter(filter))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + ByteString.copyFromUtf8("fake-row-key"), + filter); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowStrFilterTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(TableId.of("fake-table")).rowKey("fake-row-key").filter(filter))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = bigtableDataClient.readRow(TableId.of("fake-table"), "fake-row-key", filter); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void readRowOnAuthorizedViewStrFilterTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + // Build the filter expression + Filter filter = + FILTERS + .chain() + .filter(FILTERS.qualifier().regex("prefix.*")) + .filter(FILTERS.limit().cellsPerRow(10)); + Row expectedRow = + Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); + Mockito.when( + mockReadRowCallable.futureCall( + Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .rowKey("fake-row-key") + .filter(filter))) + .thenReturn(ApiFutures.immediateFuture(expectedRow)); + + Row actualRow = + bigtableDataClient.readRow( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-row-key", filter); + + assertThat(actualRow).isEqualTo(expectedRow); + } + + @Test + public void proxyReadRowsSyncTest() { + Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); + + Query query = Query.create(TableId.of("fake-table")); + bigtableDataClient.readRows(query); + + Mockito.verify(mockReadRowsCallable).call(query); + } + + @Test + public void proxyReadRowsOnAuthorizedViewSyncTest() { + Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); + + Query query = Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")); + bigtableDataClient.readRows(query); + + Mockito.verify(mockReadRowsCallable).call(query); + } + + @Test + public void proxyReadRowsAsyncTest() { + Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); + + Query query = Query.create(TableId.of("fake-table")); + @SuppressWarnings("unchecked") + ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); + bigtableDataClient.readRowsAsync(query, mockObserver); + + Mockito.verify(mockReadRowsCallable).call(query, mockObserver); + } + + @Test + public void proxyReadRowsOnAuthorizedViewAsyncTest() { + Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); + + Query query = Query.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")); + @SuppressWarnings("unchecked") + ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); + bigtableDataClient.readRowsAsync(query, mockObserver); + + Mockito.verify(mockReadRowsCallable).call(query, mockObserver); + } + + @Test + public void proxyGenerateInitialChangeStreamPartitionsSyncTest() { + Mockito.when(mockStub.generateInitialChangeStreamPartitionsCallable()) + .thenReturn(mockGenerateInitialChangeStreamPartitionsCallable); + + bigtableDataClient.generateInitialChangeStreamPartitions("fake-table"); + + Mockito.verify(mockGenerateInitialChangeStreamPartitionsCallable).call("fake-table"); + } + + @Test + public void proxyGenerateInitialChangeStreamPartitionsAsyncTest() { + Mockito.when(mockStub.generateInitialChangeStreamPartitionsCallable()) + .thenReturn(mockGenerateInitialChangeStreamPartitionsCallable); + + @SuppressWarnings("unchecked") + ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); + bigtableDataClient.generateInitialChangeStreamPartitionsAsync("fake-table", mockObserver); + + Mockito.verify(mockGenerateInitialChangeStreamPartitionsCallable) + .call("fake-table", mockObserver); + } + + @Test + public void proxyReadChangeStreamSyncTest() { + Mockito.when(mockStub.readChangeStreamCallable()).thenReturn(mockReadChangeStreamCallable); + + ReadChangeStreamQuery query = ReadChangeStreamQuery.create("fake-table"); + bigtableDataClient.readChangeStream(query); + + Mockito.verify(mockReadChangeStreamCallable).call(query); + } + + @Test + public void proxyReadChangeStreamAsyncTest() { + Mockito.when(mockStub.readChangeStreamCallable()).thenReturn(mockReadChangeStreamCallable); + + @SuppressWarnings("unchecked") + ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); + ReadChangeStreamQuery query = ReadChangeStreamQuery.create("fake-table"); + bigtableDataClient.readChangeStreamAsync(query, mockObserver); + + Mockito.verify(mockReadChangeStreamCallable).call(query, mockObserver); + } + + @SuppressWarnings("deprecation") + @Test + public void proxySampleRowKeysCallableTest() { + Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); + + assertThat(bigtableDataClient.sampleRowKeysCallable()) + .isSameInstanceAs(mockSampleRowKeysCallable); + } + + @Test + @SuppressWarnings({"deprecation"}) + public void proxySampleRowKeysTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.sampleRowKeysAsync("fake-table"); + + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall(SampleRowKeysRequest.create(TableId.of("fake-table"))); + } + + @Test + @SuppressWarnings({"deprecation"}) + public void proxySampleRowKeysOnAuthorizedViewTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + bigtableDataClient.sampleRowKeysAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view")); + + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall( + SampleRowKeysRequest.create(AuthorizedViewId.of("fake-table", "fake-authorized-view"))); + } + + @SuppressWarnings("deprecation") + @Test + public void sampleRowKeysTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + Mockito.when( + mockSampleRowKeysCallableWithRequest.futureCall( + ArgumentMatchers.any(SampleRowKeysRequest.class))) + .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); + bigtableDataClient.sampleRowKeys("fake-table"); + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall(SampleRowKeysRequest.create(TableId.of("fake-table"))); + } + + @Test + public void sampleRowKeysOnAuthorizedViewTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + Mockito.when( + mockSampleRowKeysCallableWithRequest.futureCall( + ArgumentMatchers.any(SampleRowKeysRequest.class))) + .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); + bigtableDataClient.sampleRowKeys(AuthorizedViewId.of("fake-table", "fake-authorized-view")); + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall( + SampleRowKeysRequest.create(AuthorizedViewId.of("fake-table", "fake-authorized-view"))); + } + + @Test + public void proxyMutateRowCallableTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + + assertThat(bigtableDataClient.mutateRowCallable()).isSameInstanceAs(mockMutateRowCallable); + } + + @Test + @SuppressWarnings({"deprecation"}) + public void proxyMutateRowTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + + RowMutation request = + RowMutation.create(TableId.of("fake-table"), "some-key") + .setCell("some-family", "fake-qualifier", "fake-value"); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.mutateRowAsync(request); + + Mockito.verify(mockMutateRowCallable).futureCall(request); + } + + @Test + public void proxyMutateRowOnAuthorizedViewTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + + RowMutation request = + RowMutation.create(AuthorizedViewId.of("fake-table", "fake-authorized-view"), "some-key") + .setCell("some-family", "fake-qualifier", "fake-value"); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.mutateRowAsync(request); + + Mockito.verify(mockMutateRowCallable).futureCall(request); + } + + @Test + public void mutateRowTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + Mockito.when(mockMutateRowCallable.futureCall(ArgumentMatchers.any(RowMutation.class))) + .thenAnswer( + (Answer>) + invocationOnMock -> ApiFutures.immediateFuture(Empty.getDefaultInstance())); + + RowMutation request = + RowMutation.create(TableId.of("fake-table"), "some-key") + .setCell("some-family", "fake-qualifier", "fake-value"); + + bigtableDataClient.mutateRow(request); + Mockito.verify(mockMutateRowCallable).futureCall(request); + } + + @Test + public void mutateRowOnAuthorizedViewTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + Mockito.when(mockMutateRowCallable.futureCall(ArgumentMatchers.any(RowMutation.class))) + .thenAnswer( + (Answer>) + invocationOnMock -> ApiFutures.immediateFuture(Empty.getDefaultInstance())); + + RowMutation request = + RowMutation.create(AuthorizedViewId.of("fake-table", "fake-authorized-view"), "some-key") + .setCell("some-family", "fake-qualifier", "fake-value"); + + bigtableDataClient.mutateRow(request); + Mockito.verify(mockMutateRowCallable).futureCall(request); + } + + @Test + public void proxyBulkMutatesRowTest() { + Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); + + BulkMutation request = + BulkMutation.create(TableId.of("fake-table")) + .add( + "fake-key", + Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.bulkMutateRowsAsync(request); + + Mockito.verify(mockBulkMutateRowsCallable).futureCall(request); + } + + @Test + public void proxyBulkMutatesRowOnAuthorizedViewTest() { + Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); + + BulkMutation request = + BulkMutation.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .add( + "fake-key", + Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.bulkMutateRowsAsync(request); + + Mockito.verify(mockBulkMutateRowsCallable).futureCall(request); + } + + @Test + public void bulkMutatesRowTest() { + Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); + + Mockito.when(mockBulkMutateRowsCallable.futureCall(ArgumentMatchers.any(BulkMutation.class))) + .thenAnswer( + (Answer>) + invocationOnMock -> ApiFutures.immediateFuture(Empty.getDefaultInstance())); + + BulkMutation request = + BulkMutation.create(TableId.of("fake-table")) + .add( + "fake-key", + Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + bigtableDataClient.bulkMutateRows(request); + Mockito.verify(mockBulkMutateRowsCallable).futureCall(request); + } + + @Test + public void bulkMutatesRowOnAuthorizedViewTest() { + Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); + + Mockito.when(mockBulkMutateRowsCallable.futureCall(ArgumentMatchers.any(BulkMutation.class))) + .thenAnswer( + (Answer>) + invocationOnMock -> ApiFutures.immediateFuture(Empty.getDefaultInstance())); + + BulkMutation request = + BulkMutation.create(AuthorizedViewId.of("fake-table", "fake-authorized-view")) + .add( + "fake-key", + Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + bigtableDataClient.bulkMutateRows(request); + Mockito.verify(mockBulkMutateRowsCallable).futureCall(request); + } + + @Test + public void proxyNewBulkMutationBatcherTest() { + Mockito.when(mockStub.newMutateRowsBatcher(Mockito.any(TableId.class), Mockito.any())) + .thenReturn(mockBulkMutationBatcher); + + ApiFuture expectedResponse = ApiFutures.immediateFuture(null); + Batcher batcher = + bigtableDataClient.newBulkMutationBatcher(TableId.of("fake-table")); + RowMutationEntry request = + RowMutationEntry.create("some-key").setCell("some-family", "fake-qualifier", "fake-value"); + Mockito.when(mockBulkMutationBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualRes = batcher.add(request); + assertThat(actualRes).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newMutateRowsBatcher(Mockito.any(TableId.class), Mockito.any()); + } + + @Test + public void proxyNewBulkMutationBatcherOnAuthorizedViewTest() { + Mockito.when(mockStub.newMutateRowsBatcher(Mockito.any(TargetId.class), Mockito.any())) + .thenReturn(mockBulkMutationBatcher); + + ApiFuture expectedResponse = ApiFutures.immediateFuture(null); + Batcher batcher = + bigtableDataClient.newBulkMutationBatcher( + AuthorizedViewId.of("fake-table", "fake-authorized-view")); + RowMutationEntry request = + RowMutationEntry.create("some-key").setCell("some-family", "fake-qualifier", "fake-value"); + Mockito.when(mockBulkMutationBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualRes = batcher.add(request); + assertThat(actualRes).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newMutateRowsBatcher(Mockito.any(TargetId.class), Mockito.any()); + } + + @Test + public void proxyNewBulkReadRowsTest() { + Mockito.when(mockStub.newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any())) + .thenReturn(mockBulkReadRowsBatcher); + + ApiFuture expectedResponse = + ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); + ByteString request = ByteString.copyFromUtf8("fake-row-key"); + + Batcher batcher = + bigtableDataClient.newBulkReadRowsBatcher(TableId.of("fake-table")); + Mockito.when(mockBulkReadRowsBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualResponse = batcher.add(request); + assertThat(actualResponse).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any()); + } + + @Test + public void proxyNewBulkReadRowsOnAuthorizedViewTest() { + Mockito.when(mockStub.newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any())) + .thenReturn(mockBulkReadRowsBatcher); + + ApiFuture expectedResponse = + ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); + ByteString request = ByteString.copyFromUtf8("fake-row-key"); + + Batcher batcher = + bigtableDataClient.newBulkReadRowsBatcher( + AuthorizedViewId.of("fake-table", "fake-authorized-view")); + Mockito.when(mockBulkReadRowsBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualResponse = batcher.add(request); + assertThat(actualResponse).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any()); + } + + @Test + public void proxyNewBulkReadRowsWithFilterTest() { + Mockito.when(mockStub.newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any())) + .thenReturn(mockBulkReadRowsBatcher); + + ApiFuture expectedResponse = + ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); + ByteString request = ByteString.copyFromUtf8("fake-row-key"); + + Batcher batcher = + bigtableDataClient.newBulkReadRowsBatcher( + TableId.of("fake-table"), FILTERS.key().regex("fake-row")); + Mockito.when(mockBulkReadRowsBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualResponse = batcher.add(request); + assertThat(actualResponse).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any()); + } + + @Test + public void proxyNewBulkReadRowsOnAuthorizedViewWithFilterTest() { + Mockito.when(mockStub.newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any())) + .thenReturn(mockBulkReadRowsBatcher); + + ApiFuture expectedResponse = + ApiFutures.immediateFuture( + Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); + ByteString request = ByteString.copyFromUtf8("fake-row-key"); + + Batcher batcher = + bigtableDataClient.newBulkReadRowsBatcher( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), + FILTERS.key().regex("fake-row")); + Mockito.when(mockBulkReadRowsBatcher.add(request)).thenReturn(expectedResponse); + + ApiFuture actualResponse = batcher.add(request); + assertThat(actualResponse).isSameInstanceAs(expectedResponse); + + Mockito.verify(mockStub).newBulkReadRowsBatcher(Mockito.any(Query.class), Mockito.any()); + } + + @Test + public void proxyCheckAndMutateRowCallableTest() { + assertThat(bigtableDataClient.checkAndMutateRowCallable()) + .isSameInstanceAs(mockStub.checkAndMutateRowCallable()); + } + + @Test + public void proxyCheckAndMutateRowTest() { + Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); + + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TableId.of("fake-table"), "fake-key") + .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.checkAndMutateRowAsync(mutation); + + Mockito.verify(mockCheckAndMutateRowCallable).futureCall(mutation); + } + + @Test + public void proxyCheckAndMutateRowOnAuthorizedViewTest() { + Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); + + ConditionalRowMutation mutation = + ConditionalRowMutation.create( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-key") + .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.checkAndMutateRowAsync(mutation); + + Mockito.verify(mockCheckAndMutateRowCallable).futureCall(mutation); + } + + @Test + public void checkAndMutateRowTest() { + Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); + + Mockito.when( + mockCheckAndMutateRowCallable.futureCall( + ArgumentMatchers.any(ConditionalRowMutation.class))) + .thenReturn(ApiFutures.immediateFuture(Boolean.TRUE)); + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TableId.of("fake-table"), "fake-key") + .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + bigtableDataClient.checkAndMutateRow(mutation); + + Mockito.verify(mockCheckAndMutateRowCallable).futureCall(mutation); + } + + @Test + public void checkAndMutateRowOnAuthorizedViewTest() { + Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); + + Mockito.when( + mockCheckAndMutateRowCallable.futureCall( + ArgumentMatchers.any(ConditionalRowMutation.class))) + .thenReturn(ApiFutures.immediateFuture(Boolean.TRUE)); + ConditionalRowMutation mutation = + ConditionalRowMutation.create( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "fake-key") + .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + + bigtableDataClient.checkAndMutateRow(mutation); + + Mockito.verify(mockCheckAndMutateRowCallable).futureCall(mutation); + } + + @Test + public void proxyReadModifyWriteRowTest() { + Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); + + ReadModifyWriteRow request = + ReadModifyWriteRow.create(TableId.of("fake-table"), "some-key") + .append("fake-family", "fake-qualifier", "suffix"); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.readModifyWriteRowAsync(request); + + Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); + } + + @Test + public void proxyReadModifyWriteRowOnAuthorizedViewTest() { + Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); + + ReadModifyWriteRow request = + ReadModifyWriteRow.create( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "some-key") + .append("fake-family", "fake-qualifier", "suffix"); + + @SuppressWarnings("VariableUnused") + ApiFuture ignored = bigtableDataClient.readModifyWriteRowAsync(request); + + Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); + } + + @Test + public void readModifyWriteRowTest() { + Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); + + Mockito.when( + mockReadModifyWriteRowCallable.futureCall( + ArgumentMatchers.any(ReadModifyWriteRow.class))) + .thenReturn( + ApiFutures.immediateFuture( + Row.create( + ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); + ReadModifyWriteRow request = + ReadModifyWriteRow.create(TableId.of("fake-table"), "some-key") + .append("fake-family", "fake-qualifier", "suffix"); + bigtableDataClient.readModifyWriteRow(request); + Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); + } + + @Test + public void readModifyWriteRowOnAuthorizedViewTest() { + Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); + + Mockito.when( + mockReadModifyWriteRowCallable.futureCall( + ArgumentMatchers.any(ReadModifyWriteRow.class))) + .thenReturn( + ApiFutures.immediateFuture( + Row.create( + ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); + ReadModifyWriteRow request = + ReadModifyWriteRow.create( + AuthorizedViewId.of("fake-table", "fake-authorized-view"), "some-key") + .append("fake-family", "fake-qualifier", "suffix"); + bigtableDataClient.readModifyWriteRow(request); + Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); + } + + @Test + public void proxyReadModifyWriterRowCallableTest() { + Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); + + assertThat(bigtableDataClient.readModifyWriteRowCallable()) + .isSameInstanceAs(mockReadModifyWriteRowCallable); + } + + @Test + public void prepareQueryTest() { + Mockito.when(mockStub.prepareQueryCallable()).thenReturn(mockPrepareQueryCallable); + + String query = "SELECT * FROM table"; + Map> paramTypes = new HashMap<>(); + bigtableDataClient.prepareStatement(query, paramTypes); + Mockito.verify(mockPrepareQueryCallable).call(PrepareQueryRequest.create(query, paramTypes)); + } + + @Test + public void executeQueryMustUseSameClientAsPrepare() { + Mockito.when(mockStub.prepareQueryCallable()).thenReturn(mockPrepareQueryCallable); + + String query = "SELECT * FROM table"; + Map> paramTypes = new HashMap<>(); + bigtableDataClient.prepareStatement(query, paramTypes); + Mockito.verify(mockPrepareQueryCallable).call(PrepareQueryRequest.create(query, paramTypes)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java new file mode 100644 index 000000000000..cb5ca95c5c91 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java @@ -0,0 +1,47 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableDataSettingsTest { + + @Test + public void testToString() { + // TODO: figure out how avoid using setRefreshingChannel + @SuppressWarnings("deprecation") + BigtableDataSettings settings = + BigtableDataSettings.newBuilder() + .setProjectId("our-project-2-12") + .setInstanceId("our-instance-85") + .setAppProfileId("our-appProfile-06") + .enableBatchMutationLatencyBasedThrottling(10) + // disable channel priming so we won't need authentication + // for sending the prime request since we're only testing the settings. + .setRefreshingChannel(false) + .setBulkMutationFlowControl(true) + .build(); + EnhancedBigtableStubSettings stubSettings = settings.getStubSettings(); + assertThat(settings.toString()) + .isEqualTo("BigtableDataSettings{stubSettings=" + stubSettings.toString() + "}"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.java new file mode 100644 index 000000000000..c2b4edf763b4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.java @@ -0,0 +1,92 @@ +/* + * 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.google.cloud.bigtable.data.v2; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.ServerInterceptor; +import io.grpc.ServerTransportFilter; +import java.io.IOException; +import java.net.BindException; +import java.net.ServerSocket; +import java.util.ArrayList; +import java.util.List; + +public class FakeServiceBuilder { + private final List interceptors = new ArrayList<>(); + private final List services = new ArrayList<>(); + private final List transportFilters = new ArrayList<>(); + + public static FakeServiceBuilder create(BindableService... services) { + return new FakeServiceBuilder(services); + } + + private FakeServiceBuilder(BindableService[] services) { + for (BindableService service : services) { + this.addService(service); + } + } + + public FakeServiceBuilder intercept(ServerInterceptor interceptor) { + interceptors.add(interceptor); + return this; + } + + public FakeServiceBuilder addService(BindableService service) { + services.add(service); + return this; + } + + public FakeServiceBuilder addTransportFilter(ServerTransportFilter transportFilter) { + transportFilters.add(transportFilter); + return this; + } + + public Server start() throws IOException { + IOException lastError = null; + + for (int i = 0; i < 10; i++) { + try { + return startWithoutRetries(); + } catch (IOException e) { + lastError = e; + if (e.getCause() instanceof BindException) { + continue; + } + if (e.getMessage().contains("Failed to bind to address")) { + continue; + } + break; + } + } + + throw lastError; + } + + private Server startWithoutRetries() throws IOException { + int port; + try (ServerSocket ss = new ServerSocket(0)) { + port = ss.getLocalPort(); + } + ServerBuilder builder = ServerBuilder.forPort(port); + interceptors.forEach(builder::intercept); + services.forEach(builder::addService); + transportFilters.forEach(builder::addTransportFilter); + + return builder.build().start(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/JwtCredentialsWithAudienceTests.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/JwtCredentialsWithAudienceTests.java new file mode 100644 index 000000000000..780f40db77e2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/JwtCredentialsWithAudienceTests.java @@ -0,0 +1,76 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.auth.oauth2.OAuth2Utils; +import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; +import com.google.cloud.bigtable.data.v2.internal.JwtCredentialsWithAudience; +import java.io.IOException; +import java.net.URI; +import java.security.PrivateKey; +import org.junit.Test; + +public class JwtCredentialsWithAudienceTests { + + private static final String SA_CLIENT_EMAIL = + "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr@developer.gserviceaccount.com"; + private static final String SA_CLIENT_ID = + "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; + private static final String SA_PRIVATE_KEY_ID = "d84a4fefcf50791d4a90f2d7af17469d6282df9d"; + private static final String SA_PRIVATE_KEY_PKCS8 = + "-----BEGIN PRIVATE KEY-----\n" + + "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12ikv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0zkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/GrCtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6D2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrPSXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAutLPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEAgidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ==\n" + + "-----END PRIVATE KEY-----\n"; + private static final String QUOTA_PROJECT = "sample-quota-project-id"; + + @Test + public void getUniverseDomain_default() throws IOException { + PrivateKey privateKey = OAuth2Utils.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8); + ServiceAccountJwtAccessCredentials serviceAccountJwtAccessCredentials = + ServiceAccountJwtAccessCredentials.newBuilder() + .setClientId(SA_CLIENT_ID) + .setClientEmail(SA_CLIENT_EMAIL) + .setPrivateKey(privateKey) + .setPrivateKeyId(SA_PRIVATE_KEY_ID) + .setQuotaProjectId(QUOTA_PROJECT) + .build(); + JwtCredentialsWithAudience jwtWithAudience = + new JwtCredentialsWithAudience( + serviceAccountJwtAccessCredentials, URI.create("default-aud")); + assertThat(jwtWithAudience.getUniverseDomain()).isEqualTo("googleapis.com"); + } + + @Test + public void getUniverseDomain_custom() throws IOException { + PrivateKey privateKey = OAuth2Utils.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8); + ServiceAccountJwtAccessCredentials serviceAccountJwtAccessCredentials = + ServiceAccountJwtAccessCredentials.newBuilder() + .setClientId(SA_CLIENT_ID) + .setClientEmail(SA_CLIENT_EMAIL) + .setPrivateKey(privateKey) + .setPrivateKeyId(SA_PRIVATE_KEY_ID) + .setQuotaProjectId(QUOTA_PROJECT) + .setUniverseDomain("example.com") + .build(); + JwtCredentialsWithAudience jwtWithAudience = + new JwtCredentialsWithAudience( + serviceAccountJwtAccessCredentials, URI.create("default-aud")); + assertThat(jwtWithAudience.getUniverseDomain()).isEqualTo("example.com"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MetadataSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MetadataSubject.java new file mode 100644 index 000000000000..5e76ce38cd30 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MetadataSubject.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import io.grpc.Metadata; +import javax.annotation.Nullable; + +/** Utility class to test key-value pairs in {@link io.grpc.Metadata}. */ +public final class MetadataSubject extends Subject { + + @Nullable private final Metadata actual; + + public static Factory metadata() { + return MetadataSubject::new; + } + + private MetadataSubject(FailureMetadata metadata, @Nullable Metadata actual) { + super(metadata, actual); + this.actual = actual; + } + + public static MetadataSubject assertThat(@Nullable Metadata actual) { + return assertAbout(metadata()).that(actual); + } + + public void containsAtLeast(String... keyValuePairs) { + assert actual != null; + for (int i = 0; i < keyValuePairs.length; i += 2) { + check("containsAtLeast()") + .that(actual.get(Metadata.Key.of(keyValuePairs[i], Metadata.ASCII_STRING_MARSHALLER))) + .isEqualTo(keyValuePairs[i + 1]); + } + } + + public void doesNotContainKeys(String... keys) { + assert actual != null; + for (String key : keys) { + check("doesNotContainKeys()") + .that(actual.containsKey(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER))) + .isFalse(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java new file mode 100644 index 000000000000..15f3792b812c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.functional; + +import com.google.api.gax.rpc.InternalException; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +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.TableId; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import io.grpc.Server; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadRowsTest { + private FakeService service; + private Server server; + + @Before + public void setUp() throws Exception { + service = new FakeService(); + server = FakeServiceBuilder.create(service).start(); + } + + @After + public void tearDown() throws Exception { + server.shutdown(); + } + + @Test + public void rowMergingErrorsUseInternalStatus() throws Exception { + BigtableDataSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build(); + + service.readRowsResponses.add( + ReadRowsResponse.newBuilder() + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("z")) + .setFamilyName(StringValue.newBuilder().setValue("f")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q")).build()) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("v")) + .setCommitRow(true)) + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("a")) + .setFamilyName(StringValue.newBuilder().setValue("f")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q")).build()) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("v")) + .setCommitRow(true)) + .build()); + + try (BigtableDataClient client = BigtableDataClient.create(settings)) { + Assert.assertThrows( + InternalException.class, + () -> { + for (Row ignored : client.readRows(Query.create(TableId.of("fake-table")))) {} + }); + } + } + + static class FakeService extends BigtableGrpc.BigtableImplBase { + private final List readRowsResponses = + Collections.synchronizedList(new ArrayList<>()); + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + for (ReadRowsResponse r : readRowsResponses) { + responseObserver.onNext(r); + } + responseObserver.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java new file mode 100644 index 000000000000..127a70478416 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java @@ -0,0 +1,1040 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.enumType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.floatValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.nullValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.protoType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structField; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ColumnMetadata; +import com.google.bigtable.v2.Type; +import com.google.bigtable.v2.Type.KindCase; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.bigtable.common.Type.SchemalessEnum; +import com.google.cloud.bigtable.common.Type.SchemalessProto; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Album; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.protobuf.ByteString; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.experimental.runners.Enclosed; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; + +@SuppressWarnings("DoubleBraceInitialization") +@RunWith(Enclosed.class) +public class AbstractProtoStructReaderTest { + + // Timestamp can be in micros up to max long + private static final long MAX_TS_SECONDS = Long.MAX_VALUE / 1000 / 1000; + + @AutoValue + public abstract static class TestProtoStruct extends AbstractProtoStructReader { + public static TestProtoStruct create(ResultSetMetadata metadata, List values) { + return new AutoValue_AbstractProtoStructReaderTest_TestProtoStruct(values, metadata); + } + + abstract ResultSetMetadata metadata(); + + @Override + public int getColumnIndex(String columnName) { + return metadata().getColumnIndex(columnName); + } + + @Override + public SqlType getColumnType(int columnIndex) { + return metadata().getColumnType(columnIndex); + } + } + + // New tests should always be added to types test + // Specific tests we don't want to re-run for each type go here + @RunWith(JUnit4.class) + public static class OneOffTests { + @Test + public void simpleMapField_validatesType() { + TestProtoStruct structWithMap = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("testField", mapType(bytesType(), stringType())))), + Collections.singletonList( + mapValue( + mapElement(bytesValue("foo"), stringValue("bar")), + mapElement(bytesValue("key"), stringValue("val"))))); + HashMap expectedMap = new HashMap<>(); + expectedMap.put(ByteString.copyFromUtf8("foo"), "bar"); + expectedMap.put(ByteString.copyFromUtf8("key"), "val"); + + assertThat( + structWithMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.string()))) + .isEqualTo(expectedMap); + assertThat(structWithMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.string()))) + .isEqualTo(expectedMap); + + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + } + + @Test + public void nestedMapField_validatesType() { + TestProtoStruct historicalMap = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata( + columnMetadata( + "testField", + mapType( + bytesType(), + arrayType( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))))))), + Collections.singletonList( + mapValue( + mapElement( + bytesValue("qual"), + arrayValue( + structValue(timestampValue(10000, 100), bytesValue("test1")), + structValue(timestampValue(20000, 100), bytesValue("test2"))))))); + + HashMap> expectedMap = new HashMap<>(); + expectedMap.put( + ByteString.copyFromUtf8("qual"), + Arrays.asList( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))), + arrayValue(timestampValue(10000, 100), bytesValue("test1")).getArrayValue()), + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))), + arrayValue(timestampValue(20000, 100), bytesValue("test2")).getArrayValue()))); + + assertThat(historicalMap.getMap("testField", SqlType.historicalMap())).isEqualTo(expectedMap); + assertThat(historicalMap.getMap(0, SqlType.historicalMap())).isEqualTo(expectedMap); + + assertThrows( + IllegalStateException.class, + () -> historicalMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> + historicalMap.getMap( + "testField", SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.string())))); + assertThrows( + IllegalStateException.class, + () -> historicalMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> + historicalMap.getMap( + 0, SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.string())))); + } + + @Test + public void arrayField_validatesType() { + TestProtoStruct structWithList = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("testField", arrayType(stringType())))), + Collections.singletonList(arrayValue(stringValue("foo"), stringValue("bar")))); + List expectedList = Arrays.asList("foo", "bar"); + + assertThat(structWithList.getList("testField", SqlType.arrayOf(SqlType.string()))) + .isEqualTo(expectedList); + assertThat(structWithList.getList(0, SqlType.arrayOf(SqlType.string()))) + .isEqualTo(expectedList); + + assertThrows( + IllegalStateException.class, + () -> structWithList.getList("testField", SqlType.arrayOf(SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithList.getList(0, SqlType.arrayOf(SqlType.bytes()))); + } + + // Test this independently since it won't throw an exception until accessing an element if + // float is converted to double incorrectly + @Test + public void arrayField_accessingFloat() { + TestProtoStruct structWithList = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("testField", arrayType(float32Type())))), + Collections.singletonList(arrayValue(floatValue(1.1f), floatValue(1.2f)))); + + List floatList = + structWithList.getList("testField", SqlType.arrayOf(SqlType.float32())); + assertThat(floatList.get(0)).isEqualTo(1.1f); + assertThat(floatList.get(1)).isEqualTo(1.2f); + } + + // Test this independently since it verifies that parsing fails when data is deserialized into + // an incompatible Protobuf message, which is highly proto-specific. + @Test + public void mapField_accessingProto() { + Singer singer = Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build(); + TestProtoStruct structWithMap = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata( + columnMetadata( + "testField", + mapType( + bytesType(), + protoType( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle"))))), + Collections.singletonList( + mapValue(mapElement(bytesValue("key"), bytesValue(singer.toByteArray()))))); + HashMap expectedMap = new HashMap<>(); + expectedMap.put(ByteString.copyFromUtf8("key"), singer); + + assertThat( + structWithMap.getMap( + "testField", + SqlType.mapOf(SqlType.bytes(), SqlType.protoOf(Singer.getDefaultInstance())))) + .isEqualTo(expectedMap); + assertThat( + structWithMap.getMap( + 0, SqlType.mapOf(SqlType.bytes(), SqlType.protoOf(Singer.getDefaultInstance())))) + .isEqualTo(expectedMap); + + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + "testField", + SqlType.mapOf( + SqlType.bytes(), + SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")))); + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + 0, + SqlType.mapOf( + SqlType.bytes(), + SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")))); + assertThrows( + IllegalStateException.class, + () -> + structWithMap.getMap( + "testField", + SqlType.mapOf(SqlType.bytes(), SqlType.protoOf(Album.getDefaultInstance())))); + assertThrows( + IllegalStateException.class, + () -> + structWithMap.getMap( + 0, SqlType.mapOf(SqlType.bytes(), SqlType.protoOf(Album.getDefaultInstance())))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + } + + // Test this independently since it performs enum-specific verifications. + @Test + public void mapField_accessingEnum() { + TestProtoStruct structWithMap = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata( + columnMetadata( + "testField", + mapType( + bytesType(), + enumType( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle"))))), + Collections.singletonList(mapValue(mapElement(bytesValue("key"), int64Value(0))))); + HashMap expectedMap = new HashMap<>(); + expectedMap.put(ByteString.copyFromUtf8("key"), Genre.POP); + + assertThat( + structWithMap.getMap( + "testField", SqlType.mapOf(SqlType.bytes(), SqlType.enumOf(Genre::forNumber)))) + .isEqualTo(expectedMap); + assertThat( + structWithMap.getMap( + 0, SqlType.mapOf(SqlType.bytes(), SqlType.enumOf(Genre::forNumber)))) + .isEqualTo(expectedMap); + + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + "testField", + SqlType.mapOf( + SqlType.bytes(), + SchemalessEnum.create( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))); + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + 0, + SqlType.mapOf( + SqlType.bytes(), + SchemalessEnum.create( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))); + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + "testField", + SqlType.mapOf( + SqlType.bytes(), + SchemalessEnum.create( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))); + assertThrows( + UnsupportedOperationException.class, + () -> + structWithMap.getMap( + 0, + SqlType.mapOf( + SqlType.bytes(), + SchemalessEnum.create( + "com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap("testField", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + assertThrows( + IllegalStateException.class, + () -> structWithMap.getMap(0, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))); + } + } + + @RunWith(Parameterized.class) + public static class TypesTest { + @Parameterized.Parameters() + public static List parameters() { + return Arrays.asList( + new Object[][] { + // Bytes + { + Collections.singletonList(columnMetadata("testField", bytesType())), + Collections.singletonList(bytesValue("test")), + 0, + "testField", + (BiFunction) TestProtoStruct::getBytes, + (BiFunction) TestProtoStruct::getBytes, + ByteString.copyFromUtf8("test") + }, + // String + { + Collections.singletonList(columnMetadata("testField", stringType())), + Collections.singletonList(stringValue("test")), + 0, + "testField", + (BiFunction) TestProtoStruct::getString, + (BiFunction) TestProtoStruct::getString, + "test" + }, + // Long + { + Collections.singletonList(columnMetadata("testField", int64Type())), + Collections.singletonList(int64Value(110L)), + 0, + "testField", + (BiFunction) TestProtoStruct::getLong, + (BiFunction) TestProtoStruct::getLong, + 110L + }, + // Double + { + Collections.singletonList(columnMetadata("testField", float64Type())), + Collections.singletonList(floatValue(100.3d)), + 0, + "testField", + (BiFunction) TestProtoStruct::getDouble, + (BiFunction) TestProtoStruct::getDouble, + 100.3d + }, + // Float + { + Collections.singletonList(columnMetadata("testField", float32Type())), + Collections.singletonList(floatValue(100.3f)), + 0, + "testField", + (BiFunction) TestProtoStruct::getFloat, + (BiFunction) TestProtoStruct::getFloat, + 100.3f + }, + // Boolean + { + Collections.singletonList(columnMetadata("testField", boolType())), + Collections.singletonList(boolValue(true)), + 0, + "testField", + (BiFunction) TestProtoStruct::getBoolean, + (BiFunction) TestProtoStruct::getBoolean, + true + }, + // Timestamp + { + Collections.singletonList(columnMetadata("testField", timestampType())), + Collections.singletonList(timestampValue(1000000, 100)), + 0, + "testField", + (BiFunction) TestProtoStruct::getTimestamp, + (BiFunction) TestProtoStruct::getTimestamp, + Instant.ofEpochSecond(1000000, 100) + }, + // MAX long timestamp - bigtable allows users to set timestamp micros to any long + // so the client should parse them. In practice the server doesn't currently, + // support timestamps this large. + { + Collections.singletonList(columnMetadata("testField", timestampType())), + Collections.singletonList(timestampValue(MAX_TS_SECONDS, 0)), + 0, + "testField", + (BiFunction) TestProtoStruct::getTimestamp, + (BiFunction) TestProtoStruct::getTimestamp, + Instant.ofEpochSecond(MAX_TS_SECONDS) + }, + // Date + { + Collections.singletonList(columnMetadata("testField", dateType())), + Collections.singletonList(dateValue(2024, 6, 1)), + 0, + "testField", + (BiFunction) TestProtoStruct::getDate, + (BiFunction) TestProtoStruct::getDate, + Date.fromYearMonthDay(2024, 6, 1) + }, + // Struct + { + Collections.singletonList( + columnMetadata( + "testField", + structType( + structField("stringField", stringType()), + structField("intField", int64Type()), + structField("listField", arrayType(stringType())), + structField("protoField", protoType("MyMessage", "my_bundle")), + structField("enumField", enumType("MyEnum", "other_bundle"))))), + Collections.singletonList( + arrayValue( + stringValue("test"), + int64Value(100), + arrayValue(stringValue("nested"), stringValue("nested2")), + bytesValue("proto"), + int64Value(1))), + 0, + "testField", + (BiFunction) TestProtoStruct::getStruct, + (BiFunction) TestProtoStruct::getStruct, + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("stringField", stringType()), + structField("intField", int64Type()), + structField("listField", arrayType(stringType())), + structField("protoField", protoType("MyMessage", "my_bundle")), + structField("enumField", enumType("MyEnum", "other_bundle")))), + arrayValue( + stringValue("test"), + int64Value(100), + arrayValue(stringValue("nested"), stringValue("nested2")), + bytesValue("proto"), + int64Value(1)) + .getArrayValue()) + }, + // Simple List + { + Collections.singletonList(columnMetadata("testField", arrayType(stringType()))), + Collections.singletonList( + arrayValue(stringValue("foo"), stringValue("bar"), stringValue("baz"))), + 0, + "testField", + (BiFunction>) + (row, field) -> row.getList(field, SqlType.arrayOf(SqlType.string())), + (BiFunction>) + (row, index) -> row.getList(index, SqlType.arrayOf(SqlType.string())), + Arrays.asList("foo", "bar", "baz") + }, + // List With Null Values + { + Collections.singletonList(columnMetadata("testField", arrayType(stringType()))), + Collections.singletonList( + arrayValue(stringValue("foo"), nullValue(), stringValue("baz"))), + 0, + "testField", + (BiFunction>) + (row, field) -> row.getList(field, SqlType.arrayOf(SqlType.string())), + (BiFunction>) + (row, index) -> row.getList(index, SqlType.arrayOf(SqlType.string())), + Arrays.asList("foo", null, "baz") + }, + // Float List + { + Collections.singletonList(columnMetadata("testField", arrayType(float32Type()))), + Collections.singletonList( + arrayValue(floatValue(1.1f), floatValue(1.2f), floatValue(1.3f))), + 0, + "testField", + (BiFunction>) + (row, field) -> row.getList(field, SqlType.arrayOf(SqlType.float32())), + (BiFunction>) + (row, index) -> row.getList(index, SqlType.arrayOf(SqlType.float32())), + Arrays.asList(1.1f, 1.2f, 1.3f) + }, + // Double List + { + Collections.singletonList(columnMetadata("testField", arrayType(float64Type()))), + Collections.singletonList( + arrayValue(floatValue(1.11d), floatValue(1.22d), floatValue(1.33d))), + 0, + "testField", + (BiFunction>) + (row, field) -> row.getList(field, SqlType.arrayOf(SqlType.float64())), + (BiFunction>) + (row, index) -> row.getList(index, SqlType.arrayOf(SqlType.float64())), + Arrays.asList(1.11d, 1.22d, 1.33d) + }, + // Simple Map + { + Collections.singletonList( + columnMetadata("testField", mapType(bytesType(), stringType()))), + Collections.singletonList( + mapValue( + mapElement(bytesValue("foo"), stringValue("bar")), + mapElement(bytesValue("key"), stringValue("val")))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getMap(field, SqlType.mapOf(SqlType.bytes(), SqlType.string())), + (BiFunction>) + (row, index) -> + row.getMap(index, SqlType.mapOf(SqlType.bytes(), SqlType.string())), + new HashMap() { + { + put(ByteString.copyFromUtf8("foo"), "bar"); + put(ByteString.copyFromUtf8("key"), "val"); + } + } + }, + // Map With Null Keys and Values + { + Collections.singletonList( + columnMetadata("testField", mapType(bytesType(), stringType()))), + Collections.singletonList( + mapValue( + mapElement(bytesValue("foo"), nullValue()), + mapElement(nullValue(), stringValue("val")))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getMap(field, SqlType.mapOf(SqlType.bytes(), SqlType.string())), + (BiFunction>) + (row, index) -> + row.getMap(index, SqlType.mapOf(SqlType.bytes(), SqlType.string())), + new HashMap() { + { + put(ByteString.copyFromUtf8("foo"), null); + put(null, "val"); + } + } + }, + // Map With List Values + { + Collections.singletonList( + columnMetadata("testField", mapType(bytesType(), arrayType(stringType())))), + Collections.singletonList( + mapValue( + mapElement( + bytesValue("key1"), arrayValue(stringValue("1.1"), stringValue("1.2"))), + mapElement(bytesValue("key2"), arrayValue(stringValue("2.1"))))), + 0, + "testField", + (BiFunction>>) + (row, field) -> + row.getMap( + field, SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.string()))), + (BiFunction>>) + (row, index) -> + row.getMap( + index, SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.string()))), + new HashMap>() { + { + put(ByteString.copyFromUtf8("key1"), Arrays.asList("1.1", "1.2")); + put(ByteString.copyFromUtf8("key2"), Collections.singletonList("2.1")); + } + } + }, + { + Collections.singletonList( + columnMetadata( + "historicalField", + mapType( + bytesType(), + arrayType( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType())))))), + Collections.singletonList( + mapValue( + mapElement( + bytesValue("qual"), + arrayValue( + structValue(timestampValue(10000, 100), bytesValue("test1")), + structValue(timestampValue(20000, 100), bytesValue("test2")))))), + 0, + "historicalField", + (BiFunction>>) + (row, field) -> row.getMap(field, SqlType.historicalMap()), + (BiFunction>>) + (row, index) -> row.getMap(index, SqlType.historicalMap()), + new HashMap>() { + { + put( + ByteString.copyFromUtf8("qual"), + Arrays.asList( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))), + arrayValue(timestampValue(10000, 100), bytesValue("test1")) + .getArrayValue()), + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))), + arrayValue(timestampValue(20000, 100), bytesValue("test2")) + .getArrayValue()))); + } + }, + }, + // Proto + { + Collections.singletonList( + columnMetadata( + "testField", + protoType("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle"))), + Collections.singletonList( + bytesValue( + Singer.newBuilder() + .setName("Foo") + .setGenre(Genre.POP) + .build() + .toByteArray())), + 0, + "testField", + (BiFunction) + (row, field) -> row.getProtoMessage(field, Singer.getDefaultInstance()), + (BiFunction) + (row, index) -> row.getProtoMessage(index, Singer.getDefaultInstance()), + Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build() + }, + // Proto List + { + Collections.singletonList( + columnMetadata( + "testField", + arrayType( + protoType( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")))), + Collections.singletonList( + arrayValue( + bytesValue( + Singer.newBuilder() + .setName("Foo") + .setGenre(Genre.POP) + .build() + .toByteArray()), + bytesValue( + Singer.newBuilder() + .setName("Bar") + .setGenre(Genre.JAZZ) + .build() + .toByteArray()))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getList( + field, SqlType.arrayOf(SqlType.protoOf(Singer.getDefaultInstance()))), + (BiFunction>) + (row, index) -> + row.getList( + index, SqlType.arrayOf(SqlType.protoOf(Singer.getDefaultInstance()))), + Arrays.asList( + Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build(), + Singer.newBuilder().setName("Bar").setGenre(Genre.JAZZ).build()) + }, + // Proto Map + { + Collections.singletonList( + columnMetadata( + "testField", + mapType( + bytesType(), + protoType( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")))), + Collections.singletonList( + mapValue( + mapElement( + bytesValue("foo"), + bytesValue( + Singer.newBuilder() + .setName("Foo") + .setGenre(Genre.POP) + .build() + .toByteArray())), + mapElement( + bytesValue("key"), + bytesValue( + Singer.newBuilder() + .setName("Bar") + .setGenre(Genre.JAZZ) + .build() + .toByteArray())))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getMap( + field, + SqlType.mapOf( + SqlType.bytes(), SqlType.protoOf(Singer.getDefaultInstance()))), + (BiFunction>) + (row, index) -> + row.getMap( + index, + SqlType.mapOf( + SqlType.bytes(), SqlType.protoOf(Singer.getDefaultInstance()))), + new HashMap() { + { + put( + ByteString.copyFromUtf8("foo"), + Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build()); + put( + ByteString.copyFromUtf8("key"), + Singer.newBuilder().setName("Bar").setGenre(Genre.JAZZ).build()); + } + } + }, + // Enum + { + Collections.singletonList( + columnMetadata( + "testField", + enumType("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle"))), + Collections.singletonList(int64Value(1)), + 0, + "testField", + (BiFunction) + (row, field) -> row.getProtoEnum(field, Genre::forNumber), + (BiFunction) + (row, index) -> row.getProtoEnum(index, Genre::forNumber), + Genre.JAZZ + }, + // Enum List + { + Collections.singletonList( + columnMetadata( + "testField", + arrayType( + enumType("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))), + Collections.singletonList(arrayValue(nullValue(), int64Value(2), int64Value(100))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getList(field, SqlType.arrayOf(SqlType.enumOf(Genre::forNumber))), + (BiFunction>) + (row, index) -> + row.getList(index, SqlType.arrayOf(SqlType.enumOf(Genre::forNumber))), + Arrays.asList(null, Genre.FOLK, null) + }, + // Enum Map + { + Collections.singletonList( + columnMetadata( + "testField", + mapType( + bytesType(), + enumType("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle")))), + Collections.singletonList( + mapValue( + mapElement(bytesValue("foo"), int64Value(1)), + mapElement(bytesValue("key"), int64Value(2)))), + 0, + "testField", + (BiFunction>) + (row, field) -> + row.getMap( + field, SqlType.mapOf(SqlType.bytes(), SqlType.enumOf(Genre::forNumber))), + (BiFunction>) + (row, index) -> + row.getMap( + index, SqlType.mapOf(SqlType.bytes(), SqlType.enumOf(Genre::forNumber))), + new HashMap() { + { + put(ByteString.copyFromUtf8("foo"), Genre.JAZZ); + put(ByteString.copyFromUtf8("key"), Genre.FOLK); + } + } + } + }); + } + + @Parameter(value = 0) + public List schema; + + @Parameter(value = 1) + public List values; + + @Parameter(value = 2) + public Integer index; + + @Parameter(value = 3) + public String columnName; + + @Parameter(value = 4) + public BiFunction getByColumn; + + @Parameter(value = 5) + public BiFunction getByIndex; + + @Parameter(value = 6) + public Object expectedJavaValue; + + private TestProtoStruct getTestRow() { + return TestProtoStruct.create( + ProtoResultSetMetadata.fromProto(metadata(schema.toArray(new ColumnMetadata[] {}))), + values); + } + + @Test + public void getByColumnName_convertsValues() { + assertThat(getByColumn.apply(getTestRow(), columnName)).isEqualTo(expectedJavaValue); + } + + @Test + public void getByIndex_convertsValues() { + assertThat(getByIndex.apply(getTestRow(), index)).isEqualTo(expectedJavaValue); + } + + @Test + public void getByColumnName_throwsExceptionOnNonExistentColumn() { + assertThrows( + IllegalArgumentException.class, () -> getByColumn.apply(getTestRow(), "invalid")); + } + + @Test + public void getByColumnIndex_throwsExceptionOnNonExistentColumn() { + // Assume none of the tests have 10k columns + assertThrows(IndexOutOfBoundsException.class, () -> getByIndex.apply(getTestRow(), 10000)); + } + + @Test + public void getByColumnIndex_throwsNullPointerOnNullValue() { + TestProtoStruct row = + TestProtoStruct.create( + getTestRow().metadata(), + schema.stream() + .map((ColumnMetadata t) -> SqlProtoFactory.nullValue()) + .collect(Collectors.toList())); + + assertThrows(NullPointerException.class, () -> getByIndex.apply(row, index)); + } + + @Test + public void getByColumnName_throwsNullPointerOnNullValue() { + TestProtoStruct row = + TestProtoStruct.create( + getTestRow().metadata(), + schema.stream() + .map((ColumnMetadata t) -> SqlProtoFactory.nullValue()) + .collect(Collectors.toList())); + + assertThrows(NullPointerException.class, () -> getByColumn.apply(row, columnName)); + } + + @Test + public void getByColumnIndex_throwsExceptionOnWrongType() { + // Replace the given column with a column of a different type + Type updatedType = stringType(); + Value updatedValue = stringValue("test"); + if (schema.get(index).getType().getKindCase().equals(KindCase.STRING_TYPE)) { + updatedType = int64Type(); + updatedValue = int64Value(1000); + } + List updatedSchema = new ArrayList<>(schema); + updatedSchema.set(index, columnMetadata(columnName, updatedType)); + List updatedValues = new ArrayList<>(values); + updatedValues.set(index, updatedValue); + TestProtoStruct row = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata(updatedSchema.toArray(new ColumnMetadata[] {}))), + updatedValues); + + assertThrows(IllegalStateException.class, () -> getByIndex.apply(row, index)); + } + + @Test + public void getByColumnName_throwsExceptionOnWrongType() { + // Replace the given column with a column of a different type + Type updatedType = stringType(); + Value updatedValue = stringValue("test"); + if (schema.get(index).getType().getKindCase().equals(KindCase.STRING_TYPE)) { + updatedType = int64Type(); + updatedValue = int64Value(1000); + } + List updatedSchema = new ArrayList<>(schema); + updatedSchema.set(index, columnMetadata(columnName, updatedType)); + List updatedValues = new ArrayList<>(values); + updatedValues.set(index, updatedValue); + TestProtoStruct row = + TestProtoStruct.create( + ProtoResultSetMetadata.fromProto( + metadata(updatedSchema.toArray(new ColumnMetadata[] {}))), + updatedValues); + + assertThrows(IllegalStateException.class, () -> getByColumn.apply(row, columnName)); + } + + @Test + public void isNull_worksForNullValues() { + TestProtoStruct row = + TestProtoStruct.create( + getTestRow().metadata(), + schema.stream() + .map((ColumnMetadata t) -> SqlProtoFactory.nullValue()) + .collect(Collectors.toList())); + + assertTrue(row.isNull(columnName)); + assertTrue(row.isNull(index)); + } + + @Test + public void isNull_worksForNonNullValues() { + assertFalse(getTestRow().isNull(columnName)); + assertFalse(getTestRow().isNull(index)); + } + + @Test + public void getColumnTypeByName() { + assertThat(SqlType.fromProto(schema.get(index).getType())) + .isEqualTo(getTestRow().getColumnType(columnName)); + } + + // consider moving it to non-parameterized test + @Test + public void getByColumnName_throwsExceptionForDuplicateColumnName() { + // Add all fields to the schema twice + List duplicatedSchema = new ArrayList<>(schema); + duplicatedSchema.addAll(schema); + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(duplicatedSchema.toArray(new ColumnMetadata[] {}))); + List duplicatedValues = new ArrayList<>(values); + duplicatedValues.addAll(values); + TestProtoStruct row = TestProtoStruct.create(metadata, duplicatedValues); + + assertThrows(IllegalArgumentException.class, () -> getByColumn.apply(row, columnName)); + } + + @Test + public void getByIndex_worksWithDuplicateColumnName() { + // Add all fields to the schema twice + List duplicatedSchema = new ArrayList<>(schema); + duplicatedSchema.addAll(schema); + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(duplicatedSchema.toArray(new ColumnMetadata[] {}))); + List duplicatedValues = new ArrayList<>(values); + duplicatedValues.addAll(values); + TestProtoStruct row = TestProtoStruct.create(metadata, duplicatedValues); + + assertThat(getByIndex.apply(row, index)).isEqualTo(expectedJavaValue); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparatorTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparatorTest.java new file mode 100644 index 000000000000..e7c673be68a8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ByteStringComparatorTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import com.google.common.truth.Truth; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ByteStringComparatorTest { + @Test + public void emptyTest() { + int result = ByteStringComparator.INSTANCE.compare(ByteString.EMPTY, ByteString.EMPTY); + + Truth.assertThat(result).isEqualTo(0); + } + + @Test + public void equalTest() { + int result = + ByteStringComparator.INSTANCE.compare( + ByteString.copyFromUtf8("a"), ByteString.copyFromUtf8("a")); + + Truth.assertThat(result).isEqualTo(0); + } + + @Test + public void unequalTest() { + ByteString a = ByteString.copyFromUtf8("a"); + ByteString b = ByteString.copyFromUtf8("b"); + + Truth.assertThat(ByteStringComparator.INSTANCE.compare(a, b)).isEqualTo("a".compareTo("b")); + Truth.assertThat(ByteStringComparator.INSTANCE.compare(b, a)).isEqualTo("b".compareTo("a")); + } + + @Test + public void lengthTest() { + ByteString a = ByteString.copyFromUtf8("a"); + ByteString a_ = ByteString.copyFromUtf8("b").concat(ByteString.copyFrom(new byte[] {0})); + + Truth.assertThat(ByteStringComparator.INSTANCE.compare(a, a_)).isEqualTo(-1); + Truth.assertThat(ByteStringComparator.INSTANCE.compare(a_, a)).isEqualTo(1); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequestTest.java new file mode 100644 index 000000000000..983bc8521ce1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequestTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class PrepareQueryRequestTest { + + @Test + public void testProtoConversion() { + Map> paramTypes = new HashMap<>(); + paramTypes.put("strParam", SqlType.string()); + paramTypes.put("bytesParam", SqlType.bytes()); + paramTypes.put("intParam", SqlType.int64()); + paramTypes.put("float64Param", SqlType.float64()); + paramTypes.put("float32Param", SqlType.float32()); + paramTypes.put("boolParam", SqlType.bool()); + paramTypes.put("timestampParam", SqlType.timestamp()); + paramTypes.put("dateParam", SqlType.date()); + paramTypes.put("strArrayParam", SqlType.arrayOf(SqlType.string())); + paramTypes.put("byteArrayParam", SqlType.arrayOf(SqlType.bytes())); + paramTypes.put("intArrayParam", SqlType.arrayOf(SqlType.int64())); + paramTypes.put("float32ArrayParam", SqlType.arrayOf(SqlType.float32())); + paramTypes.put("float64ArrayParam", SqlType.arrayOf(SqlType.float64())); + paramTypes.put("boolArrayParam", SqlType.arrayOf(SqlType.bool())); + paramTypes.put("tsArrayParam", SqlType.arrayOf(SqlType.timestamp())); + paramTypes.put("dateArrayParam", SqlType.arrayOf(SqlType.date())); + + PrepareQueryRequest request = PrepareQueryRequest.create("SELECT * FROM table", paramTypes); + RequestContext rc = RequestContext.create("project", "instance", "profile"); + com.google.bigtable.v2.PrepareQueryRequest proto = request.toProto(rc); + + assertThat(proto.getQuery()).isEqualTo("SELECT * FROM table"); + assertThat(proto.getAppProfileId()).isEqualTo("profile"); + assertThat(proto.getInstanceName()) + .isEqualTo(NameUtil.formatInstanceName("project", "instance")); + + Map protoParamTypes = new HashMap<>(); + protoParamTypes.put("strParam", stringType()); + protoParamTypes.put("bytesParam", bytesType()); + protoParamTypes.put("intParam", int64Type()); + protoParamTypes.put("float64Param", float64Type()); + protoParamTypes.put("float32Param", float32Type()); + protoParamTypes.put("boolParam", boolType()); + protoParamTypes.put("timestampParam", timestampType()); + protoParamTypes.put("dateParam", dateType()); + protoParamTypes.put("strArrayParam", arrayType(stringType())); + protoParamTypes.put("byteArrayParam", arrayType(bytesType())); + protoParamTypes.put("intArrayParam", arrayType(int64Type())); + protoParamTypes.put("float32ArrayParam", arrayType(float32Type())); + protoParamTypes.put("float64ArrayParam", arrayType(float64Type())); + protoParamTypes.put("boolArrayParam", arrayType(boolType())); + protoParamTypes.put("tsArrayParam", arrayType(timestampType())); + protoParamTypes.put("dateArrayParam", arrayType(dateType())); + assertThat(proto.getParamTypesMap()).isEqualTo(protoParamTypes); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java new file mode 100644 index 000000000000..44d80cec6b52 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java @@ -0,0 +1,417 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.bigtable.v2.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PrepareQueryState; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryVersion; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.PrepareRpcExpectation; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.TestBigtableSqlService; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import io.grpc.Status.Code; +import io.grpc.testing.GrpcServerRule; +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class PreparedStatementImplTest { + + private static final ResultSetMetadata METADATA_PROTO = + metadata(columnMetadata("_key", bytesType()), columnMetadata("p", stringType())); + + @Rule public GrpcServerRule serverRule = new GrpcServerRule(); + private TestBigtableSqlService service; + private BigtableDataClient client; + private Map> paramTypes; + private int prepareAttempts; + + @Before + public void setUp() throws IOException { + service = new TestBigtableSqlService(); + serverRule.getServiceRegistry().addService(service); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilder() + .setProjectId(TestBigtableSqlService.DEFAULT_PROJECT_ID) + .setInstanceId(TestBigtableSqlService.DEFAULT_INSTANCE_ID) + .setAppProfileId(TestBigtableSqlService.DEFAULT_APP_PROFILE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()); + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + .build(); + // Remove log noise from client side metrics + settings.setMetricsProvider(NoopMetricsProvider.INSTANCE).disableInternalMetrics(); + prepareAttempts = + settings.stubSettings().prepareQuerySettings().retrySettings().getMaxAttempts(); + client = BigtableDataClient.create(settings.build()); + paramTypes = ImmutableMap.of("param", SqlType.string()); + } + + private PreparedStatementImpl getDefaultPrepareStatement() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("plan"), + METADATA_PROTO, + // Plan expires right away + Instant.now()))); + return (PreparedStatementImpl) + client.prepareStatement("SELECT _key, @param AS p FROM table", paramTypes); + } + + @After + public void tearDown() { + if (client != null) { + client.close(); + } + } + + @Test + public void testBackgroundRefresh() throws InterruptedException, ExecutionException { + PreparedStatementImpl preparedStatement = getDefaultPrepareStatement(); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse(ByteString.copyFromUtf8("plan2"), METADATA_PROTO, Instant.now()))); + // Refresh won't be triggered until this call + PreparedQueryData initialPlan = preparedStatement.getLatestPrepareResponse(); + PrepareResponse initialResponse = initialPlan.prepareFuture().get(); + // wait for the second call + do { + Thread.sleep(10); + } while (service.prepareCount < 2); + Thread.sleep(50); + PreparedQueryData updatedPlan = preparedStatement.getLatestPrepareResponse(); + PrepareResponse updatedResponse = updatedPlan.prepareFuture().get(); + assertThat(updatedPlan.version()).isNotEqualTo(initialPlan.version()); + assertThat(initialResponse.preparedQuery()).isEqualTo(ByteString.copyFromUtf8("plan")); + assertThat(initialResponse.resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA_PROTO)); + assertThat(updatedResponse.preparedQuery()).isEqualTo(ByteString.copyFromUtf8("plan2")); + assertThat(updatedResponse.resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA_PROTO)); + // We don't expect any additional calls + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void noRefreshBeforeExpiryWindow() throws ExecutionException, InterruptedException { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @other AS o FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("other_plan"), + METADATA_PROTO, + // Don't expire + Instant.now().plus(Duration.ofMinutes(10))))); + PreparedStatementImpl unexpired = + (PreparedStatementImpl) + client.prepareStatement("SELECT _key, @other AS o FROM table", paramTypes); + // Don't expect any refresh + PreparedQueryData initialPlan = unexpired.getLatestPrepareResponse(); + PrepareResponse initialResponse = initialPlan.prepareFuture().get(); + + assertThat(initialResponse.preparedQuery()).isEqualTo(ByteString.copyFromUtf8("other_plan")); + assertThat(service.prepareCount).isEqualTo(1); + } + + @Test + public void testMarkExpiredAndStartRefresh() throws ExecutionException, InterruptedException { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("plan"), + METADATA_PROTO, + // Plan expires right away + Instant.now().plusSeconds(2L)))); + PreparedStatementImpl preparedStatement = + (PreparedStatementImpl) + client.prepareStatement("SELECT _key, @param AS p FROM table", paramTypes); + PreparedQueryData initialPlan = preparedStatement.getLatestPrepareResponse(); + PrepareResponse initialPrepareResponse = initialPlan.prepareFuture().get(); + + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("hardRefreshPlan"), + METADATA_PROTO, + Instant.now().plus(Duration.ofMinutes(10))))); + + PreparedQueryData updatedPlan = + preparedStatement.markExpiredAndStartRefresh(initialPlan.version()); + PrepareResponse updatedPrepareResponse = updatedPlan.prepareFuture().get(); + + assertThat(updatedPlan.version()).isNotEqualTo(initialPlan.version()); + assertThat(initialPrepareResponse.preparedQuery()).isEqualTo(ByteString.copyFromUtf8("plan")); + assertThat(initialPrepareResponse.resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA_PROTO)); + assertThat(updatedPrepareResponse.preparedQuery()) + .isEqualTo(ByteString.copyFromUtf8("hardRefreshPlan")); + assertThat(updatedPrepareResponse.resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA_PROTO)); + // We don't expect any additional calls + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void testConcurrentBackgroundRefreshCalls() + throws InterruptedException, ExecutionException { + PreparedStatementImpl preparedStatement = getDefaultPrepareStatement(); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("plan2"), + METADATA_PROTO, + Instant.now().plus(Duration.ofMinutes(10))))); + ExecutorService executor = Executors.newFixedThreadPool(50); + List> callableList = new ArrayList<>(); + for (int i = 0; i < 50; i++) { + callableList.add(preparedStatement::getLatestPrepareResponse); + } + List> results = executor.invokeAll(callableList); + executor.shutdown(); + boolean done = executor.awaitTermination(1, TimeUnit.MINUTES); + assertThat(done).isTrue(); + assertThat(service.prepareCount).isEqualTo(2); + for (Future prepareFuture : results) { + PreparedQueryData response = prepareFuture.get(); + assertThat(response.prepareFuture().get().preparedQuery()) + .isIn( + // Some will get the first plan, some might get the result of refresh + ImmutableList.of(ByteString.copyFromUtf8("plan"), ByteString.copyFromUtf8("plan2"))); + } + } + + @Test + public void testConcurrentMarkExpiredAndStartRefreshCalls() + throws InterruptedException, ExecutionException { + PreparedStatementImpl preparedStatement = getDefaultPrepareStatement(); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("plan2"), + METADATA_PROTO, + Instant.now().plus(Duration.ofMinutes(10))))); + PreparedQueryData initialData = preparedStatement.getLatestPrepareResponse(); + ExecutorService executor = Executors.newFixedThreadPool(50); + List> callableList = new ArrayList<>(); + for (int i = 0; i < 50; i++) { + callableList.add(() -> preparedStatement.markExpiredAndStartRefresh(initialData.version())); + } + List> results = executor.invokeAll(callableList); + executor.shutdown(); + boolean done = executor.awaitTermination(1, TimeUnit.MINUTES); + assertThat(done).isTrue(); + for (Future refreshFuture : results) { + PreparedQueryData response = refreshFuture.get(); + assertThat(response.version()).isNotEqualTo(initialData.version()); + assertThat(response.prepareFuture().get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA_PROTO)); + } + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void testPrepareFailuresAreRetried() throws ExecutionException, InterruptedException { + PreparedStatementImpl preparedStatement = getDefaultPrepareStatement(); + int failures = 0; + // Exhaust all the retries w unavailables + for (int i = 0; i <= prepareAttempts; i++) { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWithStatus(Code.UNAVAILABLE)); + failures++; + } + // Now exhaust all the retries again w deadline exceeded + for (int i = 0; i <= prepareAttempts; i++) { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .respondWithStatus(Code.DEADLINE_EXCEEDED)); + failures++; + } + // then succeed + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .withDelay(Duration.ofMillis(20)) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("plan2"), + METADATA_PROTO, + Instant.now().plus(Duration.ofMinutes(10))))); + PreparedQueryData initialData = preparedStatement.getLatestPrepareResponse(); + PreparedQueryData nextData = + preparedStatement.markExpiredAndStartRefresh(initialData.version()); + + assertThat(nextData.prepareFuture().get().preparedQuery()) + .isEqualTo(ByteString.copyFromUtf8("plan2")); + // initial request + failures + final success + assertThat(service.prepareCount).isEqualTo(1 + failures + 1); + } + + @Test + public void garbageCollectionWorksWhenRetryIsOngoing() throws InterruptedException { + PreparedStatementImpl preparedStatement = getDefaultPrepareStatement(); + + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT _key, @param AS p FROM table") + .withParamTypes(paramTypes) + .withDelay(Duration.ofSeconds(1)) + // Return a permanent error so the stub doesn't retry + .respondWithStatus(Code.INTERNAL)); + WeakReference weakRef = new WeakReference<>(preparedStatement); + PreparedQueryVersion initialPlanId = preparedStatement.getLatestPrepareResponse().version(); + PreparedQueryData next = preparedStatement.markExpiredAndStartRefresh(initialPlanId); + preparedStatement = null; + for (int i = 0; i < 5; i++) { + // This isn't guaranteed to run GC, so call it a few times. Testing has shown that this + // is enough to prevent any flakes in 1000 runs + System.gc(); + Thread.sleep(10); + } + assertThat(service.prepareCount).isEqualTo(2); + assertThat(weakRef.get()).isNull(); + // The plan refresh stops retrying after the PreparedStatement is garbage collected. + // Because this means it isn't needed anymore, we don't want to keep refreshing. + assertThrows( + RuntimeException.class, + () -> ApiExceptions.callAndTranslateApiException(next.prepareFuture())); + } + + @Test + public void testPrepareQueryStateInitialState() throws ExecutionException, InterruptedException { + ResultSetMetadata md = metadata(columnMetadata("strCol", stringType())); + PrepareQueryState state = + PrepareQueryState.createInitialState( + PrepareResponse.fromProto(prepareResponse(ByteString.copyFromUtf8("plan"), md))); + assertThat(state.current().prepareFuture().isDone()).isTrue(); + assertThat(state.current().prepareFuture().get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(md)); + assertThat(state.maybeBackgroundRefresh()).isEmpty(); + } + + @Test + public void testPrepareQueryStateWithBackgroundPlan() + throws ExecutionException, InterruptedException { + ResultSetMetadata md = metadata(columnMetadata("strCol", stringType())); + PrepareQueryState state = + PrepareQueryState.createInitialState( + PrepareResponse.fromProto(prepareResponse(ByteString.copyFromUtf8("plan"), md))); + + PrepareQueryState withBackgroundPlan = + state.withBackgroundPlan( + ApiFutures.immediateFuture(PrepareResponse.fromProto(prepareResponse(md)))); + assertThat(withBackgroundPlan.current().prepareFuture().isDone()).isTrue(); + assertThat(withBackgroundPlan.current().prepareFuture().get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(md)); + assertThat(withBackgroundPlan.current().version()).isEqualTo(state.current().version()); + assertThat(withBackgroundPlan.maybeBackgroundRefresh()).isPresent(); + assertThat(withBackgroundPlan.maybeBackgroundRefresh().get().version()) + .isNotEqualTo(withBackgroundPlan.current().version()); + assertThat( + withBackgroundPlan + .maybeBackgroundRefresh() + .get() + .prepareFuture() + .get() + .resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(md)); + } + + @Test + public void testPrepareQueryStatePromoteBackgroundPlan() + throws ExecutionException, InterruptedException { + ResultSetMetadata md = metadata(columnMetadata("strCol", stringType())); + PrepareQueryState state = + PrepareQueryState.createInitialState( + PrepareResponse.fromProto(prepareResponse(ByteString.copyFromUtf8("plan"), md))); + PrepareQueryState withBackgroundPlan = + state.withBackgroundPlan( + ApiFutures.immediateFuture(PrepareResponse.fromProto(prepareResponse(md)))); + PrepareQueryState finalState = withBackgroundPlan.promoteBackgroundPlan(); + + assertThat(finalState.current().version()) + .isEqualTo(withBackgroundPlan.maybeBackgroundRefresh().get().version()); + assertThat(finalState.current().prepareFuture().get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(md)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadataTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadataTest.java new file mode 100644 index 000000000000..067b3bb4ac14 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadataTest.java @@ -0,0 +1,210 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ProtoSchema; +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import java.util.Arrays; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ProtoResultSetMetadataTest { + + @Test + public void getColumnIndex_returnsCorrectIndex() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("0", SqlType.string()), + ColumnMetadataImpl.create("1", SqlType.int64()), + ColumnMetadataImpl.create("2", SqlType.int64()), + ColumnMetadataImpl.create("3", SqlType.int64()), + ColumnMetadataImpl.create("4", SqlType.int64()))); + + assertThat(metadata.getColumnIndex("0")).isEqualTo(0); + assertThat(metadata.getColumnIndex("1")).isEqualTo(1); + assertThat(metadata.getColumnIndex("2")).isEqualTo(2); + assertThat(metadata.getColumnIndex("3")).isEqualTo(3); + assertThat(metadata.getColumnIndex("4")).isEqualTo(4); + } + + @Test + public void getColumnType_worksByName() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("col0", SqlType.string()), + ColumnMetadataImpl.create("col1", SqlType.int64()), + ColumnMetadataImpl.create("col2", SqlType.timestamp()), + ColumnMetadataImpl.create("col3", SqlType.date()), + ColumnMetadataImpl.create("col4", SqlType.int64()))); + + assertThat(metadata.getColumnType("col0")).isEqualTo(SqlType.string()); + assertThat(metadata.getColumnType("col1")).isEqualTo(SqlType.int64()); + assertThat(metadata.getColumnType("col2")).isEqualTo(SqlType.timestamp()); + assertThat(metadata.getColumnType("col3")).isEqualTo(SqlType.date()); + assertThat(metadata.getColumnType("col4")).isEqualTo(SqlType.int64()); + } + + @Test + public void getColumnType_worksByIndex() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("col0", SqlType.string()), + ColumnMetadataImpl.create("col1", SqlType.int64()), + ColumnMetadataImpl.create("col2", SqlType.timestamp()), + ColumnMetadataImpl.create("col3", SqlType.date()), + ColumnMetadataImpl.create("col4", SqlType.int64()))); + + assertThat(metadata.getColumnType(0)).isEqualTo(SqlType.string()); + assertThat(metadata.getColumnType(1)).isEqualTo(SqlType.int64()); + assertThat(metadata.getColumnType(2)).isEqualTo(SqlType.timestamp()); + assertThat(metadata.getColumnType(3)).isEqualTo(SqlType.date()); + assertThat(metadata.getColumnType(4)).isEqualTo(SqlType.int64()); + } + + @Test + public void getColumns_returnsColumnsUnchanged() { + List columns = + Arrays.asList( + ColumnMetadataImpl.create("col0", SqlType.string()), + ColumnMetadataImpl.create("col1", SqlType.int64()), + ColumnMetadataImpl.create("col2", SqlType.timestamp()), + ColumnMetadataImpl.create("col3", SqlType.date()), + ColumnMetadataImpl.create("col4", SqlType.int64())); + ResultSetMetadata metadata = ProtoResultSetMetadata.create(columns); + + assertThat(metadata.getColumns()).isEqualTo(columns); + } + + @Test + public void getColumnTypeByNonExistentName_throwsException() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("a", SqlType.string()), + ColumnMetadataImpl.create("b", SqlType.int64()))); + + assertThrows(IllegalArgumentException.class, () -> metadata.getColumnType("c")); + } + + @Test + public void getColumnTypeByNonExistentIndex_throwsException() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("a", SqlType.string()), + ColumnMetadataImpl.create("b", SqlType.int64()))); + + assertThrows(IndexOutOfBoundsException.class, () -> metadata.getColumnType(2)); + } + + @Test + public void getColumnIndexForNonExistentName_throwsException() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("a", SqlType.string()), + ColumnMetadataImpl.create("b", SqlType.int64()))); + + assertThrows(IllegalArgumentException.class, () -> metadata.getColumnIndex("c")); + } + + @Test + public void getColumnType_throwsExceptionForDuplicateName() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("test", SqlType.string()), + ColumnMetadataImpl.create("test", SqlType.int64()))); + + assertThrows(IllegalArgumentException.class, () -> metadata.getColumnType("test")); + } + + @Test + public void getColumnType_allowsGetByIndexWithDuplicateType() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("test", SqlType.string()), + ColumnMetadataImpl.create("test", SqlType.int64()))); + + assertThat(metadata.getColumnType(0)).isEqualTo(SqlType.string()); + assertThat(metadata.getColumnType(1)).isEqualTo(SqlType.int64()); + } + + @Test + public void getColumnIndex_throwsExceptionForDuplicateName() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.create( + Arrays.asList( + ColumnMetadataImpl.create("test", SqlType.string()), + ColumnMetadataImpl.create("test", SqlType.int64()))); + + assertThrows(IllegalArgumentException.class, () -> metadata.getColumnIndex("test")); + } + + @Test + public void fromProto_throwsExceptionWithEmptySchema() { + com.google.bigtable.v2.ResultSetMetadata invalidProto = + com.google.bigtable.v2.ResultSetMetadata.newBuilder().build(); + assertThrows(IllegalStateException.class, () -> ProtoResultSetMetadata.fromProto(invalidProto)); + } + + @Test + public void fromProto_withEmptyTypeInSchema_throwsException() { + com.google.bigtable.v2.ResultSetMetadata invalidProto = + com.google.bigtable.v2.ResultSetMetadata.newBuilder() + .setProtoSchema( + ProtoSchema.newBuilder() + .addColumns( + com.google.bigtable.v2.ColumnMetadata.newBuilder() + .setName("test") + .setType(Type.newBuilder().build()))) + .build(); + assertThrows(IllegalStateException.class, () -> ProtoResultSetMetadata.fromProto(invalidProto)); + } + + @Test + public void fromProto_allowsColumnWithNoName() { + com.google.bigtable.v2.ResultSetMetadata proto = + com.google.bigtable.v2.ResultSetMetadata.newBuilder() + .setProtoSchema( + ProtoSchema.newBuilder() + .addColumns( + com.google.bigtable.v2.ColumnMetadata.newBuilder() + .setType(stringType()) + .build())) + .build(); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(proto); + assertThat(metadata.getColumns().size()).isEqualTo(1); + assertThat(metadata.getColumns().get(0).type()).isEqualTo(SqlType.string()); + assertThat(metadata.getColumns().get(0).name()).isEqualTo(""); + assertThat(metadata.getColumnIndex("")).isEqualTo(0); + assertThat(metadata.getColumnType("")).isEqualTo(SqlType.string()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java new file mode 100644 index 000000000000..cd8dfc734004 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java @@ -0,0 +1,334 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.enumType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.floatValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.protoType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structField; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.Type; +import com.google.bigtable.v2.Type.Struct; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.bigtable.common.Type.SchemalessEnum; +import com.google.cloud.bigtable.common.Type.SchemalessProto; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.protobuf.ByteString; +import java.time.Instant; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@SuppressWarnings("DoubleBraceInitialization") +@RunWith(JUnit4.class) +public class ProtoStructTest { + + static Singer singer = Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build(); + + static ProtoStruct struct = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("bytesField", bytesType()), + structField("stringField", stringType()), + structField("longField", int64Type()), + structField("doubleField", float64Type()), + structField("floatField", float32Type()), + structField("booleanField", boolType()), + structField("timestampField", timestampType()), + structField("dateField", dateType()), + structField( + "structField", structType(structField("stringField", stringType()))), + structField("listField", arrayType(stringType())), + structField("mapField", mapType(stringType(), stringType())), + structField( + "protoField", + protoType("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")), + structField( + "enumField", + enumType( + "com.google.cloud.bigtable.data.v2.test.Genre", "other_bundle")))), + arrayValue( + bytesValue("testBytes"), + stringValue("testString"), + int64Value(123), + floatValue(1.23), + floatValue(1.23), + boolValue(true), + timestampValue(100000, 100), + dateValue(2024, 6, 1), + structValue(stringValue("string")), + arrayValue(stringValue("foo"), stringValue("bar")), + arrayValue( + mapElement(stringValue("foo"), stringValue("bar")), + mapElement(stringValue("key"), stringValue("val"))), + bytesValue(singer.toByteArray()), + int64Value(0)) + .getArrayValue()); + + // These are more extensively tested in AbstractProtoStructReaderTest since that is what + // implements the logic + @Test + public void getByIndex_supportsAllTypes() { + assertThat(struct.getBytes(0)).isEqualTo(ByteString.copyFromUtf8("testBytes")); + assertThat(struct.getString(1)).isEqualTo("testString"); + assertThat(struct.getLong(2)).isEqualTo(123); + assertThat(struct.getDouble(3)).isEqualTo(1.23d); + assertThat(struct.getFloat(4)).isEqualTo(1.23f); + assertThat(struct.getBoolean(5)).isTrue(); + assertThat(struct.getTimestamp(6)).isEqualTo(Instant.ofEpochSecond(100000, 100)); + assertThat(struct.getDate(7)).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(struct.getStruct(8)) + .isEqualTo( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto(structType(structField("stringField", stringType()))), + structValue(stringValue("string")).getArrayValue())); + assertThat(struct.getList(9, SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", "bar")); + assertThat(struct.getMap(10, SqlType.mapOf(SqlType.string(), SqlType.string()))) + .isEqualTo( + new HashMap() { + { + put("foo", "bar"); + put("key", "val"); + } + }); + assertThat(struct.getProtoMessage(11, Singer.getDefaultInstance())).isEqualTo(singer); + assertThat(struct.getProtoEnum(12, Genre::forNumber)).isEqualTo(Genre.POP); + } + + @Test + public void getByNameSupportsAllTypes() { + assertThat(struct.getBytes("bytesField")).isEqualTo(ByteString.copyFromUtf8("testBytes")); + assertThat(struct.getString("stringField")).isEqualTo("testString"); + assertThat(struct.getLong("longField")).isEqualTo(123); + assertThat(struct.getDouble("doubleField")).isEqualTo(1.23d); + assertThat(struct.getFloat("floatField")).isEqualTo(1.23f); + assertThat(struct.getBoolean("booleanField")).isTrue(); + assertThat(struct.getTimestamp("timestampField")).isEqualTo(Instant.ofEpochSecond(100000, 100)); + assertThat(struct.getDate("dateField")).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(struct.getStruct("structField")) + .isEqualTo( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto(structType(structField("stringField", stringType()))), + structValue(stringValue("string")).getArrayValue())); + assertThat(struct.getList("listField", SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", "bar")); + assertThat(struct.getMap("mapField", SqlType.mapOf(SqlType.string(), SqlType.string()))) + .isEqualTo( + new HashMap() { + { + put("foo", "bar"); + put("key", "val"); + } + }); + assertThat(struct.getProtoMessage("protoField", Singer.getDefaultInstance())).isEqualTo(singer); + assertThat(struct.getProtoEnum("enumField", Genre::forNumber)).isEqualTo(Genre.POP); + } + + @Test + public void getColumnType_byName() { + assertThat(struct.getColumnType("bytesField")).isEqualTo(SqlType.bytes()); + assertThat(struct.getColumnType("stringField")).isEqualTo(SqlType.string()); + assertThat(struct.getColumnType("longField")).isEqualTo(SqlType.int64()); + assertThat(struct.getColumnType("doubleField")).isEqualTo(SqlType.float64()); + assertThat(struct.getColumnType("floatField")).isEqualTo(SqlType.float32()); + assertThat(struct.getColumnType("booleanField")).isEqualTo(SqlType.bool()); + assertThat(struct.getColumnType("timestampField")).isEqualTo(SqlType.timestamp()); + assertThat(struct.getColumnType("dateField")).isEqualTo(SqlType.date()); + assertThat(struct.getColumnType("structField")) + .isEqualTo(SqlType.fromProto(structType(structField("stringField", stringType())))); + assertThat(struct.getColumnType("listField")).isEqualTo(SqlType.arrayOf(SqlType.string())); + assertThat(struct.getColumnType("mapField")) + .isEqualTo(SqlType.mapOf(SqlType.string(), SqlType.string())); + assertThat(struct.getColumnType("protoField")) + .isEqualTo( + SchemalessProto.create("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")); + assertThat(struct.getColumnType("enumField")) + .isEqualTo( + SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Genre", "other_bundle")); + } + + @Test + public void getColumnType_byIndex() { + assertThat(struct.getColumnType(0)).isEqualTo(SqlType.bytes()); + assertThat(struct.getColumnType(1)).isEqualTo(SqlType.string()); + assertThat(struct.getColumnType(2)).isEqualTo(SqlType.int64()); + assertThat(struct.getColumnType(3)).isEqualTo(SqlType.float64()); + assertThat(struct.getColumnType(4)).isEqualTo(SqlType.float32()); + assertThat(struct.getColumnType(5)).isEqualTo(SqlType.bool()); + assertThat(struct.getColumnType(6)).isEqualTo(SqlType.timestamp()); + assertThat(struct.getColumnType(7)).isEqualTo(SqlType.date()); + assertThat(struct.getColumnType(8)) + .isEqualTo(SqlType.fromProto(structType(structField("stringField", stringType())))); + assertThat(struct.getColumnType(9)).isEqualTo(SqlType.arrayOf(SqlType.string())); + assertThat(struct.getColumnType(10)) + .isEqualTo(SqlType.mapOf(SqlType.string(), SqlType.string())); + assertThat(struct.getColumnType(11)) + .isEqualTo( + SchemalessProto.create("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")); + assertThat(struct.getColumnType(12)) + .isEqualTo( + SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Genre", "other_bundle")); + } + + @Test + public void getColumnIndex_worksForExistingColumns() { + assertThat(struct.getColumnIndex("bytesField")).isEqualTo(0); + assertThat(struct.getColumnIndex("stringField")).isEqualTo(1); + assertThat(struct.getColumnIndex("longField")).isEqualTo(2); + assertThat(struct.getColumnIndex("doubleField")).isEqualTo(3); + assertThat(struct.getColumnIndex("floatField")).isEqualTo(4); + assertThat(struct.getColumnIndex("booleanField")).isEqualTo(5); + assertThat(struct.getColumnIndex("timestampField")).isEqualTo(6); + assertThat(struct.getColumnIndex("dateField")).isEqualTo(7); + assertThat(struct.getColumnIndex("structField")).isEqualTo(8); + assertThat(struct.getColumnIndex("listField")).isEqualTo(9); + assertThat(struct.getColumnIndex("mapField")).isEqualTo(10); + assertThat(struct.getColumnIndex("protoField")).isEqualTo(11); + assertThat(struct.getColumnIndex("enumField")).isEqualTo(12); + } + + @Test + public void getColumnIndex_throwsExceptionForNonExistentIndex() { + assertThrows(IllegalArgumentException.class, () -> struct.getColumnIndex("nonexistent")); + } + + @Test + public void values_populatedFromFieldValues() { + List values = Arrays.asList(stringValue("foo"), stringValue("bar")); + ProtoStruct s = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType( + structField("stringField1", stringType()), + structField("stringField2", stringType()))), + arrayValue(values.toArray(new Value[] {})).getArrayValue()); + + assertThat(s.values()).isEqualTo(values); + } + + @Test + public void getByColumnIndex_supportsUnnamedColumn() { + ProtoStruct s = + ProtoStruct.create( + // This creates a struct with two unnamed string fields + (SqlType.Struct) SqlType.fromProto(structType(stringType(), stringType())), + arrayValue(stringValue("foo"), stringValue("bar")).getArrayValue()); + + assertThat(s.getString(0)).isEqualTo("foo"); + assertThat(s.getString(1)).isEqualTo("bar"); + } + + @Test + public void getByColumnName_supportsUnnamedColumn() { + ProtoStruct s = + ProtoStruct.create( + // This creates a struct with one unnamed string fields + (SqlType.Struct) SqlType.fromProto(structType(stringType())), + arrayValue(stringValue("foo")).getArrayValue()); + + assertThat(s.getString("")).isEqualTo("foo"); + } + + @Test + public void emptyStruct_behavesCorrectly() { + ProtoStruct empty = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + Type.newBuilder().setStructType(Struct.newBuilder().build()).build()), + ArrayValue.newBuilder().build()); + + assertThrows(IndexOutOfBoundsException.class, () -> empty.getString(0)); + assertThrows(IllegalArgumentException.class, () -> empty.getString("")); + assertThrows(IndexOutOfBoundsException.class, () -> empty.getColumnType(0)); + assertThrows(IllegalArgumentException.class, () -> empty.getColumnType("")); + } + + @Test + public void getColumnIndexOnDuplicateField_throwsException() { + List values = Arrays.asList(stringValue("foo"), stringValue("bar")); + ProtoStruct s = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType(structField("dup", stringType()), structField("dup", stringType()))), + arrayValue(values.toArray(new Value[] {})).getArrayValue()); + + assertThrows(IllegalArgumentException.class, () -> s.getColumnIndex("dup")); + } + + @Test + public void getByFieldNameOnDuplicateField_throwsException() { + List values = Arrays.asList(stringValue("foo"), stringValue("bar")); + ProtoStruct s = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType(structField("dup", stringType()), structField("dup", stringType()))), + arrayValue(values.toArray(new Value[] {})).getArrayValue()); + + assertThrows(IllegalArgumentException.class, () -> s.getString("dup")); + } + + @Test + public void getByIndex_worksWithDuplicateFieldNames() { + List values = Arrays.asList(stringValue("foo"), stringValue("bar")); + ProtoStruct s = + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto( + structType(structField("dup", stringType()), structField("dup", stringType()))), + arrayValue(values.toArray(new Value[] {})).getArrayValue()); + + assertThat(s.getString(0)).isEqualTo("foo"); + assertThat(s.getString(1)).isEqualTo("bar"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtilTest.java new file mode 100644 index 000000000000..b0f1d64a9de3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtilTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.internal.QueryParamUtil.convertToQueryParamProto; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class QueryParamUtilTest { + + @Test + public void convertsSimpleTypes() { + assertThat(convertToQueryParamProto(SqlType.string())).isEqualTo(stringType()); + assertThat(convertToQueryParamProto(SqlType.bytes())).isEqualTo(bytesType()); + assertThat(convertToQueryParamProto(SqlType.int64())).isEqualTo(int64Type()); + assertThat(convertToQueryParamProto(SqlType.float64())).isEqualTo(float64Type()); + assertThat(convertToQueryParamProto(SqlType.float32())).isEqualTo(float32Type()); + assertThat(convertToQueryParamProto(SqlType.bool())).isEqualTo(boolType()); + assertThat(convertToQueryParamProto(SqlType.timestamp())).isEqualTo(timestampType()); + assertThat(convertToQueryParamProto(SqlType.date())).isEqualTo(dateType()); + } + + @Test + public void convertsValidArrayTypes() { + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.string()))) + .isEqualTo(arrayType(stringType())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.bytes()))) + .isEqualTo(arrayType(bytesType())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.int64()))) + .isEqualTo(arrayType(int64Type())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.float64()))) + .isEqualTo(arrayType(float64Type())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.float32()))) + .isEqualTo(arrayType(float32Type())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.bool()))) + .isEqualTo(arrayType(boolType())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.timestamp()))) + .isEqualTo(arrayType(timestampType())); + assertThat(convertToQueryParamProto(SqlType.arrayOf(SqlType.date()))) + .isEqualTo(arrayType(dateType())); + } + + @Test + public void failsForInvalidArrayElementTypes() { + assertThrows( + IllegalArgumentException.class, + () -> convertToQueryParamProto(SqlType.arrayOf(SqlType.struct()))); + assertThrows( + IllegalArgumentException.class, + () -> convertToQueryParamProto(SqlType.arrayOf(SqlType.arrayOf(SqlType.string())))); + assertThrows( + IllegalArgumentException.class, + () -> + convertToQueryParamProto( + SqlType.arrayOf(SqlType.mapOf(SqlType.string(), SqlType.string())))); + } + + @Test + public void failsForMap() { + assertThrows( + IllegalArgumentException.class, + () -> convertToQueryParamProto(SqlType.mapOf(SqlType.string(), SqlType.string()))); + } + + @Test + public void failsForStruct() { + assertThrows(IllegalArgumentException.class, () -> convertToQueryParamProto(SqlType.struct())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RegexUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RegexUtilTest.java new file mode 100644 index 000000000000..befd4281d295 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RegexUtilTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RegexUtilTest { + @Test + public void literalRegexPassthroughTest() { + ByteString input = ByteString.copyFromUtf8("hi"); + ByteString actual = RegexUtil.literalRegex(input); + + assertThat(actual).isEqualTo(input); + } + + @Test + public void literalRegexEscapeTest() { + ByteString input = ByteString.copyFromUtf8("h.*i"); + ByteString actual = RegexUtil.literalRegex(input); + ByteString expected = ByteString.copyFromUtf8("h\\.\\*i"); + + assertThat(actual).isEqualTo(expected); + } + + @Test + public void literalRegexEscapeBytes() { + ByteString input = ByteString.copyFrom(new byte[] {(byte) 0xe2, (byte) 0x80, (byte) 0xb3}); + ByteString actual = RegexUtil.literalRegex(input); + + assertThat(actual).isEqualTo(input); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java new file mode 100644 index 000000000000..97877231640a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java @@ -0,0 +1,369 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.callContext; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.enumType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.floatValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.protoType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structField; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallContext; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStreamImpl; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.protobuf.ByteString; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ResultSetImplTest { + + private static ResultSet resultSetWithFakeStream( + com.google.bigtable.v2.ResultSetMetadata protoMetadata, SqlRow... rows) { + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>(Arrays.asList(rows)); + SettableApiFuture future = SettableApiFuture.create(); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + future.set(metadata); + PreparedStatement preparedStatement = SqlProtoFactory.preparedStatement(protoMetadata); + ExecuteQueryCallContext fakeCallContext = callContext(preparedStatement.bind().build(), future); + return ResultSetImpl.create(SqlServerStreamImpl.create(future, stream.call(fakeCallContext))); + } + + @SuppressWarnings("DoubleBraceInitialization") + @Test + public void testSingleRow() throws ExecutionException, InterruptedException { + Singer singer = Singer.newBuilder().setName("Foo").setGenre(Genre.POP).build(); + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata( + columnMetadata("string", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("long", int64Type()), + columnMetadata("double", float64Type()), + columnMetadata("float", float32Type()), + columnMetadata("boolean", boolType()), + columnMetadata("timestamp", timestampType()), + columnMetadata("date", dateType()), + columnMetadata("struct", structType(structField("string", stringType()))), + columnMetadata("list", arrayType(stringType())), + columnMetadata("map", mapType(stringType(), stringType())), + columnMetadata( + "proto", protoType("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle")), + columnMetadata( + "enum", enumType("com.google.cloud.bigtable.data.v2.test.Genre", "other_bundle"))); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create( + metadata, + Arrays.asList( + stringValue("test"), + bytesValue("bytes"), + int64Value(100), + floatValue(1.23), + floatValue(1.23), + boolValue(true), + timestampValue(10000000, 100), + dateValue(2024, 6, 5), + structValue(stringValue("foo")), + arrayValue(stringValue("foo"), stringValue("bar")), + mapValue(mapElement(stringValue("key"), stringValue("val"))), + bytesValue(singer.toByteArray()), + int64Value(0)))); + int rows = 0; + while (resultSet.next()) { + rows++; + assertThat(resultSet.getString(0)).isEqualTo("test"); + assertThat(resultSet.getString("string")).isEqualTo("test"); + assertThat(resultSet.getBytes(1)).isEqualTo(ByteString.copyFromUtf8("bytes")); + assertThat(resultSet.getBytes("bytes")).isEqualTo(ByteString.copyFromUtf8("bytes")); + assertThat(resultSet.getLong(2)).isEqualTo(100); + assertThat(resultSet.getLong("long")).isEqualTo(100); + assertThat(resultSet.getDouble(3)).isEqualTo(1.23d); + assertThat(resultSet.getDouble("double")).isEqualTo(1.23d); + assertThat(resultSet.getFloat(4)).isEqualTo(1.23f); + assertThat(resultSet.getFloat("float")).isEqualTo(1.23f); + assertThat(resultSet.getBoolean(5)).isTrue(); + assertThat(resultSet.getBoolean("boolean")).isTrue(); + assertThat(resultSet.getTimestamp(6)).isEqualTo(Instant.ofEpochSecond(10000000, 100)); + assertThat(resultSet.getTimestamp("timestamp")) + .isEqualTo(Instant.ofEpochSecond(10000000, 100)); + assertThat(resultSet.getDate(7)).isEqualTo(Date.fromYearMonthDay(2024, 6, 5)); + assertThat(resultSet.getDate("date")).isEqualTo(Date.fromYearMonthDay(2024, 6, 5)); + assertThat(resultSet.getStruct(8)) + .isEqualTo( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto(structType(structField("string", stringType()))), + structValue(stringValue("foo")).getArrayValue())); + assertThat(resultSet.getStruct("struct")) + .isEqualTo( + ProtoStruct.create( + (SqlType.Struct) + SqlType.fromProto(structType(structField("string", stringType()))), + structValue(stringValue("foo")).getArrayValue())); + assertThat(resultSet.getList(9, SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", "bar")); + assertThat(resultSet.getList("list", SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", "bar")); + assertThat(resultSet.getMap(10, SqlType.mapOf(SqlType.string(), SqlType.string()))) + .isEqualTo( + new HashMap() { + { + put("key", "val"); + } + }); + assertThat(resultSet.getMap("map", SqlType.mapOf(SqlType.string(), SqlType.string()))) + .isEqualTo( + new HashMap() { + { + put("key", "val"); + } + }); + assertThat(resultSet.getProtoMessage(11, Singer.getDefaultInstance())).isEqualTo(singer); + assertThat(resultSet.getProtoMessage("proto", Singer.getDefaultInstance())).isEqualTo(singer); + assertThat(resultSet.getProtoEnum(12, Genre::forNumber)).isEqualTo(Genre.POP); + assertThat(resultSet.getProtoEnum("enum", Genre::forNumber)).isEqualTo(Genre.POP); + } + + assertThat(rows).isEqualTo(1); + assertThat(resultSet.next()).isFalse(); + assertThat(resultSet.getMetadata()).isEqualTo(metadata); + resultSet.close(); + } + + @Test + public void testIteration() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + try (ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))), + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("bar"))), + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("baz"))), + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("a"))), + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("b"))))) { + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("foo"); + assertThat(resultSet.next()).isTrue(); + // skip a row + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("baz"); + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("a"); + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("b"); + assertThat(resultSet.next()).isFalse(); + } + } + + @Test + public void testEmptyResultSet() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + try (ResultSet resultSet = resultSetWithFakeStream(protoMetadata)) { + assertThat(resultSet.next()).isFalse(); + assertThat(resultSet.getMetadata()).isEqualTo(metadata); + } + } + + @Test + public void getCallsPrevented_afterNextReturnsFalse() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + + ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))), + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("bar")))); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("foo"); + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getString(0)).isEqualTo("bar"); + assertThat(resultSet.next()).isFalse(); + // Users can still call next + assertThat(resultSet.next()).isFalse(); + // Attempts to access data will throw an exception + assertThrows(IllegalStateException.class, () -> resultSet.getString(0)); + resultSet.close(); + } + + @Test + public void close_preventsGetCalls() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo")))); + + assertThat(resultSet.next()).isTrue(); + resultSet.close(); + assertThrows(IllegalStateException.class, () -> resultSet.getString(0)); + } + + @Test + public void close_cancelsStreamWhenResultsNotConsumed() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("string", stringType()))); + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>( + Collections.singletonList( + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))))); + SqlServerStream sqlServerStream = + SqlServerStreamImpl.create( + SettableApiFuture.create(), stream.call(ExecuteQueryRequest.newBuilder().build())); + ResultSet resultSet = ResultSetImpl.create(sqlServerStream); + resultSet.close(); + + Throwable lastCallError = stream.popLastCall().getError(); + assertThat(lastCallError).isInstanceOf(CancellationException.class); + } + + @Test + public void close_doesNotCancelStreamWhenResultsConsumed() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("string", stringType()))); + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>( + Collections.singletonList( + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))))); + SqlServerStream sqlServerStream = + SqlServerStreamImpl.create( + SettableApiFuture.create(), stream.call(ExecuteQueryRequest.newBuilder().build())); + ResultSet resultSet = ResultSetImpl.create(sqlServerStream); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.next()).isFalse(); + resultSet.close(); + Throwable lastCallError = stream.popLastCall().getError(); + assertThat(lastCallError).isNull(); + } + + @Test + public void getBeforeNext_throwsException() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + try (ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))))) { + assertThrows(IllegalStateException.class, () -> resultSet.getString(0)); + } + } + + @Test + public void getOnColumnWithDuplicateName_throwsException() { + com.google.bigtable.v2.ResultSetMetadata protoMetadata = + metadata(columnMetadata("string", stringType())); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(protoMetadata); + try (ResultSet resultSet = + resultSetWithFakeStream( + protoMetadata, + ProtoSqlRow.create(metadata, Arrays.asList(stringValue("foo"), stringValue("bar"))))) { + + assertThat(resultSet.next()).isTrue(); + assertThrows(IllegalArgumentException.class, () -> resultSet.getString("name")); + } + } + + @Test + public void getMetadata_unwrapsExecutionExceptions() { + SettableApiFuture metadataFuture = SettableApiFuture.create(); + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>(Collections.emptyList()); + PreparedStatement preparedStatement = + SqlProtoFactory.preparedStatement(metadata(columnMetadata("foo", stringType()))); + ExecuteQueryCallContext fakeCallContext = + callContext(preparedStatement.bind().build(), metadataFuture); + ResultSet rs = + ResultSetImpl.create( + SqlServerStreamImpl.create(metadataFuture, stream.call(fakeCallContext))); + + metadataFuture.setException(new IllegalStateException("test")); + assertThrows(IllegalStateException.class, rs::getMetadata); + } + + @Test + public void getMetadata_returnsNonRuntimeExecutionExceptionsWrapped() { + SettableApiFuture metadataFuture = SettableApiFuture.create(); + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>(Collections.emptyList()); + PreparedStatement preparedStatement = + SqlProtoFactory.preparedStatement(metadata(columnMetadata("foo", stringType()))); + ExecuteQueryCallContext fakeCallContext = + callContext(preparedStatement.bind().build(), metadataFuture); + ResultSet rs = + ResultSetImpl.create( + SqlServerStreamImpl.create(metadataFuture, stream.call(fakeCallContext))); + + metadataFuture.setException(new Throwable("test")); + assertThrows(RuntimeException.class, rs::getMetadata); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java new file mode 100644 index 000000000000..c1bb915e8150 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java @@ -0,0 +1,147 @@ +/* + * 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.google.cloud.bigtable.data.v2.internal; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import java.util.List; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowMergerUtilTest { + + @Test + public void testEmpty() { + try (RowMergerUtil util = new RowMergerUtil()) {} + + try (RowMergerUtil util = new RowMergerUtil()) { + util.parseReadRowsResponses(ImmutableList.of()); + } + } + + @Test + public void testSingle() { + List responses = + ImmutableList.of( + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key")) + .setFamilyName(StringValue.newBuilder().setValue("family")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("qualifier"))) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build()); + try (RowMergerUtil util = new RowMergerUtil()) { + List rows = util.parseReadRowsResponses(responses); + assertThat(rows) + .containsExactly( + Row.create( + ByteString.copyFromUtf8("key"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.copyFromUtf8("qualifier"), + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value"))))); + } + } + + @Test + public void testMultiple() { + List responses = + ImmutableList.of( + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key")) + .setFamilyName(StringValue.newBuilder().setValue("family")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("qualifier"))) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build(), + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key2")) + .setFamilyName(StringValue.newBuilder().setValue("family")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("qualifier"))) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build()); + try (RowMergerUtil util = new RowMergerUtil()) { + assertThat(util.parseReadRowsResponses(responses)) + .containsExactly( + Row.create( + ByteString.copyFromUtf8("key"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.copyFromUtf8("qualifier"), + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value")))), + Row.create( + ByteString.copyFromUtf8("key2"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.copyFromUtf8("qualifier"), + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value"))))); + } + } + + @Test + public void testPartial() { + List responses = + ImmutableList.of( + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key")) + .setFamilyName(StringValue.newBuilder().setValue("family")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("qualifier"))) + .setTimestampMicros(1000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(false)) + .build()); + + RowMergerUtil util = new RowMergerUtil(); + util.parseReadRowsResponses(responses); + Assert.assertThrows(IllegalStateException.class, util::close); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java new file mode 100644 index 000000000000..26609216e68b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java @@ -0,0 +1,347 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.internal; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.RowSet; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowSetUtilTest { + @Test + public void testSplitFullScan() { + RowSet input = RowSet.getDefaultInstance(); + + RowSet right = RowSetUtil.erase(input, ByteString.copyFromUtf8("g"), true); + assertThat(right).isEqualTo(parse("(g-")); + + RowSet left = RowSetUtil.erase(input, ByteString.copyFromUtf8("g"), false); + assertThat(left).isEqualTo(parse("-g)")); + } + + @Test + public void testSplitAllLeft() { + RowSet input = parse("a,(a1-c),[a2-c),(a3-c),[a4-c)"); + RowSet left = RowSetUtil.erase(input, ByteString.copyFromUtf8("c"), false); + RowSet right = RowSetUtil.erase(input, ByteString.copyFromUtf8("c"), true); + + assertThat(left).isEqualTo(input); + assertThat(right).isNull(); + } + + @Test + public void testSplitAllRight() { + RowSet input = parse("a1,c,(a-c],[a2-c],(a3-c),[a4-c)"); + + assertThat(RowSetUtil.erase(input, ByteString.copyFromUtf8("a"), true)).isEqualTo(input); + assertThat(RowSetUtil.erase(input, ByteString.copyFromUtf8("a"), false)).isNull(); + } + + @Test + public void testSplit() { + RowSet input = parse("a1,c,(a1-c],[a2-c],(a3-c),[a4-c),[b-z],(b-y]"); + + RowSet before = RowSetUtil.erase(input, ByteString.copyFromUtf8("b"), false); + RowSet after = RowSetUtil.erase(input, ByteString.copyFromUtf8("b"), true); + + assertThat(before).isEqualTo(parse("a1,(a1-b),[a2-b),(a3-b),[a4-b)")); + assertThat(after).isEqualTo(parse("c,(b-c],(b-c],(b-c),(b-c),(b-z],(b-y]")); + } + + @Test + public void testShardNoop() { + assertShardNoSplit("a,[p-q)"); + assertShardNoSplit("0_key,[1_range_start-2_range_end)", "3_split"); + assertShardNoSplit("-1_range_end)", "5_split"); + assertShardNoSplit("0_key,[1_range_start-2_range_end)", "2_range_end"); + assertShardNoSplit("9_row_key,(5_range_start-7_range_end)", "3_split"); + assertShardNoSplit("(5_range_start-", "3_split"); + assertShardNoSplit("3_split,[3_split-5_split)", "3_split", "5_split"); + assertShardNoSplit("[3_split-", "3_split"); + } + + private static void assertShardNoSplit(String rowStr, String... splits) { + RowSet input = parse(rowStr); + + assertThat(RowSetUtil.shard(input, splitPoints(splits))).containsExactly(input); + } + + @Test + public void testShardFullTableScan() { + RowSet input = RowSet.getDefaultInstance(); + SortedSet splitPoints = splitPoints("a"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("-a)"), parse("[a-")) + .inOrder(); + } + + @Test + public void testShardMultipleKeys() { + RowSet input = parse("1_beforeSplit,2_onSplit,3_afterSplit"); + SortedSet splitPoints = splitPoints("2_onSplit"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("1_beforeSplit"), parse("2_onSplit,3_afterSplit")) + .inOrder(); + } + + @Test + public void testShardKeysEmptyLeft() { + RowSet input = parse("5_test,8_test"); + SortedSet splitPoints = splitPoints("0_split", "6-split"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("5_test"), parse("8_test")) + .inOrder(); + } + + @Test + public void testShardKeysEmptyRight() { + RowSet input = parse("0_test,2_test"); + SortedSet splitPoints = splitPoints("1_split", "5_split"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("0_test"), parse("2_test")) + .inOrder(); + } + + @Test + public void testShardMixedSplit() { + RowSet input = parse("0,a,c,-a],-b],(c-e],(d-f],(m-"); + SortedSet splitPoints = splitPoints("a", "d", "j", "o"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly( + parse("0,-a)"), + parse("a,c,[a-a],-b],(c-d)"), + parse("[d-e],(d-f]"), + parse("(m-o)"), + parse("[o-")) + .inOrder(); + } + + @Test + public void testShardUnsortedRequest() { + RowSet input = + parse( + "7_row_key_1,2_row_key_2,[8_range_1_start-9_range_1_end),[3_range_2_start-4_range_2_end)"); + SortedSet splitPoints = splitPoints("5-split"); + + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly( + parse("2_row_key_2,[3_range_2_start-4_range_2_end)"), + parse("7_row_key_1,[8_range_1_start-9_range_1_end)")) + .inOrder(); + } + + private static SortedSet splitPoints(String... s) { + + return Arrays.stream(s) + .map(ByteString::copyFromUtf8) + .collect(Collectors.toCollection(() -> new TreeSet<>(ByteStringComparator.INSTANCE))); + } + + private static RowSet parse(String encodedRowSet) { + RowSet.Builder builder = RowSet.newBuilder(); + + for (String s : Splitter.on(",").split(encodedRowSet)) { + if (s.contains("-")) { + builder.addRowRanges(parseRange(s)); + } else { + builder.addRowKeys(ByteString.copyFromUtf8(s)); + } + } + return builder.build(); + } + + private static RowRange parseRange(String s) { + String[] parts = s.split("-", 2); + Preconditions.checkArgument(parts.length == 2, "Ranges must have exactly 2 parts: " + s); + + RowRange.Builder builder = RowRange.newBuilder(); + + String encodedStart = parts[0]; + if ("".equals(encodedStart)) { + // noop - start key unset + } else if (encodedStart.startsWith("(")) { + String value = encodedStart.substring(1); + builder.setStartKeyOpen(ByteString.copyFromUtf8(value)); + } else if (encodedStart.startsWith("[")) { + String value = encodedStart.substring(1); + builder.setStartKeyClosed(ByteString.copyFromUtf8(value)); + } else { + throw new IllegalArgumentException("unexpected range start format"); + } + + String encodedEnd = parts[1]; + if (encodedEnd.isEmpty()) { + // noop - end key unset + } else if (encodedEnd.endsWith(")")) { + String value = encodedEnd.substring(0, encodedEnd.length() - 1); + builder.setEndKeyOpen(ByteString.copyFromUtf8(value)); + } else if (encodedEnd.endsWith("]")) { + String value = encodedEnd.substring(0, encodedEnd.length() - 1); + builder.setEndKeyClosed(ByteString.copyFromUtf8(value)); + } else { + throw new IllegalArgumentException("unexpected range end format"); + } + return builder.build(); + } + + @Test + public void emptyBoundTest() { + RowSet rowSet = RowSet.getDefaultInstance(); + + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded()); + } + + @Test + public void singleKeyBoundTest() { + RowSet rowSet = RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("a")).build(); + + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startClosed("a").endClosed("a")); + } + + @Test + public void multiKeyBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowKeys(ByteString.copyFromUtf8("a")) + .addRowKeys(ByteString.copyFromUtf8("d")) + .build(); + + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startClosed("a").endClosed("d")); + } + + @Test + public void singleClosedClosedRangeBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyClosed(ByteString.copyFromUtf8("b"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startClosed("a").endClosed("b")); + } + + @Test + public void singleClosedOpenRangeBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("b"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startClosed("a").endOpen("b")); + } + + @Test + public void singleOpenOpenRangeBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("b"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startOpen("a").endOpen("b")); + } + + @Test + public void singleRangeOpenClosedBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("a")) + .setEndKeyClosed(ByteString.copyFromUtf8("b"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startOpen("a").endClosed("b")); + } + + @Test + public void singleRangeUnbounded1BoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges(RowRange.newBuilder().setStartKeyClosed(ByteString.copyFromUtf8("a"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().startClosed("a")); + } + + @Test + public void singleRangeUnbounded2BoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("z"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.unbounded().endClosed("z")); + } + + @Test + public void multipleRangeBoundTest() { + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("m"))) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("q")) + .setEndKeyOpen(ByteString.copyFromUtf8("z"))) + .build(); + ByteStringRange actual = RowSetUtil.getBound(rowSet); + assertThat(actual).isEqualTo(ByteStringRange.create("a", "z")); + } + + @Test + public void eraseLargeRowEmptyRangeTest() { + ByteString key = ByteString.copyFromUtf8("a"); + ByteString keyTrailer = key.concat(ByteString.copyFrom(new byte[] {0})); + + RowSet rowSet = + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder().setStartKeyClosed(key).setEndKeyOpen(keyTrailer).build()) + .build(); + RowSet actual = RowSetUtil.eraseLargeRow(rowSet, key); + assertThat(actual).isNull(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java new file mode 100644 index 000000000000..3de98211479f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java @@ -0,0 +1,212 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSets; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ColumnMetadata; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SqlRowMergerUtilTest { + + @Test + public void close_succeedsWhenEmpty() { + com.google.bigtable.v2.ResultSetMetadata md = metadata(columnMetadata("a", stringType())); + try (SqlRowMergerUtil util = new SqlRowMergerUtil(md)) {} + + try (SqlRowMergerUtil util = new SqlRowMergerUtil(md)) { + // Metadata with no rows + List unused = util.parseExecuteQueryResponses(ImmutableList.of()); + } + } + + @Test + public void parseExecuteQueryResponses_handlesSingleValue_serializedProtoRows() { + com.google.bigtable.v2.ResultSetMetadata metadata = + metadata(columnMetadata("str", stringType())); + ImmutableList responses = + ImmutableList.of(partialResultSetWithToken(stringValue("val"))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil(metadata)) { + List rows = util.parseExecuteQueryResponses(responses); + assertThat(rows) + .containsExactly( + ProtoSqlRow.create( + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("str", stringType()))), + ImmutableList.of(stringValue("val")))); + ; + } + } + + @Test + public void + parseExecuteQueryResponses_handlesMultipleValuesAcrossMultipleRows_serializedProtoRows() { + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("map", mapType(stringType(), bytesType())) + }; + com.google.bigtable.v2.ResultSetMetadata metadataProto = metadata(columns); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataProto); + ImmutableList responses = + partialResultSets( + 3, + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))), + stringValue("str2"), + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2"))), + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3")))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil(metadataProto)) { + List rows = util.parseExecuteQueryResponses(responses); + assertThat(rows) + .containsExactly( + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))))), + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str2"), + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2"))))), + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3")))))); + } + } + + @Test + public void parseExecuteQueryResponses_throwsOnCloseWithPartialBatch_serializedProtoRows() { + com.google.bigtable.v2.ResultSetMetadata metadata = + metadata(columnMetadata("str", stringType())); + ImmutableList responses = + ImmutableList.of(partialResultSetWithoutToken(stringValue("str1"))); + + SqlRowMergerUtil util = new SqlRowMergerUtil(metadata); + List unused = util.parseExecuteQueryResponses(responses); + assertThrows(IllegalStateException.class, util::close); + } + + @Test + public void + parseExecuteQueryResponses_throwsOnParseWithPartialRowsInCompleteBatch_serializedProtoRows() { + com.google.bigtable.v2.ResultSetMetadata metadata = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + ImmutableList responses = + ImmutableList.of( + partialResultSetWithToken( + stringValue("str1"), bytesValue("bytes1"), stringValue("str2"))); + + SqlRowMergerUtil util = new SqlRowMergerUtil(metadata); + assertThrows(IllegalStateException.class, () -> util.parseExecuteQueryResponses(responses)); + } + + @Test + public void parseExecuteQueryResponses_worksWithIncrementalSetsOfResponses_serializedProtoRows() { + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("map", mapType(stringType(), bytesType())) + }; + com.google.bigtable.v2.ResultSetMetadata metadataProto = metadata(columns); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataProto); + ImmutableList responses = + partialResultSets( + 3, + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))), + stringValue("str2"), + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2"))), + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3")))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil(metadataProto)) { + List rows = new ArrayList<>(); + rows.addAll(util.parseExecuteQueryResponses(responses.subList(0, 1))); + rows.addAll(util.parseExecuteQueryResponses(responses.subList(1, 2))); + rows.addAll(util.parseExecuteQueryResponses(responses.subList(2, 3))); + + assertThat(rows) + .containsExactly( + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))))), + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str2"), + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2"))))), + ProtoSqlRow.create( + metadata, + ImmutableList.of( + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3")))))); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java new file mode 100644 index 000000000000..de88a9c8f42a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java @@ -0,0 +1,38 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.internal; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import javax.annotation.Nullable; + +/** Truth subject for {@link ProtoSqlRow}. Intended for ease-of-use in testing. */ +public final class SqlRowSubject extends Subject { + + private SqlRowSubject(FailureMetadata metadata, @Nullable SqlRow actual) { + super(metadata, actual); + } + + public static Factory sqlRow() { + return SqlRowSubject::new; + } + + public static SqlRowSubject assertThat(@Nullable SqlRow actual) { + return assertAbout(sqlRow()).that(actual); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtilTest.java new file mode 100644 index 000000000000..5c6dac76323c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtilTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.protobuf.Timestamp; +import java.time.Instant; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TimestampUtilTest { + + @Test + public void testToInstant() { + assertThat(TimestampUtil.toInstant(Timestamp.getDefaultInstance())) + .isEqualTo(Instant.ofEpochSecond(0)); + assertThat(TimestampUtil.toInstant(Timestamp.newBuilder().setSeconds(1000).build())) + .isEqualTo(Instant.ofEpochSecond(1000)); + assertThat( + TimestampUtil.toInstant(Timestamp.newBuilder().setSeconds(2000).setNanos(3000).build())) + .isEqualTo(Instant.ofEpochSecond(2000, 3000)); + assertThat(TimestampUtil.toInstant(Timestamp.newBuilder().setNanos(3000).build())) + .isEqualTo(Instant.ofEpochSecond(0, 3000)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java new file mode 100644 index 000000000000..4d706ef29088 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class AuthorizedViewNameTest { + + @Test + public void testParseOk() { + String name = "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v"; + AuthorizedViewName parsed = AuthorizedViewName.parse(name); + + assertThat(parsed) + .isEqualTo( + AuthorizedViewName.builder() + .setProjectId("fake-p") + .setInstanceId("fake-i") + .setTableId("fake-t") + .setAuthorizedViewId("fake-v") + .build()); + } + + @Test + public void testParseFail() { + assertThrows(IllegalArgumentException.class, () -> AuthorizedViewName.parse("")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "project/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instance/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/table/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedView/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects//instances/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances//tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables//authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v/extra")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java new file mode 100644 index 000000000000..7a92e5eb608a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java @@ -0,0 +1,352 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Server; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientTest { + private ClientConfiguration defaultConfig; + + private ScheduledExecutorService executor; + private FakeBigtableService service; + private Server server; + private Client client; + private InstanceName instanceName = + InstanceName.parse("projects/fake-project/instances/fake-instance"); + + @BeforeEach + void setUp() throws IOException { + ClientConfiguration.Builder builder = ClientConfigurationManager.loadDefault().toBuilder(); + builder.setSessionConfiguration( + SessionClientConfiguration.newBuilder() + .setSessionLoad(1) + .setSessionPoolConfiguration( + SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + .setNewSessionCreationBudget(10) + .setNewSessionCreationPenalty(Durations.fromMinutes(1)) + .setHeadroom(0.5f) + .setMinSessionCount(5) + .setMaxSessionCount(20) + .setNewSessionQueueLength(10) + .setConsecutiveSessionFailureThreshold(10))); + defaultConfig = builder.build(); + + executor = Executors.newScheduledThreadPool(4); + service = new FakeBigtableService(); + server = FakeServiceBuilder.create(service).intercept(new PeerInfoInterceptor()).start(); + + ClientSettings settings = + ClientSettings.builder() + .setChannelProvider( + new ChannelProviders.EmulatorChannelProvider("localhost", server.getPort())) + .setInstanceName(instanceName) + .setAppProfileId("default") + .build(); + + client = Client.create(settings); + } + + @AfterEach + void tearDown() { + client.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void testRequestFails() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(), + Deadline.after(1, TimeUnit.MINUTES)); + + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("Session failed with consecutive failures"); + + table.close(); + } + + @Test + public void testDeadlineRespected() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(), + Deadline.after(10, TimeUnit.MILLISECONDS)); + + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("DEADLINE_EXCEEDED"); + + table.close(); + } + + @Test + public void testGrpcContextDeadlineRespected() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + + Context.current() + .withDeadline(Deadline.after(10, TimeUnit.MILLISECONDS), executor) + .run( + () -> { + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("key")) + .build(), + Deadline.after(1, TimeUnit.MINUTES)); + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("DEADLINE_EXCEEDED"); + }); + + table.close(); + } + + @Test + public void testOpenAuthorizedViewRequestSent() throws Exception { + AuthorizedViewAsync view = + client.openAuthorizedViewAsync( + "fake-table", "fake-view", OpenAuthorizedViewRequest.Permission.PERMISSION_READ); + + // wait for session to start + Thread.sleep(500); + + OpenAuthorizedViewRequest expectedPayload = + OpenAuthorizedViewRequest.newBuilder() + .setAuthorizedViewName( + AuthorizedViewName.builder() + .setProjectId(instanceName.getProjectId()) + .setInstanceId(instanceName.getInstanceId()) + .setTableId("fake-table") + .setAuthorizedViewId("fake-view") + .build() + .toString()) + .setAppProfileId("default") + .setPermission(OpenAuthorizedViewRequest.Permission.PERMISSION_READ) + .build(); + + assertThat(service.openSessionRequests.get(0).getOpenSession().getPayload()) + .isEqualTo(expectedPayload.toByteString()); + + SessionReadRowRequest read = + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(); + + CompletableFuture future1 = + view.readRow(read, Deadline.after(1, TimeUnit.MINUTES)); + + future1.get(); + + ByteString payload = service.vrpcRequests.get(0).getVirtualRpc().getPayload(); + assertThat(payload).isEqualTo(VRpcDescriptor.READ_ROW_AUTH_VIEW.encode(read)); + + SessionMutateRowRequest mutate = + SessionMutateRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("key")) + .addMutations( + Mutation.newBuilder().setDeleteFromRow(Mutation.DeleteFromRow.getDefaultInstance())) + .build(); + CompletableFuture future2 = + view.mutateRow(mutate, Deadline.after(1, TimeUnit.MINUTES)); + + future2.get(); + + payload = service.vrpcRequests.get(1).getVirtualRpc().getPayload(); + assertThat(payload).isEqualTo(VRpcDescriptor.MUTATE_ROW_AUTH_VIEW.encode(mutate)); + + view.close(); + } + + @Test + public void testMaterializedViewRequestSent() throws Exception { + MaterializedViewAsync view = + client.openMaterializedViewAsync( + "fake-view", OpenMaterializedViewRequest.Permission.PERMISSION_READ); + + // Wait for session to start + Thread.sleep(500); + + OpenMaterializedViewRequest expected = + OpenMaterializedViewRequest.newBuilder() + .setMaterializedViewName( + MaterializedViewName.builder() + .setProjectId(instanceName.getProjectId()) + .setInstanceId(instanceName.getInstanceId()) + .setMaterializedViewId("fake-view") + .build() + .toString()) + .setPermission(OpenMaterializedViewRequest.Permission.PERMISSION_READ) + .setAppProfileId("default") + .build(); + + assertThat(service.openSessionRequests.get(0).getOpenSession().getPayload()) + .isEqualTo(expected.toByteString()); + + SessionReadRowRequest read = + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(); + + CompletableFuture future = + view.readRow(read, Deadline.after(1, TimeUnit.MINUTES)); + + future.get(); + + assertThat(service.vrpcRequests.get(0).getVirtualRpc().getPayload()) + .isEqualTo(VRpcDescriptor.READ_ROW_MAT_VIEW.encode(read)); + + view.close(); + } + + class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + private final List openSessionRequests = new ArrayList<>(); + private final List vrpcRequests = new ArrayList<>(); + + @Override + public void getClientConfiguration( + GetClientConfigurationRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(defaultConfig); + responseObserver.onCompleted(); + } + + @Override + public StreamObserver openTable( + StreamObserver responseObserver) { + // Make openTable take a long time and return a noop which will cause the session creation to + // fail. + try { + Thread.sleep(10); + } catch (Exception e) { + // dont care + } + return super.openTable(responseObserver); + } + + @Override + public StreamObserver openAuthorizedView( + StreamObserver responseObserver) { + return new StreamObserver() { + @Override + public void onNext(SessionRequest sessionRequest) { + if (sessionRequest.hasOpenSession()) { + openSessionRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setOpenSession(OpenSessionResponse.getDefaultInstance()) + .build()); + } else if (sessionRequest.hasVirtualRpc()) { + vrpcRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(sessionRequest.getVirtualRpc().getRpcId()) + .build()) + .build()); + } + } + + @Override + public void onError(Throwable throwable) {} + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + } + + @Override + public StreamObserver openMaterializedView( + StreamObserver responseObserver) { + return new StreamObserver() { + @Override + public void onNext(SessionRequest sessionRequest) { + if (sessionRequest.hasOpenSession()) { + openSessionRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setOpenSession(OpenSessionResponse.getDefaultInstance()) + .build()); + } else if (sessionRequest.hasVirtualRpc()) { + vrpcRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(sessionRequest.getVirtualRpc().getRpcId()) + .build()) + .build()); + } + } + + @Override + public void onError(Throwable throwable) {} + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java new file mode 100644 index 000000000000..4a93ff70042d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class InstanceNameTest { + + @Test + void testParseOk() { + assertThat(InstanceName.parse("projects/my-project/instances/my-instance")) + .isEqualTo( + InstanceName.builder().setProjectId("my-project").setInstanceId("my-instance").build()); + } + + @Test + void testParseFail() { + assertThrows(IllegalArgumentException.class, () -> InstanceName.parse("")); + assertThrows(IllegalArgumentException.class, () -> InstanceName.parse("projects/my-project")); + assertThrows( + IllegalArgumentException.class, () -> TableName.parse("projects/my-project/instances")); + assertThrows( + IllegalArgumentException.class, + () -> InstanceName.parse("projects/my-project/instances/my-instance/extra")); + assertThrows( + IllegalArgumentException.class, + () -> InstanceName.parse("projects//instances/my-instance")); + assertThrows( + IllegalArgumentException.class, () -> InstanceName.parse("projects/my-project/instances/")); + assertThrows( + IllegalArgumentException.class, + () -> InstanceName.parse("projects/my-project/instances//")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java new file mode 100644 index 000000000000..4d46042c1625 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class MaterializedViewNameTest { + + @Test + public void testParseOk() { + String name = "projects/fake-p/instances/fake-i/materializedViews/fake-v"; + + assertThat(MaterializedViewName.parse(name)) + .isEqualTo( + MaterializedViewName.builder() + .setProjectId("fake-p") + .setInstanceId("fake-i") + .setMaterializedViewId("fake-v") + .build()); + } + + @Test + public void testParseError() { + assertThrows(IllegalArgumentException.class, () -> AuthorizedViewName.parse("")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("project/fake-p/instances/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instance/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances/fake-i/materializedView/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects//instances/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances//materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances/fake-i/materializedViews/")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/materializedViews/fake-v/extra")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java new file mode 100644 index 000000000000..54406abe51a8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java @@ -0,0 +1,213 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcCallContextSubject.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.protobuf.Message; +import io.grpc.Deadline; +import io.grpc.Metadata; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class TableBaseTest { + + private TableBase table; + private final FakeSessionPool fakeSessionPool = new FakeSessionPool(); + private final Metrics noopMetrics = new NoopMetrics(); + private final ScheduledExecutorService mockExecutor = + Mockito.mock(ScheduledExecutorService.class); + private static final ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName( + InstanceName.builder() + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build()) + .setAppProfileId("default") + .build(); + private Deadline deadline; + private UnaryResponseFuture f; + + @BeforeEach + public void setup() { + table = + new TableBase( + fakeSessionPool, + VRpcDescriptor.READ_ROW, + VRpcDescriptor.MUTATE_ROW, + noopMetrics, + mockExecutor); + deadline = Deadline.after(1, TimeUnit.MINUTES); + f = new UnaryResponseFuture<>(); + } + + @Test + public void testAddToCellNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setAddToCell(Mutation.AddToCell.getDefaultInstance()).build()) + .build(), + f, + deadline); + + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testMergeToCellNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setMergeToCell(Mutation.MergeToCell.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testSetCellSystemTimestampNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setSetCell(Mutation.SetCell.newBuilder().setTimestampMicros(-1).build())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testDeleteFromRowIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setDeleteFromRow(Mutation.DeleteFromRow.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testDeleteFromColumnIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setDeleteFromColumn(Mutation.DeleteFromColumn.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testDeleteFromCfIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setDeleteFromFamily(Mutation.DeleteFromFamily.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testSetCellIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations(Mutation.newBuilder().setSetCell(Mutation.SetCell.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + static class FakeSessionPool implements SessionPool { + + private FakeVRpc lastVRpc = null; + + @Override + public void start(OpenTableRequest openReq, Metadata md) {} + + @Override + public void close(CloseSessionRequest req) {} + + @Override + public SessionPoolInfo getInfo() { + return SessionPoolInfo.create(clientInfo, VRpcDescriptor.TABLE_SESSION, "fake-pool"); + } + + @Override + public VRpc newCall( + VRpcDescriptor desc) { + FakeVRpc localVRpc = new FakeVRpc<>(); + this.lastVRpc = localVRpc; + return localVRpc; + } + + @Override + public int getConsecutiveUnimplementedFailures() { + return 0; + } + + @Override + public boolean hasSession() { + return true; + } + } + + static class FakeVRpc implements VRpc { + private VRpcCallContext ctx; + + @Override + public void start(Object req, VRpcCallContext ctx, VRpcListener ignored) { + this.ctx = ctx; + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) {} + + @Override + public void requestNext() {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java new file mode 100644 index 000000000000..7a09185f3dce --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +class TableNameTest { + + @Test + void testParseOk() { + assertThat(TableName.parse("projects/my-project/instances/my-instance/tables/my-table")) + .isEqualTo( + TableName.builder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setTableId("my-table") + .build()); + } + + @Test + void testParseFail() { + assertThrows(IllegalArgumentException.class, () -> TableName.parse("")); + assertThrows(IllegalArgumentException.class, () -> TableName.parse("projects/my-project")); + assertThrows( + IllegalArgumentException.class, () -> TableName.parse("projects/my-project/instances")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects/my-project/instances/my-instance")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects/my-project/instances/my-instance/tables")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects/my-project/instances/my-instance/tables/my-table/extra")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects//instances/my-instance/tables")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects/my-project/instances//tables/my-table")); + assertThrows( + IllegalArgumentException.class, + () -> TableName.parse("projects/my-project/instances/my-instance/tables/")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java new file mode 100644 index 000000000000..b5e2de38fa34 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java @@ -0,0 +1,472 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream.Listener; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import io.grpc.Attributes; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Clock; +import java.time.Instant; +import java.util.Base64; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ChannelPoolDpImplTest { + @Mock private ScheduledExecutorService bgExecutor; + + @Mock private Supplier channelSupplier; + + @Mock private ClientCall clientCall; + + @Mock private ManagedChannel channel; + + @Captor private ArgumentCaptor> listener; + + private final DebugTagTracer debugTagTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + + private static final ChannelPoolConfiguration defaultConfig = + ChannelPoolConfiguration.newBuilder() + .setMinServerCount(2) + .setMaxServerCount(25) + .setPerServerSessionCount(10) + .build(); + + @Test + void testInitialService() { + when(channelSupplier.get()).thenReturn(channel); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + pool.serviceChannels(); + + verify(channelSupplier, times(pool.minGroups)).get(); + + pool.close(); + } + + @Test + void testNewStreamStartsASingleChannel() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + SessionStream ignored = + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + + // Only 1 channel created + verify(channelSupplier, times(1)).get(); + // And that channel was asked to create a new session + verify(channel, times(1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testSecondChannelCreatedWhenFirstIsFull() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // Starting channels are half-filled. + for (int i = 0; i < pool.softMaxPerGroup / 2; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + } + // Only 1 channel created. + verify(channelSupplier, times(1)).get(); + // And that channel was asked to create all the sessions on until max + verify(channel, times(pool.softMaxPerGroup / 2)).newCall(any(), any()); + + // Next call triggers creation of a new channel. + ManagedChannel otherChannel = Mockito.mock(ManagedChannel.class); + doReturn(otherChannel).when(channelSupplier).get(); + when(otherChannel.newCall(any(), any())).thenReturn(clientCall); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + verify(channelSupplier, times(2)).get(); + verify(otherChannel, times(1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testClosingASessionFreesASlot() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // fill up the channel + for (int i = 0; i < pool.softMaxPerGroup / 2; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + // release one session + ClientCall.Listener value = listener.getValue(); + value.onClose(Status.OK, new Metadata()); + + // next call should not trigger creation of another channel + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // So invocation count should stay at 1 from the first channel + verify(channelSupplier, times(1)).get(); + + pool.close(); + } + + @Test + void testLeastLoadedChannelGetsNext() { + ManagedChannel channel1 = mock(ManagedChannel.class); + when(channel1.newCall(any(), any())).thenReturn(clientCall); + + ManagedChannel channel2 = mock(ManagedChannel.class); + when(channel2.newCall(any(), any())).thenReturn(clientCall); + + when(channelSupplier.get()).thenReturn(channel1, channel2); + doNothing().when(clientCall).start(listener.capture(), any()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // fill up 2 channels + for (int i = 0; i < pool.softMaxPerGroup; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + verify(channelSupplier, times(2)).get(); + + List> allListeners = listener.getAllValues(); + + // release one session + allListeners.get(0).onClose(Status.OK, new Metadata()); + + // next call should be created on the first channel + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // Now the first channel has an extra call + verify(channel1, times(pool.softMaxPerGroup / 2 + 1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testDownsize() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + Clock clock = Mockito.mock(Clock.class); + when(clock.instant()).thenReturn(Instant.now()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl( + channelSupplier, defaultConfig, "pool", debugTagTracer, bgExecutor, clock); + + int numChannels = 5; + int numSessions = numChannels * pool.softMaxPerGroup / 2; + + for (int i = 0; i < numSessions; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + verify(channelSupplier, times(numChannels)).get(); + + int i = 0; + // Start and finish all sessions. + for (ClientCall.Listener listener : listener.getAllValues()) { + // Afe Id of 0 creates an empty protobuf which does not get picks up in + // onHeaders, this is why we start with 555. + PeerInfo peerInfo = + PeerInfo.newBuilder().setApplicationFrontendId(555 + i / numChannels).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + listener.onHeaders(headers); + i++; + listener.onClose(Status.OK, new Metadata()); + } + + when(clock.instant()).thenReturn(Instant.now()); + pool.serviceChannels(); + verify(channel, times(numChannels - pool.minGroups)).shutdown(); + + pool.close(); + } + + @Test + void testDownsizeToOptimal() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + Clock clock = Mockito.mock(Clock.class); + when(clock.instant()).thenReturn(Instant.now()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl( + channelSupplier, defaultConfig, "pool", debugTagTracer, bgExecutor, clock); + + int numChannels = 5; + int numSessions = numChannels * pool.softMaxPerGroup / 2; + + for (int i = 0; i < numSessions; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + verify(channelSupplier, times(numChannels)).get(); + + int i = 0; + // Start all sessions. + for (ClientCall.Listener listener : listener.getAllValues()) { + // Afe Id of 0 creates an empty protobuf which does not get picks up in + // onHeaders, this is why we start with 555. + PeerInfo peerInfo = + PeerInfo.newBuilder().setApplicationFrontendId(555 + i / numChannels).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + listener.onHeaders(headers); + i++; + } + + // Now we have 25 sessions on 5 channel groups each of 1 channel. + // Let's close 6 sessions from different channels/AFEs. + i = 0; + for (ClientCall.Listener listener : listener.getAllValues()) { + if (i % 4 == 0 && i != 0) { + listener.onClose(Status.OK, new Metadata()); + } + i++; + } + + // Now we should have 19 sessions on 5 channel groups each of 1 channel. + // I.e. dumpState + // FINE: ChannelPool channelGroups: 5, channels: 5, starting channels: 0, totalStreams: 19, + // AFEs: 5, distribution: [4, 4, 4, 4, 3] + when(clock.instant()).thenReturn(Instant.now()); + pool.serviceChannels(); + + // Should scale down to 4 channels. 19 / 5 round up = 4. + verify(channel, times(numChannels - 4)).shutdown(); + + pool.close(); + } + + @Test + void testRecycleChannelOnUnimplemented() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // Only 1 channel created initially + verify(channelSupplier, times(1)).get(); + + // Release with UNIMPLEMENTED status + ClientCall.Listener value = listener.getValue(); + value.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // The channel should be shutdown + verify(channel, times(1)).shutdown(); + + // And a new channel should be requested from the supplier + verify(channelSupplier, times(2)).get(); + + pool.close(); + } + + @Test + void testRecycleChannelInGroupOnUnimplemented() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + ClientCall.Listener value = listener.getValue(); + + // Assign to a group by providing AFE ID + PeerInfo peerInfo = PeerInfo.newBuilder().setApplicationFrontendId(555).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + value.onHeaders(headers); + + // This call is successful + value.onClose(Status.OK, new Metadata()); + + // Another call + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + value = listener.getValue(); + + // Release with UNIMPLEMENTED status + value.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // The channel should be shutdown + verify(channel, times(1)).shutdown(); + + // And a new channel should be requested from the supplier + verify(channelSupplier, times(2)).get(); + + pool.close(); + } + + @Test + void testDoubleRecycleCreatesExtraChannel() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // Create 2 streams on the same channel + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // Initially 1 channel + verify(channelSupplier, times(1)).get(); + + // Trigger first recycle via first stream + ClientCall.Listener listener1 = listener.getAllValues().get(0); + listener1.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // Channel should be recycled (shutdown + addChannel) + verify(channel, times(1)).shutdown(); + // Now isShutdown returns true for the channel + when(channel.isShutdown()).thenReturn(true); + verify(channelSupplier, times(2)).get(); + + // Trigger second recycle via second stream on the SAME (already recycled) channel + ClientCall.Listener listener2 = listener.getAllValues().get(1); + listener2.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // BUG: This should NOT cause another addChannel() or shutdown() + // If it fails, times(3) will be true. + verify(channelSupplier, times(2)).get(); + verify(channel, times(1)).shutdown(); + + pool.close(); + } + + @Test + void testRecycledChannelDoesNotRejoinPool() throws InterruptedException { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // 1. Create stream1 on channel1 + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // 2. Create stream2 on channel1 to trigger recycle + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + ClientCall.Listener listener1 = listener.getAllValues().get(0); + ClientCall.Listener listener2 = listener.getAllValues().get(1); + + // Prepare channel2 that will be picked up by addChannel during recycling + ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); + when(channelSupplier.get()).thenReturn(channel2); + when(channel2.newCall(any(), any())).thenReturn(clientCall); + + // 3. Recycle channel1 via stream2 + listener2.onClose(Status.UNIMPLEMENTED, new Metadata()); + verify(channel, times(1)).shutdown(); + // Now isShutdown for the channel1 returns true + when(channel.isShutdown()).thenReturn(true); + + // 4. stream1 (on recycled channel1) receives headers with AFE ID + // This triggers rehomeChannel + PeerInfo peerInfo = PeerInfo.newBuilder().setApplicationFrontendId(555).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + listener1.onHeaders(headers); + + // 5. Try to create a new stream. + // It should NOT pick channel1 because it's recycled/shutdown. + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + + // BUG: If channel1 was re-added to a group, the picker might have picked it. + // channel.newCall was called 2 times (steps 1 and 2). It should NOT be called a 3rd time. + verify(channel, times(2)).newCall(any(), any()); + // Instead, it should be called on channel2 + verify(channel2, times(1)).newCall(any(), any()); + + pool.close(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java new file mode 100644 index 000000000000..08aa7b3afe1f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java @@ -0,0 +1,365 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.channels; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.lenient; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream.Listener; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import io.grpc.CallOptions; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class FallbackChannelPoolTest { + @Mock private ChannelPool primary; + @Mock private ChannelPool secondary; + @Mock private ScheduledExecutorService exec; + @Mock private ScheduledFuture future; + @Mock private SessionStream primaryStream; + @Mock private SessionStream secondaryStream; + @Mock private Listener listener; + @Captor ArgumentCaptor listenerCaptor; + private Map invocationCount; + + private static final MethodDescriptor methodDescriptor = + FakeSessionGrpc.getOpenSessionMethod(); + + private FallbackConfiguration config; + private FallbackChannelPool pool; + private Runnable checkTask; + private Metrics metrics; + + @BeforeEach + void setUp() { + invocationCount = new HashMap<>(); + config = + FallbackConfiguration.builder() + .setEnabled(true) + .setErrorRate(0.5) + .setCheckInterval(Duration.ofSeconds(10)) + .setPrimary("Primary", primary) + .setFallback("Fallback", secondary) + .build(); + + // Capture the runnable passed to schedule + when(exec.schedule(any(Runnable.class), anyLong(), any(TimeUnit.class))) + .thenAnswer( + invocation -> { + checkTask = invocation.getArgument(0); + return future; + }); + + lenient().when(primary.newStream(any(), any())).thenReturn(primaryStream); + lenient().when(secondary.newStream(any(), any())).thenReturn(secondaryStream); + + metrics = new NoopMetrics(); + pool = new FallbackChannelPool(config, metrics.getPoolFallbackListener(), exec); + } + + @AfterEach + void tearDown() { + pool.close(); + metrics.close(); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation. + private Listener openSessionGetListener(SessionStream stream) { + Integer count = invocationCount.getOrDefault(stream, 0); + count++; + invocationCount.put(stream, count); + + SessionStream s = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + s.start(listener, new Metadata()); + verify(stream, times(count)).start(listenerCaptor.capture(), any()); + return listenerCaptor.getValue(); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation and + // opens session successfully. + private void openSessionSuccessfully(SessionStream stream) { + openSessionGetListener(stream).onBeforeSessionStart(PeerInfo.getDefaultInstance()); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation and + // terminates the call with the `status`. + private void openSessionWithError(SessionStream stream, Status status) { + openSessionGetListener(stream).onClose(status, new Metadata()); + } + + @Test + void testLifecycle() { + pool.start(); + verify(primary).start(); + verify(secondary).start(); + verify(exec) + .schedule( + any(Runnable.class), + eq(config.getCheckInterval().toMillis()), + eq(TimeUnit.MILLISECONDS)); + + pool.close(); + verify(primary).close(); + verify(secondary).close(); + verify(future).cancel(false); + } + + @Test + void testRoutesToPrimaryByDefault() { + pool.start(); + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + + verify(primary).newStream(any(), any()); + verify(secondary, never()).newStream(any(), any()); + + // Verify delegation + stream.sendMessage(null); + verify(primaryStream).sendMessage(null); + } + + @Test + void testFallbackTrigger() { + pool.start(); + + // 1. Success + openSessionSuccessfully(primaryStream); + + // 2. Failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + // Current stats: 1 success, 1 failure. Total 2. Rate 0.5. + // Config error rate is 0.5. So 0.5 >= 0.5 is true. Should switch. + + checkTask.run(); // Execute check + + // Next stream should go to secondary + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + + // Verify delegation + stream.sendMessage(null); + verify(secondaryStream).sendMessage(null); + } + + @Test + void testForceCloseDoesNotCountAsFailure() { + pool.start(); + + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + stream.start(listener, new Metadata()); + + verify(primaryStream).start(listenerCaptor.capture(), any()); + Listener primaryListener = listenerCaptor.getValue(); + primaryListener.onBeforeSessionStart(PeerInfo.getDefaultInstance()); + + stream.forceClose("test", null); + primaryListener.onClose(Status.CANCELLED, new Metadata()); + + // 1 success, 0 failure (ignored). + // Should not fallback. + + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + } + + @Test + void testPeerInfoIgnoresFailures() { + pool.start(); + + Listener primaryListener = openSessionGetListener(primaryStream); + primaryListener.onBeforeSessionStart(PeerInfo.getDefaultInstance()); + + primaryListener.onClose(Status.UNAVAILABLE, new Metadata()); + + // 1 success, 0 failure (ignored). + // Should not fallback. + + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + } + + @Test + void testStartExceptionCountsAsFailure() { + doThrow(new RuntimeException("boom")).when(primaryStream).start(any(), any()); + + pool.start(); + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + + try { + stream.start(listener, new Metadata()); + } catch (RuntimeException e) { + // expected + } + + // 1 failure. Rate 1.0 > 0.5. + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testUpdateConfigChangesInterval() { + pool.start(); + verify(exec) + .schedule( + any(Runnable.class), + eq(config.getCheckInterval().toMillis()), + eq(TimeUnit.MILLISECONDS)); + + Duration newInterval = Duration.ofSeconds(20); + FallbackConfiguration newConfig = config.toBuilder().setCheckInterval(newInterval).build(); + pool.updateConfig(newConfig); + + // checkTask.run() should reschedule with the new interval + checkTask.run(); + verify(exec) + .schedule(any(Runnable.class), eq(newInterval.toMillis()), eq(TimeUnit.MILLISECONDS)); + } + + @Test + void testUpdateConfigDisablesFallback() { + pool.start(); + // Trigger fallback + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + checkTask.run(); // Now using secondary + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + + // Disable fallback + FallbackConfiguration disabledConfig = config.toBuilder().setEnabled(false).build(); + pool.updateConfig(disabledConfig); + + // Should switch back to primary + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(primary, times(2)).newStream(any(), any()); + + // Even with failures, should not switch to secondary anymore + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + checkTask.run(); + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, times(1)).newStream(any(), any()); // Still 1 from before + } + + @Test + void testUpdateConfigChangesErrorRate() { + pool.start(); + // One failure and one success = 50% + openSessionWithError(primaryStream, Status.UNAVAILABLE); + openSessionSuccessfully(primaryStream); + + // Update error rate to be higher + FallbackConfiguration newConfig = config.toBuilder().setErrorRate(0.6).build(); + pool.updateConfig(newConfig); + + checkTask.run(); + // 0.5 < 0.6, so should NOT switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + + // Update to a lower error rate + newConfig = config.toBuilder().setErrorRate(0.5).build(); + pool.updateConfig(newConfig); + + // One failure and one success = 50% + openSessionWithError(primaryStream, Status.UNAVAILABLE); + openSessionSuccessfully(primaryStream); + + checkTask.run(); + // 0.5 >= 0.5, so should switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testUpdateConfigEnablesFallback() { + FallbackConfiguration disabledConfig = config.toBuilder().setEnabled(false).build(); + pool = new FallbackChannelPool(disabledConfig, metrics.getPoolFallbackListener(), exec); + + pool.start(); + // Primary failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + // Current error rate 1.0 + + checkTask.run(); + // Fallback is disabled, should NOT switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + + // Update config to enable fallback + FallbackConfiguration newConfig = config.toBuilder().setEnabled(true).build(); + pool.updateConfig(newConfig); + + // Primary failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + // Current error rate 1.0 + + checkTask.run(); + // 1.0 > 0.5, so should switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testRescheduleAfterCheck() { + pool.start(); + verify(exec, times(1)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + + checkTask.run(); + verify(exec, times(2)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + + checkTask.run(); + verify(exec, times(3)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java new file mode 100644 index 000000000000..92c43430e067 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.compat; + +import static com.google.common.truth.Truth.assertWithMessage; + +import io.grpc.Context; +import io.grpc.Context.CancellableContext; +import java.util.concurrent.CompletableFuture; +import org.junit.jupiter.api.Test; + +class FutureAdapterTest { + @Test + void testCancellation() { + CompletableFuture inner = new CompletableFuture<>(); + CancellableContext cancellableContext = Context.current().withCancellation(); + FutureAdapter f = new FutureAdapter<>(inner, cancellableContext); + f.cancel(true); + + assertWithMessage("Inner future should be cancelled").that(inner.isCancelled()).isTrue(); + + assertWithMessage("gRPC context is cancelled").that(cancellableContext.isCancelled()).isTrue(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java new file mode 100644 index 000000000000..2f157180faef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java @@ -0,0 +1,805 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import static com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator.FailureReason.UNKNOWN; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; + +import com.google.api.Distribution; +import com.google.api.MonitoredResource; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtableCloudMonitoringExporter; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration.SessionCloseVRpcState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings.LoadBalancingStrategy; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.MetricServiceSettings; +import com.google.common.base.Function; +import com.google.common.collect.ImmutableMap; +import com.google.common.truth.Correspondence; +import com.google.common.truth.Truth; +import com.google.monitoring.v3.CreateTimeSeriesRequest; +import com.google.monitoring.v3.MetricServiceGrpc.MetricServiceImplBase; +import com.google.monitoring.v3.Point; +import com.google.monitoring.v3.TimeSeries; +import com.google.monitoring.v3.TypedValue; +import com.google.protobuf.Empty; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.stub.StreamObserver; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class MetricRegistryExportTest { + private static final InstanceName INSTANCE_NAME = InstanceName.of("my-project", "my-instance"); + private static final String appProfileId = "my-app-profile"; + private static final String tableId = "my-table"; + private static final String clusterId = "my-cluster"; + private static final String clusterZone = "us-east1-b"; + + private Server server; + private FakeMetricService metricService; + private ManagedChannel fakeServiceChannel; + + private PeriodicMetricReader metricReader; + private SdkMeterProvider meterProvider; + private MetricRegistry metricRegistry; + private RecorderRegistry registry; + + private EnvInfo envInfo; + private ClientInfo clientInfo = + ClientInfo.builder().setInstanceName(INSTANCE_NAME).setAppProfileId(appProfileId).build(); + private SessionPoolInfo poolInfo; + private MethodInfo methodInfo; + private ClusterInformation clusterInfo; + private PeerInfo peerInfo; + + private MonitoredResource expectedTableMonitoredResource; + private MonitoredResource expectedClientMonitoredResource; + + @BeforeEach + void setUp() throws Exception { + metricService = new FakeMetricService(); + server = FakeServiceBuilder.create(metricService).start(); + + envInfo = + EnvInfo.builder() + .setPlatform("gcp_compute_engine") + .setProject("my-client-project") + .setRegion("us-east1") + .setHostId("123456") + .setHostName("my-vm") + .build(); + + poolInfo = SessionPoolInfo.create(clientInfo, VRpcDescriptor.TABLE_SESSION, tableId); + + fakeServiceChannel = + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); + + metricRegistry = new MetricRegistry(); + + MetricServiceClient metricClient = + MetricServiceClient.create( + MetricServiceSettings.newBuilder() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(fakeServiceChannel))) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build()); + BigtableCloudMonitoringExporter exporter = + new BigtableCloudMonitoringExporter( + metricRegistry, () -> envInfo, clientInfo, metricClient); + metricReader = PeriodicMetricReader.create(exporter); + meterProvider = SdkMeterProvider.builder().registerMetricReader(metricReader).build(); + + registry = metricRegistry.newInternalRecorderRegistry(meterProvider); + + methodInfo = MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + + clusterInfo = + ClusterInformation.newBuilder().setZoneId(clusterZone).setClusterId(clusterId).build(); + peerInfo = + PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_CLOUD_PATH) + .setGoogleFrontendId(123) + .setApplicationFrontendRegion("us-east1") + .setApplicationFrontendSubzone("ab") + .build(); + + expectedTableMonitoredResource = + MonitoredResource.newBuilder() + .setType("bigtable_client_raw") + .putLabels("project_id", clientInfo.getInstanceName().getProjectId()) + .putLabels("instance", clientInfo.getInstanceName().getInstanceId()) + .putLabels("cluster", clusterInfo.getClusterId()) + .putLabels("table", tableId) + .putLabels("zone", clusterInfo.getZoneId()) + .build(); + + expectedClientMonitoredResource = + MonitoredResource.newBuilder() + .setType("bigtable_client") + .putLabels("project_id", clientInfo.getInstanceName().getProjectId()) + .putLabels("instance", clientInfo.getInstanceName().getInstanceId()) + .putLabels("app_profile", appProfileId) + .putLabels("client_project", envInfo.getProject()) + .putLabels("region", envInfo.getRegion()) + .putLabels("cloud_platform", envInfo.getPlatform()) + .putLabels("host_id", envInfo.getHostId()) + .putLabels("host_name", envInfo.getHostName()) + .putLabels("client_name", clientInfo.getClientName()) + .putLabels("uuid", envInfo.getUid()) + .build(); + } + + @AfterEach + void tearDown() { + meterProvider.close(); + fakeServiceChannel.shutdown(); + server.shutdownNow(); + } + + @Test + void testOpLatency() { + registry.operationLatency.record( + clientInfo, + tableId, + methodInfo, + clusterInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/operation_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName(), + "streaming", Boolean.toString(methodInfo.getStreaming())); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testAttemptLatency() { + registry.attemptLatency.record( + clientInfo, + tableId, + clusterInfo, + methodInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/attempt_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName(), + "streaming", Boolean.toString(methodInfo.getStreaming())); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testAttemptLatency2() { + registry.attemptLatency2.record( + clientInfo, + tableId, + peerInfo, + clusterInfo, + methodInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/attempt_latencies2"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "transport_type", "session_cloudpath", + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "transport_region", Util.formatTransportRegion(peerInfo), + "transport_zone", "", + "transport_subzone", peerInfo.getApplicationFrontendSubzone(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName(), + "streaming", Boolean.toString(methodInfo.getStreaming())); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testRetryCount() { + registry.retryCount.record( + clientInfo, tableId, methodInfo, clusterInfo, Status.UNAVAILABLE.getCode(), 1); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/retry_count"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName()); + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder().setValue(TypedValue.newBuilder().setInt64Value(1)).build()); + } + + @Test + void testFirstByteLatency() { + registry.firstResponseLantency.record( + clientInfo, + tableId, + methodInfo, + clusterInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/first_response_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName()); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testServerLatencies() { + registry.serverLatency.record( + clientInfo, + tableId, + methodInfo, + clusterInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/server_latencies"); + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName(), + "streaming", Boolean.toString(methodInfo.getStreaming())); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testChannelPoolOutstandingRpcs() { + registry.channelPoolOutstandingRpcs.record( + clientInfo, + peerInfo.getTransportType(), + LoadBalancingStrategy.POWER_OF_TWO_LEAST_IN_FLIGHT, + true, + 1); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/connection_pool/outstanding_rpcs"); + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "transport_type", "session_cloudpath", + "lb_policy", "POWER_OF_TWO_LEAST_IN_FLIGHT", + "streaming", "true"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(1))) + .build()); + } + + @Test + void testConnectivityErrors() { + registry.connectivityErrorCount.record( + clientInfo, tableId, methodInfo, clusterInfo, Status.UNAVAILABLE.getCode(), 1); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/connectivity_error_count"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName()); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder().setValue(TypedValue.newBuilder().setInt64Value(1)).build()); + } + + @Test + void testDpCompatGuage() { + registry.dpCompatGuage.recordFailure(clientInfo, UNKNOWN); + registry.dpCompatGuage.recordSuccess(clientInfo, "ipv4"); + + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + List timeSeriesList = + metricService.findTimeSeriesByName( + "bigtable.googleapis.com/internal/client/direct_access/compatible"); + + assertThat(timeSeriesList).hasSize(2); + for (TimeSeries timeSeries : timeSeriesList) { + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + } + assertThat(timeSeriesList) + .comparingElementsUsing( + Correspondence.transforming( + (Function>) + input -> input.getMetric().getLabelsMap(), + "metric labels")) + .containsExactly( + ImmutableMap.of( + "reason", "", + "ip_preference", "ipv4"), + ImmutableMap.of("reason", UNKNOWN.getValue(), "ip_preference", "")); + } + + @Test + void testApplicationErrors() { + registry.applicationBlockingLatency.record( + clientInfo, tableId, methodInfo, clusterInfo, Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/application_latencies"); + + assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName()); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123))) + .build()); + } + + @Test + void testClientBlocking() { + registry.clientBlockingLatency.record( + clientInfo, tableId, methodInfo, clusterInfo, Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/throttling_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName()); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testRemainingDeadline() { + registry.remainingDeadline.record( + clientInfo, + tableId, + methodInfo, + clusterInfo, + Status.UNAVAILABLE.getCode(), + Duration.ofMillis(123)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/remaining_deadline"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedTableMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "UNAVAILABLE", + "client_uid", envInfo.getUid(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId(), + "method", methodInfo.getName(), + "streaming", Boolean.toString(methodInfo.getStreaming())); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(123.0))) + .build()); + } + + @Test + void testPerConnectionErrors() { + registry.perConnectionErrorCount.record(clientInfo, 1); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/per_connection_error_count"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "project_id", clientInfo.getInstanceName().getProjectId(), + "client_uid", envInfo.getUid(), + "instance", clientInfo.getInstanceName().getInstanceId(), + "client_name", clientInfo.getClientName(), + "app_profile", clientInfo.getAppProfileId()); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(1))) + .build()); + } + + @Test + void testBatchWriteFactor() { + registry.batchWriteFlowControlFactor.record( + clientInfo, Code.DEADLINE_EXCEEDED, true, MethodInfo.of("Bigtable.MutateRows", false), 0.5); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/batch_write_flow_control_factor"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "status", "DEADLINE_EXCEEDED", + "applied", "true", + "method", "Bigtable.MutateRows"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue(TypedValue.newBuilder().setDoubleValue(0.5).build()) + .build()); + } + + @Test + void testBatchWriteQps() { + registry.batchWriteFlowControlTargetQps.record( + clientInfo, MethodInfo.of("Bigtable.MutateRows", false), 123); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/batch_write_flow_control_target_qps"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly("method", "Bigtable.MutateRows"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue(TypedValue.newBuilder().setDoubleValue(123.0).build()) + .build()); + } + + @Test + void testSessionDuration() { + registry.sessionDuration.record( + poolInfo, + peerInfo, + Status.Code.DATA_LOSS, + CloseSessionReason.CLOSE_SESSION_REASON_USER, + SessionCloseVRpcState.SomeOk, + true, + Duration.ofMinutes(5)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/durations"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "closing_reason", "CLOSE_SESSION_REASON_USER", + "vrpcs", "some_ok", + "ready", "true", + "status", "DATA_LOSS"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue( + Distribution.newBuilder() + .setCount(1) + .setMean((double) Duration.ofMinutes(5).toMillis()))) + .build()); + } + + @Test + void testSessionOpenLatency() { + registry.sessionOpenLatency.record( + poolInfo, peerInfo, Status.Code.DATA_LOSS, Duration.ofMillis(10)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/open_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "status", "DATA_LOSS"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(10))) + .build()); + } + + @Test + void testSessionUptime() { + registry.sessionUptime.record(poolInfo, peerInfo, true, Duration.ofMinutes(10)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/uptime"); + + assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "ready", "true"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue( + Distribution.newBuilder() + .setCount(1) + .setMean((double) Duration.ofMinutes(10).toMillis()))) + .build()); + } + + @Test + void testPacemaker() { + registry.pacemakerDelay.record(clientInfo, "background", Duration.ofMillis(1)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/pacemaker_delays"); + + assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()).containsExactly("executor", "background"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue( + Distribution.newBuilder().setCount(1).setMean(1000.0))) + .build()); + } + + private static class FakeMetricService extends MetricServiceImplBase { + final BlockingDeque requests = new LinkedBlockingDeque<>(); + + @Override + public void createServiceTimeSeries( + CreateTimeSeriesRequest request, StreamObserver responseObserver) { + requests.add(request); + responseObserver.onNext(Empty.getDefaultInstance()); + responseObserver.onCompleted(); + } + + List findTimeSeriesByName(String name) { + return requests.stream() + .flatMap(r -> r.getTimeSeriesList().stream()) + .filter(ts -> name.equals(ts.getMetric().getType())) + .collect(Collectors.toList()); + } + + TimeSeries getSingleTimeSeriesByName(String name) { + List timeSeriesList = findTimeSeriesByName(name); + assertWithMessage("Expected to have a single TimeSeries with the name %s", name) + .that(timeSeriesList) + .hasSize(1); + + return timeSeriesList.get(0); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java new file mode 100644 index 000000000000..bc4b3a8eb263 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientTransportLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableApplicationBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency2; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableClientBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableConnectivityErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableFirstResponseLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRetryCount; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.truth.Correspondence; +import io.grpc.Deadline; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.Tagger; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class MetricsIsolationTest { + private ScheduledExecutorService executor; + private InMemoryMetricReader internalReader; + private InMemoryMetricReader userReader; + private MetricsImpl metrics; + private ClientInfo clientInfo; + + private static final Correspondence METRIC_DATA_NAME = + Correspondence.transforming(MetricData::getName, "metric data name"); + + private static final List PUBLIC_METRICS = + ImmutableList.of( + TableAttemptLatency.NAME, + TableOperationLatency.NAME, + TableFirstResponseLatency.NAME, + TableRetryCount.NAME, + TableConnectivityErrorCount.NAME, + TableApplicationBlockingLatency.NAME, + TableClientBlockingLatency.NAME); + + private static final List INTERNAL_METRICS = + ImmutableList.of( + TableAttemptLatency2.NAME, ClientTransportLatency.NAME, TableRemainingDeadline.NAME); + + @BeforeEach + void setUp() { + executor = Executors.newSingleThreadScheduledExecutor(); + internalReader = InMemoryMetricReader.create(); + userReader = InMemoryMetricReader.create(); + + clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of("project", "instance")) + .setAppProfileId("profile") + .build(); + + SdkMeterProvider internalMeterProvider = + SdkMeterProvider.builder().registerMetricReader(internalReader).build(); + OpenTelemetrySdk internalOtel = + OpenTelemetrySdk.builder().setMeterProvider(internalMeterProvider).build(); + + SdkMeterProvider userMeterProvider = + SdkMeterProvider.builder().registerMetricReader(userReader).build(); + OpenTelemetry userOtel = OpenTelemetrySdk.builder().setMeterProvider(userMeterProvider).build(); + + MetricRegistry registry = new MetricRegistry(); + + metrics = + new MetricsImpl( + registry, + clientInfo, + Mockito.mock(ApiTracerFactory.class), + internalOtel, + userOtel, + Mockito.mock(Tagger.class), + Mockito.mock(StatsRecorder.class), + executor); + } + + @AfterEach + void tearDown() { + metrics.close(); + executor.shutdown(); + } + + @Test + void testMetricsIsolation() { + metrics.start(); + + SessionPoolInfo poolInfo = + SessionPoolInfo.create( + ClientInfo.builder() + .setClientName("fake-client") + .setInstanceName(InstanceName.of("fake-project", "fake-instance")) + .setAppProfileId("default") + .build(), + VRpcDescriptor.TABLE_SESSION, + "fake-session"); + + // 1. Trigger shared and attemptLatency2 metrics (VRpcTracer) + VRpcTracer tracer = + metrics.newTableTracer( + poolInfo, VRpcDescriptor.READ_ROW, Deadline.after(1, TimeUnit.MINUTES)); + + tracer.onAttemptStart(null); + tracer.onRequestSent(PeerInfo.getDefaultInstance()); + tracer.onAttemptFinish(VRpcResult.createServerOk(VirtualRpcResponse.getDefaultInstance())); + tracer.onOperationFinish(VRpcResult.createServerOk(VirtualRpcResponse.getDefaultInstance())); + + // user metric should have exactly PUBLIC_METRICS + assertThat(userReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsAtLeastElementsIn(PUBLIC_METRICS); + assertThat(userReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsNoneIn(INTERNAL_METRICS); + + // internal metric should have exactly PUBLIC_METRICS + INTERNAL_METRICS + assertThat(internalReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsAtLeastElementsIn(Iterables.concat(PUBLIC_METRICS, INTERNAL_METRICS)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java new file mode 100644 index 000000000000..f92f375bdb26 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java @@ -0,0 +1,34 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import org.junit.jupiter.api.Test; + +class ClientInfoTest { + @Test + void testName() { + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of("fake-project", "fake-instance")) + .setAppProfileId("fake-app-profile") + .build(); + assertThat(clientInfo.getClientName()).containsMatch("java-bigtable/\\d+\\.\\d+\\.\\d+.*"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java new file mode 100644 index 000000000000..55df4aee7f82 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.cloud.opentelemetry.detection.DetectedPlatform; +import com.google.cloud.opentelemetry.detection.GCPPlatformDetector.SupportedPlatform; +import com.google.common.base.Function; +import com.google.common.base.Supplier; +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class EnvInfoTest { + private static final Supplier NULL_HOST = Suppliers.ofInstance(null); + + @SuppressWarnings("UnnecessaryLambda") + private static final Function NULL_ENV = (ignored) -> null; + + @Mock private DetectedPlatform detectedPlatform; + + @Test + void testUid() { + when(detectedPlatform.getSupportedPlatform()).thenReturn(SupportedPlatform.UNKNOWN_PLATFORM); + + EnvInfo info1 = EnvInfo.detect(detectedPlatform, NULL_ENV, NULL_HOST); + EnvInfo info2 = EnvInfo.detect(detectedPlatform, NULL_ENV, NULL_HOST); + + assertThat(info1.getUid()).isNotEmpty(); + assertThat(info2.getUid()).isNotEmpty(); + assertThat(info1.getUid()).isNotEqualTo(info2.getUid()); + } + + @Test + void testUnknown() { + when(detectedPlatform.getSupportedPlatform()).thenReturn(SupportedPlatform.UNKNOWN_PLATFORM); + EnvInfo envInfo = EnvInfo.detect(detectedPlatform, NULL_ENV, NULL_HOST); + assertThat(envInfo.getHostName()).isEmpty(); + assertThat(envInfo.getHostId()).isEmpty(); + assertThat(envInfo.getPlatform()).isEqualTo("unknown"); + assertThat(envInfo.getRegion()).isEqualTo("global"); + } + + @Test + void testGce() { + when(detectedPlatform.getSupportedPlatform()) + .thenReturn(SupportedPlatform.GOOGLE_COMPUTE_ENGINE); + when(detectedPlatform.getProjectId()).thenReturn("my-project"); + when(detectedPlatform.getAttributes()) + .thenReturn( + ImmutableMap.of( + "machine_type", "n2-standard-8", + "availability_zone", "us-central1-c", + "instance_id", "1234567890", + "instance_name", "my-vm-name", + "cloud_region", "us-central1", + "instance_hostname", "my-vm-name.us-central1-c.c.my-project.google.com.internal")); + EnvInfo envInfo = EnvInfo.detect(detectedPlatform, NULL_ENV, NULL_HOST); + assertThat(envInfo.getPlatform()).isEqualTo("gcp_compute_engine"); + assertThat(envInfo.getProject()).isEqualTo("my-project"); + assertThat(envInfo.getRegion()).isEqualTo("us-central1"); + assertThat(envInfo.getHostId()).isEqualTo("1234567890"); + assertThat(envInfo.getHostName()).isEqualTo("my-vm-name"); + } + + @Test + void testGke() { + when(detectedPlatform.getSupportedPlatform()) + .thenReturn(SupportedPlatform.GOOGLE_KUBERNETES_ENGINE); + when(detectedPlatform.getProjectId()).thenReturn("my-project"); + when(detectedPlatform.getAttributes()) + .thenReturn( + ImmutableMap.of( + "gke_cluster_name", "my-cluster", + "gke_cluster_location", "us-central1", + "gke_cluster_location_type", "country-region", + "instance_id", "1234567890")); + Map env = ImmutableMap.of("HOSTNAME", "my-hostname"); + + EnvInfo envInfo = EnvInfo.detect(detectedPlatform, env::get, NULL_HOST); + assertThat(envInfo.getPlatform()).isEqualTo("gcp_kubernetes_engine"); + assertThat(envInfo.getProject()).isEqualTo("my-project"); + assertThat(envInfo.getRegion()).isEqualTo("us-central1"); + assertThat(envInfo.getHostId()).isEqualTo("1234567890"); + assertThat(envInfo.getHostName()).isEqualTo("my-hostname"); + } + + @Test + void testGkeHostanmeFallback() { + when(detectedPlatform.getSupportedPlatform()) + .thenReturn(SupportedPlatform.GOOGLE_KUBERNETES_ENGINE); + when(detectedPlatform.getProjectId()).thenReturn("my-project"); + when(detectedPlatform.getAttributes()) + .thenReturn( + ImmutableMap.of( + "gke_cluster_name", "my-cluster", + "gke_cluster_location", "us-central1", + "gke_cluster_location_type", "country-region", + "instance_id", "1234567890")); + EnvInfo envInfo = EnvInfo.detect(detectedPlatform, NULL_ENV, () -> "my-hostname"); + assertThat(envInfo.getPlatform()).isEqualTo("gcp_kubernetes_engine"); + assertThat(envInfo.getProject()).isEqualTo("my-project"); + assertThat(envInfo.getRegion()).isEqualTo("us-central1"); + assertThat(envInfo.getHostId()).isEqualTo("1234567890"); + assertThat(envInfo.getHostName()).isEqualTo("my-hostname"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java new file mode 100644 index 000000000000..5e981f1f4bed --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.attributes; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.bigtable.v2.PeerInfo.TransportType; +import io.grpc.Status; +import io.opencensus.tags.TagValue; +import org.junit.jupiter.api.Test; + +class UtilTest { + @Test + void ensureAllTransportTypeHaveExpectedPrefix() { + for (TransportType type : TransportType.values()) { + assertWithMessage("%s should have a mapping", type) + .that(Util.transportTypeToStringWithoutFallback(type)) + .isNotNull(); + } + } + + @Test + public void testOk() { + TagValue tagValue = TagValue.create(Util.extractStatus(null).name()); + assertThat(tagValue.asString()).isEqualTo("OK"); + } + + @Test + public void testError() { + DeadlineExceededException error = + new DeadlineExceededException( + "Deadline exceeded", null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true); + TagValue tagValue = TagValue.create(Util.extractStatus(error).name()); + assertThat(tagValue.asString()).isEqualTo("DEADLINE_EXCEEDED"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java new file mode 100644 index 000000000000..dfd41325962b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java @@ -0,0 +1,553 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.Distribution; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.api.TableName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.stub.MetricServiceStub; +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.monitoring.v3.CreateTimeSeriesRequest; +import com.google.monitoring.v3.TimeSeries; +import com.google.protobuf.Empty; +import com.google.protobuf.util.Timestamps; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramPointData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableLongPointData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableMetricData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableSumData; +import io.opentelemetry.sdk.resources.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class BigtableCloudMonitoringExporter2Test { + private static final TableName tableName = + TableName.of("fake-project", "fake-instance", "fake-table"); + private static final String appProfileId = "default"; + private static final String zone = "us-east-1"; + private static final String cluster = "cluster-1"; + + private ClientInfo clientInfo; + private EnvInfo envInfo; + + private FakeMetricServiceStub mockMetricServiceStub; + private MetricServiceClient fakeMetricServiceClient; + private BigtableCloudMonitoringExporter exporter; + + private Attributes attributes; + private Resource resource; + private InstrumentationScopeInfo scope; + + @BeforeEach + public void setUp() { + mockMetricServiceStub = new FakeMetricServiceStub(); + fakeMetricServiceClient = new FakeMetricServiceClient(mockMetricServiceStub); + + envInfo = + EnvInfo.builder() + .setProject("client-project") + .setPlatform("gce_instance") + .setRegion("cleint-region") + .setHostName("harold") + .setHostId("1234567890") + .build(); + + clientInfo = + ClientInfo.builder() + .setInstanceName(tableName.getInstanceName()) + .setAppProfileId(appProfileId) + .build(); + + MetricRegistry metricRegistry = new MetricRegistry(); + exporter = + new BigtableCloudMonitoringExporter( + metricRegistry, () -> envInfo, clientInfo, fakeMetricServiceClient); + + attributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProjectId()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstanceId()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTableId()) + .put(TableSchema.CLUSTER_ID_KEY, cluster) + .put(TableSchema.ZONE_ID_KEY, zone) + .put(MetricLabels.APP_PROFILE_KEY, appProfileId) + .build(); + + resource = Resource.create(Attributes.empty()); + + scope = InstrumentationScopeInfo.create(MetricRegistry.METER_NAME); + } + + @AfterEach + public void tearDown() {} + + @Test + public void testExportingSumData() throws InterruptedException { + long fakeValue = 11L; + + long startEpoch = 10; + long endEpoch = 15; + LongPointData longPointData = + ImmutableLongPointData.create(startEpoch, endEpoch, attributes, fakeValue); + + MetricData longData = + ImmutableMetricData.createLongSum( + resource, + scope, + "bigtable.googleapis.com/internal/client/retry_count", + "description", + "1", + ImmutableSumData.create( + true, AggregationTemporality.CUMULATIVE, ImmutableList.of(longPointData))); + + exporter.export(Collections.singletonList(longData)); + + CreateTimeSeriesRequest request = mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES); + + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTableId(), + TableSchema.CLUSTER_ID_KEY.getKey(), cluster, + TableSchema.ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + envInfo.getUid()); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(fakeValue); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime()) + .isEqualTo(Timestamps.fromNanos(startEpoch)); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime()) + .isEqualTo(Timestamps.fromNanos(endEpoch)); + } + + @Test + public void testExportingHistogramData() throws InterruptedException { + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes, + 3d, + true, + 1d, // min + true, + 2d, // max + Collections.singletonList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData))); + + exporter.export(Arrays.asList(histogramData)); + + CreateTimeSeriesRequest request = mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES); + + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTableId(), + TableSchema.CLUSTER_ID_KEY.getKey(), cluster, + TableSchema.ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + this.envInfo.getUid()); + Distribution distribution = timeSeries.getPoints(0).getValue().getDistributionValue(); + assertThat(distribution.getCount()).isEqualTo(3); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime()) + .isEqualTo(Timestamps.fromNanos(startEpoch)); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime()) + .isEqualTo(Timestamps.fromNanos(endEpoch)); + } + + @Test + public void testExportingSumDataInBatches() { + long startEpoch = 10; + long endEpoch = 15; + + Collection toExport = new ArrayList<>(); + for (int i = 0; i < 250; i++) { + Attributes testAttributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProjectId()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstanceId()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTableId() + i) + .put(TableSchema.CLUSTER_ID_KEY, cluster) + .put(TableSchema.ZONE_ID_KEY, zone) + .put(MetricLabels.APP_PROFILE_KEY, appProfileId) + .build(); + LongPointData longPointData = + ImmutableLongPointData.create(startEpoch, endEpoch, testAttributes, i); + + MetricData longData = + ImmutableMetricData.createLongSum( + resource, + scope, + "bigtable.googleapis.com/internal/client/retry_count", + "description", + "1", + ImmutableSumData.create( + true, AggregationTemporality.CUMULATIVE, ImmutableList.of(longPointData))); + toExport.add(longData); + } + + exporter.export(toExport); + + assertThat(mockMetricServiceStub.requests).hasSize(2); + CreateTimeSeriesRequest firstRequest = mockMetricServiceStub.requests.poll(); + CreateTimeSeriesRequest secondRequest = mockMetricServiceStub.requests.poll(); + + assertThat(firstRequest.getTimeSeriesList()).hasSize(200); + assertThat(secondRequest.getTimeSeriesList()).hasSize(50); + + for (int i = 0; i < 250; i++) { + TimeSeries timeSeries; + if (i < 200) { + timeSeries = firstRequest.getTimeSeriesList().get(i); + } else { + timeSeries = secondRequest.getTimeSeriesList().get(i - 200); + } + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), + tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), + tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTableId() + i, + TableSchema.CLUSTER_ID_KEY.getKey(), + cluster, + TableSchema.ZONE_ID_KEY.getKey(), + zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + envInfo.getUid()); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(i); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime()) + .isEqualTo(Timestamps.fromNanos(startEpoch)); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime()) + .isEqualTo(Timestamps.fromNanos(endEpoch)); + } + } + + @Test + public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedException { + String gceProjectId = "fake-gce-project"; + EnvInfo envInfo = + EnvInfo.builder() + .setPlatform("gce_instance") + .setProject(gceProjectId) + .setRegion("cleint-region") + .setHostId("1234567890") + .setHostName("harold") + .build(); + + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(tableName.getInstanceName()) + .setAppProfileId(appProfileId) + .build(); + + MetricRegistry metricRegistry = new MetricRegistry(); + BigtableCloudMonitoringExporter exporter = + new BigtableCloudMonitoringExporter( + metricRegistry, Suppliers.ofInstance(envInfo), clientInfo, fakeMetricServiceClient); + + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + Attributes.of( + ClientSchema.BIGTABLE_PROJECT_ID_KEY, + tableName.getProjectId(), + ClientSchema.INSTANCE_ID_KEY, + tableName.getInstanceId(), + ClientSchema.APP_PROFILE_KEY, + appProfileId, + ClientSchema.CLIENT_NAME, + clientInfo.getClientName()), + 3d, + true, + 1d, // min + true, + 2d, // max + Arrays.asList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/per_connection_error_count", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData))); + + exporter.export(Collections.singletonList(histogramData)); + + CreateTimeSeriesRequest request = mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES); + + assertThat(request.getName()).isEqualTo("projects/" + tableName.getProjectId()); + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .isEqualTo( + ImmutableMap.builder() + .put("project_id", tableName.getProjectId()) + .put("instance", tableName.getInstanceId()) + .put("app_profile", appProfileId) + .put("client_project", gceProjectId) + .put("region", "cleint-region") + .put("cloud_platform", "gce_instance") + .put("host_id", "1234567890") + .put("host_name", "harold") + .put("client_name", clientInfo.getClientName()) + .put("uuid", envInfo.getUid()) + .build()); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .isEqualTo( + ImmutableMap.builder() + .put(ClientSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId()) + .put(ClientSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId()) + .put(ClientSchema.APP_PROFILE_KEY.getKey(), appProfileId) + .put(ClientSchema.CLIENT_NAME.getKey(), clientInfo.getClientName()) + .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) + .build()); + } + + @Test + public void testExportingToMultipleProjects() throws InterruptedException { + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData1 = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes, + 3d, + true, + 1d, // min + true, + 2d, // max + Arrays.asList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData1 = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData1))); + + HistogramPointData histogramPointData2 = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes.toBuilder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, "another-project") + .build(), + 50d, + true, + 5d, // min + true, + 30d, // max + Arrays.asList(1.0), + Arrays.asList(5L, 10L)); + + MetricData histogramData2 = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData2))); + + exporter.export(Arrays.asList(histogramData1, histogramData2)); + + List allValues = + Arrays.asList( + mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES), + mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES)); + + assertThat(allValues).hasSize(2); + + List> labelsMap = new ArrayList<>(); + List counts = new ArrayList<>(); + allValues.forEach( + value -> { + labelsMap.add(value.getTimeSeriesList().get(0).getResource().getLabelsMap()); + counts.add( + value + .getTimeSeriesList() + .get(0) + .getPoints(0) + .getValue() + .getDistributionValue() + .getCount()); + }); + + assertThat(labelsMap) + .containsExactly( + ImmutableMap.of( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), + tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), + tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTableId(), + TableSchema.CLUSTER_ID_KEY.getKey(), + cluster, + TableSchema.ZONE_ID_KEY.getKey(), + zone), + ImmutableMap.of( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), + "another-project", + TableSchema.INSTANCE_ID_KEY.getKey(), + tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTableId(), + TableSchema.CLUSTER_ID_KEY.getKey(), + cluster, + TableSchema.ZONE_ID_KEY.getKey(), + zone)); + assertThat(counts).containsExactly(3l, 15l); + } + + private static class FakeMetricServiceClient extends MetricServiceClient { + protected FakeMetricServiceClient(MetricServiceStub stub) { + super(stub); + } + } + + private static class FakeMetricServiceStub extends MetricServiceStub { + private final BlockingDeque requests = new LinkedBlockingDeque<>(); + + @Override + public UnaryCallable createServiceTimeSeriesCallable() { + return new UnaryCallable() { + @Override + public ApiFuture futureCall( + CreateTimeSeriesRequest createTimeSeriesRequest, ApiCallContext apiCallContext) { + requests.add(createTimeSeriesRequest); + return ApiFutures.immediateFuture(Empty.getDefaultInstance()); + } + }; + } + + @Override + public void close() {} + + @Override + public void shutdown() {} + + @Override + public boolean isShutdown() { + return false; + } + + @Override + public boolean isTerminated() { + return false; + } + + @Override + public void shutdownNow() {} + + @Override + public boolean awaitTermination(long l, TimeUnit timeUnit) throws InterruptedException { + return false; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporterTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporterTest.java new file mode 100644 index 000000000000..2e04d7c5666f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporterTest.java @@ -0,0 +1,542 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.internal.csm.exporter; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.Distribution; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.stub.MetricServiceStub; +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.monitoring.v3.CreateTimeSeriesRequest; +import com.google.monitoring.v3.TimeSeries; +import com.google.protobuf.Empty; +import com.google.protobuf.util.Timestamps; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramPointData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableLongPointData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableMetricData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableSumData; +import io.opentelemetry.sdk.resources.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +public class BigtableCloudMonitoringExporterTest { + private static final String projectId = "fake-project"; + private static final String instanceId = "fake-instance"; + private static final String appProfileId = "default"; + private static final String tableId = "fake-table"; + private static final String zone = "us-east-1"; + private static final String cluster = "cluster-1"; + + private static final String clientName = "fake-client-name"; + private static final String taskId = "fake-task-id"; + + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + @Mock private MetricServiceStub mockMetricServiceStub; + private MetricServiceClient fakeMetricServiceClient; + private BigtableCloudMonitoringExporter exporter; + + private Attributes attributes; + private Resource resource; + private InstrumentationScopeInfo scope; + + private EnvInfo envInfo = + EnvInfo.builder() + .setProject("client-project") + .setPlatform("gce_instance") + .setRegion("cleint-region") + .setHostName("harold") + .setHostId("1234567890") + .setUid(taskId) + .build(); + private ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of(projectId, instanceId)) + .setAppProfileId(appProfileId) + .setClientName(clientName) + .build(); + + @Before + public void setUp() { + fakeMetricServiceClient = new FakeMetricServiceClient(mockMetricServiceStub); + + exporter = + new BigtableCloudMonitoringExporter( + new MetricRegistry(), + Suppliers.ofInstance(envInfo), + clientInfo, + fakeMetricServiceClient); + + attributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, projectId) + .put(TableSchema.INSTANCE_ID_KEY, instanceId) + .put(TableSchema.TABLE_ID_KEY, tableId) + .put(TableSchema.CLUSTER_ID_KEY, cluster) + .put(TableSchema.ZONE_ID_KEY, zone) + .put(MetricLabels.APP_PROFILE_KEY, appProfileId) + .build(); + + resource = Resource.create(Attributes.empty()); + + scope = InstrumentationScopeInfo.create(MetricRegistry.METER_NAME); + } + + @After + public void tearDown() { + exporter.close(); + fakeMetricServiceClient.close(); + } + + @Test + public void testExportingSumData() { + ArgumentCaptor argumentCaptor = + ArgumentCaptor.forClass(CreateTimeSeriesRequest.class); + + UnaryCallable mockCallable = mock(UnaryCallable.class); + when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable); + ApiFuture future = ApiFutures.immediateFuture(Empty.getDefaultInstance()); + when(mockCallable.futureCall(argumentCaptor.capture())).thenReturn(future); + + long fakeValue = 11L; + + long startEpoch = 10; + long endEpoch = 15; + LongPointData longPointData = + ImmutableLongPointData.create(startEpoch, endEpoch, attributes, fakeValue); + + MetricData longData = + ImmutableMetricData.createLongSum( + resource, + scope, + "bigtable.googleapis.com/internal/client/retry_count", + "description", + "1", + ImmutableSumData.create( + true, AggregationTemporality.CUMULATIVE, ImmutableList.of(longPointData))); + + exporter.export(Arrays.asList(longData)); + + CreateTimeSeriesRequest request = argumentCaptor.getValue(); + + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + TableSchema.INSTANCE_ID_KEY.getKey(), instanceId, + TableSchema.TABLE_ID_KEY.getKey(), tableId, + TableSchema.CLUSTER_ID_KEY.getKey(), cluster, + TableSchema.ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + taskId); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(fakeValue); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getStartTime())) + .isEqualTo(startEpoch); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getEndTime())) + .isEqualTo(endEpoch); + } + + @Test + public void testExportingHistogramData() { + ArgumentCaptor argumentCaptor = + ArgumentCaptor.forClass(CreateTimeSeriesRequest.class); + + UnaryCallable mockCallable = mock(UnaryCallable.class); + when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable); + ApiFuture future = ApiFutures.immediateFuture(Empty.getDefaultInstance()); + when(mockCallable.futureCall(argumentCaptor.capture())).thenReturn(future); + + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes, + 3d, + true, + 1d, // min + true, + 2d, // max + Arrays.asList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData))); + + exporter.export(Arrays.asList(histogramData)); + + CreateTimeSeriesRequest request = argumentCaptor.getValue(); + + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + TableSchema.INSTANCE_ID_KEY.getKey(), instanceId, + TableSchema.TABLE_ID_KEY.getKey(), tableId, + TableSchema.CLUSTER_ID_KEY.getKey(), cluster, + TableSchema.ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + taskId); + Distribution distribution = timeSeries.getPoints(0).getValue().getDistributionValue(); + assertThat(distribution.getCount()).isEqualTo(3); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getStartTime())) + .isEqualTo(startEpoch); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getEndTime())) + .isEqualTo(endEpoch); + } + + @Test + public void testExportingSumDataInBatches() { + ArgumentCaptor argumentCaptor = + ArgumentCaptor.forClass(CreateTimeSeriesRequest.class); + + UnaryCallable mockCallable = mock(UnaryCallable.class); + when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable); + ApiFuture future = ApiFutures.immediateFuture(Empty.getDefaultInstance()); + when(mockCallable.futureCall(argumentCaptor.capture())).thenReturn(future); + + long startEpoch = 10; + long endEpoch = 15; + + Collection toExport = new ArrayList<>(); + for (int i = 0; i < 250; i++) { + Attributes testAttributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, projectId) + .put(TableSchema.INSTANCE_ID_KEY, instanceId) + .put(TableSchema.TABLE_ID_KEY, tableId + i) + .put(TableSchema.CLUSTER_ID_KEY, cluster) + .put(TableSchema.ZONE_ID_KEY, zone) + .put(MetricLabels.APP_PROFILE_KEY, appProfileId) + .build(); + LongPointData longPointData = + ImmutableLongPointData.create(startEpoch, endEpoch, testAttributes, i); + + MetricData longData = + ImmutableMetricData.createLongSum( + resource, + scope, + "bigtable.googleapis.com/internal/client/retry_count", + "description", + "1", + ImmutableSumData.create( + true, AggregationTemporality.CUMULATIVE, ImmutableList.of(longPointData))); + toExport.add(longData); + } + + exporter.export(toExport); + + assertThat(argumentCaptor.getAllValues()).hasSize(2); + CreateTimeSeriesRequest firstRequest = argumentCaptor.getAllValues().get(0); + CreateTimeSeriesRequest secondRequest = argumentCaptor.getAllValues().get(1); + + assertThat(firstRequest.getTimeSeriesList()).hasSize(200); + assertThat(secondRequest.getTimeSeriesList()).hasSize(50); + + for (int i = 0; i < 250; i++) { + TimeSeries timeSeries; + if (i < 200) { + timeSeries = firstRequest.getTimeSeriesList().get(i); + } else { + timeSeries = secondRequest.getTimeSeriesList().get(i - 200); + } + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + TableSchema.INSTANCE_ID_KEY.getKey(), instanceId, + TableSchema.TABLE_ID_KEY.getKey(), tableId + i, + TableSchema.CLUSTER_ID_KEY.getKey(), cluster, + TableSchema.ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + MetricLabels.APP_PROFILE_KEY.getKey(), + appProfileId, + MetricLabels.CLIENT_UID.getKey(), + taskId); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(i); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getStartTime())) + .isEqualTo(startEpoch); + assertThat(Timestamps.toNanos(timeSeries.getPoints(0).getInterval().getEndTime())) + .isEqualTo(endEpoch); + } + } + + @Test + public void testTimeSeriesForMetricWithGceOrGkeResource() { + BigtableCloudMonitoringExporter exporter = + new BigtableCloudMonitoringExporter( + new MetricRegistry(), + Suppliers.ofInstance(envInfo), + clientInfo, + fakeMetricServiceClient); + ArgumentCaptor argumentCaptor = + ArgumentCaptor.forClass(CreateTimeSeriesRequest.class); + + UnaryCallable mockCallable = mock(UnaryCallable.class); + when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable); + ApiFuture future = ApiFutures.immediateFuture(Empty.getDefaultInstance()); + when(mockCallable.futureCall(argumentCaptor.capture())).thenReturn(future); + + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + Attributes.of( + ClientSchema.BIGTABLE_PROJECT_ID_KEY, + projectId, + ClientSchema.INSTANCE_ID_KEY, + instanceId, + ClientSchema.APP_PROFILE_KEY, + appProfileId, + ClientSchema.CLIENT_NAME, + clientName), + 3d, + true, + 1d, // min + true, + 2d, // max + Arrays.asList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/per_connection_error_count", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData))); + + exporter.export(Arrays.asList(histogramData)); + + CreateTimeSeriesRequest request = argumentCaptor.getValue(); + + assertThat(request.getName()).isEqualTo("projects/" + projectId); + assertThat(request.getTimeSeriesList()).hasSize(1); + + com.google.monitoring.v3.TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .isEqualTo( + ImmutableMap.builder() + .put("project_id", projectId) + .put("instance", instanceId) + .put("app_profile", appProfileId) + .put("client_project", "client-project") + .put("region", "cleint-region") + .put("cloud_platform", "gce_instance") + .put("host_id", "1234567890") + .put("host_name", "harold") + .put("client_name", clientName) + .put("uuid", taskId) + .build()); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .isEqualTo( + ImmutableMap.builder() + .put(ClientSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), projectId) + .put(ClientSchema.INSTANCE_ID_KEY.getKey(), instanceId) + .put(ClientSchema.APP_PROFILE_KEY.getKey(), appProfileId) + .put(ClientSchema.CLIENT_NAME.getKey(), clientName) + .put(MetricLabels.CLIENT_UID.getKey(), taskId) + .build()); + } + + @Test + public void testExportingToMultipleProjects() { + ArgumentCaptor argumentCaptor = + ArgumentCaptor.forClass(CreateTimeSeriesRequest.class); + + UnaryCallable mockCallable = mock(UnaryCallable.class); + when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable); + ApiFuture future = ApiFutures.immediateFuture(Empty.getDefaultInstance()); + when(mockCallable.futureCall(any())).thenReturn(future); + + long startEpoch = 10; + long endEpoch = 15; + HistogramPointData histogramPointData1 = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes, + 3d, + true, + 1d, // min + true, + 2d, // max + Arrays.asList(1.0), + Arrays.asList(1L, 2L)); + + MetricData histogramData1 = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData1))); + + HistogramPointData histogramPointData2 = + ImmutableHistogramPointData.create( + startEpoch, + endEpoch, + attributes.toBuilder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, "another-project") + .build(), + 50d, + true, + 5d, // min + true, + 30d, // max + Arrays.asList(1.0), + Arrays.asList(5L, 10L)); + + MetricData histogramData2 = + ImmutableMetricData.createDoubleHistogram( + resource, + scope, + "bigtable.googleapis.com/internal/client/operation_latencies", + "description", + "ms", + ImmutableHistogramData.create( + AggregationTemporality.CUMULATIVE, ImmutableList.of(histogramPointData2))); + + exporter.export(Arrays.asList(histogramData1, histogramData2)); + + verify(mockCallable, times(2)).futureCall(argumentCaptor.capture()); + + List allValues = argumentCaptor.getAllValues(); + + assertThat(allValues).hasSize(2); + + List> labelsMap = new ArrayList<>(); + List counts = new ArrayList<>(); + allValues.forEach( + value -> { + labelsMap.add(value.getTimeSeriesList().get(0).getResource().getLabelsMap()); + counts.add( + value + .getTimeSeriesList() + .get(0) + .getPoints(0) + .getValue() + .getDistributionValue() + .getCount()); + }); + + assertThat(labelsMap) + .containsExactly( + ImmutableMap.of( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), + projectId, + TableSchema.INSTANCE_ID_KEY.getKey(), + instanceId, + TableSchema.TABLE_ID_KEY.getKey(), + tableId, + TableSchema.CLUSTER_ID_KEY.getKey(), + cluster, + TableSchema.ZONE_ID_KEY.getKey(), + zone), + ImmutableMap.of( + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), + "another-project", + TableSchema.INSTANCE_ID_KEY.getKey(), + instanceId, + TableSchema.TABLE_ID_KEY.getKey(), + tableId, + TableSchema.CLUSTER_ID_KEY.getKey(), + cluster, + TableSchema.ZONE_ID_KEY.getKey(), + zone)); + assertThat(counts).containsExactly(3l, 15l); + } + + private static class FakeMetricServiceClient extends MetricServiceClient { + + protected FakeMetricServiceClient(MetricServiceStub stub) { + super(stub); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java new file mode 100644 index 000000000000..0a19733b6cfb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java @@ -0,0 +1,471 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.UnavailableException; +import com.google.bigtable.v2.BigtableGrpc.BigtableImplBase; +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.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.BigtableClientContext; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.collect.ImmutableMap; +import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.opencensus.stats.StatsComponent; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tags; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BigtableTracerCallableTest { + private Server server; + private Server serverNoHeader; + + private final FakeService fakeService = new FakeService(); + + private final StatsComponent localStats = new SimpleStatsComponent(); + private EnhancedBigtableStub stub; + private EnhancedBigtableStub noHeaderStub; + private int attempts; + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String APP_PROFILE_ID = "default"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + + private static final long WAIT_FOR_METRICS_TIME_MS = 1_000; + + private AtomicInteger fakeServerTiming; + + @Before + public void setUp() throws Exception { + setupRpcViews(); + + // Create a server that'll inject a server-timing header with a random number and a stub that + // connects to this server. + fakeServerTiming = new AtomicInteger(new Random().nextInt(1000) + 1); + server = + FakeServiceBuilder.create(fakeService) + .intercept( + new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + return serverCallHandler.startCall( + new SimpleForwardingServerCall(serverCall) { + @Override + public void sendHeaders(Metadata headers) { + headers.put( + Metadata.Key.of("server-timing", Metadata.ASCII_STRING_MARSHALLER), + String.format("gfet4t7; dur=%d", fakeServerTiming.get())); + super.sendHeaders(headers); + } + }, + metadata); + } + }) + .start(); + + BigtableDataSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + // only testing opencensus + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build(); + + attempts = settings.getStubSettings().readRowsSettings().getRetrySettings().getMaxAttempts(); + stub = + new EnhancedBigtableStub( + settings.getStubSettings().getPerOpSettings(), + BigtableClientContext.create( + settings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder())); + + // Create another server without injecting the server-timing header and another stub that + // connects to it. + serverNoHeader = FakeServiceBuilder.create(fakeService).start(); + + BigtableDataSettings noHeaderSettings = + BigtableDataSettings.newBuilderForEmulator(serverNoHeader.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build(); + + noHeaderStub = + new EnhancedBigtableStub( + noHeaderSettings.getStubSettings().getPerOpSettings(), + BigtableClientContext.create( + noHeaderSettings.getStubSettings(), + Tags.getTagger(), + localStats.getStatsRecorder())); + } + + @SuppressWarnings("deprecation") + private void setupRpcViews() { + com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientGfeViews( + localStats.getViewManager()); + } + + @After + public void tearDown() { + stub.close(); + noHeaderStub.close(); + server.shutdown(); + serverNoHeader.shutdown(); + } + + @Test + public void testGFELatencyMetricReadRows() { + ServerStream call = stub.readRowsCallable().call(Query.create(TABLE_ID)); + call.forEach(r -> {}); + + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencyMetricMutateRow() throws InterruptedException { + stub.mutateRowCallable().call(RowMutation.create(TABLE_ID, "fake-key")); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencyMetricMutateRows() throws InterruptedException { + BulkMutation mutations = + BulkMutation.create(TABLE_ID) + .add("key", Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + stub.bulkMutateRowsCallable().call(mutations); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencySampleRowKeys() throws InterruptedException { + stub.sampleRowKeysCallableWithRequest().call(SampleRowKeysRequest.create(TABLE_ID)); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.SampleRowKeys"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencySampleRowKeysWithRequest() throws InterruptedException { + stub.sampleRowKeysCallableWithRequest().call(SampleRowKeysRequest.create(TABLE_ID)); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.SampleRowKeys"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencyCheckAndMutateRow() throws InterruptedException { + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, "fake-key") + .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); + stub.checkAndMutateRowCallable().call(mutation); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.CheckAndMutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFELatencyReadModifyWriteRow() throws InterruptedException { + ReadModifyWriteRow request = + ReadModifyWriteRow.create(TABLE_ID, "fake-key") + .append("fake-family", "fake-qualifier", "suffix"); + stub.readModifyWriteRowCallable().call(request); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadModifyWriteRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + + @Test + public void testGFEMissingHeaderMetric() throws InterruptedException { + // Make a few calls to the server which will inject the server-timing header and the counter + // should be 0. + stub.readRowsCallable().call(Query.create(TABLE_ID)); + stub.mutateRowCallable().call(RowMutation.create(TABLE_ID, "key")); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long mutateRowMissingCount = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + long readRowsMissingCount = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + + assertThat(mutateRowMissingCount).isEqualTo(0); + assertThat(readRowsMissingCount).isEqualTo(0); + + // Make a few more calls to the server which won't add the header and the counter should match + // the number of requests sent. + int readRowsCalls = new Random().nextInt(10) + 1; + int mutateRowCalls = new Random().nextInt(10) + 1; + for (int i = 0; i < mutateRowCalls; i++) { + noHeaderStub.mutateRowCallable().call(RowMutation.create(TABLE_ID, "fake-key" + i)); + } + for (int i = 0; i < readRowsCalls; i++) { + noHeaderStub.readRowsCallable().call(Query.create(TABLE_ID)); + } + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + + mutateRowMissingCount = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + readRowsMissingCount = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + assertThat(mutateRowMissingCount).isEqualTo(mutateRowCalls); + assertThat(readRowsMissingCount).isEqualTo(readRowsCalls); + } + + @Test + public void testMetricsWithErrorResponse() throws InterruptedException { + try { + stub.readRowsCallable().call(Query.create(TableId.of("random-table-id"))).iterator().next(); + fail("readrows should throw exception"); + } catch (Exception e) { + assertThat(e).isInstanceOf(UnavailableException.class); + } + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long missingCount = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("UNAVAILABLE")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(missingCount).isEqualTo(attempts); + } + + private static class FakeService extends BigtableImplBase { + private final String defaultTableName = + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId()); + + @Override + public void readRows(ReadRowsRequest request, StreamObserver observer) { + if (!request.getTableName().equals(defaultTableName)) { + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + observer.onNext(ReadRowsResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void mutateRow(MutateRowRequest request, StreamObserver observer) { + observer.onNext(MutateRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void mutateRows(MutateRowsRequest request, StreamObserver observer) { + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntries(MutateRowsResponse.Entry.newBuilder().setIndex(i)); + } + observer.onNext(builder.build()); + observer.onCompleted(); + } + + @Override + public void sampleRowKeys( + com.google.bigtable.v2.SampleRowKeysRequest request, + StreamObserver observer) { + observer.onNext(SampleRowKeysResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, StreamObserver observer) { + observer.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, StreamObserver observer) { + observer.onNext(ReadModifyWriteRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java new file mode 100644 index 000000000000..4472c433f713 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java @@ -0,0 +1,475 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.when; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.BatcherImpl; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +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.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.BigtableClientContext; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor; +import com.google.common.base.Stopwatch; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Range; +import com.google.common.util.concurrent.SettableFuture; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.opencensus.stats.StatsComponent; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tags; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.stubbing.Answer; + +@RunWith(JUnit4.class) +@Deprecated +public class MetricsTracerTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String APP_PROFILE_ID = "default"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final long SLEEP_VARIABILITY = 15; + + private static final ReadRowsResponse DEFAULT_READ_ROWS_RESPONSES = + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .setFamilyName(StringValue.of("cf")) + .setQualifier(BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q"))) + .setTimestampMicros(1_000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build(); + + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + private Server server; + + @Mock(answer = Answers.CALLS_REAL_METHODS) + private BigtableGrpc.BigtableImplBase mockService; + + private final StatsComponent localStats = new SimpleStatsComponent(); + private EnhancedBigtableStub stub; + private BigtableDataSettings settings; + + @Before + public void setUp() throws Exception { + server = FakeServiceBuilder.create(mockService).start(); + + com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientViews( + localStats.getViewManager()); + + settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build(); + + BigtableClientContext bigtableClientContext = + BigtableClientContext.create( + settings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); + + stub = + new EnhancedBigtableStub( + settings.getStubSettings().getPerOpSettings(), bigtableClientContext); + } + + @After + public void tearDown() { + stub.close(); + server.shutdown(); + } + + @Test + public void testReadRowsLatency() throws InterruptedException { + final long sleepTime = 50; + + doAnswer( + (Answer) + invocation -> { + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + Thread.sleep(sleepTime); + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + observer.onCompleted(); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + Stopwatch stopwatch = Stopwatch.createStarted(); + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + long opLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_OP_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(opLatency).isIn(Range.closed(sleepTime, elapsed)); + } + + @Test + public void testReadRowsOpCount() throws InterruptedException { + doAnswer( + invocation -> { + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + observer.onCompleted(); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + @SuppressWarnings({"UnusedVariable", "MismatchedQueryAndUpdateOfCollection"}) + ArrayList ignored = + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + @SuppressWarnings({ + "UnusedVariable", + "MismatchedQueryAndUpdateOfCollection", + "ModifiedButNotUsed" + }) + ArrayList ignored2 = + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + + long opLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_COMPLETED_OP_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(opLatency).isEqualTo(2); + } + + @Test + @SuppressWarnings("FutureReturnValueIgnored") + public void testReadRowsFirstRow() throws InterruptedException { + final long beforeSleep = 50; + final long afterSleep = 50; + + SettableFuture gotFirstRow = SettableFuture.create(); + + ExecutorService executor = Executors.newCachedThreadPool(); + doAnswer( + invocation -> { + StreamObserver observer = invocation.getArgument(1); + executor.submit( + () -> { + Thread.sleep(beforeSleep); + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + // wait until the first row is consumed before padding the operation span + gotFirstRow.get(); + Thread.sleep(afterSleep); + observer.onCompleted(); + return null; + }); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + Stopwatch stopwatch = Stopwatch.createStarted(); + + // Get the first row and notify the mock that it can start padding the operation span + Iterator it = stub.readRowsCallable().call(Query.create(TABLE_ID)).iterator(); + it.next(); + gotFirstRow.set(null); + // finish the stream + while (it.hasNext()) { + it.next(); + } + long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + executor.shutdown(); + + long firstRowLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW, + ImmutableMap.of(), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + + assertThat(firstRowLatency) + .isIn( + Range.closed( + beforeSleep - SLEEP_VARIABILITY, elapsed - afterSleep + SLEEP_VARIABILITY)); + } + + @Test + public void testReadRowsAttemptsPerOp() throws InterruptedException { + final AtomicInteger callCount = new AtomicInteger(0); + + doAnswer( + invocation -> { + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + + // First call will trigger a transient error + if (callCount.getAndIncrement() == 0) { + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return null; + } + + // Next attempt will return a row + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + observer.onCompleted(); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + + long opLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_ATTEMPTS_PER_OP_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(opLatency).isEqualTo(2); + } + + @Test + public void testReadRowsAttemptLatency() throws InterruptedException { + final long sleepTime = 50; + final AtomicInteger callCount = new AtomicInteger(0); + + doAnswer( + invocation -> { + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + + Thread.sleep(sleepTime); + + // First attempt will return a transient error + if (callCount.getAndIncrement() == 0) { + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return null; + } + // Next attempt will be ok + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + observer.onCompleted(); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + Stopwatch stopwatch = Stopwatch.createStarted(); + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + long attemptLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_ATTEMPT_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + // Average attempt latency will be just a single wait (as opposed to op latency which will be 2x + // sleeptime) + assertThat(attemptLatency).isIn(Range.closed(sleepTime, elapsed - sleepTime)); + } + + @Test + public void testInvalidRequest() { + try { + stub.bulkMutateRowsCallable().call(BulkMutation.create(TABLE_ID)); + Assert.fail("Invalid request should throw exception"); + } catch (IllegalStateException e) { + // Verify that the latency is recorded with an error code (in this case UNKNOWN) + long attemptLatency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_ATTEMPT_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("UNKNOWN")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(attemptLatency).isAtLeast(0); + } + } + + @Test + public void testBatchReadRowsThrottledTime() throws Exception { + doAnswer( + invocation -> { + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + observer.onNext(DEFAULT_READ_ROWS_RESPONSES); + observer.onCompleted(); + return null; + }) + .when(mockService) + .readRows(any(ReadRowsRequest.class), any()); + + try (Batcher batcher = + stub.newBulkReadRowsBatcher(Query.create(TABLE_ID), GrpcCallContext.createDefault())) { + ApiFuture ignored = batcher.add(ByteString.copyFromUtf8("row1")); + } + + long throttledTimeMetric = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_BATCH_THROTTLED_TIME_VIEW, + ImmutableMap.of(RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(throttledTimeMetric).isEqualTo(0); + } + + @Test + public void testBatchMutateRowsThrottledTime() throws Exception { + FlowController flowController = Mockito.mock(FlowController.class); + MutateRowsBatchingDescriptor batchingDescriptor = new MutateRowsBatchingDescriptor(); + + // Mock throttling + final long throttled = 50; + doAnswer( + invocation -> { + Thread.sleep(throttled); + return null; + }) + .when(flowController) + .reserve(any(Long.class), any(Long.class)); + when(flowController.getMaxElementCountLimit()).thenReturn(null); + when(flowController.getMaxRequestBytesLimit()).thenReturn(null); + + doAnswer( + invocation -> { + MutateRowsRequest request = (MutateRowsRequest) invocation.getArguments()[0]; + @SuppressWarnings("unchecked") + StreamObserver observer = + (StreamObserver) invocation.getArguments()[1]; + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntriesBuilder().setIndex(i); + } + observer.onNext(builder.build()); + observer.onCompleted(); + return null; + }) + .when(mockService) + .mutateRows(any(MutateRowsRequest.class), any()); + + ApiCallContext defaultContext = GrpcCallContext.createDefault(); + + try (Batcher batcher = + new BatcherImpl<>( + batchingDescriptor, + stub.internalBulkMutateRowsCallable().withDefaultCallContext(defaultContext), + BulkMutation.create(TABLE_ID), + settings.getStubSettings().bulkMutateRowsSettings().getBatchingSettings(), + Executors.newSingleThreadScheduledExecutor(), + flowController, + defaultContext)) { + + ApiFuture ignored = batcher.add(RowMutationEntry.create("key").deleteRow()); + } + + long throttledTimeMetric = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_BATCH_THROTTLED_TIME_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRows")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(throttledTimeMetric).isAtLeast(throttled); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/SimpleStatsComponent.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/SimpleStatsComponent.java new file mode 100644 index 000000000000..bf867989d1b8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/SimpleStatsComponent.java @@ -0,0 +1,27 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; + +import io.opencensus.implcore.common.MillisClock; +import io.opencensus.implcore.internal.SimpleEventQueue; +import io.opencensus.implcore.stats.StatsComponentImplBase; + +/** A StatsComponent implementation for testing that executes all events inline. */ +public class SimpleStatsComponent extends StatsComponentImplBase { + public SimpleStatsComponent() { + super(new SimpleEventQueue(), MillisClock.getInstance()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java new file mode 100644 index 000000000000..db86a027fccb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java @@ -0,0 +1,351 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.internal.csm.opencensus; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Function; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterators; +import com.google.common.collect.Maps; +import io.grpc.Context; +import io.opencensus.common.Scope; +import io.opencensus.stats.AggregationData; +import io.opencensus.stats.Measure; +import io.opencensus.stats.MeasureMap; +import io.opencensus.stats.StatsComponent; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.stats.View; +import io.opencensus.stats.ViewData; +import io.opencensus.tags.Tag; +import io.opencensus.tags.TagContext; +import io.opencensus.tags.TagContextBuilder; +import io.opencensus.tags.TagKey; +import io.opencensus.tags.TagMetadata; +import io.opencensus.tags.TagMetadata.TagTtl; +import io.opencensus.tags.TagValue; +import io.opencensus.tags.Tagger; +import io.opencensus.tags.unsafe.ContextUtils; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +class StatsTestUtils { + private StatsTestUtils() {} + + public static class MetricsRecord { + public final ImmutableMap tags; + public final ImmutableMap metrics; + + private MetricsRecord( + ImmutableMap tags, ImmutableMap metrics) { + this.tags = tags; + this.metrics = metrics; + } + + /** Returns the value of a metric, or {@code null} if not found. */ + @Nullable + public Double getMetric(Measure measure) { + for (Map.Entry m : metrics.entrySet()) { + if (m.getKey().equals(measure)) { + Number value = m.getValue(); + if (value instanceof Double) { + return (Double) value; + } else if (value instanceof Long) { + return (double) (Long) value; + } + throw new AssertionError("Unexpected measure value type: " + value.getClass().getName()); + } + } + return null; + } + + /** Returns the value of a metric converted to long, or throw if not found. */ + public long getMetricAsLongOrFail(Measure measure) { + Double doubleValue = getMetric(measure); + checkNotNull(doubleValue, "Measure not found: %s", measure.getName()); + long longValue = (long) (Math.abs(doubleValue) + 0.0001); + if (doubleValue < 0) { + longValue = -longValue; + } + return longValue; + } + } + + /** + * A {@link Tagger} implementation that saves metrics records to be accessible from {@link + * #pollRecord()} and {@link #pollRecord(long, TimeUnit)}, until {@link #rolloverRecords} is + * called. + */ + public static final class FakeStatsRecorder extends StatsRecorder { + + private BlockingQueue records; + + public FakeStatsRecorder() { + rolloverRecords(); + } + + @Override + public MeasureMap newMeasureMap() { + return new FakeStatsRecord(this); + } + + public MetricsRecord pollRecord() { + return getCurrentRecordSink().poll(); + } + + public MetricsRecord pollRecord(long timeout, TimeUnit unit) throws InterruptedException { + return getCurrentRecordSink().poll(timeout, unit); + } + + /** + * Disconnect this tagger with the contexts it has created so far. The records from those + * contexts will not show up in {@link #pollRecord}. Useful for isolating the records between + * test cases. + */ + // This needs to be synchronized with getCurrentRecordSink() which may run concurrently. + public synchronized void rolloverRecords() { + records = new LinkedBlockingQueue<>(); + } + + private synchronized BlockingQueue getCurrentRecordSink() { + return records; + } + } + + public static final class FakeTagger extends Tagger { + + @Override + public FakeTagContext empty() { + return FakeTagContext.EMPTY; + } + + @Override + public TagContext getCurrentTagContext() { + return ContextUtils.getValue(Context.current()); + } + + @Override + public TagContextBuilder emptyBuilder() { + return new FakeTagContextBuilder(ImmutableMap.of()); + } + + @Override + public FakeTagContextBuilder toBuilder(TagContext tags) { + return new FakeTagContextBuilder(getTags(tags)); + } + + @Override + public TagContextBuilder currentBuilder() { + throw new UnsupportedOperationException(); + } + + @Override + public Scope withTagContext(TagContext tags) { + throw new UnsupportedOperationException(); + } + } + + public static final class FakeStatsRecord extends MeasureMap { + private final BlockingQueue recordSink; + public final Map metrics = Maps.newHashMap(); + + private FakeStatsRecord(FakeStatsRecorder statsRecorder) { + this.recordSink = statsRecorder.getCurrentRecordSink(); + } + + @Override + public MeasureMap put(Measure.MeasureDouble measure, double value) { + metrics.put(measure, value); + return this; + } + + @Override + public MeasureMap put(Measure.MeasureLong measure, long value) { + metrics.put(measure, value); + return this; + } + + @Override + public void record(TagContext tags) { + recordSink.add(new MetricsRecord(getTags(tags), ImmutableMap.copyOf(metrics))); + } + + @Override + public void record() { + throw new UnsupportedOperationException(); + } + } + + public static final class FakeTagContext extends TagContext { + private static final FakeTagContext EMPTY = + new FakeTagContext(ImmutableMap.of()); + + private static final TagMetadata METADATA_PROPAGATING = + TagMetadata.create(TagTtl.UNLIMITED_PROPAGATION); + + private final ImmutableMap tags; + + private FakeTagContext(ImmutableMap tags) { + this.tags = tags; + } + + public ImmutableMap getTags() { + return tags; + } + + @Override + public String toString() { + return "[tags=" + tags + "]"; + } + + @Override + protected Iterator getIterator() { + return Iterators.transform( + tags.entrySet().iterator(), + new Function, Tag>() { + @Override + public Tag apply(@Nullable Map.Entry entry) { + return Tag.create(entry.getKey(), entry.getValue(), METADATA_PROPAGATING); + } + }); + } + } + + public static class FakeTagContextBuilder extends TagContextBuilder { + + private final Map tagsBuilder = Maps.newHashMap(); + + private FakeTagContextBuilder(Map tags) { + tagsBuilder.putAll(tags); + } + + @SuppressWarnings("deprecation") + @Override + public TagContextBuilder put(TagKey key, TagValue value) { + tagsBuilder.put(key, value); + return this; + } + + @Override + public TagContextBuilder remove(TagKey key) { + tagsBuilder.remove(key); + return this; + } + + @Override + public TagContext build() { + FakeTagContext context = new FakeTagContext(ImmutableMap.copyOf(tagsBuilder)); + return context; + } + + @Override + public Scope buildScoped() { + throw new UnsupportedOperationException(); + } + } + + // This method handles the default TagContext, which isn't an instance of FakeTagContext. + private static ImmutableMap getTags(TagContext tags) { + return tags instanceof FakeTagContext + ? ((FakeTagContext) tags).getTags() + : ImmutableMap.of(); + } + + public static long getAggregationValueAsLong( + StatsComponent stats, + View view, + ImmutableMap tags, + String projectId, + String instanceId, + String appProfileId) { + ViewData viewData = stats.getViewManager().getView(view.getName()); + Map, AggregationData> aggregationMap = + Objects.requireNonNull(viewData).getAggregationMap(); + + List tagValues = new ArrayList<>(); + + for (TagKey column : view.getColumns()) { + if (RpcMeasureConstants.BIGTABLE_PROJECT_ID == column) { + tagValues.add(TagValue.create(projectId)); + } else if (RpcMeasureConstants.BIGTABLE_INSTANCE_ID == column) { + tagValues.add(TagValue.create(instanceId)); + } else if (RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID == column) { + tagValues.add(TagValue.create(appProfileId)); + } else { + tagValues.add(tags.get(column)); + } + } + + AggregationData aggregationData = aggregationMap.get(tagValues); + + if (aggregationData == null) { + throw new RuntimeException( + "Failed to find metric for: " + tags + ". Current aggregation data: " + aggregationMap); + } + + return aggregationData.match( + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.SumDataDouble arg) { + return (long) arg.getSum(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.SumDataLong arg) { + return arg.getSum(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.CountData arg) { + return arg.getCount(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.DistributionData arg) { + return (long) arg.getMean(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.LastValueDataDouble arg) { + return (long) arg.getLastValue(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData.LastValueDataLong arg) { + return arg.getLastValue(); + } + }, + new io.opencensus.common.Function() { + @Override + public Long apply(AggregationData arg) { + throw new UnsupportedOperationException(); + } + }); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java new file mode 100644 index 000000000000..548a53600c17 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java @@ -0,0 +1,1245 @@ +/* + * 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.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getAggregatedDoubleValue; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getAggregatedValue; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getMetricData; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.verifyAttributes; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertThrows; + +import com.google.api.client.util.Lists; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.BatchingException; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.BigtableGrpc; +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.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ResponseParams; +import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlFactor; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlTargetQps; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableApplicationBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableClientBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableConnectivityErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableFirstResponseLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRetryCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableServerLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +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.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.common.base.Stopwatch; +import com.google.common.collect.Comparators; +import com.google.common.collect.Range; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.ForwardingServerCall; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.ProxiedSocketAddress; +import io.grpc.ProxyDetector; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.ServerCallStreamObserver; +import io.grpc.stub.StreamObserver; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.net.SocketAddress; +import java.nio.charset.Charset; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class BuiltinMetricsTracerTest { + private static final Metadata.Key LOCATION_METADATA_KEY = + Metadata.Key.of("x-goog-ext-425905942-bin", Metadata.BINARY_BYTE_MARSHALLER); + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String APP_PROFILE_ID = "default"; + private static final TableId TABLE = TableId.of("fake-table"); + + private static final String BAD_TABLE_ID = "non-exist-table"; + private static final String FIRST_RESPONSE_TABLE_ID = "first-response"; + private static final String ZONE = "us-west-1"; + private static final String CLUSTER = "cluster-0"; + private static final long FAKE_SERVER_TIMING = 50; + private static final long SERVER_LATENCY = 100; + private static final long APPLICATION_LATENCY = 200; + private static final long SLEEP_VARIABILITY = 15; + private static final String CLIENT_NAME = "java-bigtable/" + Version.VERSION; + private static final Duration CHANNEL_BLOCKING_LATENCY = Duration.ofMillis(200); + + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + private final FakeService fakeService = new FakeService(); + private Server server; + + private OpenTelemetrySdk otel; + private EnhancedBigtableStub stub; + + private static final int batchElementCount = 2; + + private final ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .build(); + private final Attributes expectedBaseAttributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, PROJECT_ID) + .put(TableSchema.INSTANCE_ID_KEY, INSTANCE_ID) + .put(MetricLabels.APP_PROFILE_KEY, APP_PROFILE_ID) + .build(); + + private final Attributes expectedClientSchemaBaseAttributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, PROJECT_ID) + .put(TableSchema.INSTANCE_ID_KEY, INSTANCE_ID) + .put(MetricLabels.APP_PROFILE_KEY, APP_PROFILE_ID) + .put(MetricLabels.CLIENT_NAME, "java-bigtable/" + Version.VERSION) + .build(); + + private InMemoryMetricReader metricReader; + + private DelayProxyDetector delayProxyDetector; + + private final OutstandingRpcCounter outstandingRpcCounter = new OutstandingRpcCounter(); + + @Before + public void setUp() throws Exception { + metricReader = InMemoryMetricReader.create(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + + otel = OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + MetricRegistry mr = new MetricRegistry(); + + BuiltinMetricsTracerFactory facotry = + new BuiltinMetricsTracerFactory( + mr.newInternalRecorderRegistry(otel.getMeterProvider()), clientInfo); + + // Add an interceptor to add server-timing in headers + ServerInterceptor trailersInterceptor = + new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + return serverCallHandler.startCall( + new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { + @Override + public void sendHeaders(Metadata headers) { + headers.put( + Metadata.Key.of("server-timing", Metadata.ASCII_STRING_MARSHALLER), + String.format("gfet4t7; dur=%d", FAKE_SERVER_TIMING)); + + ResponseParams params = + ResponseParams.newBuilder().setZoneId(ZONE).setClusterId(CLUSTER).build(); + byte[] byteArray = params.toByteArray(); + headers.put(LOCATION_METADATA_KEY, byteArray); + + super.sendHeaders(headers); + } + }, + metadata); + } + }; + + server = FakeServiceBuilder.create(fakeService).intercept(trailersInterceptor).start(); + + BigtableDataSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + .build(); + EnhancedBigtableStubSettings.Builder stubSettingsBuilder = + settings.getStubSettings().toBuilder(); + stubSettingsBuilder + .mutateRowSettings() + .retrySettings() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(200)); + + stubSettingsBuilder + .readRowsSettings() + .retrySettings() + .setTotalTimeoutDuration(Duration.ofMillis(9000)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(9000)) + .setRpcTimeoutMultiplier(1) + .setInitialRpcTimeoutDuration(Duration.ofMillis(6000)) + .setInitialRetryDelayDuration(Duration.ofMillis(10)) + .setRetryDelayMultiplier(1) + .setMaxRetryDelayDuration(Duration.ofMillis(10)); + + stubSettingsBuilder + .bulkMutateRowsSettings() + .setServerInitiatedFlowControl(true) + .setBatchingSettings( + // Each batch has 2 mutations, batch has 1 in-flight request, disable auto flush by + // setting the delay to 1 hour. + BatchingSettings.newBuilder() + .setElementCountThreshold((long) batchElementCount) + .setRequestByteThreshold(1000L) + .setDelayThresholdDuration(java.time.Duration.ofHours(1)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount((long) batchElementCount + 1) + .setMaxOutstandingRequestBytes(1001L) + .build()) + .build()); + + stubSettingsBuilder.setTracerFactory(facotry); + + InstantiatingGrpcChannelProvider.Builder channelProvider = + ((InstantiatingGrpcChannelProvider) stubSettingsBuilder.getTransportChannelProvider()) + .toBuilder(); + + @SuppressWarnings("rawtypes") + final ApiFunction oldConfigurator = + channelProvider.getChannelConfigurator(); + + delayProxyDetector = new DelayProxyDetector(); + + channelProvider.setChannelConfigurator( + (builder) -> { + if (oldConfigurator != null) { + builder = oldConfigurator.apply(builder); + } + return builder.proxyDetector(delayProxyDetector).intercept(outstandingRpcCounter); + }); + stubSettingsBuilder.setTransportChannelProvider(channelProvider.build()); + stub = EnhancedBigtableStub.create(stubSettingsBuilder.build()); + } + + @After + public void tearDown() { + stub.close(); + server.shutdown(); + otel.close(); + } + + @Test + public void testReadRowsOperationLatencies() { + Stopwatch stopwatch = Stopwatch.createStarted(); + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE)).iterator()); + long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.STREAMING_KEY, true) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + MetricData metricData = getMetricData(metricReader, TableOperationLatency.NAME); + + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isIn(Range.closed(SERVER_LATENCY, elapsed)); + } + + @Test + public void testReadRowsOperationLatenciesOnAuthorizedView() { + String authorizedViewId = "test-authorized-view-id"; + Stopwatch stopwatch = Stopwatch.createStarted(); + Lists.newArrayList( + stub.readRowsCallable().call(Query.create(AuthorizedViewId.of(TABLE, authorizedViewId)))); + long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.STREAMING_KEY, true) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + MetricData metricData = getMetricData(metricReader, TableOperationLatency.NAME); + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isIn(Range.closed(SERVER_LATENCY, elapsed)); + } + + @Test + public void testFirstResponseLatencies() { + Stopwatch firstResponseTimer = Stopwatch.createStarted(); + stub.readRowsCallable() + .call( + Query.create(TableId.of(FIRST_RESPONSE_TABLE_ID)), + new ResponseObserver() { + @Override + public void onStart(StreamController controller) {} + + @Override + public void onResponse(Row response) { + // Server sends back 2 responses for this test + if (firstResponseTimer.isRunning()) { + firstResponseTimer.stop(); + } + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + // dont really care + } + } + + @Override + public void onError(Throwable t) {} + + @Override + public void onComplete() {} + }); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, FIRST_RESPONSE_TABLE_ID) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + MetricData metricData = getMetricData(metricReader, TableFirstResponseLatency.NAME); + + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isAtMost(firstResponseTimer.elapsed(TimeUnit.MILLISECONDS)); + } + + @Test + public void testGfeMetrics() { + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE))); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.STREAMING_KEY, true) + .build(); + + MetricData serverLatenciesMetricData = getMetricData(metricReader, TableServerLatency.NAME); + + long serverLatencies = getAggregatedValue(serverLatenciesMetricData, expectedAttributes); + assertThat(serverLatencies).isEqualTo(FAKE_SERVER_TIMING); + + MetricData connectivityErrorCountMetricData = + getMetricData(metricReader, TableConnectivityErrorCount.NAME); + Attributes expected1 = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "UNAVAILABLE") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, "global") + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + Attributes expected2 = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + verifyAttributes(connectivityErrorCountMetricData, expected1); + verifyAttributes(connectivityErrorCountMetricData, expected2); + + assertThat(getAggregatedValue(connectivityErrorCountMetricData, expected1)).isEqualTo(1); + assertThat(getAggregatedValue(connectivityErrorCountMetricData, expected2)).isEqualTo(0); + } + + @Test + public void testReadRowsApplicationLatencyWithAutoFlowControl() throws Exception { + final SettableApiFuture future = SettableApiFuture.create(); + final AtomicInteger counter = new AtomicInteger(0); + // For auto flow control, application latency is the time application spent in onResponse. + stub.readRowsCallable() + .call( + Query.create(TABLE), + new ResponseObserver() { + @Override + public void onStart(StreamController streamController) {} + + @Override + public void onResponse(Row row) { + counter.getAndIncrement(); + try { + Thread.sleep(APPLICATION_LATENCY); + } catch (InterruptedException ignored) { + // dont really care + } + } + + @Override + public void onError(Throwable throwable) { + future.setException(throwable); + } + + @Override + public void onComplete() { + future.set(null); + } + }); + future.get(); + + assertThat(counter.get()).isEqualTo(fakeService.getResponseCounter().get()); + + MetricData applicationLatency = + getMetricData(metricReader, TableApplicationBlockingLatency.NAME); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .build(); + long value = getAggregatedValue(applicationLatency, expectedAttributes); + + assertThat(value).isAtLeast((APPLICATION_LATENCY - SLEEP_VARIABILITY) * counter.get()); + + MetricData operationLatency = getMetricData(metricReader, TableOperationLatency.NAME); + long operationLatencyValue = + getAggregatedValue( + operationLatency, + expectedAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(MetricLabels.STREAMING_KEY, true) + .build()); + assertThat(value).isAtMost(operationLatencyValue - SERVER_LATENCY); + } + + @Test + public void testReadRowsApplicationLatencyWithManualFlowControl() throws Exception { + int counter = 0; + + Iterator rows = stub.readRowsCallable().call(Query.create(TABLE)).iterator(); + while (rows.hasNext()) { + counter++; + Thread.sleep(APPLICATION_LATENCY); + rows.next(); + } + + MetricData applicationLatency = + getMetricData(metricReader, TableApplicationBlockingLatency.NAME); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .build(); + + long value = getAggregatedValue(applicationLatency, expectedAttributes); + // For manual flow control, the last application latency shouldn't count, because at that + // point the server already sent back all the responses. + assertThat(counter).isEqualTo(fakeService.getResponseCounter().get()); + assertThat(value).isAtLeast(APPLICATION_LATENCY * (counter - 1) - SERVER_LATENCY); + + MetricData operationLatency = getMetricData(metricReader, TableOperationLatency.NAME); + long operationLatencyValue = + getAggregatedValue( + operationLatency, + expectedAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(MetricLabels.STREAMING_KEY, true) + .build()); + assertThat(value).isAtMost(operationLatencyValue - SERVER_LATENCY); + } + + @Test + public void testRetryCount() throws InterruptedException { + stub.mutateRowCallable() + .call(RowMutation.create(TABLE, "random-row").setCell("cf", "q", "value")); + + MetricData metricData = getMetricData(metricReader, TableRetryCount.NAME); + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRow") + .put(MetricLabels.STATUS_KEY, "OK") + .build(); + + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isEqualTo(fakeService.getAttemptCounter().get() - 1); + } + + @Test + public void testMutateRowAttemptsTagValues() throws InterruptedException { + stub.mutateRowCallable() + .call(RowMutation.create(TABLE, "random-row").setCell("cf", "q", "value")); + + outstandingRpcCounter.waitUntilRpcsDone(); + MetricData metricData = getMetricData(metricReader, TableAttemptLatency.NAME); + + Attributes expected1 = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "UNAVAILABLE") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, "global") + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRow") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, false) + .build(); + + Attributes expected2 = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRow") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, false) + .build(); + + verifyAttributes(metricData, expected1); + verifyAttributes(metricData, expected2); + } + + @Test + public void testMutateRowsPartialError() throws InterruptedException { + Batcher batcher = stub.newMutateRowsBatcher(TABLE, null); + int numMutations = 6; + for (int i = 0; i < numMutations; i++) { + String key = i % 2 == 0 ? "key" : "fail-key"; + ApiFuture ignored = batcher.add(RowMutationEntry.create(key).setCell("f", "q", "v")); + } + + assertThrows(BatchingException.class, batcher::close); + + MetricData metricData = getMetricData(metricReader, TableAttemptLatency.NAME); + + Attributes expected = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, false) + .build(); + + verifyAttributes(metricData, expected); + } + + @Test + public void testMutateRowsRpcError() { + Batcher batcher = + stub.newMutateRowsBatcher(TableId.of(BAD_TABLE_ID), null); + int numMutations = 6; + for (int i = 0; i < numMutations; i++) { + String key = i % 2 == 0 ? "key" : "fail-key"; + ApiFuture ignored = batcher.add(RowMutationEntry.create(key).setCell("f", "q", "v")); + } + + assertThrows(BatchingException.class, batcher::close); + + MetricData metricData = getMetricData(metricReader, TableAttemptLatency.NAME); + + Attributes expected = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "NOT_FOUND") + .put(TableSchema.TABLE_ID_KEY, BAD_TABLE_ID) + .put(TableSchema.ZONE_ID_KEY, "global") + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, false) + .build(); + + verifyAttributes(metricData, expected); + } + + @Test + public void testReadRowsAttemptsTagValues() { + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE)).iterator()); + + MetricData metricData = getMetricData(metricReader, TableAttemptLatency.NAME); + + Attributes expected1 = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "UNAVAILABLE") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, "global") + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, true) + .build(); + + Attributes expected2 = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .put(MetricLabels.STREAMING_KEY, true) + .build(); + + verifyAttributes(metricData, expected1); + verifyAttributes(metricData, expected2); + } + + @Test + public void testBatchBlockingLatencies() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + for (int i = 0; i < 6; i++) { + ApiFuture ignored = + batcher.add(RowMutationEntry.create("key").setCell("f", "q", "v")); + } + + // closing the batcher to trigger the third flush + batcher.close(); + + int expectedNumRequests = 6 / batchElementCount; + + MetricData applicationLatency = getMetricData(metricReader, TableClientBlockingLatency.NAME); + + Attributes expectedAttributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + long value = getAggregatedValue(applicationLatency, expectedAttributes); + // After the first request is sent, batcher will block on add because of the server latency. + // Blocking latency should be around server latency. So each data point would be at least + // (SERVER_LATENCY - 10). + long expected = (SERVER_LATENCY - 10) * (expectedNumRequests - 1) / expectedNumRequests; + assertThat(value).isAtLeast(expected); + } + } + + @Test + public void testQueuedOnChannelServerStreamLatencies() throws Exception { + ApiFuture> f = stub.readRowsCallable().all().futureCall(Query.create(TABLE)); + Duration proxyDelayPriorTest = delayProxyDetector.getCurrentDelayUsed(); + f.get(); + + MetricData clientLatency = getMetricData(metricReader, TableClientBlockingLatency.NAME); + + Attributes attributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + assertThat(Duration.ofMillis(getAggregatedValue(clientLatency, attributes))) + .isAtLeast( + // Offset the expected latency to deal with asynchrony and jitter + CHANNEL_BLOCKING_LATENCY.minus( + Comparators.max(proxyDelayPriorTest, Duration.ofMillis(1)))); + } + + @Test + public void testQueuedOnChannelUnaryLatencies() throws Exception { + ApiFuture f = + stub.mutateRowCallable() + .futureCall(RowMutation.create(TABLE, "a-key").setCell("f", "q", "v")); + Duration proxyDelayPriorTest = delayProxyDetector.getCurrentDelayUsed(); + f.get(); + + outstandingRpcCounter.waitUntilRpcsDone(); + MetricData clientLatency = getMetricData(metricReader, TableClientBlockingLatency.NAME); + + Attributes attributes = + expectedBaseAttributes.toBuilder() + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRow") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + assertThat(Duration.ofMillis(getAggregatedValue(clientLatency, attributes))) + .isAtLeast( + // Offset the expected latency to deal with asynchrony and jitter + CHANNEL_BLOCKING_LATENCY.minus( + Comparators.max(proxyDelayPriorTest, Duration.ofMillis(1)))); + } + + @Test + public void testPermanentFailure() { + assertThrows( + NotFoundException.class, + () -> + Lists.newArrayList( + stub.readRowsCallable().call(Query.create(TableId.of(BAD_TABLE_ID))).iterator())); + + MetricData attemptLatency = getMetricData(metricReader, TableAttemptLatency.NAME); + + Attributes expected = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "NOT_FOUND") + .put(TableSchema.TABLE_ID_KEY, BAD_TABLE_ID) + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(TableSchema.ZONE_ID_KEY, "global") + .put(MetricLabels.STREAMING_KEY, true) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + + verifyAttributes(attemptLatency, expected); + + MetricData opLatency = getMetricData(metricReader, TableOperationLatency.NAME); + verifyAttributes(opLatency, expected); + } + + @Test + public void testRemainingDeadline() { + stub.readRowsCallable().all().call(Query.create(TABLE)); + MetricData deadlineMetric = getMetricData(metricReader, TableRemainingDeadline.NAME); + + Attributes retryAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "UNAVAILABLE") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(TableSchema.ZONE_ID_KEY, "global") + .put(TableSchema.CLUSTER_ID_KEY, "") + .put(MetricLabels.STREAMING_KEY, true) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + HistogramPointData retryHistogramPointData = + deadlineMetric.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(retryAttributes)) + .collect(Collectors.toList()) + .get(0); + + double retryRemainingDeadline = retryHistogramPointData.getSum(); + // The retry remaining deadline should be equivalent to the original timeout. + assertThat(retryRemainingDeadline).isEqualTo(9000); + + Attributes okAttributes = + expectedBaseAttributes.toBuilder() + .put(MetricLabels.STATUS_KEY, "OK") + .put(TableSchema.TABLE_ID_KEY, TABLE.getTableId()) + .put(TableSchema.ZONE_ID_KEY, ZONE) + .put(TableSchema.CLUSTER_ID_KEY, CLUSTER) + .put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows") + .put(MetricLabels.STREAMING_KEY, true) + .put(MetricLabels.CLIENT_NAME, CLIENT_NAME) + .build(); + HistogramPointData okHistogramPointData = + deadlineMetric.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(okAttributes)) + .collect(Collectors.toList()) + .get(0); + + double okRemainingDeadline = okHistogramPointData.getSum(); + // first attempt latency + retry delay + double expected = 9000 - SERVER_LATENCY - CHANNEL_BLOCKING_LATENCY.toMillis() - 10; + assertThat(okRemainingDeadline).isIn(Range.closed(expected - 500, expected + 10)); + } + + @Test + public void testBatchWriteFlowControlTargetQpsIncreased() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("batch-write-flow-control-success-12") + .setCell("f", "q", "v")); + + // closing the batcher to trigger the flush + batcher.close(); + + MetricData targetQpsMetric = + getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME); + Attributes targetQpsAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .build(); + double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes); + double expected_qps = 12; + assertThat(actual_qps).isEqualTo(expected_qps); + + MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME); + Attributes factorAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(ClientSchema.CLIENT_NAME, "java-bigtable/" + Version.VERSION) + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.APPLIED_KEY, true) + .put(MetricLabels.STATUS_KEY, "OK") + .build(); + double actual_factor_mean = getAggregatedDoubleValue(factorMetric, factorAttributes); + double expected_factor_mean = 1.2; + assertThat(actual_factor_mean).isEqualTo(expected_factor_mean); + } + } + + @Test + public void testBatchWriteFlowControlTargetQpsDecreased() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("batch-write-flow-control-success-08") + .setCell("f", "q", "v")); + + // closing the batcher to trigger the flush + batcher.close(); + + MetricData targetQpsMetric = + getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME); + Attributes targetQpsAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .build(); + double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes); + double expected_qps = 8.0; + assertThat(actual_qps).isEqualTo(expected_qps); + + MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME); + Attributes factorAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.APPLIED_KEY, true) + .put(MetricLabels.STATUS_KEY, "OK") + .build(); + double actual_factor_mean = getAggregatedDoubleValue(factorMetric, factorAttributes); + double expected_factor_mean = 0.8; + assertThat(actual_factor_mean).isEqualTo(expected_factor_mean); + } + } + + @Test + public void testBatchWriteFlowControlTargetQpsCappedOnMaxFactor() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("batch-write-flow-control-success-18") + .setCell("f", "q", "v")); + + // closing the batcher to trigger the flush + batcher.close(); + + MetricData targetQpsMetric = + getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME); + Attributes targetQpsAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .build(); + double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes); + // Factor is 1.8 but capped at 1.3 so updated QPS is 13. + double expected_qps = 13; + assertThat(actual_qps).isEqualTo(expected_qps); + + MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME); + Attributes factorAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.APPLIED_KEY, true) + .put(MetricLabels.STATUS_KEY, "OK") + .build(); + double actual_factor_mean = getAggregatedDoubleValue(factorMetric, factorAttributes); + // Factor is 1.8 but capped at 1.3 + double expected_factor_mean = 1.3; + assertThat(actual_factor_mean).isEqualTo(expected_factor_mean); + } + } + + @Test + public void testBatchWriteFlowControlTargetQpsCappedOnMinFactor() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("batch-write-flow-control-success-05") + .setCell("f", "q", "v")); + + // closing the batcher to trigger the flush + batcher.close(); + + MetricData targetQpsMetric = + getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME); + Attributes targetQpsAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .build(); + double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes); + // Factor is 0.5 but capped at 0.7 so updated QPS is 7. + double expected_qps = 7; + assertThat(actual_qps).isEqualTo(expected_qps); + + MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME); + Attributes factorAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.APPLIED_KEY, true) + .put(MetricLabels.STATUS_KEY, "OK") + .build(); + double actual_factor_mean = getAggregatedDoubleValue(factorMetric, factorAttributes); + // Factor is 0.5 but capped at 0.7 + double expected_factor_mean = 0.7; + assertThat(actual_factor_mean).isEqualTo(expected_factor_mean); + } + } + + @Test + public void testBatchWriteFlowControlTargetQpsDecreasedForError() throws InterruptedException { + try (Batcher batcher = stub.newMutateRowsBatcher(TABLE, null)) { + ApiFuture ignored = + batcher.add( + RowMutationEntry.create("batch-write-flow-control-fail-unavailable") + .setCell("f", "q", "v")); + + // closing the batcher to trigger the flush + batcher.close(); + + MetricData targetQpsMetric = + getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME); + Attributes targetQpsAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .build(); + double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes); + // On error, min factor is applied. + double expected_qps = 7; + assertThat(actual_qps).isEqualTo(expected_qps); + + MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME); + Attributes factorAttributes = + expectedClientSchemaBaseAttributes.toBuilder() + .put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows") + .put(MetricLabels.APPLIED_KEY, true) + .put(MetricLabels.STATUS_KEY, "UNAVAILABLE") + .build(); + double actual_factor_mean = getAggregatedDoubleValue(factorMetric, factorAttributes); + // On error, min factor is applied. + double expected_factor_mean = 0.7; + assertThat(actual_factor_mean).isEqualTo(expected_factor_mean); + } + } + + private static class FakeService extends BigtableGrpc.BigtableImplBase { + + static List createFakeResponse() { + List responses = new ArrayList<>(); + for (int i = 0; i < 4; i++) { + responses.add( + ReadRowsResponse.newBuilder() + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("fake-key-" + i)) + .setFamilyName(StringValue.of("cf")) + .setQualifier( + BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q"))) + .setTimestampMicros(1_000) + .setValue( + ByteString.copyFromUtf8( + String.join("", Collections.nCopies(1024 * 1024, "A")))) + .setCommitRow(true)) + .build()); + } + return responses; + } + + private final AtomicInteger attemptCounter = new AtomicInteger(0); + private final AtomicInteger responseCounter = new AtomicInteger(0); + private final Iterator source = createFakeResponse().listIterator(); + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + if (request.getTableName().contains(FIRST_RESPONSE_TABLE_ID)) { + responseObserver.onNext(source.next()); + responseObserver.onNext(source.next()); + responseObserver.onCompleted(); + return; + } + if (request.getTableName().contains(BAD_TABLE_ID)) { + responseObserver.onError(new StatusRuntimeException(Status.NOT_FOUND)); + return; + } + final AtomicBoolean done = new AtomicBoolean(); + final ServerCallStreamObserver target = + (ServerCallStreamObserver) responseObserver; + try { + Thread.sleep(SERVER_LATENCY); + } catch (InterruptedException ignored) { + // dont care + } + if (attemptCounter.getAndIncrement() == 0) { + target.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + + // Only return the next response when the buffer is emptied for testing manual flow control. + // The fake service won't keep calling onNext unless it received an onRequest event from + // the application thread + target.setOnReadyHandler( + () -> { + while (target.isReady() && source.hasNext()) { + responseCounter.getAndIncrement(); + target.onNext(source.next()); + } + if (!source.hasNext() && done.compareAndSet(false, true)) { + target.onCompleted(); + } + }); + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + if (attemptCounter.getAndIncrement() < 2) { + responseObserver.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + if (request.getTableName().contains(BAD_TABLE_ID)) { + responseObserver.onError(new StatusRuntimeException(Status.NOT_FOUND)); + return; + } + try { + Thread.sleep(SERVER_LATENCY); + } catch (InterruptedException ignored) { + // dont care + } + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + String receivedRowkey = ""; + for (int i = 0; i < request.getEntriesCount(); i++) { + receivedRowkey = + request.getEntries(i).getRowKey().toString(Charset.availableCharsets().get("UTF-8")); + if (request + .getEntries(i) + .getRowKey() + .toString(Charset.availableCharsets().get("UTF-8")) + .startsWith("fail")) { + builder + .addEntriesBuilder() + .setIndex(i) + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(com.google.rpc.Code.PERMISSION_DENIED_VALUE) + .build()); + continue; + } + builder.addEntriesBuilder().setIndex(i); + } + + // Add RateLimitInfo for Batch Write Flow Control + com.google.protobuf.Duration duration = + builder.getRateLimitInfoBuilder().getPeriodBuilder().setSeconds(10).build(); + if (receivedRowkey.equals("batch-write-flow-control-success-18")) { + builder.setRateLimitInfo( + builder.getRateLimitInfoBuilder().setFactor(1.8).setPeriod(duration).build()); + } else if (receivedRowkey.equals("batch-write-flow-control-success-12")) { + builder.setRateLimitInfo( + builder.getRateLimitInfoBuilder().setFactor(1.2).setPeriod(duration).build()); + } else if (receivedRowkey.equals("batch-write-flow-control-success-08")) { + builder.setRateLimitInfo( + builder.getRateLimitInfoBuilder().setFactor(0.8).setPeriod(duration).build()); + } else if (receivedRowkey.equals("batch-write-flow-control-success-05")) { + builder.setRateLimitInfo( + builder.getRateLimitInfoBuilder().setFactor(0.5).setPeriod(duration).build()); + } else if (receivedRowkey.equals("batch-write-flow-control-fail-unavailable")) { + if (getAttemptCounter().get() > 0) { + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + return; + } + getAttemptCounter().incrementAndGet(); + responseObserver.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + public AtomicInteger getAttemptCounter() { + return attemptCounter; + } + + public AtomicInteger getResponseCounter() { + return responseCounter; + } + } + + static class OutstandingRpcCounter implements ClientInterceptor { + private int numOutstandingRpcs = 0; + private final Object lock = new Object(); + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + synchronized (lock) { + numOutstandingRpcs++; + } + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + super.onClose(status, trailers); + synchronized (lock) { + numOutstandingRpcs--; + lock.notify(); + } + } + }, + headers); + } + }; + } + + void waitUntilRpcsDone() throws InterruptedException { + synchronized (lock) { + while (numOutstandingRpcs > 0) { + lock.wait(); + } + } + } + } + + static class DelayProxyDetector implements ProxyDetector { + private volatile Instant lastProxyDelay = null; + + @Nullable + @Override + public ProxiedSocketAddress proxyFor(SocketAddress socketAddress) throws IOException { + lastProxyDelay = Instant.now(); + try { + Thread.sleep(CHANNEL_BLOCKING_LATENCY.toMillis()); + } catch (InterruptedException ignored) { + // dont care + } + return null; + } + + Duration getCurrentDelayUsed() { + Instant local = lastProxyDelay; + // If the delay was never injected - add 1 ms for channel establishment + if (local == null) { + return Duration.ofMillis(1); + } + Duration duration = + Duration.between(local, Instant.now()).plus(Duration.of(10, ChronoUnit.MICROS)); + + assertWithMessage("test burned through all channel blocking latency during setup") + .that(duration) + .isLessThan(CHANNEL_BLOCKING_LATENCY); + + return duration; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java new file mode 100644 index 000000000000..8f835db87db9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java @@ -0,0 +1,362 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientChannelPoolOutstandingRpcs; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientPerConnectionErrorCount; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelObserver; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolObserver; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings.LoadBalancingStrategy; +import com.google.common.collect.ImmutableList; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.stubbing.Answer; + +@RunWith(JUnit4.class) +public class ChannelPoolMetricsTracerTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String APP_PROFILE_ID = "fake-profile"; + + @Rule public final MockitoRule mockito = MockitoJUnit.rule(); + + private InMemoryMetricReader metricReader; + @Mock private ScheduledExecutorService mockScheduler; + private ArgumentCaptor runnableCaptor; + + private ChannelPoolMetricsTracer tracker; + + @Mock private BigtableChannelPoolObserver mockInsightsProvider; + @Mock private BigtableChannelObserver mockInsight1; + @Mock private BigtableChannelObserver mockInsight2; + + @Before + public void setUp() { + metricReader = InMemoryMetricReader.create(); + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .build(); + SdkMeterProvider meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader).build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider).build(); + + MetricRegistry mr = new MetricRegistry(); + + tracker = + new ChannelPoolMetricsTracer( + mr.newInternalRecorderRegistry(openTelemetry.getMeterProvider()), clientInfo); + + runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + // Configure mockScheduler to capture the runnable when tracker.start() is called + when(mockScheduler.scheduleAtFixedRate(runnableCaptor.capture(), anyLong(), anyLong(), any())) + .then((Answer>) invocation -> Mockito.mock(ScheduledFuture.class)); + + // Default stubbing for insights provider + List defaultInsights = ImmutableList.of(mockInsight1, mockInsight2); + when(mockInsightsProvider.getChannelInfos()).thenAnswer(invocation -> defaultInsights); + // Default stubbing for observer methods + when(mockInsight1.getOutstandingUnaryRpcs()).thenReturn(0); + when(mockInsight1.getOutstandingStreamingRpcs()).thenReturn(0); + when(mockInsight1.getAndResetErrorCount()).thenReturn(0L); + when(mockInsight1.getAndResetSuccessCount()).thenReturn(0L); + when(mockInsight2.getOutstandingUnaryRpcs()).thenReturn(0); + when(mockInsight2.getOutstandingStreamingRpcs()).thenReturn(0); + when(mockInsight2.getAndResetErrorCount()).thenReturn(0L); + when(mockInsight2.getAndResetSuccessCount()).thenReturn(0L); + when(mockInsight1.getTransportType()) + .thenReturn(PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH); + when(mockInsight2.getTransportType()) + .thenReturn(PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH); + } + + /** Helper to run the captured ChannelPoolMetricsTracer task. */ + void runTrackerTask() { + List capturedRunnables = runnableCaptor.getAllValues(); + assertThat(capturedRunnables).hasSize(1); // Expect only one task scheduled + Runnable trackerRunnable = capturedRunnables.get(0); + assertThat(trackerRunnable).isInstanceOf(ChannelPoolMetricsTracer.class); + trackerRunnable.run(); + } + + private Attributes getExpectedErrorAttributes() { + return Attributes.builder() + .put(AttributeKey.stringKey("project_id"), PROJECT_ID) + .put(AttributeKey.stringKey("instance"), INSTANCE_ID) + .put(AttributeKey.stringKey("app_profile"), APP_PROFILE_ID) + .put( + AttributeKey.stringKey("client_name"), + "java-bigtable/" + com.google.cloud.bigtable.Version.VERSION) + .build(); + } + + private static Attributes getExpectedRpcAttributes(String lbPolicy, boolean streaming) { + return Attributes.builder() + .put(AttributeKey.stringKey("project_id"), PROJECT_ID) + .put(AttributeKey.stringKey("instance"), INSTANCE_ID) + .put(AttributeKey.stringKey("app_profile"), APP_PROFILE_ID) + .put( + AttributeKey.stringKey("client_name"), + "java-bigtable/" + com.google.cloud.bigtable.Version.VERSION) + .put(AttributeKey.stringKey("transport_type"), "cloudpath") + .put(AttributeKey.stringKey("lb_policy"), lbPolicy) + .put(AttributeKey.booleanKey("streaming"), streaming) + .build(); + } + + private static Optional getMetricData( + Collection metrics, String metricName) { + return metrics.stream().filter(m -> m.getName().equals(metricName)).findFirst(); + } + + private static HistogramPointData getPointForStreaming( + Collection points, boolean streaming) { + return points.stream() + .filter( + p -> + Boolean.TRUE.equals(p.getAttributes().get(AttributeKey.booleanKey("streaming"))) + == streaming) + .findFirst() + .orElseThrow( + () -> new AssertionError("Missing HistogramPointData for streaming=" + streaming)); + } + + @Test + public void testSingleRun() { + // Arrange + tracker.registerChannelInsightsProvider(mockInsightsProvider); + tracker.registerLoadBalancingStrategy(LoadBalancingStrategy.LEAST_IN_FLIGHT); + ScheduledFuture ignored = tracker.start(mockScheduler); + + // Outstanding RPCs + when(mockInsight1.getOutstandingUnaryRpcs()).thenReturn(5); + when(mockInsight1.getOutstandingStreamingRpcs()).thenReturn(2); + when(mockInsight2.getOutstandingUnaryRpcs()).thenReturn(10); + when(mockInsight2.getOutstandingStreamingRpcs()).thenReturn(8); + // Error Counts + when(mockInsight1.getAndResetErrorCount()).thenReturn(1L); + when(mockInsight1.getAndResetSuccessCount()).thenReturn(9L); + when(mockInsight2.getAndResetErrorCount()).thenReturn(3L); + when(mockInsight2.getAndResetSuccessCount()).thenReturn(7L); + + runTrackerTask(); + + // Assert + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(2); + + // Assert Outstanding RPCs metric + Optional rpcMetricDataOpt = + getMetricData(metrics, ClientChannelPoolOutstandingRpcs.NAME); + assertThat(rpcMetricDataOpt.isPresent()).isTrue(); + MetricData rpcMetricData = rpcMetricDataOpt.get(); + Collection rpcPoints = rpcMetricData.getHistogramData().getPoints(); + assertThat(rpcPoints).hasSize(2); // One for streaming=false, one for streaming=true + + HistogramPointData unaryPoint = getPointForStreaming(rpcPoints, false); + assertThat(unaryPoint.getAttributes()) + .isEqualTo(getExpectedRpcAttributes("LEAST_IN_FLIGHT", false)); + assertThat(unaryPoint.getCount()).isEqualTo(2); + assertThat(unaryPoint.getSum()).isWithin(1e-9).of(15.0); // 5 + 10 + + HistogramPointData streamingPoint = getPointForStreaming(rpcPoints, true); + assertThat(streamingPoint.getAttributes()) + .isEqualTo(getExpectedRpcAttributes("LEAST_IN_FLIGHT", true)); + assertThat(streamingPoint.getCount()).isEqualTo(2); + assertThat(streamingPoint.getSum()).isWithin(1e-9).of(10.0); // 2 + 8 + + // Assert Error Count metric + Optional errorMetricDataOpt = + getMetricData(metrics, ClientPerConnectionErrorCount.NAME); + assertThat(errorMetricDataOpt.isPresent()).isTrue(); + MetricData errorMetricData = errorMetricDataOpt.get(); + Collection errorPoints = errorMetricData.getHistogramData().getPoints(); + assertThat(errorPoints).hasSize(1); + + HistogramPointData errorPoint = errorPoints.iterator().next(); + assertThat(errorPoint.getAttributes()).isEqualTo(getExpectedErrorAttributes()); + assertThat(errorPoint.getCount()).isEqualTo(2); // Two insights + assertThat(errorPoint.getSum()).isWithin(1e-9).of(4.0); // 1 + 3 + } + + @Test + public void testMultipleRuns() { + // Arrange + tracker.registerChannelInsightsProvider(mockInsightsProvider); + tracker.registerLoadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN); + ScheduledFuture ignored = tracker.start(mockScheduler); + + // First run + when(mockInsight1.getOutstandingUnaryRpcs()).thenReturn(1); + when(mockInsight1.getOutstandingStreamingRpcs()).thenReturn(2); + when(mockInsight2.getOutstandingUnaryRpcs()).thenReturn(3); + when(mockInsight2.getOutstandingStreamingRpcs()).thenReturn(4); + when(mockInsight1.getAndResetErrorCount()).thenReturn(1L); + when(mockInsight1.getAndResetSuccessCount()).thenReturn(1L); + when(mockInsight2.getAndResetErrorCount()).thenReturn(0L); + when(mockInsight2.getAndResetSuccessCount()).thenReturn(2L); + runTrackerTask(); + + // Second run - values change + when(mockInsight1.getOutstandingUnaryRpcs()).thenReturn(10); + when(mockInsight1.getOutstandingStreamingRpcs()).thenReturn(20); + when(mockInsight2.getOutstandingUnaryRpcs()).thenReturn(30); + when(mockInsight2.getOutstandingStreamingRpcs()).thenReturn(40); + when(mockInsight1.getAndResetErrorCount()).thenReturn(5L); + when(mockInsight1.getAndResetSuccessCount()).thenReturn(5L); + when(mockInsight2.getAndResetErrorCount()).thenReturn(2L); + when(mockInsight2.getAndResetSuccessCount()).thenReturn(8L); + runTrackerTask(); + + // Assert cumulative metrics + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(2); + + // Assert Outstanding RPCs + Optional rpcMetricDataOpt = + getMetricData(metrics, ClientChannelPoolOutstandingRpcs.NAME); + assertThat(rpcMetricDataOpt.isPresent()).isTrue(); + Collection rpcPoints = + rpcMetricDataOpt.get().getHistogramData().getPoints(); + assertThat(rpcPoints).hasSize(2); + + HistogramPointData unaryPoint = getPointForStreaming(rpcPoints, false); + assertThat(unaryPoint.getCount()).isEqualTo(4); // 2 insights * 2 runs + assertThat(unaryPoint.getSum()).isWithin(1e-9).of(44.0); // (1 + 3) + (10 + 30) + + HistogramPointData streamingPoint = getPointForStreaming(rpcPoints, true); + assertThat(streamingPoint.getCount()).isEqualTo(4); // 2 insights * 2 runs + assertThat(streamingPoint.getSum()).isWithin(1e-9).of(66.0); // (2 + 4) + (20 + 40) + + // Assert Error Counts + Optional errorMetricDataOpt = + getMetricData(metrics, ClientPerConnectionErrorCount.NAME); + assertThat(errorMetricDataOpt.isPresent()).isTrue(); + Collection errorPoints = + errorMetricDataOpt.get().getHistogramData().getPoints(); + assertThat(errorPoints).hasSize(1); + + HistogramPointData errorPoint = errorPoints.iterator().next(); + assertThat(errorPoint.getAttributes()).isEqualTo(getExpectedErrorAttributes()); + assertThat(errorPoint.getCount()).isEqualTo(4); // 2 insights * 2 runs + assertThat(errorPoint.getSum()).isWithin(1e-9).of(8.0); // (1 + 0) + (5 + 2) + } + + @Test + public void testErrorMetricsOnlyRecordedForAllChannels() { + // Arrange + tracker.registerChannelInsightsProvider(mockInsightsProvider); + ScheduledFuture ignored = tracker.start(mockScheduler); + + // Insight 1: Active (has successes) + when(mockInsight1.getAndResetErrorCount()).thenReturn(0L); + when(mockInsight1.getAndResetSuccessCount()).thenReturn(5L); + // Insight 2: Inactive + when(mockInsight2.getAndResetErrorCount()).thenReturn(0L); + when(mockInsight2.getAndResetSuccessCount()).thenReturn(0L); + + runTrackerTask(); + + Collection metrics = metricReader.collectAllMetrics(); + Optional errorMetricDataOpt = + getMetricData(metrics, ClientPerConnectionErrorCount.NAME); + assertThat(errorMetricDataOpt.isPresent()).isTrue(); + Collection errorPoints = + errorMetricDataOpt.get().getHistogramData().getPoints(); + assertThat(errorPoints).hasSize(1); + + HistogramPointData errorPoint = errorPoints.iterator().next(); + assertThat(errorPoint.getAttributes()).isEqualTo(getExpectedErrorAttributes()); + assertThat(errorPoint.getCount()).isEqualTo(2); // both channel recorded + assertThat(errorPoint.getSum()).isWithin(1e-9).of(0.0); // Recorded 0 errors + } + + @Test + public void testDefaultLbPolicy() { + // Arrange: Only register insights provider, not LB strategy + tracker.registerChannelInsightsProvider(mockInsightsProvider); + ScheduledFuture ignored = tracker.start(mockScheduler); + runTrackerTask(); + + Collection metrics = metricReader.collectAllMetrics(); + Optional rpcMetricDataOpt = + getMetricData(metrics, ClientChannelPoolOutstandingRpcs.NAME); + assertThat(rpcMetricDataOpt.isPresent()).isTrue(); + Collection points = rpcMetricDataOpt.get().getHistogramData().getPoints(); + + points.forEach( + point -> + assertThat(point.getAttributes().asMap()) + .containsEntry(AttributeKey.stringKey("lb_policy"), "ROUND_ROBIN")); + } + + @Test + public void testNoMetricsIfChannelInsightsProviderInactive() { + ScheduledFuture ignored = tracker.start(mockScheduler); + runTrackerTask(); + assertThat(metricReader.collectAllMetrics()).isEmpty(); + } + + @Test + public void testNoMetricsIfChannelInsightsEmpty() { + tracker.registerChannelInsightsProvider(mockInsightsProvider); + when(mockInsightsProvider.getChannelInfos()).thenReturn(ImmutableList.of()); + ScheduledFuture ignored = tracker.start(mockScheduler); + runTrackerTask(); + assertThat(metricReader.collectAllMetrics()).isEmpty(); + } + + @Test + public void testNoMetricsIfChannelInsightsNull() { + tracker.registerChannelInsightsProvider(mockInsightsProvider); + when(mockInsightsProvider.getChannelInfos()).thenReturn(null); + ScheduledFuture ignored = tracker.start(mockScheduler); + runTrackerTask(); + assertThat(metricReader.collectAllMetrics()).isEmpty(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerTest.java new file mode 100644 index 000000000000..c77f3e1e50f4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerTest.java @@ -0,0 +1,274 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracer.Scope; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.cloud.bigtable.misc_utilities.MethodComparator; +import com.google.common.collect.ImmutableList; +import java.lang.reflect.Method; +import java.util.Arrays; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class CompositeTracerTest { + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + @Mock private ApiTracer child1; + @Mock private ApiTracer child2; + @Mock private BigtableTracer child3; + @Mock private BigtableTracer child4; + + private CompositeTracer compositeTracer; + + @Before + public void setup() { + compositeTracer = new CompositeTracer(ImmutableList.of(child1, child2, child3, child4)); + } + + @Test + public void testInScope() { + Scope scope1 = mock(Scope.class); + when(child1.inScope()).thenReturn(scope1); + + Scope scope2 = mock(Scope.class); + when(child2.inScope()).thenReturn(scope2); + + Scope scope3 = mock(Scope.class); + when(child3.inScope()).thenReturn(scope3); + + Scope scope4 = mock(Scope.class); + when(child4.inScope()).thenReturn(scope4); + + Scope parentScope = compositeTracer.inScope(); + + parentScope.close(); + verify(scope1, times(1)).close(); + verify(scope2, times(1)).close(); + verify(scope3, times(1)).close(); + verify(scope4, times(1)).close(); + } + + @Test + public void testOperationSucceeded() { + compositeTracer.operationSucceeded(); + verify(child1, times(1)).operationSucceeded(); + verify(child2, times(1)).operationSucceeded(); + verify(child3, times(1)).operationSucceeded(); + verify(child4, times(1)).operationSucceeded(); + } + + @Test + public void testOperationCancelled() { + compositeTracer.operationCancelled(); + verify(child1, times(1)).operationCancelled(); + verify(child2, times(1)).operationCancelled(); + verify(child3, times(1)).operationCancelled(); + verify(child4, times(1)).operationCancelled(); + } + + @Test + public void testOperationFailed() { + RuntimeException error = new RuntimeException(); + compositeTracer.operationFailed(error); + verify(child1, times(1)).operationFailed(error); + verify(child2, times(1)).operationFailed(error); + verify(child3, times(1)).operationFailed(error); + verify(child4, times(1)).operationFailed(error); + } + + @Test + public void testConnectionSelected() { + compositeTracer.connectionSelected("connection-one"); + verify(child1, times(1)).connectionSelected("connection-one"); + verify(child2, times(1)).connectionSelected("connection-one"); + verify(child3, times(1)).connectionSelected("connection-one"); + verify(child4, times(1)).connectionSelected("connection-one"); + } + + @Test + public void testAttemptStarted() { + ReadRowsRequest request = ReadRowsRequest.getDefaultInstance(); + compositeTracer.attemptStarted(request, 3); + verify(child1, times(1)).attemptStarted(request, 3); + verify(child2, times(1)).attemptStarted(request, 3); + verify(child3, times(1)).attemptStarted(request, 3); + verify(child4, times(1)).attemptStarted(request, 3); + } + + @Test + public void testAttemptSucceeded() { + compositeTracer.attemptSucceeded(); + verify(child1, times(1)).attemptSucceeded(); + verify(child2, times(1)).attemptSucceeded(); + verify(child3, times(1)).attemptSucceeded(); + verify(child4, times(1)).attemptSucceeded(); + } + + @Test + public void testAttemptCancelled() { + compositeTracer.attemptCancelled(); + verify(child1, times(1)).attemptCancelled(); + verify(child2, times(1)).attemptCancelled(); + verify(child3, times(1)).attemptCancelled(); + verify(child4, times(1)).attemptCancelled(); + } + + @Test + public void testAttemptFailed() { + RuntimeException error = new RuntimeException(); + java.time.Duration delay = java.time.Duration.ofMillis(10); + compositeTracer.attemptFailed(error, toThreetenDuration(delay)); + // the implementation of CompositeTracer.attemptFailed delegates to attemptFailedDuration. + verify(child1, times(1)).attemptFailedDuration(error, delay); + verify(child2, times(1)).attemptFailedDuration(error, delay); + verify(child3, times(1)).attemptFailedDuration(error, delay); + verify(child4, times(1)).attemptFailedDuration(error, delay); + } + + @Test + public void testAttemptFailedDuration() { + RuntimeException error = new RuntimeException(); + java.time.Duration delay = java.time.Duration.ofMillis(10); + compositeTracer.attemptFailedDuration(error, delay); + verify(child1, times(1)).attemptFailedDuration(error, delay); + verify(child2, times(1)).attemptFailedDuration(error, delay); + verify(child3, times(1)).attemptFailedDuration(error, delay); + verify(child4, times(1)).attemptFailedDuration(error, delay); + } + + @Test + public void testAttemptFailedRetriesExhausted() { + RuntimeException error = new RuntimeException(); + compositeTracer.attemptFailedRetriesExhausted(error); + verify(child1, times(1)).attemptFailedRetriesExhausted(error); + verify(child2, times(1)).attemptFailedRetriesExhausted(error); + verify(child3, times(1)).attemptFailedRetriesExhausted(error); + verify(child4, times(1)).attemptFailedRetriesExhausted(error); + } + + @Test + public void testAttemptPermanentFailure() { + RuntimeException error = new RuntimeException(); + compositeTracer.attemptPermanentFailure(error); + verify(child1, times(1)).attemptPermanentFailure(error); + verify(child2, times(1)).attemptPermanentFailure(error); + verify(child3, times(1)).attemptPermanentFailure(error); + verify(child4, times(1)).attemptPermanentFailure(error); + } + + @Test + public void testLroStartFailed() { + RuntimeException error = new RuntimeException(); + compositeTracer.lroStartFailed(error); + verify(child1, times(1)).lroStartFailed(error); + verify(child2, times(1)).lroStartFailed(error); + verify(child3, times(1)).lroStartFailed(error); + verify(child4, times(1)).lroStartFailed(error); + } + + @Test + public void testLroStartSucceeded() { + compositeTracer.lroStartSucceeded(); + verify(child1, times(1)).lroStartSucceeded(); + verify(child2, times(1)).lroStartSucceeded(); + verify(child3, times(1)).lroStartSucceeded(); + verify(child4, times(1)).lroStartSucceeded(); + } + + @Test + public void testResponseReceived() { + compositeTracer.responseReceived(); + verify(child1, times(1)).responseReceived(); + verify(child2, times(1)).responseReceived(); + verify(child3, times(1)).responseReceived(); + verify(child4, times(1)).responseReceived(); + } + + @Test + public void testRequestSent() { + compositeTracer.requestSent(); + verify(child1, times(1)).requestSent(); + verify(child2, times(1)).requestSent(); + verify(child3, times(1)).requestSent(); + verify(child4, times(1)).requestSent(); + } + + @Test + public void testBatchRequestSent() { + compositeTracer.batchRequestSent(2, 20); + verify(child1, times(1)).batchRequestSent(2, 20); + verify(child2, times(1)).batchRequestSent(2, 20); + verify(child3, times(1)).batchRequestSent(2, 20); + verify(child4, times(1)).batchRequestSent(2, 20); + } + + @Test + public void testGetAttempt() { + compositeTracer.attemptStarted(2); + Assert.assertEquals(2, compositeTracer.getAttempt()); + } + + @Test + public void testSidebandData() { + MetadataExtractorInterceptor.SidebandData sidebandData = + new MetadataExtractorInterceptor.SidebandData(); + compositeTracer.setSidebandData(sidebandData); + verify(child3, times(1)).setSidebandData(sidebandData); + verify(child4, times(1)).setSidebandData(sidebandData); + } + + @Test + public void testBatchRequestThrottled() { + compositeTracer.batchRequestThrottled(5L); + verify(child3, times(1)).batchRequestThrottled(5L); + verify(child4, times(1)).batchRequestThrottled(5L); + } + + @Test + public void testMethodsOverride() { + Method[] baseMethods = BigtableTracer.class.getDeclaredMethods(); + Method[] compositeTracerMethods = CompositeTracer.class.getDeclaredMethods(); + assertThat(Arrays.asList(compositeTracerMethods)) + .comparingElementsUsing(MethodComparator.METHOD_CORRESPONDENCE) + .containsAtLeastElementsIn(baseMethods); + } + + @Test + public void testGrpcMessageSent() { + compositeTracer.grpcMessageSent(); + verify(child3, times(1)).grpcMessageSent(); + verify(child4, times(1)).grpcMessageSent(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java new file mode 100644 index 000000000000..12f041fa851c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.common.collect.ImmutableList; +import io.grpc.Status; +import java.time.Duration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class CompositeVRpcTracerTest { + + @Mock VRpcTracer child1; + @Mock VRpcTracer child2; + private CompositeVRpcTracer compositeVRpcTracer; + + @BeforeEach + void setup() { + compositeVRpcTracer = new CompositeVRpcTracer(ImmutableList.of(child1, child2)); + } + + @Test + void onOperationStartTest() { + compositeVRpcTracer.onOperationStart(); + verify(child1, times(1)).onOperationStart(); + verify(child2, times(1)).onOperationStart(); + } + + @Test + void onAttemptStartTest() { + SessionReadRowRequest request = SessionReadRowRequest.getDefaultInstance(); + compositeVRpcTracer.onAttemptStart(request); + verify(child1, times(1)).onAttemptStart(request); + verify(child2, times(1)).onAttemptStart(request); + } + + @Test + void onRequestSentTest() { + PeerInfo fakePeerInfo = PeerInfo.getDefaultInstance(); + compositeVRpcTracer.onRequestSent(fakePeerInfo); + verify(child1, times(1)).onRequestSent(fakePeerInfo); + verify(child2, times(1)).onRequestSent(fakePeerInfo); + } + + @Test + void onApplicationBlockingLatenciesTest() { + Duration elapsed = Duration.ofMillis(5); + compositeVRpcTracer.recordApplicationBlockingLatencies(elapsed); + verify(child1, times(1)).recordApplicationBlockingLatencies(elapsed); + verify(child2, times(1)).recordApplicationBlockingLatencies(elapsed); + } + + @Test + void onAttemptFinishTest() { + VRpc.VRpcResult result = VRpc.VRpcResult.createLocalTransportError(Status.UNAVAILABLE); + compositeVRpcTracer.onAttemptFinish(result); + verify(child1, times(1)).onAttemptFinish(result); + verify(child2, times(1)).onAttemptFinish(result); + } + + @Test + void onOperationFinishTest() { + VRpc.VRpcResult result = VRpc.VRpcResult.createLocalTransportError(Status.UNAVAILABLE); + compositeVRpcTracer.onOperationFinish(result); + verify(child1, times(1)).onOperationFinish(result); + verify(child2, times(1)).onOperationFinish(result); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java new file mode 100644 index 000000000000..62a802dfeb0d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java @@ -0,0 +1,515 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.csm.tracers; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; + +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionRequestStats; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.RetryingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.FakeDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.Session; +import com.google.cloud.bigtable.data.v2.internal.session.SessionFactory; +import com.google.cloud.bigtable.data.v2.internal.session.SessionImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Stopwatch; +import com.google.common.base.Suppliers; +import com.google.common.collect.Range; +import com.google.common.truth.Correspondence; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import com.google.rpc.RetryInfo; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.opencensus.stats.Stats; +import io.opencensus.tags.Tags; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.time.Duration; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class VRpcTracerTest { + private static final Correspondence METRIC_DATA_BY_NAME = + Correspondence.transforming(MetricData::getName, "MetricData name"); + + private ScheduledExecutorService executor; + + private Server server; + private ChannelPool channelPool; + private SessionPoolInfo poolInfo; + + private MetricRegistry metricRegistry; + private RecorderRegistry recorderRegistry; + private InMemoryMetricReader metricReader; + private MetricsImpl metrics; + private Session session; + private final FakeSessionListener sessionListener = new FakeSessionListener(); + + private final String clusterId = "fake-cluster"; + private final String zoneId = "us-east1-a"; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + + metricReader = InMemoryMetricReader.create(); + OpenTelemetrySdk otel = + OpenTelemetrySdk.builder() + .setMeterProvider(SdkMeterProvider.builder().registerMetricReader(metricReader).build()) + .build(); + + metricRegistry = new MetricRegistry(); + recorderRegistry = metricRegistry.newInternalRecorderRegistry(otel.getMeterProvider()); + + metrics = + new MetricsImpl( + metricRegistry, + clientInfo, + BaseApiTracerFactory.getInstance(), + otel, + null, + Tags.getTagger(), + Stats.getStatsRecorder(), + executor); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + SessionFactory sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + } + + @AfterEach + void tearDown() { + if (session != null) { + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + } + channelPool.close(); + metrics.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void operationLatencyTest() throws Exception { + // Set up a session to return 1 error response with a retry delay and 1 vrpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(50); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createResponse(2, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + CompletableFuture opFinished = new CompletableFuture<>(); + Stopwatch stopwatch = Stopwatch.createStarted(); + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture userFuture = new UnaryResponseFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + super.onOperationFinish(result); + // operation finished is called after listener.close() which means that userFuture gets + // resolved before tracer.onOperationFinish is called. Set a opFinished future here so + // the elapsed time includes everything. + opFinished.complete(null); + } + }; + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + userFuture); + SessionFakeScriptedResponse response = userFuture.get(); + assertThat(response).isEqualToDefaultInstance(); + opFinished.get(); + long maxOpLatency = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + long operationLatencies = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/operation_latencies", + Attributes.empty()); + + assertThat(operationLatencies).isIn(Range.closed(Durations.toMillis(retryDelay), maxOpLatency)); + } + + @Test + public void attemptLatencyTest() throws Exception { + // Set up a session that returns an error response with a retry delay and a vrpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(50); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createResponse(2, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + Stopwatch stopwatch = Stopwatch.createStarted(); + AtomicLong maxAttemptLatency = new AtomicLong(); + DelayedVRpc delayedVRpc = + new DelayedVRpc<>( + () -> new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor)); + UnaryResponseFuture userFuture = new UnaryResponseFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + super.onAttemptFinish(result); + if (!result.getStatus().isOk()) { + maxAttemptLatency.set(stopwatch.elapsed(TimeUnit.MILLISECONDS)); + } + } + }; + delayedVRpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + userFuture); + + long sessionDelay = 5L; + Thread.sleep(sessionDelay); + delayedVRpc.execute(); + + SessionFakeScriptedResponse response = userFuture.get(); + assertThat(response).isEqualToDefaultInstance(); + + long firstAttemptLatency = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/attempt_latencies", + Attributes.builder().put("status", Code.UNAVAILABLE.name()).build()); + assertThat(firstAttemptLatency).isIn(Range.closed(sessionDelay, maxAttemptLatency.get())); + } + + @Test + public void retryCountTest() throws Exception { + // Set up a session to return 2 error responses and a VRpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(0); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 2)) + .addActions(createResponse(3, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + CompletableFuture opFinished = new CompletableFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + super.onOperationFinish(result); + opFinished.complete(null); + } + }; + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + SessionFakeScriptedResponse response = f.get(); + assertThat(response).isEqualToDefaultInstance(); + opFinished.get(); + + long retryCount = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/retry_count", + Attributes.empty()); + assertThat(retryCount).isEqualTo(2); + } + + @Test + public void clientBlockingLatencySessionDelayTest() throws Exception { + // Set up a session that returns a VRpc response after a fake delay + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createResponse(1, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + + // Test + DelayedVRpc delayedVRpc = + new DelayedVRpc<>( + () -> new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor)); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + CompletableFuture attemptFinished = new CompletableFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + super.onAttemptFinish(result); + attemptFinished.complete(null); + } + }; + assertThat(sessionListener.popNext(Duration.ofSeconds(2))) + .isInstanceOf(OpenSessionResponse.class); + + delayedVRpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + long sessionDelay = 200; + Thread.sleep(sessionDelay); + delayedVRpc.execute(); + + SessionFakeScriptedResponse response = f.get(); + assertThat(response).isEqualToDefaultInstance(); + attemptFinished.get(); + + long clientBlockingLatency = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/throttling_latencies", + Attributes.empty()); + + assertThat(clientBlockingLatency).isAtLeast(sessionDelay); + } + + private Action createErrorResponse( + int errorCode, com.google.protobuf.Duration retryDelay, long rpcId) { + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder().setCode(errorCode).setMessage("fake error").build(); + ErrorResponse errorResponse = + ErrorResponse.newBuilder() + .setRpcId(rpcId) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(retryDelay).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + return Action.newBuilder().setErrorResponse(errorResponse).build(); + } + + private Action createResponse(long rpcId, String clusterId, String zoneId) { + VirtualRpcResponse response = + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setClusterInfo( + ClusterInformation.newBuilder().setClusterId(clusterId).setZoneId(zoneId).build()) + .setStats(SessionRequestStats.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build(); + + return Action.newBuilder().setResponse(response).build(); + } + + // Get the metric value that matches any of the attributes in the attribute map + private static long getMetricValue( + InMemoryMetricReader reader, String metricName, Attributes attributes) { + Collection allMetricData = reader.collectAllMetrics(); + List matchingMetadata = + allMetricData.stream() + .filter(md -> METRIC_DATA_BY_NAME.compare(md, metricName)) + .collect(Collectors.toList()); + assertWithMessage( + "Found multiple MetricData with the same name: %s, in: %s", + metricName, matchingMetadata) + .that(matchingMetadata.size()) + .isAtMost(1); + + if (!matchingMetadata.isEmpty()) { + MetricData metricData = matchingMetadata.get(0); + + Collection points = + metricData.getData().getPoints().stream() + .filter( + pd -> + pd.getAttributes() + .asMap() + .entrySet() + .containsAll(attributes.asMap().entrySet())) + .collect(Collectors.toList()); + + assertWithMessage("ambiguous labels matched too many points").that(points).hasSize(1); + + switch (metricData.getType()) { + case HISTOGRAM: + HistogramPointData hd = (HistogramPointData) points.iterator().next(); + return (long) hd.getSum() / hd.getCount(); + case LONG_SUM: + LongPointData ld = (LongPointData) points.iterator().next(); + return ld.getValue(); + default: + return 0; + } + } + + // MetricData was not found, assert on original collection to get a descriptive error message + assertThat(allMetricData).comparingElementsUsing(METRIC_DATA_BY_NAME).contains(metricName); + throw new IllegalStateException( + "MetricData was missing then appeared, this should never happen"); + } + + static class DelayedVRpc implements VRpc { + + private final Supplier> supplier; + + private ReqT req; + private VRpcCallContext ctx; + private VRpcListener listener; + + DelayedVRpc(Supplier> supplier) { + this.supplier = supplier; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + this.req = req; + this.ctx = ctx; + this.listener = listener; + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + throw new UnsupportedOperationException(); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException(); + } + + public void execute() { + supplier.get().start(req, ctx, listener); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessCheckerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessCheckerTest.java new file mode 100644 index 000000000000..5ce624cf44d2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessCheckerTest.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.dp; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import io.grpc.Channel; +import io.grpc.ManagedChannel; +import java.util.concurrent.ScheduledExecutorService; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class ClassicDirectAccessCheckerTest { + + @Rule public final MockitoRule mockito = MockitoJUnit.rule(); + + @Mock private ChannelPrimer mockChannelPrimer; + @Mock private ManagedChannel mockChannel; + @Mock private DirectPathCompatibleTracer mockTracer; + @Mock private MetadataExtractorInterceptor mockInterceptor; + @Mock private MetadataExtractorInterceptor.SidebandData mockSidebandData; + @Mock private ScheduledExecutorService mockExecutor; + + private ClassicDirectAccessChecker checker; + + @Before + public void setUp() throws Exception { + // Pass null for the executor by default so background investigations aren't triggered + checker = spy(new ClassicDirectAccessChecker(mockTracer, mockChannelPrimer, mockExecutor)); + doReturn(mockInterceptor).when(checker).createInterceptor(); + when(mockInterceptor.getSidebandData()).thenReturn(mockSidebandData); + } + + @Test + public void testEligibleForDirectAccess() { + PeerInfo peerInfo = + PeerInfo.newBuilder() + .setTransportType(PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS) + .build(); + when(mockSidebandData.getPeerInfo()).thenReturn(peerInfo); + when(mockSidebandData.getIpProtocol()).thenReturn(Util.IpProtocol.IPV6); + + boolean isEligible = checker.check(mockChannel); + + assertThat(isEligible).isTrue(); + verify(mockChannelPrimer).primeChannel(any(Channel.class)); + verify(mockTracer).recordSuccess(Util.IpProtocol.IPV6); + verify(mockChannel).shutdownNow(); + } + + @Test + public void testNotEligibleCFE() { + PeerInfo peerInfo = + PeerInfo.newBuilder() + .setTransportType(PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH) + .build(); + when(mockSidebandData.getPeerInfo()).thenReturn(peerInfo); + + boolean isEligible = checker.check(mockChannel); + + assertThat(isEligible).isFalse(); + verifyNoInteractions(mockTracer); // No interactions because executor is null + verify(mockChannel).shutdownNow(); + } + + @Test + public void testMissingSidebandData() { + // Override the Before setup to return null for this specific test + when(mockInterceptor.getSidebandData()).thenReturn(null); + + boolean isEligible = checker.check(mockChannel); + + assertThat(isEligible).isFalse(); + verifyNoInteractions(mockTracer); + verify(mockChannel).shutdownNow(); + } + + @Test + public void testExceptionSafetyAndCleanup() { + doThrow(new RuntimeException("Simulated primer failure")) + .when(mockChannelPrimer) + .primeChannel(any(Channel.class)); + + boolean isEligible = checker.check(mockChannel); + + assertThat(isEligible).isFalse(); + verifyNoInteractions(mockTracer); + verify(mockChannel).shutdownNow(); + } + + @Test + public void testNullPeerInfoIsHandledSafely() { + when(mockInterceptor.getSidebandData()).thenReturn(mockSidebandData); + + when(mockSidebandData.getPeerInfo()).thenReturn(null); + boolean isEligible = checker.check(mockChannel); + assertThat(isEligible).isFalse(); + verifyNoInteractions(mockTracer); + verify(mockChannel).shutdownNow(); + } + + @Test + public void testInvestigationTriggeredOnFailure() { + // Re-instantiate the checker with a mock executor to verify investigation is scheduled + checker = spy(new ClassicDirectAccessChecker(mockTracer, mockChannelPrimer, mockExecutor)); + doReturn(mockInterceptor).when(checker).createInterceptor(); + when(mockInterceptor.getSidebandData()).thenReturn(null); // Force a failure + + boolean isEligible = checker.check(mockChannel); + + assertThat(isEligible).isFalse(); + + // Verify the checker submitted a Runnable task to the background executor + ArgumentCaptor runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + verify(mockExecutor).execute(runnableCaptor.capture()); + + // Execute the captured runnable to ensure it safely calls the tracer + runnableCaptor.getValue().run(); + verify(mockTracer).recordFailure(DirectAccessInvestigator.FailureReason.UNKNOWN); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java new file mode 100644 index 000000000000..d26eecd5d3ac --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import io.grpc.Deadline; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ForwardingVRpcTest { + @Mock private VRpc innerVRpc; + + @Mock private VRpcListener outerListener; + + @Captor private ArgumentCaptor> innerListenerCaptor; + + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + + @Test + void proxyOkTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + // Start + outerVRpc.start("req", ctx, outerListener); + verify(innerVRpc).start(Mockito.eq("req"), Mockito.same(ctx), innerListenerCaptor.capture()); + + // Listener + VRpcListener innerListener = innerListenerCaptor.getValue(); + + // Listener.onMessage + innerListener.onMessage("response"); + verify(outerListener).onMessage("response"); + + // Listener.onClose + VRpcResult result = + VRpcResult.createServerOk(VirtualRpcResponse.newBuilder().setRpcId(1).build()); + innerListener.onClose(result); + verify(outerListener).onClose(result); + } + + @Test + void proxyCancelTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + // Start + outerVRpc.start("req", ctx, outerListener); + Throwable t = new RuntimeException(); + outerVRpc.cancel("reason", t); + + verify(innerVRpc).cancel("reason", t); + } + + @Test + void proxyRequestNextTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + outerVRpc.start("req", ctx, outerListener); + verify(innerVRpc).start(Mockito.anyString(), Mockito.any(), innerListenerCaptor.capture()); + VRpcListener innerListener = innerListenerCaptor.getValue(); + innerListener.onMessage("s"); + + outerVRpc.requestNext(); + verify(innerVRpc, times(1)).requestNext(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java new file mode 100644 index 000000000000..b9af925d4871 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.session.FakeDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.SessionFactory; +import com.google.cloud.bigtable.data.v2.internal.session.SessionImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Suppliers; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import com.google.rpc.RetryInfo; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.Status; +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class RetryingVRpcTest { + private ScheduledExecutorService executor; + + private Server server; + private ChannelPool channelPool; + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + private SessionPoolInfo poolInfo; + private SessionFactory sessionFactory; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + } + + @AfterEach + void tearDown() { + channelPool.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + void noRetryTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void retryServerError() throws Exception { + int requestTag = 1; + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(Durations.fromMillis(10)).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + requestTag, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setResponse( + VirtualRpcResponse.newBuilder() + .setRpcId(2) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build())) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(requestTag).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void retryDeadlineRespectedTest() throws Exception { + int requestTag = 1; + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // Deadline is < retryDelay + responseDealy, we should not schedule retry and fail with the + // server + // returned error + Duration retryDelay = Durations.fromSeconds(1); + Duration responseDelay = Durations.fromMillis(500); + Duration deadline = Durations.fromSeconds(1); + + String errorMessage = "fake unavailable error"; + // server responses: 1 unavailable error followed by an OK response + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.UNAVAILABLE.getNumber()) + .setMessage(errorMessage) + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(retryDelay).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + requestTag, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .setDelay(responseDelay) + .build()) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setResponse( + VirtualRpcResponse.newBuilder() + .setRpcId(2) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build())) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(requestTag).build(), + VRpc.VRpcCallContext.create( + Deadline.after(Durations.toMillis(deadline), TimeUnit.MILLISECONDS), true, tracer), + f); + ExecutionException exception = assertThrows(ExecutionException.class, f::get); + assertThat(exception).hasMessageThat().contains(errorMessage); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void vRpcFailureTest() throws Exception { + // vrpc error on the session should not close the stream + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + VRpcException cause = + (VRpcException) assertThrows(ExecutionException.class, () -> f.get()).getCause(); + assertThat(cause).hasMessageThat().isEqualTo("DEADLINE_EXCEEDED: fake deadline exceeded error"); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + void cancelInScheduledState() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(Durations.fromSeconds(1)).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 1, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + // Wait for the first attempt to fail and get scheduled for retry + Thread.sleep(50); + + retrying.cancel("test cancel", null); + + ExecutionException executionException = assertThrows(ExecutionException.class, f::get); + assertThat(executionException.getCause()).isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) executionException.getCause(); + assertThat(vRpcException.getStatus().getCode()).isEqualTo(Status.Code.CANCELLED); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java new file mode 100644 index 000000000000..f9312e614920 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.middleware; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.base.Ticker; +import com.google.common.collect.Range; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class VRpcCallContextTest { + + @Test + public void testDeadline() { + FakeTicker fakeTicker = new FakeTicker(System.nanoTime()); + VRpc.OperationInfo operationInfo = + VRpc.OperationInfo.create(fakeTicker, Duration.ofMinutes(1), true); + assertThat(operationInfo.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(58L, 60L)); + + fakeTicker.increment(Duration.ofSeconds(10)); + assertThat(operationInfo.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(48L, 50L)); + + fakeTicker.increment(Duration.ofSeconds(10)); + VRpc.OperationInfo nextAttempt = operationInfo.createForNextAttempt(); + assertThat(nextAttempt.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(38L, 40L)); + + fakeTicker.increment(Duration.ofSeconds(50)); + assertThat(nextAttempt.getDeadline().isExpired()).isTrue(); + } + + private static class FakeTicker extends Ticker { + private long nanoTime; + + FakeTicker(long time) { + this.nanoTime = time; + } + + void increment(Duration duration) { + this.nanoTime += duration.toNanos(); + } + + @Override + public long read() { + return nanoTime; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java new file mode 100644 index 000000000000..f7cee4eb0da5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.FakeSessionOpRequest; +import com.google.bigtable.v2.FakeSessionOpResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.Decoder; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.Encoder; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.common.collect.ImmutableMap; +import java.util.function.BiConsumer; +import java.util.function.Function; + +public class FakeDescriptor { + public static final SessionDescriptor FAKE_SESSION = + new SessionDescriptor<>( + FakeSessionGrpc.getOpenSessionMethod(), r -> "FAKE_SESSION", r -> ImmutableMap.of()); + public static VRpcDescriptor< + OpenFakeSessionRequest, SessionFakeScriptedRequest, SessionFakeScriptedResponse> + SCRIPTED = + new VRpcDescriptor<>( + FAKE_SESSION, + MethodInfo.of("Bigtable.FakeMethod", false), + createFakeEncoder(FakeSessionOpRequest.Builder::setScriptedRequest), + createFakeDecoder(FakeSessionOpResponse::getScripted), + (name, appProfileId, req) -> { + throw new UnsupportedOperationException(); + }); + + private static Encoder createFakeEncoder( + BiConsumer subEncoder) { + return req -> { + FakeSessionOpRequest.Builder builder = FakeSessionOpRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createFakeDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(FakeSessionOpResponse.parseFrom(bytes)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java new file mode 100644 index 000000000000..136195dc3312 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java @@ -0,0 +1,216 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.PoolSizer.Sized; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.common.base.Preconditions; +import com.google.rpc.Status; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class PoolSizerTest { + + private static final float IDLE_SESSION_HEADROOM_RATIO = 0.5f; + private static final int MIN_IDLE_SESSIONS = 5; + private static final int MAX_IDLE_SESSIONS = 400; + private static final int PENDING_RPCS_PER_SESSION = 10; + + private static final SessionClientConfiguration.SessionPoolConfiguration DEFAULT_CONFIG = + SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + .setHeadroom(IDLE_SESSION_HEADROOM_RATIO) + .setMinSessionCount(MIN_IDLE_SESSIONS) + .setMaxSessionCount(MAX_IDLE_SESSIONS) + .setNewSessionQueueLength(PENDING_RPCS_PER_SESSION) + .build(); + + @Test + void testInitial() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testTestEquilibrium() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + assertThat(sizer.getScaleDelta()).isEqualTo(0); + assertThat(sizer.handleNewCall()).isFalse(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testPendingRpcs() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 9; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + Preconditions.checkState( + pendingRpcsCount.getSize() > MIN_IDLE_SESSIONS, + "Test requires the pendingCount to be larger than ready count"); + + int numReadySessions = MIN_IDLE_SESSIONS; + + stats.getTestHelper().setReadyCount(numReadySessions); + stats.getTestHelper().setInUseCount(0); + stats.getTestHelper().setExpectedCapacity(numReadySessions); + assertThat(sizer.getScaleDelta()) + .isEqualTo( + (int) Math.ceil((float) pendingRpcsCount.getSize() / PENDING_RPCS_PER_SESSION) + - numReadySessions + + MIN_IDLE_SESSIONS); + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testInUseWithNewCall() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(0); + stats.getTestHelper().setInUseCount(1); + stats.getTestHelper().setExpectedCapacity(1); + + // Ensure that we always have at least MIN_IDLE_SESSIONS sessions available + // Separately we want to have IDLE_SESSION_HEADROOM_RATIO available sessions, but in this case + // MIN_IDLE_SESSIONS is the primary indicator + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + // Remain steady in band + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testInUseWithNewCall2() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(0); + stats.getTestHelper().setInUseCount(20); + stats.getTestHelper().setExpectedCapacity(20); + + // Separately we want to have IDLE_SESSION_HEADROOM_RATIO available sessions + // Separately we want to ensure that we always have at least MIN_IDLE_SESSIONS sessions + // but in this case the ratio is the primary indicator available + assertThat(sizer.getScaleDelta()).isEqualTo(10); + // Remain steady in band + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testEquilibriumWhenStarting() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setStartingCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + assertThat(sizer.getScaleDelta()).isEqualTo(0); + // Remain steady in band + assertThat(sizer.handleNewCall()).isFalse(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testEquilibriumWhenStartingWithLoad() { + PoolStats stats = new PoolStats(); + final AtomicInteger pendingCount = new AtomicInteger(0); + Sized pendingRpcsCount = () -> pendingCount.get(); + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + + // Started 5 sessions on startup to satisfy PoolSizer.MIN_IDLE_SESSIONS. + stats.getTestHelper().setStartingCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + // Requests start to pile up while we still have our first 5 sessions starting. + int incomingRequests = 100; + for (int i = 0; i < incomingRequests; i++) { + // When we start a pending vRPC we add it to the list... + pendingCount.incrementAndGet(); + // ... and call handleNewCall() on the sizer. + boolean newCallVerdict = sizer.handleNewCall(); + if (i % PENDING_RPCS_PER_SESSION == 0) { + // For 1st, 11th, 21st, 31st etc. pending call we should demand a new session to be started. + assertThat(newCallVerdict).isTrue(); + } else { + assertThat(newCallVerdict).isFalse(); + } + + int forPending = (int) Math.ceil((float) pendingCount.get() / PENDING_RPCS_PER_SESSION); + int sessionsNeeded = forPending + stats.getInUseCount(); + int desiredIdleSessions = (int) Math.ceil(sessionsNeeded * IDLE_SESSION_HEADROOM_RATIO); + desiredIdleSessions = + Math.max(Math.min(desiredIdleSessions, MAX_IDLE_SESSIONS), MIN_IDLE_SESSIONS); + int desiredCapacity = sessionsNeeded + desiredIdleSessions; + + assertThat(sizer.getScaleDelta()) + .isEqualTo(Math.max(0, desiredCapacity - stats.getExpectedCapacity())); + + if (newCallVerdict) { + // Starting new session as instructed by handleNewCall(). + stats.getTestHelper().setStartingCount(stats.getStartingCount() + 1); + stats.getTestHelper().setExpectedCapacity(stats.getExpectedCapacity() + 1); + } + } + + // After 100 pending RPCs we have 15 sessions starting (10 + 5 for idle headroom). + assertThat(stats.getExpectedCapacity()).isEqualTo(15); + assertThat(sizer.getScaleDelta()).isEqualTo(0); + assertThat(sizer.handleNewCall()).isFalse(); + + // Simulate one session has started. + stats.getTestHelper().setStartingCount(stats.getStartingCount() - 1); + stats.getTestHelper().setReadyCount(stats.getReadyCount() + 1); + // One pending would be immediately taken. + pendingCount.decrementAndGet(); + stats.getTestHelper().setReadyCount(stats.getReadyCount() - 1); + stats.getTestHelper().setInUseCount(stats.getInUseCount() + 1); + // And two more sessions would be requested. + // We still have pending calls for 10 sessions. + // + 1 in-use session now + // + 6 for idle headroom (50% of 11) + // = 17 sessions needed, but we only have 15 + assertThat(sizer.getScaleDelta()).isEqualTo(2); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java new file mode 100644 index 000000000000..1eb9bbd467b9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import java.time.Duration; +import java.time.Instant; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class SessionCreationBudgetTest { + + private FakeClock clock; + private Duration penalty; + + @BeforeEach + public void setup() { + clock = new FakeClock(Instant.now()); + penalty = Duration.ofMinutes(1); + } + + @Test + public void test() { + SessionCreationBudget budget = new SessionCreationBudget(1, penalty, clock); + // Try reserve 2 sessions, the second one should return false + assertThat(budget.tryReserveSession()).isTrue(); + assertThat(budget.tryReserveSession()).isFalse(); + + // Release the session, try reserve again should return true + budget.onSessionCreationSuccess(); + assertThat(budget.tryReserveSession()).isTrue(); + + // Release the session as failure, try reserve again should false because of penalty + budget.onSessionCreationFailure(); + assertThat(budget.tryReserveSession()).isFalse(); + + // increment the clock, try reserver again should return true + clock.increment(penalty.plus(Duration.ofNanos(1))); + assertThat(budget.tryReserveSession()).isTrue(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java new file mode 100644 index 000000000000..692783c4cc39 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java @@ -0,0 +1,541 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.StatusSubject.assertThat; +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcResultSubject.assertThat; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenFakeSessionRequest.StreamError; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult.State; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeVRpcListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Stopwatch; +import com.google.common.base.Suppliers; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.Status; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class SessionImplTest { + private ScheduledExecutorService executor; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + private Server server; + private ChannelPool channelPool; + private SessionFactory sessionFactory; + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + private SessionPoolInfo poolInfo; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + } + + @AfterEach + void tearDown() { + channelPool.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + void sessionSendAndCloseTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void sessionCloseBeforeInit() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void sessionGoAwayTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + Duration goAwayDelay = Duration.ofMillis(100); + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setGoAwayDelay(Durations.fromMillis(goAwayDelay.toMillis())) + .putVrpcActions(0, ActionList.getDefaultInstance()) + .putVrpcActions(1, ActionList.getDefaultInstance()) + .putVrpcActions(2, ActionList.getDefaultInstance()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + // Send vRPCs until after a goaway time + Stopwatch stopwatch = Stopwatch.createStarted(); + int numUncommittedErrors = 0; + int numOk = 0; + while (stopwatch.elapsed(TimeUnit.MILLISECONDS) < goAwayDelay.toMillis()) { + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + try { + f.get(); + numOk++; + } catch (VRpcException e) { + if (e.getResult().getState() == State.UNCOMMITED) { + numUncommittedErrors++; + } + } + } + + assertWithMessage("Ensure that some vRpcs succeeded prior to the goaway") + .that(numOk) + .isGreaterThan(0); + assertWithMessage("Ensure that only the last vRpc could be rejected with an uncommited error") + .that(numUncommittedErrors) + .isAtMost(1); + + assertThat(sessionListener.popUntil(GoAwayResponse.class)).isInstanceOf(GoAwayResponse.class); + + // Make sure we can't send vrpc after receiving goaway + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThrows(ExecutionException.class, f::get); + + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void streamErrorDuringRpcTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + Status.Code actualCode = Status.Code.INTERNAL; + com.google.rpc.Status actualSessionStatusProto = + com.google.rpc.Status.newBuilder() + .setCode(actualCode.value()) + .setMessage("fake internal error") + .build(); + + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setStreamError( + StreamError.newBuilder() + .setDelay(Durations.fromMillis(200)) + .setStatus(actualSessionStatusProto)) + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions( + Action.newBuilder() + .setResponse(VirtualRpcResponse.getDefaultInstance()) + .setDelay( + com.google.protobuf.Duration.newBuilder() + .setNanos(300000000)) + .build()) + .build()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + VRpcException error = (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(error) + .hasMessageThat() + .isEqualTo( + "UNAVAILABLE: vRPC failed due to transport error\n" + + "Transport error: INTERNAL: fake internal error. PeerInfo:" + + " application_frontend_subzone: \"ll\" transport_type:" + + " TRANSPORT_TYPE_SESSION_DIRECT_ACCESS application_frontend_region: \"local\""); + assertThat(error.getResult()).state().isEqualTo(State.TRANSPORT_FAILURE); + // TODO: fix server Latency definition - need to split node latency from transport latency + assertThat(error.getResult()).backendLatency().isEqualTo(Duration.ZERO); + + Status status = sessionListener.popUntil(Status.class); + assertThat(status).code().isEqualTo(actualCode); + assertThat(status) + .description() + .isEqualTo( + actualSessionStatusProto.getMessage() + + ". PeerInfo: application_frontend_subzone: \"ll\" transport_type:" + + " TRANSPORT_TYPE_SESSION_DIRECT_ACCESS application_frontend_region: \"local\""); + } + + @Test + void rpcErrorDuringRpcTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + com.google.rpc.Status expectedRpcStatus = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded") + .build(); + + ErrorResponse errorResponse = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(expectedRpcStatus) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + + ActionList errorActionList = + ActionList.newBuilder() + .addActions(Action.newBuilder().setErrorResponse(errorResponse).build()) + .build(); + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions(0, errorActionList) + .putVrpcActions(1, ActionList.getDefaultInstance()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + // error response + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + VRpcException error = (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(error).hasMessageThat().isEqualTo("DEADLINE_EXCEEDED: fake deadline exceeded"); + assertThat(error.getResult()).state().isEqualTo(State.SERVER_RESULT); + // TODO: fix server Latency definition - need to split node latency from transport latency + assertThat(error.getResult()).backendLatency().isEqualTo(Duration.ZERO); + + // Sending another vRPC after a failed vRPC is ok + f = new UnaryResponseFuture<>(); + rpc = session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + // shouldn't throw an error + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + session.close(CloseSessionRequest.getDefaultInstance()); + + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void localErrorTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + RuntimeException expectedError = new RuntimeException("my fake onMessageError"); + FakeVRpcListener rpcListener = + new FakeVRpcListener() { + @Override + public void onMessage(SessionFakeScriptedResponse msg) { + throw expectedError; + } + }; + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + rpcListener); + + VRpcResult result = (VRpcResult) rpcListener.popNext(); + + // TODO: Need a different State to represent local processing failure + assertThat(result).state().isEqualTo(State.USER_FAILURE); + // The status is INTERNAL with a desc explaining the failure was due to local handling + assertThat(result).status().code().isEqualTo(Status.CANCELLED.getCode()); + assertThat(result) + .status() + .description() + .isEqualTo("Cancelling RPC due to exception thrown by user callback"); + assertThat(result).status().cause().isSameInstanceAs(expectedError); + } + + @Test + void testHeartbeat() throws Exception { + FakeClock clock = new FakeClock(Instant.now()); + + Instant time = clock.instant(); + + SessionImpl session = new SessionImpl(metrics, clock, poolInfo, 0, sessionFactory.createNew()); + + int keepAliveDurationMs = 150; + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setSessionParams( + SessionParametersResponse.newBuilder() + .setKeepAlive(Durations.fromMillis(keepAliveDurationMs)) + .build()) + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions( + Action.newBuilder() + .setDelay(Durations.fromMillis(500)) + .setResponse(VirtualRpcResponse.getDefaultInstance()) + .build()) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + assertThat(session.getNextHeartbeat()).isEqualTo(time.plus(SessionImpl.FUTURE_TIME)); + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(session.getNextHeartbeat()) + .isEqualTo(time.plus(Duration.ofMillis(keepAliveDurationMs))); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + assertThat(session.getNextHeartbeat()).isEqualTo(time.plus(SessionImpl.FUTURE_TIME)); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void testCancel() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + int responseDelayMs = 200; + // Configure the fake service to delay the response, giving us time to cancel it + ActionList actions = + ActionList.newBuilder() + .addActions( + Action.newBuilder() + .setDelay(Durations.fromMillis(responseDelayMs)) + .setResponse(VirtualRpcResponse.getDefaultInstance())) + .build(); + + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions(0, actions) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + // Wait for the session to be ready + sessionListener.popUntil(OpenSessionResponse.class); + + // Start the RPC + FakeVRpcListener rpcListener = new FakeVRpcListener<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + rpcListener); + + // Cancel it immediately + rpc.cancel("test cancel", null); + + // Verify that the rpc was closed with a CANCELLED status + VRpcResult result = rpcListener.popUntil(VRpcResult.class); + assertThat(result).state().isEqualTo(State.UNCOMMITED); + assertThat(result).status().code().isEqualTo(Status.Code.CANCELLED); + assertThat(result).status().description().isEqualTo("test cancel"); + + // Verify that the response is ignored + Thread.sleep(responseDelayMs + 10); + assertThat(rpcListener.getOnMessageCount()).isEqualTo(0); + + session.close(CloseSessionRequest.getDefaultInstance()); + sessionListener.popUntil(Status.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java new file mode 100644 index 000000000000..def4986a95c1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java @@ -0,0 +1,476 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequestStats; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import com.google.protobuf.Message; +import com.google.protobuf.util.Durations; +import io.grpc.Metadata; +import java.time.Duration; +import java.time.Instant; +import org.junit.jupiter.api.Test; + +class SessionListTest { + private final FakeSession fakeSession = new FakeSession(); + + private static final VRpcResult OK_RESULT = + VRpcResult.createServerOk( + VirtualRpcResponse.newBuilder() + .setRpcId(1) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setStats( + SessionRequestStats.newBuilder().setBackendLatency(Durations.fromMicros(500))) + .build()); + private static final Duration FAKE_VRPC_E2E_LATENCY = Duration.ofMillis(1); + + @Test + void testInitialStats() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testInitialToStarting() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + list.newHandle(fakeSession); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).hasSize(1); + + assertThat(stats.getStartingCount()).isEqualTo(1); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testStartingToReady() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + handle.onSessionStarted(); + + assertThat(list.getAfesWithReadySessions()).hasSize(1); + assertThat(list.getAfesWithReadySessions().get(0).sessions).containsExactly(handle); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(1); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + // TODO: StartingToGoAway? or to REMOVED + + @Test + void testReadyToInUse() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(1); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testReadyInUseToIdle() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + assertThat(list.getAfesWithReadySessions().get(0).sessions).containsExactly(handle); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(1); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testReadyIdleToSoftClosing() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + // idle session after a goaway skips CLOSING + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyInUseToSoftClosing() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(1); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToAwaitClose() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + // idle ready session skips CLOSING + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToAwaitCloseWhileRpcIsActive() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + // Session will auto transition to WAIT_SERVER_CLOSE from CLOSING when vRpc finishes + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testStartingToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + // server killed the session before it started + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.STARTING); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyIdleToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.READY); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyInUseToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSED; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + handle.onSessionClosed(SessionState.READY); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingIdleToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.WAIT_SERVER_CLOSE); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + // Simulate hard session close when a vRpc is outstanding + fakeSession.state = SessionState.CLOSED; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + handle.onSessionClosed(SessionState.CLOSING); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testAwaitCloseToSoftClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.WAIT_SERVER_CLOSE); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + // Minimal impl of Session that only exposes state to test SessionList + private static class FakeSession implements Session { + private SessionState state = SessionState.NEW; + + @Override + public SessionState getState() { + return state; + } + + @Override + public PeerInfo getPeerInfo() { + return PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendId(1234) + .setApplicationFrontendRegion("us-east1") + .setApplicationFrontendSubzone("xx") + .build(); + } + + @Override + public Instant getLastStateChange() { + throw new UnsupportedOperationException(); + } + + @Override + public OpenParams getOpenParams() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isOpenParamsUpdated() { + return false; + } + + @Override + public String getLogName() { + throw new UnsupportedOperationException(); + } + + @Override + public Instant getNextHeartbeat() { + return Instant.now().plus(Duration.ofMinutes(5)); + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + throw new UnsupportedOperationException(); + } + + @Override + public void close(CloseSessionRequest req) { + throw new UnsupportedOperationException(); + } + + @Override + public void forceClose(CloseSessionRequest reason) { + throw new UnsupportedOperationException(); + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) + throws IllegalStateException { + throw new UnsupportedOperationException(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java new file mode 100644 index 000000000000..c0e6e01d6125 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java @@ -0,0 +1,535 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcResultSubject.assertThat; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.StreamError; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionRefreshConfig; +import com.google.bigtable.v2.SessionRequest; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.base.Suppliers; +import com.google.common.collect.Range; +import com.google.common.truth.Correspondence; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@Nested +@ExtendWith(MockitoExtension.class) +public class SessionPoolImplTest { + private static final ClientInfo CLIENT_INFO = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + private static Correspondence + OPEN_SESSION_REQUEST_CORRESPONDENCE = + Correspondence.transforming(SessionRequest::getOpenSession, "open session"); + + private ScheduledExecutorService executor; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + @Mock private ClientConfigurationManager configManager; + + private Server server; + private final VRpcTracer vrpcTracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + private ChannelPool channelPool; + private SessionPoolImpl sessionPool; + private FakeSessionService fakeService; + private HeaderInterceptor headerInterceptor; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + fakeService = new FakeSessionService(executor); + headerInterceptor = new HeaderInterceptor(); + server = + FakeServiceBuilder.create(fakeService) + .intercept(new PeerInfoInterceptor()) + .intercept(headerInterceptor) + .start(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + ClientConfigurationManager.ListenerHandle listenerHandle = + Mockito.mock(ClientConfigurationManager.ListenerHandle.class); + when(configManager.getClientConfiguration()) + .thenReturn(ClientConfigurationManager.loadDefault()); + when(configManager.addListener(any(), any())).thenReturn(listenerHandle); + doNothing().when(listenerHandle).close(); + + sessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + channelPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + } + + @AfterEach + void tearDown() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("close session") + .build()); + channelPool.close(); + // channel gets shutdown in channelPool.close() + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void consecutiveFailuresTest() { + com.google.rpc.Status errorStatus = + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL_VALUE) + .setMessage("fake internal error") + .build(); + + OpenFakeSessionRequest request = + OpenFakeSessionRequest.newBuilder() + .setStreamError( + StreamError.newBuilder() + .setStatus(errorStatus) + .setDelay(Durations.fromMillis(0)) + .build()) + .build(); + sessionPool.start(request, new Metadata()); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + sessionPool.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, vrpcTracer), + f); + + VRpcException exception = + (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(exception) + .hasMessageThat() + .contains( + "INTERNAL: Session failed with consecutive failures. Most recent server status:" + + " Status{code=INTERNAL, description=fake internal error. PeerInfo:" + + " transport_type: TRANSPORT_TYPE_SESSION_UNKNOWN, cause=null}"); + } + + @Test + void pendingVRpcDrainTest() throws ExecutionException, InterruptedException, TimeoutException { + // delay all messages to force the first vrpc to be queued + + SessionPool testSessionPool = null; + + // Create a channel that will delay all response messages by 10ms + try (ChannelPool delayedPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .intercept(new DelayedClientInterceptor(Duration.ofMillis(10))) + .build()))) { + + delayedPool.start(); + + // wrap it with a session pool + testSessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + delayedPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + + // session ack should be delayed by at least 10ms + testSessionPool.start(OpenFakeSessionRequest.getDefaultInstance(), new Metadata()); + + // Start a vRpc that will be put in the pending queue due to slow session start + VRpc vrpc = + testSessionPool.newCall(FakeDescriptor.SCRIPTED); + CompletableFuture resultFuture = new CompletableFuture<>(); + vrpc.start( + SessionFakeScriptedRequest.getDefaultInstance(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.SECONDS), true, vrpcTracer), + new VRpc.VRpcListener() { + @Override + public void onMessage(SessionFakeScriptedResponse msg) {} + + @Override + public void onClose(VRpcResult result) { + resultFuture.complete(result); + } + }); + + // Ensure that the rpc eventually succeeded + VRpcResult result = resultFuture.get(1, TimeUnit.MINUTES); + assertThat(result).isOk(); + + } finally { + if (testSessionPool != null) { + testSessionPool.close(CloseSessionRequest.getDefaultInstance()); + } + } + } + + @Test + void testCreateSessionDoesntPropagateDeadline() { + DeadlineInterceptor deadlineInterceptor = new DeadlineInterceptor(); + try (ChannelPool capturedDeadlinePool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .intercept(deadlineInterceptor) + .build()))) { + + capturedDeadlinePool.start(); + + SessionPoolImpl testSessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + capturedDeadlinePool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + + Context.current() + .withDeadlineAfter(1, TimeUnit.MINUTES, executor) + .run( + () -> + testSessionPool.start( + OpenFakeSessionRequest.getDefaultInstance(), new Metadata())); + + assertThat(deadlineInterceptor.getObservedDeadline()).isNull(); + + testSessionPool.close(CloseSessionRequest.getDefaultInstance()); + } + } + + @Nested + class RetrySessionCreation { + + private FakeClock fakeClock; + private ScheduledExecutorService mockExecutor; + private FakeSessionService fakeService; + private ChannelPool channelPool; + private SessionPoolImpl sessionPool; + + private final Duration penalty = Duration.ofMinutes(1); + + @BeforeEach + void setUp() throws Exception { + fakeClock = new FakeClock(Instant.now()); + mockExecutor = mock(ScheduledExecutorService.class, Mockito.RETURNS_DEEP_STUBS); + + Duration penalty = Duration.ofMinutes(1); + SessionCreationBudget budget = new SessionCreationBudget(10, penalty, fakeClock); + + fakeService = new FakeSessionService(executor); + Server rejectRequestServer = + FakeServiceBuilder.create(fakeService).intercept(new PeerInfoInterceptor()).start(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", + rejectRequestServer.getPort(), + InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + sessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + channelPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + mockExecutor, + budget); + } + + @AfterEach + void tearDown() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("close session") + .build()); + server.shutdown(); + channelPool.close(); + } + + @Test + public void test() throws Exception { + ArgumentCaptor runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + ArgumentCaptor delayCaptor = ArgumentCaptor.forClass(Long.class); + + // start the pool + sessionPool.start( + OpenFakeSessionRequest.newBuilder() + .setStreamError(StreamError.getDefaultInstance()) + .build(), + new Metadata()); + + // Session creations should fail and a task to retry session creation should be scheduled. + // The delay should be around budget creation failure penalty. It'll take some time for the + // job to exhaust all the creation budget so set a delay before verifying. + int waitForReadyMs = 1000; + verify(mockExecutor, Mockito.timeout(waitForReadyMs)) + .schedule(runnableCaptor.capture(), delayCaptor.capture(), eq(TimeUnit.MILLISECONDS)); + assertThat(delayCaptor.getValue()) + .isIn( + Range.openClosed( + penalty.minus(Duration.ofMillis(waitForReadyMs)).toMillis(), penalty.toMillis())); + + // we should have received some open requests + int requestsBefore = fakeService.getOpenRequestCount().get(); + assertThat(requestsBefore).isGreaterThan(0); + + // vrpc will queue in the PendingVRpcs queue + VRpc vrpc = + sessionPool.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + vrpc.start( + SessionFakeScriptedRequest.getDefaultInstance(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.SECONDS), true, vrpcTracer), + f); + + // Advance the clock so there's more budget to create sessions + fakeClock.increment(penalty.plusMillis(1)); + + // Run the scheduled task, pool sizer will return a positive scale factor because there's a + // pending vrpc + runnableCaptor.getValue().run(); + + // The retry task will try to open new sessions. This will fail and schedule another retry. + verify(mockExecutor, Mockito.timeout(1000).times(2)) + .schedule(any(Runnable.class), anyLong(), eq(TimeUnit.MILLISECONDS)); + + // the retry will exhaust the budget again. we should see double the request compared to + // before + int requestsAfter = fakeService.getOpenRequestCount().get(); + assertThat(requestsAfter).isGreaterThan(requestsBefore); + } + } + + @Test + public void refreshConfigTest() throws Exception { + OpenSessionRequest refreshRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + String refreshHeaderKey = "x-refresh-header"; + Metadata.Key metadataKey = Metadata.Key.of(refreshHeaderKey, Metadata.ASCII_STRING_MARSHALLER); + SessionRefreshConfig refreshConfig = + SessionRefreshConfig.newBuilder() + .setOptimizedOpenRequest(refreshRequest) + .addMetadata( + SessionRefreshConfig.Metadata.newBuilder() + .setKey(refreshHeaderKey) + .setValue(ByteString.copyFromUtf8("refresh_value"))) + .build(); + + OpenFakeSessionRequest request = + OpenFakeSessionRequest.newBuilder() + .setRefreshConfig(refreshConfig) + .setRefreshConfigDelay(Durations.fromMillis(100)) + .setGoAwayDelay(Durations.fromMillis(120)) + .build(); + + sessionPool.start(request, new Metadata()); + + Thread.sleep(500); + + List requests = fakeService.getSessionRequests(); + assertThat(requests.size()).isGreaterThan(1); + assertThat(requests) + .comparingElementsUsing(OPEN_SESSION_REQUEST_CORRESPONDENCE) + .contains(refreshRequest); + + // Verify headers + List headers = headerInterceptor.getHeadersList(); + boolean containsHeader = false; + for (Metadata header : headers) { + if (header.containsKey(metadataKey)) { + containsHeader = true; + assertThat(header.get(metadataKey)).isEqualTo("refresh_value"); + } + } + assertThat(containsHeader).isTrue(); + } + + private static class DelayedClientInterceptor implements ClientInterceptor { + private final Duration delay; + + private DelayedClientInterceptor(Duration delay) { + this.delay = delay; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onMessage(RespT message) { + try { + // delay all messages to force the first vrpc to be queued + Thread.sleep(delay.toMillis()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + super.onMessage(message); + } + }, + headers); + } + }; + } + } + + private static class DeadlineInterceptor implements ClientInterceptor { + private volatile Deadline observedDeadline; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + if (method.getBareMethodName().equals("OpenSession")) { + observedDeadline = Context.current().getDeadline(); + } + return next.newCall(method, callOptions); + } + + public Deadline getObservedDeadline() { + return observedDeadline; + } + } + + private static class HeaderInterceptor implements ServerInterceptor { + private final List headersList = new ArrayList<>(); + + @Override + public io.grpc.ServerCall.Listener interceptCall( + ServerCall call, Metadata headers, ServerCallHandler next) { + headersList.add(headers); + return next.startCall(call, headers); + } + + public List getHeadersList() { + return headersList; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java new file mode 100644 index 000000000000..4a42efaf76a7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionType; +import org.junit.jupiter.api.Test; + +class UtilTest { + @Test + void testTableOpenRpc() { + SessionType sessionType = + SessionUtil.extractSessionTypeFromMethod(BigtableGrpc.getOpenTableMethod()); + assertThat(sessionType).isEqualTo(SessionType.SESSION_TYPE_TABLE); + } + + @Test + void testTableOpenMsg() { + OpenTableRequest msg = OpenTableRequest.getDefaultInstance(); + SessionType sessionType = SessionUtil.extractOpenSessionTypeFromOpenMsg(msg); + assertThat(sessionType).isEqualTo(SessionType.SESSION_TYPE_TABLE); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java new file mode 100644 index 000000000000..4c1e31294a4b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Cell; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.Row; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.TableRequest; +import com.google.bigtable.v2.TableResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import org.junit.jupiter.api.Test; + +class VRpcDescriptorTest { + + @Test + void testReadRow() throws InvalidProtocolBufferException { + assertThat(VRpcDescriptor.READ_ROW.getSessionDescriptor()) + .isEqualTo(VRpcDescriptor.TABLE_SESSION); + + TableResponse tableResp = + TableResponse.newBuilder() + .setReadRow( + SessionReadRowResponse.newBuilder() + .setRow( + Row.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .addFamilies( + Family.newBuilder() + .setName("f") + .addColumns( + Column.newBuilder() + .addCells( + Cell.newBuilder() + .setTimestampMicros(12345) + .setValue(ByteString.copyFromUtf8("value"))))))) + .build(); + assertThat(VRpcDescriptor.READ_ROW.decode(tableResp.toByteString())) + .isEqualTo(tableResp.getReadRow()); + + SessionReadRowRequest req = + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .setFilter(RowFilter.newBuilder().setBlockAllFilter(true)) + .build(); + assertThat(TableRequest.parseFrom(VRpcDescriptor.READ_ROW.encode(req))) + .isEqualTo(TableRequest.newBuilder().setReadRow(req).build()); + } + + @Test + void testToLegacyProtoReadRow() { + SessionReadRowRequest req = + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .setFilter(RowFilter.newBuilder().setBlockAllFilter(true)) + .build(); + ReadRowsRequest legacyReq = + (ReadRowsRequest) VRpcDescriptor.READ_ROW.toLegacyProto("table1", "app1", req); + assertThat(legacyReq.getTableName()).isEqualTo("table1"); + assertThat(legacyReq.getAppProfileId()).isEqualTo("app1"); + assertThat(legacyReq.getRows().getRowKeys(0)).isEqualTo(req.getKey()); + assertThat(legacyReq.getFilter()).isEqualTo(req.getFilter()); + assertThat(legacyReq.getRowsLimit()).isEqualTo(1); + } + + @Test + void testToLegacyProtoMutateRow() { + SessionMutateRowRequest req = + SessionMutateRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .addMutations( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName("f") + .setColumnQualifier(ByteString.copyFromUtf8("c")) + .setValue(ByteString.copyFromUtf8("v")))) + .build(); + MutateRowRequest legacyReq = + (MutateRowRequest) VRpcDescriptor.MUTATE_ROW.toLegacyProto("table1", "app1", req); + assertThat(legacyReq.getTableName()).isEqualTo("table1"); + assertThat(legacyReq.getAppProfileId()).isEqualTo("app1"); + assertThat(legacyReq.getRowKey()).isEqualTo(req.getKey()); + assertThat(legacyReq.getMutationsList()).isEqualTo(req.getMutationsList()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java new file mode 100644 index 000000000000..94bd6fcc5049 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolImpl.Watchdog; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.protobuf.Message; +import io.grpc.Metadata; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class WatchdogTest { + private final Duration interval = Duration.ofMinutes(5); + private ScheduledExecutorService executor; + private SessionPoolImpl.Watchdog watchdog; + private SessionList sessions; + private FakeSession fakeSession = new FakeSession(); + + private Instant now; + private FakeClock fakeClock; + + @BeforeEach + void setUp() { + executor = Executors.newScheduledThreadPool(4); + + now = Instant.now(); + fakeClock = new FakeClock(now); + sessions = new SessionList(); + watchdog = + new Watchdog( + new Object(), + executor, + interval, + sessions, + NoopMetrics.NoopDebugTracer.INSTANCE, + fakeClock); + } + + @AfterEach + void tearDown() { + executor.shutdownNow(); + } + + @Test + public void awaitCloseTest() { + fakeSession.lastStateChange = fakeClock.instant(); + + fakeSession.state = SessionState.STARTING; + SessionList.SessionHandle handle = sessions.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + watchdog.run(); + assertThat(fakeSession.forceCloseReason).isNull(); + + fakeClock.increment(interval.plus(Duration.ofNanos(1))); + watchdog.run(); + + assertThat(fakeSession.forceCloseReason).isNotNull(); + assertThat(fakeSession.forceCloseReason.getDescription()) + .contains("awaiting close for too long"); + } + + private static class FakeSession implements Session { + private static final String sessionName = "fake-session"; + private SessionState state = SessionState.NEW; + private Instant lastStateChange = Instant.now(); + private CloseSessionRequest forceCloseReason = null; + + @Override + public PeerInfo getPeerInfo() { + return PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendId(1234) + .setApplicationFrontendRegion("us-east1") + .setApplicationFrontendSubzone("xx") + .build(); + } + + @Override + public SessionState getState() { + return state; + } + + @Override + public Instant getLastStateChange() { + return lastStateChange; + } + + @Override + public String getLogName() { + return sessionName; + } + + @Override + public Instant getNextHeartbeat() { + return Instant.now().plus(Duration.ofMinutes(5)); + } + + @Override + public OpenParams getOpenParams() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isOpenParamsUpdated() { + return false; + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + throw new UnsupportedOperationException(); + } + + @Override + public void close(CloseSessionRequest req) { + throw new UnsupportedOperationException(); + } + + @Override + public void forceClose(CloseSessionRequest reason) { + forceCloseReason = reason; + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) + throws IllegalStateException { + throw new UnsupportedOperationException(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java new file mode 100644 index 000000000000..6e7b80baf02d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.time.ZoneId; + +public class FakeClock extends Clock { + + private Instant time; + + public FakeClock(Instant time) { + this.time = time; + } + + public void increment(Duration delta) { + this.time = time.plus(delta); + } + + @Override + public ZoneId getZone() { + return null; + } + + @Override + public Clock withZone(ZoneId zone) { + return null; + } + + @Override + public Instant instant() { + return time; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java new file mode 100644 index 000000000000..aef206ffd545 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.ServerInterceptor; +import io.grpc.ServerTransportFilter; +import java.io.IOException; +import java.net.BindException; +import java.net.ServerSocket; +import java.util.ArrayList; +import java.util.List; + +public class FakeServiceBuilder { + private final List interceptors = new ArrayList<>(); + private final List services = new ArrayList<>(); + private final List transportFilters = new ArrayList<>(); + + public static FakeServiceBuilder create(BindableService... services) { + return new FakeServiceBuilder(services); + } + + private FakeServiceBuilder(BindableService[] services) { + for (BindableService service : services) { + this.addService(service); + } + } + + public FakeServiceBuilder intercept(ServerInterceptor interceptor) { + interceptors.add(interceptor); + return this; + } + + public FakeServiceBuilder addService(BindableService service) { + services.add(service); + return this; + } + + public FakeServiceBuilder addTransportFilter(ServerTransportFilter transportFilter) { + transportFilters.add(transportFilter); + return this; + } + + public Server start() throws IOException { + IOException lastError = null; + + for (int i = 0; i < 10; i++) { + try { + return startWithoutRetries(); + } catch (IOException e) { + lastError = e; + if (e.getCause() instanceof BindException) { + continue; + } + if (e.getMessage().contains("Failed to bind to address")) { + continue; + } + break; + } + } + + throw lastError; + } + + private Server startWithoutRetries() throws IOException { + int port; + try (ServerSocket ss = new ServerSocket(0)) { + port = ss.getLocalPort(); + } + ServerBuilder builder = ServerBuilder.forPort(port); + interceptors.forEach(builder::intercept); + services.forEach(builder::addService); + transportFilters.forEach(builder::addTransportFilter); + + return builder.build().start(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java new file mode 100644 index 000000000000..d7063eddeda7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java @@ -0,0 +1,79 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.cloud.bigtable.data.v2.internal.session.Session; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +public class FakeSessionListener implements Session.Listener { + private BlockingDeque msgs = new LinkedBlockingDeque<>(); + + @Override + public void onReady(OpenSessionResponse msg) { + msgs.add(msg); + } + + @Override + public void onGoAway(GoAwayResponse msg) { + msgs.add(msg); + } + + @Override + public void onClose(SessionState prevState, Status status, Metadata trailers) { + msgs.add(status); + } + + @SuppressWarnings("unchecked") + public T popUntil(Class cls) throws InterruptedException, TimeoutException { + List seen = new ArrayList<>(); + + Object msg = null; + while (!cls.isInstance(msg)) { + try { + msg = popNext(); + seen.add(msg); + } catch (TimeoutException e) { + throw new TimeoutException( + "Timed out waiting to popUntil event of: " + cls + ", seen: " + seen); + } + } + return (T) msg; + } + + public Object popNext() throws InterruptedException, TimeoutException { + return popNext(Duration.ofSeconds(1)); + } + + public Object popNext(Duration timeout) throws InterruptedException, TimeoutException { + Object obj = msgs.poll(timeout.toMillis(), TimeUnit.MILLISECONDS); + if (obj == null) { + throw new TimeoutException("Timed out waiting to popNext Session event"); + } + return obj; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java new file mode 100644 index 000000000000..1b575fd2d261 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.atomic.AtomicInteger; + +public class FakeSessionService extends FakeSessionGrpc.FakeSessionImplBase { + + private final ScheduledExecutorService executor; + private final AtomicInteger openRequestCount = new AtomicInteger(0); + + private final List sessionRequests = new ArrayList<>(); + + public FakeSessionService(ScheduledExecutorService executor) { + this.executor = executor; + } + + @Override + public StreamObserver openSession( + StreamObserver responseObserver) { + openRequestCount.incrementAndGet(); + SessionHandler handler = new SessionHandler(executor, responseObserver); + return new StreamObserver() { + @Override + public void onNext(SessionRequest value) { + sessionRequests.add(value); + handler.onNext(value); + } + + @Override + public void onError(Throwable t) { + handler.onError(t); + } + + @Override + public void onCompleted() { + handler.onCompleted(); + } + }; + } + + public AtomicInteger getOpenRequestCount() { + return openRequestCount; + } + + public java.util.List getSessionRequests() { + return sessionRequests; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java new file mode 100644 index 000000000000..524bb2795f61 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import java.time.Duration; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +public class FakeVRpcListener implements VRpcListener { + private BlockingDeque msgs = new LinkedBlockingDeque<>(); + private final AtomicInteger onMessageCount = new AtomicInteger(0); + + @Override + public void onMessage(RespT msg) { + onMessageCount.getAndIncrement(); + msgs.add(msg); + } + + @Override + public void onClose(VRpcResult result) { + msgs.add(result); + } + + @SuppressWarnings("unchecked") + public T popUntil(Class cls) throws InterruptedException { + Object obj = null; + while (!cls.isInstance(obj)) { + obj = popNext(); + } + return (T) obj; + } + + public Object popNext() throws InterruptedException { + return popNext(Duration.ofSeconds(1)); + } + + public Object popNext(Duration timeout) throws InterruptedException { + return msgs.poll(timeout.toMillis(), TimeUnit.MILLISECONDS); + } + + public int getOnMessageCount() { + return onMessageCount.get(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java new file mode 100644 index 000000000000..1cbf2651b10f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import java.util.Base64; + +public class PeerInfoInterceptor implements ServerInterceptor { + private static final Metadata.Key PEER_INFO_KEY = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + + @Override + public Listener interceptCall( + ServerCall call, Metadata headers, ServerCallHandler next) { + + return next.startCall( + new SimpleForwardingServerCall(call) { + @Override + public void sendHeaders(Metadata headers) { + PeerInfo peerInfo = + PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendRegion("local") + .setApplicationFrontendSubzone("ll") + .build(); + String encoded = Base64.getUrlEncoder().encodeToString(peerInfo.toByteArray()); + headers.put(PEER_INFO_KEY, encoded); + super.sendHeaders(headers); + } + }, + headers); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java new file mode 100644 index 000000000000..f1e4b4055931 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java @@ -0,0 +1,438 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.session.fake; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FakeSessionOpRequest; +import com.google.bigtable.v2.FakeSessionOpResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenFakeSessionResponse; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionRequest.PayloadCase; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.util.Durations; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.time.Duration; +import java.util.ArrayDeque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +public class SessionHandler implements StreamObserver { + public static final long AUTOMATIC_RPC_ID = -1; + + private final ScheduledExecutorService executor; + private final StreamObserver respStream; + private final Set> timers = new HashSet<>(); + private State state; + + public SessionHandler( + ScheduledExecutorService executor, StreamObserver respStream) { + this.executor = executor; + this.respStream = respStream; + + this.state = new NewState(this); + } + + // gRPC event handlers + @Override + public synchronized void onNext(SessionRequest msg) { + state = state.onMessage(msg); + } + + @Override + public synchronized void onError(Throwable t) { + state = state.onClose(Status.fromThrowable(t)); + } + + @Override + public synchronized void onCompleted() {} + + // helpers + ScheduledFuture delay(Duration amount, Supplier f) { + ScheduledFuture timer = + executor.schedule( + () -> { + synchronized (SessionHandler.this) { + state = f.get(); + } + }, + amount.toMillis(), + TimeUnit.MILLISECONDS); + timers.add(timer); + return timer; + } + + void writeResponse(SessionResponse response) { + respStream.onNext(response); + } + + State terminateWithError(Status status) { + respStream.onError(status.asRuntimeException()); + timers.forEach(t -> t.cancel(true)); + timers.clear(); + + return DoneState.INSTANCE; + } + + State terminateSuccess() { + state = DoneState.INSTANCE; + respStream.onCompleted(); + timers.forEach(t -> t.cancel(true)); + timers.clear(); + return state; + } + + interface State { + State onMessage(SessionRequest sReq); + + State onClose(Status status); + } + + static class NewState implements State { + private final SessionHandler handler; + + NewState(SessionHandler handler) { + this.handler = handler; + } + + @Override + public State onMessage(SessionRequest sReq) { + Preconditions.checkState( + sReq.getPayloadCase() == PayloadCase.OPEN_SESSION, + "NewState expected an OpenSession msg, got: %s", + sReq); + + OpenFakeSessionRequest oReq; + try { + oReq = OpenFakeSessionRequest.parseFrom(sReq.getOpenSession().getPayload()); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + + if (oReq.hasStreamError()) { + Status status = + Status.fromCodeValue(oReq.getStreamError().getStatus().getCode()) + .withDescription(oReq.getStreamError().getStatus().getMessage()); + + if (Durations.ZERO.equals(oReq.getStreamError().getDelay())) { + return handler.terminateWithError(status); + } else { + ScheduledFuture ignored = + handler.delay( + Duration.ofMillis(Durations.toMillis(oReq.getStreamError().getDelay())), + () -> handler.state = handler.terminateWithError(status)); + } + } + + // TODO: populate this + SessionParametersResponse params = + SessionParametersResponse.newBuilder().setKeepAlive(Durations.fromSeconds(1)).build(); + + if (oReq.hasSessionParams()) { + params = oReq.getSessionParams(); + } + handler.writeResponse(SessionResponse.newBuilder().setSessionParameters(params).build()); + + handler.writeResponse( + SessionResponse.newBuilder() + .setOpenSession( + OpenSessionResponse.newBuilder() + .setPayload(OpenFakeSessionResponse.newBuilder().build().toByteString())) + .build()); + + Duration goAwayDelay = + oReq.hasGoAwayDelay() + ? Duration.ofMillis(Durations.toMillis(oReq.getGoAwayDelay())) + : Duration.ofMinutes(1); + + if (oReq.equals(OpenFakeSessionRequest.getDefaultInstance())) { + oReq = + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .setRepeat(true) + .addActions( + Action.newBuilder() + .setResponse(VirtualRpcResponse.getDefaultInstance()) + .build()) + .build()) + .build(); + } + + return new RunningState(handler, goAwayDelay, oReq); + } + + @Override + public State onClose(Status status) { + return DoneState.INSTANCE; + } + } + + static class RunningState implements State { + private static final Duration HALF_CLOSE_WAIT_TIMEOUT = Duration.ofSeconds(1); + + private final SessionHandler helper; + private ScheduledFuture lifecycleTimer; + private boolean vRpcActive = false; + private boolean gotHalfClose = false; + + private final Map actionsMap; + private final Map actionQueues = new HashMap<>(); + + public RunningState( + SessionHandler helper, Duration goAwayDelay, OpenFakeSessionRequest request) { + this.helper = helper; + this.actionsMap = request.getVrpcActionsMap(); + + lifecycleTimer = helper.delay(goAwayDelay, this::handleGoAwayTimer); + + if (request.hasRefreshConfig()) { + Duration refreshDelay = + Duration.ofMillis( + com.google.protobuf.util.Durations.toMillis(request.getRefreshConfigDelay())); + helper.delay(refreshDelay, () -> handleRefreshConfigTimer(request.getRefreshConfig())); + } + } + + @Override + public State onMessage(SessionRequest request) { + switch (request.getPayloadCase()) { + case VIRTUAL_RPC: + State state = dispatchVRpc(request.getVirtualRpc()); + return state; + case CLOSE_SESSION: + return handleCloseMsg(request.getCloseSession()); + default: + return helper.terminateWithError( + Status.INTERNAL.withDescription("Unexpected payload: " + request)); + } + } + + private State dispatchVRpc(VirtualRpcRequest request) { + if (gotHalfClose) { + return helper.terminateWithError( + Status.INTERNAL.withDescription("got vRpc after client sent halfClose")); + } + Preconditions.checkState(!vRpcActive, "only 1 outstanding vRPC is supported"); + + FakeSessionOpRequest innerReq; + try { + innerReq = FakeSessionOpRequest.parseFrom(request.getPayload()); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + + this.vRpcActive = true; + + switch (innerReq.getPayloadCase()) { + case SCRIPTED_REQUEST: + long tag = innerReq.getScriptedRequest().getTag(); + ActionList actionList = actionsMap.get(tag); + Preconditions.checkNotNull(actionList, "tag not in action map: " + tag); + if (actionQueues.get(tag) == null) { + actionQueues.put(tag, createActionQueue(actionList)); + } + return handleVRpcScripted(request.getRpcId(), actionQueues.get(tag)); + default: + return helper.terminateWithError( + Status.INVALID_ARGUMENT.withDescription("Unexpected vRpc type: " + request)); + } + } + + private State handleVRpcScripted(long rpcId, ActionQueue actionQueue) { + if (helper.state != this) { + return helper.state; + } + + Action action = actionQueue.getNextAction(); + if (action.hasDelay()) { + @SuppressWarnings("UnusedVariable") + ScheduledFuture ignored = + helper.delay( + Duration.ofMillis(Durations.toMillis(action.getDelay())), + () -> handleResponse(action, rpcId)); + } else { + handleResponse(action, rpcId); + } + + return this; + } + + private State handleResponse(Action action, long rpcId) { + if (action.equals(Action.getDefaultInstance())) { + helper.writeResponse( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setPayload( + FakeSessionOpResponse.newBuilder() + .setScripted(SessionFakeScriptedResponse.getDefaultInstance()) + .build() + .toByteString())) + .build()); + } + + if (action.hasResponse()) { + if (action.getResponse().equals(VirtualRpcResponse.getDefaultInstance())) { + helper.writeResponse( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setPayload( + FakeSessionOpResponse.newBuilder() + .setScripted(SessionFakeScriptedResponse.getDefaultInstance()) + .build() + .toByteString())) + .build()); + + } else { + VirtualRpcResponse response = action.getResponse(); + if (response.getRpcId() == AUTOMATIC_RPC_ID) { + response = response.toBuilder().setRpcId(rpcId).build(); + } + helper.writeResponse(SessionResponse.newBuilder().setVirtualRpc(response).build()); + } + } + + if (action.hasErrorResponse()) { + helper.writeResponse( + SessionResponse.newBuilder().setError(action.getErrorResponse()).build()); + } + + vRpcActive = false; + return this; + } + + private State handleGoAwayTimer() { + if (helper.state != this) { + return helper.state; + } + helper.writeResponse( + SessionResponse.newBuilder() + .setGoAway( + GoAwayResponse.newBuilder() + .setReason("session_expiry") + .setDescription("Session needs to be refreshed") + .build()) + .build()); + this.lifecycleTimer = helper.delay(HALF_CLOSE_WAIT_TIMEOUT, this::handleCloseWaitTimeout); + return this; + } + + private State handleRefreshConfigTimer(com.google.bigtable.v2.SessionRefreshConfig config) { + if (helper.state != this) { + return helper.state; + } + helper.writeResponse(SessionResponse.newBuilder().setSessionRefreshConfig(config).build()); + return this; + } + + private ActionQueue createActionQueue(ActionList actionList) { + ActionQueue actionQueue; + if (actionList.equals(ActionList.getDefaultInstance())) { + Queue actions = new ArrayDeque<>(); + actions.add(Action.getDefaultInstance()); + actionQueue = new ActionQueue(true, actions); + } else { + actionQueue = + new ActionQueue(actionList.getRepeat(), new ArrayDeque<>(actionList.getActionsList())); + } + return actionQueue; + } + + // HalfClose + @Override + public State onClose(Status status) { + lifecycleTimer.cancel(true); + gotHalfClose = true; + + if (!vRpcActive) { + return helper.terminateSuccess(); + } + + return this; + } + + private State handleCloseWaitTimeout() { + if (helper.state != this) { + return helper.state; + } + + return helper.terminateWithError( + Status.INTERNAL.withDescription("client did not acknowledge a GO_AWAY response in time")); + } + + private State handleCloseMsg(CloseSessionRequest ignored) { + return helper.terminateSuccess(); + } + } + + static class DoneState implements State { + static final DoneState INSTANCE = new DoneState(); + + private DoneState() {} + + @Override + public State onMessage(SessionRequest request) { + return this; + } + + @Override + public State onClose(Status status) { + return this; + } + } + + static class ActionQueue { + private final boolean isRepeat; + private final Queue actions; + + ActionQueue(boolean repeat, Queue actions) { + this.isRepeat = repeat; + this.actions = actions; + } + + Action getNextAction() { + if (isRepeat) { + return actions.peek(); + } else { + return actions.poll(); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java new file mode 100644 index 000000000000..3dd5c4b0398a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.internal.test_helpers; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.StringSubject; +import com.google.common.truth.Subject; +import com.google.common.truth.ThrowableSubject; +import io.grpc.Status; +import io.grpc.Status.Code; +import javax.annotation.Nullable; + +public class StatusSubject extends Subject { + private final @Nullable Status actual; + + private StatusSubject(FailureMetadata failureMetadata, @Nullable Status subject) { + super(failureMetadata, subject); + this.actual = subject; + } + + public void isOk() { + code().isEqualTo(Code.OK); + } + + public Subject code() { + return check("code").that(actual.getCode()); + } + + public StringSubject description() { + return check("description").that(actual.getDescription()); + } + + public ThrowableSubject cause() { + return check("cause").that(actual.getCause()); + } + + public static StatusSubject assertThat(@Nullable Status status) { + return assertAbout(statuses()).that(status); + } + + public static Factory statuses() { + return StatusSubject::new; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java new file mode 100644 index 000000000000..29aa3b139390 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.test_helpers; + +import static com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import javax.annotation.Nullable; + +public class VRpcCallContextSubject extends Subject { + private final @Nullable VRpcCallContext actual; + + private VRpcCallContextSubject(FailureMetadata metadata, @Nullable VRpcCallContext subject) { + super(metadata, subject); + this.actual = subject; + } + + public void isIdempotent() { + check("operationinfo.isidempotent").that(actual.getOperationInfo().isIdempotent()).isTrue(); + } + + public void isNotIdempotent() { + check("operationinfo.isidempotent").that(actual.getOperationInfo().isIdempotent()).isFalse(); + } + + public static VRpcCallContextSubject assertThat(@Nullable VRpcCallContext context) { + return assertAbout(vRpcCallContexts()).that(context); + } + + public static Factory vRpcCallContexts() { + return VRpcCallContextSubject::new; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java new file mode 100644 index 000000000000..28b741e09548 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.test_helpers; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.common.truth.ComparableSubject; +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import com.google.rpc.RetryInfo; +import java.time.Duration; +import java.util.Optional; +import javax.annotation.Nullable; + +public final class VRpcResultSubject extends Subject { + private final @Nullable VRpcResult actual; + + private VRpcResultSubject(FailureMetadata failureMetadata, @Nullable VRpcResult subject) { + super(failureMetadata, subject); + this.actual = subject; + } + + public Subject state() { + return check("state").that(actual.getState()); + } + + public Subject rejected() { + return check("rejected").that(actual.getRejected()); + } + + public void hasRetryInfo() { + check("retryInfo").that(actual.getRetryInfo()).isNotNull(); + } + + public ComparableSubject retryInfoDelay() { + return check("retryInfo.delay") + .that( + Optional.ofNullable(actual.getRetryInfo()) + .map(RetryInfo::getRetryDelay) + .map(d -> Duration.ofSeconds(d.getSeconds()).plus(Duration.ofNanos(d.getNanos()))) + .orElse(null)); + } + + public ComparableSubject backendLatency() { + return check("retryInfo.backendLatency").that(actual.getBackendLatency()); + } + + public void isOk() { + status().isOk(); + } + + public StatusSubject status() { + return check("status").about(StatusSubject.statuses()).that(actual.getStatus()); + } + + public static VRpcResultSubject assertThat(@Nullable VRpcResult vRpcResult) { + return assertAbout(vrpcResults()).that(vRpcResult); + } + + public static Factory vrpcResults() { + return VRpcResultSubject::new; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java new file mode 100644 index 000000000000..d069c72ea290 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java @@ -0,0 +1,360 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.internal.util; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight; +import com.google.bigtable.v2.LoadBalancingOptions.PeakEwma; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ForwardingChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager.ConfigListener; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ClientConfigurationManagerTest { + private static final FeatureFlags FEATURE_FLAGS = FeatureFlags.getDefaultInstance(); + + private static final ClientInfo CLIENT_INFO = + ClientInfo.builder() + .setClientName("fake-client") + .setInstanceName(InstanceName.of("fake-project", "fake-instance")) + .setAppProfileId("default") + .build(); + + private Server server; + private FakeConfigService service; + private ChannelProviders.ChannelProvider channelProvider; + @Mock private ScheduledExecutorService mockExecutor; + private final OutstandingRpcCounter outstandingRpcCounter = new OutstandingRpcCounter(); + private ClientConfigurationManager manager; + private final NoopMetrics.NoopDebugTracer noopDebugTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + + @BeforeEach + void setUp() throws IOException { + service = new FakeConfigService(); + + server = FakeServiceBuilder.create(service).start(); + + channelProvider = + new ForwardingChannelProvider( + new ChannelProviders.EmulatorChannelProvider("localhost", server.getPort())) { + @Override + public ManagedChannelBuilder newChannelBuilder() { + return super.newChannelBuilder().intercept(outstandingRpcCounter); + } + }; + + manager = + new ClientConfigurationManager( + FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + } + + @AfterEach + void tearDown() { + manager.close(); + server.shutdown(); + } + + @Test + void initialFetchTest() throws ExecutionException, InterruptedException { + // Check the initial config is correct + ClientConfiguration initialConfig = manager.start().get(); + assertThat(initialConfig).isEqualTo(service.config.get()); + + // Make sure that the next poll was scheduled + ArgumentCaptor pollDelayCaptor = ArgumentCaptor.forClass(Long.class); + verify(mockExecutor, times(1)) + .schedule(any(Runnable.class), pollDelayCaptor.capture(), eq(TimeUnit.MILLISECONDS)); + + assertThat(pollDelayCaptor.getValue()) + .isEqualTo( + Durations.toMillis( + service.config.get().getPollingConfiguration().getPollingInterval())); + } + + @Test + void notifyListenerTest() throws Exception { + // Fetch initial config + manager.start().get(); + + ArgumentCaptor runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + verify(mockExecutor, times(1)).schedule(runnableCaptor.capture(), anyLong(), any()); + + // Add a listener + @SuppressWarnings("unchecked") + ConfigListener mockListener = Mockito.mock(ConfigListener.class); + manager.addListener(ClientConfiguration::getSessionConfiguration, mockListener); + + // force a fetch + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + // Config didnt change so listener shouldnt be invoked + verify(mockListener, never()).onChange(any()); + + // Change an unrelated config + ClientConfiguration.Builder builder = service.config.get().toBuilder(); + builder.getPollingConfigurationBuilder().setPollingInterval(Durations.fromMinutes(100)); + service.config.set(builder.build()); + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + // And make sure that the listener isn't invoked + verify(mockListener, never()).onChange(any()); + + // Now modify the relevant config section + builder + .getSessionConfigurationBuilder() + .getSessionPoolConfigurationBuilder() + .setLoadBalancingOptions( + LoadBalancingOptions.newBuilder() + .setLeastInFlight(LeastInFlight.newBuilder().setRandomSubsetSize(10))); + service.config.set(builder.build()); + // force a run + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + verify(mockListener, times(1)).onChange(eq(builder.build().getSessionConfiguration())); + } + + @Test + void testDisabledSessions() throws ExecutionException, InterruptedException { + ClientConfiguration.Builder builder = manager.getDefaultConfig().toBuilder(); + builder.getSessionConfigurationBuilder().setSessionLoad(0); + ClientConfiguration disabledCfg = builder.build(); + + // Default config should have entries for session & channel pools + assertThat(disabledCfg.getSessionConfiguration().getSessionPoolConfiguration()) + .isNotEqualToDefaultInstance(); + assertThat(disabledCfg.getSessionConfiguration().getChannelConfiguration()) + .isNotEqualToDefaultInstance(); + + service.config.set(disabledCfg); + // Fetch initial config + ClientConfiguration resolvedConfig = manager.start().get(); + // But since the load is zero, the session & channel pool configs should be cleared + assertThat(resolvedConfig.getSessionConfiguration().getSessionPoolConfiguration()) + .isEqualToDefaultInstance(); + assertThat(resolvedConfig.getSessionConfiguration().getChannelConfiguration()) + .isEqualToDefaultInstance(); + } + + @Deprecated + @Test + void testMigrateSessionPool() throws ExecutionException, InterruptedException { + ClientConfiguration defaultConfig = manager.getDefaultConfig(); + + // Override LoadBalancingOptions + LoadBalancingOptions loadBalancingOptions = + LoadBalancingOptions.newBuilder() + .setPeakEwma(PeakEwma.newBuilder().setRandomSubsetSize(0)) + .build(); + + ClientConfiguration.Builder legacyBuilder = defaultConfig.toBuilder(); + + // Enable sessions + legacyBuilder.getSessionConfigurationBuilder().setSessionLoad(0.1f); + + // Now patch default config to be a legacy config + // During migration, LoadBalancingOptions are a toplevel config, so clear out the + // SessionPoolConfiguration and set the toplevel option + legacyBuilder + .getSessionConfigurationBuilder() + .setLoadBalancingOptions(loadBalancingOptions) + .clearSessionPoolConfiguration() + .clearChannelConfiguration(); + ClientConfiguration legacyCfg = legacyBuilder.build(); + + service.config.set(legacyCfg); + // Fetch initial config + ClientConfiguration resolvedConfig = manager.start().get(); + + // Make sure that SessionPoolConfiguration got patched with SessionPool & ChannelPool configs + // And ensure that the toplevel LoadBalancingOptions got migrated + ClientConfiguration.Builder expectedConfig = legacyCfg.toBuilder(); + expectedConfig + .getSessionConfigurationBuilder() + .clearLoadBalancingOptions() + .setSessionPoolConfiguration( + defaultConfig.getSessionConfiguration().getSessionPoolConfiguration().toBuilder() + .setLoadBalancingOptions(loadBalancingOptions)) + .setChannelConfiguration(defaultConfig.getSessionConfiguration().getChannelConfiguration()); + + assertThat(resolvedConfig).isEqualTo(expectedConfig.build()); + } + + @Test + void testSysPropOverride() throws Exception { + manager.close(); + + String clientConfigOverrides = + TextFormat.printer() + .printToString( + ClientConfiguration.newBuilder() + .setSessionConfiguration( + SessionClientConfiguration.newBuilder() + .setSessionLoad(0.75f) + .setSessionPoolConfiguration( + SessionPoolConfiguration.newBuilder().setHeadroom(0.7f))) + .build()); + Properties sysProps = new Properties(); + sysProps.setProperty(ClientConfigurationManager.OVERRIDE_SYS_PROP_KEY, clientConfigOverrides); + manager = + new ClientConfigurationManager( + sysProps, FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + + ClientConfiguration initialConfig = manager.start().get(); + + // The effective config should be the server config with the overlayed fields + ClientConfiguration.Builder expectedConfig = service.config.get().toBuilder(); + expectedConfig.getSessionConfigurationBuilder().setSessionLoad(0.75f); + expectedConfig + .getSessionConfigurationBuilder() + .getSessionPoolConfigurationBuilder() + .setHeadroom(0.7f); + + assertThat(initialConfig).isEqualTo(expectedConfig.build()); + assertThat(manager.areSessionsRequired()).isTrue(); + } + + /** Verify that proto merging works when the override the same as the default value */ + @Test + void testSysPropOverrideSessionLoadZero() throws Exception { + manager.close(); + + String clientConfigOverrides = + TextFormat.printer() + .printToString( + ClientConfiguration.newBuilder() + .setSessionConfiguration( + SessionClientConfiguration.newBuilder().setSessionLoad(0)) + .build()); + Properties sysProps = new Properties(); + sysProps.setProperty(ClientConfigurationManager.OVERRIDE_SYS_PROP_KEY, clientConfigOverrides); + manager = + new ClientConfigurationManager( + sysProps, FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + + ClientConfiguration initialConfig = manager.start().get(); + + // The effective config should be the server config with the overlayed fields + ClientConfiguration.Builder expectedConfig = service.config.get().toBuilder(); + expectedConfig.getSessionConfigurationBuilder().setSessionLoad(0); + + assertThat(initialConfig).isEqualTo(service.config.get()); + } + + static class FakeConfigService extends BigtableGrpc.BigtableImplBase { + private final AtomicReference config = new AtomicReference<>(); + + public FakeConfigService() throws IOException { + ClientConfiguration.Builder builder = ClientConfigurationManager.loadDefault().toBuilder(); + builder.getSessionConfigurationBuilder().setSessionLoad(0.25f); + config.set(builder.build()); + } + + @Override + public void getClientConfiguration( + GetClientConfigurationRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(config.get()); + responseObserver.onCompleted(); + } + } + + private static class OutstandingRpcCounter implements ClientInterceptor { + private int numOutstandingRpcs = 0; + private final Object lock = new Object(); + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + synchronized (lock) { + numOutstandingRpcs++; + } + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + super.onClose(status, trailers); + synchronized (lock) { + numOutstandingRpcs--; + lock.notify(); + } + } + }, + headers); + } + }; + } + + void waitUntilRpcsDone() throws InterruptedException { + synchronized (lock) { + while (numOutstandingRpcs > 0) { + lock.wait(); + } + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java new file mode 100644 index 000000000000..cb944a2aec7a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java @@ -0,0 +1,393 @@ +/* + * 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.google.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getAggregatedValue; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getMetricData; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.getStartTimeSeconds; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTestUtils.verifyAttributes; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.client.util.Lists; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +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.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; +import com.google.cloud.bigtable.test_helpers.env.CloudEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.common.base.Stopwatch; +import com.google.common.collect.BoundType; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Range; +import com.google.monitoring.v3.ListTimeSeriesRequest; +import com.google.monitoring.v3.ListTimeSeriesResponse; +import com.google.monitoring.v3.Point; +import com.google.monitoring.v3.ProjectName; +import com.google.monitoring.v3.TimeInterval; +import com.google.monitoring.v3.TimeSeries; +import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@Ignore("Temporarily disable flaky test") +@RunWith(JUnit4.class) +public class BuiltinMetricsIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + private static final Logger logger = Logger.getLogger(BuiltinMetricsIT.class.getName()); + + @Rule public Timeout globalTimeout = Timeout.seconds(900); + + private Table tableCustomOtel; + private Table tableDefault; + private BigtableDataClient clientCustomOtel; + private BigtableDataClient clientDefault; + private BigtableTableAdminClient tableAdminClient; + private MetricServiceClient metricClient; + + private InMemoryMetricReader metricReader; + + public static String[] VIEWS = { + "operation_latencies", + "attempt_latencies", + "connectivity_error_count", + "application_blocking_latencies", + }; + + @Before + public void setup() throws IOException { + // This test tests 2 things. End-to-end test using the default OTEL instance created by the + // client, and also end-to-end test using a custom OTEL instance set by the customer. In + // both tests, a BigtableCloudMonitoringExporter is created to export data to Cloud Monitoring. + assume() + .withMessage("Builtin metrics integration test is not supported by emulator") + .that(testEnvRule.env()) + .isInstanceOf(CloudEnv.class); + + String appProfileId = testEnvRule.env().getDataClientSettings().getAppProfileId(); + + assume() + .withMessage( + "Builtin metrics integration test needs to be able to use a custom app profile and the" + + " app profile is currently forced to " + + appProfileId) + .that(appProfileId) + .isEmpty(); + + // Create a cloud monitoring client + metricClient = MetricServiceClient.create(); + + tableAdminClient = testEnvRule.env().getTableAdminClient(); + + // When using the custom OTEL instance, we can also register a InMemoryMetricReader on the + // SdkMeterProvider to verify the data exported on Cloud Monitoring with the in memory metric + // data collected in InMemoryMetricReader. + metricReader = InMemoryMetricReader.create(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + + BigtableDataSettings.Builder settings = testEnvRule.env().getDataClientSettings().toBuilder(); + + clientCustomOtel = + BigtableDataClient.create( + settings + .setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)) + .build()); + clientDefault = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() { + if (metricClient != null) { + metricClient.close(); + } + if (tableCustomOtel != null) { + tableAdminClient.deleteTable(tableCustomOtel.getId()); + } + if (tableDefault != null) { + tableAdminClient.deleteTable(tableDefault.getId()); + } + + if (clientCustomOtel != null) { + clientCustomOtel.close(); + } + if (clientDefault != null) { + clientDefault.close(); + } + } + + @Test + public void testBuiltinMetricsWithDefaultOTEL() throws Exception { + logger.info("Started testing builtin metrics with default OTEL"); + tableDefault = + tableAdminClient.createTable( + CreateTableRequest.of(PrefixGenerator.newPrefix("BuiltinMetricsIT#test1")) + .addFamily("cf")); + logger.info("Create default table: " + tableDefault.getId()); + + Instant start = Instant.now().minus(Duration.ofSeconds(10)); + + // Send a MutateRow and ReadRows request and measure the latencies for these requests. + clientDefault.mutateRow( + RowMutation.create(TableId.of(tableDefault.getId()), "a-new-key") + .setCell("cf", "q", "abc")); + ArrayList ignored = + Lists.newArrayList( + clientDefault.readRows(Query.create(TableId.of(tableDefault.getId())).limit(10))); + + // This stopwatch is used for to limit fetching of metric data in verifyMetrics + Stopwatch metricsPollingStopwatch = Stopwatch.createStarted(); + + ProjectName name = ProjectName.of(testEnvRule.env().getProjectId()); + + // Interval is set in the monarch request when query metric timestamps. + // Restrict it to before we send to request and 3 minute after we send the request. If + // it turns out to be still flaky we can increase the filter range. + Instant end = Instant.now().plus(Duration.ofMinutes(3)); + TimeInterval interval = + TimeInterval.newBuilder() + .setStartTime(Timestamps.fromMillis(start.toEpochMilli())) + .setEndTime(Timestamps.fromMillis(end.toEpochMilli())) + .build(); + + for (String view : VIEWS) { + // Filter on instance and method name + // Verify that metrics are published for MutateRow request + String metricFilter = + String.format( + "metric.type=\"bigtable.googleapis.com/client/%s\" AND" + + " resource.labels.instance=\"%s\" AND" + + " metric.labels.method=\"Bigtable.MutateRow\" AND resource.labels.table=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableDefault.getId()); + ListTimeSeriesRequest.Builder requestBuilder = + ListTimeSeriesRequest.newBuilder() + .setName(name.toString()) + .setFilter(metricFilter) + .setInterval(interval) + .setView(ListTimeSeriesRequest.TimeSeriesView.FULL); + verifyMetricsArePublished(requestBuilder.build(), metricsPollingStopwatch, view); + + // Verify that metrics are published for ReadRows request + metricFilter = + String.format( + "metric.type=\"bigtable.googleapis.com/client/%s\" AND" + + " resource.labels.instance=\"%s\" AND" + + " metric.labels.method=\"Bigtable.ReadRows\" AND resource.labels.table=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableDefault.getId()); + requestBuilder.setFilter(metricFilter); + + verifyMetricsArePublished(requestBuilder.build(), metricsPollingStopwatch, view); + } + } + + @Test + public void testBuiltinMetricsWithCustomOTEL() throws Exception { + logger.info("Started testing builtin metrics with custom OTEL"); + tableCustomOtel = + tableAdminClient.createTable( + CreateTableRequest.of(PrefixGenerator.newPrefix("BuiltinMetricsIT#test2")) + .addFamily("cf")); + logger.info("Create custom table: " + tableCustomOtel.getId()); + + Instant start = Instant.now().minus(Duration.ofSeconds(10)); + // Send a MutateRow and ReadRows request and measure the latencies for these requests. + clientCustomOtel.mutateRow( + RowMutation.create(TableId.of(tableCustomOtel.getId()), "a-new-key") + .setCell("cf", "q", "abc")); + ArrayList ignored = + Lists.newArrayList( + clientCustomOtel.readRows(Query.create(TableId.of(tableCustomOtel.getId())).limit(10))); + + // This stopwatch is used for to limit fetching of metric data in verifyMetrics + Stopwatch metricsPollingStopwatch = Stopwatch.createStarted(); + + ProjectName name = ProjectName.of(testEnvRule.env().getProjectId()); + + // Interval is set in the monarch request when query metric timestamps. + // Restrict it to before we send to request and 3 minute after we send the request. If + // it turns out to be still flaky we can increase the filter range. + Instant end = start.plus(Duration.ofMinutes(3)); + TimeInterval interval = + TimeInterval.newBuilder() + .setStartTime(Timestamps.fromMillis(start.toEpochMilli())) + .setEndTime(Timestamps.fromMillis(end.toEpochMilli())) + .build(); + + for (String view : VIEWS) { + String otelMetricName = view; + if (view.equals("application_blocking_latencies")) { + otelMetricName = "application_latencies"; + } + MetricData dataFromReader = getMetricData(metricReader, otelMetricName); + + // Filter on instance and method name + // Verify that metrics are correct for MutateRows request + String metricFilter = + String.format( + "metric.type=\"bigtable.googleapis.com/client/%s\" AND" + + " resource.labels.instance=\"%s\" AND" + + " metric.labels.method=\"Bigtable.MutateRow\" AND resource.labels.table=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableCustomOtel.getId()); + ListTimeSeriesRequest.Builder requestBuilder = + ListTimeSeriesRequest.newBuilder() + .setName(name.toString()) + .setFilter(metricFilter) + .setInterval(interval) + .setView(ListTimeSeriesRequest.TimeSeriesView.FULL); + + ListTimeSeriesResponse response = + verifyMetricsArePublished(requestBuilder.build(), metricsPollingStopwatch, view); + verifyMetricsWithMetricsReader(response, dataFromReader); + + // Verify that metrics are correct for ReadRows request + metricFilter = + String.format( + "metric.type=\"bigtable.googleapis.com/client/%s\" AND" + + " resource.labels.instance=\"%s\" AND" + + " metric.labels.method=\"Bigtable.ReadRows\" AND resource.labels.table=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableCustomOtel.getId()); + requestBuilder.setFilter(metricFilter); + + response = verifyMetricsArePublished(requestBuilder.build(), metricsPollingStopwatch, view); + verifyMetricsWithMetricsReader(response, dataFromReader); + } + } + + private ListTimeSeriesResponse verifyMetricsArePublished( + ListTimeSeriesRequest request, Stopwatch metricsPollingStopwatch, String view) + throws Exception { + ListTimeSeriesResponse response = metricClient.listTimeSeriesCallable().call(request); + while (response.getTimeSeriesCount() == 0 + && metricsPollingStopwatch.elapsed(TimeUnit.MINUTES) < 10) { + logger.log( + Level.INFO, + "Checking for view " + + view + + ", has timeseries=" + + response.getTimeSeriesCount() + + " stopwatch elapsed " + + metricsPollingStopwatch.elapsed(TimeUnit.MINUTES)); + // Call listTimeSeries every minute + Thread.sleep(Duration.ofMinutes(1).toMillis()); + response = metricClient.listTimeSeriesCallable().call(request); + } + + assertWithMessage("View " + view + " didn't return any data.") + .that(response.getTimeSeriesCount()) + .isGreaterThan(0); + + return response; + } + + private void verifyMetricsWithMetricsReader( + ListTimeSeriesResponse response, MetricData dataFromReader) { + + for (TimeSeries ts : response.getTimeSeriesList()) { + Map attributesMap = + ImmutableMap.builder() + .putAll(ts.getResource().getLabelsMap()) + .putAll(ts.getMetric().getLabelsMap()) + .build(); + AttributesBuilder attributesBuilder = Attributes.builder(); + String streamingKey = MetricLabels.STREAMING_KEY.getKey(); + attributesMap.forEach( + (k, v) -> { + if (!k.equals(streamingKey)) { + attributesBuilder.put(k, v); + } + }); + if (attributesMap.containsKey(streamingKey)) { + attributesBuilder.put(streamingKey, Boolean.parseBoolean(attributesMap.get(streamingKey))); + } + Attributes attributes = attributesBuilder.build(); + verifyAttributes(dataFromReader, attributes); + long expectedValue = getAggregatedValue(dataFromReader, attributes); + Timestamp startTime = getStartTimeSeconds(dataFromReader, attributes); + assertThat(startTime.getSeconds()).isGreaterThan(0); + List point = + ts.getPointsList().stream() + .filter( + p -> + Timestamps.compare(p.getInterval().getStartTime(), startTime) >= 0 + && Timestamps.compare( + p.getInterval().getStartTime(), + Timestamps.add( + startTime, + com.google.protobuf.Duration.newBuilder() + .setSeconds(60) + .build())) + < 0) + .collect(Collectors.toList()); + if (!point.isEmpty()) { + long actualValue = (long) point.get(0).getValue().getDistributionValue().getMean(); + assertWithMessage( + ts.getMetric().getType() + + " actual value does not match expected value, actual value " + + actualValue + + " expected value " + + expectedValue + + " actual start time " + + point.get(0).getInterval().getStartTime() + + " expected start time " + + startTime) + .that(actualValue) + .isIn( + Range.range( + expectedValue - 1, BoundType.CLOSED, expectedValue + 1, BoundType.CLOSED)); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java new file mode 100644 index 000000000000..bd2e8e5352e2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java @@ -0,0 +1,263 @@ +/* + * 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.BatcherImpl; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlEventStats; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +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.RowMutationEntry; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import java.io.IOException; +import java.util.Objects; +import java.util.UUID; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class BulkMutateIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test(timeout = 60 * 1000) + public void test() throws IOException, InterruptedException { + BigtableDataSettings settings = testEnvRule.env().getDataClientSettings(); + String rowPrefix = UUID.randomUUID().toString(); + // Set target latency really low so it'll trigger adjusting thresholds + BigtableDataSettings.Builder builder = + settings.toBuilder().enableBatchMutationLatencyBasedThrottling(2L); + + try (BigtableDataClient client = BigtableDataClient.create(builder.build()); + BatcherImpl batcher = + (BatcherImpl) + client.newBulkMutationBatcher(testEnvRule.env().getTableId())) { + FlowControlEventStats events = batcher.getFlowController().getFlowControlEventStats(); + long initialThreashold = + Objects.requireNonNull(batcher.getFlowController().getCurrentElementCountLimit()); + assertThat(batcher.getFlowController().getCurrentElementCountLimit()) + .isNotEqualTo(batcher.getFlowController().getMinElementCountLimit()); + assertThat(batcher.getFlowController().getCurrentElementCountLimit()) + .isNotEqualTo(batcher.getFlowController().getMaxElementCountLimit()); + + String familyId = testEnvRule.env().getFamilyId(); + long initial = batcher.getFlowController().getCurrentElementCountLimit(); + for (long i = 0; i < initial * 3; i++) { + String key = rowPrefix + "test-key" + i; + ApiFuture ignored = + batcher.add(RowMutationEntry.create(key).setCell(familyId, "qualifier", i)); + } + batcher.flush(); + assertThat(events.getLastFlowControlEvent()).isNotNull(); + // Verify that the threshold is adjusted + assertThat(batcher.getFlowController().getCurrentElementCountLimit()) + .isNotEqualTo(initialThreashold); + // Query a key to make sure the write succeeded + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call( + Query.create(testEnvRule.env().getTableId()) + .rowKey(rowPrefix + "test-key" + initial)); + assertThat(row.getCells()).hasSize(1); + } + } + + @Test(timeout = 60 * 1000) + public void testOnAuthorizedView() throws IOException, InterruptedException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataSettings settings = testEnvRule.env().getDataClientSettings(); + String rowPrefix = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + // Set target latency really low so it'll trigger adjusting thresholds + BigtableDataSettings.Builder builder = + settings.toBuilder().enableBatchMutationLatencyBasedThrottling(2L); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + try (BigtableDataClient client = BigtableDataClient.create(builder.build()); + Batcher batcher = + client.newBulkMutationBatcher( + AuthorizedViewId.of(testEnvRule.env().getTableId(), testAuthorizedView.getId()))) { + + String familyId = testEnvRule.env().getFamilyId(); + + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(rowPrefix + "test-key") + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, "value")); + batcher.flush(); + + // Query a key to make sure the write succeeded + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowPrefix + "test-key")); + assertThat(row.getCells()).hasSize(1); + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } + + @Test + public void testManyMutations() throws IOException, InterruptedException { + // Emulator is very slow and will take a long time for the test to run + assume() + .withMessage("testManyMutations is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataSettings settings = testEnvRule.env().getDataClientSettings(); + String rowPrefix = UUID.randomUUID().toString(); + + BatchingSettings batchingSettings = + settings.getStubSettings().bulkMutateRowsSettings().getBatchingSettings(); + + settings.toBuilder() + .stubSettings() + .bulkMutateRowsSettings() + .setBatchingSettings( + batchingSettings.toBuilder().setDelayThreshold(Duration.ofHours(1)).build()); + try (BigtableDataClient client = BigtableDataClient.create(settings); + BatcherImpl batcher = + (BatcherImpl) + client.newBulkMutationBatcher(testEnvRule.env().getTableId())) { + + String familyId = testEnvRule.env().getFamilyId(); + for (int i = 0; i < 2; i++) { + String key = rowPrefix + "test-key"; + RowMutationEntry rowMutationEntry = RowMutationEntry.create(key); + // Create mutation entries with many columns. The batcher should flush every time. + for (long j = 0; j < 50001; j++) { + rowMutationEntry.setCell(familyId, "q" + j + i, j); + } + ApiFuture ignored = batcher.add(rowMutationEntry); + } + batcher.flush(); + // Query a key to make sure the write succeeded + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowPrefix + "test-key")); + assertThat(row.getCells()).hasSize(100002); + } + } + + @Test(timeout = 60 * 1000) + public void testManyMutationsOnAuthorizedView() throws IOException, InterruptedException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + BigtableDataSettings settings = testEnvRule.env().getDataClientSettings(); + String rowPrefix = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + + BatchingSettings batchingSettings = + settings.getStubSettings().bulkMutateRowsSettings().getBatchingSettings(); + + settings.toBuilder() + .stubSettings() + .bulkMutateRowsSettings() + .setBatchingSettings( + batchingSettings.toBuilder().setDelayThreshold(Duration.ofHours(1)).build()); + try (BigtableDataClient client = BigtableDataClient.create(settings); + Batcher batcher = + client.newBulkMutationBatcher( + AuthorizedViewId.of(testEnvRule.env().getTableId(), testAuthorizedView.getId()))) { + String familyId = testEnvRule.env().getFamilyId(); + for (int i = 0; i < 2; i++) { + String key = rowPrefix + "test-key"; + RowMutationEntry rowMutationEntry = RowMutationEntry.create(key); + // Create mutation entries with many columns. The batcher should flush every time. + for (long j = 0; j < 50001; j++) { + rowMutationEntry.setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + j + i, j); + } + ApiFuture ignored = batcher.add(rowMutationEntry); + } + batcher.flush(); + // Query a key to make sure the write succeeded + Row row = + client + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowPrefix + "test-key")); + assertThat(row.getCells()).hasSize(100002); + } + + // We should not be able to mutate rows outside the authorized view + try { + try (BigtableDataClient client = BigtableDataClient.create(settings); + Batcher batcherOutsideAuthorizedView = + client.newBulkMutationBatcher( + AuthorizedViewId.of( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()))) { + String keyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view"; + RowMutationEntry rowMutationEntry = RowMutationEntry.create(keyOutsideAuthorizedView); + rowMutationEntry.setCell( + testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "test-value"); + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = batcherOutsideAuthorizedView.add(rowMutationEntry); + batcherOutsideAuthorizedView.flush(); + } + fail("Should not be able to apply bulk mutation on rows outside authorized view"); + } catch (Exception e) { + // Ignore. + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java new file mode 100644 index 000000000000..a14029294f3f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java @@ -0,0 +1,196 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.batching.Batcher; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +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.RowMutationEntry; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BulkReadIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + private static String AUTHORIZED_VIEW_ROW_PREFIX = "row#"; + private static String AUTHORIZED_VIEW_COLUMN_QUALIFIER = "qualifier"; + + @Test + public void testBulkRead() throws InterruptedException, ExecutionException { + BigtableDataClient client = testEnvRule.env().getDataClient(); + String family = testEnvRule.env().getFamilyId(); + String rowPrefix = UUID.randomUUID().toString(); + int numRows = 10; + + BulkMutation bulkMutation = BulkMutation.create(testEnvRule.env().getTableId()); + List expectedRows = new ArrayList<>(); + + for (int i = 0; i < numRows; i++) { + bulkMutation.add( + RowMutationEntry.create(rowPrefix + "-" + i) + .setCell(family, "qualifier", 10_000L, "value-" + i)); + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(rowPrefix + "-" + i), + ImmutableList.of( + RowCell.create( + family, + ByteString.copyFromUtf8("qualifier"), + 10_000L, + ImmutableList.of(), + ByteString.copyFromUtf8("value-" + i))))); + } + client.bulkMutateRows(bulkMutation); + + try (Batcher batcher = + client.newBulkReadRowsBatcher(testEnvRule.env().getTableId())) { + + List> rowFutures = new ArrayList<>(numRows); + + for (int rowCount = 0; rowCount < numRows; rowCount++) { + ApiFuture entryResponse = + batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + rowCount)); + + rowFutures.add(entryResponse); + } + + batcher.flush(); + List actualRows = ApiFutures.allAsList(rowFutures).get(); + assertThat(actualRows).isEqualTo(expectedRows); + + // To verify non-existent and duplicate row keys + rowFutures = new ArrayList<>(); + + // non-existent row key + rowFutures.add(batcher.add(ByteString.copyFromUtf8(UUID.randomUUID().toString()))); + + // duplicate row key + rowFutures.add(batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + 0))); + rowFutures.add(batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + 0))); + + batcher.flush(); + actualRows = ApiFutures.allAsList(rowFutures).get(); + assertThat(actualRows.get(0)).isNull(); + assertThat(actualRows.get(1)).isEqualTo(expectedRows.get(0)); + assertThat(actualRows.get(2)).isEqualTo(expectedRows.get(0)); + } + } + + @Test + public void testBulkReadOnAuthorizedView() throws InterruptedException, ExecutionException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + String family = testEnvRule.env().getFamilyId(); + String rowPrefix = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + int numRows = 10; + + BulkMutation bulkMutation = BulkMutation.create(testEnvRule.env().getTableId()); + List expectedRows = new ArrayList<>(); + + for (int i = 0; i < numRows; i++) { + bulkMutation.add( + RowMutationEntry.create(rowPrefix + "-" + i) + .setCell(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER, 10_000L, "value-" + i)); + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(rowPrefix + "-" + i), + ImmutableList.of( + RowCell.create( + family, + ByteString.copyFromUtf8(AUTHORIZED_VIEW_COLUMN_QUALIFIER), + 10_000L, + ImmutableList.of(), + ByteString.copyFromUtf8("value-" + i))))); + } + // Add a row outside the authorized view. + String rowPrefixForRowOutsideAuthorizedView = rowPrefix + numRows; + bulkMutation.add( + RowMutationEntry.create(rowPrefixForRowOutsideAuthorizedView) + .setCell(family, "outside-authorized-view", 10_000L, "test-value")); + client.bulkMutateRows(bulkMutation); + + try (Batcher batcher = + client.newBulkReadRowsBatcher( + AuthorizedViewId.of(testEnvRule.env().getTableId(), testAuthorizedView.getId()))) { + + List> rowFutures = new ArrayList<>(numRows); + + for (int rowCount = 0; rowCount < numRows; rowCount++) { + ApiFuture entryResponse = + batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + rowCount)); + + rowFutures.add(entryResponse); + } + + batcher.flush(); + List actualRows = ApiFutures.allAsList(rowFutures).get(); + assertThat(actualRows).isEqualTo(expectedRows); + + // To verify non-existent and duplicate row keys + rowFutures = new ArrayList<>(); + + // non-existent row key + rowFutures.add(batcher.add(ByteString.copyFromUtf8(UUID.randomUUID().toString()))); + + // duplicate row key + rowFutures.add(batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + 0))); + rowFutures.add(batcher.add(ByteString.copyFromUtf8(rowPrefix + "-" + 0))); + + // row key outside authorized view + rowFutures.add(batcher.add(ByteString.copyFromUtf8(rowPrefixForRowOutsideAuthorizedView))); + + batcher.flush(); + actualRows = ApiFutures.allAsList(rowFutures).get(); + assertThat(actualRows.get(0)).isNull(); + assertThat(actualRows.get(1)).isEqualTo(expectedRows.get(0)); + assertThat(actualRows.get(2)).isEqualTo(expectedRows.get(0)); + assertThat(actualRows.get(3)).isNull(); + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java new file mode 100644 index 000000000000..a3570f5e5bfb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java @@ -0,0 +1,163 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +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.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CheckAndMutateIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test + public void test() throws Exception { + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String rowKey = UUID.randomUUID().toString(); + + testEnvRule + .env() + .getDataClient() + .mutateRowCallable() + .call( + RowMutation.create(tableId, rowKey) + .setCell(familyId, "q1", "val1") + .setCell(familyId, "q2", "val2")); + + testEnvRule + .env() + .getDataClient() + .checkAndMutateRowAsync( + ConditionalRowMutation.create(tableId, rowKey) + .condition(FILTERS.qualifier().exactMatch("q1")) + .then(Mutation.create().setCell(familyId, "q3", "q1"))) + .get(1, TimeUnit.MINUTES); + + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(tableId).rowKey(rowKey)); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(2).getValue()).isEqualTo(ByteString.copyFromUtf8("q1")); + } + + @Test + public void testOnAuthorizedView() throws Exception { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String rowKey = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + BigtableDataClient dataClient = testEnvRule.env().getDataClient(); + + dataClient + .mutateRowCallable() + .call( + RowMutation.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "1", "val1") + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "2", "val2")); + + dataClient + .checkAndMutateRowAsync( + ConditionalRowMutation.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .condition(FILTERS.qualifier().exactMatch(AUTHORIZED_VIEW_COLUMN_QUALIFIER + "1")) + .then( + Mutation.create() + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "3", "q1"))) + .get(1, TimeUnit.MINUTES); + + Row row = dataClient.readRowsCallable().first().call(Query.create(tableId).rowKey(rowKey)); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(2).getValue()).isEqualTo(ByteString.copyFromUtf8("q1")); + + // Conditional mutation for rows exist in the table but outside the authorized view + String rowKeyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view"; + dataClient + .mutateRowCallable() + .call( + RowMutation.create(tableId, rowKeyOutsideAuthorizedView) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, "value")); + try { + dataClient + .checkAndMutateRowAsync( + ConditionalRowMutation.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + rowKeyOutsideAuthorizedView) + .condition(FILTERS.qualifier().exactMatch(AUTHORIZED_VIEW_COLUMN_QUALIFIER)) + .then(Mutation.create().setCell(familyId, "new_qualifier", "new-value"))) + .get(1, TimeUnit.MINUTES); + fail("Should not be able to conditional mutate row outside authorized view"); + } catch (Exception e) { + assertThat(e.getCause()).isInstanceOf(PermissionDeniedException.class); + } + + // Column qualifier outside the authorized view + try { + dataClient + .checkAndMutateRowAsync( + ConditionalRowMutation.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .condition(FILTERS.qualifier().exactMatch(AUTHORIZED_VIEW_COLUMN_QUALIFIER)) + .then(Mutation.create().setCell(familyId, "new_qualifier", "new-value"))) + .get(1, TimeUnit.MINUTES); + fail("Should not be able to perform mutations with cells outside the authorized view"); + } catch (Exception e) { + assertThat(e.getCause()).isInstanceOf(PermissionDeniedException.class); + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java new file mode 100644 index 000000000000..9f1e2f710456 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java @@ -0,0 +1,262 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.it; + +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv.ConnectionMode; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.base.Stopwatch; +import com.google.common.collect.ImmutableSet; +import io.grpc.ManagedChannelBuilder; +import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; +import io.grpc.netty.shaded.io.netty.channel.ChannelDuplexHandler; +import io.grpc.netty.shaded.io.netty.channel.ChannelFactory; +import io.grpc.netty.shaded.io.netty.channel.ChannelHandlerContext; +import io.grpc.netty.shaded.io.netty.channel.ChannelPromise; +import io.grpc.netty.shaded.io.netty.channel.EventLoopGroup; +import io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup; +import io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel; +import io.grpc.netty.shaded.io.netty.util.ReferenceCountUtil; +import io.grpc.netty.shaded.io.netty.util.concurrent.Future; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * Test DirectPath fallback behavior by injecting a ChannelHandler into the netty stack that will + * disrupt IPv6 communications. + * + *

WARNING: this test can only be run on a GCE VM and will explicitly ignore + * GOOGLE_APPLICATION_CREDENTIALS and use the service account associated with the VM. + */ +@RunWith(JUnit4.class) +public class DirectPathFallbackIT { + // A threshold of completed read calls to observe to ascertain IPv6 is working. + // This was determined experimentally to account for both gRPC-LB RPCs and Bigtable api RPCs. + private static final int MIN_COMPLETE_READ_CALLS = 40; + private static final int NUM_RPCS_TO_SEND = 20; + + // IP address prefixes allocated for DirectPath backends. + private static final String DP_IPV6_PREFIX = "2001:4860:8040"; + private static final String DP_IPV4_PREFIX = "34.126"; + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + private final AtomicBoolean blackholeDpAddr = new AtomicBoolean(); + private final AtomicInteger numBlocked = new AtomicInteger(); + private final AtomicInteger numDpAddrRead = new AtomicInteger(); + + private final ChannelFactory channelFactory; + private final EventLoopGroup eventLoopGroup; + private BigtableDataClient instrumentedClient; + + public DirectPathFallbackIT() { + // Create a transport channel provider that can intercept ipv6 packets. + channelFactory = new MyChannelFactory(); + eventLoopGroup = new NioEventLoopGroup(); + } + + @Before + public void setup() throws IOException { + Set validModes = + ImmutableSet.of( + ConnectionMode.REQUIRE_DIRECT_PATH, ConnectionMode.REQUIRE_DIRECT_PATH_IPV4); + assume() + .withMessage("DirectPathFallbackIT can only return when explicitly requested") + .that(validModes.contains(testEnvRule.env().getConnectionMode())) + .isTrue(); + + BigtableDataSettings defaultSettings = testEnvRule.env().getDataClientSettings(); + InstantiatingGrpcChannelProvider defaultTransportProvider = + (InstantiatingGrpcChannelProvider) + defaultSettings.getStubSettings().getTransportChannelProvider(); + InstantiatingGrpcChannelProvider instrumentedTransportChannelProvider = + defaultTransportProvider.toBuilder() + .setAttemptDirectPath(true) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator( + builder -> { + injectNettyChannelHandler(builder); + + // Fail fast when blackhole is active + builder.keepAliveTime(1, TimeUnit.SECONDS); + builder.keepAliveTimeout(1, TimeUnit.SECONDS); + return builder; + }) + .build(); + + // Inject the instrumented transport provider into a new client + BigtableDataSettings.Builder settingsBuilder = + testEnvRule.env().getDataClientSettings().toBuilder(); + + settingsBuilder + .stubSettings() + .setTransportChannelProvider(instrumentedTransportChannelProvider); + + instrumentedClient = BigtableDataClient.create(settingsBuilder.build()); + } + + @After + public void teardown() { + if (instrumentedClient != null) { + instrumentedClient.close(); + } + if (eventLoopGroup != null) { + Future ignored = eventLoopGroup.shutdownGracefully(); + } + } + + @Test + public void testFallback() throws InterruptedException, TimeoutException { + // Precondition: wait for DirectPath to connect + assertWithMessage("Failed to observe RPCs over DirectPath").that(exerciseDirectPath()).isTrue(); + + // Enable the blackhole, which will prevent communication with grpclb and thus DirectPath. + blackholeDpAddr.set(true); + + // Send a request, which should be routed over IPv4 and CFE. + instrumentedClient.readRow(testEnvRule.env().getTableId(), "nonexistent-row"); + + // Verify that the above check was meaningful, by verifying that the blackhole actually dropped + // packets. + assertWithMessage("Failed to detect any IPv6 traffic in blackhole") + .that(numBlocked.get()) + .isGreaterThan(0); + + // Make sure that the client will start reading from IPv6 again by sending new requests and + // checking the injected IPv6 counter has been updated. + blackholeDpAddr.set(false); + + assertWithMessage("Failed to upgrade back to DirectPath").that(exerciseDirectPath()).isTrue(); + } + + private boolean exerciseDirectPath() throws InterruptedException, TimeoutException { + Stopwatch stopwatch = Stopwatch.createStarted(); + numDpAddrRead.set(0); + + boolean seenEnough = false; + + while (!seenEnough && stopwatch.elapsed(TimeUnit.MINUTES) < 2) { + for (int i = 0; i < NUM_RPCS_TO_SEND; i++) { + instrumentedClient.readRow(testEnvRule.env().getTableId(), "nonexistent-row"); + } + Thread.sleep(100); + seenEnough = numDpAddrRead.get() >= MIN_COMPLETE_READ_CALLS; + } + return seenEnough; + } + + /** + * This is a giant hack to enable testing DirectPath CFE fallback. + * + *

Injects a NettyChannelHandler to signal IPv6 packet loss. + */ + private void injectNettyChannelHandler(ManagedChannelBuilder channelBuilder) { + NettyChannelBuilder nettyChannelBuilder = (NettyChannelBuilder) channelBuilder; + nettyChannelBuilder.channelFactory(channelFactory); + nettyChannelBuilder.eventLoopGroup(eventLoopGroup); + } + + /** + * @see com.google.cloud.bigtable.data.v2.it.DirectPathFallbackIT.MyChannelHandler + */ + private class MyChannelFactory implements ChannelFactory { + @Override + public NioSocketChannel newChannel() { + NioSocketChannel channel = new NioSocketChannel(); + channel.pipeline().addLast(new MyChannelHandler()); + + return channel; + } + } + + /** + * A netty {@link io.grpc.netty.shaded.io.netty.channel.ChannelHandler} that can be instructed to + * make IPv6 packets disappear + */ + private class MyChannelHandler extends ChannelDuplexHandler { + private boolean isDpAddr; + + @Override + public void connect( + ChannelHandlerContext ctx, + SocketAddress remoteAddress, + SocketAddress localAddress, + ChannelPromise promise) + throws Exception { + + if (remoteAddress instanceof InetSocketAddress) { + InetAddress inetAddress = ((InetSocketAddress) remoteAddress).getAddress(); + String addr = inetAddress.getHostAddress(); + isDpAddr = addr.startsWith(DP_IPV6_PREFIX) || addr.startsWith(DP_IPV4_PREFIX); + } + + if (!(isDpAddr && blackholeDpAddr.get())) { + super.connect(ctx, remoteAddress, localAddress, promise); + } else { + // Fail the connection fast + @SuppressWarnings("UnusedVariable") + ChannelPromise ignored = promise.setFailure(new IOException("fake error")); + } + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + boolean dropCall = isDpAddr && blackholeDpAddr.get(); + + if (dropCall) { + // Don't notify the next handler and increment counter + numBlocked.incrementAndGet(); + ReferenceCountUtil.release(msg); + } else { + super.channelRead(ctx, msg); + } + } + + @Override + public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { + boolean dropCall = isDpAddr && blackholeDpAddr.get(); + + if (dropCall) { + // Don't notify the next handler and increment counter + numBlocked.incrementAndGet(); + } else { + if (isDpAddr) { + numDpAddrRead.incrementAndGet(); + } + super.channelReadComplete(ctx); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java new file mode 100644 index 000000000000..f72ebf1437c9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java @@ -0,0 +1,448 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.cloud.Date; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Album; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import com.google.protobuf.DescriptorProtos.FileDescriptorSet; +import java.io.IOException; +import java.time.Instant; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ExecuteQueryIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + private static BigtableDataClient dataClient; + private static BigtableTableAdminClient adminClient; + private static String tableId; + private static Table table; + private static String schemaBundleId; + private static String cf; + private static String uniquePrefix; + private static final Logger logger = Logger.getLogger(ExecuteQueryIT.class.getName()); + + @BeforeClass + public static void setUpAll() throws IOException { + assume() + .withMessage("ExecuteQuery is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + assume() + .withMessage("ExecuteQuery only works over CloudPath") + .that(testEnvRule.env().getConnectionMode()) + .isNoneOf( + AbstractTestEnv.ConnectionMode.REQUIRE_DIRECT_PATH, + AbstractTestEnv.ConnectionMode.REQUIRE_DIRECT_PATH_IPV4); + + tableId = PrefixGenerator.newPrefix("ExecuteQueryIT"); + dataClient = testEnvRule.env().getDataClient(); + adminClient = testEnvRule.env().getTableAdminClient(); + cf = testEnvRule.env().getFamilyId(); + uniquePrefix = UUID.randomUUID() + "-execute-query-it-"; + schemaBundleId = PrefixGenerator.newPrefix("ExecuteQueryIT#bundle"); + + table = adminClient.createTable(CreateTableRequest.of(tableId).addFamily(cf)); + FileDescriptorSet fileDescriptorSet = + FileDescriptorSet.newBuilder() + .addFile(Singer.getDescriptor().getFile().toProto()) + .addFile(Album.getDescriptor().getFile().toProto()) + .build(); + adminClient.createSchemaBundle( + CreateSchemaBundleRequest.of(tableId, schemaBundleId) + .setProtoSchema(fileDescriptorSet.toByteString())); + + dataClient.mutateRow( + RowMutation.create(tableId, uniquePrefix + "a") + .setCell(cf, ByteString.copyFromUtf8("qual"), 1000, ByteString.copyFromUtf8("old")) + .setCell(cf, ByteString.copyFromUtf8("qual2"), 1000, ByteString.copyFromUtf8("old2"))); + // Overwrite the previous values. Used for testing with_history + dataClient.mutateRow( + RowMutation.create(tableId, uniquePrefix + "a") + .setCell(cf, ByteString.copyFromUtf8("qual"), 10000, ByteString.copyFromUtf8("val")) + .setCell(cf, ByteString.copyFromUtf8("qual2"), 10000, ByteString.copyFromUtf8("val2")) + .setCell(cf, ByteString.copyFromUtf8("qual3"), 10000, ByteString.copyFromUtf8("val3"))); + dataClient.mutateRow( + RowMutation.create(tableId, uniquePrefix + "b") + .setCell(cf, ByteString.copyFromUtf8("qual"), 10000, ByteString.copyFromUtf8("bval")) + .setCell( + cf, ByteString.copyFromUtf8("qual2"), 10000, ByteString.copyFromUtf8("bval2"))); + } + + @AfterClass + public static void tearDownAll() { + if (table != null) { + // Deleting the table will also clean up all the schema bundles under it. + adminClient.deleteTable(tableId); + } + } + + @Test + public void selectStar() { + PreparedStatement preparedStatement = + dataClient.prepareStatement( + "SELECT * FROM `" + tableId + "` WHERE _key LIKE '" + uniquePrefix + "%'", + new HashMap<>()); + BoundStatement statement = preparedStatement.bind().build(); + try (ResultSet rs = dataClient.executeQuery(statement)) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("_key")).isEqualTo(ByteString.copyFromUtf8(uniquePrefix + "a")); + assertThat( + rs.getMap(cf, SqlType.mapOf(SqlType.bytes(), SqlType.bytes())) + .get(ByteString.copyFromUtf8("qual"))) + .isEqualTo(ByteString.copyFromUtf8("val")); + + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("_key")).isEqualTo(ByteString.copyFromUtf8(uniquePrefix + "b")); + assertThat( + rs.getMap(cf, SqlType.mapOf(SqlType.bytes(), SqlType.bytes())) + .get(ByteString.copyFromUtf8("qual"))) + .isEqualTo(ByteString.copyFromUtf8("bval")); + + assertThat(rs.next()).isFalse(); + } + } + + @Test + public void withHistoryQuery() { + PreparedStatement preparedStatement = + dataClient.prepareStatement( + "SELECT * FROM `" + + tableId + + "`(with_history => true) WHERE _key LIKE '" + + uniquePrefix + + "%'", + new HashMap<>()); + BoundStatement statement = preparedStatement.bind().build(); + try (ResultSet rs = dataClient.executeQuery(statement)) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("_key")).isEqualTo(ByteString.copyFromUtf8(uniquePrefix + "a")); + Map> rowACf = rs.getMap(cf, SqlType.historicalMap()); + List rowAQual = rowACf.get(ByteString.copyFromUtf8("qual")); + assertThat(rowAQual.size()).isEqualTo(2); + Struct rowAQual_0 = rowAQual.get(0); + assertThat(rowAQual_0.getBytes("value")).isEqualTo(ByteString.copyFromUtf8("val")); + // timestamp in micros above so we divide by 1000 + assertThat(rowAQual_0.getTimestamp("timestamp")).isEqualTo(Instant.ofEpochMilli(10)); + Struct rowAQual_1 = rowAQual.get(1); + assertThat(rowAQual_1.getBytes("value")).isEqualTo(ByteString.copyFromUtf8("old")); + assertThat(rowAQual_1.getTimestamp("timestamp")).isEqualTo(Instant.ofEpochMilli(1)); + + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("_key")).isEqualTo(ByteString.copyFromUtf8(uniquePrefix + "b")); + Map> rowBCf = rs.getMap(cf, SqlType.historicalMap()); + List rowBQual = rowBCf.get(ByteString.copyFromUtf8("qual")); + assertThat(rowBQual.size()).isEqualTo(1); + Struct rowBQual_0 = rowBQual.get(0); + assertThat(rowBQual_0.getBytes("value")).isEqualTo(ByteString.copyFromUtf8("bval")); + + assertThat(rs.next()).isFalse(); + } + } + + @SuppressWarnings("DoubleBraceInitialization") + @Test + public void allTypes() throws Exception { + Album album = Album.newBuilder().setTitle("Lover").build(); + + // For some reason the ExecuteQuery data path sometimes cannot resolve a newly-created schema + // bundle immediately after its creation. To avoid test flakiness, we wrap query preparation + // with a retry loop. + PreparedStatement preparedStatement; + int retryCount = 0; + int maxRetries = 10; + while (true) { + try { + preparedStatement = + dataClient.prepareStatement( + "SELECT 'stringVal' AS strCol, b'foo' as bytesCol, 1 AS intCol, CAST(1.2 AS" + + " FLOAT32) as f32Col, CAST(1.3 AS FLOAT64) as f64Col, true as boolCol," + + " TIMESTAMP_FROM_UNIX_MILLIS(1000) AS tsCol, DATE(2024, 06, 01) as dateCol," + + " STRUCT(1 as a, \"foo\" as b) AS structCol, [1,2,3] AS arrCol, " + + cf + + " as mapCol, " + + " CAST(b'\022\005Lover' AS `" + + schemaBundleId + + ".com.google.cloud.bigtable.data.v2.test.Album`) as protoCol, CAST('JAZZ' AS" + + " `" + + schemaBundleId + + ".com.google.cloud.bigtable.data.v2.test.Genre`) as enumCol FROM `" + + tableId + + "` WHERE _key='" + + uniquePrefix + + "a' LIMIT 1", + new HashMap<>()); + break; + } catch (InvalidArgumentException e) { + if (++retryCount == maxRetries) { + throw e; + } + logger.log(Level.INFO, "Retrying prepareStatement, retryCount: " + retryCount); + Thread.sleep(5000); + } + } + + BoundStatement statement = preparedStatement.bind().build(); + try (ResultSet rs = dataClient.executeQuery(statement)) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("stringVal"); + assertThat(rs.getString(0)).isEqualTo("stringVal"); + assertThat(rs.getBytes("bytesCol")).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(rs.getBytes(1)).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(rs.getLong("intCol")).isEqualTo(1L); + assertThat(rs.getLong(2)).isEqualTo(1L); + assertThat(rs.getFloat("f32Col")).isEqualTo(1.2f); + assertThat(rs.getFloat(3)).isEqualTo(1.2f); + assertThat(rs.getDouble("f64Col")).isEqualTo(1.3d); + assertThat(rs.getDouble(4)).isEqualTo(1.3d); + assertThat(rs.getBoolean("boolCol")).isTrue(); + assertThat(rs.getBoolean(5)).isTrue(); + assertThat(rs.getTimestamp("tsCol")).isEqualTo(Instant.ofEpochMilli(1000)); + assertThat(rs.getTimestamp(6)).isEqualTo(Instant.ofEpochMilli(1000)); + assertThat(rs.getDate("dateCol")).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(rs.getStruct("structCol").getLong("a")).isEqualTo(1); + assertThat(rs.getStruct("structCol").getString("b")).isEqualTo("foo"); + assertThat(rs.getStruct(8).getLong("a")).isEqualTo(1); + assertThat(rs.getStruct(8).getString("b")).isEqualTo("foo"); + assertThat(rs.getList("arrCol", SqlType.arrayOf(SqlType.int64()))) + .isEqualTo(Arrays.asList(1L, 2L, 3L)); + assertThat(rs.getList(9, SqlType.arrayOf(SqlType.int64()))) + .isEqualTo(Arrays.asList(1L, 2L, 3L)); + assertThat(rs.getMap("mapCol", SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))) + .isEqualTo( + new HashMap() { + { + put(ByteString.copyFromUtf8("qual"), ByteString.copyFromUtf8("val")); + put(ByteString.copyFromUtf8("qual2"), ByteString.copyFromUtf8("val2")); + put(ByteString.copyFromUtf8("qual3"), ByteString.copyFromUtf8("val3")); + } + }); + assertThat(rs.getMap(10, SqlType.mapOf(SqlType.bytes(), SqlType.bytes()))) + .isEqualTo( + new HashMap() { + { + put(ByteString.copyFromUtf8("qual"), ByteString.copyFromUtf8("val")); + put(ByteString.copyFromUtf8("qual2"), ByteString.copyFromUtf8("val2")); + put(ByteString.copyFromUtf8("qual3"), ByteString.copyFromUtf8("val3")); + } + }); + assertThat(rs.getProtoMessage("protoCol", Album.getDefaultInstance())).isEqualTo(album); + assertThat(rs.getProtoMessage(11, Album.getDefaultInstance())).isEqualTo(album); + assertThat(rs.getProtoEnum("enumCol", Genre::forNumber)).isEqualTo(Genre.JAZZ); + assertThat(rs.getProtoEnum(12, Genre::forNumber)).isEqualTo(Genre.JAZZ); + assertThat(rs.next()).isFalse(); + } + } + + @Test + public void allQueryParamsTypes() { + Map> paramTypes = new HashMap<>(); + paramTypes.put("stringParam", SqlType.string()); + paramTypes.put("bytesParam", SqlType.bytes()); + paramTypes.put("int64Param", SqlType.int64()); + paramTypes.put("doubleParam", SqlType.float64()); + paramTypes.put("floatParam", SqlType.float32()); + paramTypes.put("boolParam", SqlType.bool()); + paramTypes.put("tsParam", SqlType.timestamp()); + paramTypes.put("dateParam", SqlType.date()); + paramTypes.put("stringArrayParam", SqlType.arrayOf(SqlType.string())); + paramTypes.put("byteArrayParam", SqlType.arrayOf(SqlType.bytes())); + paramTypes.put("intArrayParam", SqlType.arrayOf(SqlType.int64())); + paramTypes.put("doubleArrayParam", SqlType.arrayOf(SqlType.float64())); + paramTypes.put("floatArrayParam", SqlType.arrayOf(SqlType.float32())); + paramTypes.put("boolArrayParam", SqlType.arrayOf(SqlType.bool())); + paramTypes.put("tsArrayParam", SqlType.arrayOf(SqlType.timestamp())); + paramTypes.put("dateArrayParam", SqlType.arrayOf(SqlType.date())); + + PreparedStatement preparedStatement = + dataClient.prepareStatement( + "SELECT @stringParam AS strCol, @bytesParam as bytesCol, @int64Param AS intCol, " + + "@doubleParam AS doubleCol, @floatParam AS floatCol, @boolParam AS boolCol, " + + "@tsParam AS tsCol, @dateParam AS dateCol, @byteArrayParam AS byteArrayCol, " + + "@stringArrayParam AS stringArrayCol, @intArrayParam AS intArrayCol, " + + "@floatArrayParam AS floatArrayCol, @doubleArrayParam AS doubleArrayCol, " + + "@boolArrayParam AS boolArrayCol, @tsArrayParam AS tsArrayCol, " + + "@dateArrayParam AS dateArrayCol", + paramTypes); + BoundStatement boundStatement = + preparedStatement + .bind() + .setStringParam("stringParam", "stringVal") + .setBytesParam("bytesParam", ByteString.copyFromUtf8("foo")) + .setLongParam("int64Param", 1L) + .setDoubleParam("doubleParam", 1.3d) + .setFloatParam("floatParam", 1.4f) + .setBooleanParam("boolParam", true) + .setTimestampParam("tsParam", Instant.ofEpochMilli(1000)) + .setDateParam("dateParam", Date.fromYearMonthDay(2024, 6, 1)) + .setListParam( + "byteArrayParam", + Arrays.asList(ByteString.copyFromUtf8("foo"), null, ByteString.copyFromUtf8("bar")), + SqlType.arrayOf(SqlType.bytes())) + .setListParam( + "stringArrayParam", + Arrays.asList("foo", null, "bar"), + SqlType.arrayOf(SqlType.string())) + .setListParam( + "intArrayParam", Arrays.asList(1L, null, 2L), SqlType.arrayOf(SqlType.int64())) + .setListParam( + "floatArrayParam", + Arrays.asList(1.2f, null, 1.3f), + SqlType.arrayOf(SqlType.float32())) + .setListParam( + "doubleArrayParam", + Arrays.asList(1.4d, null, 1.5d), + SqlType.arrayOf(SqlType.float64())) + .setListParam( + "boolArrayParam", Arrays.asList(true, null, false), SqlType.arrayOf(SqlType.bool())) + .setListParam( + "tsArrayParam", + Arrays.asList( + Instant.ofEpochSecond(1000, 1000), null, Instant.ofEpochSecond(2000, 2000)), + SqlType.arrayOf(SqlType.timestamp())) + .setListParam( + "dateArrayParam", + Arrays.asList( + Date.fromYearMonthDay(2024, 8, 1), null, Date.fromYearMonthDay(2024, 8, 2)), + SqlType.arrayOf(SqlType.date())) + .build(); + + ResultSet rs = dataClient.executeQuery(boundStatement); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("stringVal"); + assertThat(rs.getString(0)).isEqualTo("stringVal"); + assertThat(rs.getBytes("bytesCol")).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(rs.getBytes(1)).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(rs.getLong("intCol")).isEqualTo(1L); + assertThat(rs.getLong(2)).isEqualTo(1L); + assertThat(rs.getDouble("doubleCol")).isEqualTo(1.3d); + assertThat(rs.getDouble(3)).isEqualTo(1.3d); + assertThat(rs.getFloat("floatCol")).isEqualTo(1.4f); + assertThat(rs.getFloat(4)).isEqualTo(1.4f); + assertThat(rs.getBoolean("boolCol")).isTrue(); + assertThat(rs.getBoolean(5)).isTrue(); + assertThat(rs.getTimestamp("tsCol")).isEqualTo(Instant.ofEpochMilli(1000)); + assertThat(rs.getTimestamp(6)).isEqualTo(Instant.ofEpochMilli(1000)); + assertThat(rs.getDate("dateCol")).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(2024, 6, 1)); + assertThat(rs.getList("byteArrayCol", SqlType.arrayOf(SqlType.bytes()))) + .isEqualTo( + Arrays.asList(ByteString.copyFromUtf8("foo"), null, ByteString.copyFromUtf8("bar"))); + assertThat(rs.getList(8, SqlType.arrayOf(SqlType.bytes()))) + .isEqualTo( + Arrays.asList(ByteString.copyFromUtf8("foo"), null, ByteString.copyFromUtf8("bar"))); + assertThat(rs.getList("stringArrayCol", SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", null, "bar")); + assertThat(rs.getList(9, SqlType.arrayOf(SqlType.string()))) + .isEqualTo(Arrays.asList("foo", null, "bar")); + assertThat(rs.getList("intArrayCol", SqlType.arrayOf(SqlType.int64()))) + .isEqualTo(Arrays.asList(1L, null, 2L)); + assertThat(rs.getList(10, SqlType.arrayOf(SqlType.int64()))) + .isEqualTo(Arrays.asList(1L, null, 2L)); + assertThat(rs.getList("floatArrayCol", SqlType.arrayOf(SqlType.float32()))) + .isEqualTo(Arrays.asList(1.2f, null, 1.3f)); + assertThat(rs.getList(11, SqlType.arrayOf(SqlType.float32()))) + .isEqualTo(Arrays.asList(1.2f, null, 1.3f)); + assertThat(rs.getList("doubleArrayCol", SqlType.arrayOf(SqlType.float64()))) + .isEqualTo(Arrays.asList(1.4d, null, 1.5d)); + assertThat(rs.getList(12, SqlType.arrayOf(SqlType.float64()))) + .isEqualTo(Arrays.asList(1.4d, null, 1.5d)); + assertThat(rs.getList("boolArrayCol", SqlType.arrayOf(SqlType.bool()))) + .isEqualTo(Arrays.asList(true, null, false)); + assertThat(rs.getList(13, SqlType.arrayOf(SqlType.bool()))) + .isEqualTo(Arrays.asList(true, null, false)); + assertThat(rs.getList("tsArrayCol", SqlType.arrayOf(SqlType.timestamp()))) + .isEqualTo( + Arrays.asList( + Instant.ofEpochSecond(1000, 1000), null, Instant.ofEpochSecond(2000, 2000))); + assertThat(rs.getList(14, SqlType.arrayOf(SqlType.timestamp()))) + .isEqualTo( + Arrays.asList( + Instant.ofEpochSecond(1000, 1000), null, Instant.ofEpochSecond(2000, 2000))); + assertThat(rs.getList("dateArrayCol", SqlType.arrayOf(SqlType.date()))) + .isEqualTo( + Arrays.asList( + Date.fromYearMonthDay(2024, 8, 1), null, Date.fromYearMonthDay(2024, 8, 2))); + assertThat(rs.getList(15, SqlType.arrayOf(SqlType.date()))) + .isEqualTo( + Arrays.asList( + Date.fromYearMonthDay(2024, 8, 1), null, Date.fromYearMonthDay(2024, 8, 2))); + } + + @Test + public void testNullColumns() { + PreparedStatement preparedStatement = + dataClient.prepareStatement( + "SELECT cf['qual'] AS neverNull, cf['qual3'] AS maybeNull FROM `" + + tableId + + "` WHERE _key LIKE '" + + uniquePrefix + + "%'", + new HashMap<>()); + BoundStatement statement = preparedStatement.bind().build(); + try (ResultSet rs = dataClient.executeQuery(statement)) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("neverNull")).isEqualTo(ByteString.copyFromUtf8("val")); + // qual3 is set in row A but not row B + assertThat(rs.isNull("maybeNull")).isFalse(); + assertThat(rs.isNull(1)).isFalse(); + assertThat(rs.getBytes("maybeNull")).isEqualTo(ByteString.copyFromUtf8("val3")); + assertThat(rs.next()).isTrue(); + assertThat(rs.getBytes("neverNull")).isEqualTo(ByteString.copyFromUtf8("bval")); + assertThat(rs.isNull("maybeNull")).isTrue(); + assertThat(rs.isNull(1)).isTrue(); + assertThrows(NullPointerException.class, () -> rs.getBytes("maybeNull")); + assertThrows(NullPointerException.class, () -> rs.getBytes(1)); + assertThat(rs.next()).isFalse(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java new file mode 100644 index 000000000000..3f73ad451420 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java @@ -0,0 +1,378 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +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.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class LargeRowIT { + + private static final Logger logger = Logger.getLogger(LargeRowIT.class.getName()); + + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); + + private BigtableTableAdminClient tableAdminClient; + private Table table; + private final String familyId = "cf"; + + @Before + public void setup() { + tableAdminClient = testEnvRule.env().getTableAdminClient(); + String tableId = PrefixGenerator.newPrefix("LargeRowTest"); + table = tableAdminClient.createTable(CreateTableRequest.of(tableId).addFamily(familyId)); + } + + @After + public void tearDown() { + if (table != null) { + tableAdminClient.deleteTable(table.getId()); + } + } + + @Test + public void testWriteRead() throws Exception { + String rowKey = UUID.randomUUID().toString(); + String familyId = testEnvRule.env().getFamilyId(); + + byte[] largeValueBytes = new byte[100 * 1024 * 1024]; + Random random = new Random(); + random.nextBytes(largeValueBytes); + ByteString largeValue = ByteString.copyFrom(largeValueBytes); + + // Create a 200 MB row + logger.info("Sending large row, this will take awhile"); + for (int i = 0; i < 2; i++) { + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create(testEnvRule.env().getTableId(), rowKey) + .setCell(familyId, ByteString.copyFromUtf8("q" + i), largeValue)) + .get(10, TimeUnit.MINUTES); + } + + logger.info("Reading large row, this will take awhile"); + // Read it back + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowKey)); + + assertThat(row.getCells()).hasSize(2); + assertThat(row.getCells().get(0).getValue()).isEqualTo(largeValue); + assertThat(row.getCells().get(1).getValue()).isEqualTo(largeValue); + } + + @Test + public void testSkipLargeRow() throws Throwable { + assume() + .withMessage("Large row read errors are not supported by emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = TableId.of(table.getId()); + String familyId = this.familyId; + long timestampMicros = System.currentTimeMillis() * 1_000; + + // small row creations + client.bulkMutateRows( + BulkMutation.create(tableId) + .add( + RowMutationEntry.create("r1") + .setCell(familyId, "qualifier", timestampMicros, "my-value")) + .add( + RowMutationEntry.create("r4") + .setCell(familyId, "qualifier", timestampMicros, "my-value")) + .add( + RowMutationEntry.create("r5") + .setCell(familyId, "qualifier", timestampMicros, "my-value")) + .add( + RowMutationEntry.create("r6") + .setCell(familyId, "qualifier", timestampMicros, "my-value"))); + + Row expectedRow1 = + Row.create( + ByteString.copyFromUtf8("r1"), + ImmutableList.of( + RowCell.create( + familyId, + ByteString.copyFromUtf8("qualifier"), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value")))); + + Row expectedRow4 = + Row.create( + ByteString.copyFromUtf8("r4"), + ImmutableList.of( + RowCell.create( + familyId, + ByteString.copyFromUtf8("qualifier"), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value")))); + + Row expectedRow5 = + Row.create( + ByteString.copyFromUtf8("r5"), + ImmutableList.of( + RowCell.create( + familyId, + ByteString.copyFromUtf8("qualifier"), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value")))); + + Row expectedRow6 = + Row.create( + ByteString.copyFromUtf8("r6"), + ImmutableList.of( + RowCell.create( + familyId, + ByteString.copyFromUtf8("qualifier"), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value")))); + + // large row creation + byte[] largeValueBytes = new byte[3 * 1024 * 1024]; + ByteString largeValue = ByteString.copyFrom(largeValueBytes); + + for (int i = 0; i < 100; i++) { + ByteString qualifier = ByteString.copyFromUtf8("qualifier1_" + "_" + i); + client.mutateRow(RowMutation.create(tableId, "r2").setCell(familyId, qualifier, largeValue)); + client.mutateRow(RowMutation.create(tableId, "r3").setCell(familyId, qualifier, largeValue)); + } + + // sync + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r1").endOpen("r3")))) + .containsExactly(expectedRow1) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r1").endClosed("r4")))) + .containsExactly(expectedRow1, expectedRow4) + .inOrder(); + + List emptyRows = + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r2").endClosed("r3"))); + assertThat(emptyRows).isEmpty(); + + List startWithFaultyRow = + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r2").endClosed("r4"))); + assertThat(startWithFaultyRow).containsExactly(expectedRow4); + + List endsWithFaultyRow = + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r1").endClosed("r3"))); + assertThat(endsWithFaultyRow).containsExactly(expectedRow1); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r1").endClosed("r4")))) + .containsExactly(expectedRow1, expectedRow4) + .inOrder(); + + assertThat(client.skipLargeRowsCallable().all().call(Query.create(tableId))) + .containsExactly(expectedRow1, expectedRow4, expectedRow5, expectedRow6) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call(Query.create(tableId).range(ByteStringRange.unbounded().endClosed("r4")))) + .containsExactly(expectedRow1, expectedRow4) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call(Query.create(tableId).range(ByteStringRange.unbounded().startClosed("r1")))) + .containsExactly(expectedRow1, expectedRow4, expectedRow5, expectedRow6) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call(Query.create(tableId).range(ByteStringRange.unbounded().endOpen("r4")))) + .containsExactly(expectedRow1); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call(Query.create(tableId).range(ByteStringRange.unbounded().startOpen("r1")))) + .containsExactly(expectedRow4, expectedRow5, expectedRow6); + + assertThat(client.skipLargeRowsCallable().all().call(Query.create(tableId).reversed(true))) + .containsExactly(expectedRow6, expectedRow5, expectedRow4, expectedRow1) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().endClosed("r4")) + .reversed(true))) + .containsExactly(expectedRow4, expectedRow1) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r1")) + .reversed(true))) + .containsExactly(expectedRow6, expectedRow5, expectedRow4, expectedRow1) + .inOrder(); + + assertThat( + client + .skipLargeRowsCallable() + .all() + .call( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed("r2").endOpen("r3\0")))) + .isEmpty(); + + // async + AccumulatingObserver observer = new AccumulatingObserver(); + Query query = Query.create(tableId).range("r1", "r3"); + client.skipLargeRowsCallable().call(query, observer); + observer.awaitCompletion(); + assertThat(observer.responses).containsExactly(expectedRow1); + + AccumulatingObserver observer2 = new AccumulatingObserver(); + Query query2 = Query.create(tableId).range("r1", "r5"); + client.skipLargeRowsCallable().call(query2, observer2); + observer2.awaitCompletion(); + assertThat(observer2.responses).containsExactly(expectedRow1, expectedRow4); + + AccumulatingObserver observer3 = new AccumulatingObserver(); + Query query3 = Query.create(tableId); + client.skipLargeRowsCallable().call(query3, observer3); + observer3.awaitCompletion(); + assertThat(observer3.responses) + .containsExactly(expectedRow1, expectedRow4, expectedRow5, expectedRow6); + } + + static class AccumulatingObserver implements ResponseObserver { + + final List responses = Lists.newArrayList(); + final SettableApiFuture completionFuture = SettableApiFuture.create(); + + void awaitCompletion() throws Throwable { + try { + completionFuture.get(10, TimeUnit.MINUTES); + } catch (ExecutionException e) { + throw e.getCause(); + } + } + + @Override + public void onStart(StreamController controller) {} + + @Override + public void onResponse(Row row) { + responses.add(row); + } + + @Override + public void onError(Throwable t) { + completionFuture.setException(t); + } + + @Override + public void onComplete() { + completionFuture.set(null); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java new file mode 100644 index 000000000000..5e56d36e724e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java @@ -0,0 +1,37 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.it; + +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.common.truth.Correspondence; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; + +public class MetricsITUtils { + + static final Correspondence METRIC_DATA_NAME_CONTAINS = + Correspondence.from((md, s) -> md.getName().contains(s), "contains name"); + + static final Correspondence POINT_DATA_CLUSTER_ID_CONTAINS = + Correspondence.from( + (pd, s) -> pd.getAttributes().get(TableSchema.CLUSTER_ID_KEY).contains(s), + "contains attributes"); + + static final Correspondence POINT_DATA_ZONE_ID_CONTAINS = + Correspondence.from( + (pd, s) -> pd.getAttributes().get(TableSchema.ZONE_ID_KEY).contains(s), + "contains attributes"); +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java new file mode 100644 index 000000000000..a54c7268276f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java @@ -0,0 +1,156 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +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.RowMutation; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MutateRowIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test + public void test() throws Exception { + String rowKey = UUID.randomUUID().toString(); + String familyId = testEnvRule.env().getFamilyId(); + + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create(testEnvRule.env().getTableId(), rowKey) + .setCell(familyId, "q", "myVal") + .setCell(familyId, "q2", "myVal2") + .setCell(familyId, "q3", "myVal3") + .setCell(familyId, "q4", 0x12345678)) + .get(1, TimeUnit.MINUTES); + + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create(testEnvRule.env().getTableId(), rowKey).deleteCells(familyId, "q2")) + .get(1, TimeUnit.MINUTES); + + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowKey)); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(0).getValue()).isEqualTo(ByteString.copyFromUtf8("myVal")); + assertThat(row.getCells().get(1).getValue()).isEqualTo(ByteString.copyFromUtf8("myVal3")); + assertThat(row.getCells().get(2).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0x12, 0x34, 0x56, 0x78})); + } + + @Test + public void testOnAuthorizedView() throws Exception { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + String rowKey = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + String familyId = testEnvRule.env().getFamilyId(); + + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create( + AuthorizedViewId.of(testEnvRule.env().getTableId(), testAuthorizedView.getId()), + rowKey) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, "myVal") + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "2", "myVal2") + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "3", "myVal3") + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "4", 0x12345678)) + .get(1, TimeUnit.MINUTES); + + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create( + AuthorizedViewId.of(testEnvRule.env().getTableId(), testAuthorizedView.getId()), + rowKey) + .deleteCells(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "2")) + .get(1, TimeUnit.MINUTES); + + Row row = + testEnvRule + .env() + .getDataClient() + .readRowsCallable() + .first() + .call(Query.create(testEnvRule.env().getTableId()).rowKey(rowKey)); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(0).getValue()).isEqualTo(ByteString.copyFromUtf8("myVal")); + assertThat(row.getCells().get(1).getValue()).isEqualTo(ByteString.copyFromUtf8("myVal3")); + assertThat(row.getCells().get(2).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0x12, 0x34, 0x56, 0x78})); + + // We should not be able to mutate a row outside the authorized view + try { + String rowKeyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view"; + testEnvRule + .env() + .getDataClient() + .mutateRowAsync( + RowMutation.create( + AuthorizedViewId.of( + testEnvRule.env().getTableId(), testAuthorizedView.getId()), + rowKeyOutsideAuthorizedView) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, "myVal")) + .get(1, TimeUnit.MINUTES); + fail("Should not be able to mutate row outside authorized view"); + } catch (Exception e) { + assertThat(e.getCause()).isInstanceOf(PermissionDeniedException.class); + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java new file mode 100644 index 000000000000..51adc4abb63f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java @@ -0,0 +1,801 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +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.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.ByteString; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import io.grpc.MethodDescriptor; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadIT { + + private String prefix; + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Before + public void setUp() { + prefix = UUID.randomUUID().toString(); + } + + @Test + public void isRowExists() throws Exception { + String rowKey = prefix + "-test-row-key"; + TableId tableId = testEnvRule.env().getTableId(); + testEnvRule + .env() + .getDataClient() + .mutateRow( + RowMutation.create(tableId, rowKey) + .setCell(testEnvRule.env().getFamilyId(), "qualifier", "value")); + + assertThat(testEnvRule.env().getDataClient().exists(tableId, rowKey)).isTrue(); + + String nonExistingKey = prefix + "non-existing-key"; + assertThat(testEnvRule.env().getDataClient().exists(tableId, nonExistingKey)).isFalse(); + + // Async + assertThat(testEnvRule.env().getDataClient().existsAsync(tableId, rowKey).get()).isTrue(); + } + + @Test + public void isRowExistsOnAuthorizedView() throws Exception { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataClient dataClient = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String rowKey = AUTHORIZED_VIEW_ROW_PREFIX + prefix + "-isRowExistsOnAuthorizedView"; + String rowKeyOutsideAuthorizedView = prefix + "-isRowExistsOnAuthorizedView"; + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + dataClient.mutateRow( + RowMutation.create(tableId, rowKey) + .setCell(testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "value")); + dataClient.mutateRow( + RowMutation.create(tableId, rowKeyOutsideAuthorizedView) + .setCell(testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "value")); + + assertThat(dataClient.exists(AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey)) + .isTrue(); + assertThat( + dataClient.exists( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + rowKeyOutsideAuthorizedView)) + .isFalse(); + + // Async + assertThat( + dataClient + .existsAsync(AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .get()) + .isTrue(); + assertThat( + dataClient + .existsAsync( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + rowKeyOutsideAuthorizedView) + .get()) + .isFalse(); + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView(tableId.getTableId(), testAuthorizedView.getId()); + } + + @Test + public void readEmpty() throws Throwable { + String uniqueKey = prefix + "-readEmpty"; + + Query query = Query.create(testEnvRule.env().getTableId()).rowKey(uniqueKey); + + // Sync + ArrayList rows = Lists.newArrayList(testEnvRule.env().getDataClient().readRows(query)); + assertThat(rows).isEmpty(); + + // Async + AccumulatingObserver observer = new AccumulatingObserver(); + testEnvRule.env().getDataClient().readRowsAsync(query, observer); + observer.awaitCompletion(); + assertThat(observer.responses).isEmpty(); + } + + @Test + public void readEmptyOnAuthorizedView() throws Throwable { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + TableId tableId = testEnvRule.env().getTableId(); + BigtableDataClient dataClient = testEnvRule.env().getDataClient(); + String uniqueKey = AUTHORIZED_VIEW_ROW_PREFIX + prefix + "-readEmptyOnAuthorizedView"; + String uniqueKeyOutsideAuthorizedView = prefix + "-readEmptyOnAuthorizedView"; + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + Query query = + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())).rowKey(uniqueKey); + Query queryOutsideAuthorizedView = + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .rowKey(uniqueKeyOutsideAuthorizedView); + + // Sync + ArrayList rows = Lists.newArrayList(dataClient.readRows(query)); + assertThat(rows).isEmpty(); + + // Row exists on the table but outside the authorized view + dataClient.mutateRow( + RowMutation.create(tableId, uniqueKeyOutsideAuthorizedView) + .setCell(testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "value")); + rows = Lists.newArrayList(dataClient.readRows(queryOutsideAuthorizedView)); + assertThat(rows).isEmpty(); + + // Async + AccumulatingObserver observer = new AccumulatingObserver(); + testEnvRule.env().getDataClient().readRowsAsync(query, observer); + observer.awaitCompletion(); + assertThat(observer.responses).isEmpty(); + + // Row exists on the table but outside the authorized view + observer = new AccumulatingObserver(); + testEnvRule.env().getDataClient().readRowsAsync(queryOutsideAuthorizedView, observer); + observer.awaitCompletion(); + assertThat(observer.responses).isEmpty(); + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView(tableId.getTableId(), testAuthorizedView.getId()); + } + + @Test + public void read() throws Throwable { + int numRows = 5; + List expectedRows = Lists.newArrayList(); + String uniqueKey = prefix + "-read"; + + long timestampMicros = System.currentTimeMillis() * 1_000; + + for (int i = 0; i < numRows; i++) { + testEnvRule + .env() + .getDataClient() + .mutateRowCallable() + .call( + RowMutation.create(testEnvRule.env().getTableId(), uniqueKey + "-" + i) + .setCell(testEnvRule.env().getFamilyId(), "q", timestampMicros, "my-value")); + + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(uniqueKey + "-" + i), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8("q"), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value"))))); + } + + TableId tableId = testEnvRule.env().getTableId(); + + // Sync + Query query = Query.create(tableId).range(uniqueKey + "-0", uniqueKey + "-" + numRows); + ArrayList actualResults = + Lists.newArrayList(testEnvRule.env().getDataClient().readRows(query)); + + assertThat(actualResults).containsExactlyElementsIn(expectedRows); + + // Async + AccumulatingObserver observer = new AccumulatingObserver(); + testEnvRule.env().getDataClient().readRowsAsync(query, observer); + observer.awaitCompletion(); + assertThat(observer.responses).containsExactlyElementsIn(expectedRows); + + // Point Sync + Row actualRow = + testEnvRule.env().getDataClient().readRow(tableId, expectedRows.get(0).getKey()); + assertThat(actualRow).isEqualTo(expectedRows.get(0)); + + // Point Async + ApiFuture actualRowFuture = + testEnvRule.env().getDataClient().readRowAsync(tableId, expectedRows.get(0).getKey()); + assertThat(actualRowFuture.get()).isEqualTo(expectedRows.get(0)); + } + + @Test + public void readOnAuthorizedView() throws Throwable { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + int numRows = 5; + List expectedRows = Lists.newArrayList(); + String uniqueKey = AUTHORIZED_VIEW_ROW_PREFIX + prefix + "-readOnAuthorizedView"; + String uniqueKeyOutsideAuthorizedView = prefix + "-readOnAuthorizedView"; + TableId tableId = testEnvRule.env().getTableId(); + BigtableDataClient dataClient = testEnvRule.env().getDataClient(); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + long timestampMicros = System.currentTimeMillis() * 1_000; + + for (int i = 0; i < numRows; i++) { + dataClient + .mutateRowCallable() + .call( + RowMutation.create(tableId, uniqueKey + "-" + i) + .setCell( + testEnvRule.env().getFamilyId(), + AUTHORIZED_VIEW_COLUMN_QUALIFIER, + timestampMicros, + "my-value")); + + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(uniqueKey + "-" + i), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(AUTHORIZED_VIEW_COLUMN_QUALIFIER), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("my-value"))))); + } + // Add a few rows that outside the authorized view + for (int i = 0; i < numRows; i++) { + dataClient + .mutateRowCallable() + .call( + RowMutation.create(tableId, uniqueKeyOutsideAuthorizedView + "-" + i) + .setCell( + testEnvRule.env().getFamilyId(), + AUTHORIZED_VIEW_COLUMN_QUALIFIER, + timestampMicros, + "my-value")); + } + + // Sync + Query query = + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range(uniqueKey + "-0", uniqueKey + "-" + numRows); + Query queryOutsideAuthorizedView = + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range( + uniqueKeyOutsideAuthorizedView + "-0", + uniqueKeyOutsideAuthorizedView + "-" + numRows); + + ArrayList actualResults = Lists.newArrayList(dataClient.readRows(query)); + assertThat(actualResults).containsExactlyElementsIn(expectedRows); + + // rows exist but outside the authorized view + ArrayList results = Lists.newArrayList(dataClient.readRows(queryOutsideAuthorizedView)); + assertThat(results).isEmpty(); + + // Async + AccumulatingObserver observer = new AccumulatingObserver(); + dataClient.readRowsAsync(query, observer); + observer.awaitCompletion(); + assertThat(observer.responses).containsExactlyElementsIn(expectedRows); + + // Rows exist but outside the authorized view + observer = new AccumulatingObserver(); + dataClient.readRowsAsync(queryOutsideAuthorizedView, observer); + observer.awaitCompletion(); + assertThat(observer.responses).isEmpty(); + + // Point Sync + Row actualRow = + dataClient.readRow( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), expectedRows.get(0).getKey()); + assertThat(actualRow).isEqualTo(expectedRows.get(0)); + + // Row exists but outside the authorized view + assertThat( + dataClient.readRow( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + uniqueKeyOutsideAuthorizedView + "-0")) + .isNull(); + + // Point Async + ApiFuture actualRowFuture = + dataClient.readRowAsync( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), expectedRows.get(0).getKey()); + assertThat(actualRowFuture.get()).isEqualTo(expectedRows.get(0)); + + // Row exists but outside the authorized view + assertThat( + dataClient + .readRowAsync( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + uniqueKeyOutsideAuthorizedView + "-0") + .get()) + .isNull(); + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView(tableId.getTableId(), testAuthorizedView.getId()); + } + + @Test + public void rangeQueries() { + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String uniqueKey = prefix + "-range-queries"; + String keyA = uniqueKey + "-" + "a"; + String keyZ = uniqueKey + "-" + "z"; + + long timestampMicros = System.currentTimeMillis() * 1_000; + + client.bulkMutateRows( + BulkMutation.create(tableId) + .add(RowMutationEntry.create(keyA).setCell(familyId, "", timestampMicros, "A")) + .add(RowMutationEntry.create(keyZ).setCell(familyId, "", timestampMicros, "Z"))); + + Row expectedRowA = + Row.create( + ByteString.copyFromUtf8(keyA), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(""), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("A")))); + + Row expectedRowZ = + Row.create( + ByteString.copyFromUtf8(keyZ), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(""), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("Z")))); + + // Closed/Open + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed(keyA).endOpen(keyZ))))) + .containsExactly(expectedRowA); + + // Closed/Closed + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .range(ByteStringRange.unbounded().startClosed(keyA).endClosed(keyZ))))) + .containsExactly(expectedRowA, expectedRowZ); + + // Open/Closed + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .range(ByteStringRange.unbounded().startOpen(keyA).endClosed(keyZ))))) + .containsExactly(expectedRowZ); + + // Open/Open + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .range(ByteStringRange.unbounded().startOpen(keyA).endOpen(keyZ))))) + .isEmpty(); + } + + @Test + public void rangeQueriesOnAuthorizedView() throws InterruptedException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String uniqueKey = AUTHORIZED_VIEW_ROW_PREFIX + prefix + "-rangeQueriesOnAuthorizedView"; + String keyA = uniqueKey + "-" + "a"; + String keyZ = uniqueKey + "-" + "z"; + String keyOutsideAuthorizedView = prefix; + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + long timestampMicros = System.currentTimeMillis() * 1_000; + + client.bulkMutateRows( + BulkMutation.create(tableId) + .add( + RowMutationEntry.create(keyA) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, timestampMicros, "A")) + .add( + RowMutationEntry.create(keyZ) + .setCell(familyId, AUTHORIZED_VIEW_COLUMN_QUALIFIER, timestampMicros, "Z")) + .add( + RowMutationEntry.create(keyOutsideAuthorizedView) + .setCell( + familyId, + AUTHORIZED_VIEW_COLUMN_QUALIFIER, + timestampMicros, + "outsideAuthorizedView"))); + + Row expectedRowA = + Row.create( + ByteString.copyFromUtf8(keyA), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(AUTHORIZED_VIEW_COLUMN_QUALIFIER), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("A")))); + + Row expectedRowZ = + Row.create( + ByteString.copyFromUtf8(keyZ), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(AUTHORIZED_VIEW_COLUMN_QUALIFIER), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("Z")))); + + // Closed/Open + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range(ByteStringRange.unbounded().startClosed(keyA).endOpen(keyZ))))) + .containsExactly(expectedRowA); + + // Closed/Closed + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range(ByteStringRange.unbounded().startClosed(keyA).endClosed(keyZ))))) + .containsExactly(expectedRowA, expectedRowZ); + + // Open/Closed + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range(ByteStringRange.unbounded().startOpen(keyA).endClosed(keyZ))))) + .containsExactly(expectedRowZ); + + // Open/Open + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(AuthorizedViewId.of(tableId, testAuthorizedView.getId())) + .range(ByteStringRange.unbounded().startOpen(keyA).endOpen(keyZ))))) + .isEmpty(); + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView(tableId.getTableId(), testAuthorizedView.getId()); + } + + @Test + public void reversed() { + assume() + .withMessage("reverse scans are not supported in the emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String uniqueKey = prefix + "-rev-queries"; + String keyA = uniqueKey + "-" + "a"; + String keyB = uniqueKey + "-" + "b"; + String keyC = uniqueKey + "-" + "c"; + + long timestampMicros = System.currentTimeMillis() * 1_000; + + client.bulkMutateRows( + BulkMutation.create(tableId) + .add(RowMutationEntry.create(keyA).setCell(familyId, "", timestampMicros, "A")) + .add(RowMutationEntry.create(keyB).setCell(familyId, "", timestampMicros, "B")) + .add(RowMutationEntry.create(keyC).setCell(familyId, "", timestampMicros, "C"))); + + Row expectedRowA = + Row.create( + ByteString.copyFromUtf8(keyA), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(""), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("A")))); + + Row expectedRowB = + Row.create( + ByteString.copyFromUtf8(keyB), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(""), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("B")))); + Row expectedRowC = + Row.create( + ByteString.copyFromUtf8(keyC), + ImmutableList.of( + RowCell.create( + testEnvRule.env().getFamilyId(), + ByteString.copyFromUtf8(""), + timestampMicros, + ImmutableList.of(), + ByteString.copyFromUtf8("C")))); + + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId).reversed(true).range(ByteStringRange.prefix(uniqueKey))))) + .containsExactly(expectedRowC, expectedRowB, expectedRowA) + .inOrder(); + + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .reversed(true) + .range(ByteStringRange.prefix(uniqueKey)) + .limit(2)))) + .containsExactly(expectedRowC, expectedRowB) + .inOrder(); + + assertThat( + ImmutableList.copyOf( + client.readRows( + Query.create(tableId) + .reversed(true) + .range(ByteStringRange.unbounded().endOpen(keyC)) + .limit(2)))) + .containsExactly(expectedRowB, expectedRowA) + .inOrder(); + } + + @Test + @Ignore("Test taking too long to run, ignore for now") + public void reversedWithForcedResumption() throws IOException, InterruptedException { + assume() + .withMessage("reverse scans are not supported in the emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String familyId = testEnvRule.env().getFamilyId(); + String uniqueKey = prefix + "-rev-queries2"; + + // Add enough rows that ensures resumption logic is forced + Random random; + List expectedResults; + try (Batcher batcher = client.newBulkMutationBatcher(tableId)) { + + byte[] valueBytes = new byte[1024]; + random = new Random(); + + expectedResults = new ArrayList<>(); + + for (int i = 0; i < 2 * 1024; i++) { + ByteString key = ByteString.copyFromUtf8(String.format("%s-%05d", uniqueKey, i)); + ByteString qualifier = ByteString.copyFromUtf8("q"); + long timestamp = System.currentTimeMillis() * 1000; + random.nextBytes(valueBytes); + ByteString value = ByteString.copyFrom(valueBytes); + + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(key).setCell(familyId, qualifier, timestamp, value)); + expectedResults.add( + Row.create( + key, + ImmutableList.of( + RowCell.create(familyId, qualifier, timestamp, ImmutableList.of(), value)))); + } + } + Collections.reverse(expectedResults); + + BigtableDataSettings.Builder settingsBuilder = + testEnvRule.env().getDataClientSettings().toBuilder(); + + settingsBuilder.stubSettings().readRowsSettings().retrySettings().setMaxAttempts(100); + + InstantiatingGrpcChannelProvider.Builder transport = + ((InstantiatingGrpcChannelProvider) + settingsBuilder.stubSettings().getTransportChannelProvider()) + .toBuilder(); + @SuppressWarnings("rawtypes") + ApiFunction oldConfigurator = + transport.getChannelConfigurator(); + + // Randomly camp the deadline to force a timeout to force a retry + transport.setChannelConfigurator( + (@SuppressWarnings("rawtypes") + ManagedChannelBuilder c) -> { + if (oldConfigurator != null) { + c = oldConfigurator.apply(c); + } + return c.intercept( + new ClientInterceptor() { + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + if (method.getBareMethodName().equals("ReadRows")) { + callOptions = + callOptions.withDeadlineAfter(random.nextInt(200), TimeUnit.MILLISECONDS); + } + + return next.newCall(method, callOptions); + } + }); + }); + settingsBuilder.stubSettings().setTransportChannelProvider(transport.build()); + + try (BigtableDataClient patchedClient = BigtableDataClient.create(settingsBuilder.build())) { + for (int i = 0; i < 10; i++) { + List actualResults = new ArrayList<>(); + for (Row row : + patchedClient.readRows(Query.create(tableId).prefix(uniqueKey).reversed(true))) { + actualResults.add(row); + Thread.sleep(1); + } + assertThat(actualResults).containsExactlyElementsIn(expectedResults).inOrder(); + } + } + } + + @Test + public void readSingleNonexistentAsyncCallback() throws Exception { + ApiFuture future = + testEnvRule + .env() + .getDataClient() + .readRowAsync(testEnvRule.env().getTableId(), "somenonexistentkey"); + + final AtomicReference unexpectedError = new AtomicReference<>(); + final AtomicBoolean found = new AtomicBoolean(); + final CountDownLatch latch = new CountDownLatch(1); + + ApiFutures.addCallback( + future, + new ApiFutureCallback() { + @Override + public void onFailure(Throwable t) { + unexpectedError.set(t); + latch.countDown(); + } + + @Override + public void onSuccess(Row result) { + found.set(true); + latch.countDown(); + } + }, + MoreExecutors.directExecutor()); + + latch.await(1, TimeUnit.MINUTES); + + if (unexpectedError.get() != null) { + throw new RuntimeException("Unexpected async error", unexpectedError.get()); + } + assertThat(found.get()).isTrue(); + } + + static class AccumulatingObserver implements ResponseObserver { + + final List responses = Lists.newArrayList(); + final SettableApiFuture completionFuture = SettableApiFuture.create(); + + void awaitCompletion() throws Throwable { + try { + completionFuture.get(10, TimeUnit.MINUTES); + } catch (ExecutionException e) { + throw e.getCause(); + } + } + + @Override + public void onStart(StreamController controller) {} + + @Override + public void onResponse(Row row) { + responses.add(row); + } + + @Override + public void onError(Throwable t) { + completionFuture.setException(t); + } + + @Override + public void onComplete() { + completionFuture.set(null); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java new file mode 100644 index 000000000000..cb8f2f8b5895 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java @@ -0,0 +1,143 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.protobuf.ByteString; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadModifyWriteIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test + public void test() throws InterruptedException, ExecutionException, TimeoutException { + TableId tableId = testEnvRule.env().getTableId(); + String family = testEnvRule.env().getFamilyId(); + String rowKey = UUID.randomUUID().toString(); + + Row row = + testEnvRule + .env() + .getDataClient() + .readModifyWriteRowAsync( + ReadModifyWriteRow.create(tableId, rowKey) + .append(family, "q1", "a") + .increment(family, "q2", 3) + .increment(family, "q3", 0x12345679)) + .get(1, TimeUnit.MINUTES); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(0).getValue()).isEqualTo(ByteString.copyFromUtf8("a")); + assertThat(row.getCells().get(1).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 3})); + assertThat(row.getCells().get(2).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0x12, 0x34, 0x56, 0x79})); + } + + @Test + public void testOnAuthorizedView() + throws InterruptedException, ExecutionException, TimeoutException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + TableId tableId = testEnvRule.env().getTableId(); + String family = testEnvRule.env().getFamilyId(); + String rowKey = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + + Row row = + testEnvRule + .env() + .getDataClient() + .readModifyWriteRowAsync( + ReadModifyWriteRow.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .append(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "1", "a") + .increment(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "2", 3) + .increment(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER + "3", 0x12345679)) + .get(1, TimeUnit.MINUTES); + + assertThat(row.getCells()).hasSize(3); + assertThat(row.getCells().get(0).getValue()).isEqualTo(ByteString.copyFromUtf8("a")); + assertThat(row.getCells().get(1).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 3})); + assertThat(row.getCells().get(2).getValue()) + .isEqualTo(ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0x12, 0x34, 0x56, 0x79})); + + // Row key outside the authorized view + String rowKeyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view"; + try { + testEnvRule + .env() + .getDataClient() + .readModifyWriteRowAsync( + ReadModifyWriteRow.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), + rowKeyOutsideAuthorizedView) + .append(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER, "a")) + .get(1, TimeUnit.MINUTES); + fail("Should not be able to modify a row outside authorized view"); + } catch (Exception e) { + assertThat(e.getCause()).isInstanceOf(PermissionDeniedException.class); + } + + // Column qualifier outside the authorized view + try { + testEnvRule + .env() + .getDataClient() + .readModifyWriteRowAsync( + ReadModifyWriteRow.create( + AuthorizedViewId.of(tableId, testAuthorizedView.getId()), rowKey) + .append(family, "outside-authorized-view", "a")) + .get(1, TimeUnit.MINUTES); + fail("Should not be able to perform mutations with cells outside the authorized view"); + } catch (Exception e) { + assertThat(e.getCause()).isInstanceOf(PermissionDeniedException.class); + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java new file mode 100644 index 000000000000..c6ace17adea8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java @@ -0,0 +1,152 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_COLUMN_QUALIFIER; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.AUTHORIZED_VIEW_ROW_PREFIX; +import static com.google.cloud.bigtable.misc_utilities.AuthorizedViewTestHelper.createTestAuthorizedView; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; +import static org.junit.Assert.fail; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +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.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowMutationEntryBatcherIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test + public void testNewBatcher() throws Exception { + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String family = testEnvRule.env().getFamilyId(); + String rowPrefix = UUID.randomUUID().toString(); + + try (Batcher batcher = client.newBulkMutationBatcher(tableId)) { + for (int i = 0; i < 10; i++) { + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(rowPrefix + "-" + i) + .setCell(family, "qualifier", 10_000L, "value-" + i)); + } + } + + List expectedRows = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(rowPrefix + "-" + i), + ImmutableList.of( + RowCell.create( + family, + ByteString.copyFromUtf8("qualifier"), + 10_000L, + ImmutableList.of(), + ByteString.copyFromUtf8("value-" + i))))); + } + ServerStream actualRows = client.readRows(Query.create(tableId).prefix(rowPrefix)); + + assertThat(actualRows).containsExactlyElementsIn(expectedRows); + } + + @Test + public void testNewBatcherOnAuthorizedView() throws Exception { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + AuthorizedView testAuthorizedView = createTestAuthorizedView(testEnvRule); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + TableId tableId = testEnvRule.env().getTableId(); + String family = testEnvRule.env().getFamilyId(); + String rowPrefix = AUTHORIZED_VIEW_ROW_PREFIX + UUID.randomUUID(); + + try (Batcher batcher = + client.newBulkMutationBatcher(AuthorizedViewId.of(tableId, testAuthorizedView.getId()))) { + for (int i = 0; i < 10; i++) { + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(rowPrefix + "-" + i) + .setCell(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER, 10_000L, "value-" + i)); + } + } + + List expectedRows = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + expectedRows.add( + Row.create( + ByteString.copyFromUtf8(rowPrefix + "-" + i), + ImmutableList.of( + RowCell.create( + family, + ByteString.copyFromUtf8(AUTHORIZED_VIEW_COLUMN_QUALIFIER), + 10_000L, + ImmutableList.of(), + ByteString.copyFromUtf8("value-" + i))))); + } + ServerStream actualRows = client.readRows(Query.create(tableId).prefix(rowPrefix)); + + assertThat(actualRows).containsExactlyElementsIn(expectedRows); + + // We should not be able to mutate rows outside the authorized view + String rowKeyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view"; + try { + try (Batcher batcher = + client.newBulkMutationBatcher(AuthorizedViewId.of(tableId, testAuthorizedView.getId()))) { + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(rowKeyOutsideAuthorizedView) + .setCell(family, AUTHORIZED_VIEW_COLUMN_QUALIFIER, 10_000L, "value")); + } + fail("Should not be able to apply bulk mutation on rows outside authorized view"); + } catch (Exception e) { + // Ignore. + } + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView( + testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java new file mode 100644 index 000000000000..063d0d1f5095 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java @@ -0,0 +1,130 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SampleRowsIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + @Test + public void test() throws InterruptedException, ExecutionException, TimeoutException { + BigtableDataClient client = testEnvRule.env().getDataClient(); + String rowPrefix = UUID.randomUUID().toString(); + + // Create some data so that sample row keys has something to show + List> futures = Lists.newArrayList(); + for (int i = 0; i < 10; i++) { + ApiFuture future = + client.mutateRowAsync( + RowMutation.create(testEnvRule.env().getTableId(), rowPrefix + "-" + i) + .setCell(testEnvRule.env().getFamilyId(), "", "value")); + futures.add(future); + } + ApiFutures.allAsList(futures).get(1, TimeUnit.MINUTES); + + ApiFuture> future = client.sampleRowKeysAsync(testEnvRule.env().getTableId()); + + List results = future.get(1, TimeUnit.MINUTES); + + assertThat(results).isNotEmpty(); + assertThat(results.get(results.size() - 1).getOffsetBytes()).isGreaterThan(0L); + } + + @Test + public void testOnAuthorizedView() + throws InterruptedException, ExecutionException, TimeoutException { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + AuthorizedView testAuthorizedView = createPreSplitTableAndAuthorizedView(); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + + ApiFuture> future = + client.sampleRowKeysAsync( + AuthorizedViewId.of(testAuthorizedView.getTableId(), testAuthorizedView.getId())); + + List results = future.get(1, TimeUnit.MINUTES); + + List resultKeys = new ArrayList<>(); + for (KeyOffset keyOffset : results) { + resultKeys.add(keyOffset.getKey()); + } + + assertThat(resultKeys) + .containsExactly( + ByteString.copyFromUtf8("food"), + ByteString.copyFromUtf8("fool"), + ByteString.copyFromUtf8("fop")); + + testEnvRule + .env() + .getTableAdminClient() + .deleteAuthorizedView(testAuthorizedView.getTableId(), testAuthorizedView.getId()); + + testEnvRule.env().getTableAdminClient().deleteTable(testAuthorizedView.getTableId()); + } + + private static AuthorizedView createPreSplitTableAndAuthorizedView() { + String tableId = PrefixGenerator.newPrefix("SampleRowsIT#AuthorizedView"); + String authorizedViewId = UUID.randomUUID().toString(); + + testEnvRule + .env() + .getTableAdminClient() + .createTable( + CreateTableRequest.of(tableId) + .addSplit(ByteString.copyFromUtf8("apple")) + .addSplit(ByteString.copyFromUtf8("food")) + .addSplit(ByteString.copyFromUtf8("fool")) + .addSplit(ByteString.copyFromUtf8("good"))); + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(tableId, authorizedViewId) + .setAuthorizedViewType(SubsetView.create().addRowPrefix("foo")) + .setDeletionProtection(false); + return testEnvRule.env().getTableAdminClient().createAuthorizedView(request); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java new file mode 100644 index 000000000000..09ab6e085106 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java @@ -0,0 +1,180 @@ +/* + * 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.google.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.METRIC_DATA_NAME_CONTAINS; +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.POINT_DATA_CLUSTER_ID_CONTAINS; +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.POINT_DATA_ZONE_ID_CONTAINS; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +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.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import com.google.common.collect.Lists; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; + +public class StreamingMetricsMetadataIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + private BigtableDataClient client; + private InMemoryMetricReader metricReader; + + @Before + public void setup() throws IOException { + assume() + .withMessage("StreamingMetricsMetadataIT is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataSettings.Builder settings = testEnvRule.env().getDataClientSettings().toBuilder(); + + metricReader = InMemoryMetricReader.create(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + + settings.setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)); + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() throws IOException { + if (client != null) { + client.close(); + } + } + + @Test + public void testSuccess() throws Exception { + String prefix = UUID.randomUUID().toString(); + String uniqueKey = prefix + "-read"; + + Query query = Query.create(testEnvRule.env().getTableId()).rowKey(uniqueKey); + // consume the iterator + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(query)); + + ApiFuture> clustersFuture = + testEnvRule + .env() + .getInstanceAdminClient() + .listClustersAsync(testEnvRule.env().getInstanceId()); + + List clusters = clustersFuture.get(1, TimeUnit.MINUTES); + + Collection allMetricData = metricReader.collectAllMetrics(); + List metrics = + metricReader.collectAllMetrics().stream() + .filter(m -> m.getName().contains(TableOperationLatency.NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(TableOperationLatency.NAME); + assertThat(metrics).hasSize(1); + + MetricData metricData = metrics.get(0); + List pointData = new ArrayList<>(metricData.getData().getPoints()); + List clusterAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains(clusters.get(0).getId()); + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS) + .contains(clusters.get(0).getZone()); + assertThat(clusterAttributes).contains(clusters.get(0).getId()); + assertThat(zoneAttributes).contains(clusters.get(0).getZone()); + } + + @Test + public void testFailure() { + Query query = Query.create(TableId.of("non-exist-table")); + try { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(query)); + } catch (NotFoundException ignored) { + // dont care + } + + Collection allMetricData = metricReader.collectAllMetrics(); + List metrics = + metricReader.collectAllMetrics().stream() + .filter(m -> m.getName().contains(TableOperationLatency.NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(TableOperationLatency.NAME); + assertThat(metrics).hasSize(1); + + MetricData metricData = metrics.get(0); + List pointData = new ArrayList<>(metricData.getData().getPoints()); + List clusterAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains(""); + assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); + assertThat(clusterAttributes).contains(""); + assertThat(zoneAttributes).contains("global"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java new file mode 100644 index 000000000000..5f151d749a90 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java @@ -0,0 +1,197 @@ +/* + * 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.google.cloud.bigtable.data.v2.it; + +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.METRIC_DATA_NAME_CONTAINS; +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.POINT_DATA_CLUSTER_ID_CONTAINS; +import static com.google.cloud.bigtable.data.v2.it.MetricsITUtils.POINT_DATA_ZONE_ID_CONTAINS; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; +import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; + +public class UnaryMetricsMetadataIT { + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + + private BigtableDataClient client; + private InMemoryMetricReader metricReader; + + @Before + public void setup() throws IOException { + assume() + .withMessage("UnaryMetricsMetadataIT is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataSettings.Builder settings = testEnvRule.env().getDataClientSettings().toBuilder(); + + metricReader = InMemoryMetricReader.create(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + + settings.setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)); + + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() throws IOException { + if (client != null) { + client.close(); + } + } + + @Test + public void testSuccess() throws Exception { + String rowKey = UUID.randomUUID().toString(); + String familyId = testEnvRule.env().getFamilyId(); + + ApiFuture future = + client + .mutateRowCallable() + .futureCall( + RowMutation.create(testEnvRule.env().getTableId(), rowKey) + .setCell(familyId, "q", "myVal")); + + future.get(1, TimeUnit.MINUTES); + + ApiFuture> clustersFuture = + testEnvRule + .env() + .getInstanceAdminClient() + .listClustersAsync(testEnvRule.env().getInstanceId()); + List clusters = clustersFuture.get(1, TimeUnit.MINUTES); + + Collection allMetricData = metricReader.collectAllMetrics(); + List metrics = + allMetricData.stream() + .filter(m -> m.getName().contains(TableOperationLatency.NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(TableOperationLatency.NAME); + assertThat(metrics).hasSize(1); + + MetricData metricData = metrics.get(0); + List pointData = new ArrayList<>(metricData.getData().getPoints()); + List clusterAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains(clusters.get(0).getId()); + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS) + .contains(clusters.get(0).getZone()); + assertThat(clusterAttributes).contains(clusters.get(0).getId()); + assertThat(zoneAttributes).contains(clusters.get(0).getZone()); + } + + @Test + public void testFailure() throws Exception { + String rowKey = UUID.randomUUID().toString(); + String familyId = testEnvRule.env().getFamilyId(); + + ApiFuture future = + client + .mutateRowCallable() + .futureCall( + RowMutation.create(TableId.of("non-exist-table"), rowKey) + .setCell(familyId, "q", "myVal")); + + try { + future.get(1, TimeUnit.MINUTES); + } catch (ExecutionException e) { + if (!(e.getCause() instanceof NotFoundException)) { + throw e; + } + } + + Collection allMetricData = metricReader.collectAllMetrics(); + MetricData metricData = null; + for (MetricData md : allMetricData) { + if (md.getName().equals(TableAttemptLatency.NAME)) { + metricData = md; + break; + } + } + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(TableAttemptLatency.NAME); + assertThat(metricData).isNotNull(); + + List pointData = new ArrayList<>(metricData.getData().getPoints()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains(""); + assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); + List clusterAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(TableSchema.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(clusterAttributes).contains(""); + assertThat(zoneAttributes).contains("global"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java new file mode 100644 index 000000000000..431125fb8ca3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class AuthorizedViewIdTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String AUTHORIZED_VIEW_ID = "my-authorized-view"; + + @Test + public void testToResourceName() { + AuthorizedViewId authorizedViewId = AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID); + + assertThat(authorizedViewId.toResourceName(PROJECT_ID, INSTANCE_ID)) + .isEqualTo( + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"); + } + + @Test + public void testEquality() { + AuthorizedViewId authorizedViewId = AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID); + + assertThat(authorizedViewId).isEqualTo(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)); + assertThat(authorizedViewId) + .isNotEqualTo(AuthorizedViewId.of(TABLE_ID, "another-authorized-view")); + } + + @Test + public void testHashCode() { + AuthorizedViewId authorizedViewId = AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID); + + assertThat(authorizedViewId.hashCode()) + .isEqualTo(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID).hashCode()); + assertThat(authorizedViewId.hashCode()) + .isNotEqualTo(AuthorizedViewId.of(TABLE_ID, "another-authorized-view").hashCode()); + assertThat(authorizedViewId.hashCode()).isNotEqualTo(TableId.of(TABLE_ID).hashCode()); + } + + @Test + public void testToString() { + AuthorizedViewId authorizedViewId = AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID); + + assertThat(authorizedViewId.toString()) + .isEqualTo("AuthorizedViewId{tableId=my-table, authorizedViewId=my-authorized-view}"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java new file mode 100644 index 000000000000..412959eb11f0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java @@ -0,0 +1,314 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.protobuf.ByteString; +import com.google.protobuf.TextFormat; +import com.google.protobuf.TextFormat.ParseException; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BulkMutationTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final String AUTHORIZED_VIEW_ID = "fake-authorized-view"; + private static final String APP_PROFILE = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE); + + @Test + public void test() throws ParseException { + // Test BulkMutation on a table. + BulkMutation m = + BulkMutation.create(TABLE_ID) + .add( + "key-a", + Mutation.create() + .setCell("fake-family1", "fake-qualifier1", 1_000, "fake-value1") + .setCell("fake-family2", "fake-qualifier2", 2_000, "fake-value2")) + .add( + ByteString.copyFromUtf8("key-b"), + Mutation.create().setCell("fake-family3", "fake-qualifier3", 3_000, "fake-value3")); + + MutateRowsRequest actual = m.toProto(REQUEST_CONTEXT); + + MutateRowsRequest.Builder expected = + MutateRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId())) + .setAppProfileId(APP_PROFILE); + TextFormat.merge( + "entries {" + + " row_key: 'key-a'" + + " mutations {" + + " set_cell {" + + " family_name: 'fake-family1'" + + " column_qualifier: 'fake-qualifier1'" + + " timestamp_micros: 1000" + + " value: 'fake-value1'" + + " }" + + " }" + + " mutations {" + + " set_cell {" + + " family_name: 'fake-family2'" + + " column_qualifier: 'fake-qualifier2'" + + " timestamp_micros: 2000" + + " value: 'fake-value2'" + + " }" + + " }" + + "}" + + "entries {" + + " row_key: 'key-b'" + + " mutations {" + + " set_cell {" + + " family_name: 'fake-family3'" + + " column_qualifier: 'fake-qualifier3'" + + " timestamp_micros: 3000" + + " value: 'fake-value3'" + + " }" + + " }" + + "}", + expected); + + assertThat(actual).isEqualTo(expected.build()); + + // Test BulkMutation on an authorized view. + m = + BulkMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .add( + "key-a", + Mutation.create() + .setCell("fake-family1", "fake-qualifier1", 1_000, "fake-value1") + .setCell("fake-family2", "fake-qualifier2", 2_000, "fake-value2")) + .add( + ByteString.copyFromUtf8("key-b"), + Mutation.create().setCell("fake-family3", "fake-qualifier3", 3_000, "fake-value3")); + + actual = m.toProto(REQUEST_CONTEXT); + + expected + .clearTableName() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId(), AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE); + + assertThat(actual).isEqualTo(expected.build()); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // Test BulkMutation on a table. + BulkMutation expected = + BulkMutation.create(TABLE_ID) + .add( + "key-a", + Mutation.create().setCell("fake-family1", "fake-qualifier1", 1_000, "fake-value1")); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + BulkMutation actual = (BulkMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + + // Test BulkMutation on an authorized view. + expected = + BulkMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .add( + "key-a", + Mutation.create().setCell("fake-family1", "fake-qualifier1", 1_000, "fake-value1")); + + bos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + actual = (BulkMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + } + + @Test + public void cloneTest() { + // Test BulkMutation on a table. + BulkMutation originalTableBulkMutation = + BulkMutation.create(TABLE_ID) + .add( + "test-rowKey", + Mutation.create().setCell("fake-family1", "fake-qualifier1", 12345, "fake-value1")); + + MutateRowsRequest originalTableRequest = originalTableBulkMutation.toProto(REQUEST_CONTEXT); + BulkMutation clonedTableMutation = originalTableBulkMutation.clone(); + MutateRowsRequest clonedTableRequest = clonedTableMutation.toProto(REQUEST_CONTEXT); + + // Both BulkMutations should be equals. + assertThat(clonedTableRequest).isEqualTo(originalTableRequest); + assertThat(clonedTableRequest.getTableName()).isEqualTo(originalTableRequest.getTableName()); + assertThat(clonedTableRequest.getAuthorizedViewName()) + .isEqualTo(originalTableRequest.getAuthorizedViewName()); + assertThat(clonedTableRequest.getEntriesList()) + .isEqualTo(originalTableRequest.getEntriesList()); + + // Mutating cloned BulkMutation + clonedTableMutation.add( + "another-rowKey", Mutation.create().deleteCells("delete-family", "delete-qualifier")); + assertThat(clonedTableMutation.toProto(REQUEST_CONTEXT)).isNotEqualTo(originalTableRequest); + + // Test BulkMutation on an authorized view. + BulkMutation originalAuthorizedViewBulkMutation = + BulkMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .add( + "test-rowKey", + Mutation.create().setCell("fake-family1", "fake-qualifier1", 12345, "fake-value1")); + + MutateRowsRequest originalAuthorizedViewRequest = + originalAuthorizedViewBulkMutation.toProto(REQUEST_CONTEXT); + BulkMutation clonedAuthorizedViewMutation = originalAuthorizedViewBulkMutation.clone(); + MutateRowsRequest clonedAuthorizedViewRequest = + clonedAuthorizedViewMutation.toProto(REQUEST_CONTEXT); + + // Both BulkMutations should be equals. + assertThat(clonedAuthorizedViewRequest).isEqualTo(originalAuthorizedViewRequest); + assertThat(clonedAuthorizedViewRequest.getTableName()) + .isEqualTo(originalAuthorizedViewRequest.getTableName()); + assertThat(clonedAuthorizedViewRequest.getAuthorizedViewName()) + .isEqualTo(originalAuthorizedViewRequest.getAuthorizedViewName()); + assertThat(clonedAuthorizedViewRequest.getEntriesList()) + .isEqualTo(originalAuthorizedViewRequest.getEntriesList()); + + // Mutating cloned BulkMutation + clonedAuthorizedViewMutation.add( + "another-rowKey", Mutation.create().deleteCells("delete-family", "delete-qualifier")); + assertThat(clonedAuthorizedViewMutation.toProto(REQUEST_CONTEXT)) + .isNotEqualTo(originalAuthorizedViewRequest); + + // BulkMutations on an authorized view is different from BulkMutations on a table. + assertThat(originalAuthorizedViewRequest).isNotEqualTo(originalTableRequest); + assertThat(clonedAuthorizedViewRequest).isNotEqualTo(clonedTableRequest); + } + + @Test + public void addRowMutationEntry() { + RowMutationEntry entry = + RowMutationEntry.create("test-rowKey") + .setCell("fake-family1", "fake-qualifier1", "fake-value1"); + + // Test BulkMutation on a table. + BulkMutation bulkMutation = BulkMutation.create(TABLE_ID); + bulkMutation.add(entry); + assertThat(bulkMutation.toProto(REQUEST_CONTEXT).getEntriesList()).contains(entry.toProto()); + + // Test BulkMutation on an authorized view. + bulkMutation = BulkMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)); + bulkMutation.add(entry); + assertThat(bulkMutation.toProto(REQUEST_CONTEXT).getEntriesList()).contains(entry.toProto()); + } + + @Test + public void fromProtoTest() { + // Test BulkMutation on a table. + BulkMutation expected = + BulkMutation.create(TABLE_ID) + .add( + "key", + Mutation.create().setCell("fake-family", "fake-qualifier", 10_000L, "fake-value")); + + MutateRowsRequest protoRequest = expected.toProto(REQUEST_CONTEXT); + BulkMutation actualBulkMutation = BulkMutation.fromProto(protoRequest); + + assertThat(actualBulkMutation.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + String projectId = "fresh-project"; + String instanceId = "fresh-instance"; + String appProfile = "fresh-app-profile"; + MutateRowsRequest overriddenRequest = + actualBulkMutation.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()) + .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID.getTableId())); + assertThat(overriddenRequest.getAuthorizedViewName()).isEmpty(); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + + // Test BulkMutation on an authorized view. + expected = + BulkMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .add( + "key", + Mutation.create().setCell("fake-family", "fake-qualifier", 10_000L, "fake-value")); + + protoRequest = expected.toProto(REQUEST_CONTEXT); + actualBulkMutation = BulkMutation.fromProto(protoRequest); + + assertThat(actualBulkMutation.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + overriddenRequest = + actualBulkMutation.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()).isEmpty(); + assertThat(overriddenRequest.getAuthorizedViewName()) + .matches( + NameUtil.formatAuthorizedViewName( + projectId, instanceId, TABLE_ID.getTableId(), AUTHORIZED_VIEW_ID)); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + } + + @Test + public void testManyMutations() { + BulkMutation bulkMutation = BulkMutation.create(TABLE_ID); + + try { + for (int i = 0; i < 3; i++) { + String key = "key" + i; + Mutation mutation = Mutation.create(); + for (int j = 0; j < 50000; j++) { + mutation.setCell("f", "q" + j, "value"); + } + bulkMutation.add(key, mutation); + } + Assert.fail("Test should fail with IllegalArgumentException"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).contains("Too many mutations"); + } + + // we should be able to add 10000 mutations + bulkMutation = BulkMutation.create(TABLE_ID); + Mutation mutation = Mutation.create(); + for (int i = 0; i < 100000; i++) { + mutation.setCell("f", "q" + i, "value"); + } + bulkMutation.add("key", mutation); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationTokenTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationTokenTest.java new file mode 100644 index 000000000000..7e15ad5bbb8f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationTokenTest.java @@ -0,0 +1,97 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ChangeStreamContinuationTokenTest { + + private final String TOKEN = "token"; + + private ByteStringRange createFakeByteStringRange() { + return ByteStringRange.create("a", "b"); + } + + private RowRange rowRangeFromPartition(ByteStringRange partition) { + return RowRange.newBuilder() + .setStartKeyClosed(partition.getStart()) + .setEndKeyOpen(partition.getEnd()) + .build(); + } + + @Test + public void basicTest() throws Exception { + ByteStringRange byteStringRange = createFakeByteStringRange(); + ChangeStreamContinuationToken changeStreamContinuationToken = + ChangeStreamContinuationToken.create(byteStringRange, TOKEN); + assertThat(changeStreamContinuationToken.getPartition()).isEqualTo(byteStringRange); + assertThat(changeStreamContinuationToken.getToken()).isEqualTo(TOKEN); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(changeStreamContinuationToken); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + ChangeStreamContinuationToken actual = (ChangeStreamContinuationToken) ois.readObject(); + assertThat(actual).isEqualTo(changeStreamContinuationToken); + } + + @Test + public void fromProtoTest() { + ByteStringRange byteStringRange = createFakeByteStringRange(); + StreamContinuationToken proto = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange(rowRangeFromPartition(byteStringRange)) + .build()) + .setToken(TOKEN) + .build(); + ChangeStreamContinuationToken changeStreamContinuationToken = + ChangeStreamContinuationToken.fromProto(proto); + assertThat(changeStreamContinuationToken.getPartition()).isEqualTo(byteStringRange); + assertThat(changeStreamContinuationToken.getToken()).isEqualTo(TOKEN); + assertThat(changeStreamContinuationToken) + .isEqualTo( + ChangeStreamContinuationToken.fromProto(changeStreamContinuationToken.getTokenProto())); + } + + @Test + public void toByteStringTest() throws Exception { + ByteStringRange byteStringRange = createFakeByteStringRange(); + ChangeStreamContinuationToken changeStreamContinuationToken = + ChangeStreamContinuationToken.create(byteStringRange, TOKEN); + assertThat(changeStreamContinuationToken.getPartition()).isEqualTo(byteStringRange); + assertThat(changeStreamContinuationToken.getToken()).isEqualTo(TOKEN); + assertThat(changeStreamContinuationToken) + .isEqualTo( + ChangeStreamContinuationToken.fromByteString( + changeStreamContinuationToken.toByteString())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java new file mode 100644 index 000000000000..761bec376540 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java @@ -0,0 +1,336 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.Mutation; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.time.Instant; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ChangeStreamMutationTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String TABLE_ID = "fake-table"; + private static final String APP_PROFILE_ID = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + private static final Instant FAKE_COMMIT_TIMESTAMP = Instant.ofEpochSecond(0, 1000L); + private static final Instant FAKE_LOW_WATERMARK = Instant.ofEpochSecond(0, 2000L); + private static final org.threeten.bp.Instant FAKE_COMMIT_TIMESTAMP_THREETEN = + toThreetenInstant(FAKE_COMMIT_TIMESTAMP); + private static final org.threeten.bp.Instant FAKE_LOW_WATERMARK_THREETEN = + toThreetenInstant(FAKE_LOW_WATERMARK); + + @Test + public void userInitiatedMutationTest() throws IOException, ClassNotFoundException { + // Create a user initiated logical mutation. + ChangeStreamMutation changeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")) + .deleteFamily("fake-family") + .deleteCells( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)) + .addToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("col1")), + Value.rawTimestamp(1000), + Value.intValue(1234)) + .mergeToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("col2")), + Value.rawTimestamp(1000), + Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Test the getters. + assertThat(changeStreamMutation.getRowKey()).isEqualTo(ByteString.copyFromUtf8("key")); + assertThat(changeStreamMutation.getType()).isEqualTo(ChangeStreamMutation.MutationType.USER); + assertThat(changeStreamMutation.getSourceClusterId()).isEqualTo("fake-source-cluster-id"); + assertThat(changeStreamMutation.getCommitTime()).isEqualTo(FAKE_COMMIT_TIMESTAMP); + assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP_THREETEN); + assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); + assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); + assertThat(changeStreamMutation.getEstimatedLowWatermarkTime()).isEqualTo(FAKE_LOW_WATERMARK); + assertThat(changeStreamMutation.getEstimatedLowWatermark()) + .isEqualTo(FAKE_LOW_WATERMARK_THREETEN); + + // Test serialization. + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(changeStreamMutation); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + ChangeStreamMutation actual = (ChangeStreamMutation) ois.readObject(); + assertThat(actual).isEqualTo(changeStreamMutation); + } + + @Test + public void gcMutationTest() throws IOException, ClassNotFoundException { + // Create a GC mutation. + ChangeStreamMutation changeStreamMutation = + ChangeStreamMutation.createGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")) + .deleteFamily("fake-family") + .deleteCells( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Test the getters. + assertThat(changeStreamMutation.getRowKey()).isEqualTo(ByteString.copyFromUtf8("key")); + assertThat(changeStreamMutation.getType()) + .isEqualTo(ChangeStreamMutation.MutationType.GARBAGE_COLLECTION); + Assert.assertTrue(changeStreamMutation.getSourceClusterId().isEmpty()); + assertThat(changeStreamMutation.getCommitTime()).isEqualTo(FAKE_COMMIT_TIMESTAMP); + assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP_THREETEN); + assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); + assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); + assertThat(changeStreamMutation.getEstimatedLowWatermarkTime()).isEqualTo(FAKE_LOW_WATERMARK); + assertThat(changeStreamMutation.getEstimatedLowWatermark()) + .isEqualTo(FAKE_LOW_WATERMARK_THREETEN); + + // Test serialization. + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(changeStreamMutation); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + ChangeStreamMutation actual = (ChangeStreamMutation) ois.readObject(); + assertThat(actual).isEqualTo(changeStreamMutation); + } + + @Test + public void toRowMutationTest() { + ChangeStreamMutation changeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")) + .deleteFamily("fake-family") + .deleteCells( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)) + .addToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("qual1")), + Value.rawTimestamp(1000), + Value.intValue(1234)) + .mergeToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("qual2")), + Value.rawTimestamp(1000), + Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Convert it to a rowMutation and construct a MutateRowRequest. + RowMutation rowMutation = changeStreamMutation.toRowMutation(TABLE_ID); + MutateRowRequest mutateRowRequest = rowMutation.toProto(REQUEST_CONTEXT); + String tableName = + NameUtil.formatTableName( + REQUEST_CONTEXT.getProjectId(), REQUEST_CONTEXT.getInstanceId(), TABLE_ID); + assertThat(mutateRowRequest.getTableName()).isEqualTo(tableName); + assertThat(mutateRowRequest.getMutationsList()).hasSize(5); + assertThat(mutateRowRequest.getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(mutateRowRequest.getMutations(1).getDeleteFromFamily().getFamilyName()) + .isEqualTo("fake-family"); + assertThat(mutateRowRequest.getMutations(2).getDeleteFromColumn().getFamilyName()) + .isEqualTo("fake-family"); + assertThat(mutateRowRequest.getMutations(2).getDeleteFromColumn().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(mutateRowRequest.getMutations(3).getAddToCell()) + .isEqualTo( + Mutation.AddToCell.newBuilder() + .setFamilyName("agg-family") + .setColumnQualifier(Value.rawValue(ByteString.copyFromUtf8("qual1")).toProto()) + .setTimestamp(Value.rawTimestamp(1000).toProto()) + .setInput(Value.intValue(1234).toProto()) + .build()); + assertThat(mutateRowRequest.getMutations(4).getMergeToCell()) + .isEqualTo( + Mutation.MergeToCell.newBuilder() + .setFamilyName("agg-family") + .setColumnQualifier(Value.rawValue(ByteString.copyFromUtf8("qual2")).toProto()) + .setTimestamp(Value.rawTimestamp(1000).toProto()) + .setInput(Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L))).toProto()) + .build()); + } + + @Test + public void toRowMutationWithoutTokenShouldFailTest() { + ChangeStreamMutation.Builder builder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK); + Assert.assertThrows(IllegalStateException.class, builder::build); + } + + @Test + public void toRowMutationWithoutLowWatermarkShouldFailTest() { + ChangeStreamMutation.Builder builder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setToken("fake-token"); + Assert.assertThrows(IllegalStateException.class, builder::build); + } + + @Test + public void toRowMutationEntryTest() { + ChangeStreamMutation changeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")) + .deleteFamily("fake-family") + .deleteCells( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)) + .addToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("qual1")), + Value.rawTimestamp(1000), + Value.intValue(1234)) + .mergeToCell( + "agg-family", + Value.rawValue(ByteString.copyFromUtf8("qual2")), + Value.rawTimestamp(1000), + Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Convert it to a rowMutationEntry and construct a MutateRowRequest. + RowMutationEntry rowMutationEntry = changeStreamMutation.toRowMutationEntry(); + MutateRowsRequest.Entry mutateRowsRequestEntry = rowMutationEntry.toProto(); + assertThat(mutateRowsRequestEntry.getRowKey()).isEqualTo(ByteString.copyFromUtf8("key")); + assertThat(mutateRowsRequestEntry.getMutationsList()).hasSize(5); + assertThat(mutateRowsRequestEntry.getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(mutateRowsRequestEntry.getMutations(1).getDeleteFromFamily().getFamilyName()) + .isEqualTo("fake-family"); + assertThat(mutateRowsRequestEntry.getMutations(2).getDeleteFromColumn().getFamilyName()) + .isEqualTo("fake-family"); + assertThat(mutateRowsRequestEntry.getMutations(2).getDeleteFromColumn().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(mutateRowsRequestEntry.getMutations(3).getAddToCell()) + .isEqualTo( + Mutation.AddToCell.newBuilder() + .setFamilyName("agg-family") + .setColumnQualifier(Value.rawValue(ByteString.copyFromUtf8("qual1")).toProto()) + .setTimestamp(Value.rawTimestamp(1000).toProto()) + .setInput(Value.intValue(1234).toProto()) + .build()); + assertThat(mutateRowsRequestEntry.getMutations(4).getMergeToCell()) + .isEqualTo( + Mutation.MergeToCell.newBuilder() + .setFamilyName("agg-family") + .setColumnQualifier(Value.rawValue(ByteString.copyFromUtf8("qual2")).toProto()) + .setTimestamp(Value.rawTimestamp(1000).toProto()) + .setInput(Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L))).toProto()) + .build()); + } + + @Test + public void toRowMutationEntryWithoutTokenShouldFailTest() { + ChangeStreamMutation.Builder builder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK); + Assert.assertThrows(IllegalStateException.class, builder::build); + } + + @Test + public void toRowMutationEntryWithoutLowWatermarkShouldFailTest() { + ChangeStreamMutation.Builder builder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setToken("fake-token"); + Assert.assertThrows(IllegalStateException.class, builder::build); + } + + @Test + public void testWithLongValue() { + ChangeStreamMutation changeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000L, + ByteString.copyFrom(Longs.toByteArray(1L))) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + RowMutation rowMutation = changeStreamMutation.toRowMutation(TABLE_ID); + MutateRowRequest mutateRowRequest = rowMutation.toProto(REQUEST_CONTEXT); + String tableName = + NameUtil.formatTableName( + REQUEST_CONTEXT.getProjectId(), REQUEST_CONTEXT.getInstanceId(), TABLE_ID); + assertThat(mutateRowRequest.getTableName()).isEqualTo(tableName); + assertThat(mutateRowRequest.getMutationsList()).hasSize(1); + assertThat(mutateRowRequest.getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("\000\000\000\000\000\000\000\001")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java new file mode 100644 index 000000000000..e46c7b30b2fb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java @@ -0,0 +1,272 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.time.Instant; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ChangeStreamRecordTest { + + @Test + public void heartbeatSerializationTest() throws IOException, ClassNotFoundException { + ReadChangeStreamResponse.Heartbeat heartbeatProto = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark( + com.google.protobuf.Timestamp.newBuilder().setSeconds(1000).build()) + .setContinuationToken( + StreamContinuationToken.newBuilder().setToken("random-token").build()) + .build(); + Heartbeat heartbeat = Heartbeat.fromProto(heartbeatProto); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(heartbeat); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + Heartbeat actual = (Heartbeat) ois.readObject(); + assertThat(actual).isEqualTo(heartbeat); + } + + @Test + public void closeStreamSerializationTest() throws IOException, ClassNotFoundException { + Status status = Status.newBuilder().setCode(11).build(); + RowRange rowRange1 = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("apple")) + .build(); + String token1 = "close-stream-token-1"; + RowRange rowRange2 = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("apple")) + .setEndKeyOpen(ByteString.copyFromUtf8("")) + .build(); + String token2 = "close-stream-token-2"; + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange1).build()) + .setToken(token1) + .build()) + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange2).build()) + .setToken(token2) + .build()) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange1)) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange2)) + .setStatus(status) + .build(); + CloseStream closeStream = CloseStream.fromProto(closeStreamProto); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(closeStream); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + CloseStream actual = (CloseStream) ois.readObject(); + assertThat(actual.getChangeStreamContinuationTokens()) + .isEqualTo(closeStream.getChangeStreamContinuationTokens()); + assertThat(actual.getStatus()).isEqualTo(closeStream.getStatus()); + assertThat(actual.getNewPartitions()).isEqualTo(closeStream.getNewPartitions()); + } + + @Test + public void heartbeatTest() { + Timestamp lowWatermark = Timestamp.newBuilder().setSeconds(1000).build(); + RowRange rowRange = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("apple")) + .setEndKeyOpen(ByteString.copyFromUtf8("banana")) + .build(); + String token = "heartbeat-token"; + ReadChangeStreamResponse.Heartbeat heartbeatProto = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark(lowWatermark) + .setContinuationToken( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange).build()) + .setToken(token) + .build()) + .build(); + Heartbeat actualHeartbeat = Heartbeat.fromProto(heartbeatProto); + + assertThat(actualHeartbeat.getEstimatedLowWatermarkTime()) + .isEqualTo(Instant.ofEpochSecond(lowWatermark.getSeconds(), lowWatermark.getNanos())); + assertThat(actualHeartbeat.getChangeStreamContinuationToken().getPartition()) + .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); + assertThat(actualHeartbeat.getChangeStreamContinuationToken().getToken()).isEqualTo(token); + } + + @Test + public void closeStreamTest() { + Status status = Status.newBuilder().setCode(11).build(); + RowRange rowRange1 = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("apple")) + .build(); + String token1 = "close-stream-token-1"; + RowRange rowRange2 = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("apple")) + .setEndKeyOpen(ByteString.copyFromUtf8("")) + .build(); + String token2 = "close-stream-token-2"; + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange1).build()) + .setToken(token1) + .build()) + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange2).build()) + .setToken(token2) + .build()) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange1)) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange2)) + .setStatus(status) + .build(); + CloseStream actualCloseStream = CloseStream.fromProto(closeStreamProto); + + assertThat(status).isEqualTo(actualCloseStream.getStatus().toProto()); + assertThat(actualCloseStream.getChangeStreamContinuationTokens().get(0).getPartition()) + .isEqualTo( + ByteStringRange.create(rowRange1.getStartKeyClosed(), rowRange1.getEndKeyOpen())); + assertThat(token1) + .isEqualTo(actualCloseStream.getChangeStreamContinuationTokens().get(0).getToken()); + assertThat(actualCloseStream.getChangeStreamContinuationTokens().get(1).getPartition()) + .isEqualTo( + ByteStringRange.create(rowRange2.getStartKeyClosed(), rowRange2.getEndKeyOpen())); + assertThat(token2) + .isEqualTo(actualCloseStream.getChangeStreamContinuationTokens().get(1).getToken()); + assertThat(actualCloseStream.getNewPartitions().get(0)) + .isEqualTo( + ByteStringRange.create(rowRange1.getStartKeyClosed(), rowRange1.getEndKeyOpen())); + assertThat(actualCloseStream.getNewPartitions().get(1)) + .isEqualTo( + ByteStringRange.create(rowRange2.getStartKeyClosed(), rowRange2.getEndKeyOpen())); + } + + // Tests that an OK CloseStream should not have continuation tokens. + @Test + public void closeStreamOkWithContinuationTokenShouldFail() { + Status status = Status.newBuilder().setCode(0).build(); + RowRange rowRange = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("apple")) + .build(); + String token = "close-stream-token-1"; + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange)) + .setToken(token)) + .setStatus(status) + .build(); + Assert.assertThrows(IllegalStateException.class, () -> CloseStream.fromProto(closeStreamProto)); + } + + // Tests that a non-OK CloseStream should have continuation tokens. + @Test + public void closeStreamErrorWithoutContinuationTokenShouldFail() { + Status status = Status.newBuilder().setCode(11).build(); + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder().setStatus(status).build(); + Assert.assertThrows(IllegalStateException.class, () -> CloseStream.fromProto(closeStreamProto)); + } + + // Tests that the number of continuation tokens should match the number of new partitions. + @Test + public void closeStreamTokenAndNewPartitionCountMismatchedTest() { + Status status = Status.newBuilder().setCode(11).build(); + RowRange rowRange = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("apple")) + .build(); + String token = "close-stream-token-1"; + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange)) + .setToken(token)) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange)) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange)) + .setStatus(status) + .build(); + Assert.assertThrows(IllegalStateException.class, () -> CloseStream.fromProto(closeStreamProto)); + } + + // Tests that number of continuation tokens and new partitions don't need to match if new + // partitions is empty. + @Test + public void closeStreamTokenAndZeroNewPartitionMismatchNoExceptionTest() + throws IOException, ClassNotFoundException { + Status status = Status.newBuilder().setCode(11).build(); + RowRange rowRange = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("apple")) + .build(); + String token = "close-stream-token-1"; + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange)) + .setToken(token)) + .setStatus(status) + .build(); + CloseStream closeStream = CloseStream.fromProto(closeStreamProto); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(closeStream); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + CloseStream actual = (CloseStream) ois.readObject(); + assertThat(actual.getChangeStreamContinuationTokens()) + .isEqualTo(closeStream.getChangeStreamContinuationTokens()); + assertThat(actual.getStatus()).isEqualTo(closeStream.getStatus()); + assertThat(actual.getNewPartitions()).isEqualTo(closeStream.getNewPartitions()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java new file mode 100644 index 000000000000..3a376668cf58 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java @@ -0,0 +1,307 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.Mutation.DeleteFromColumn; +import com.google.bigtable.v2.RowFilter; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ConditionalRowMutationTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final String AUTHORIZED_VIEW_ID = "fake-authorized-view"; + + private static final String APP_PROFILE_ID = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + + private static final ByteString TEST_KEY = ByteString.copyFromUtf8("fake-key"); + + @Test + public void toProtoTest() { + Mutation ignoredThenMutation = Mutation.create().deleteRow(); + + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY).then(ignoredThenMutation); + + CheckAndMutateRowRequest actualProto = + mutation.toProto(REQUEST_CONTEXT).toBuilder().clearTrueMutations().build(); + + assertThat(actualProto) + .isEqualTo( + CheckAndMutateRowRequest.newBuilder() + .setTableName( + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId())) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(TEST_KEY) + .build()); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .then(ignoredThenMutation); + + actualProto = mutation.toProto(REQUEST_CONTEXT).toBuilder().clearTrueMutations().build(); + + assertThat(actualProto) + .isEqualTo( + CheckAndMutateRowRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId(), AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(TEST_KEY) + .build()); + } + + @Test + public void conditionTest() { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY) + .condition(Filters.FILTERS.key().regex("a.*")) + .then(Mutation.create().deleteRow()); + + CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto.getPredicateFilter()) + .isEqualTo( + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8("a.*")).build()); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .condition(Filters.FILTERS.key().regex("a.*")) + .then(Mutation.create().deleteRow()); + + actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto.getPredicateFilter()) + .isEqualTo( + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8("a.*")).build()); + } + + @Test + public void thenTest() { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY) + .then(Mutation.create().deleteCells("family1", "qualifier1")) + .then(Mutation.create().deleteCells("family2", "qualifier2")); + + CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); + + List expectedMutations = new ArrayList<>(); + expectedMutations.add( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("family1") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier1"))) + .build()); + expectedMutations.add( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("family2") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier2"))) + .build()); + assertThat(actualProto.getTrueMutationsList()).isEqualTo(expectedMutations); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .then(Mutation.create().deleteCells("family1", "qualifier1")) + .then(Mutation.create().deleteCells("family2", "qualifier2")); + + actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto.getTrueMutationsList()).isEqualTo(expectedMutations); + } + + @Test + public void otherwiseTest() { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY) + .otherwise(Mutation.create().deleteCells("family1", "qualifier1")) + .otherwise(Mutation.create().deleteCells("family2", "qualifier2")); + + CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); + + List expectedMutations = new ArrayList<>(); + expectedMutations.add( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("family1") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier1"))) + .build()); + expectedMutations.add( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("family2") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier2"))) + .build()); + assertThat(actualProto.getFalseMutationsList()).isEqualTo(expectedMutations); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .otherwise(Mutation.create().deleteCells("family1", "qualifier1")) + .otherwise(Mutation.create().deleteCells("family2", "qualifier2")); + + actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto.getFalseMutationsList()).isEqualTo(expectedMutations); + } + + @Test + public void noEffectClausesTest() { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY).condition(Filters.FILTERS.pass()); + + Throwable actualError = null; + + try { + mutation.toProto(REQUEST_CONTEXT); + } catch (Throwable t) { + actualError = t; + } + + assertThat(actualError).isInstanceOf(IllegalStateException.class); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .condition(Filters.FILTERS.pass()); + + try { + mutation.toProto(REQUEST_CONTEXT); + } catch (Throwable t) { + actualError = t; + } + + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation expected = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY) + .condition(Filters.FILTERS.pass()) + .then(Mutation.create().deleteRow()) + .otherwise(Mutation.create().deleteFamily("cf")); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + ConditionalRowMutation actual = (ConditionalRowMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + + // Test ConditionalRowMutation on an authorized view. + expected = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .condition(Filters.FILTERS.pass()) + .then(Mutation.create().deleteRow()) + .otherwise(Mutation.create().deleteFamily("cf")); + + bos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + actual = (ConditionalRowMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + } + + @Test + public void fromProtoTest() { + // Test ConditionalRowMutation on a table. + ConditionalRowMutation mutation = + ConditionalRowMutation.create(TABLE_ID, TEST_KEY) + .condition(Filters.FILTERS.key().regex("test")) + .then(Mutation.create().setCell("family1", "qualifier1", 10_000L, "value")) + .otherwise(Mutation.create().deleteFamily("family")); + + CheckAndMutateRowRequest protoRequest = mutation.toProto(REQUEST_CONTEXT); + ConditionalRowMutation actualRequest = ConditionalRowMutation.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + String projectId = "fresh-project"; + String instanceId = "fresh-instance"; + String appProfile = "fresh-app-profile"; + CheckAndMutateRowRequest overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()) + .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID.getTableId())); + assertThat(overriddenRequest.getAuthorizedViewName()).isEmpty(); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + + // Test ConditionalRowMutation on an authorized view. + mutation = + ConditionalRowMutation.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID), TEST_KEY) + .condition(Filters.FILTERS.key().regex("test")) + .then(Mutation.create().setCell("family1", "qualifier1", 10_000L, "value")) + .otherwise(Mutation.create().deleteFamily("family")); + + protoRequest = mutation.toProto(REQUEST_CONTEXT); + actualRequest = ConditionalRowMutation.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()).isEmpty(); + assertThat(overriddenRequest.getAuthorizedViewName()) + .matches( + NameUtil.formatAuthorizedViewName( + projectId, instanceId, TABLE_ID.getTableId(), AUTHORIZED_VIEW_ID)); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java new file mode 100644 index 000000000000..1f74d72b7cd2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java @@ -0,0 +1,461 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.TimestampRange; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter.ChangeStreamRecordBuilder; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.time.Instant; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class DefaultChangeStreamRecordAdapterTest { + + private final DefaultChangeStreamRecordAdapter adapter = new DefaultChangeStreamRecordAdapter(); + private ChangeStreamRecordBuilder changeStreamRecordBuilder; + private static final Instant FAKE_COMMIT_TIMESTAMP = Instant.ofEpochSecond(0L, 1000L); + private static final Instant FAKE_LOW_WATERMARK = Instant.ofEpochSecond(0L, 2000L); + private static final org.threeten.bp.Instant FAKE_LOW_WATERMARK_THREETEN = + toThreetenInstant(FAKE_LOW_WATERMARK); + + @Before + public void setUp() { + changeStreamRecordBuilder = adapter.createChangeStreamRecordBuilder(); + } + + @Test + public void isHeartbeatTest() { + ChangeStreamRecord heartbeatRecord = + Heartbeat.fromProto(ReadChangeStreamResponse.Heartbeat.getDefaultInstance()); + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + ChangeStreamRecord changeStreamMutationRecord = + ChangeStreamMutation.createGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) + .setToken("token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + Assert.assertTrue(adapter.isHeartbeat(heartbeatRecord)); + Assert.assertFalse(adapter.isHeartbeat(closeStreamRecord)); + Assert.assertFalse(adapter.isHeartbeat(changeStreamMutationRecord)); + } + + @Test + public void getTokenFromHeartbeatTest() { + ChangeStreamRecord heartbeatRecord = + Heartbeat.fromProto( + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark( + Timestamp.newBuilder() + .setSeconds(FAKE_LOW_WATERMARK_THREETEN.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK_THREETEN.getNano())) + .setContinuationToken( + StreamContinuationToken.newBuilder().setToken("heartbeat-token").build()) + .build()); + Assert.assertEquals("heartbeat-token", adapter.getTokenFromHeartbeat(heartbeatRecord)); + } + + @Test + public void getTokenFromHeartbeatInvalidTypeTest() { + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, () -> adapter.getTokenFromHeartbeat(closeStreamRecord)); + assertThat(e).hasMessageThat().isEqualTo("record is not a Heartbeat."); + } + + @Test + public void isChangeStreamMutationTest() { + ChangeStreamRecord heartbeatRecord = + Heartbeat.fromProto(ReadChangeStreamResponse.Heartbeat.getDefaultInstance()); + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + ChangeStreamRecord changeStreamMutationRecord = + ChangeStreamMutation.createGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) + .setToken("token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + Assert.assertFalse(adapter.isChangeStreamMutation(heartbeatRecord)); + Assert.assertFalse(adapter.isChangeStreamMutation(closeStreamRecord)); + Assert.assertTrue(adapter.isChangeStreamMutation(changeStreamMutationRecord)); + } + + @Test + public void getTokenFromChangeStreamMutationTest() { + ChangeStreamRecord changeStreamMutationRecord = + ChangeStreamMutation.createGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) + .setToken("change-stream-mutation-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + Assert.assertEquals( + "change-stream-mutation-token", + adapter.getTokenFromChangeStreamMutation(changeStreamMutationRecord)); + } + + @Test + public void getTokenFromChangeStreamMutationInvalidTypeTest() { + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> adapter.getTokenFromChangeStreamMutation(closeStreamRecord)); + assertThat(e).hasMessageThat().isEqualTo("record is not a ChangeStreamMutation."); + } + + @Test + public void heartbeatTest() { + ReadChangeStreamResponse.Heartbeat expectedHeartbeat = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark( + Timestamp.newBuilder() + .setSeconds(FAKE_LOW_WATERMARK_THREETEN.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK_THREETEN.getNano()) + .build()) + .setContinuationToken( + StreamContinuationToken.newBuilder().setToken("random-token").build()) + .build(); + assertThat(changeStreamRecordBuilder.onHeartbeat(expectedHeartbeat)) + .isEqualTo(Heartbeat.fromProto(expectedHeartbeat)); + // Call again. + assertThat(changeStreamRecordBuilder.onHeartbeat(expectedHeartbeat)) + .isEqualTo(Heartbeat.fromProto(expectedHeartbeat)); + } + + @Test + public void closeStreamTest() { + ReadChangeStreamResponse.CloseStream expectedCloseStream = + ReadChangeStreamResponse.CloseStream.newBuilder() + .setStatus(Status.newBuilder().setCode(0).build()) + .build(); + assertThat(changeStreamRecordBuilder.onCloseStream(expectedCloseStream)) + .isEqualTo(CloseStream.fromProto(expectedCloseStream)); + // Call again. + assertThat(changeStreamRecordBuilder.onCloseStream(expectedCloseStream)) + .isEqualTo(CloseStream.fromProto(expectedCloseStream)); + } + + @Test(expected = IllegalStateException.class) + public void createHeartbeatWithExistingMutationShouldFailTest() { + changeStreamRecordBuilder.startGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.onHeartbeat(ReadChangeStreamResponse.Heartbeat.getDefaultInstance()); + } + + @Test(expected = IllegalStateException.class) + public void createCloseStreamWithExistingMutationShouldFailTest() { + changeStreamRecordBuilder.startGcMutation( + ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.onCloseStream( + ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + } + + @Test + public void singleDeleteFamilyTest() { + // Suppose this is the mod we get from the ReadChangeStreamResponse. + Mutation.DeleteFromFamily deleteFromFamily = + Mutation.DeleteFromFamily.newBuilder().setFamilyName("fake-family").build(); + + // Expected logical mutation in the change stream record. + ChangeStreamMutation expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.deleteFamily(deleteFromFamily.getFamilyName()); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + // Call again. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + } + + @Test + public void singleDeleteCellTest() { + // Suppose this is the mod we get from the ReadChangeStreamResponse. + Mutation.DeleteFromColumn deleteFromColumn = + Mutation.DeleteFromColumn.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setTimeRange( + TimestampRange.newBuilder() + .setStartTimestampMicros(1000L) + .setEndTimestampMicros(2000L) + .build()) + .build(); + + // Expected logical mutation in the change stream record. + ChangeStreamMutation expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteCells( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.deleteCells( + deleteFromColumn.getFamilyName(), + deleteFromColumn.getColumnQualifier(), + Range.TimestampRange.create( + deleteFromColumn.getTimeRange().getStartTimestampMicros(), + deleteFromColumn.getTimeRange().getEndTimestampMicros())); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + // Call again. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + } + + @Test + public void singleNonChunkedCellTest() { + // Expected logical mutation in the change stream record. + ChangeStreamMutation expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8("fake-value")) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + // Suppose the SetCell is not chunked and the state machine calls `cellValue()` once. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("fake-value")); + changeStreamRecordBuilder.finishCell(); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + // Call again. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + } + + @Test + public void singleChunkedCellTest() { + // Expected logical mutation in the change stream record. + ChangeStreamMutation expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8("fake-value1-value2")) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + // Suppose the SetCell is chunked into two pieces and the state machine calls `cellValue()` + // twice. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("fake-value1")); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("-value2")); + changeStreamRecordBuilder.finishCell(); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + // Call again. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + } + + @Test + public void multipleChunkedCellsTest() { + // Expected logical mutation in the change stream record. + ChangeStreamMutation.Builder expectedChangeStreamMutationBuilder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + for (int i = 0; i < 10; ++i) { + expectedChangeStreamMutationBuilder.setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8(i + "-fake-value1-value2-value3")); + } + expectedChangeStreamMutationBuilder + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + for (int i = 0; i < 10; ++i) { + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8(i + "-fake-value1")); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("-value2")); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("-value3")); + changeStreamRecordBuilder.finishCell(); + } + // Check that they're the same. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutationBuilder.build()); + // Call again. + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutationBuilder.build()); + } + + @Test + public void multipleDifferentModsTest() { + // Expected logical mutation in the change stream record, which contains one DeleteFromFamily, + // one non-chunked cell, and one chunked cell. + ChangeStreamMutation.Builder expectedChangeStreamMutationBuilder = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8("non-chunked-value")) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8("chunked-value")) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK); + + // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.deleteFamily("fake-family"); + // Add non-chunked cell. + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("non-chunked-value")); + changeStreamRecordBuilder.finishCell(); + // Add chunked cell. + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("chunked")); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("-value")); + changeStreamRecordBuilder.finishCell(); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutationBuilder.build()); + } + + @Test + public void resetTest() { + // Build a Heartbeat. + ReadChangeStreamResponse.Heartbeat expectedHeartbeat = + ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + assertThat(changeStreamRecordBuilder.onHeartbeat(expectedHeartbeat)) + .isEqualTo(Heartbeat.fromProto(expectedHeartbeat)); + + // Reset and build a CloseStream. + changeStreamRecordBuilder.reset(); + ReadChangeStreamResponse.CloseStream expectedCloseStream = + ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + assertThat(changeStreamRecordBuilder.onCloseStream(expectedCloseStream)) + .isEqualTo(CloseStream.fromProto(expectedCloseStream)); + + // Reset and build a DeleteFamily. + changeStreamRecordBuilder.reset(); + Mutation deleteFromFamily = + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder().setFamilyName("fake-family").build()) + .build(); + ChangeStreamMutation expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .deleteFamily("fake-family") + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.deleteFamily(deleteFromFamily.getDeleteFromFamily().getFamilyName()); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + + // Reset a build a cell. + changeStreamRecordBuilder.reset(); + expectedChangeStreamMutation = + ChangeStreamMutation.createUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 100L, + ByteString.copyFromUtf8("fake-value1-value2")) + .setToken("fake-token") + .setEstimatedLowWatermarkTime(FAKE_LOW_WATERMARK) + .build(); + + changeStreamRecordBuilder.startUserMutation( + ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); + changeStreamRecordBuilder.startCell( + "fake-family", ByteString.copyFromUtf8("fake-qualifier"), 100L); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("fake-value1")); + changeStreamRecordBuilder.cellValue(ByteString.copyFromUtf8("-value2")); + changeStreamRecordBuilder.finishCell(); + assertThat( + changeStreamRecordBuilder.finishChangeStreamMutation("fake-token", FAKE_LOW_WATERMARK)) + .isEqualTo(expectedChangeStreamMutation); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapterTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapterTest.java new file mode 100644 index 000000000000..21afab9edffc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapterTest.java @@ -0,0 +1,239 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class DefaultRowAdapterTest { + + private final DefaultRowAdapter adapter = new DefaultRowAdapter(); + private RowBuilder rowBuilder; + + @Before + public void setUp() { + rowBuilder = adapter.createRowBuilder(); + } + + @Test + public void singleCellRowTest() { + ByteString value = ByteString.copyFromUtf8("my-value"); + rowBuilder.startRow(ByteString.copyFromUtf8("my-key")); + rowBuilder.startCell( + "my-family", + ByteString.copyFromUtf8("my-qualifier"), + 100, + ImmutableList.of("my-label"), + value.size()); + rowBuilder.cellValue(value); + rowBuilder.finishCell(); + + assertThat(rowBuilder.finishRow()) + .isEqualTo( + Row.create( + ByteString.copyFromUtf8("my-key"), + ImmutableList.of( + RowCell.create( + "my-family", + ByteString.copyFromUtf8("my-qualifier"), + 100, + ImmutableList.of("my-label"), + value)))); + } + + @Test + public void multiCellTest() { + List expectedCells = Lists.newArrayList(); + + rowBuilder.startRow(ByteString.copyFromUtf8("my-key")); + + for (int i = 0; i < 10; i++) { + ByteString value = ByteString.copyFromUtf8("value-" + i); + ByteString qualifier = ByteString.copyFromUtf8("qualifier-" + i); + rowBuilder.startCell("family", qualifier, 1000, ImmutableList.of("my-label"), value.size()); + rowBuilder.cellValue(value); + rowBuilder.finishCell(); + + expectedCells.add( + RowCell.create("family", qualifier, 1000, ImmutableList.of("my-label"), value)); + } + + assertThat(rowBuilder.finishRow()) + .isEqualTo(Row.create(ByteString.copyFromUtf8("my-key"), expectedCells)); + } + + @Test + public void splitCellTest() { + ByteString part1 = ByteString.copyFromUtf8("part1"); + ByteString part2 = ByteString.copyFromUtf8("part2"); + + rowBuilder.startRow(ByteString.copyFromUtf8("my-key")); + rowBuilder.startCell( + "family", + ByteString.copyFromUtf8("qualifier"), + 1000, + ImmutableList.of("my-label"), + part1.size() + part2.size()); + rowBuilder.cellValue(part1); + rowBuilder.cellValue(part2); + rowBuilder.finishCell(); + + assertThat(rowBuilder.finishRow()) + .isEqualTo( + Row.create( + ByteString.copyFromUtf8("my-key"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.copyFromUtf8("qualifier"), + 1000, + ImmutableList.of("my-label"), + ByteString.copyFromUtf8("part1part2"))))); + } + + @Test + public void markerRowTest() { + Row markerRow = rowBuilder.createScanMarkerRow(ByteString.copyFromUtf8("key")); + assertThat(adapter.isScanMarkerRow(markerRow)).isTrue(); + + ByteString value = ByteString.copyFromUtf8("value"); + rowBuilder.startRow(ByteString.copyFromUtf8("key")); + rowBuilder.startCell( + "family", ByteString.EMPTY, 1000, ImmutableList.of(), value.size()); + rowBuilder.cellValue(value); + rowBuilder.finishCell(); + + assertThat(adapter.isScanMarkerRow(rowBuilder.finishRow())).isFalse(); + } + + @Test + public void sortFamiliesAreSorted() { + ByteString col1 = ByteString.copyFromUtf8("col1"); + ByteString col2 = ByteString.copyFromUtf8("col2"); + List labels = ImmutableList.of(); + ByteString value1 = ByteString.copyFromUtf8("my-value1"); + ByteString value2 = ByteString.copyFromUtf8("my-value2"); + ByteString value3 = ByteString.copyFromUtf8("my-value3"); + ByteString value4 = ByteString.copyFromUtf8("my-value4"); + + rowBuilder.startRow(ByteString.copyFromUtf8("key1")); + + // family2 with 2 cells is received before family1 + rowBuilder.startCell("family2", col1, 1000, labels, value1.size()); + rowBuilder.cellValue(value1); + rowBuilder.finishCell(); + + rowBuilder.startCell("family2", col2, 1000, labels, value2.size()); + rowBuilder.cellValue(value2); + rowBuilder.finishCell(); + + // family1 with 2 cells is received after family2 cells + rowBuilder.startCell("family1", col1, 1000, ImmutableList.of(), value3.size()); + rowBuilder.cellValue(value3); + rowBuilder.finishCell(); + + rowBuilder.startCell("family1", col2, 1000, ImmutableList.of(), value4.size()); + rowBuilder.cellValue(value4); + rowBuilder.finishCell(); + + Row actualRow = rowBuilder.finishRow(); + + // The resulting the cells will reorder family1 first + assertThat(actualRow.getCells()) + .containsExactlyElementsIn( + ImmutableList.of( + RowCell.create("family1", col1, 1000, labels, value3), + RowCell.create("family1", col2, 1000, labels, value4), + RowCell.create("family2", col1, 1000, labels, value1), + RowCell.create("family2", col2, 1000, labels, value2))) + .inOrder(); + } + + @Test + public void protoTest() { + ByteString key = ByteString.copyFromUtf8("key"); + + String family1 = "family1"; + ByteString col1 = ByteString.copyFromUtf8("col1"); + ByteString value1 = ByteString.copyFromUtf8("value1"); + + String family2 = "family2"; + ByteString col2 = ByteString.copyFromUtf8("col2"); + ByteString value2 = ByteString.copyFromUtf8("value2"); + + List labels = ImmutableList.of(); + + com.google.bigtable.v2.Row proto = + com.google.bigtable.v2.Row.newBuilder() + .setKey(key) + .addFamilies( + com.google.bigtable.v2.Family.newBuilder() + .setName(family2) + .addColumns( + com.google.bigtable.v2.Column.newBuilder() + .setQualifier(col1) + .addCells( + com.google.bigtable.v2.Cell.newBuilder() + .setTimestampMicros(2_000) + .setValue(value2))) + .addColumns( + com.google.bigtable.v2.Column.newBuilder() + .setQualifier(col2) + .addCells( + com.google.bigtable.v2.Cell.newBuilder() + .setTimestampMicros(2_000) + .setValue(value2)))) + .addFamilies( + com.google.bigtable.v2.Family.newBuilder() + .setName(family1) + .addColumns( + com.google.bigtable.v2.Column.newBuilder() + .setQualifier(col1) + .addCells( + com.google.bigtable.v2.Cell.newBuilder() + .setTimestampMicros(1_000) + .setValue(value1))) + .addColumns( + com.google.bigtable.v2.Column.newBuilder() + .setQualifier(col2) + .addCells( + com.google.bigtable.v2.Cell.newBuilder() + .setTimestampMicros(1_000) + .setValue(value1)))) + .build(); + + Row row = adapter.createRowFromProto(proto); + assertThat(row) + .isEqualTo( + Row.create( + key, + ImmutableList.of( + RowCell.create(family1, col1, 1_000, labels, value1), + RowCell.create(family1, col2, 1_000, labels, value1), + RowCell.create(family2, col1, 2_000, labels, value2), + RowCell.create(family2, col2, 2_000, labels, value2)))); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/EntryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/EntryTest.java new file mode 100644 index 000000000000..645859f5aa99 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/EntryTest.java @@ -0,0 +1,101 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class EntryTest { + private void validateSerializationRoundTrip(Object obj) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(obj); + oos.close(); + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + assertThat(ois.readObject()).isEqualTo(obj); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // DeleteFamily + Entry deleteFamilyEntry = DeleteFamily.create("fake-family"); + validateSerializationRoundTrip(deleteFamilyEntry); + + // DeleteCell + Entry deleteCellsEntry = + DeleteCells.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)); + validateSerializationRoundTrip(deleteCellsEntry); + + // SetCell + Entry setCellEntry = + SetCell.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")); + validateSerializationRoundTrip(setCellEntry); + } + + @Test + public void deleteFamilyTest() { + Entry deleteFamilyEntry = DeleteFamily.create("fake-family"); + DeleteFamily deleteFamily = (DeleteFamily) deleteFamilyEntry; + assertThat(deleteFamily.getFamilyName()).isEqualTo("fake-family"); + } + + @Test + public void deleteCellsTest() { + Entry deleteCellEntry = + DeleteCells.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)); + DeleteCells deleteCells = (DeleteCells) deleteCellEntry; + assertThat(deleteCells.getFamilyName()).isEqualTo("fake-family"); + assertThat(deleteCells.getQualifier()).isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(deleteCells.getTimestampRange()) + .isEqualTo(Range.TimestampRange.create(1000L, 2000L)); + } + + @Test + public void setSellTest() { + Entry setCellEntry = + SetCell.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")); + SetCell setCell = (SetCell) setCellEntry; + assertThat(setCell.getFamilyName()).isEqualTo("fake-family"); + assertThat(setCell.getQualifier()).isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(setCell.getTimestamp()).isEqualTo(1000); + assertThat(setCell.getValue()).isEqualTo(ByteString.copyFromUtf8("fake-value")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java new file mode 100644 index 000000000000..b8311f592ec4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java @@ -0,0 +1,751 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.fail; + +import com.google.bigtable.v2.ColumnRange; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.RowFilter.Chain; +import com.google.bigtable.v2.RowFilter.Condition; +import com.google.bigtable.v2.RowFilter.Interleave; +import com.google.bigtable.v2.TimestampRange; +import com.google.bigtable.v2.ValueRange; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class FiltersTest { + @Test + public void chainTest() { + RowFilter actualProto = + FILTERS + .chain() + .filter(FILTERS.key().regex(".*")) + .filter(FILTERS.key().sample(0.5)) + .filter(FILTERS.chain().filter(FILTERS.family().regex("hi$")).filter(FILTERS.pass())) + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setChain( + Chain.newBuilder() + .addFilters( + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))) + .addFilters(RowFilter.newBuilder().setRowSampleFilter(0.5)) + .addFilters( + RowFilter.newBuilder() + .setChain( + Chain.newBuilder() + .addFilters( + RowFilter.newBuilder().setFamilyNameRegexFilter("hi$")) + .addFilters(RowFilter.newBuilder().setPassAllFilter(true))))) + .build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void chainEmptyTest() { + RowFilter actualProto = FILTERS.chain().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setPassAllFilter(true).build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void chainSingleTest() { + RowFilter actualProto = FILTERS.chain().filter(FILTERS.key().regex(".*")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*")).build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void interleaveTest() { + RowFilter actualProto = + FILTERS + .interleave() + .filter(FILTERS.key().regex(".*")) + .filter(FILTERS.key().sample(0.5)) + .filter( + FILTERS.interleave().filter(FILTERS.family().regex("hi$")).filter(FILTERS.pass())) + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setInterleave( + Interleave.newBuilder() + .addFilters( + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))) + .addFilters(RowFilter.newBuilder().setRowSampleFilter(0.5)) + .addFilters( + RowFilter.newBuilder() + .setInterleave( + Interleave.newBuilder() + .addFilters( + RowFilter.newBuilder().setFamilyNameRegexFilter("hi$")) + .addFilters( + RowFilter.newBuilder().setPassAllFilter(true).build())))) + .build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void interleaveEmptyTest() { + RowFilter actualProto = FILTERS.chain().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setPassAllFilter(true).build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void interleaveSingleTest() { + RowFilter actualProto = FILTERS.interleave().filter(FILTERS.key().regex(".*")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*")).build(); + + assertThat(actualProto).isEqualTo(expectedFilter); + } + + @Test + public void conditionTest() { + RowFilter actualFilter = + FILTERS + .condition(FILTERS.key().regex(".*")) + .then(FILTERS.label("true")) + .otherwise(FILTERS.label("false")) + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setCondition( + Condition.newBuilder() + .setPredicateFilter( + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))) + .setTrueFilter(RowFilter.newBuilder().setApplyLabelTransformer("true")) + .setFalseFilter(RowFilter.newBuilder().setApplyLabelTransformer("false"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void keyRegexTest() { + RowFilter actualFilter = FILTERS.key().regex(ByteString.copyFromUtf8(".*")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*")).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void keyRegexStringTest() { + RowFilter actualFilter = FILTERS.key().regex(".*").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*")).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void keyExactMatchTest() { + RowFilter actualFilter = FILTERS.key().exactMatch(ByteString.copyFromUtf8(".*")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8("\\.\\*")).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void keyExactMatchStringTest() { + RowFilter actualFilter = FILTERS.key().exactMatch(".*").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8("\\.\\*")).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void keySampleTest() { + RowFilter actualFilter = FILTERS.key().sample(0.3).toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setRowSampleFilter(0.3).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void familyRegexTest() { + RowFilter actualFilter = FILTERS.family().regex("^hi").toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setFamilyNameRegexFilter("^hi").build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void familyExactMatchTest() { + RowFilter actualFilter = FILTERS.family().exactMatch("^hi").toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setFamilyNameRegexFilter("\\^hi").build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierRegexTest() { + RowFilter actualFilter = FILTERS.qualifier().regex(ByteString.copyFromUtf8("^hi")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("^hi")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierRegexStringTest() { + RowFilter actualFilter = FILTERS.qualifier().regex("^hi").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("^hi")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierExactMatchTest() { + RowFilter actualFilter = + FILTERS.qualifier().exactMatch(ByteString.copyFromUtf8("^hi")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("\\^hi")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierExactStringMatchTest() { + RowFilter actualFilter = FILTERS.qualifier().exactMatch("^hi").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnQualifierRegexFilter(ByteString.copyFromUtf8("\\^hi")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierRangeInFamilyClosedOpen() { + RowFilter actualFilter = + FILTERS + .qualifier() + .rangeWithinFamily("family") + .startClosed("begin") + .endOpen("end") + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnRangeFilter( + ColumnRange.newBuilder() + .setFamilyName("family") + .setStartQualifierClosed(ByteString.copyFromUtf8("begin")) + .setEndQualifierOpen(ByteString.copyFromUtf8("end"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierRangeInFamilyOpenClosed() { + RowFilter actualFilter = + FILTERS + .qualifier() + .rangeWithinFamily("family") + .startOpen("begin") + .endClosed("end") + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnRangeFilter( + ColumnRange.newBuilder() + .setFamilyName("family") + .setStartQualifierOpen(ByteString.copyFromUtf8("begin")) + .setEndQualifierClosed(ByteString.copyFromUtf8("end"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void qualifierRangeRange() { + RowFilter actualFilter = + FILTERS + .qualifier() + .rangeWithinFamily("family") + .startClosed("begin") + .endOpen("end") + .toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setColumnRangeFilter( + ColumnRange.newBuilder() + .setFamilyName("family") + .setStartQualifierClosed(ByteString.copyFromUtf8("begin")) + .setEndQualifierOpen(ByteString.copyFromUtf8("end"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void timestampRange() { + RowFilter actualFilter = + FILTERS.timestamp().range().startClosed(1_000L).endOpen(30_000L).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setTimestampRangeFilter( + TimestampRange.newBuilder() + .setStartTimestampMicros(1_000L) + .setEndTimestampMicros(30_000L)) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void timestampAtExactTime() { + RowFilter actualFilter = FILTERS.timestamp().exact(20_000L).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setTimestampRangeFilter( + TimestampRange.newBuilder() + .setStartTimestampMicros(20_000L) + .setEndTimestampMicros(20_000L + 1)) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void timestampOpenClosedFakeRange() { + RowFilter actualFilter = + FILTERS.timestamp().range().startOpen(1_000L).endClosed(30_000L).toProto(); + + // open start & closed end are faked in the client by incrementing the query + RowFilter expectedFilter = + RowFilter.newBuilder() + .setTimestampRangeFilter( + TimestampRange.newBuilder() + .setStartTimestampMicros(1_000L + 1) + .setEndTimestampMicros(30_000L + 1)) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueRegex() { + RowFilter actualFilter = FILTERS.value().regex("some[0-9]regex").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setValueRegexFilter(ByteString.copyFromUtf8("some[0-9]regex")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueExactMatch() { + RowFilter actualFilter = + FILTERS.value().exactMatch(ByteString.copyFromUtf8("some[0-9]regex")).toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setValueRegexFilter(ByteString.copyFromUtf8("some\\[0\\-9\\]regex")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueExactStringMatch() { + RowFilter actualFilter = FILTERS.value().exactMatch("some[0-9]regex").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setValueRegexFilter(ByteString.copyFromUtf8("some\\[0\\-9\\]regex")) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueRangeClosedOpen() { + RowFilter actualFilter = FILTERS.value().range().startClosed("begin").endOpen("end").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setValueRangeFilter( + ValueRange.newBuilder() + .setStartValueClosed(ByteString.copyFromUtf8("begin")) + .setEndValueOpen(ByteString.copyFromUtf8("end"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueRangeOpenClosed() { + RowFilter actualFilter = FILTERS.value().range().startOpen("begin").endClosed("end").toProto(); + + RowFilter expectedFilter = + RowFilter.newBuilder() + .setValueRangeFilter( + ValueRange.newBuilder() + .setStartValueOpen(ByteString.copyFromUtf8("begin")) + .setEndValueClosed(ByteString.copyFromUtf8("end"))) + .build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void valueStripTest() { + RowFilter actualFilter = FILTERS.value().strip().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setStripValueTransformer(true).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void offsetCellsPerRowTest() { + RowFilter actualFilter = FILTERS.offset().cellsPerRow(10).toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setCellsPerRowOffsetFilter(10).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void limitCellsPerRowTest() { + RowFilter actualFilter = FILTERS.limit().cellsPerRow(10).toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setCellsPerRowLimitFilter(10).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void limitCellsPerColumnTest() { + RowFilter actualFilter = FILTERS.limit().cellsPerColumn(10).toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setCellsPerColumnLimitFilter(10).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void fromProtoTest() { + RowFilter inner = RowFilter.newBuilder().setRowSampleFilter(0.5).build(); + + RowFilter actualFilter = FILTERS.fromProto(inner).toProto(); + assertThat(actualFilter).isEqualTo(inner); + } + + @Test + public void passTest() { + RowFilter actualFilter = FILTERS.pass().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setPassAllFilter(true).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void blockTest() { + RowFilter actualFilter = FILTERS.block().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setBlockAllFilter(true).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void sinkTest() { + RowFilter actualFilter = FILTERS.sink().toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setSink(true).build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void labelTest() { + RowFilter actualFilter = FILTERS.label("my-label").toProto(); + + RowFilter expectedFilter = RowFilter.newBuilder().setApplyLabelTransformer("my-label").build(); + + assertThat(actualFilter).isEqualTo(expectedFilter); + } + + @Test + public void serializationTest() throws InvocationTargetException, IllegalAccessException { + // checks that the all objects returned by the all methods of the Filters class + // can be serialized/deserialized. + + for (Method m : Filters.class.getDeclaredMethods()) { + String name = m.getName(); + if (Modifier.isPublic(m.getModifiers())) { + switch (name) { + case "condition": + checkSerialization( + name, + FILTERS + .condition( + FILTERS + .chain() + .filter(FILTERS.qualifier().exactMatch("data_plan_10gb")) + .filter(FILTERS.value().exactMatch("true"))) + .then(FILTERS.label("passed-filter")) + .otherwise(FILTERS.label("filtered-out"))); + break; + case "label": + checkSerialization(name, FILTERS.label("label")); + break; + case "fromProto": + checkSerialization(name, FILTERS.label("label").toProto()); + break; + default: + checkSerialization(name, m.invoke(FILTERS)); + } + } + } + } + + private static void checkSerialization(String name, Object filter) { + try { + Object deserialized = serializeDeserialize(filter); + checkClassDeclaresSerialVersionUid(filter.getClass()); + if (filter instanceof Filters.Filter) { + checkFilters(name, (Filters.Filter) filter, (Filters.Filter) deserialized); + } else if (filter instanceof RowFilter) { + assertWithMessage("'" + name + "' deserialized filter differs") + .that(filter) + .isEqualTo(deserialized); + } else { + Class cls = filter.getClass(); + checkClassDoesNotContainNonStaticFields(cls, cls.getFields()); + checkClassDoesNotContainNonStaticFields(cls, cls.getDeclaredFields()); + checkSpawnedFilters(name, cls, filter, deserialized); + } + } catch (IOException | ClassNotFoundException e) { + fail(name + ": " + e); + } + } + + private static void checkFilters( + String name, Filters.Filter original, Filters.Filter deserialized) { + RowFilter protoBefore = ((Filters.Filter) original).toProto(); + RowFilter protoAfter = ((Filters.Filter) deserialized).toProto(); + assertWithMessage("'" + name + "' filter protoBuf mismatches after deserialization") + .that(protoBefore) + .isEqualTo(protoAfter); + } + + private static void checkSpawnedFilters( + String name, Class cls, Object original, Object deserialized) { + + int numberOfMethods = 0; + for (Method m : cls.getDeclaredMethods()) { + if (Modifier.isPublic(m.getModifiers())) { + numberOfMethods++; + } + } + ByteString re = ByteString.copyFromUtf8("some\\[0\\-9\\]regex"); + + switch (name) { + case "family": + { + Filters.FamilyFilter f1 = (Filters.FamilyFilter) original; + Filters.FamilyFilter f2 = (Filters.FamilyFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters(name + "/exactMatch", f1.exactMatch("abc"), f2.exactMatch("abc")); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + + break; + } + case "qualifier": + { + Filters.QualifierFilter f1 = (Filters.QualifierFilter) original; + Filters.QualifierFilter f2 = (Filters.QualifierFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(5); + checkFilters(name + "/exactMatch", f1.exactMatch("abc"), f2.exactMatch("abc")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters( + name + "/rangeWithinFamily", + f1.rangeWithinFamily("family"), + f2.rangeWithinFamily("family")); + + break; + } + case "limit": + { + Filters.LimitFilter f1 = (Filters.LimitFilter) original; + Filters.LimitFilter f2 = (Filters.LimitFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters( + name + "/cellsPerColumn", f1.cellsPerColumn(100500), f2.cellsPerColumn(100500)); + checkFilters(name + "/cellsPerRow", f1.cellsPerRow(-10), f2.cellsPerRow(-10)); + + break; + } + case "value": + { + Filters.ValueFilter f1 = (Filters.ValueFilter) original; + Filters.ValueFilter f2 = (Filters.ValueFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(6); + checkFilters(name + "/exactMatch", f1.exactMatch("x"), f2.exactMatch("x")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/range", f1.range(), f2.range()); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters(name + "/strip", f1.strip(), f2.strip()); + + break; + } + case "offset": + { + Filters.OffsetFilter f1 = (Filters.OffsetFilter) original; + Filters.OffsetFilter f2 = (Filters.OffsetFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(1); + checkFilters(name + "/cellsPerRow", f1.cellsPerRow(100500), f2.cellsPerRow(100500)); + + break; + } + case "key": + { + Filters.KeyFilter f1 = (Filters.KeyFilter) original; + Filters.KeyFilter f2 = (Filters.KeyFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(5); + checkFilters(name + "/exactMatch", f1.exactMatch("a"), f2.exactMatch("a")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/regex", f1.regex("a"), f2.regex("a")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters(name + "/sample", f1.sample(0.1), f2.sample(0.1)); + + break; + } + case "timestamp": + { + Filters.TimestampFilter f1 = (Filters.TimestampFilter) original; + Filters.TimestampFilter f2 = (Filters.TimestampFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters(name + "/exact", f1.exact(100500L), f2.exact(100500L)); + checkFilters(name + "/range", f1.range(), f2.range()); + + break; + } + default: + fail("Untested filter: " + name); + } + } + + private static void checkClassDeclaresSerialVersionUid(Class cls) { + String uid = "serialVersionUID"; + for (Field field : cls.getDeclaredFields()) { + if (uid.equals(field.getName())) { + int modifiers = field.getModifiers(); + assertWithMessage(field + " is not static").that(Modifier.isStatic(modifiers)).isTrue(); + assertWithMessage(field + " is not final").that(Modifier.isFinal(modifiers)).isTrue(); + assertWithMessage(field + " is not private").that(Modifier.isPrivate(modifiers)).isTrue(); + assertWithMessage(field + " must be long") + .that(field.getType().getSimpleName()) + .isEqualTo("long"); + return; + } + } + fail(cls + " does not declare serialVersionUID"); + } + + private static void checkClassDoesNotContainNonStaticFields(Class cls, Field[] fields) { + for (Field field : fields) { + assertWithMessage(cls + " has a non-static field '" + field + "'") + .that(Modifier.isStatic(field.getModifiers())) + .isTrue(); + } + } + + private static Object serializeDeserialize(Object obj) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try (ObjectOutputStream outStream = new ObjectOutputStream(bos)) { + outStream.writeObject(obj); + } + + ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); + try (ObjectInputStream inStream = new ObjectInputStream(bis)) { + return inStream.readObject(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewIdTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewIdTest.java new file mode 100644 index 000000000000..2f944c3ee0ee --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewIdTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MaterializedViewIdTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + private static final String MATERIALIZED_VIEW_ID = "my-materialized-view"; + + @Test + public void testToResourceName() { + MaterializedViewId authorizedViewId = MaterializedViewId.of(MATERIALIZED_VIEW_ID); + + assertThat(authorizedViewId.toResourceName(PROJECT_ID, INSTANCE_ID)) + .isEqualTo( + "projects/my-project/instances/my-instance/materializedViews/my-materialized-view"); + } + + @Test + public void testEquality() { + MaterializedViewId authorizedViewId = MaterializedViewId.of(MATERIALIZED_VIEW_ID); + + assertThat(authorizedViewId).isEqualTo(MaterializedViewId.of(MATERIALIZED_VIEW_ID)); + assertThat(authorizedViewId).isNotEqualTo(MaterializedViewId.of("another-materialized-view")); + } + + @Test + public void testHashCode() { + MaterializedViewId authorizedViewId = MaterializedViewId.of(MATERIALIZED_VIEW_ID); + + assertThat(authorizedViewId.hashCode()) + .isEqualTo(MaterializedViewId.of(MATERIALIZED_VIEW_ID).hashCode()); + assertThat(authorizedViewId.hashCode()) + .isNotEqualTo(MaterializedViewId.of("another-materialized-view").hashCode()); + assertThat(authorizedViewId.hashCode()).isNotEqualTo(TableId.of(TABLE_ID).hashCode()); + } + + @Test + public void testToString() { + MaterializedViewId authorizedViewId = MaterializedViewId.of(MATERIALIZED_VIEW_ID); + + assertThat(authorizedViewId.toString()) + .isEqualTo("MaterializedViewId{materializedViewId=my-materialized-view}"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java new file mode 100644 index 000000000000..3ba1de67011e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java @@ -0,0 +1,307 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Mutation.AddToCell; +import com.google.bigtable.v2.Mutation.DeleteFromColumn; +import com.google.bigtable.v2.Mutation.DeleteFromFamily; +import com.google.bigtable.v2.Mutation.DeleteFromRow; +import com.google.bigtable.v2.Mutation.MergeToCell; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MutationTest { + + private Mutation mutation; + + @Before + public void setUp() { + mutation = Mutation.create(); + } + + @Test + public void setCellTest() { + long minTimestamp = System.currentTimeMillis() * 1_000; + + mutation + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1_000, + ByteString.copyFromUtf8("fake-value")) + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + ByteString.copyFromUtf8("fake-value")) + .setCell("fake-family2", "fake-qualifier2", 1_000, "fake-value2") + .setCell("fake-family2", "fake-qualifier2", "fake-value2"); + + List actual = mutation.getMutations(); + + long maxTimestamp = System.currentTimeMillis() * 1_000; + com.google.common.collect.Range expectedTimestampRange = + com.google.common.collect.Range.closed(minTimestamp, maxTimestamp); + + assertThat(actual).hasSize(4); + + assertThat(actual.get(0).getSetCell().getFamilyName()).isEqualTo("fake-family"); + assertThat(actual.get(0).getSetCell().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(actual.get(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(actual.get(0).getSetCell().getTimestampMicros()).isEqualTo(1_000); + + assertThat(actual.get(1).getSetCell().getFamilyName()).isEqualTo("fake-family"); + assertThat(actual.get(1).getSetCell().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier")); + assertThat(actual.get(1).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(actual.get(1).getSetCell().getTimestampMicros()).isIn(expectedTimestampRange); + + assertThat(actual.get(2).getSetCell().getFamilyName()).isEqualTo("fake-family2"); + assertThat(actual.get(2).getSetCell().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier2")); + assertThat(actual.get(2).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value2")); + assertThat(actual.get(2).getSetCell().getTimestampMicros()).isEqualTo(1_000); + + assertThat(actual.get(3).getSetCell().getFamilyName()).isEqualTo("fake-family2"); + assertThat(actual.get(3).getSetCell().getColumnQualifier()) + .isEqualTo(ByteString.copyFromUtf8("fake-qualifier2")); + assertThat(actual.get(3).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value2")); + assertThat(actual.get(3).getSetCell().getTimestampMicros()).isIn(expectedTimestampRange); + + assertThat(Mutation.fromProtoUnsafe(actual).getMutations()).isEqualTo(actual); + } + + @Test + public void setCellWithServerSideTimestamp() { + Mutation mutation = Mutation.createUnsafe(); + mutation.setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Mutation.SERVER_SIDE_TIMESTAMP, + ByteString.copyFromUtf8("fake-value")); + List actual = mutation.getMutations(); + assertThat(actual.get(0).getSetCell().getTimestampMicros()) + .isEqualTo(Mutation.SERVER_SIDE_TIMESTAMP); + } + + @Test + public void deleteColumnTest() { + mutation + .deleteCells("fake-family", "fake-qualifier") + .deleteCells("fake-family2", ByteString.copyFromUtf8("fake-qualifier2")) + .deleteCells( + "fake-family3", + ByteString.copyFromUtf8("fake-qualifier3"), + TimestampRange.create(1000L, 2000L)); + + List actual = mutation.getMutations(); + + assertThat(actual) + .containsExactly( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier"))) + .build(), + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("fake-family2") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier2"))) + .build(), + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromColumn( + DeleteFromColumn.newBuilder() + .setFamilyName("fake-family3") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier3")) + .setTimeRange( + com.google.bigtable.v2.TimestampRange.newBuilder() + .setStartTimestampMicros(1000) + .setEndTimestampMicros(2000))) + .build()); + } + + @Test + public void deleteFamilyTest() { + mutation.deleteFamily("fake-family1").deleteFamily("fake-family2"); + + List actual = mutation.getMutations(); + + assertThat(actual) + .containsExactly( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromFamily(DeleteFromFamily.newBuilder().setFamilyName("fake-family1")) + .build(), + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromFamily(DeleteFromFamily.newBuilder().setFamilyName("fake-family2")) + .build()); + } + + @Test + public void deleteRowTest() { + mutation.deleteRow(); + List actual = mutation.getMutations(); + + assertThat(actual) + .containsExactly( + com.google.bigtable.v2.Mutation.newBuilder() + .setDeleteFromRow(DeleteFromRow.getDefaultInstance()) + .build()); + } + + @Test + public void addToCellTest() { + mutation.addToCell("cf1", "q", 10000, 1234); + List actual = mutation.getMutations(); + + com.google.bigtable.v2.Mutation.Builder builder = com.google.bigtable.v2.Mutation.newBuilder(); + AddToCell.Builder addToCellBuilder = builder.getAddToCellBuilder(); + addToCellBuilder.setFamilyName("cf1"); + addToCellBuilder.getColumnQualifierBuilder().setRawValue(ByteString.copyFromUtf8("q")); + addToCellBuilder.getTimestampBuilder().setRawTimestampMicros(10000); + addToCellBuilder.getInputBuilder().setIntValue(1234); + + assertThat(actual).containsExactly(builder.build()); + } + + @Test + public void mergeToCellTest() { + mutation.mergeToCell("cf1", "q", 10000, ByteString.copyFrom(Longs.toByteArray(1234L))); + List actual = mutation.getMutations(); + + com.google.bigtable.v2.Mutation.Builder builder = com.google.bigtable.v2.Mutation.newBuilder(); + MergeToCell.Builder mergeToCellBuilder = builder.getMergeToCellBuilder(); + mergeToCellBuilder.setFamilyName("cf1"); + mergeToCellBuilder.getColumnQualifierBuilder().setRawValue(ByteString.copyFromUtf8("q")); + mergeToCellBuilder.getTimestampBuilder().setRawTimestampMicros(10000); + mergeToCellBuilder.getInputBuilder().setRawValue(ByteString.copyFrom(Longs.toByteArray(1234L))); + + assertThat(actual).containsExactly(builder.build()); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + Mutation expected = Mutation.create().setCell("cf", "q", "val"); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + Mutation actual = (Mutation) ois.readObject(); + assertThat(actual.getMutations()).isEqualTo(expected.getMutations()); + } + + @Test + public void tooManyMutationsTest() { + Mutation mutation = Mutation.create(); + + for (int i = 0; i < Mutation.MAX_MUTATIONS; i++) { + mutation.setCell("f", "", ""); + } + + Exception actualError = null; + + try { + mutation.setCell("f", "", ""); + } catch (Exception e) { + actualError = e; + } + + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void tooLargeRequest() { + Mutation mutation = Mutation.create(); + + Exception actualError = null; + + try { + mutation.setCell( + "f", ByteString.copyFromUtf8(""), ByteString.copyFrom(new byte[Mutation.MAX_BYTE_SIZE])); + } catch (Exception e) { + actualError = e; + } + + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testWithLongValue() { + Mutation mutation = + Mutation.create() + .setCell("fake-family", "fake-qualifier", 100_000L) + .setCell("fake-family", ByteString.copyFromUtf8("test-qualifier"), 100_000L) + .setCell("fake-family", "fake-qualifier", 30_000L, 20000L); + + List mutations = mutation.getMutations(); + + assertThat(mutations.size()).isEqualTo(3); + com.google.bigtable.v2.Mutation actualMutation = mutations.get(0); + + assertThat(actualMutation.getSetCell().getValue()) + .isEqualTo(ByteString.copyFrom(Longs.toByteArray(100_000L))); + + assertThat(mutations.get(2).getSetCell()) + .isEqualTo( + com.google.bigtable.v2.Mutation.SetCell.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setTimestampMicros(30_000L) + .setValue(ByteString.copyFrom(Longs.toByteArray(20_000L))) + .build()); + } + + @Test + public void fromProtoTest() { + mutation + .setCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1_000, + ByteString.copyFromUtf8("fake-value")) + .deleteCells("fake-family", ByteString.copyFromUtf8("fake-qualifier")) + .deleteFamily("fake-family2") + .addToCell("agg-family", "qual1", 1000, 1234) + .mergeToCell("agg-family", "qual2", 1000, ByteString.copyFrom(Longs.toByteArray(1234L))); + + List protoMutation = mutation.getMutations(); + + assertThat(Mutation.fromProto(protoMutation).getMutations()).isEqualTo(protoMutation); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java new file mode 100644 index 000000000000..b7c394eb1539 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java @@ -0,0 +1,969 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.RowSet; +import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSortedSet; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; +import java.util.SortedSet; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class QueryTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final AuthorizedViewId AUTHORIZED_VIEW_ID = + AuthorizedViewId.of(TABLE_ID, "fake-authorized-view"); + private static final String APP_PROFILE_ID = "fake-profile-id"; + private RequestContext requestContext; + + @Before + public void setUp() { + requestContext = RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + } + + @Test + public void requestContextTest() { + // Table query test. + Query query = Query.create(TABLE_ID); + ReadRowsRequest proto = query.toProto(requestContext); + assertThat(proto).isEqualTo(expectedReadFromTableProtoBuilder().build()); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID); + proto = query.toProto(requestContext); + assertThat(proto).isEqualTo(expectedReadFromAuthorizedViewProtoBuilder().build()); + } + + @Test + public void rowKeysTest() { + // Table query test. + Query query = + Query.create(TABLE_ID) + .rowKey("simple-string") + .rowKey(ByteString.copyFromUtf8("byte-string")); + + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowKeys(ByteString.copyFromUtf8("simple-string")) + .addRowKeys(ByteString.copyFromUtf8("byte-string")); + + ReadRowsRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = + Query.create(AUTHORIZED_VIEW_ID) + .rowKey("simple-string") + .rowKey(ByteString.copyFromUtf8("byte-string")); + + expectedProto = expectedReadFromAuthorizedViewProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowKeys(ByteString.copyFromUtf8("simple-string")) + .addRowKeys(ByteString.copyFromUtf8("byte-string")); + + actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void rowRangeTest() { + // Table query test. + Query query = + Query.create(TABLE_ID) + .range("simple-begin", "simple-end") + .range(ByteString.copyFromUtf8("byte-begin"), ByteString.copyFromUtf8("byte-end")) + .range(ByteStringRange.create("range-begin", "range-end")); + + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("simple-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("simple-end"))) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("byte-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("byte-end"))) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("range-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("range-end"))); + + ReadRowsRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = + Query.create(AUTHORIZED_VIEW_ID) + .range("simple-begin", "simple-end") + .range(ByteString.copyFromUtf8("byte-begin"), ByteString.copyFromUtf8("byte-end")) + .range(ByteStringRange.create("range-begin", "range-end")); + + expectedProto = expectedReadFromAuthorizedViewProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("simple-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("simple-end"))) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("byte-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("byte-end"))) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("range-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("range-end"))); + + actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void filterTestWithExceptions() { + // Table query test. + Exception actualException = null; + try { + Query.create(TABLE_ID).filter(null); + } catch (Exception ex) { + actualException = ex; + } + assertThat(actualException).isInstanceOf(NullPointerException.class); + + actualException = null; + int maxFilterSize = 20 * 1024; + ByteString largeValue = ByteString.copyFrom(new byte[maxFilterSize + 1]); + + try { + Query.create(TABLE_ID).filter(FILTERS.value().exactMatch(largeValue)); + } catch (Exception ex) { + actualException = ex; + } + assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20KB"); + + // AuthorizedView query test. + actualException = null; + try { + Query.create(AUTHORIZED_VIEW_ID).filter(null); + } catch (Exception ex) { + actualException = ex; + } + assertThat(actualException).isInstanceOf(NullPointerException.class); + + actualException = null; + try { + Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.value().exactMatch(largeValue)); + } catch (Exception ex) { + actualException = ex; + } + assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20KB"); + } + + @Test + public void filterTest() { + // Table query test. + Query query = Query.create(TABLE_ID).filter(FILTERS.key().regex(".*")); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder() + .setFilter(RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))); + + ReadRowsRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.key().regex(".*")); + + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setFilter(RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))); + + actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void limitTest() { + // Table query test. + Query query = Query.create(TABLE_ID).limit(10); + + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder().setRowsLimit(10); + + ReadRowsRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).limit(10); + + expectedProto = expectedReadFromAuthorizedViewProtoBuilder().setRowsLimit(10); + + actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // Table query test. + Query expected = Query.create(TABLE_ID).filter(FILTERS.key().regex(".*")); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + Query actual = (Query) ois.readObject(); + assertThat(actual.toProto(requestContext)).isEqualTo(expected.toProto(requestContext)); + + // AuthorizedView query test. + expected = Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.key().regex(".*")); + + bos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + actual = (Query) ois.readObject(); + assertThat(actual.toProto(requestContext)).isEqualTo(expected.toProto(requestContext)); + } + + @Test + public void shardTestSplitPoints() { + // Table query test. + Query query = Query.create(TABLE_ID).range("a", "z"); + + SortedSet splitPoints = + ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) + .add(ByteString.copyFromUtf8("j")) + .build(); + + List subQueries = query.shard(splitPoints); + + assertThat(subQueries).hasSize(2); + assertThat(subQueries.get(0).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) + .build()); + assertThat(subQueries.get(1).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")))) + .build()); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).range("a", "z"); + + subQueries = query.shard(splitPoints); + + assertThat(subQueries).hasSize(2); + assertThat(subQueries.get(0).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) + .build()); + assertThat(subQueries.get(1).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")))) + .build()); + } + + @Test + public void shardTestKeyOffsets() { + // Table query test. + Query query = Query.create(TABLE_ID).range("a", "z"); + + List keyOffsets = + ImmutableList.of( + KeyOffset.create(ByteString.copyFromUtf8("j"), 10), + KeyOffset.create(ByteString.EMPTY, 100)); + + List subQueries = query.shard(keyOffsets); + + assertThat(subQueries).hasSize(2); + assertThat(subQueries.get(0).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) + .build()); + assertThat(subQueries.get(1).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")))) + .build()); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).range("a", "z"); + + subQueries = query.shard(keyOffsets); + + assertThat(subQueries).hasSize(2); + assertThat(subQueries.get(0).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) + .build()); + assertThat(subQueries.get(1).toProto(requestContext)) + .isEqualTo( + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")))) + .build()); + } + + private static ReadRowsRequest.Builder expectedReadFromTableProtoBuilder() { + return ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID); + } + + private static ReadRowsRequest.Builder expectedReadFromAuthorizedViewProtoBuilder() { + return ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID); + } + + @Test + public void testFromProto() { + // Table query test. + ReadRowsRequest request = + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setFilter(RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))) + .setRows( + RowSet.newBuilder() + .addRowKeys(ByteString.copyFromUtf8("row-key")) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyClosed(ByteString.copyFromUtf8("z")))) + .build(); + Query query = Query.fromProto(request); + + assertThat(query.toProto(requestContext)).isEqualTo(request); + + // AuthorizedView query test. + request = + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setFilter(RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))) + .setRows( + RowSet.newBuilder() + .addRowKeys(ByteString.copyFromUtf8("row-key")) + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("j")) + .setEndKeyClosed(ByteString.copyFromUtf8("z")))) + .build(); + query = Query.fromProto(request); + + assertThat(query.toProto(requestContext)).isEqualTo(request); + } + + @Test + public void testFromProtoWithInvalidTableId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + Query.fromProto( + ReadRowsRequest.getDefaultInstance().toBuilder() + .setTableName("invalid-name") + .build())); + + assertThat(e).hasMessageThat().startsWith("Invalid table name:"); + } + + @Test + public void testFromProtoWithInvalidAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + Query.fromProto( + ReadRowsRequest.getDefaultInstance().toBuilder() + .setAuthorizedViewName("invalid-name") + .build())); + + assertThat(e).hasMessageThat().startsWith("Invalid authorized view name:"); + } + + @Test + public void testFromProtoWithEmptyTableAndAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> Query.fromProto(ReadRowsRequest.getDefaultInstance())); + assertThat(e) + .hasMessageThat() + .startsWith( + "Either table name, authorized view name or materialized view name must be specified."); + } + + @Test + public void testFromProtoWithBothTableAndAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + Query.fromProto( + ReadRowsRequest.getDefaultInstance().toBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .build())); + + assertThat(e) + .hasMessageThat() + .startsWith( + "Only one of table name, authorized view name and materialized view name can be" + + " specified at the same time"); + } + + @Test + public void testEquality() { + // Table query test. + Query request = + Query.create(TABLE_ID) + .rowKey("row-key") + .range("a", "z") + .limit(3) + .filter(FILTERS.family().exactMatch("test")); + + // Query#toProto should not change the Query instance state + request.toProto(requestContext); + assertThat(request) + .isEqualTo( + Query.create(TABLE_ID) + .rowKey("row-key") + .range("a", "z") + .limit(3) + .filter(FILTERS.family().exactMatch("test"))); + + assertThat(Query.create(TABLE_ID).rowKey("row-key")) + .isNotEqualTo(Query.create(TABLE_ID).rowKey("row-key-1")); + assertThat(Query.create(TABLE_ID).range("a", "z")) + .isNotEqualTo(Query.create(TABLE_ID).range("a", "s")); + assertThat(Query.create(TABLE_ID).filter(FILTERS.family().regex("test"))) + .isNotEqualTo(Query.create(TABLE_ID).filter(FILTERS.family().exactMatch("test-one"))); + assertThat(Query.create(TABLE_ID).limit(4)).isNotEqualTo(Query.create(TABLE_ID).limit(5)); + + // AuthorizedView query test. + request = + Query.create(AUTHORIZED_VIEW_ID) + .rowKey("row-key") + .range("a", "z") + .limit(3) + .filter(FILTERS.family().exactMatch("test")); + + // Query#toProto should not change the Query instance state + request.toProto(requestContext); + assertThat(request) + .isEqualTo( + Query.create(AUTHORIZED_VIEW_ID) + .rowKey("row-key") + .range("a", "z") + .limit(3) + .filter(FILTERS.family().exactMatch("test"))); + + assertThat(Query.create(AUTHORIZED_VIEW_ID).rowKey("row-key")) + .isNotEqualTo(Query.create(AUTHORIZED_VIEW_ID).rowKey("row-key-1")); + assertThat(Query.create(AUTHORIZED_VIEW_ID).range("a", "z")) + .isNotEqualTo(Query.create(AUTHORIZED_VIEW_ID).range("a", "s")); + assertThat(Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.family().regex("test"))) + .isNotEqualTo( + Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.family().exactMatch("test-one"))); + assertThat(Query.create(AUTHORIZED_VIEW_ID).limit(4)) + .isNotEqualTo(Query.create(AUTHORIZED_VIEW_ID).limit(5)); + + assertThat(Query.create(AUTHORIZED_VIEW_ID)).isNotEqualTo(Query.create(TABLE_ID)); + } + + @Test + public void testClone() { + // Table query test. + Query query = Query.create(TABLE_ID).filter(FILTERS.key().regex("temp")).limit(10); + ReadRowsRequest request = + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowsLimit(10) + .setFilter( + RowFilter.newBuilder() + .setRowKeyRegexFilter(ByteString.copyFromUtf8("temp")) + .build()) + .build(); + + Query clonedReq = query.clone(); + assertThat(clonedReq).isEqualTo(query); + assertThat(clonedReq.toProto(requestContext)).isEqualTo(request); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).filter(FILTERS.key().regex("temp")).limit(10); + request = + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowsLimit(10) + .setFilter( + RowFilter.newBuilder() + .setRowKeyRegexFilter(ByteString.copyFromUtf8("temp")) + .build()) + .build(); + + clonedReq = query.clone(); + assertThat(clonedReq).isEqualTo(query); + assertThat(clonedReq.toProto(requestContext)).isEqualTo(request); + } + + @Test + public void testQueryPaginatorRangeLimitReached() { + // Table query test. + int chunkSize = 10, limit = 15; + Query query = Query.create(TABLE_ID).range("a", "z").limit(limit); + Query.QueryPaginator paginator = query.createPaginator(chunkSize); + + Query nextQuery = paginator.getNextQuery(); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + int expectedLimit = limit - chunkSize; + nextQuery = paginator.getNextQuery(); + expectedProto = + expectedReadFromTableProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(expectedLimit); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("d"))).isFalse(); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).range("a", "z").limit(limit); + paginator = query.createPaginator(chunkSize); + + nextQuery = paginator.getNextQuery(); + + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + nextQuery = paginator.getNextQuery(); + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(expectedLimit); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("d"))).isFalse(); + } + + @Test + public void testQueryPaginatorRangeLimitMultiplyOfChunkSize() { + int chunkSize = 10, limit = 20; + + // Table query test. + Query query = Query.create(TABLE_ID).range("a", "z").limit(limit); + Query.QueryPaginator paginator = query.createPaginator(chunkSize); + + Query nextQuery = paginator.getNextQuery(); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + int expectedLimit = limit - chunkSize; + nextQuery = paginator.getNextQuery(); + expectedProto = + expectedReadFromTableProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(expectedLimit); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("d"))).isFalse(); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).range("a", "z").limit(limit); + paginator = query.createPaginator(chunkSize); + + nextQuery = paginator.getNextQuery(); + + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + nextQuery = paginator.getNextQuery(); + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(expectedLimit); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("d"))).isFalse(); + } + + @Test + public void testQueryPaginatorRagneNoLimit() { + int chunkSize = 10; + + // Table query test. + Query query = Query.create(TABLE_ID).range("a", "z"); + Query.QueryPaginator paginator = query.createPaginator(chunkSize); + + Query nextQuery = paginator.getNextQuery(); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + nextQuery = paginator.getNextQuery(); + expectedProto + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("z"))).isFalse(); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).range("a", "z"); + paginator = query.createPaginator(chunkSize); + + nextQuery = paginator.getNextQuery(); + + expectedProto = + expectedReadFromAuthorizedViewProtoBuilder() + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("a")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isTrue(); + nextQuery = paginator.getNextQuery(); + expectedProto + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder() + .setStartKeyOpen(ByteString.copyFromUtf8("c")) + .setEndKeyOpen(ByteString.copyFromUtf8("z")) + .build())) + .setRowsLimit(chunkSize); + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("z"))).isFalse(); + } + + @Test + public void testQueryPaginatorRowsNoLimit() { + int chunkSize = 10; + + // Table query test. + Query query = Query.create(TABLE_ID).rowKey("a").rowKey("b").rowKey("c"); + + Query.QueryPaginator paginator = query.createPaginator(chunkSize); + + Query nextQuery = paginator.getNextQuery(); + + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowKeys(ByteString.copyFromUtf8("a")) + .addRowKeys(ByteString.copyFromUtf8("b")) + .addRowKeys(ByteString.copyFromUtf8("c")); + expectedProto.setRowsLimit(chunkSize); + + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + paginator.advance(ByteString.copyFromUtf8("b")); + nextQuery = paginator.getNextQuery(); + expectedProto = expectedReadFromTableProtoBuilder(); + expectedProto.getRowsBuilder().addRowKeys(ByteString.copyFromUtf8("c")); + expectedProto.setRowsLimit(chunkSize); + + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isFalse(); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID).rowKey("a").rowKey("b").rowKey("c"); + + paginator = query.createPaginator(chunkSize); + + nextQuery = paginator.getNextQuery(); + + expectedProto = expectedReadFromAuthorizedViewProtoBuilder(); + expectedProto + .getRowsBuilder() + .addRowKeys(ByteString.copyFromUtf8("a")) + .addRowKeys(ByteString.copyFromUtf8("b")) + .addRowKeys(ByteString.copyFromUtf8("c")); + expectedProto.setRowsLimit(chunkSize); + + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + paginator.advance(ByteString.copyFromUtf8("b")); + nextQuery = paginator.getNextQuery(); + expectedProto = expectedReadFromAuthorizedViewProtoBuilder(); + expectedProto.getRowsBuilder().addRowKeys(ByteString.copyFromUtf8("c")); + expectedProto.setRowsLimit(chunkSize); + + assertThat(nextQuery.toProto(requestContext)).isEqualTo(expectedProto.build()); + + assertThat(paginator.advance(ByteString.copyFromUtf8("c"))).isFalse(); + } + + @Test + public void testQueryPaginatorFullTableScan() { + int chunkSize = 10; + + // Table query test. + Query query = Query.create(TABLE_ID); + Query.QueryPaginator queryPaginator = query.createPaginator(chunkSize); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder().setRowsLimit(chunkSize); + assertThat(queryPaginator.getNextQuery().toProto(requestContext)) + .isEqualTo(expectedProto.build()); + + assertThat(queryPaginator.advance(ByteString.copyFromUtf8("a"))).isTrue(); + expectedProto + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("a")).build())) + .setRowsLimit(chunkSize); + assertThat(queryPaginator.getNextQuery().toProto(requestContext)) + .isEqualTo(expectedProto.build()); + + assertThat(queryPaginator.advance(ByteString.copyFromUtf8("a"))).isFalse(); + + // AuthorizedView query test. + query = Query.create(AUTHORIZED_VIEW_ID); + queryPaginator = query.createPaginator(chunkSize); + + expectedProto = expectedReadFromAuthorizedViewProtoBuilder().setRowsLimit(chunkSize); + assertThat(queryPaginator.getNextQuery().toProto(requestContext)) + .isEqualTo(expectedProto.build()); + + assertThat(queryPaginator.advance(ByteString.copyFromUtf8("a"))).isTrue(); + expectedProto + .setRows( + RowSet.newBuilder() + .addRowRanges( + RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("a")).build())) + .setRowsLimit(chunkSize); + assertThat(queryPaginator.getNextQuery().toProto(requestContext)) + .isEqualTo(expectedProto.build()); + + assertThat(queryPaginator.advance(ByteString.copyFromUtf8("a"))).isFalse(); + } + + @Test + public void testQueryPaginatorEmptyTable() { + int chunkSize = 10; + Query query = Query.create(TABLE_ID); + Query.QueryPaginator queryPaginator = query.createPaginator(chunkSize); + + ReadRowsRequest.Builder expectedProto = + expectedReadFromTableProtoBuilder().setRowsLimit(chunkSize); + assertThat(queryPaginator.getNextQuery().toProto(requestContext)) + .isEqualTo(expectedProto.build()); + + assertThat(queryPaginator.advance(ByteString.EMPTY)).isFalse(); + } + + @Test + public void testQueryReversed() { + Query query = Query.create(TABLE_ID).reversed(true); + assertThat(query.toProto(requestContext)) + .isEqualTo(expectedReadFromTableProtoBuilder().setReversed(true).build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java new file mode 100644 index 000000000000..6baea360993c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java @@ -0,0 +1,320 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.models.Range.BoundType; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RangeTest { + @Test + public void timestampUnboundedTest() { + TimestampRange range = TimestampRange.unbounded(); + assertThat(range.getStartBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.getEndBound()).isEqualTo(BoundType.UNBOUNDED); + + Throwable actualError = null; + try { + //noinspection ResultOfMethodCallIgnored + range.getStart(); + } catch (Throwable e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalStateException.class); + + try { + //noinspection ResultOfMethodCallIgnored + range.getEnd(); + } catch (Throwable e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void timestampOfTest() { + TimestampRange range = TimestampRange.create(10, 2_000); + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(10); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(2_000); + } + + @Test + public void timestampChangeStartTest() { + TimestampRange range = TimestampRange.create(10, 2_000).startOpen(20L); + + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(2_000); + + assertThat(range.getStartBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getStart()).isEqualTo(20); + + range = range.startClosed(30L); + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(30); + } + + @Test + public void timestampChangeEndTest() { + TimestampRange range = TimestampRange.create(10, 2_000).endClosed(1_000L); + + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(10); + + assertThat(range.getEndBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getEnd()).isEqualTo(1_000); + + range = range.endOpen(3_000L); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(3_000); + } + + @Test + public void timestampCloneTest() { + TimestampRange range = TimestampRange.create(10, 2_000); + TimestampRange rangeSame = range.endClosed(3_000L); + TimestampRange rangeClone = range.clone().endClosed(4_000L); + + assertThat(range.getEnd()).isEqualTo(3_000); + assertThat(rangeSame.getEnd()).isEqualTo(3_000); + assertThat(rangeClone.getEnd()).isEqualTo(4_000); + } + + @Test + public void timestampEqualsTest() { + TimestampRange r1 = TimestampRange.create(1, 10); + TimestampRange r2 = TimestampRange.create(1, 10); + TimestampRange r3 = TimestampRange.create(2, 20); + + assertThat(r1).isEqualTo(r2); + assertThat(r2).isEqualTo(r1); + assertThat(r1).isNotEqualTo(r3); + } + + @Test + public void timestampSerializationTest() throws IOException, ClassNotFoundException { + TimestampRange expected = TimestampRange.create(10, 20); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + TimestampRange actual = (TimestampRange) ois.readObject(); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void byteStringUnboundedTest() { + ByteStringRange range = ByteStringRange.unbounded(); + assertThat(range.getStartBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.getEndBound()).isEqualTo(BoundType.UNBOUNDED); + + Throwable actualError = null; + try { + range.getStart(); + } catch (Throwable e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalStateException.class); + + try { + range.getEnd(); + } catch (Throwable e) { + actualError = e; + } + assertThat(actualError).isInstanceOf(IllegalStateException.class); + } + + @Test + public void byteStringOfTest() { + ByteStringRange range = + ByteStringRange.create(ByteString.copyFromUtf8("a"), ByteString.copyFromUtf8("b")); + + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("a")); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("b")); + } + + @Test + public void byteStringOfStringTest() { + ByteStringRange range = ByteStringRange.create("a", "b"); + + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("a")); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("b")); + } + + @Test + public void byteStringPrefixTest() { + assertThat(ByteStringRange.prefix("a")).isEqualTo(ByteStringRange.create("a", "b")); + + assertThat(ByteStringRange.prefix("ab")).isEqualTo(ByteStringRange.create("ab", "ac")); + + ByteString prefix2 = ByteString.copyFrom(new byte[] {'a', (byte) 0xFF}); + + assertThat(ByteStringRange.prefix(prefix2)) + .isEqualTo(ByteStringRange.create(prefix2, ByteString.copyFromUtf8("b"))); + + ByteString prefix3 = ByteString.copyFrom(new byte[] {(byte) 0xFF, (byte) 0xFF}); + + assertThat(ByteStringRange.prefix(prefix3)) + .isEqualTo(ByteStringRange.unbounded().startClosed(prefix3)); + + assertThat(ByteStringRange.prefix(ByteString.EMPTY)).isEqualTo(ByteStringRange.unbounded()); + } + + @Test + public void byteStringChangeStartTest() { + ByteStringRange range = + ByteStringRange.create(ByteString.copyFromUtf8("a"), ByteString.copyFromUtf8("z")) + .startOpen(ByteString.copyFromUtf8("b")); + + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("z")); + + assertThat(range.getStartBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("b")); + + range = range.startClosed(ByteString.copyFromUtf8("c")); + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("c")); + + assertThat(range.startOpen(ByteString.EMPTY).getStartBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.startClosed(ByteString.EMPTY).getStartBound()).isEqualTo(BoundType.UNBOUNDED); + } + + @Test + public void byteStringChangeStartStringTest() { + ByteStringRange range = ByteStringRange.create("a", "z").startOpen("b"); + + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("z")); + + assertThat(range.getStartBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("b")); + + range = range.startClosed("c"); + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("c")); + + assertThat(range.startOpen("").getStartBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.startClosed("").getStartBound()).isEqualTo(BoundType.UNBOUNDED); + } + + @Test + public void byteStringChangeEndTest() { + ByteStringRange range = + ByteStringRange.create(ByteString.copyFromUtf8("a"), ByteString.copyFromUtf8("z")) + .endClosed(ByteString.copyFromUtf8("y")); + + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("a")); + + assertThat(range.getEndBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("y")); + + range = range.endOpen(ByteString.copyFromUtf8("x")); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("x")); + + assertThat(range.endOpen(ByteString.EMPTY).getEndBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.endClosed(ByteString.EMPTY).getEndBound()).isEqualTo(BoundType.UNBOUNDED); + } + + @Test + public void byteStringChangeEndStringTest() { + ByteStringRange range = ByteStringRange.create("a", "z").endClosed("y"); + + assertThat(range.getStartBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getStart()).isEqualTo(ByteString.copyFromUtf8("a")); + + assertThat(range.getEndBound()).isEqualTo(BoundType.CLOSED); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("y")); + + range = range.endOpen("x"); + assertThat(range.getEndBound()).isEqualTo(BoundType.OPEN); + assertThat(range.getEnd()).isEqualTo(ByteString.copyFromUtf8("x")); + + assertThat(range.endOpen("").getEndBound()).isEqualTo(BoundType.UNBOUNDED); + assertThat(range.endClosed("").getEndBound()).isEqualTo(BoundType.UNBOUNDED); + } + + @Test + public void byteStringCloneTest() { + ByteStringRange range = ByteStringRange.create("a", "original"); + ByteStringRange rangeSame = range.endClosed("sameInstance"); + ByteStringRange rangeClone = range.clone().endClosed("cloneInstance"); + + assertThat(range.getEnd().toStringUtf8()).isEqualTo("sameInstance"); + assertThat(rangeSame.getEnd().toStringUtf8()).isEqualTo("sameInstance"); + assertThat(rangeClone.getEnd().toStringUtf8()).isEqualTo("cloneInstance"); + } + + @Test + public void byteStringEqualsTest() { + ByteStringRange r1 = ByteStringRange.create("a", "c"); + ByteStringRange r2 = ByteStringRange.create("a", "c"); + ByteStringRange r3 = ByteStringRange.create("q", "z"); + + assertThat(r1).isEqualTo(r2); + assertThat(r2).isEqualTo(r1); + assertThat(r1).isNotEqualTo(r3); + } + + @Test + public void byteStringSerializationTest() throws IOException, ClassNotFoundException { + ByteStringRange expected = ByteStringRange.create("a", "z"); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + ByteStringRange actual = (ByteStringRange) ois.readObject(); + assertThat(actual).isEqualTo(expected); + } + + @Test + public void byteStringRangeToByteStringTest() throws InvalidProtocolBufferException { + ByteStringRange expected = ByteStringRange.create("a", "z"); + + ByteString serialized = ByteStringRange.serializeToByteString(expected); + ByteStringRange deserialized = ByteStringRange.toByteStringRange(serialized); + + assertThat(deserialized).isEqualTo(expected); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java new file mode 100644 index 000000000000..a8b9ab502208 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java @@ -0,0 +1,379 @@ +/* + * 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.google.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamContinuationTokens; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.Timestamp; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.time.Instant; +import java.util.Collections; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadChangeStreamQueryTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String TABLE_ID = "fake-table"; + private static final String APP_PROFILE_ID = "fake-profile-id"; + private RequestContext requestContext; + private static final Instant FAKE_START_TIME = Instant.ofEpochSecond(1L, 1000L); + private static final Instant FAKE_END_TIME = Instant.ofEpochSecond(1L, 2000L); + + @Before + public void setUp() { + requestContext = RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + } + + @Test + public void requestContextTest() { + ReadChangeStreamQuery query = ReadChangeStreamQuery.create(TABLE_ID); + + ReadChangeStreamRequest proto = query.toProto(requestContext); + assertThat(proto).isEqualTo(expectedProtoBuilder().build()); + } + + @Test + public void streamPartitionTest() { + // Case 1: String. + ReadChangeStreamQuery query1 = + ReadChangeStreamQuery.create(TABLE_ID).streamPartition("simple-begin", "simple-end"); + ReadChangeStreamRequest actualProto1 = query1.toProto(requestContext); + ReadChangeStreamRequest.Builder expectedProto1 = expectedProtoBuilder(); + expectedProto1.setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("simple-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("simple-end")) + .build()) + .build()); + assertThat(actualProto1).isEqualTo(expectedProto1.build()); + + // Case 2: ByteString. + ReadChangeStreamQuery query2 = + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition( + ByteString.copyFromUtf8("byte-begin"), ByteString.copyFromUtf8("byte-end")); + ReadChangeStreamRequest actualProto2 = query2.toProto(requestContext); + ReadChangeStreamRequest.Builder expectedProto2 = expectedProtoBuilder(); + expectedProto2.setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("byte-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("byte-end")) + .build()) + .build()); + assertThat(actualProto2).isEqualTo(expectedProto2.build()); + + // Case 3: ByteStringRange. + ReadChangeStreamQuery query3 = + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition(ByteStringRange.create("range-begin", "range-end")); + ReadChangeStreamRequest actualProto3 = query3.toProto(requestContext); + ReadChangeStreamRequest.Builder expectedProto3 = expectedProtoBuilder(); + expectedProto3.setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("range-begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("range-end")) + .build()) + .build()); + assertThat(actualProto3).isEqualTo(expectedProto3.build()); + } + + @Test + public void startTimeTest() { + ReadChangeStreamQuery query = ReadChangeStreamQuery.create(TABLE_ID).startTime(FAKE_START_TIME); + + ReadChangeStreamRequest.Builder expectedProto = + expectedProtoBuilder() + .setStartTime( + Timestamp.newBuilder() + .setSeconds(FAKE_START_TIME.getEpochSecond()) + .setNanos(FAKE_START_TIME.getNano())); + + ReadChangeStreamRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void endTimeTest() { + ReadChangeStreamQuery query = ReadChangeStreamQuery.create(TABLE_ID).endTime(FAKE_END_TIME); + + ReadChangeStreamRequest.Builder expectedProto = + expectedProtoBuilder() + .setEndTime( + Timestamp.newBuilder() + .setSeconds(FAKE_END_TIME.getEpochSecond()) + .setNanos(FAKE_END_TIME.getNano())); + + ReadChangeStreamRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void heartbeatDurationTest() { + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create(TABLE_ID).heartbeatDuration(java.time.Duration.ofSeconds(5)); + + ReadChangeStreamRequest.Builder expectedProto = + expectedProtoBuilder().setHeartbeatDuration(Duration.newBuilder().setSeconds(5).build()); + + ReadChangeStreamRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void continuationTokensTest() { + StreamContinuationToken tokenProto = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("start")) + .setEndKeyOpen(ByteString.copyFromUtf8("end")) + .build()) + .build()) + .setToken("random-token") + .build(); + ChangeStreamContinuationToken token = ChangeStreamContinuationToken.fromProto(tokenProto); + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create(TABLE_ID).continuationTokens(Collections.singletonList(token)); + + ReadChangeStreamRequest.Builder expectedProto = + expectedProtoBuilder() + .setContinuationTokens( + StreamContinuationTokens.newBuilder().addTokens(tokenProto).build()); + + ReadChangeStreamRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test + public void createWithStartTimeAndContinuationTokensTest() { + StreamContinuationToken tokenProto = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("start")) + .setEndKeyOpen(ByteString.copyFromUtf8("end")) + .build()) + .build()) + .setToken("random-token") + .build(); + ChangeStreamContinuationToken token = ChangeStreamContinuationToken.fromProto(tokenProto); + IllegalStateException e = + assertThrows( + IllegalStateException.class, + () -> + ReadChangeStreamQuery.create(TABLE_ID) + .startTime(FAKE_START_TIME) + .continuationTokens(Collections.singletonList(token))); + assertThat(e) + .hasMessageThat() + .isEqualTo("startTime and continuationTokens can't be specified together"); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + StreamContinuationToken tokenProto = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("start")) + .setEndKeyOpen(ByteString.copyFromUtf8("end")) + .build()) + .build()) + .setToken("random-token") + .build(); + ChangeStreamContinuationToken token = ChangeStreamContinuationToken.fromProto(tokenProto); + ReadChangeStreamQuery expected = + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition("simple-begin", "simple-end") + .continuationTokens(Collections.singletonList(token)) + .endTime(FAKE_END_TIME) + .heartbeatDuration(java.time.Duration.ofSeconds(5)); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + ReadChangeStreamQuery actual = (ReadChangeStreamQuery) ois.readObject(); + assertThat(actual.toProto(requestContext)).isEqualTo(expected.toProto(requestContext)); + } + + private static ReadChangeStreamRequest.Builder expectedProtoBuilder() { + return ReadChangeStreamRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID); + } + + @Test + public void testFromProto() { + StreamContinuationToken token = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("")) + .build()) + .build()) + .setToken("random-token") + .build(); + ReadChangeStreamRequest request = + ReadChangeStreamRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyClosed(ByteString.copyFromUtf8("")) + .build())) + .setContinuationTokens(StreamContinuationTokens.newBuilder().addTokens(token).build()) + .setEndTime( + Timestamp.newBuilder() + .setSeconds(FAKE_END_TIME.getEpochSecond()) + .setNanos(FAKE_END_TIME.getNano())) + .setHeartbeatDuration(Duration.newBuilder().setSeconds(5).build()) + .build(); + ReadChangeStreamQuery query = ReadChangeStreamQuery.fromProto(request); + assertThat(query.toProto(requestContext)).isEqualTo(request); + } + + @Test + public void testFromProtoWithEmptyTableId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> ReadChangeStreamQuery.fromProto(ReadChangeStreamRequest.getDefaultInstance())); + + assertThat(e).hasMessageThat().startsWith("Invalid table name:"); + } + + @Test + public void testEquality() { + ReadChangeStreamQuery request = + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition("simple-begin", "simple-end") + .startTime(FAKE_START_TIME) + .endTime(FAKE_END_TIME) + .heartbeatDuration(java.time.Duration.ofSeconds(5)); + + // ReadChangeStreamQuery#toProto should not change the ReadChangeStreamQuery instance state + request.toProto(requestContext); + assertThat(request) + .isEqualTo( + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition("simple-begin", "simple-end") + .startTime(FAKE_START_TIME) + .endTime(FAKE_END_TIME) + .heartbeatDuration(java.time.Duration.ofSeconds(5))); + + assertThat(ReadChangeStreamQuery.create(TABLE_ID).streamPartition("begin-1", "end-1")) + .isNotEqualTo(ReadChangeStreamQuery.create(TABLE_ID).streamPartition("begin-2", "end-1")); + assertThat(ReadChangeStreamQuery.create(TABLE_ID).startTime(FAKE_START_TIME)) + .isNotEqualTo( + ReadChangeStreamQuery.create(TABLE_ID).startTime(Instant.ofEpochSecond(1L, 1001L))); + assertThat(ReadChangeStreamQuery.create(TABLE_ID).endTime(FAKE_END_TIME)) + .isNotEqualTo( + ReadChangeStreamQuery.create(TABLE_ID).endTime(Instant.ofEpochSecond(1L, 1001L))); + assertThat( + ReadChangeStreamQuery.create(TABLE_ID) + .heartbeatDuration(java.time.Duration.ofSeconds(5))) + .isNotEqualTo( + ReadChangeStreamQuery.create(TABLE_ID) + .heartbeatDuration(java.time.Duration.ofSeconds(6))); + } + + @Test + public void testClone() { + StreamContinuationToken tokenProto = + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("start")) + .setEndKeyOpen(ByteString.copyFromUtf8("end")) + .build()) + .build()) + .setToken("random-token") + .build(); + ChangeStreamContinuationToken token = ChangeStreamContinuationToken.fromProto(tokenProto); + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create(TABLE_ID) + .streamPartition("begin", "end") + .continuationTokens(Collections.singletonList(token)) + .endTime(FAKE_END_TIME) + .heartbeatDuration(java.time.Duration.ofSeconds(5)); + ReadChangeStreamRequest request = + ReadChangeStreamRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("begin")) + .setEndKeyOpen(ByteString.copyFromUtf8("end")) + .build())) + .setContinuationTokens( + StreamContinuationTokens.newBuilder().addTokens(tokenProto).build()) + .setEndTime( + Timestamp.newBuilder() + .setSeconds(FAKE_END_TIME.getEpochSecond()) + .setNanos(FAKE_END_TIME.getNano())) + .setHeartbeatDuration(Duration.newBuilder().setSeconds(5).build()) + .build(); + + ReadChangeStreamQuery clonedReq = query.clone(); + assertThat(clonedReq).isEqualTo(query); + assertThat(clonedReq.toProto(requestContext)).isEqualTo(request); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java new file mode 100644 index 000000000000..f48178d66f90 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java @@ -0,0 +1,243 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadModifyWriteRowTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final AuthorizedViewId AUTHORIZED_VIEW_ID = + AuthorizedViewId.of(TABLE_ID, "fake-authorized-view"); + private static final String APP_PROFILE_ID = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + + @Test + public void testAppend() { + // Test ReadModifyWriteRow on a table. + ReadModifyWriteRow mutation = + ReadModifyWriteRow.create(TABLE_ID, "fake-key") + .append( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + ByteString.copyFromUtf8("fake-value")) + .append("fake-family", "fake-qualifier-str", "fake-value-str"); + + ReadModifyWriteRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); + + ReadModifyWriteRowRequest expected = + ReadModifyWriteRowRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setAppendValue(ByteString.copyFromUtf8("fake-value"))) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier-str")) + .setAppendValue(ByteString.copyFromUtf8("fake-value-str"))) + .build(); + assertThat(actualProto).isEqualTo(expected); + + // Test ReadModifyWriteRow on an authorized view. + mutation = + ReadModifyWriteRow.create(AUTHORIZED_VIEW_ID, "fake-key") + .append( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + ByteString.copyFromUtf8("fake-value")) + .append("fake-family", "fake-qualifier-str", "fake-value-str"); + + actualProto = mutation.toProto(REQUEST_CONTEXT); + + expected = + ReadModifyWriteRowRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setAppendValue(ByteString.copyFromUtf8("fake-value"))) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier-str")) + .setAppendValue(ByteString.copyFromUtf8("fake-value-str"))) + .build(); + assertThat(actualProto).isEqualTo(expected); + } + + @Test + public void testIncrement() { + // Test ReadModifyWriteRow on a table. + ReadModifyWriteRow mutation = + ReadModifyWriteRow.create(TABLE_ID, "fake-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .increment("fake-family", "fake-qualifier-str", 2); + + ReadModifyWriteRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto) + .isEqualTo( + ReadModifyWriteRowRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setIncrementAmount(1)) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier-str")) + .setIncrementAmount(2)) + .build()); + + // Test ReadModifyWriteRow on an authorized view. + mutation = + ReadModifyWriteRow.create(AUTHORIZED_VIEW_ID, "fake-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .increment("fake-family", "fake-qualifier-str", 2); + + actualProto = mutation.toProto(REQUEST_CONTEXT); + + assertThat(actualProto) + .isEqualTo( + ReadModifyWriteRowRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setIncrementAmount(1)) + .addRules( + ReadModifyWriteRule.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier-str")) + .setIncrementAmount(2)) + .build()); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // Test ReadModifyWriteRow on a table. + ReadModifyWriteRow expected = + ReadModifyWriteRow.create(TABLE_ID, "fake-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .append("fake-family", "a", "b"); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + ReadModifyWriteRow actual = (ReadModifyWriteRow) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + + // Test ReadModifyWriteRow on an authorized view. + expected = + ReadModifyWriteRow.create(AUTHORIZED_VIEW_ID, "fake-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .append("fake-family", "a", "b"); + + bos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + actual = (ReadModifyWriteRow) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + } + + @Test + public void fromProtoTest() { + // Test ReadModifyWriteRow on a table. + ReadModifyWriteRow expected = + ReadModifyWriteRow.create(TABLE_ID, "row-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .append("fake-family", "fake-qualifier", "fake-value"); + + ReadModifyWriteRowRequest protoRequest = expected.toProto(REQUEST_CONTEXT); + ReadModifyWriteRow actualRequest = ReadModifyWriteRow.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + String projectId = "fresh-project"; + String instanceId = "fresh-instance"; + String appProfile = "fresh-app-profile"; + ReadModifyWriteRowRequest overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()) + .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID)); + assertThat(overriddenRequest.getAuthorizedViewName()).isEmpty(); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + + // Test ReadModifyWriteRow on an authorized view. + expected = + ReadModifyWriteRow.create(AUTHORIZED_VIEW_ID, "row-key") + .increment("fake-family", ByteString.copyFromUtf8("fake-qualifier"), 1) + .append("fake-family", "fake-qualifier", "fake-value"); + + protoRequest = expected.toProto(REQUEST_CONTEXT); + actualRequest = ReadModifyWriteRow.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()).isEmpty(); + assertThat(overriddenRequest.getAuthorizedViewName()) + .matches(NameUtil.formatAuthorizedViewName(projectId, instanceId, AUTHORIZED_VIEW_ID)); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java new file mode 100644 index 000000000000..6ee8f1cf3e55 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java @@ -0,0 +1,152 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.*; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import com.google.protobuf.LazyStringArrayList; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowCellTest { + + @Test + public void compareTest() { + ByteString col1 = ByteString.copyFromUtf8("col1"); + long timestamp1 = 1_000; + List labels1 = ImmutableList.of("label1"); + ByteString value1 = ByteString.copyFromUtf8("value1"); + + ByteString col2 = ByteString.copyFromUtf8("col2"); + long timestamp2 = 2_000; + List labels2 = ImmutableList.of("label2"); + ByteString value2 = ByteString.copyFromUtf8("value2"); + + Comparator c = RowCell.compareByNative(); + + // equal + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp1, labels1, value1), + RowCell.create("family1", col1, timestamp1, labels1, value1))) + .isEqualTo(0); + + // equal ignores labels & values + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp1, labels1, value1), + RowCell.create("family1", col1, timestamp1, labels2, value2))) + .isEqualTo(0); + + // family lesser then + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp1, labels1, value1), + RowCell.create("family2", col1, timestamp1, labels1, value1))) + .isEqualTo(-1); + + // family greater then + assertThat( + c.compare( + RowCell.create("family2", col1, timestamp1, labels1, value1), + RowCell.create("family1", col1, timestamp1, labels1, value1))) + .isEqualTo(1); + + // col lesser then + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp1, labels1, value1), + RowCell.create("family1", col2, timestamp1, labels1, value1))) + .isEqualTo(-1); + + // col greater then + assertThat( + c.compare( + RowCell.create("family1", col2, timestamp1, labels1, value1), + RowCell.create("family1", col1, timestamp1, labels1, value1))) + .isEqualTo(1); + + // reverse timestamp lesser then + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp2, labels1, value1), + RowCell.create("family1", col1, timestamp1, labels1, value1))) + .isEqualTo(-1); + + // reverse timestamp greater then + assertThat( + c.compare( + RowCell.create("family1", col1, timestamp1, labels1, value1), + RowCell.create("family1", col1, timestamp2, labels1, value1))) + .isEqualTo(1); + } + + @Test + public void testSerialization() throws IOException, ClassNotFoundException { + LazyStringArrayList lazyListNonEmpty = + new LazyStringArrayList(ImmutableList.of("lazy", "very lazy")); + lazyListNonEmpty.makeImmutable(); + LazyStringArrayList lazyListEmpty = LazyStringArrayList.emptyList(); + lazyListEmpty.makeImmutable(); + List[] labelLists = { + Arrays.asList("str1", "str2", "str3"), + ImmutableList.of("string1", "string2"), + lazyListNonEmpty, + lazyListEmpty + }; + + for (int i = 0; i < labelLists.length; i++) { + String family = "family_" + i; + ByteString col = ByteString.copyFromUtf8("col_" + i); + long timestamp = 1000L * (i + 1); + List labels = labelLists[i]; + ByteString value = ByteString.copyFromUtf8("value_" + i); + RowCell cell = RowCell.create(family, col, timestamp, labels, value); + RowCell deserialized = (RowCell) serializeDeserialize(cell); + + assertThat(cell.getFamily()).isEqualTo(deserialized.getFamily()); + assertThat(cell.getQualifier()).isEqualTo(deserialized.getQualifier()); + assertThat(cell.getTimestamp()).isEqualTo(deserialized.getTimestamp()); + assertThat(cell.getLabels()).isEqualTo(deserialized.getLabels()); + assertThat(cell.getValue()).isEqualTo(deserialized.getValue()); + } + } + + private static Object serializeDeserialize(Object obj) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try (ObjectOutputStream outStream = new ObjectOutputStream(bos)) { + outStream.writeObject(obj); + } + + ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); + try (ObjectInputStream inStream = new ObjectInputStream(bis)) { + return inStream.readObject(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntryTest.java new file mode 100644 index 000000000000..4f616d937937 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntryTest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.Mutation; +import com.google.common.collect.ImmutableList; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowMutationEntryTest { + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + long timestamp = 10_000L; + RowMutationEntry underTest = + RowMutationEntry.create("row-key") + .setCell("fake-family", "qualifier-1", timestamp, "fake-values"); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(underTest); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + RowMutationEntry actual = (RowMutationEntry) ois.readObject(); + assertThat(actual.toProto()).isEqualTo(underTest.toProto()); + } + + @Test + public void toProtoTest() { + long timestamp = 10_000L; + ByteString rowKey = ByteString.copyFromUtf8("row-key"); + RowMutationEntry underTest = + RowMutationEntry.create(rowKey) + .setCell("fake-family", "qualifier-1", timestamp, "fake-values"); + MutateRowsRequest.Entry entry = underTest.toProto(); + assertThat(entry) + .isEqualTo( + MutateRowsRequest.Entry.newBuilder() + .setRowKey(rowKey) + .addMutations( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier-1")) + .setTimestampMicros(timestamp) + .setValue(ByteString.copyFromUtf8("fake-values")))) + .build()); + } + + @Test + public void multipleMutationTest() { + RowMutationEntry rowEntry = + RowMutationEntry.create("row-key") + .setCell("family-1", "qualifier-1", 10_000L, "fake-values") + .deleteCells("family-2", "qualifier-2") + .deleteFamily("family-3"); + + List mutationList = + ImmutableList.of( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName("family-1") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier-1")) + .setTimestampMicros(10_000L) + .setValue(ByteString.copyFromUtf8("fake-values"))) + .build(), + Mutation.newBuilder() + .setDeleteFromColumn( + Mutation.DeleteFromColumn.newBuilder() + .setFamilyName("family-2") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier-2"))) + .build(), + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder().setFamilyName("family-3")) + .build()); + + assertThat(rowEntry.toProto().getMutationsList()).isEqualTo(mutationList); + + rowEntry = RowMutationEntry.create("row-key").deleteRow(); + assertThat(rowEntry.toProto().getMutationsList()).hasSize(1); + assertThat(rowEntry.toProto().getMutationsList().get(0)) + .isEqualTo( + Mutation.newBuilder() + .setDeleteFromRow(Mutation.DeleteFromRow.newBuilder().build()) + .build()); + } + + @Test + public void unsafeMutationTest() { + ByteString rowKey = ByteString.copyFromUtf8("row-key"); + RowMutationEntry rowMutationEntry = + RowMutationEntry.createUnsafe(rowKey) + .setCell("family-1", "qualifier-1", 10_000L, "fake-values") + .deleteFamily("family-2"); + + MutateRowsRequest.Entry entry = rowMutationEntry.toProto(); + assertThat(entry.getMutationsCount()).isEqualTo(2); + assertThat(entry.getMutationsList()) + .isEqualTo( + ImmutableList.of( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName("family-1") + .setColumnQualifier(ByteString.copyFromUtf8("qualifier-1")) + .setTimestampMicros(10_000L) + .setValue(ByteString.copyFromUtf8("fake-values"))) + .build(), + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder().setFamilyName("family-2")) + .build())); + } + + @Test + public void testWithLongValue() { + RowMutationEntry rowMutationEntry = + RowMutationEntry.create("fake-key") + .setCell("fake-family", "fake-qualifier", 100_000L) + .setCell("fake-family", "fake-qualifier", 30_000L, 100_000L); + + MutateRowsRequest.Entry entryMutation = rowMutationEntry.toProto(); + + Mutation.SetCell setCell = entryMutation.getMutations(0).getSetCell(); + assertThat(setCell.getFamilyName()).isEqualTo("fake-family"); + assertThat(setCell.getColumnQualifier().toStringUtf8()).isEqualTo("fake-qualifier"); + assertThat(setCell.getValue()).isEqualTo(ByteString.copyFrom(Longs.toByteArray(100_000L))); + + assertThat(entryMutation.getMutations(1).getSetCell()) + .isEqualTo( + Mutation.SetCell.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setTimestampMicros(30_000L) + .setValue(ByteString.copyFrom(Longs.toByteArray(100_000L))) + .build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java new file mode 100644 index 000000000000..16569ef97e71 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java @@ -0,0 +1,303 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.Mutation.SetCell; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowMutationTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final AuthorizedViewId AUTHORIZED_VIEW_ID = + AuthorizedViewId.of(TABLE_ID, "fake-authorized-view"); + private static final String APP_PROFILE_ID = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + private static final ByteString TEST_KEY = ByteString.copyFromUtf8("fake-key"); + + @Test + public void toProtoTest() { + long timestampMin = System.currentTimeMillis() * 1_000; + + // Test RowMutation on a table. + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", "fake-value"); + + MutateRowRequest actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + com.google.common.collect.Range timestampRange = + com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000); + + assertThat(actualRowMutation.getTableName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(actualRowMutation.getAuthorizedViewName()).isEmpty(); + assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + assertThat(actualRowMutation.getMutationsList()).hasSize(1); + assertThat(actualRowMutation.getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(actualRowMutation.getMutations(0).getSetCell().getTimestampMicros()) + .isIn(timestampRange); + + // Test RowMutation on an authorized view. + rowMutation = + RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", "fake-value"); + + actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + timestampRange = + com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000); + + assertThat(actualRowMutation.getTableName()).isEmpty(); + assertThat(actualRowMutation.getAuthorizedViewName()) + .isEqualTo(NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)); + assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + assertThat(actualRowMutation.getMutationsList()).hasSize(1); + assertThat(actualRowMutation.getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + assertThat(actualRowMutation.getMutations(0).getSetCell().getTimestampMicros()) + .isIn(timestampRange); + } + + @Test + public void toBulkProtoTest() { + long timestampMin = System.currentTimeMillis() * 1_000; + + // Test RowMutation on a table. + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", "fake-value"); + + MutateRowsRequest actualRowMutation = rowMutation.toBulkProto(REQUEST_CONTEXT); + + com.google.common.collect.Range timestampRange = + com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000); + + assertThat(actualRowMutation.getTableName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(actualRowMutation.getAuthorizedViewName()).isEmpty(); + assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + assertThat(actualRowMutation.getEntriesList()).hasSize(1); + assertThat(actualRowMutation.getEntries(0).getMutationsList()).hasSize(1); + assertThat(actualRowMutation.getEntries(0).getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + + assertThat(actualRowMutation.getEntries(0).getMutations(0).getSetCell().getTimestampMicros()) + .isIn(timestampRange); + + // Test RowMutation on an authorized view. + rowMutation = + RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", "fake-value"); + + actualRowMutation = rowMutation.toBulkProto(REQUEST_CONTEXT); + + timestampRange = + com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000); + + assertThat(actualRowMutation.getTableName()).isEmpty(); + assertThat(actualRowMutation.getAuthorizedViewName()) + .isEqualTo(NameUtil.formatAuthorizedViewName(PROJECT_ID, INSTANCE_ID, AUTHORIZED_VIEW_ID)); + assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + assertThat(actualRowMutation.getEntriesList()).hasSize(1); + assertThat(actualRowMutation.getEntries(0).getMutationsList()).hasSize(1); + assertThat(actualRowMutation.getEntries(0).getMutations(0).getSetCell().getValue()) + .isEqualTo(ByteString.copyFromUtf8("fake-value")); + + assertThat(actualRowMutation.getEntries(0).getMutations(0).getSetCell().getTimestampMicros()) + .isIn(timestampRange); + } + + @Test + public void toProtoTestWithProvidedMutation() { + Mutation mutation = Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value"); + // Test RowMutation on a table. + RowMutation rowMutation = RowMutation.create(TABLE_ID, TEST_KEY, mutation); + + MutateRowRequest actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + + assertThat(actualRowMutation.getMutationsList()).isEqualTo(mutation.getMutations()); + + // Test RowMutation on an authorized view. + rowMutation = RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY, mutation); + + actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + + assertThat(actualRowMutation.getMutationsList()).isEqualTo(mutation.getMutations()); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + // Test RowMutation on a table. + RowMutation expected = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", 10_000, "fake-value"); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + RowMutation actual = (RowMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + + // Test RowMutation on an authorized view. + expected = + RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", 10_000, "fake-value"); + + bos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + + actual = (RowMutation) ois.readObject(); + assertThat(actual.toProto(REQUEST_CONTEXT)).isEqualTo(expected.toProto(REQUEST_CONTEXT)); + } + + @Test + public void testWithLongValue() { + // Test RowMutation on a table. + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", 100_000L) + .setCell("fake-family", "fake-qualifier", 30_000L, 100_000L); + + MutateRowRequest actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + + SetCell setCell = actualRowMutation.getMutations(0).getSetCell(); + assertThat(setCell.getFamilyName()).isEqualTo("fake-family"); + assertThat(setCell.getColumnQualifier().toStringUtf8()).isEqualTo("fake-qualifier"); + assertThat(setCell.getValue()).isEqualTo(ByteString.copyFrom(Longs.toByteArray(100_000L))); + + assertThat(actualRowMutation.getMutations(1).getSetCell()) + .isEqualTo( + SetCell.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setTimestampMicros(30_000L) + .setValue(ByteString.copyFrom(Longs.toByteArray(100_000L))) + .build()); + + // Test RowMutation on an authorized view. + rowMutation = + RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier", 100_000L) + .setCell("fake-family", "fake-qualifier", 30_000L, 100_000L); + + actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); + + setCell = actualRowMutation.getMutations(0).getSetCell(); + assertThat(setCell.getFamilyName()).isEqualTo("fake-family"); + assertThat(setCell.getColumnQualifier().toStringUtf8()).isEqualTo("fake-qualifier"); + assertThat(setCell.getValue()).isEqualTo(ByteString.copyFrom(Longs.toByteArray(100_000L))); + + assertThat(actualRowMutation.getMutations(1).getSetCell()) + .isEqualTo( + SetCell.newBuilder() + .setFamilyName("fake-family") + .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier")) + .setTimestampMicros(30_000L) + .setValue(ByteString.copyFrom(Longs.toByteArray(100_000L))) + .build()); + } + + @Test + public void fromProtoTest() { + // Test RowMutation on a table. + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier-1", "fake-value") + .setCell("fake-family", "fake-qualifier-2", 30_000L, "fake-value-2"); + + MutateRowRequest protoRequest = rowMutation.toProto(REQUEST_CONTEXT); + RowMutation actualRequest = RowMutation.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + String projectId = "fresh-project"; + String instanceId = "fresh-instance"; + String appProfile = "fresh-app-profile"; + MutateRowRequest overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()) + .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID)); + assertThat(overriddenRequest.getAuthorizedViewName()).isEmpty(); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + + // Test RowMutation on an authorized view. + rowMutation = + RowMutation.create(AUTHORIZED_VIEW_ID, TEST_KEY) + .setCell("fake-family", "fake-qualifier-1", "fake-value") + .setCell("fake-family", "fake-qualifier-2", 30_000L, "fake-value-2"); + + protoRequest = rowMutation.toProto(REQUEST_CONTEXT); + actualRequest = RowMutation.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()).isEmpty(); + assertThat(overriddenRequest.getAuthorizedViewName()) + .matches(NameUtil.formatAuthorizedViewName(projectId, instanceId, AUTHORIZED_VIEW_ID)); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + } + + @Test + public void toSessionProtoTest() { + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("cf1", "q1", "v1") + .setCell("cf2", "q2", "v2"); + + List mutations = + rowMutation.toProto(REQUEST_CONTEXT).getMutationsList(); + + SessionMutateRowRequest expected = + SessionMutateRowRequest.newBuilder().setKey(TEST_KEY).addAllMutations(mutations).build(); + + SessionMutateRowRequest sessionProto = rowMutation.toSessionProto(); + + assertThat(sessionProto).isEqualTo(expected); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowTest.java new file mode 100644 index 000000000000..b361ff2d0a3b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowTest.java @@ -0,0 +1,165 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowTest { + @Test + public void compareTest() { + Row row1 = + Row.create( + ByteString.copyFromUtf8("key1"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.EMPTY, + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value")))); + Row row2 = + Row.create( + ByteString.copyFromUtf8("key2"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.EMPTY, + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value")))); + Row row2b = + Row.create( + ByteString.copyFromUtf8("key2"), + ImmutableList.of( + RowCell.create( + "family2", + ByteString.EMPTY, + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value")))); + + assertThat(Row.compareByKey().compare(row1, row2)).isEqualTo(-1); + assertThat(Row.compareByKey().compare(row2, row1)).isEqualTo(1); + + // Comparator only cares about row keys + assertThat(Row.compareByKey().compare(row2, row2b)).isEqualTo(0); + } + + @Test + public void serializationTest() throws IOException, ClassNotFoundException { + Row expected = + Row.create( + ByteString.copyFromUtf8("key1"), + ImmutableList.of( + RowCell.create( + "family", + ByteString.EMPTY, + 1000, + ImmutableList.of(), + ByteString.copyFromUtf8("value")))); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(expected); + oos.close(); + + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + assertThat(ois.readObject()).isEqualTo(expected); + } + + @Test + public void getFamilyCellsTest() { + ByteString col1 = ByteString.copyFromUtf8("col1"); + ByteString col2 = ByteString.copyFromUtf8("col2"); + + List labels = ImmutableList.of(); + ByteString value = ByteString.EMPTY; + + Row row = + Row.create( + ByteString.copyFromUtf8("ignored-key"), + ImmutableList.of( + RowCell.create("family1", col1, 1_000, labels, value), + RowCell.create("family1", col2, 1_000, labels, value), + RowCell.create("family2", col1, 1_000, labels, value), + RowCell.create("family4", col1, 1_000, labels, value))); + + assertThat(row.getCells("family1")) + .containsExactly( + RowCell.create("family1", col1, 1_000, labels, value), + RowCell.create("family1", col2, 1_000, labels, value)) + .inOrder(); + + assertThat(row.getCells("family2")) + .containsExactly(RowCell.create("family2", col1, 1_000, labels, value)); + + assertThat(row.getCells("family3")).isEmpty(); + + assertThat(row.getCells("family4")) + .containsExactly(RowCell.create("family4", col1, 1_000, labels, value)); + } + + @Test + public void getQualifierCellsTest() { + ByteString col1 = ByteString.copyFromUtf8("col1"); + ByteString col2 = ByteString.copyFromUtf8("col2"); + + List labels = ImmutableList.of(); + ByteString value = ByteString.EMPTY; + + Row row = + Row.create( + ByteString.copyFromUtf8("ignored-key"), + ImmutableList.of( + RowCell.create("family1", col1, 1_000, labels, value), + RowCell.create("family1", col2, 2_000, labels, value), + RowCell.create("family1", col2, 1_000, labels, value), + RowCell.create("family2", col1, 1_000, labels, value), + RowCell.create("family4", col1, 1_000, labels, value))); + + assertThat(row.getCells("family1", col1)) + .containsExactly(RowCell.create("family1", col1, 1_000, labels, value)); + + assertThat(row.getCells("family1", col2)) + .containsExactly( + RowCell.create("family1", col2, 1_000, labels, value), + RowCell.create("family1", col2, 2_000, labels, value)); + + assertThat(row.getCells("family2", col1)) + .containsExactly(RowCell.create("family2", col1, 1_000, labels, value)); + + assertThat(row.getCells("family2", col2)).isEmpty(); + + assertThat(row.getCells("family3", col1)).isEmpty(); + assertThat(row.getCells("family3", col2)).isEmpty(); + + assertThat(row.getCells("family4", col1)) + .containsExactly(RowCell.create("family4", col1, 1_000, labels, value)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java new file mode 100644 index 000000000000..5b9c0cee4b80 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java @@ -0,0 +1,191 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SampleRowKeysRequestTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String TABLE_ID = "fake-table"; + private static final String AUTHORIZED_VIEW_ID = "fake-authorized-view"; + private static final String APP_PROFILE_ID = "fake-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + + @Test + public void toProtoTest() { + // Test SampleRowKeysRequest on a table. + SampleRowKeysRequest sampleRowKeysRequest = SampleRowKeysRequest.create(TableId.of(TABLE_ID)); + com.google.bigtable.v2.SampleRowKeysRequest actualRequest = + sampleRowKeysRequest.toProto(REQUEST_CONTEXT); + assertThat(actualRequest.getTableName()) + .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + assertThat(actualRequest.getAuthorizedViewName()).isEmpty(); + assertThat(actualRequest.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + + // Test SampleRowKeysRequest on an authorized view. + sampleRowKeysRequest = + SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)); + actualRequest = sampleRowKeysRequest.toProto(REQUEST_CONTEXT); + assertThat(actualRequest.getTableName()).isEmpty(); + assertThat(actualRequest.getAuthorizedViewName()) + .isEqualTo( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)); + assertThat(actualRequest.getAppProfileId()).isEqualTo(APP_PROFILE_ID); + } + + @Test + public void fromProtoTest() { + // Test SampleRowKeysRequest on a table. + SampleRowKeysRequest sampleRowKeysRequest = SampleRowKeysRequest.create(TableId.of(TABLE_ID)); + + com.google.bigtable.v2.SampleRowKeysRequest protoRequest = + sampleRowKeysRequest.toProto(REQUEST_CONTEXT); + SampleRowKeysRequest actualRequest = SampleRowKeysRequest.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + String projectId = "fresh-project"; + String instanceId = "fresh-instance"; + String appProfile = "fresh-app-profile"; + com.google.bigtable.v2.SampleRowKeysRequest overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()) + .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID)); + assertThat(overriddenRequest.getAuthorizedViewName()).isEmpty(); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + + // Test SampleRowKeysRequest on an authorized view. + sampleRowKeysRequest = + SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)); + + protoRequest = sampleRowKeysRequest.toProto(REQUEST_CONTEXT); + actualRequest = SampleRowKeysRequest.fromProto(protoRequest); + + assertThat(actualRequest.toProto(REQUEST_CONTEXT)).isEqualTo(protoRequest); + + overriddenRequest = + actualRequest.toProto(RequestContext.create(projectId, instanceId, appProfile)); + + assertThat(overriddenRequest).isNotEqualTo(protoRequest); + assertThat(overriddenRequest.getTableName()).isEmpty(); + assertThat(overriddenRequest.getAuthorizedViewName()) + .matches( + NameUtil.formatAuthorizedViewName(projectId, instanceId, TABLE_ID, AUTHORIZED_VIEW_ID)); + assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); + } + + @Test + public void testFromProtoWithInvalidTableId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance().toBuilder() + .setTableName("invalid-name") + .build())); + + assertThat(e).hasMessageThat().startsWith("Invalid table name:"); + } + + @Test + public void testFromProtoWithInvalidAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance().toBuilder() + .setAuthorizedViewName("invalid-name") + .build())); + + assertThat(e).hasMessageThat().startsWith("Invalid authorized view name:"); + } + + @Test + public void testFromProtoWithEmptyTableAndAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance())); + + assertThat(e) + .hasMessageThat() + .startsWith( + "Either table name, authorized view name or materialized view name must be specified."); + } + + @Test + public void testFromProtoWithBothTableAndAuthorizedViewId() { + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, + () -> + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance().toBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .build())); + + assertThat(e) + .hasMessageThat() + .startsWith( + "Only one of table name, authorized view name and materialized view name can be" + + " specified at the same time."); + } + + @Test + public void testEquality() { + // Test SampleRowKeysRequest on a table. + assertThat(SampleRowKeysRequest.create(TableId.of(TABLE_ID))) + .isEqualTo(SampleRowKeysRequest.create(TableId.of(TABLE_ID))); + assertThat(SampleRowKeysRequest.create(TableId.of("another-table"))) + .isNotEqualTo(SampleRowKeysRequest.create(TableId.of(TABLE_ID))); + + // Test SampleRowKeysRequest on an authorized view. + assertThat(SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID))) + .isEqualTo(SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID))); + assertThat( + SampleRowKeysRequest.create(AuthorizedViewId.of("another-table", AUTHORIZED_VIEW_ID))) + .isNotEqualTo( + SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID))); + assertThat( + SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, "another-authorized-view"))) + .isNotEqualTo( + SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID))); + + assertThat(SampleRowKeysRequest.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID))) + .isNotEqualTo(SampleRowKeysRequest.create(TableId.of(TABLE_ID))); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/TableIdTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/TableIdTest.java new file mode 100644 index 000000000000..8e1c9d502dce --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/TableIdTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TableIdTest { + private static final String PROJECT_ID = "my-project"; + private static final String INSTANCE_ID = "my-instance"; + private static final String TABLE_ID = "my-table"; + + @Test + public void testToResourceName() { + TableId tableId = TableId.of(TABLE_ID); + + assertThat(tableId.toResourceName(PROJECT_ID, INSTANCE_ID)) + .isEqualTo("projects/my-project/instances/my-instance/tables/my-table"); + } + + @Test + public void testEquality() { + TableId tableId = TableId.of(TABLE_ID); + + assertThat(tableId).isEqualTo(TableId.of(TABLE_ID)); + assertThat(tableId).isNotEqualTo(TableId.of("another-table")); + } + + @Test + public void testHashCode() { + TableId tableId = TableId.of(TABLE_ID); + + assertThat(tableId.hashCode()).isEqualTo(TableId.of(TABLE_ID).hashCode()); + assertThat(tableId.hashCode()).isNotEqualTo(TableId.of("another-table").hashCode()); + } + + @Test + public void testToString() { + TableId tableId = TableId.of(TABLE_ID); + + assertThat(tableId.toString()).isEqualTo("TableId{tableId=my-table}"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ValueTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ValueTest.java new file mode 100644 index 000000000000..ed3df8579944 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ValueTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ValueTest { + @Test + public void rawValue() { + Value value = Value.rawValue(ByteString.copyFromUtf8("test")); + assertThat(Value.fromProto(value.toProto())).isEqualTo(value); + } + + @Test + public void rawTimestamp() { + Value value = Value.rawTimestamp(1234); + assertThat(Value.fromProto(value.toProto())).isEqualTo(value); + } + + @Test + public void int64() { + Value value = Value.intValue(1234); + assertThat(Value.fromProto(value.toProto())).isEqualTo(value); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatementTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatementTest.java new file mode 100644 index 000000000000..71f46610a203 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatementTest.java @@ -0,0 +1,872 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.floatValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.nullValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ColumnMetadata; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.Timestamp; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.protobuf.ByteString; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import javax.annotation.Nullable; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class BoundStatementTest { + + private static final String EXPECTED_APP_PROFILE = "test-profile"; + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create("test-project", "test-instance", EXPECTED_APP_PROFILE); + private static final String EXPECTED_INSTANCE_NAME = + "projects/test-project/instances/test-instance"; + private static final ByteString EXPECTED_PREPARED_QUERY = ByteString.copyFromUtf8("foo"); + // BoundStatement doesn't validate params against schema right now, so we can use hardcoded + // columns for now + private static final ColumnMetadata[] DEFAULT_COLUMNS = { + columnMetadata("_key", bytesType()), columnMetadata("cf", stringType()) + }; + private static final @Nullable ByteString NO_RESUME_TOKEN = null; + + // Use ColumnMetadata as a more concise way of specifying params + public static BoundStatement.Builder boundStatementBuilder(ColumnMetadata... paramColumns) { + HashMap> paramTypes = new HashMap<>(paramColumns.length); + for (ColumnMetadata c : paramColumns) { + paramTypes.put(c.getName(), SqlType.fromProto(c.getType())); + } + // This doesn't impact bound statement, but set it so it looks like a real response + Instant expiry = Instant.now().plus(Duration.ofMinutes(1)); + return preparedStatement( + PrepareResponse.fromProto( + PrepareQueryResponse.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .setMetadata(metadata(DEFAULT_COLUMNS)) + .setValidUntil( + Timestamp.ofTimeSecondsAndNanos(expiry.getEpochSecond(), expiry.getNano()) + .toProto()) + .build()), + paramTypes) + .bind(); + } + + @Test + public void statementWithoutParameters() { + BoundStatement s = boundStatementBuilder().build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithResumeToken() { + BoundStatement s = boundStatementBuilder().build(); + + assertThat( + s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, ByteString.copyFromUtf8("token"))) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .setResumeToken(ByteString.copyFromUtf8("token")) + .build()); + } + + @Test + public void statementWithBytesParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("key", bytesType())) + .setBytesParam("key", ByteString.copyFromUtf8("test")) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "key", + Value.newBuilder() + .setType(bytesType()) + .setBytesValue(ByteString.copyFromUtf8("test")) + .build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullBytesParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("key", bytesType())) + .setBytesParam("key", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("key", Value.newBuilder().setType(bytesType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithStringParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("key", stringType())) + .setStringParam("key", "test") + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "key", Value.newBuilder().setType(stringType()).setStringValue("test").build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullStringParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("key", stringType())) + .setStringParam("key", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("key", Value.newBuilder().setType(stringType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithInt64Param() { + BoundStatement s = + boundStatementBuilder(columnMetadata("number", int64Type())) + .setLongParam("number", 1L) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("number", Value.newBuilder().setType(int64Type()).setIntValue(1).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullInt64Param() { + BoundStatement s = + boundStatementBuilder(columnMetadata("number", int64Type())) + .setLongParam("number", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("number", Value.newBuilder().setType(int64Type()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBoolParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("bool", boolType())) + .setBooleanParam("bool", true) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "bool", Value.newBuilder().setType(boolType()).setBoolValue(true).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullBoolParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("bool", boolType())) + .setBooleanParam("bool", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("bool", Value.newBuilder().setType(boolType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithTimestampParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("timeParam", timestampType())) + .setTimestampParam("timeParam", Instant.ofEpochSecond(1000, 100)) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "timeParam", + Value.newBuilder() + .setType(timestampType()) + .setTimestampValue(timestampValue(1000, 100).getTimestampValue()) + .build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullTimestampParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("timeParam", timestampType())) + .setTimestampParam("timeParam", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("timeParam", Value.newBuilder().setType(timestampType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithDateParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("dateParam", dateType())) + .setDateParam("dateParam", Date.fromYearMonthDay(2024, 6, 11)) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "dateParam", + Value.newBuilder() + .setType(dateType()) + .setDateValue(dateValue(2024, 6, 11).getDateValue()) + .build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullDateParam() { + BoundStatement s = + boundStatementBuilder(columnMetadata("dateParam", dateType())) + .setDateParam("dateParam", null) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams("dateParam", Value.newBuilder().setType(dateType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBytesListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(bytesType())), + columnMetadata("listWithNullElem", arrayType(bytesType())), + columnMetadata("emptyList", arrayType(bytesType())), + columnMetadata("nullList", arrayType(bytesType()))) + .setListParam( + "listParam", + Arrays.asList(ByteString.copyFromUtf8("foo"), ByteString.copyFromUtf8("bar")), + SqlType.arrayOf(SqlType.bytes())) + .setListParam( + "listWithNullElem", + Arrays.asList(ByteString.copyFromUtf8("foo"), null, ByteString.copyFromUtf8("bar")), + SqlType.arrayOf(SqlType.bytes())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.bytes())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.bytes())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(bytesType())) + .setArrayValue( + arrayValue(bytesValue("foo"), bytesValue("bar")).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(bytesType())) + .setArrayValue( + arrayValue(bytesValue("foo"), nullValue(), bytesValue("bar")) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(bytesType())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(bytesType())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithStringListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(stringType())), + columnMetadata("listWithNullElem", arrayType(stringType())), + columnMetadata("emptyList", arrayType(stringType())), + columnMetadata("nullList", arrayType(stringType()))) + .setListParam( + "listParam", Arrays.asList("foo", "bar"), SqlType.arrayOf(SqlType.string())) + .setListParam( + "listWithNullElem", + Arrays.asList("foo", "bar", null), + SqlType.arrayOf(SqlType.string())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.string())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.string())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(stringType())) + .setArrayValue( + arrayValue(stringValue("foo"), stringValue("bar")).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(stringType())) + .setArrayValue( + arrayValue(stringValue("foo"), stringValue("bar"), nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(stringType())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(stringType())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithInt64ListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(int64Type())), + columnMetadata("listWithNullElem", arrayType(int64Type())), + columnMetadata("emptyList", arrayType(int64Type())), + columnMetadata("nullList", arrayType(int64Type()))) + .setListParam("listParam", Arrays.asList(1L, 2L), SqlType.arrayOf(SqlType.int64())) + .setListParam( + "listWithNullElem", Arrays.asList(null, 3L, 4L), SqlType.arrayOf(SqlType.int64())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.int64())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.int64())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(int64Type())) + .setArrayValue(arrayValue(int64Value(1), int64Value(2)).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(int64Type())) + .setArrayValue( + arrayValue(nullValue(), int64Value(3), int64Value(4)).getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(int64Type())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(int64Type())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithFloat32ListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(float32Type())), + columnMetadata("listWithNullElem", arrayType(float32Type())), + columnMetadata("emptyList", arrayType(float32Type())), + columnMetadata("nullList", arrayType(float32Type()))) + .setListParam( + "listParam", Arrays.asList(1.1f, 1.2f), SqlType.arrayOf(SqlType.float32())) + .setListParam( + "listWithNullElem", + Arrays.asList(1.3f, 1.4f, null), + SqlType.arrayOf(SqlType.float32())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.float32())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.float32())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(float32Type())) + .setArrayValue( + arrayValue(floatValue(1.1f), floatValue(1.2f)).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(float32Type())) + .setArrayValue( + arrayValue(floatValue(1.3f), floatValue(1.4f), nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(float32Type())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(float32Type())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithFloat64ListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(float64Type())), + columnMetadata("listWithNullElem", arrayType(float64Type())), + columnMetadata("emptyList", arrayType(float64Type())), + columnMetadata("nullList", arrayType(float64Type()))) + .setListParam( + "listParam", Arrays.asList(1.1d, 1.2d), SqlType.arrayOf(SqlType.float64())) + .setListParam( + "listWithNullElem", + Arrays.asList(1.3d, 1.4d, null), + SqlType.arrayOf(SqlType.float64())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.float64())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.float64())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(float64Type())) + .setArrayValue(arrayValue(floatValue(1.1), floatValue(1.2)).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(float64Type())) + .setArrayValue( + arrayValue(floatValue(1.3), floatValue(1.4), nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(float64Type())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(float64Type())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBooleanListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(boolType())), + columnMetadata("listWithNullElem", arrayType(boolType())), + columnMetadata("emptyList", arrayType(boolType())), + columnMetadata("nullList", arrayType(boolType()))) + .setListParam("listParam", Arrays.asList(true, false), SqlType.arrayOf(SqlType.bool())) + .setListParam( + "listWithNullElem", + Arrays.asList(true, false, null), + SqlType.arrayOf(SqlType.bool())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.bool())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.bool())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(boolType())) + .setArrayValue( + arrayValue(boolValue(true), boolValue(false)).getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(boolType())) + .setArrayValue( + arrayValue(boolValue(true), boolValue(false), nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(boolType())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(boolType())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithTimestampListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(timestampType())), + columnMetadata("listWithNullElem", arrayType(timestampType())), + columnMetadata("emptyList", arrayType(timestampType())), + columnMetadata("nullList", arrayType(timestampType()))) + .setListParam( + "listParam", + Arrays.asList(Instant.ofEpochSecond(3000, 100), Instant.ofEpochSecond(4000, 100)), + SqlType.arrayOf(SqlType.timestamp())) + .setListParam( + "listWithNullElem", + Arrays.asList( + Instant.ofEpochSecond(1000, 100), Instant.ofEpochSecond(2000, 100), null), + SqlType.arrayOf(SqlType.timestamp())) + .setListParam( + "emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.timestamp())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.timestamp())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(timestampType())) + .setArrayValue( + arrayValue(timestampValue(3000, 100), timestampValue(4000, 100)) + .getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(timestampType())) + .setArrayValue( + arrayValue( + timestampValue(1000, 100), + timestampValue(2000, 100), + nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(timestampType())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams( + "nullList", Value.newBuilder().setType(arrayType(timestampType())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithDateListParam() { + BoundStatement s = + boundStatementBuilder( + columnMetadata("listParam", arrayType(dateType())), + columnMetadata("listWithNullElem", arrayType(dateType())), + columnMetadata("emptyList", arrayType(dateType())), + columnMetadata("nullList", arrayType(dateType()))) + .setListParam( + "listParam", + Arrays.asList(Date.fromYearMonthDay(2024, 6, 1), Date.fromYearMonthDay(2024, 7, 1)), + SqlType.arrayOf(SqlType.date())) + .setListParam( + "listWithNullElem", + Arrays.asList( + Date.fromYearMonthDay(2024, 8, 1), Date.fromYearMonthDay(2024, 8, 2), null), + SqlType.arrayOf(SqlType.date())) + .setListParam("emptyList", Collections.emptyList(), SqlType.arrayOf(SqlType.date())) + .setListParam("nullList", null, SqlType.arrayOf(SqlType.date())) + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "listParam", + Value.newBuilder() + .setType(arrayType(dateType())) + .setArrayValue( + arrayValue(dateValue(2024, 6, 1), dateValue(2024, 7, 1)) + .getArrayValue()) + .build()) + .putParams( + "listWithNullElem", + Value.newBuilder() + .setType(arrayType(dateType())) + .setArrayValue( + arrayValue(dateValue(2024, 8, 1), dateValue(2024, 8, 2), nullValue()) + .getArrayValue()) + .build()) + .putParams( + "emptyList", + Value.newBuilder() + .setType(arrayType(dateType())) + .setArrayValue(arrayValue().getArrayValue()) + .build()) + .putParams("nullList", Value.newBuilder().setType(arrayType(dateType())).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void setListParamRejectsUnsupportedElementTypes() { + BoundStatement.Builder statement = boundStatementBuilder(); + + assertThrows( + IllegalArgumentException.class, + () -> statement.setListParam("param", null, SqlType.arrayOf(SqlType.struct()))); + assertThrows( + IllegalArgumentException.class, + () -> + statement.setListParam( + "param", null, SqlType.arrayOf(SqlType.arrayOf(SqlType.string())))); + assertThrows( + IllegalArgumentException.class, + () -> + statement.setListParam( + "param", null, SqlType.arrayOf(SqlType.mapOf(SqlType.bytes(), SqlType.bytes())))); + } + + @Test + public void statementBuilderAllowsParamsToBeOverridden() { + BoundStatement s = + boundStatementBuilder(columnMetadata("key", stringType())) + .setStringParam("key", "test1") + .setStringParam("key", "test2") + .setStringParam("key", "test3") + .setStringParam("key", "test4") + .build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .putParams( + "key", Value.newBuilder().setType(stringType()).setStringValue("test4").build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void builderWorksWithNoParams() { + BoundStatement s = boundStatementBuilder().build(); + + assertThat(s.toProto(EXPECTED_PREPARED_QUERY, REQUEST_CONTEXT, NO_RESUME_TOKEN)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setPreparedQuery(EXPECTED_PREPARED_QUERY) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void builderValidatesParameterNames() { + BoundStatement.Builder builder = boundStatementBuilder(); + + IllegalArgumentException e = + assertThrows( + IllegalArgumentException.class, () -> builder.setStringParam("non-existent", "test")); + assertThat(e.getMessage()).contains("No parameter named: non-existent"); + } + + @Test + public void builderValidatesTypesMatch() { + BoundStatement.Builder builder = + boundStatementBuilder( + columnMetadata("stringParam", stringType()), + columnMetadata("bytesParam", bytesType()), + columnMetadata("stringListParam", stringType())); + + IllegalArgumentException eString = + assertThrows( + IllegalArgumentException.class, + () -> builder.setBytesParam("stringParam", ByteString.copyFromUtf8("foo"))); + assertThat(eString.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eBytes = + assertThrows( + IllegalArgumentException.class, () -> builder.setStringParam("bytesParam", "foo")); + assertThat(eBytes.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eLong = + assertThrows(IllegalArgumentException.class, () -> builder.setLongParam("bytesParam", 1L)); + assertThat(eLong.getMessage()).contains("Invalid type passed for query param"); + assertThrows(IllegalArgumentException.class, () -> builder.setDoubleParam("bytesParam", 1.1d)); + assertThat(eLong.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eFloat = + assertThrows( + IllegalArgumentException.class, () -> builder.setFloatParam("bytesParam", 1.1f)); + assertThat(eFloat.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eBool = + assertThrows( + IllegalArgumentException.class, () -> builder.setBooleanParam("bytesParam", true)); + assertThat(eBool.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eTs = + assertThrows( + IllegalArgumentException.class, + () -> builder.setTimestampParam("bytesParam", Instant.now())); + assertThat(eTs.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eDate = + assertThrows( + IllegalArgumentException.class, + () -> builder.setDateParam("bytesParam", Date.fromYearMonthDay(2025, 1, 1))); + assertThat(eDate.getMessage()).contains("Invalid type passed for query param"); + IllegalArgumentException eList = + assertThrows( + IllegalArgumentException.class, + () -> + builder.setListParam( + "stringListParam", + Collections.singletonList(ByteString.copyFromUtf8("foo")), + SqlType.arrayOf(SqlType.bytes()))); + assertThat(eList.getMessage()).contains("Invalid type passed for query param"); + } + + @Test + public void builderValidatesAllParamsAreSet() { + BoundStatement.Builder builder = + boundStatementBuilder( + columnMetadata("stringParam", stringType()), columnMetadata("bytesParam", bytesType())); + builder.setStringParam("stringParam", "s"); + + IllegalArgumentException e = assertThrows(IllegalArgumentException.class, builder::build); + assertThat(e.getMessage()) + .contains("Attempting to build BoundStatement without binding parameter: bytesParam"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.java new file mode 100644 index 000000000000..e8e33387a603 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.java @@ -0,0 +1,297 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.models.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.boolType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.dateType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.enumType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float32Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.float64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.protoType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structField; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.timestampType; +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Type; +import com.google.cloud.bigtable.common.Type.SchemalessEnum; +import com.google.cloud.bigtable.common.Type.SchemalessProto; +import com.google.cloud.bigtable.common.Type.StructWithSchema; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType.Code; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Album; +import com.google.cloud.bigtable.data.v2.test.AlbumProto.Format; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Genre; +import com.google.cloud.bigtable.data.v2.test.SingerProto.Singer; +import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SqlTypeTest { + + private HashMap> protoToJavaMapping; + + @Before + public void setUp() { + protoToJavaMapping = new HashMap<>(); + protoToJavaMapping.put(bytesType(), SqlType.bytes()); + protoToJavaMapping.put(stringType(), SqlType.string()); + protoToJavaMapping.put(int64Type(), SqlType.int64()); + protoToJavaMapping.put(float32Type(), SqlType.float32()); + protoToJavaMapping.put(float64Type(), SqlType.float64()); + protoToJavaMapping.put(boolType(), SqlType.bool()); + protoToJavaMapping.put(timestampType(), SqlType.timestamp()); + protoToJavaMapping.put(dateType(), SqlType.date()); + protoToJavaMapping.put( + structType(structField("foo", stringType()), structField("bar", int64Type())), + new StructWithSchema( + Arrays.asList( + StructWithSchema.Field.fromProto(structField("foo", stringType())), + StructWithSchema.Field.fromProto(structField("bar", int64Type()))))); + protoToJavaMapping.put(arrayType(stringType()), SqlType.arrayOf(SqlType.string())); + protoToJavaMapping.put( + mapType(bytesType(), stringType()), SqlType.mapOf(SqlType.bytes(), SqlType.string())); + protoToJavaMapping.put( + protoType("foo", "my_bundle"), SchemalessProto.create("foo", "my_bundle")); + protoToJavaMapping.put(enumType("foo", "my_bundle"), SchemalessEnum.create("foo", "my_bundle")); + } + + @Test + public void fromProto_supportsAllTypes() { + EnumSet allCodes = EnumSet.allOf(SqlType.Code.class); + for (Map.Entry> entry : protoToJavaMapping.entrySet()) { + SqlType converted = SqlType.fromProto(entry.getKey()); + assertThat(converted).isEqualTo(entry.getValue()); + allCodes.remove(converted.getCode()); + } + assertThat(allCodes).isEmpty(); + } + + @Test + public void typesMatch_supportsAllTypes() { + EnumSet allCodes = EnumSet.allOf(SqlType.Code.class); + + for (Map.Entry> entry : protoToJavaMapping.entrySet()) { + SqlType type = entry.getValue(); + SqlType copyOfType = SqlType.fromProto(entry.getKey()); + assertThat(SqlType.typesMatch(type, copyOfType)).isTrue(); + SqlType otherType = + type.getCode().equals(Code.STRING) ? SqlType.bytes() : SqlType.string(); + assertThat(SqlType.typesMatch(type, otherType)).isFalse(); + allCodes.remove(type.getCode()); + } + + assertThat(allCodes).isEmpty(); + } + + @Test + public void historicalMap_matchesProto() { + SqlType expected = + SqlType.fromProto( + mapType( + bytesType(), + arrayType( + structType( + structField("timestamp", timestampType()), + structField("value", bytesType()))))); + assertThat(SqlType.typesMatch(SqlType.historicalMap(), expected)).isTrue(); + } + + @Test + public void typesMatch_ignoresStructSchema() { + SqlType.Struct schemalessStruct = SqlType.struct(); + Type structProto = + structType(structField("timestamp", timestampType()), structField("value", bytesType())); + StructWithSchema structWithSchema = StructWithSchema.fromProto(structProto.getStructType()); + SqlType.Array arrayNestedSchemaless = SqlType.arrayOf(SqlType.struct()); + SqlType arrayNestedSchema = SqlType.fromProto(arrayType(structProto)); + SqlType.Map> historicalMapSchemaless = SqlType.historicalMap(); + SqlType mapNestedSchema = SqlType.fromProto(mapType(bytesType(), arrayType(structProto))); + + assertThat(SqlType.typesMatch(schemalessStruct, structWithSchema)).isTrue(); + assertThat(SqlType.typesMatch(arrayNestedSchema, arrayNestedSchemaless)).isTrue(); + assertThat(SqlType.typesMatch(historicalMapSchemaless, mapNestedSchema)).isTrue(); + } + + @Test + public void typesMatch_checksArrayElements() { + SqlType.Array stringArray = SqlType.arrayOf(SqlType.string()); + SqlType.Array bytesArray = SqlType.arrayOf(SqlType.bytes()); + SqlType.Array> nestedStringArray = + SqlType.arrayOf(SqlType.arrayOf(SqlType.string())); + SqlType.Array> nestedBytesArray = + SqlType.arrayOf(SqlType.arrayOf(SqlType.bytes())); + + assertThat(SqlType.typesMatch(stringArray, bytesArray)).isFalse(); + assertThat(SqlType.typesMatch(nestedStringArray, nestedBytesArray)).isFalse(); + } + + @Test + public void typesMatch_checksMapSchema() { + SqlType.Map bytesBytesMap = + SqlType.mapOf(SqlType.bytes(), SqlType.bytes()); + SqlType.Map bytesStringMap = + SqlType.mapOf(SqlType.string(), SqlType.bytes()); + SqlType.Map stringBytesMap = + SqlType.mapOf(SqlType.bytes(), SqlType.string()); + + assertThat(SqlType.typesMatch(bytesBytesMap, bytesStringMap)).isFalse(); + assertThat(SqlType.typesMatch(bytesBytesMap, stringBytesMap)).isFalse(); + assertThat( + SqlType.typesMatch( + SqlType.mapOf(SqlType.bytes(), bytesBytesMap), + SqlType.mapOf(SqlType.bytes(), bytesStringMap))) + .isFalse(); + } + + @Test + public void typesMatch_checksProto() { + SqlType.Proto singerProto = SqlType.protoOf(Singer.getDefaultInstance()); + SqlType.Proto albumProto = SqlType.protoOf(Album.getDefaultInstance()); + SqlType.Proto schemalessSinger = + SchemalessProto.create("com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle"); + SqlType.Proto schemalessAlbum = + SchemalessProto.create("com.google.cloud.bigtable.data.v2.test.Album", "my_bundle"); + + // Both Schemaless types + assertThat(SqlType.typesMatch(schemalessSinger, schemalessAlbum)).isFalse(); + assertThat( + SqlType.typesMatch( + schemalessSinger, + SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Singer", "my_bundle"))) + .isTrue(); + + // Both concrete types + assertThat(SqlType.typesMatch(singerProto, albumProto)).isFalse(); + assertThat(SqlType.typesMatch(singerProto, SqlType.protoOf(Singer.getDefaultInstance()))) + .isTrue(); + + // Schemaless versus concrete types (unqualified proto message names must match) + assertThat(SqlType.typesMatch(schemalessSinger, singerProto)).isTrue(); + assertThat(SqlType.typesMatch(singerProto, schemalessSinger)).isTrue(); + assertThat(SqlType.typesMatch(singerProto, SchemalessProto.create("Singer", "my_bundle"))) + .isTrue(); + assertThat( + SqlType.typesMatch(singerProto, SchemalessProto.create("foo.bar.Singer", "my_bundle"))) + .isTrue(); + assertThat(SqlType.typesMatch(singerProto, SchemalessProto.create("Singer", "other_bundle"))) + .isTrue(); + assertThat( + SqlType.typesMatch( + singerProto, SchemalessProto.create("foo.bar.Singer", "other_bundle"))) + .isTrue(); + assertThat(SqlType.typesMatch(schemalessSinger, albumProto)).isFalse(); + assertThat(SqlType.typesMatch(albumProto, schemalessSinger)).isFalse(); + assertThat(SqlType.typesMatch(singerProto, SchemalessProto.create("Album", "my_bundle"))) + .isFalse(); + assertThat( + SqlType.typesMatch( + singerProto, + SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Album", "my_bundle"))) + .isFalse(); + assertThat(SqlType.typesMatch(singerProto, SchemalessProto.create("", "my_bundle"))).isFalse(); + } + + @Test + public void typesMatch_checksEnum() { + SqlType.Enum genreEnum = SqlType.enumOf(Genre::forNumber); + SqlType.Enum formatEnum = SqlType.enumOf(Format::forNumber); + SqlType.Enum schemalessGenre = + SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle"); + SqlType.Enum schemalessFormat = + SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Format", "my_bundle"); + + // Both Schemaless types + assertThat(SqlType.typesMatch(schemalessGenre, schemalessFormat)).isFalse(); + assertThat( + SqlType.typesMatch( + schemalessGenre, + SchemalessEnum.create("com.google.cloud.bigtable.data.v2.test.Genre", "my_bundle"))) + .isTrue(); + + // Both concrete types + assertThat(SqlType.typesMatch(genreEnum, formatEnum)).isFalse(); + assertThat(SqlType.typesMatch(genreEnum, SqlType.enumOf(Genre::forNumber))).isTrue(); + + // Schemaless versus concrete types (unqualified enum message names must match) + assertThat(SqlType.typesMatch(schemalessGenre, genreEnum)).isTrue(); + assertThat(SqlType.typesMatch(genreEnum, schemalessGenre)).isTrue(); + assertThat(SqlType.typesMatch(genreEnum, SchemalessEnum.create("Genre", "my_bundle"))).isTrue(); + assertThat(SqlType.typesMatch(genreEnum, SchemalessEnum.create("foo.bar.Genre", "my_bundle"))) + .isTrue(); + assertThat(SqlType.typesMatch(genreEnum, SchemalessEnum.create("Genre", "other_bundle"))) + .isTrue(); + assertThat( + SqlType.typesMatch(genreEnum, SchemalessEnum.create("foo.bar.Genre", "other_bundle"))) + .isTrue(); + assertThat(SqlType.typesMatch(schemalessGenre, formatEnum)).isFalse(); + assertThat(SqlType.typesMatch(formatEnum, schemalessGenre)).isFalse(); + assertThat(SqlType.typesMatch(genreEnum, SchemalessEnum.create("Format", "my_bundle"))) + .isFalse(); + assertThat( + SqlType.typesMatch( + genreEnum, + SchemalessProto.create( + "com.google.cloud.bigtable.data.v2.test.Format", "my_bundle"))) + .isFalse(); + assertThat(SqlType.typesMatch(genreEnum, SchemalessEnum.create("", "my_bundle"))).isFalse(); + } + + @Test + public void struct_getFields() { + Type structProto = + structType(structField("timestamp", timestampType()), structField("value", bytesType())); + SqlType struct = SqlType.fromProto(structProto); + SqlType.Struct typedStruct = (SqlType.Struct) struct; + SqlType.Struct.Field timestampField = typedStruct.getFields().get(0); + SqlType.Struct.Field valueField = typedStruct.getFields().get(1); + assertThat(timestampField.name()).isEqualTo("timestamp"); + assertThat(timestampField.type()).isEqualTo(SqlType.timestamp()); + assertThat(valueField.name()).isEqualTo("value"); + assertThat(valueField.type()).isEqualTo(SqlType.bytes()); + } + + @Test + public void array_getElementType() { + SqlType array = SqlType.fromProto(arrayType(stringType())); + SqlType.Array typedArray = (SqlType.Array) array; + + assertThat(typedArray.getElementType()).isEqualTo(SqlType.string()); + } + + @Test + public void map_getKeyAndValueTypes() { + SqlType map = SqlType.mapOf(SqlType.bytes(), SqlType.string()); + SqlType.Map typedMap = (SqlType.Map) map; + + assertThat(typedMap.getKeyType()).isEqualTo(SqlType.bytes()); + assertThat(typedMap.getValueType()).isEqualTo(SqlType.string()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java new file mode 100644 index 000000000000..dcdef068a561 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java @@ -0,0 +1,253 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.DynamicFlowControlSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor; +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class BigtableBatchingCallSettingsTest { + + private static final BatchingSettings BATCHING_SETTINGS = + BatchingSettings.newBuilder() + .setElementCountThreshold(10L) + .setRequestByteThreshold(20L) + .setDelayThreshold(Duration.ofMillis(5)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100L) + .setMaxOutstandingRequestBytes(100L) + .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Block) + .build()) + .build(); + + @Test + public void testEmptyBuilder() { + BigtableBatchingCallSettings.Builder builder = + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()); + assertThat(builder.getBatchingSettings()).isNull(); + assertThat(builder.getRetryableCodes()).isEmpty(); + assertThat(builder.getRetrySettings()).isNotNull(); + assertThat(builder.isLatencyBasedThrottlingEnabled()).isFalse(); + assertThat(builder.getTargetRpcLatencyMs()).isNull(); + assertThat(builder.getDynamicFlowControlSettings()).isNull(); + } + + @Test + public void testBuilder() { + BigtableBatchingCallSettings.Builder builder = + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()); + + Set retryCodes = ImmutableSet.of(StatusCode.Code.UNAVAILABLE); + RetrySettings retrySettings = RetrySettings.newBuilder().build(); + builder + .setBatchingSettings(BATCHING_SETTINGS) + .setRetryableCodes(retryCodes) + .setRetrySettings(retrySettings); + + BigtableBatchingCallSettings settings = builder.build(); + assertThat(settings.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS); + assertThat(settings.getRetryableCodes()).isEqualTo(retryCodes); + assertThat(settings.getRetrySettings()).isEqualTo(retrySettings); + assertThat(settings.isLatencyBasedThrottlingEnabled()).isFalse(); + assertThat(settings.getTargetRpcLatencyMs()).isNull(); + assertThat(settings.getDynamicFlowControlSettings()).isNotNull(); + verifyFlowControlSettingWhenLatencyBasedThrottlingDisabled( + settings.getDynamicFlowControlSettings()); + + builder.enableLatencyBasedThrottling(10L); + settings = builder.build(); + assertThat(settings.isLatencyBasedThrottlingEnabled()).isTrue(); + assertThat(settings.getTargetRpcLatencyMs()).isEqualTo(10); + assertThat(settings.getDynamicFlowControlSettings()).isNotNull(); + verifyFlowControlSettingWhenLatencyBasedThrottlingEnabled( + settings.getDynamicFlowControlSettings()); + + builder.disableLatencyBasedThrottling(); + settings = builder.build(); + assertThat(settings.isLatencyBasedThrottlingEnabled()).isFalse(); + assertThat(settings.getTargetRpcLatencyMs()).isNull(); + assertThat(settings.getDynamicFlowControlSettings()).isNotNull(); + verifyFlowControlSettingWhenLatencyBasedThrottlingDisabled( + settings.getDynamicFlowControlSettings()); + + builder.setServerInitiatedFlowControl(true); + settings = builder.build(); + assertThat(settings.isServerInitiatedFlowControlEnabled()).isTrue(); + + builder.setServerInitiatedFlowControl(false); + settings = builder.build(); + assertThat(settings.isServerInitiatedFlowControlEnabled()).isFalse(); + } + + @Test + public void testBuilderFromSettings() { + BigtableBatchingCallSettings.Builder builder = + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()); + RetrySettings retrySettings = + RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(1)).build(); + builder + .setBatchingSettings(BATCHING_SETTINGS) + .setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED) + .setRetrySettings(retrySettings) + .enableLatencyBasedThrottling(10L) + .setServerInitiatedFlowControl(true); + + BigtableBatchingCallSettings settings = builder.build(); + BigtableBatchingCallSettings.Builder newBuilder = settings.toBuilder(); + + assertThat(newBuilder.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS); + assertThat(newBuilder.getRetryableCodes()) + .containsExactly(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED); + assertThat(newBuilder.getRetrySettings()).isEqualTo(retrySettings); + assertThat(newBuilder.isLatencyBasedThrottlingEnabled()).isTrue(); + assertThat(newBuilder.getTargetRpcLatencyMs()).isEqualTo(10L); + assertThat(newBuilder.getDynamicFlowControlSettings()).isNotNull(); + verifyFlowControlSettingWhenLatencyBasedThrottlingEnabled( + newBuilder.getDynamicFlowControlSettings()); + assertThat(newBuilder.isServerInitiatedFlowControlEnabled()).isTrue(); + } + + @Test + public void testMandatorySettings() { + Exception actualEx = null; + try { + BigtableBatchingCallSettings.newBuilder(null); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(NullPointerException.class); + actualEx = null; + try { + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()).build(); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testFlowControlMandatorySettings() { + Exception actualEx = null; + try { + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(null) + .setMaxOutstandingRequestBytes(null) + .build()) + .build()) + .build(); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(IllegalStateException.class); + + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(11L) + .setMaxOutstandingRequestBytes(11L) + .build()) + .setElementCountThreshold(10L) + .setRequestByteThreshold(10L) + .build()) + .build(); + + actualEx = null; + try { + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(10L) + .setMaxOutstandingRequestBytes(5L) + .build()) + .setElementCountThreshold(10L) + .setRequestByteThreshold(10L) + .build()) + .build(); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(IllegalArgumentException.class); + + actualEx = null; + try { + BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) + .setBatchingSettings( + BatchingSettings.newBuilder() + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(5L) + .setMaxOutstandingRequestBytes(10L) + .build()) + .setElementCountThreshold(10L) + .setRequestByteThreshold(10L) + .build()) + .build(); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(IllegalArgumentException.class); + } + + private void verifyFlowControlSettingWhenLatencyBasedThrottlingDisabled( + DynamicFlowControlSettings settings) { + assertThat(settings.getInitialOutstandingElementCount()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingElementCount()); + assertThat(settings.getMaxOutstandingElementCount()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingElementCount()); + assertThat(settings.getMinOutstandingElementCount()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingElementCount()); + assertThat(settings.getInitialOutstandingRequestBytes()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingRequestBytes()); + assertThat(settings.getMaxOutstandingRequestBytes()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingRequestBytes()); + assertThat(settings.getMinOutstandingRequestBytes()) + .isEqualTo(BATCHING_SETTINGS.getFlowControlSettings().getMaxOutstandingRequestBytes()); + } + + private void verifyFlowControlSettingWhenLatencyBasedThrottlingEnabled( + DynamicFlowControlSettings settings) { + assertThat(settings.getInitialOutstandingElementCount()) + .isLessThan(settings.getMaxOutstandingElementCount()); + assertThat(settings.getMinOutstandingElementCount()) + .isLessThan(settings.getMaxOutstandingElementCount()); + assertThat(settings.getInitialOutstandingRequestBytes()) + .isEqualTo(settings.getMaxOutstandingRequestBytes()); + assertThat(settings.getMinOutstandingRequestBytes()) + .isEqualTo(settings.getMaxOutstandingRequestBytes()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettingsTest.java new file mode 100644 index 000000000000..a343bf466739 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBulkReadRowsCallSettingsTest.java @@ -0,0 +1,113 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor; +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class BigtableBulkReadRowsCallSettingsTest { + + private static final BatchingSettings BATCHING_SETTINGS = + BatchingSettings.newBuilder() + .setElementCountThreshold(10L) + .setRequestByteThreshold(20L) + .setDelayThreshold(Duration.ofMillis(5)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100L) + .setMaxOutstandingRequestBytes(100L) + .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Block) + .build()) + .build(); + + @Test + public void testEmptyBuilder() { + BigtableBulkReadRowsCallSettings.Builder builder = + BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()); + assertThat(builder.getBatchingSettings()).isNull(); + assertThat(builder.getRetryableCodes()).isEmpty(); + assertThat(builder.getRetrySettings()).isNotNull(); + } + + @Test + public void testBuilder() { + BigtableBulkReadRowsCallSettings.Builder builder = + BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()); + + Set retryCodes = ImmutableSet.of(StatusCode.Code.UNAVAILABLE); + RetrySettings retrySettings = RetrySettings.newBuilder().build(); + builder + .setBatchingSettings(BATCHING_SETTINGS) + .setRetryableCodes(retryCodes) + .setRetrySettings(retrySettings); + + BigtableBulkReadRowsCallSettings settings = builder.build(); + assertThat(settings.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS); + assertThat(settings.getRetryableCodes()).isEqualTo(retryCodes); + assertThat(settings.getRetrySettings()).isEqualTo(retrySettings); + } + + @Test + public void testBuilderFromSettings() { + BigtableBulkReadRowsCallSettings.Builder builder = + BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()); + RetrySettings retrySettings = + RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(1)).build(); + builder + .setBatchingSettings(BATCHING_SETTINGS) + .setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED) + .setRetrySettings(retrySettings); + + BigtableBulkReadRowsCallSettings settings = builder.build(); + BigtableBulkReadRowsCallSettings.Builder newBuilder = settings.toBuilder(); + + assertThat(newBuilder.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS); + assertThat(newBuilder.getRetryableCodes()) + .containsExactly(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED); + assertThat(newBuilder.getRetrySettings()).isEqualTo(retrySettings); + } + + @Test + public void testMandatorySettings() { + Exception actualEx = null; + try { + BigtableBulkReadRowsCallSettings.newBuilder(null); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(NullPointerException.class); + actualEx = null; + try { + BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()).build(); + } catch (Exception ex) { + actualEx = ex; + } + assertThat(actualEx).isInstanceOf(IllegalStateException.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java new file mode 100644 index 000000000000..7913e97540b5 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java @@ -0,0 +1,251 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.auth.oauth2.AccessToken; +import com.google.auth.oauth2.OAuth2Credentials; +import com.google.bigtable.v2.BigtableGrpc.BigtableImplBase; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.common.collect.ImmutableMap; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; +import org.mockito.internal.stubbing.answers.ThrowsException; + +@RunWith(JUnit4.class) +public class BigtableChannelPrimerTest { + private static final String TOKEN_VALUE = "fake-token"; + + FakeService fakeService; + MetadataInterceptor metadataInterceptor; + BigtableChannelPrimer primer; + ManagedChannel channel; + private LogHandler logHandler; + private Server server; + + @Before + public void setup() throws IOException { + fakeService = new FakeService(); + metadataInterceptor = new MetadataInterceptor(); + + server = FakeServiceBuilder.create(fakeService).intercept(metadataInterceptor).start(); + + primer = + BigtableChannelPrimer.create( + "fake-project", + "fake-instance", + "fake-app-profile", + OAuth2Credentials.create(new AccessToken(TOKEN_VALUE, null)), + ImmutableMap.of("bigtable-feature", "fake-feature")); + + channel = + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); + logHandler = new LogHandler(); + Logger.getLogger(BigtableChannelPrimer.class.toString()).addHandler(logHandler); + } + + @After + public void teardown() { + Logger.getLogger(BigtableChannelPrimer.class.toString()).removeHandler(logHandler); + channel.shutdown(); + server.shutdown(); + } + + @Test + public void testCredentials() { + primer.primeChannel(channel); + + for (Metadata metadata : metadataInterceptor.metadataList) { + assertThat(metadata.get(Metadata.Key.of("authorization", Metadata.ASCII_STRING_MARSHALLER))) + .isEqualTo("Bearer " + TOKEN_VALUE); + } + channel.shutdown(); + } + + @Test + public void testRequests() { + final Queue requests = new ConcurrentLinkedQueue<>(); + + fakeService.pingAndWarmCallback = + new ApiFunction() { + @Override + public PingAndWarmResponse apply(PingAndWarmRequest req) { + requests.add(req); + return PingAndWarmResponse.getDefaultInstance(); + } + }; + primer.primeChannel(channel); + + assertThat(requests) + .containsExactly( + PingAndWarmRequest.newBuilder() + .setName("projects/fake-project/instances/fake-instance") + .setAppProfileId("fake-app-profile") + .build()); + } + + @Test + public void testErrorsAreLogged() { + fakeService.pingAndWarmCallback = + new ApiFunction() { + @Override + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { + throw new StatusRuntimeException(Status.FAILED_PRECONDITION); + } + }; + primer.primeChannel(channel); + + assertThat(logHandler.logs).hasSize(1); + for (LogRecord log : logHandler.logs) { + assertThat(log.getThrown().getMessage()).contains("FAILED_PRECONDITION"); + } + } + + @Test + public void testChannelErrorsAreLogged() { + ManagedChannel channel = + Mockito.mock( + ManagedChannel.class, new ThrowsException(new UnsupportedOperationException())); + primer.primeChannel(channel); + + assertThat(logHandler.logs).hasSize(1); + for (LogRecord log : logHandler.logs) { + assertThat(log.getThrown()).isInstanceOf(UnsupportedOperationException.class); + } + } + + @Test + public void testHeadersAreSent() { + primer.primeChannel(channel); + + for (Metadata metadata : metadataInterceptor.metadataList) { + assertThat(metadata.get(BigtableChannelPrimer.REQUEST_PARAMS)) + .isEqualTo( + "name=projects%2Ffake-project%2Finstances%2Ffake-instance&app_profile_id=fake-app-profile"); + assertThat( + metadata.get(Metadata.Key.of("bigtable-feature", Metadata.ASCII_STRING_MARSHALLER))) + .isEqualTo("fake-feature"); + } + } + + // New test for the async success path + @Test + public void testAsyncSuccess() throws Exception { + ApiFuture future = primer.sendPrimeRequestsAsync(channel); + + PingAndWarmResponse response = future.get(1, TimeUnit.SECONDS); + assertThat(response).isNotNull(); + assertThat(future.isDone()).isTrue(); + } + + // New test for the async failure path + @Test + public void testAsyncFailure() { + // Configure the server to return a gRPC error + fakeService.pingAndWarmCallback = + new ApiFunction() { + @Override + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { + throw new StatusRuntimeException(Status.UNAVAILABLE); + } + }; + + ApiFuture future = primer.sendPrimeRequestsAsync(channel); + + ExecutionException e = + assertThrows(ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); + assertThat(e).hasCauseThat().hasMessageThat().contains("UNAVAILABLE"); + } + + private static class MetadataInterceptor implements ServerInterceptor { + ConcurrentLinkedQueue metadataList = new ConcurrentLinkedQueue<>(); + + @Override + public Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + metadataList.add(metadata); + + return serverCallHandler.startCall(serverCall, metadata); + } + } + + static class FakeService extends BigtableImplBase { + private ApiFunction pingAndWarmCallback = + new ApiFunction() { + @Override + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { + return PingAndWarmResponse.getDefaultInstance(); + } + }; + + @Override + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { + try { + responseObserver.onNext(pingAndWarmCallback.apply(request)); + responseObserver.onCompleted(); + } catch (RuntimeException e) { + responseObserver.onError(e); + } + } + } + + private static class LogHandler extends Handler { + private ConcurrentLinkedQueue logs = new ConcurrentLinkedQueue<>(); + + @Override + public void publish(LogRecord record) { + logs.add(record); + } + + @Override + public void flush() {} + + @Override + public void close() throws SecurityException {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallableTest.java new file mode 100644 index 000000000000..2b07044c9a74 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallableTest.java @@ -0,0 +1,160 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.SpanName; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCall; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCallable; +import com.google.common.collect.ImmutableList; +import java.util.concurrent.ExecutionException; +import java.util.logging.Logger; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class BigtableUnaryOperationCallableTest { + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + @Mock private ApiTracerFactory tracerFactory; + @Mock private BigtableTracer tracer; + + @Before + public void setUp() throws Exception { + Mockito.when(tracerFactory.newTracer(Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(tracer); + } + + @Test + public void testFutureResolve() throws Exception { + BigtableUnaryOperationCallable callable = + new BigtableUnaryOperationCallable<>( + new FakeStreamingApi.ServerStreamingStashCallable<>(ImmutableList.of("value")), + GrpcCallContext.createDefault(), + tracerFactory, + SpanName.of("Fake", "method"), + false); + + ApiFuture f = callable.futureCall("fake"); + assertThat(f.get()).isEqualTo("value"); + } + + @Test + public void testMultipleResponses() throws Exception { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + + BigtableUnaryOperationCallable callable = + new BigtableUnaryOperationCallable<>( + inner, + GrpcCallContext.createDefault(), + tracerFactory, + SpanName.of("Fake", "method"), + false); + callable.logger = Mockito.mock(Logger.class); + + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = callable.futureCall("fake"); + MockServerStreamingCall call = inner.popLastCall(); + call.getController().getObserver().onResponse("first"); + call.getController().getObserver().onResponse("second"); + + ArgumentCaptor msgCaptor = ArgumentCaptor.forClass(String.class); + verify(callable.logger).log(Mockito.any(), msgCaptor.capture()); + assertThat(msgCaptor.getValue()) + .isEqualTo( + "Received response after future is resolved for a Fake.method unary operation." + + " previous: first, New response: second"); + + assertThat(call.getController().isCancelled()).isTrue(); + } + + @Test + public void testCancel() { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + BigtableUnaryOperationCallable callable = + new BigtableUnaryOperationCallable<>( + inner, + GrpcCallContext.createDefault(), + tracerFactory, + SpanName.of("Fake", "method"), + false); + ApiFuture f = callable.futureCall("req"); + f.cancel(true); + + MockServerStreamingCall call = inner.popLastCall(); + assertThat(call.getController().isCancelled()).isTrue(); + } + + @Test + public void testMissingResponse() { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + BigtableUnaryOperationCallable callable = + new BigtableUnaryOperationCallable<>( + inner, + GrpcCallContext.createDefault(), + tracerFactory, + SpanName.of("Fake", "method"), + false); + ApiFuture f = callable.futureCall("req"); + MockServerStreamingCall call = inner.popLastCall(); + call.getController().getObserver().onComplete(); + + Throwable cause = Assert.assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(cause) + .hasMessageThat() + .isEqualTo("Fake.method unary operation completed without a response message"); + } + + @Test + public void testTracing() throws Exception { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + BigtableUnaryOperationCallable callable = + new BigtableUnaryOperationCallable<>( + inner, + GrpcCallContext.createDefault(), + tracerFactory, + SpanName.of("Fake", "method"), + false); + ApiFuture f = callable.futureCall("req"); + MockServerStreamingCall call = inner.popLastCall(); + call.getController().getObserver().onResponse("value"); + call.getController().getObserver().onComplete(); + + f.get(); + verify(tracer).responseReceived(); + verify(tracer).operationSucceeded(); + + // afterResponse is the responsibility of BigtableTracerStreamingCallable + verify(tracer, never()).afterResponse(Mockito.anyLong()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallableTest.java new file mode 100644 index 000000000000..c15e20b5611c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallableTest.java @@ -0,0 +1,102 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ConvertExceptionCallableTest { + + @Test + public void rstStreamExceptionConvertedToRetryableTest() { + ApiException originalException = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + assertFalse(originalException.isRetryable()); + SettableExceptionCallable settableExceptionCallable = + new SettableExceptionCallable<>(originalException); + ConvertExceptionCallable convertStreamExceptionCallable = + new ConvertExceptionCallable<>(settableExceptionCallable); + + Throwable actualError = null; + try { + convertStreamExceptionCallable.all().call("fake-request"); + } catch (Throwable t) { + actualError = t; + } + assert actualError instanceof InternalException; + InternalException actualException = (InternalException) actualError; + assertTrue(actualException.isRetryable()); + } + + @Test + public void retriableAuthExceptionConvertedToRetryableTest() { + ApiException originalException = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "Authentication backend internal server error. Please retry")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + assertFalse(originalException.isRetryable()); + SettableExceptionCallable settableExceptionCallable = + new SettableExceptionCallable<>(originalException); + ConvertExceptionCallable convertStreamExceptionCallable = + new ConvertExceptionCallable<>(settableExceptionCallable); + + Throwable actualError = null; + try { + convertStreamExceptionCallable.all().call("fake-request"); + } catch (Throwable t) { + actualError = t; + } + assert actualError instanceof InternalException; + InternalException actualException = (InternalException) actualError; + assertTrue(actualException.isRetryable()); + } + + private static final class SettableExceptionCallable + extends ServerStreamingCallable { + private final Throwable throwable; + + public SettableExceptionCallable(Throwable throwable) { + this.throwable = throwable; + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + responseObserver.onError(throwable); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java new file mode 100644 index 000000000000..3fd220490593 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java @@ -0,0 +1,850 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.MetadataSubject.assertThat; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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.bigtable.v2.StreamContinuationToken; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataClientFactory; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.collect.Lists; +import io.grpc.ForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class CookiesHolderTest { + private static final Metadata.Key ROUTING_COOKIE_1 = + Metadata.Key.of("x-goog-cbt-cookie-routing", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key ROUTING_COOKIE_2 = + Metadata.Key.of("x-goog-cbt-cookie-random", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key ROUTING_COOKIE_HEADER = + Metadata.Key.of("x-goog-cbt-cookie-header", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key BAD_KEY = + Metadata.Key.of("x-goog-cbt-not-cookie", Metadata.ASCII_STRING_MARSHALLER); + + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final String testHeaderCookie = "header-cookie"; + private static final String testCookie = "test-routing-cookie"; + private static final String routingCookie1Header = "should-be-overridden"; + + private Server server; + private final FakeService fakeService = new FakeService(); + private BigtableDataSettings.Builder settings; + private BigtableDataClient client; + private final List serverMetadata = Collections.synchronizedList(new ArrayList<>()); + + private final Set methods = Collections.synchronizedSet(new HashSet<>()); + + @Before + public void setup() throws Exception { + ServerInterceptor serverInterceptor = + new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + serverMetadata.add(metadata); + if (metadata.containsKey(ROUTING_COOKIE_1)) { + methods.add(serverCall.getMethodDescriptor().getBareMethodName()); + } + + Metadata responseHeaders = new Metadata(); + responseHeaders.put(ROUTING_COOKIE_HEADER, testHeaderCookie); + responseHeaders.put(ROUTING_COOKIE_1, routingCookie1Header); + serverCall.sendHeaders(responseHeaders); + + return serverCallHandler.startCall( + new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { + @Override + public void sendHeaders(Metadata responseHeaders) { + // headers already sent! + } + }, + metadata); + } + }; + + server = FakeServiceBuilder.create(fakeService).intercept(serverInterceptor).start(); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance"); + + // Override CheckAndMutate and ReadModifyWrite retry settings here. These operations + // are currently not retryable but this could change in the future after we + // have routing cookie sends back meaningful information and changes how retry works. + // Routing cookie still needs to be respected and handled by the callables. + settings + .stubSettings() + .checkAndMutateRowSettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(2) + .build()) + .setRetryableCodes(StatusCode.Code.UNAVAILABLE); + + settings + .stubSettings() + .readModifyWriteRowSettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setMaxAttempts(2) + .build()) + .setRetryableCodes(StatusCode.Code.UNAVAILABLE); + + this.settings = settings; + + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() throws Exception { + if (client != null) { + client.close(); + } + if (server != null) { + server.shutdown(); + } + } + + @Test + public void testReadRows() { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "readRows", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testReadRow() { + client.readRow(TABLE_ID, "key"); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "readRows", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testMutateRows() { + client.bulkMutateRows( + BulkMutation.create(TABLE_ID).add(RowMutationEntry.create("key").setCell("cf", "q", "v"))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "mutateRows", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testMutateRow() { + client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "mutateRow", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testSampleRowKeys() { + + client.sampleRowKeys(TABLE_ID); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "sampleRowKeys", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testReadChangeStream() { + for (ChangeStreamRecord ignored : + client.readChangeStream(ReadChangeStreamQuery.create("table"))) {} + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "readChangeStream", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testGenerateInitialChangeStreamPartition() { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("table")); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + // generateInitialChangeStreamPartition uses SimpleStreamResumptionStrategy which means + // it can't resume from the middle of the stream. So we are not able to send a header + // for error responses. + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "generateInitialChangeStreamPartitions", + ROUTING_COOKIE_2.name(), + testCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testPrepareQuery() { + client.prepareStatement("SELECT * FROM table", new HashMap<>()); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "prepareQuery", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedReadRows() { + fakeService.returnCookie = false; + + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name()); + // Should contain initial metadata + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedReadRow() { + fakeService.returnCookie = false; + + client.readRow(TABLE_ID, "key"); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedMutateRows() { + fakeService.returnCookie = false; + + client.bulkMutateRows( + BulkMutation.create(TABLE_ID).add(RowMutationEntry.create("key").setCell("cf", "q", "v"))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedMutateRow() { + fakeService.returnCookie = false; + + client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedSampleRowKeys() { + fakeService.returnCookie = false; + + client.sampleRowKeys(TABLE_ID); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedReadChangeStream() { + fakeService.returnCookie = false; + + for (ChangeStreamRecord ignored : + client.readChangeStream(ReadChangeStreamQuery.create("table"))) {} + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedGenerateInitialChangeStreamParition() { + fakeService.returnCookie = false; + + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("table")); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testNoCookieSucceedPrepareQuery() { + fakeService.returnCookie = false; + + client.prepareStatement("SELECT * FROM table", new HashMap<>()); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_2.name(), BAD_KEY.name()); + assertThat(lastMetadata).containsAtLeast(ROUTING_COOKIE_1.name(), routingCookie1Header); + + serverMetadata.clear(); + } + + @Test + public void testCookiesInHeaders() throws Exception { + // Send 2 cookies in the headers, with routingCookieKey and ROUTING_COOKIE_2. ROUTING_COOKIE_2 + // is also sent in the trailers so the value should be overridden. + final Metadata.Key routingCookieKey = + Metadata.Key.of("x-goog-cbt-cookie-no-override", Metadata.ASCII_STRING_MARSHALLER); + final String routingCookieValue = "no-override"; + ServerInterceptor serverInterceptor = + new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + serverMetadata.add(metadata); + + metadata.put(routingCookieKey, routingCookieValue); + return serverCallHandler.startCall( + new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { + @Override + public void sendHeaders(Metadata headers) { + headers.put(routingCookieKey, routingCookieValue); + headers.put(ROUTING_COOKIE_2, "will-be-overridden"); + super.sendHeaders(headers); + } + }, + metadata); + } + }; + + Server newServer = null; + try { + newServer = FakeServiceBuilder.create(fakeService).intercept(serverInterceptor).start(); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilderForEmulator(newServer.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance"); + + try (BigtableDataClient client = BigtableDataClient.create(settings.build())) { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.readRows(Query.create(TableId.of("table")))); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_2.name(), testCookie, routingCookieKey.name(), routingCookieValue); + } + } finally { + if (newServer != null) { + newServer.shutdown(); + } + } + } + + @Test + public void testAllMethodsAreCalled() { + // This test ensures that all methods respect the retry cookie except for the ones that are + // explicitly added to the methods list. It requires that any newly method is exercised in this + // test. This is enforced by introspecting grpc method descriptors. + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + + fakeService.count.set(0); + client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")); + + fakeService.count.set(0); + client.bulkMutateRows( + BulkMutation.create(TABLE_ID).add(RowMutationEntry.create("key").setCell("cf", "q", "v"))); + + fakeService.count.set(0); + client.sampleRowKeys(TABLE_ID); + + fakeService.count.set(0); + client.checkAndMutateRow( + ConditionalRowMutation.create(TABLE_ID, "key") + .then(Mutation.create().setCell("cf", "q", "v"))); + + fakeService.count.set(0); + client.readModifyWriteRow(ReadModifyWriteRow.create(TABLE_ID, "key").append("cf", "q", "v")); + + fakeService.count.set(0); + @SuppressWarnings({ + "MismatchedQueryAndUpdateOfCollection", + "UnusedVariable", + "ModifiedButNotUsed" + }) + ArrayList ignored2 = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("fake-table")); + + fakeService.count.set(0); + for (@SuppressWarnings("UnusedVariable") + ChangeStreamRecord ignored1 : + client.readChangeStream(ReadChangeStreamQuery.create("fake-table"))) {} + + fakeService.count.set(0); + client.prepareStatement("SELECT * FROM table", new HashMap<>()); + + Set expected = + BigtableGrpc.getServiceDescriptor().getMethods().stream() + .map(MethodDescriptor::getBareMethodName) + .collect(Collectors.toSet()); + + // Exclude methods that are not supported by routing cookie + methods.add("PingAndWarm"); + methods.add("ExecuteQuery"); // TODO remove when retries are implemented + + // Session APIs. Routing cookie is handled differently + methods.add("OpenAuthorizedView"); + methods.add("OpenMaterializedView"); + methods.add("GetClientConfiguration"); + methods.add("OpenTable"); + + assertThat(methods).containsExactlyElementsIn(expected); + } + + @Test + public void testCookieSetWithBigtableClientFactory() throws Exception { + try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(settings.build())) { + BigtableDataClient client1 = factory.createDefault(); + BigtableDataClient client2 = factory.createForAppProfile("app-profile"); + + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client1.readRows(Query.create(TABLE_ID))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "readRows", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + // Reset fake service status + fakeService.count.set(0); + serverMetadata.clear(); + + @SuppressWarnings({ + "MismatchedQueryAndUpdateOfCollection", + "UnusedVariable", + "ModifiedButNotUsed" + }) + ArrayList ignored2 = Lists.newArrayList(client2.readRows(Query.create(TABLE_ID))); + + assertThat(fakeService.count.get()).isGreaterThan(1); + assertThat(serverMetadata).hasSize(fakeService.count.get()); + + lastMetadata = serverMetadata.get(fakeService.count.get() - 1); + + assertThat(lastMetadata) + .containsAtLeast( + ROUTING_COOKIE_1.name(), + "readRows", + ROUTING_COOKIE_2.name(), + testCookie, + ROUTING_COOKIE_HEADER.name(), + testHeaderCookie); + assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name()); + + serverMetadata.clear(); + } + } + + static class FakeService extends BigtableGrpc.BigtableImplBase { + + private volatile boolean returnCookie = true; + private final AtomicInteger count = new AtomicInteger(); + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "readRows"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(ReadRowsResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "mutateRow"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "mutateRows"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext( + MutateRowsResponse.newBuilder() + .addEntries(MutateRowsResponse.Entry.getDefaultInstance()) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void sampleRowKeys( + SampleRowKeysRequest request, StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "sampleRowKeys"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(SampleRowKeysResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, + StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "checkAndMutate"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, + StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "readModifyWrite"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(ReadModifyWriteRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void readChangeStream( + ReadChangeStreamRequest request, + StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "readChangeStream"); + responseObserver.onNext( + ReadChangeStreamResponse.newBuilder() + .setHeartbeat( + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setContinuationToken( + StreamContinuationToken.newBuilder().setToken("a").build()) + .build()) + .build()); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext( + ReadChangeStreamResponse.newBuilder() + .setCloseStream(ReadChangeStreamResponse.CloseStream.getDefaultInstance()) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void generateInitialChangeStreamPartitions( + GenerateInitialChangeStreamPartitionsRequest request, + StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "generateInitialChangeStreamPartitions"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext(GenerateInitialChangeStreamPartitionsResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void prepareQuery( + PrepareQueryRequest request, StreamObserver responseObserver) { + if (count.getAndIncrement() < 1) { + Metadata trailers = new Metadata(); + maybePopulateCookie(trailers, "prepareQuery"); + StatusRuntimeException exception = new StatusRuntimeException(Status.UNAVAILABLE, trailers); + responseObserver.onError(exception); + return; + } + responseObserver.onNext( + // Need to set metadata for response to parse + PrepareQueryResponse.newBuilder() + .setMetadata(metadata(columnMetadata("foo", stringType()))) + .build()); + responseObserver.onCompleted(); + } + + private void maybePopulateCookie(Metadata trailers, String label) { + if (returnCookie) { + trailers.put(ROUTING_COOKIE_1, label); + trailers.put(ROUTING_COOKIE_2, testCookie); + trailers.put(BAD_KEY, "bad-key"); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java new file mode 100644 index 000000000000..5a493653a7cf --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java @@ -0,0 +1,315 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.batching.DynamicFlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.common.collect.Lists; +import io.grpc.Status.Code; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class DynamicFlowControlCallableTest { + @Rule public Timeout timeout = new Timeout(1, TimeUnit.MINUTES); + + private static final int TARGET_LATENCY_MS = 100; + private static final long ADJUSTING_INTERVAL_MS = TimeUnit.SECONDS.toMillis(20); + private static final String LATENCY_HEADER = "latency"; + private static final long INITIAL_ELEMENT = 20L; + private static final long MAX_ELEMENT = 30L; + private static final long MIN_ELEMENT = 5L; + private static final int DEADLINE_EXCEEDED_LATENCY = 501; + + private FlowController flowController; + private DynamicFlowControlStats stats; + private UnaryCallable innerCallable; + private ApiCallContext context; + private MutateRowsRequest request; + + private DynamicFlowControlCallable callableToTest; + + @Before + public void setup() { + flowController = + new FlowController( + DynamicFlowControlSettings.newBuilder() + .setInitialOutstandingElementCount(INITIAL_ELEMENT) + .setMaxOutstandingElementCount(MAX_ELEMENT) + .setMinOutstandingElementCount(MIN_ELEMENT) + .setInitialOutstandingRequestBytes(15L) + .setMaxOutstandingRequestBytes(15L) + .setMinOutstandingRequestBytes(15L) + .setLimitExceededBehavior(LimitExceededBehavior.Block) + .build()); + stats = new DynamicFlowControlStats(); + context = GrpcCallContext.createDefault(); + innerCallable = new MockInnerCallable(); + request = + MutateRowsRequest.newBuilder() + .addEntries(MutateRowsRequest.Entry.getDefaultInstance()) + .build(); + callableToTest = + new DynamicFlowControlCallable( + innerCallable, flowController, stats, TARGET_LATENCY_MS, ADJUSTING_INTERVAL_MS); + } + + @After + public void cleanup() { + // reset last adjustedTimestamp after each test + stats.setLastAdjustedTimestampMs(stats.getLastAdjustedTimestampMs(), 0); + } + + @Test + public void testLatenciesAreRecorded() throws Exception { + DynamicFlowControlCallable callableToTest = + new DynamicFlowControlCallable( + // significantly increase targetLatency to ensure that slow CI runners dont accidentally + // trigger a resize + innerCallable, flowController, stats, TARGET_LATENCY_MS * 10, ADJUSTING_INTERVAL_MS); + Map> extraHeaders = new HashMap<>(); + extraHeaders.put(LATENCY_HEADER, Arrays.asList("5")); + ApiCallContext newContext = context.withExtraHeaders(extraHeaders); + ApiFuture future = callableToTest.futureCall(request, newContext); + future.get(); + assertThat(stats.getMeanLatency()).isNonZero(); + assertThat(stats.getLastAdjustedTimestampMs()).isEqualTo(0); + } + + @Test + public void testTriggeringAdjustingThreshold() throws Exception { + Map> extraHeaders = new HashMap<>(); + extraHeaders.put(LATENCY_HEADER, Arrays.asList(String.valueOf(TARGET_LATENCY_MS * 4))); + long currentTimeMs = System.currentTimeMillis(); + ApiCallContext newContext = context.withExtraHeaders(extraHeaders); + ApiFuture future = callableToTest.futureCall(request, newContext); + future.get(); + assertThat(stats.getMeanLatency()) + .isAtLeast(TARGET_LATENCY_MS * DynamicFlowControlCallable.VERY_HIGH_LATENCY_MULTIPLIER); + assertThat(stats.getLastAdjustedTimestampMs()).isGreaterThan(currentTimeMs); + long expectedStep = + Math.round( + MAX_ELEMENT * DynamicFlowControlCallable.VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE); + assertThat(flowController.getCurrentElementCountLimit()) + .isEqualTo(INITIAL_ELEMENT - expectedStep); + } + + @Test + public void testNoConsecutiveUpdatesToThreshold() throws Exception { + Map> extraHeaders = new HashMap<>(); + extraHeaders.put(LATENCY_HEADER, Arrays.asList(String.valueOf(TARGET_LATENCY_MS * 4))); + long firstRequest = System.currentTimeMillis(); + ApiCallContext newContext = context.withExtraHeaders(extraHeaders); + ApiFuture future = callableToTest.futureCall(request, newContext); + future.get(); + long secondRequest = System.currentTimeMillis(); + future = callableToTest.futureCall(request, newContext); + future.get(); + assertThat(stats.getMeanLatency()) + .isAtLeast(TARGET_LATENCY_MS * DynamicFlowControlCallable.VERY_HIGH_LATENCY_MULTIPLIER); + assertThat(stats.getLastAdjustedTimestampMs()).isGreaterThan(firstRequest); + assertThat(stats.getLastAdjustedTimestampMs()).isAtMost(secondRequest); + long expectedStep = + Math.round( + MAX_ELEMENT * DynamicFlowControlCallable.VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE); + assertThat(flowController.getCurrentElementCountLimit()) + .isEqualTo(INITIAL_ELEMENT - expectedStep); + } + + @Test + public void testDecreasingThresholdsCantGoOverLimit() throws Exception { + // set adjusting intervals to 0 so the thresholds can keep getting updated + callableToTest = + new DynamicFlowControlCallable(innerCallable, flowController, stats, TARGET_LATENCY_MS, 0); + Map> extraHeaders = new HashMap<>(); + extraHeaders.put(LATENCY_HEADER, Arrays.asList(String.valueOf(TARGET_LATENCY_MS * 4))); + ApiCallContext newContext = context.withExtraHeaders(extraHeaders); + List futures = new ArrayList<>(); + for (int i = 0; i < 3; i++) { + ApiFuture future = callableToTest.futureCall(request, newContext); + futures.add(future); + } + for (Future f : futures) { + f.get(); + } + long expectedStep = + Math.round( + MAX_ELEMENT + * DynamicFlowControlCallable.VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE) + * 3; + assertThat(INITIAL_ELEMENT - expectedStep).isLessThan(MIN_ELEMENT); + assertThat(flowController.getCurrentElementCountLimit()).isEqualTo(MIN_ELEMENT); + } + + @Test + public void testIncreasingThreshold() throws Exception { + // Test when there was flow control events and mean latency is low, increase the thresholds + callableToTest = + new DynamicFlowControlCallable( + innerCallable, flowController, stats, 1000, ADJUSTING_INTERVAL_MS); + createFlowControlEvent(flowController); + ApiFuture future = callableToTest.futureCall(request, context); + future.get(); + long expectedIncrease = + Math.round(MAX_ELEMENT * DynamicFlowControlCallable.LOW_LATENCY_INCREASE_CONCURRENCY_RATE); + assertThat(expectedIncrease).isNotEqualTo(0); + assertThat(INITIAL_ELEMENT + expectedIncrease).isLessThan(MAX_ELEMENT); + assertThat(flowController.getCurrentElementCountLimit()) + .isEqualTo(INITIAL_ELEMENT + expectedIncrease); + } + + @Test + public void testIncreasingThresholdCantGoOverLimit() throws Exception { + // set adjusting interval to 0 so it can be updated multiple times + callableToTest = new DynamicFlowControlCallable(innerCallable, flowController, stats, 1000, 0); + createFlowControlEvent(flowController); + List futures = new ArrayList<>(); + for (int i = 0; i < 20; i++) { + ApiFuture future = callableToTest.futureCall(request, context); + futures.add(future); + } + for (Future f : futures) { + f.get(); + } + long expectedIncrease = + Math.round(MAX_ELEMENT * DynamicFlowControlCallable.LOW_LATENCY_INCREASE_CONCURRENCY_RATE) + * 20; + assertThat(INITIAL_ELEMENT + expectedIncrease).isGreaterThan(MAX_ELEMENT); + assertThat(flowController.getCurrentElementCountLimit()).isEqualTo(MAX_ELEMENT); + } + + @Test + public void testConcurrentUpdates() throws Exception { + callableToTest = + new DynamicFlowControlCallable( + innerCallable, flowController, stats, 1000, ADJUSTING_INTERVAL_MS); + createFlowControlEvent(flowController); + List futures = new ArrayList<>(); + for (int i = 0; i < 20; i++) { + ApiFuture future = callableToTest.futureCall(request, context); + futures.add(future); + } + for (Future f : futures) { + f.get(); + } + // should only be updated once + long expectedIncrease = + Math.round(MAX_ELEMENT * DynamicFlowControlCallable.LOW_LATENCY_INCREASE_CONCURRENCY_RATE); + assertThat(expectedIncrease).isNotEqualTo(0); + assertThat(INITIAL_ELEMENT + expectedIncrease).isLessThan(MAX_ELEMENT); + assertThat(flowController.getCurrentElementCountLimit()) + .isEqualTo(INITIAL_ELEMENT + expectedIncrease); + } + + @Test + public void testDeadlineExceeded() throws Exception { + // very high latency with deadline exceeded exception, limits should be decreased + Map> extraHeaders = new HashMap<>(); + extraHeaders.put(LATENCY_HEADER, Arrays.asList(String.valueOf(DEADLINE_EXCEEDED_LATENCY))); + @SuppressWarnings("VariableUnused") + ApiFuture ignored = + callableToTest.futureCall(request, context.withExtraHeaders(extraHeaders)); + assertThat(flowController.getCurrentElementCountLimit()) + .isEqualTo( + INITIAL_ELEMENT + - Math.round( + MAX_ELEMENT + * DynamicFlowControlCallable.VERY_HIGH_LATENCY_DECREASE_CONCURRENCY_RATE)); + } + + static class MockInnerCallable + extends UnaryCallable> { + List response = Lists.newArrayList(); + + @Override + public ApiFuture> futureCall( + MutateRowsRequest request, ApiCallContext context) { + List latencyHeader = context.getExtraHeaders().get(LATENCY_HEADER); + if (latencyHeader != null) { + try { + Thread.sleep(Integer.valueOf(latencyHeader.get(0))); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return ApiFutures.immediateFailedFuture( + new IllegalStateException( + "Interrupted while sleeping as requested: " + latencyHeader, e)); + } + if (Integer.valueOf(latencyHeader.get(0)) == DEADLINE_EXCEEDED_LATENCY) { + return ApiFutures.immediateFailedFuture( + new DeadlineExceededException( + "deadline exceeded", null, GrpcStatusCode.of(Code.DEADLINE_EXCEEDED), false)); + } + } + return ApiFutures.immediateFuture(response); + } + } + + private void createFlowControlEvent(final FlowController flowController) throws Exception { + flowController.reserve(INITIAL_ELEMENT, 0); + CompletableFuture threadStarted = new CompletableFuture<>(); + CompletableFuture threadReservedOne = new CompletableFuture<>(); + Thread t = + new Thread( + new Runnable() { + @Override + public void run() { + threadStarted.complete(null); + try { + flowController.reserve(1, 0); + threadReservedOne.complete(null); + } catch (Exception e) { + threadReservedOne.completeExceptionally(e); + } + } + }); + t.start(); + // Wait 50 milliseconds after the thread has started to make sure + // flowController.reserve(1, 0) is blocked and creates a throttling event. It should never take + // so long. + threadStarted.get(); + Thread.sleep(50); + flowController.release(INITIAL_ELEMENT, 0); + threadReservedOne.get(); + flowController.release(1, 0); + + assertThat(flowController.getFlowControlEventStats().getLastFlowControlEvent()).isNotNull(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStatsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStatsTest.java new file mode 100644 index 000000000000..8863b4a1a98a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStatsTest.java @@ -0,0 +1,95 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiClock; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class DynamicFlowControlStatsTest { + + @Rule public final MockitoRule rule = MockitoJUnit.rule(); + + @Mock private ApiClock clock; + + @Test + public void testUpdate() { + + Mockito.when(clock.millisTime()).thenReturn(0L); + DynamicFlowControlStats stats = new DynamicFlowControlStats(0.015, clock); + stats.updateLatency(10); + assertThat(stats.getMeanLatency()).isEqualTo(10); + stats.updateLatency(10); + stats.updateLatency(10); + assertThat(stats.getMeanLatency()).isEqualTo(10); + + // In five minutes the previous latency should be decayed to under 1. And the new average should + // be very close to 20 + Mockito.when(clock.millisTime()).thenReturn(TimeUnit.MINUTES.toMillis(5)); + stats.updateLatency(20); + assertThat(stats.getMeanLatency()).isGreaterThan(19); + assertThat(stats.getMeanLatency()).isLessThan(20); + + // After a day + long aDay = TimeUnit.DAYS.toMillis(1); + for (int i = 0; i < 10; i++) { + Mockito.when(clock.millisTime()).thenReturn(aDay + TimeUnit.SECONDS.toMillis(i)); + stats.updateLatency(i); + } + assertThat(stats.getMeanLatency()).isGreaterThan(4.5); + assertThat(stats.getMeanLatency()).isLessThan(6); + } + + @Test(timeout = 1000) + public void testConcurrentUpdates() throws InterruptedException, ExecutionException { + final DynamicFlowControlStats stats = new DynamicFlowControlStats(); + ExecutorService executor = Executors.newCachedThreadPool(); + List> futures = new ArrayList<>(); + for (int i = 1; i <= 50; i++) { + final long latency = i; + Runnable r = + new Runnable() { + @Override + public void run() { + stats.updateLatency(latency); + } + }; + futures.add(executor.submit(r)); + } + for (Future f : futures) { + f.get(); + } + // Mean should be around 50 / 2 = 25 + assertThat(stats.getMeanLatency()).isGreaterThan(20); + assertThat(stats.getMeanLatency()).isLessThan(30); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java new file mode 100644 index 000000000000..b974649a53d1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java @@ -0,0 +1,117 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +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.TableId; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.RejectedExecutionException; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Ensures that closing a client during exponential retry will not hang any requests. */ +@RunWith(JUnit4.class) +public class EnhancedBigtableStubCloseRetryTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + + private ExecutorService testExecutor; + private BlockingQueue requests; + + private Server server; + private EnhancedBigtableStub stub; + + @Before + public void setUp() throws Exception { + testExecutor = Executors.newCachedThreadPool(); + requests = new ArrayBlockingQueue<>(10); + + server = FakeServiceBuilder.create(new FakeBigtable()).start(); + + BigtableDataSettings.Builder settingBuilder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()); + + stub = EnhancedBigtableStub.create(settingBuilder.build().getStubSettings()); + } + + @After + public void tearDown() throws Exception { + testExecutor.shutdown(); + stub.close(); + server.shutdown(); + } + + @Test + public void outstandingRequestsFinishAfterClose() throws Exception { + final ApiFuture> resultFuture = + stub.readRowsCallable().all().futureCall(Query.create(TableId.of("table1"))); + + // wait for the first request to hit the server + requests.take(); + // wait enough time for a retry attempt to be scheduled before closing the client + Thread.sleep(100); + stub.close(); + + ExecutionException error = + Assert.assertThrows( + ExecutionException.class, + new ThrowingRunnable() { + @Override + public void run() throws Throwable { + resultFuture.get(); + } + }); + + assertThat(error.getCause()).isInstanceOf(RejectedExecutionException.class); + } + + class FakeBigtable extends BigtableGrpc.BigtableImplBase { + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + + requests.add(request); + // Keep returning a retriable error + responseObserver.onError(Status.UNAVAILABLE.asRuntimeException()); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java new file mode 100644 index 000000000000..74d05e37fea2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java @@ -0,0 +1,119 @@ +/* + * 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static java.util.concurrent.TimeUnit.MINUTES; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +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.TableId; +import com.google.common.util.concurrent.SettableFuture; +import io.grpc.Server; +import io.grpc.stub.StreamObserver; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Ensure that an outstanding RPC will finish during a close */ +@RunWith(JUnit4.class) +public class EnhancedBigtableStubCloseTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + + private ExecutorService testExecutor; + private SettableFuture requestReceivedBarrier = SettableFuture.create(); + private SettableFuture clientClosedBarrier = SettableFuture.create(); + + private Server server; + private EnhancedBigtableStub stub; + + @Before + public void setUp() throws Exception { + testExecutor = Executors.newCachedThreadPool(); + requestReceivedBarrier = SettableFuture.create(); + clientClosedBarrier = SettableFuture.create(); + + server = FakeServiceBuilder.create(new FakeBigtable()).start(); + + EnhancedBigtableStubSettings stubSettings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build() + .getStubSettings(); + + stub = EnhancedBigtableStub.create(stubSettings); + } + + @After + public void tearDown() throws Exception { + testExecutor.shutdown(); + stub.close(); + server.shutdown(); + } + + @Test + public void outstandingRequestsFinishAfterClose() throws Exception { + ApiFuture> resultFuture = + stub.readRowsCallable().all().futureCall(Query.create(TableId.of("table1"))); + + // Wait for the server to receive the request + requestReceivedBarrier.get(1, MINUTES); + // Close the client - must happen in a separate thread because close will block until all + // requests have completed, which can't happen until the clientClosedBarrier is released. + @SuppressWarnings("UnusedVariable") + Future ignored = testExecutor.submit(() -> stub.close()); + Thread.sleep(200); // give the closer a chance to run + clientClosedBarrier.set(null); + + assertThat(resultFuture.get(1, MINUTES)).isEmpty(); + } + + class FakeBigtable extends BigtableGrpc.BigtableImplBase { + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + + // signal that server received the request + requestReceivedBarrier.set(null); + // wait until the main thread closes the client + try { + clientClosedBarrier.get(); + } catch (Exception e) { + // Shouldn't happen + responseObserver.onError(e); + } + + // send the response + responseObserver.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java new file mode 100644 index 000000000000..971f2646263e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java @@ -0,0 +1,1003 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.WatchdogProvider; +import com.google.auth.Credentials; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +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.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Range; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +@SuppressWarnings("deprecation") // TODO: remove this +public class EnhancedBigtableStubSettingsTest { + @Test + public void instanceNameIsRequiredTest() { + EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder(); + + Throwable error = null; + try { + builder.build(); + } catch (Throwable t) { + error = t; + } + + assertThat(error).isInstanceOf(IllegalStateException.class); + } + + @Test + public void settingsAreNotLostTest() { + String projectId = "my-project"; + String instanceId = "my-instance"; + String appProfileId = "my-app-profile-id"; + boolean isRefreshingChannel = false; + String endpoint = "some.other.host:123"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + WatchdogProvider watchdogProvider = Mockito.mock(WatchdogProvider.class); + Duration watchdogInterval = Duration.ofSeconds(12); + String metricsEndpoint = "test-endpoint:443"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .setAppProfileId(appProfileId) + .setRefreshingChannel(isRefreshingChannel) + .setEndpoint(endpoint) + .setCredentialsProvider(credentialsProvider) + .setStreamWatchdogProvider(watchdogProvider) + .setStreamWatchdogCheckInterval(watchdogInterval) + .setMetricsEndpoint(metricsEndpoint); + + verifyBuilder( + builder, + projectId, + instanceId, + appProfileId, + isRefreshingChannel, + endpoint, + credentialsProvider, + watchdogProvider, + watchdogInterval, + metricsEndpoint); + verifySettings( + builder.build(), + projectId, + instanceId, + appProfileId, + isRefreshingChannel, + endpoint, + credentialsProvider, + watchdogProvider, + watchdogInterval, + metricsEndpoint); + verifyBuilder( + builder.build().toBuilder(), + projectId, + instanceId, + appProfileId, + isRefreshingChannel, + endpoint, + credentialsProvider, + watchdogProvider, + watchdogInterval, + metricsEndpoint); + } + + private void verifyBuilder( + EnhancedBigtableStubSettings.Builder builder, + String projectId, + String instanceId, + String appProfileId, + boolean isRefreshingChannel, + String endpoint, + CredentialsProvider credentialsProvider, + WatchdogProvider watchdogProvider, + Duration watchdogInterval, + String metricsEndpoint) { + assertThat(builder.getProjectId()).isEqualTo(projectId); + assertThat(builder.getInstanceId()).isEqualTo(instanceId); + assertThat(builder.getAppProfileId()).isEqualTo(appProfileId); + assertThat(builder.isRefreshingChannel()).isEqualTo(isRefreshingChannel); + assertThat(builder.getEndpoint()).isEqualTo(endpoint); + assertThat(builder.getCredentialsProvider()).isEqualTo(credentialsProvider); + assertThat(builder.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); + assertThat(builder.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); + assertThat(builder.getMetricsEndpoint()).isEqualTo(metricsEndpoint); + } + + private void verifySettings( + EnhancedBigtableStubSettings settings, + String projectId, + String instanceId, + String appProfileId, + boolean isRefreshingChannel, + String endpoint, + CredentialsProvider credentialsProvider, + WatchdogProvider watchdogProvider, + Duration watchdogInterval, + String metricsEndpoint) { + assertThat(settings.getProjectId()).isEqualTo(projectId); + assertThat(settings.getInstanceId()).isEqualTo(instanceId); + assertThat(settings.getAppProfileId()).isEqualTo(appProfileId); + assertThat(settings.isRefreshingChannel()).isEqualTo(isRefreshingChannel); + assertThat(settings.getEndpoint()).isEqualTo(endpoint); + assertThat(settings.getCredentialsProvider()).isEqualTo(credentialsProvider); + assertThat(settings.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); + assertThat(settings.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); + assertThat(settings.getMetricsEndpoint()).isEqualTo(metricsEndpoint); + } + + @Test + public void multipleChannelsByDefaultTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId); + + InstantiatingGrpcChannelProvider provider = + (InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider(); + + assertThat(provider.getChannelPoolSettings().getInitialChannelCount()).isGreaterThan(1); + } + + @Test + public void readRowsIsNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + // Here and everywhere in this test, disable channel priming so we won't need + // authentication for sending the prime request since we're only testing the settings. + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .readRowsSettings() + .setIdleTimeout(Duration.ofMinutes(5)) + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + // Point readRow & bulk read settings must match streaming settings + builder.readRowSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + builder.bulkReadRowsSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + + assertThat(builder.readRowsSettings().getIdleTimeout()).isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.readRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.readRowsSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().readRowsSettings().getIdleTimeout()) + .isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.build().readRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().readRowsSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().readRowsSettings().getIdleTimeout()) + .isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.build().toBuilder().readRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().readRowsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void readRowsHasSaneDefaultsTest() { + ServerStreamingCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().readRowsSettings(); + + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + assertThat(builder.getRetryableCodes()) + .containsExactlyElementsIn( + ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE, Code.ABORTED)); + } + + @Test + public void readRowIsNotLostTest() { + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .readRowSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + // Streaming readRows & bulk read settings must match point lookup settings. + builder.readRowsSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + builder.bulkReadRowsSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + + assertThat(builder.readRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.readRowSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().readRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().readRowSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().readRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().readRowSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void readRowHasSaneDefaultsTest() { + UnaryCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().readRowSettings(); + + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + assertThat(builder.getRetryableCodes()) + .containsExactlyElementsIn( + ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE, Code.ABORTED)); + } + + @Test + public void readRowRetryCodesMustMatch() { + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setRefreshingChannel(false); + + builder.readRowsSettings().setRetryableCodes(Code.DEADLINE_EXCEEDED); + + builder.readRowSettings().setRetryableCodes(Code.ABORTED); + + Exception actualError = null; + try { + builder.build(); + } catch (Exception e) { + actualError = e; + } + assertThat(actualError).isNotNull(); + + builder.readRowSettings().setRetryableCodes(Code.DEADLINE_EXCEEDED); + builder.bulkReadRowsSettings().setRetryableCodes(Code.DEADLINE_EXCEEDED); + + actualError = null; + try { + builder.build(); + } catch (Exception e) { + actualError = e; + } + assertThat(actualError).isNull(); + } + + @Test + public void sampleRowKeysSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .sampleRowKeysSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.sampleRowKeysSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.sampleRowKeysSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().sampleRowKeysSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().sampleRowKeysSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().sampleRowKeysSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().sampleRowKeysSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void sampleRowKeysHasSaneDefaultsTest() { + UnaryCallSettings.Builder> builder = + EnhancedBigtableStubSettings.newBuilder().sampleRowKeysSettings(); + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + } + + @Test + public void mutateRowSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .mutateRowSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.mutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.mutateRowSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().mutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().mutateRowSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().mutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().mutateRowSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void mutateRowHasSaneDefaultsTest() { + UnaryCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().mutateRowSettings(); + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + } + + @Test + public void bulkMutateRowsSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + assertThat(builder.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()).isFalse(); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + long flowControlSetting = 10L; + BatchingSettings batchingSettings = + BatchingSettings.newBuilder() + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(10L) + .setMaxOutstandingRequestBytes(10L) + .build()) + .build(); + long targetLatency = 10L; + builder + .bulkMutateRowsSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .setBatchingSettings(batchingSettings) + .enableLatencyBasedThrottling(targetLatency) + .build(); + + assertThat(builder.bulkMutateRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.bulkMutateRowsSettings().getRetrySettings()).isEqualTo(retrySettings); + assertThat(builder.bulkMutateRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + assertThat(builder.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()).isTrue(); + assertThat(builder.bulkMutateRowsSettings().getTargetRpcLatencyMs()).isEqualTo(targetLatency); + assertThat( + builder + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingElementCount()) + .isEqualTo(flowControlSetting); + assertThat( + builder + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingRequestBytes()) + .isEqualTo(flowControlSetting); + + assertThat(builder.build().bulkMutateRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().bulkMutateRowsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + assertThat(builder.build().bulkMutateRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + assertThat(builder.build().bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()).isTrue(); + assertThat(builder.build().bulkMutateRowsSettings().getTargetRpcLatencyMs()) + .isEqualTo(targetLatency); + assertThat( + builder + .build() + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingElementCount()) + .isEqualTo(flowControlSetting); + assertThat( + builder + .build() + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingRequestBytes()) + .isEqualTo(flowControlSetting); + + assertThat(builder.build().toBuilder().bulkMutateRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().bulkMutateRowsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + assertThat(builder.build().toBuilder().bulkMutateRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + assertThat( + builder.build().toBuilder().bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()) + .isTrue(); + assertThat(builder.build().toBuilder().bulkMutateRowsSettings().getTargetRpcLatencyMs()) + .isEqualTo(targetLatency); + assertThat( + builder.build().toBuilder() + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingElementCount()) + .isEqualTo(flowControlSetting); + assertThat( + builder.build().toBuilder() + .bulkMutateRowsSettings() + .getDynamicFlowControlSettings() + .getMaxOutstandingRequestBytes()) + .isEqualTo(flowControlSetting); + } + + @Test + public void bulkReadRowsSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + BatchingSettings batchingSettings = BatchingSettings.newBuilder().build(); + + builder + .bulkReadRowsSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .setBatchingSettings(batchingSettings) + .build(); + + // Point read & streaming readRows settings must match point lookup settings. + builder.readRowSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + builder.readRowsSettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + + assertThat(builder.bulkReadRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.bulkReadRowsSettings().getRetrySettings()).isEqualTo(retrySettings); + assertThat(builder.bulkReadRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + + assertThat(builder.build().bulkReadRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().bulkReadRowsSettings().getRetrySettings()).isEqualTo(retrySettings); + assertThat(builder.build().bulkReadRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + + assertThat(builder.build().toBuilder().bulkReadRowsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().bulkReadRowsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + assertThat(builder.build().toBuilder().bulkReadRowsSettings().getBatchingSettings()) + .isSameInstanceAs(batchingSettings); + } + + @Test + public void mutateRowsHasSaneDefaultsTest() { + BigtableBatchingCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().bulkMutateRowsSettings(); + + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + + assertThat(builder.getBatchingSettings().getDelayThreshold()) + .isIn(Range.open(Duration.ZERO, Duration.ofMinutes(1))); + assertThat(builder.getBatchingSettings().getElementCountThreshold()) + .isIn(Range.open(0L, 1_000L)); + assertThat(builder.getBatchingSettings().getIsEnabled()).isTrue(); + assertThat(builder.getBatchingSettings().getRequestByteThreshold()) + .isLessThan(256L * 1024 * 1024); + assertThat( + builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingElementCount()) + .isAtMost(20_000L); + assertThat( + builder.getBatchingSettings().getFlowControlSettings().getMaxOutstandingRequestBytes()) + .isLessThan(512L * 1024 * 1024); + } + + @Test + public void checkAndMutateRowSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = RetrySettings.newBuilder().build(); + builder + .checkAndMutateRowSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.checkAndMutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.checkAndMutateRowSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().checkAndMutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().checkAndMutateRowSettings().getRetrySettings()) + .isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().checkAndMutateRowSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().checkAndMutateRowSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void generateInitialChangeStreamPartitionsSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = RetrySettings.newBuilder().build(); + builder + .generateInitialChangeStreamPartitionsSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.generateInitialChangeStreamPartitionsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.generateInitialChangeStreamPartitionsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + + assertThat(builder.build().generateInitialChangeStreamPartitionsSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().generateInitialChangeStreamPartitionsSettings().getRetrySettings()) + .isEqualTo(retrySettings); + + assertThat( + builder.build().toBuilder() + .generateInitialChangeStreamPartitionsSettings() + .getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat( + builder.build().toBuilder() + .generateInitialChangeStreamPartitionsSettings() + .getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void readChangeStreamSettingsAreNotLostTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + RetrySettings retrySettings = RetrySettings.newBuilder().build(); + builder + .readChangeStreamSettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.readChangeStreamSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.readChangeStreamSettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().readChangeStreamSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().readChangeStreamSettings().getRetrySettings()) + .isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().readChangeStreamSettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().readChangeStreamSettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void checkAndMutateRowSettingsAreSane() { + UnaryCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().checkAndMutateRowSettings(); + + // CheckAndMutateRow is not retryable in the case of toggle mutations. So it's disabled by + // default. + assertThat(builder.getRetrySettings().getMaxAttempts()).isAtMost(1); + assertThat(builder.getRetryableCodes()).isEmpty(); + } + + @Test + public void pingAndWarmRetriesAreDisabled() { + UnaryCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().pingAndWarmSettings(); + + assertThat(builder.getRetrySettings().getMaxAttempts()).isAtMost(1); + assertThat(builder.getRetrySettings().getInitialRpcTimeout()).isAtMost(Duration.ofSeconds(30)); + } + + @Test + public void executeQuerySettingsAreNotLost() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + // Here and everywhere in this test, disable channel priming so we won't need + // authentication for sending the prime request since we're only testing the settings. + .setRefreshingChannel(false); + + // Note that we don't support retries yet so the settings won't do anything. + // We still don't want the settings to be dropped though. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .executeQuerySettings() + .setIdleTimeout(Duration.ofMinutes(5)) + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + builder.executeQuerySettings().setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED); + + assertThat(builder.executeQuerySettings().getIdleTimeout()).isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.executeQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.executeQuerySettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().executeQuerySettings().getIdleTimeout()) + .isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.build().executeQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().executeQuerySettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().executeQuerySettings().getIdleTimeout()) + .isEqualTo(Duration.ofMinutes(5)); + assertThat(builder.build().toBuilder().executeQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().executeQuerySettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void executeQueryHasSaneDefaults() { + ServerStreamingCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().executeQuerySettings(); + + // Retries aren't supported right now + // call verifyRetrySettingAreSane when we do + assertThat(builder.getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); + assertThat(builder.getRetrySettings().getInitialRpcTimeout()).isEqualTo(Duration.ofMinutes(30)); + assertThat(builder.getRetrySettings().getMaxRpcTimeout()).isEqualTo(Duration.ofMinutes(30)); + assertThat(builder.getRetrySettings().getMaxAttempts()).isEqualTo(10); + } + + @Test + public void prepareQuerySettingsAreNotLost() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + // Here and everywhere in this test, disable channel priming so we won't need + // authentication for sending the prime request since we're only testing the settings. + .setRefreshingChannel(false); + + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeout(Duration.ofHours(1)) + .setInitialRpcTimeout(Duration.ofSeconds(10)) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofSeconds(10)) + .build(); + + builder + .prepareQuerySettings() + .setRetryableCodes(Code.ABORTED, Code.DEADLINE_EXCEEDED) + .setRetrySettings(retrySettings) + .build(); + + assertThat(builder.prepareQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.prepareQuerySettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().prepareQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().prepareQuerySettings().getRetrySettings()).isEqualTo(retrySettings); + + assertThat(builder.build().toBuilder().prepareQuerySettings().getRetryableCodes()) + .containsAtLeast(Code.ABORTED, Code.DEADLINE_EXCEEDED); + assertThat(builder.build().toBuilder().prepareQuerySettings().getRetrySettings()) + .isEqualTo(retrySettings); + } + + @Test + public void prepareQueryHasSaneDefaults() { + UnaryCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().prepareQuerySettings(); + verifyRetrySettingAreSane(builder.getRetryableCodes(), builder.getRetrySettings()); + } + + private void verifyRetrySettingAreSane(Set retryCodes, RetrySettings retrySettings) { + assertThat(retryCodes).containsAtLeast(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); + + assertThat(retrySettings.getTotalTimeout()).isGreaterThan(Duration.ZERO); + + assertThat(retrySettings.getInitialRetryDelay()).isGreaterThan(Duration.ZERO); + assertThat(retrySettings.getRetryDelayMultiplier()).isAtLeast(1.0); + assertThat(retrySettings.getMaxRetryDelay()).isGreaterThan(Duration.ZERO); + + assertThat(retrySettings.getInitialRpcTimeout()).isGreaterThan(Duration.ZERO); + assertThat(retrySettings.getRpcTimeoutMultiplier()).isAtLeast(1.0); + assertThat(retrySettings.getMaxRpcTimeout()).isGreaterThan(Duration.ZERO); + } + + @Test + public void isRefreshingChannelDefaultValueTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId); + assertThat(builder.isRefreshingChannel()).isTrue(); + } + + @Test + public void isRefreshingChannelFalseValueTest() { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + assertThat(builder.isRefreshingChannel()).isFalse(); + assertThat(builder.build().isRefreshingChannel()).isFalse(); + assertThat(builder.build().toBuilder().isRefreshingChannel()).isFalse(); + } + + static final String[] SETTINGS_LIST = { + "projectId", + "instanceId", + "appProfileId", + "isRefreshingChannel", + "perOpSettings", + "metricsProvider", + "metricsEndpoint", + "areInternalMetricsEnabled", + "jwtAudience", + "directPathConfig", + "sessionsEnabled", + }; + + @Test + public void testToString() { + EnhancedBigtableStubSettings defaultSettings = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId("our-project-85") + .setInstanceId("our-instance-06") + .setAppProfileId("our-appProfile-06") + .setRefreshingChannel(false) + .build(); + + checkToString(defaultSettings); + + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder().setEndpoint("example.com:1234").build(); + + checkToString(settings); + assertThat(settings.toString()).contains("endpoint=example.com:1234"); + + int nonStaticFields = 0; + for (Field field : EnhancedBigtableStubSettings.class.getDeclaredFields()) { + if (!Modifier.isStatic(field.getModifiers())) { + nonStaticFields++; + } + } + // failure will signal about adding a new settings property - feature flag field + assertThat(SETTINGS_LIST.length).isEqualTo(nonStaticFields - 1); + } + + void checkToString(EnhancedBigtableStubSettings settings) { + String projectId = settings.getProjectId(); + String instanceId = settings.getInstanceId(); + String appProfileId = settings.getAppProfileId(); + String isRefreshingChannel = "" + settings.isRefreshingChannel(); + String toString = settings.toString(); + assertThat(toString).isEqualTo(settings.toString()); // no variety + assertThat(toString) + .startsWith( + "EnhancedBigtableStubSettings{projectId=" + + projectId + + ", instanceId=" + + instanceId + + ", appProfileId=" + + appProfileId + + ", isRefreshingChannel=" + + isRefreshingChannel); + for (String subSettings : SETTINGS_LIST) { + assertThat(toString).contains(subSettings + "="); + } + } + + @Test + public void refreshingChannelSetFixedCredentialProvider() throws Exception { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + FakeCredentials expectedCredentials = new FakeCredentials(); + Mockito.when(credentialsProvider.getCredentials()) + .thenReturn(expectedCredentials, new FakeCredentials(), new FakeCredentials()); + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(true) + .setCredentialsProvider(credentialsProvider); + assertThat(builder.isRefreshingChannel()).isTrue(); + } + + private static class FakeCredentials extends Credentials { + @Override + public String getAuthenticationType() { + return "fake"; + } + + @Override + public Map> getRequestMetadata(URI uri) throws IOException { + return ImmutableMap.of("my-header", Arrays.asList("fake-credential")); + } + + @Override + public boolean hasRequestMetadata() { + return true; + } + + @Override + public boolean hasRequestMetadataOnly() { + return true; + } + + @Override + public void refresh() throws IOException {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java new file mode 100644 index 000000000000..a21eb3d707be --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java @@ -0,0 +1,1176 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature; +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.BatcherImpl; +import com.google.api.gax.batching.BatchingException; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.InstantiatingWatchdogProvider; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.WatchdogTimeoutException; +import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.FeatureFlags; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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.RowSet; +import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.admin.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Filters; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream; +import com.google.common.base.Preconditions; +import com.google.common.collect.Queues; +import com.google.common.io.BaseEncoding; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import com.google.protobuf.Timestamp; +import com.google.rpc.Code; +import com.google.rpc.Status; +import io.grpc.CallOptions; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.internal.GrpcUtil; +import io.grpc.stub.StreamObserver; +import io.opencensus.common.Scope; +import io.opencensus.trace.AttributeValue; +import io.opencensus.trace.Tracing; +import io.opencensus.trace.export.SpanData; +import io.opencensus.trace.export.SpanExporter.Handler; +import io.opencensus.trace.samplers.Samplers; +import java.io.IOException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.time.Instant; +import java.util.Base64; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class EnhancedBigtableStubTest { + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String INSTANCE_NAME = NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID); + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final String TABLE_NAME = + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + private static final String APP_PROFILE_ID = "app-profile-id"; + private static final TableId WAIT_TIME_TABLE_ID = TableId.of("test-wait-timeout"); + private static final String WAIT_TIME_QUERY = "test-wait-timeout"; + private static final Duration WATCHDOG_CHECK_DURATION = Duration.ofMillis(100); + private static final PrepareResponse PREPARE_RESPONSE = + PrepareResponse.fromProto( + prepareResponse( + ByteString.copyFromUtf8(WAIT_TIME_QUERY), + metadata(columnMetadata("foo", stringType())))); + private static final PreparedStatement WAIT_TIME_PREPARED_STATEMENT = + preparedStatement(PREPARE_RESPONSE, new HashMap<>()); + + private Server server; + private MetadataInterceptor metadataInterceptor; + private ContextInterceptor contextInterceptor; + private FakeDataService fakeDataService; + private EnhancedBigtableStubSettings defaultSettings; + private EnhancedBigtableStub enhancedBigtableStub; + + @Before + public void setUp() throws IOException, IllegalAccessException, InstantiationException { + metadataInterceptor = new MetadataInterceptor(); + contextInterceptor = new ContextInterceptor(); + fakeDataService = Mockito.spy(new FakeDataService()); + + server = + FakeServiceBuilder.create(fakeDataService) + .intercept(contextInterceptor) + .intercept(metadataInterceptor) + .start(); + + defaultSettings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build() + .getStubSettings(); + + enhancedBigtableStub = EnhancedBigtableStub.create(defaultSettings); + } + + @After + public void tearDown() { + enhancedBigtableStub.close(); + server.shutdown(); + } + + @Test + public void testJwtAudience() + throws InterruptedException, IOException, NoSuchAlgorithmException, ExecutionException { + // Create fake jwt creds + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); + KeyPair keyPair = keyGen.genKeyPair(); + + ServiceAccountJwtAccessCredentials jwtCreds = + ServiceAccountJwtAccessCredentials.newBuilder() + .setClientId("fake-id") + .setClientEmail("fake@example.com") + .setPrivateKey(keyPair.getPrivate()) + .setPrivateKeyId("fake-private-key") + .build(); + + // Create a stub with overridden audience + String expectedAudience = "http://localaudience"; + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(jwtCreds)) + .setJwtAudience(expectedAudience) + .build(); + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + stub.readRowCallable().futureCall(Query.create(TABLE_ID)).get(); + } + // Send rpc and grab the credentials sent + Metadata metadata = metadataInterceptor.headers.take(); + + String authValue = + metadata.get(Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(authValue).isNotNull(); + String expectedPrefix = "Bearer "; + assertThat(authValue).startsWith(expectedPrefix); + String jwtStr = authValue.substring(expectedPrefix.length()); + JsonWebSignature parsed = JsonWebSignature.parse(GsonFactory.getDefaultInstance(), jwtStr); + assertThat(parsed.getPayload().getAudience()).isEqualTo(expectedAudience); + } + + @Test + public void testBatchJwtAudience() + throws InterruptedException, IOException, NoSuchAlgorithmException, ExecutionException { + // Create fake jwt creds + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); + KeyPair keyPair = keyGen.genKeyPair(); + + ServiceAccountJwtAccessCredentials jwtCreds = + ServiceAccountJwtAccessCredentials.newBuilder() + .setClientId("fake-id") + .setClientEmail("fake@example.com") + .setPrivateKey(keyPair.getPrivate()) + .setPrivateKeyId("fake-private-key") + .build(); + + ManagedChannel channel = + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); + + // TODO: remove this suppression when setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + EnhancedBigtableStubSettings settings = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .setEndpoint("batch-bigtable.googleapis.com:443") + .setCredentialsProvider(FixedCredentialsProvider.create(jwtCreds)) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + // Use a fixed channel that will ignore the default endpoint and connect to the emulator + .setTransportChannelProvider( + FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel))) + // Channel refreshing doesn't work with FixedTransportChannelProvider. Disable it for + // the test + .setRefreshingChannel(false) + .build(); + + Metadata metadata; + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + // Send rpc and grab the credentials sent + stub.readRowCallable().futureCall(Query.create(TABLE_ID)).get(); + metadata = metadataInterceptor.headers.take(); + } + channel.shutdown(); + + String authValue = + metadata.get(Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(authValue).isNotNull(); + String expectedPrefix = "Bearer "; + assertThat(authValue).startsWith(expectedPrefix); + String jwtStr = authValue.substring(expectedPrefix.length()); + JsonWebSignature parsed = JsonWebSignature.parse(GsonFactory.getDefaultInstance(), jwtStr); + assertThat(parsed.getPayload().getAudience()).isEqualTo("https://bigtable.googleapis.com/"); + } + + @Test + public void testFeatureFlags() throws InterruptedException, IOException, ExecutionException { + enhancedBigtableStub.readRowCallable().futureCall(Query.create(TABLE_ID)).get(); + Metadata metadata = metadataInterceptor.headers.take(); + + String encodedFeatureFlags = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(encodedFeatureFlags).isNotNull(); + FeatureFlags featureFlags = + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedFeatureFlags)); + + assertThat(featureFlags.getReverseScans()).isTrue(); + assertThat(featureFlags.getLastScannedRowResponses()).isTrue(); + } + + @Test + public void testPingAndWarmFeatureFlags() throws InterruptedException, IOException { + // TODO: remove the suppression once setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder().setRefreshingChannel(true).build(); + try (EnhancedBigtableStub ignored = EnhancedBigtableStub.create(settings)) { + Preconditions.checkState( + !fakeDataService.pingRequests.isEmpty(), "Ping request was not sent during setup"); + Metadata metadata = metadataInterceptor.headers.take(); + + String encodedFeatureFlags = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(encodedFeatureFlags).isNotNull(); + FeatureFlags featureFlags = + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedFeatureFlags)); + + assertThat(featureFlags.getReverseScans()).isTrue(); + assertThat(featureFlags.getLastScannedRowResponses()).isTrue(); + assertThat(featureFlags.getRoutingCookie()).isTrue(); + assertThat(featureFlags.getRetryInfo()).isTrue(); + assertThat(featureFlags.getPeerInfo()).isTrue(); + assertThat(featureFlags.getSessionsCompatible()).isTrue(); + } + } + + @Test + public void testCheckAndMutateRequestResponseConversion() + throws ExecutionException, InterruptedException { + ConditionalRowMutation req = + ConditionalRowMutation.create(TableId.of("my-table"), "my-key") + .condition(Filters.FILTERS.pass()) + .then(Mutation.create().deleteRow()); + + ApiFuture f = enhancedBigtableStub.checkAndMutateRowCallable().futureCall(req, null); + f.get(); + + CheckAndMutateRowRequest protoReq = + fakeDataService.checkAndMutateRowRequests.poll(1, TimeUnit.SECONDS); + assertThat(protoReq) + .isEqualTo(req.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID))); + assertThat(f.get()).isEqualTo(true); + } + + @Test + public void testRMWRequestResponseConversion() throws ExecutionException, InterruptedException { + ReadModifyWriteRow req = + ReadModifyWriteRow.create(TableId.of("my-table"), "my-key").append("f", "q", "v"); + + ApiFuture f = enhancedBigtableStub.readModifyWriteRowCallable().futureCall(req, null); + f.get(); + + ReadModifyWriteRowRequest protoReq = fakeDataService.rmwRequests.poll(1, TimeUnit.SECONDS); + assertThat(protoReq) + .isEqualTo(req.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID))); + assertThat(f.get().getKey()).isEqualTo(ByteString.copyFromUtf8("my-key")); + } + + @Test + public void testMutateRowRequestResponseConversion() + throws ExecutionException, InterruptedException { + RowMutation req = RowMutation.create(TableId.of("my-table"), "my-key").deleteRow(); + CallOptions.Key testKey = CallOptions.Key.create("test-key"); + + GrpcCallContext ctx = + GrpcCallContext.createDefault() + .withCallOptions(CallOptions.DEFAULT.withOption(testKey, "callopt-value")); + ApiFuture f = enhancedBigtableStub.mutateRowCallable().futureCall(req, ctx); + f.get(); + + MutateRowRequest protoReq = fakeDataService.mutateRowRequests.poll(1, TimeUnit.SECONDS); + assertThat(protoReq) + .isEqualTo(req.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID))); + assertThat(f.get()).isEqualTo(null); + } + + @Test + public void testMutateRowRequestParams() throws ExecutionException, InterruptedException { + RowMutation req = RowMutation.create(TABLE_ID, "my-key").deleteRow(); + + ApiFuture f = enhancedBigtableStub.mutateRowCallable().futureCall(req, null); + f.get(); + + Metadata reqMetadata = metadataInterceptor.headers.poll(1, TimeUnit.SECONDS); + assertThat(reqMetadata).isNotNull(); + + // RequestParamsExtractor + String reqParams = + reqMetadata.get(Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(reqParams).contains("table_name=" + TABLE_NAME.replace("/", "%2F")); + assertThat(reqParams).contains(String.format("app_profile_id=%s", APP_PROFILE_ID)); + + // StatsHeadersUnaryCallable + assertThat(reqMetadata.keys()).contains("bigtable-client-attempt-epoch-usec"); + + assertThat(f.get()).isEqualTo(null); + } + + @Test + public void testMutateRowErrorPropagation() { + AtomicInteger invocationCount = new AtomicInteger(); + Mockito.doAnswer( + invocationOnMock -> { + StreamObserver observer = invocationOnMock.getArgument(1); + if (invocationCount.getAndIncrement() == 0) { + observer.onError(io.grpc.Status.UNAVAILABLE.asRuntimeException()); + } else { + observer.onError(io.grpc.Status.FAILED_PRECONDITION.asRuntimeException()); + } + return null; + }) + .when(fakeDataService) + .mutateRow(Mockito.any(), Mockito.any()); + + RowMutation req = RowMutation.create(TABLE_ID, "my-key").deleteRow(); + ApiFuture f = enhancedBigtableStub.mutateRowCallable().futureCall(req, null); + + ExecutionException e = assertThrows(ExecutionException.class, f::get); + assertThat(e.getCause()).isInstanceOf(FailedPreconditionException.class); + assertThat(invocationCount.get()).isEqualTo(2); + } + + @Test + public void testPrepareQueryRequestResponseConversion() + throws ExecutionException, InterruptedException { + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest req = + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest.create( + "SELECT * FROM TABLE", new HashMap<>()); + CallOptions.Key testKey = CallOptions.Key.create("test-key"); + + GrpcCallContext ctx = + GrpcCallContext.createDefault() + .withCallOptions(CallOptions.DEFAULT.withOption(testKey, "callopt-value")); + ApiFuture f = enhancedBigtableStub.prepareQueryCallable().futureCall(req, ctx); + f.get(); + + PrepareQueryRequest protoReq = fakeDataService.prepareRequests.poll(1, TimeUnit.SECONDS); + assertThat(protoReq) + .isEqualTo(req.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID))); + assertThat(f.get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(metadata(columnMetadata("foo", stringType())))); + assertThat(f.get().preparedQuery()).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(f.get().validUntil()).isEqualTo(Instant.ofEpochSecond(1000, 1000)); + } + + @Test + public void testPrepareQueryRequestParams() throws ExecutionException, InterruptedException { + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest req = + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest.create( + "SELECT * FROM TABLE", new HashMap<>()); + + ApiFuture f = + enhancedBigtableStub.prepareQueryCallable().futureCall(req, null); + f.get(); + + Metadata reqMetadata = metadataInterceptor.headers.poll(1, TimeUnit.SECONDS); + assertThat(reqMetadata).isNotNull(); + + // RequestParamsExtractor + String reqParams = + reqMetadata.get(Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER)); + assertThat(reqParams).contains("name=" + INSTANCE_NAME.replace("/", "%2F")); + assertThat(reqParams).contains(String.format("app_profile_id=%s", APP_PROFILE_ID)); + + // StatsHeadersUnaryCallable + assertThat(reqMetadata.keys()).contains("bigtable-client-attempt-epoch-usec"); + + assertThat(f.get().resultSetMetadata()) + .isEqualTo(ProtoResultSetMetadata.fromProto(metadata(columnMetadata("foo", stringType())))); + assertThat(f.get().preparedQuery()).isEqualTo(ByteString.copyFromUtf8("foo")); + assertThat(f.get().validUntil()).isEqualTo(Instant.ofEpochSecond(1000, 1000)); + } + + @Test + public void testPrepareQueryErrorPropagation() { + AtomicInteger invocationCount = new AtomicInteger(); + Mockito.doAnswer( + invocationOnMock -> { + StreamObserver observer = invocationOnMock.getArgument(1); + if (invocationCount.getAndIncrement() == 0) { + observer.onError(io.grpc.Status.UNAVAILABLE.asRuntimeException()); + } else { + observer.onError(io.grpc.Status.FAILED_PRECONDITION.asRuntimeException()); + } + return null; + }) + .when(fakeDataService) + .prepareQuery(Mockito.any(), Mockito.any()); + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest req = + com.google.cloud.bigtable.data.v2.internal.PrepareQueryRequest.create( + "SELECT * FROM TABLE", new HashMap<>()); + ApiFuture f = + enhancedBigtableStub.prepareQueryCallable().futureCall(req, null); + + ExecutionException e = assertThrows(ExecutionException.class, f::get); + assertThat(e.getCause()).isInstanceOf(FailedPreconditionException.class); + assertThat(invocationCount.get()).isEqualTo(2); + } + + @Test + public void testCreateReadRowsCallable() throws InterruptedException { + ServerStreamingCallable streamingCallable = + enhancedBigtableStub.createReadRowsCallable(new DefaultRowAdapter()); + + Query request = Query.create(TableId.of("table-id")).rowKey("row-key"); + streamingCallable.call(request).iterator().next(); + ReadRowsRequest expected = + request.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID)); + assertThat(fakeDataService.popLastRequest()).isEqualTo(expected); + } + + @Test + public void testCreateReadRowsRawCallable() throws InterruptedException { + ServerStreamingCallable callable = + enhancedBigtableStub.createReadRowsRawCallable(new DefaultRowAdapter()); + + ReadRowsRequest expectedRequest = + ReadRowsRequest.newBuilder() + .setTableName(TABLE_NAME) + .setAppProfileId("app-profile-1") + .setRows(RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("test-row-key"))) + .build(); + callable.call(expectedRequest).iterator().next(); + assertThat(fakeDataService.popLastRequest()).isEqualTo(expectedRequest); + + ReadRowsRequest expectedRequest2 = + ReadRowsRequest.newBuilder() + .setTableName(TABLE_NAME) + .setAppProfileId("app-profile-2") + .build(); + callable.call(expectedRequest2).iterator().next(); + assertThat(fakeDataService.popLastRequest()).isEqualTo(expectedRequest2); + } + + @Test + public void testChannelPrimerConfigured() throws IOException { + // TODO: remove the suppression once setRefreshingChannel can be removed + @SuppressWarnings("deprecation") + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder() + .setRefreshingChannel(true) + .setDirectPathConfig(EnhancedBigtableStubSettings.DirectPathConfig.DEFAULT) + .build(); + + try (EnhancedBigtableStub ignored = EnhancedBigtableStub.create(settings)) { + // direct access checker ping + assertThat(fakeDataService.pingRequests).hasSize(2); + } + } + + @Test + public void testUserAgent() throws InterruptedException { + ServerStreamingCallable streamingCallable = + enhancedBigtableStub.createReadRowsCallable(new DefaultRowAdapter()); + + Query request = Query.create(TABLE_ID).rowKey("row-key"); + streamingCallable.call(request).iterator().next(); + + assertThat(metadataInterceptor.headers).hasSize(1); + Metadata metadata = metadataInterceptor.headers.take(); + assertThat(metadata.get(Metadata.Key.of("user-agent", Metadata.ASCII_STRING_MARSHALLER))) + .containsMatch("bigtable-java/\\d+\\.\\d+\\.\\d+(?:-SNAPSHOT)?"); + } + + @Test + public void testSpanAttributes() throws InterruptedException { + final BlockingQueue spans = new ArrayBlockingQueue<>(100); + + // inject a temporary trace exporter + String handlerName = "stub-test-exporter"; + + Tracing.getExportComponent() + .getSpanExporter() + .registerHandler( + handlerName, + new Handler() { + @Override + public void export(Collection collection) { + spans.addAll(collection); + } + }); + + SpanData foundSpanData = null; + // Issue the rpc and grab the span + try { + try (Scope ignored = + Tracing.getTracer() + .spanBuilder("fake-parent-span") + .setSampler(Samplers.alwaysSample()) + .startScopedSpan()) { + enhancedBigtableStub.readRowCallable().call(Query.create(TABLE_ID).rowKey("row-key")); + } + + for (int i = 0; i < 100; i++) { + SpanData spanData = spans.poll(10, TimeUnit.SECONDS); + assertThat(spanData).isNotNull(); + if ("Bigtable.ReadRow".equals(spanData.getName())) { + foundSpanData = spanData; + break; + } + } + } finally { + // cleanup + Tracing.getExportComponent().getSpanExporter().unregisterHandler(handlerName); + } + + // Examine the caught span + assertThat(foundSpanData).isNotNull(); + assertThat(foundSpanData.getAttributes().getAttributeMap()) + .containsEntry("gapic", AttributeValue.stringAttributeValue(Version.VERSION)); + assertThat(foundSpanData.getAttributes().getAttributeMap()) + .containsEntry( + "grpc", + AttributeValue.stringAttributeValue( + GrpcUtil.getGrpcBuildVersion().getImplementationVersion())); + assertThat(foundSpanData.getAttributes().getAttributeMap()) + .containsEntry( + "gax", AttributeValue.stringAttributeValue(GaxGrpcProperties.getGaxGrpcVersion())); + } + + @Test + public void testBulkMutationFlowControllerConfigured() throws Exception { + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("my-project") + .setInstanceId("my-instance") + .setCredentialsProvider(defaultSettings.getCredentialsProvider()) + .enableBatchMutationLatencyBasedThrottling(10L); + + settings + .stubSettings() + .bulkMutateRowsSettings() + .setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(50L) + .setRequestByteThreshold(500L) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100L) + .setMaxOutstandingRequestBytes(1000L) + .setLimitExceededBehavior(LimitExceededBehavior.Block) + .build()) + .build()) + .build(); + + try (EnhancedBigtableStub stub1 = + EnhancedBigtableStub.create(settings.build().getStubSettings()); + EnhancedBigtableStub stub2 = + EnhancedBigtableStub.create(settings.build().getStubSettings())) { + + // Creating 2 batchers from the same stub, they should share the same FlowController and + // FlowControlEventStats + try (BatcherImpl batcher1 = + (BatcherImpl) stub1.newMutateRowsBatcher(TableId.of("my-table1"), null); + BatcherImpl batcher2 = + (BatcherImpl) stub1.newMutateRowsBatcher(TableId.of("my-table2"), null)) { + assertThat(batcher1.getFlowController()).isNotNull(); + assertThat(batcher1.getFlowController().getFlowControlEventStats()).isNotNull(); + assertThat(batcher1).isNotSameInstanceAs(batcher2); + assertThat(batcher1.getFlowController()).isSameInstanceAs(batcher2.getFlowController()); + assertThat(batcher1.getFlowController().getFlowControlEventStats()) + .isSameInstanceAs(batcher2.getFlowController().getFlowControlEventStats()); + // Verify flow controller settings + assertThat(batcher1.getFlowController().getMaxElementCountLimit()).isEqualTo(100L); + assertThat(batcher1.getFlowController().getMaxRequestBytesLimit()).isEqualTo(1000L); + assertThat(batcher1.getFlowController().getCurrentElementCountLimit()).isLessThan(100L); + assertThat(batcher1.getFlowController().getCurrentRequestBytesLimit()).isEqualTo(1000L); + assertThat(batcher1.getFlowController().getMinElementCountLimit()) + .isAtLeast( + settings + .stubSettings() + .bulkMutateRowsSettings() + .getBatchingSettings() + .getElementCountThreshold()); + assertThat(batcher1.getFlowController().getMinRequestBytesLimit()).isEqualTo(1000L); + } + + // Creating 2 batchers from different stubs, they should not share the same FlowController and + // FlowControlEventStats + try (BatcherImpl batcher1 = + (BatcherImpl) stub1.newMutateRowsBatcher(TableId.of("my-table1"), null); + BatcherImpl batcher2 = + (BatcherImpl) stub2.newMutateRowsBatcher(TableId.of("my-table2"), null)) { + assertThat(batcher1.getFlowController()).isNotNull(); + assertThat(batcher1.getFlowController().getFlowControlEventStats()).isNotNull(); + assertThat(batcher1.getFlowController()).isNotSameInstanceAs(batcher2.getFlowController()); + assertThat(batcher1.getFlowController().getFlowControlEventStats()) + .isNotSameInstanceAs(batcher2.getFlowController().getFlowControlEventStats()); + } + } + try (EnhancedBigtableStub stub1 = + EnhancedBigtableStub.create(settings.build().getStubSettings()); + EnhancedBigtableStub stub2 = + EnhancedBigtableStub.create( + settings + .disableBatchMutationLatencyBasedThrottling() + .build() + .getStubSettings()); ) { + + try (BatcherImpl batcher = + (BatcherImpl) stub2.newMutateRowsBatcher(TableId.of("my-table"), null)) { + assertThat(batcher.getFlowController().getMaxElementCountLimit()).isEqualTo(100L); + assertThat(batcher.getFlowController().getCurrentElementCountLimit()).isEqualTo(100L); + assertThat(batcher.getFlowController().getMinElementCountLimit()).isEqualTo(100L); + } + } + } + + @Test + public void testCallContextPropagatedInMutationBatcher() + throws IOException, InterruptedException, ExecutionException { + EnhancedBigtableStubSettings settings = defaultSettings.toBuilder().build(); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + // clear the previous contexts + contextInterceptor.contexts.clear(); + + // Override the timeout + GrpcCallContext clientCtx = + GrpcCallContext.createDefault().withTimeout(Duration.ofMinutes(10)); + + // Send a batch + try (Batcher batcher = + stub.newMutateRowsBatcher(TableId.of("table1"), clientCtx)) { + batcher.add(RowMutationEntry.create("key").deleteRow()).get(); + } + + // Ensure that the server got the overriden deadline + Context serverCtx = contextInterceptor.pollContext(BigtableGrpc.getMutateRowsMethod()); + assertThat(serverCtx).isNotNull(); + assertThat(serverCtx.getDeadline()).isAtLeast(Deadline.after(8, TimeUnit.MINUTES)); + } + } + + @Test + public void testCallContextPropagatedInReadBatcher() + throws IOException, InterruptedException, ExecutionException { + EnhancedBigtableStubSettings settings = defaultSettings.toBuilder().build(); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + // clear the previous contexts + contextInterceptor.contexts.clear(); + + // Override the timeout + GrpcCallContext clientCtx = + GrpcCallContext.createDefault().withTimeout(Duration.ofMinutes(10)); + + // Send a batch + try (Batcher batcher = + stub.newBulkReadRowsBatcher(Query.create(TABLE_ID), clientCtx)) { + batcher.add(ByteString.copyFromUtf8("key")).get(); + } + + // Ensure that the server got the overriden deadline + Context serverCtx = contextInterceptor.pollContext(BigtableGrpc.getReadRowsMethod()); + assertThat(serverCtx).isNotNull(); + assertThat(serverCtx.getDeadline()).isAtLeast(Deadline.after(8, TimeUnit.MINUTES)); + } + } + + @Test + public void testBulkMutationFlowControlFeatureFlagIsSet() throws Exception { + BulkMutation bulkMutation = + BulkMutation.create(TABLE_ID) + .add(RowMutationEntry.create("row-key").setCell("cf", "q", "value")); + + // Test the header is set when the feature is enabled + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + settings.bulkMutateRowsSettings().setServerInitiatedFlowControl(true); + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + stub.bulkMutateRowsCallable().call(bulkMutation); + } + assertThat(metadataInterceptor.headers).hasSize(1); + Metadata metadata = metadataInterceptor.headers.take(); + String encodedFlags = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + byte[] decodedFlags = Base64.getDecoder().decode(encodedFlags); + FeatureFlags featureFlags = FeatureFlags.parseFrom(decodedFlags); + assertThat(featureFlags.getMutateRowsRateLimit()).isTrue(); + assertThat(featureFlags.getMutateRowsRateLimit2()).isTrue(); + } + + @Test + public void testBulkMutationFlowControlFeatureFlagIsNotSet() throws Exception { + BulkMutation bulkMutation = + BulkMutation.create(TABLE_ID) + .add(RowMutationEntry.create("row-key").setCell("cf", "q", "value")); + + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + settings.bulkMutateRowsSettings().setServerInitiatedFlowControl(false); + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + stub.bulkMutateRowsCallable().call(bulkMutation); + } + assertThat(metadataInterceptor.headers).hasSize(1); + Metadata metadata = metadataInterceptor.headers.take(); + String encodedFlags = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + byte[] decodedFlags = Base64.getDecoder().decode(encodedFlags); + FeatureFlags featureFlags = FeatureFlags.parseFrom(decodedFlags); + assertThat(featureFlags.getMutateRowsRateLimit()).isFalse(); + assertThat(featureFlags.getMutateRowsRateLimit2()).isFalse(); + } + + @Test + public void testWaitTimeoutIsSet() throws Exception { + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + // Set a shorter wait timeout and make watchdog checks more frequently + settings.readRowsSettings().setWaitTimeout(WATCHDOG_CHECK_DURATION.dividedBy(2)); + settings.setStreamWatchdogProvider( + InstantiatingWatchdogProvider.create().withCheckInterval(WATCHDOG_CHECK_DURATION)); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + ServerStream results = stub.readRowsCallable().call(Query.create(WAIT_TIME_TABLE_ID)); + WatchdogTimeoutException ex = + assertThrows(WatchdogTimeoutException.class, () -> results.iterator().next()); + + assertThat(ex).hasMessageThat().contains("Canceled due to timeout waiting for next response"); + } + } + + @Test + public void testReadChangeStreamWaitTimeoutIsSet() throws Exception { + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + // Set a shorter wait timeout and make watchdog checks more frequently + settings.readChangeStreamSettings().setWaitTimeout(WATCHDOG_CHECK_DURATION.dividedBy(2)); + settings.setStreamWatchdogProvider( + InstantiatingWatchdogProvider.create().withCheckInterval(WATCHDOG_CHECK_DURATION)); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + ServerStream results = + stub.readChangeStreamCallable() + .call(ReadChangeStreamQuery.create(WAIT_TIME_TABLE_ID.getTableId())); + WatchdogTimeoutException ex = + assertThrows(WatchdogTimeoutException.class, () -> results.iterator().next()); + assertThat(ex).hasMessageThat().contains("Canceled due to timeout waiting for next response"); + } + } + + @Test + public void testBatchMutationsPartialFailure() { + Batcher batcher = + enhancedBigtableStub.newMutateRowsBatcher( + TableId.of("table1"), GrpcCallContext.createDefault()); + + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = batcher.add(RowMutationEntry.create("key0").deleteRow()); + @SuppressWarnings("UnusedVariable") + ApiFuture ignored1 = batcher.add(RowMutationEntry.create("key1").deleteRow()); + + Mockito.doAnswer( + invocationOnMock -> { + StreamObserver observer = invocationOnMock.getArgument(1); + observer.onNext( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(0) + .setStatus(Status.newBuilder().setCode(Code.OK_VALUE)) + .build()) + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(1) + .setStatus( + Status.newBuilder() + .setCode(Code.PERMISSION_DENIED_VALUE) + .setMessage("fake partial error")) + .build()) + .build()); + observer.onCompleted(); + return null; + }) + .when(fakeDataService) + .mutateRows(Mockito.any(MutateRowsRequest.class), Mockito.any()); + BatchingException batchingException = assertThrows(BatchingException.class, batcher::close); + assertThat(batchingException.getMessage()) + .contains( + "Batching finished with 1 partial failures. The 1 partial failures contained 1 entries" + + " that failed with: 1 ApiException(1 PERMISSION_DENIED)."); + assertThat(batchingException.getMessage()).contains("fake partial error"); + assertThat(batchingException.getMessage()).doesNotContain("INTERNAL"); + } + + @Test + public void testBatchMutationRPCErrorCode() { + Batcher batcher = + enhancedBigtableStub.newMutateRowsBatcher(TABLE_ID, GrpcCallContext.createDefault()); + + Mockito.doAnswer( + invocationOnMock -> { + StreamObserver observer = invocationOnMock.getArgument(1); + observer.onError(io.grpc.Status.PERMISSION_DENIED.asException()); + return null; + }) + .when(fakeDataService) + .mutateRows(Mockito.any(MutateRowsRequest.class), Mockito.any()); + + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = batcher.add(RowMutationEntry.create("key0").deleteRow()); + BatchingException batchingException = assertThrows(BatchingException.class, batcher::close); + assertThat(batchingException.getMessage()) + .contains( + "Batching finished with 1 batches failed to apply due to: 1 ApiException(1" + + " PERMISSION_DENIED) and 0 partial failures"); + } + + @Test + public void testCreateExecuteQueryCallable() throws InterruptedException { + ExecuteQueryCallable streamingCallable = enhancedBigtableStub.createExecuteQueryCallable(); + PrepareResponse prepareResponse = + PrepareResponse.fromProto( + SqlProtoFactory.prepareResponse( + ByteString.copyFromUtf8("abc"), metadata(columnMetadata("foo", stringType())))); + PreparedStatement preparedStatement = preparedStatement(prepareResponse, new HashMap<>()); + SqlServerStream sqlServerStream = streamingCallable.call(preparedStatement.bind().build()); + ExecuteQueryRequest expectedRequest = + ExecuteQueryRequest.newBuilder() + .setInstanceName(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setPreparedQuery(ByteString.copyFromUtf8("abc")) + .build(); + assertThat(sqlServerStream.rows().iterator().next()).isNotNull(); + assertThat(sqlServerStream.metadataFuture().isDone()).isTrue(); + assertThat(fakeDataService.popLastExecuteQueryRequest()).isEqualTo(expectedRequest); + } + + @Test + public void testExecuteQueryWaitTimeoutIsSet() throws IOException { + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + // Set a shorter wait timeout and make watchdog checks more frequently + settings.executeQuerySettings().setWaitTimeout(WATCHDOG_CHECK_DURATION.dividedBy(2)); + settings.setStreamWatchdogProvider( + InstantiatingWatchdogProvider.create().withCheckInterval(WATCHDOG_CHECK_DURATION)); + + Iterator iterator; + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + iterator = + stub.executeQueryCallable() + .call(WAIT_TIME_PREPARED_STATEMENT.bind().build()) + .rows() + .iterator(); + WatchdogTimeoutException e = assertThrows(WatchdogTimeoutException.class, iterator::next); + assertThat(e).hasMessageThat().contains("Canceled due to timeout waiting for next response"); + } + } + + @Test + public void testExecuteQueryWaitTimeoutWorksWithMetadataFuture() throws IOException { + EnhancedBigtableStubSettings.Builder settings = defaultSettings.toBuilder(); + // Set a shorter wait timeout and make watchdog checks more frequently + settings.executeQuerySettings().setWaitTimeout(WATCHDOG_CHECK_DURATION.dividedBy(2)); + settings.setStreamWatchdogProvider( + InstantiatingWatchdogProvider.create().withCheckInterval(WATCHDOG_CHECK_DURATION)); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build())) { + ApiFuture future = + stub.executeQueryCallable() + .call(WAIT_TIME_PREPARED_STATEMENT.bind().build()) + .metadataFuture(); + + ExecutionException e = assertThrows(ExecutionException.class, future::get); + assertThat(e.getCause()).isInstanceOf(WatchdogTimeoutException.class); + assertThat(e.getCause().getMessage()) + .contains("Canceled due to timeout waiting for next response"); + assertThat(e).hasMessageThat().contains("Canceled due to timeout waiting for next response"); + } + } + + private static class MetadataInterceptor implements ServerInterceptor { + final BlockingQueue headers = Queues.newLinkedBlockingDeque(); + + @Override + public Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + headers.add(metadata); + return serverCallHandler.startCall(serverCall, metadata); + } + } + + private static class ContextInterceptor implements ServerInterceptor { + final BlockingQueue contexts = Queues.newLinkedBlockingDeque(); + + static class MethodContext { + final MethodDescriptor method; + final Context context; + + MethodContext(MethodDescriptor method, Context context) { + this.method = method; + this.context = context; + } + } + + @Override + public Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + contexts.add(new MethodContext(serverCall.getMethodDescriptor(), Context.current())); + return serverCallHandler.startCall(serverCall, metadata); + } + + Context pollContext(MethodDescriptor method) { + ContextInterceptor.MethodContext methodContext = contexts.poll(); + while (methodContext != null) { + if (method.equals(methodContext.method)) { + return methodContext.context; + } + methodContext = contexts.poll(); + } + return null; + } + } + + private static class FakeDataService extends BigtableGrpc.BigtableImplBase { + final BlockingQueue requests = Queues.newLinkedBlockingDeque(); + final BlockingQueue readChangeReadStreamRequests = + Queues.newLinkedBlockingDeque(); + final BlockingQueue pingRequests = Queues.newLinkedBlockingDeque(); + final BlockingQueue executeQueryRequests = Queues.newLinkedBlockingDeque(); + final BlockingQueue mutateRowRequests = Queues.newLinkedBlockingDeque(); + final BlockingQueue checkAndMutateRowRequests = + Queues.newLinkedBlockingDeque(); + final BlockingQueue rmwRequests = Queues.newLinkedBlockingDeque(); + final BlockingQueue prepareRequests = Queues.newLinkedBlockingDeque(); + + ReadRowsRequest popLastRequest() throws InterruptedException { + return requests.poll(1, TimeUnit.SECONDS); + } + + ExecuteQueryRequest popLastExecuteQueryRequest() throws InterruptedException { + return executeQueryRequests.poll(1, TimeUnit.SECONDS); + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + mutateRowRequests.add(request); + + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, + StreamObserver responseObserver) { + checkAndMutateRowRequests.add(request); + responseObserver.onNext( + CheckAndMutateRowResponse.newBuilder().setPredicateMatched(true).build()); + responseObserver.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, + StreamObserver responseObserver) { + rmwRequests.add(request); + responseObserver.onNext( + ReadModifyWriteRowResponse.newBuilder() + .setRow(com.google.bigtable.v2.Row.newBuilder().setKey(request.getRowKey())) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntries(MutateRowsResponse.Entry.newBuilder().setIndex(i).build()); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + if (request.getTableName().contains(WAIT_TIME_TABLE_ID.getTableId())) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception ignored) { + // dont care about interruption + } + } + requests.add(request); + // Dummy row for stream + responseObserver.onNext( + ReadRowsResponse.newBuilder() + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setCommitRow(true) + .setRowKey(ByteString.copyFromUtf8("a")) + .setFamilyName(StringValue.getDefaultInstance()) + .setQualifier(BytesValue.getDefaultInstance()) + .setValueSize(0)) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void readChangeStream( + ReadChangeStreamRequest request, + StreamObserver responseObserver) { + if (request.getTableName().contains(WAIT_TIME_TABLE_ID.getTableId())) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception ignored) { + // dont care about interruption + } + } + readChangeReadStreamRequests.add(request); + // Dummy row for stream + responseObserver.onNext(ReadChangeStreamResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { + pingRequests.add(request); + responseObserver.onNext(PingAndWarmResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void executeQuery( + ExecuteQueryRequest request, StreamObserver responseObserver) { + if (request.getPreparedQuery().startsWith(ByteString.copyFromUtf8(WAIT_TIME_QUERY))) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception ignored) { + // dont care about interruption + } + } + executeQueryRequests.add(request); + responseObserver.onNext(partialResultSetWithToken(stringValue("test"))); + responseObserver.onCompleted(); + } + + @Override + public void prepareQuery( + PrepareQueryRequest request, StreamObserver responseObserver) { + if (request.getQuery().contains(WAIT_TIME_QUERY)) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception ignored) { + // dont care about interruption + } + } + prepareRequests.add(request); + responseObserver.onNext( + PrepareQueryResponse.newBuilder() + .setPreparedQuery(ByteString.copyFromUtf8("foo")) + .setMetadata(metadata(columnMetadata("foo", stringType()))) + .setValidUntil(Timestamp.newBuilder().setSeconds(1000).setNanos(1000).build()) + .build()); + responseObserver.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java new file mode 100644 index 000000000000..146cc1017fe0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java @@ -0,0 +1,295 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.bigtable.v2.BigtableGrpc; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +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.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.rpc.Status; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.stub.StreamObserver; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class HeadersTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + + private static final String INSTANCE_NAME = + "projects%2F" + PROJECT_ID + "%2Finstances%2F" + INSTANCE_ID; + private static final String TABLE_NAME = INSTANCE_NAME + "%2Ftables%2F" + TABLE_ID.getTableId(); + private static final String APP_PROFILE_ID = "fake-profile"; + private static final String TEST_FIXED_HEADER_STRING = "test_fixed_header"; + + private static final Metadata.Key X_GOOG_REQUEST_PARAMS_KEY = + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key API_CLIENT_HEADER_KEY = + Metadata.Key.of("x-goog-api-client", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key TEST_FIXED_HEADER = + Metadata.Key.of(TEST_FIXED_HEADER_STRING, Metadata.ASCII_STRING_MARSHALLER); + + private Server server; + private final BlockingQueue sentMetadata = new ArrayBlockingQueue<>(10); + + private BigtableDataClient client; + + @Before + public void setUp() throws Exception { + server = + FakeServiceBuilder.create(new FakeBigtableService()) + .intercept(new MetadataInterceptor()) + .start(); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID); + + HeaderProvider headerProvider = + FixedHeaderProvider.create(TEST_FIXED_HEADER_STRING, "test_header_value"); + + // Force immediate flush + settings + .stubSettings() + .setHeaderProvider(headerProvider) + .bulkMutateRowsSettings() + .setBatchingSettings( + settings.stubSettings().bulkMutateRowsSettings().getBatchingSettings().toBuilder() + .setElementCountThreshold(1L) + .build()); + + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() throws Exception { + client.close(); + server.shutdown(); + } + + @Test + public void readRowsTest() { + client.readRows(Query.create(TABLE_ID)); + verifyHeaderSent(); + } + + @Test + public void sampleRowKeysTest() { + @SuppressWarnings("UnusedVariable") + ApiFuture> ignored = client.sampleRowKeysAsync(TABLE_ID); + verifyHeaderSent(); + } + + @Test + public void mutateRowTest() { + ApiFuture ignored = + client.mutateRowAsync(RowMutation.create(TABLE_ID, "fake-key").deleteRow()); + verifyHeaderSent(); + } + + @Test + public void mutateRowsTest() throws InterruptedException { + try (Batcher batcher = client.newBulkMutationBatcher(TABLE_ID)) { + ApiFuture ignored = batcher.add(RowMutationEntry.create("fake-key").deleteRow()); + } catch (RuntimeException e) { + // Ignore the errors: none of the methods are actually implemented + } + verifyHeaderSent(); + } + + @Test + public void checkAndMutateRowTest() { + ApiFuture ignored = + client.checkAndMutateRowAsync( + ConditionalRowMutation.create(TABLE_ID, "fake-key") + .then(Mutation.create().deleteRow())); + verifyHeaderSent(); + } + + @Test + public void readModifyWriteTest() { + ApiFuture ignored = + client.readModifyWriteRowAsync( + ReadModifyWriteRow.create(TABLE_ID, "fake-key").increment("cf", "q", 1)); + verifyHeaderSent(); + } + + @Test + public void executeQueryTest() { + PreparedStatement preparedStatement = + preparedStatement(metadata(columnMetadata("foo", stringType()))); + client.executeQuery(preparedStatement.bind().build()); + verifyHeaderSent(true); + } + + @Test + public void prepareQueryTest() { + client.prepareStatement("SELECT * FROM table", new HashMap<>()); + verifyHeaderSent(true); + } + + private void verifyHeaderSent() { + verifyHeaderSent(false); + } + + private void verifyHeaderSent(boolean useInstance) { + Metadata metadata; + try { + metadata = sentMetadata.take(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + String requestParamsvalue = metadata.get(X_GOOG_REQUEST_PARAMS_KEY); + if (useInstance) { + assertThat(requestParamsvalue).containsMatch("(^|.*&)name=" + INSTANCE_NAME + "($|&.*)"); + } else { + assertThat(requestParamsvalue).containsMatch("(^|.*&)table_name=" + TABLE_NAME + "($|&.*)"); + } + assertThat(requestParamsvalue) + .containsMatch("(^|.*&)app_profile_id=" + APP_PROFILE_ID + "($|&.*)"); + + String apiClientValue = metadata.get(API_CLIENT_HEADER_KEY); + assertThat(apiClientValue).containsMatch("gl-java/[.\\d_]+"); + assertThat(apiClientValue).containsMatch("gax/[.\\d_]+"); + assertThat(apiClientValue).containsMatch("grpc/[.\\d_]+"); + + String fixedHeader = metadata.get(TEST_FIXED_HEADER); + assertThat(fixedHeader).isEqualTo("test_header_value"); + } + + private class MetadataInterceptor implements ServerInterceptor { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + sentMetadata.add(metadata); + + return serverCallHandler.startCall(serverCall, metadata); + } + } + + private static class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + responseObserver.onCompleted(); + } + + @Override + public void sampleRowKeys( + SampleRowKeysRequest request, StreamObserver responseObserver) { + responseObserver.onCompleted(); + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + responseObserver.onNext( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(0) + .setStatus(Status.getDefaultInstance())) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(ReadModifyWriteRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void prepareQuery( + PrepareQueryRequest request, StreamObserver responseObserver) { + responseObserver.onNext( + // Need to set metadata for response to parse + PrepareQueryResponse.newBuilder() + .setMetadata(metadata(columnMetadata("foo", stringType()))) + .build()); + responseObserver.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java new file mode 100644 index 000000000000..60bbad519686 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyNoInteractions; + +import io.grpc.ManagedChannel; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class NoOpChannelPrimerTest { + @Test + public void primeChannelDoesNothing() { + // Create an instance of NoOpChannelPrimer + NoOpChannelPrimer primer = NoOpChannelPrimer.create(); + + // Create a mock ManagedChannel + ManagedChannel mockChannel = mock(ManagedChannel.class); + + // Call the primeChannel method + primer.primeChannel(mockChannel); + + // Verify that no interactions occurred with the mock channel. + // This confirms the "no-op" behavior. + verifyNoInteractions(mockChannel); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingCallableTest.java new file mode 100644 index 000000000000..652049b26678 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingCallableTest.java @@ -0,0 +1,397 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamController; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RateLimitInfo; +import com.google.cloud.bigtable.gaxx.testing.FakeStatusCode; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.rpc.Code; +import com.google.rpc.Status; +import java.time.Instant; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; + +@RunWith(JUnit4.class) +public class RateLimitingCallableTest { + + private final MutateRowsRequest request = + MutateRowsRequest.newBuilder().getDefaultInstanceForType(); + private final ResponseObserver responseObserver = + Mockito.mock(ResponseObserver.class); + private final ApiCallContext context = GrpcCallContext.createDefault(); + private MockCallable innerCallable; + RateLimitingServerStreamingCallable callableToTest; + + @Before + public void setup() throws Exception { + innerCallable = new MockCallable(); + callableToTest = new RateLimitingServerStreamingCallable(innerCallable); + } + + @Test + public void testDefaultSettingOnInitiate() throws Exception { + callableToTest.call(request, responseObserver, context); + assertFalse(callableToTest.getLimiterEnabled()); + assertThat(callableToTest.getCurrentRate()).isEqualTo(10); + } + + @Test + public void testUpdateRate() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant earlier = Instant.now().minus(java.time.Duration.ofHours(1)); + + // Make sure rate will be updated. + callableToTest.getNextRateUpdateTime().set(earlier); + double oldQps = callableToTest.getCurrentRate(); + + double factor = 0.8; + int periodSeconds = 10; + + RateLimitInfo info = + RateLimitInfo.newBuilder() + .setFactor(factor) + .setPeriod(Duration.newBuilder().setSeconds(periodSeconds).build()) + .build(); + + MutateRowsResponse response = MutateRowsResponse.newBuilder().setRateLimitInfo(info).build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread some time to update the rate. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isWithin(0.01).of(oldQps * factor); + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testNoRateLimitInfoDoesNotUpdateRate() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant earlier = Instant.now().minus(java.time.Duration.ofHours(1)); + + // Make sure rate will be updated. + callableToTest.getNextRateUpdateTime().set(earlier); + double oldQps = callableToTest.getCurrentRate(); + + // A response without RateLimitInfo. + MutateRowsResponse response = MutateRowsResponse.newBuilder().build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread some time to update the rate. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change + assertFalse(callableToTest.getLimiterEnabled()); // Rate limiter is also disabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testInvalidRateLimitInfoDoesNotUpdateRate() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant earlier = Instant.now().minus(java.time.Duration.ofHours(1)); + + // make sure QPS will be updated + callableToTest.getNextRateUpdateTime().set(earlier); + double oldQps = callableToTest.getCurrentRate(); + + // A response with invalid RateLimitInfo. + double factor = 0; // Invalid factor + int periodSeconds = 10; + + RateLimitInfo info = + RateLimitInfo.newBuilder() + .setFactor(factor) + .setPeriod(Duration.newBuilder().setSeconds(periodSeconds).build()) + .build(); + + MutateRowsResponse response = MutateRowsResponse.newBuilder().setRateLimitInfo(info).build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread sometime to update the QPS + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change + assertFalse(callableToTest.getLimiterEnabled()); // Rate limiter is also disabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testMissingRateLimitInfoFactorDoesNotUpdateRate() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant earlier = Instant.now().minus(java.time.Duration.ofHours(1)); + + // Make sure rate can be updated. + callableToTest.getNextRateUpdateTime().set(earlier); + double oldQps = callableToTest.getCurrentRate(); + + // A response with invalid RateLimitInfo. + // Missing factor is equivalent to 0. + int periodSeconds = 10; + RateLimitInfo info = + RateLimitInfo.newBuilder() + .setPeriod(Duration.newBuilder().setSeconds(periodSeconds).build()) + .build(); + + MutateRowsResponse response = MutateRowsResponse.newBuilder().setRateLimitInfo(info).build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread some time to update the rate. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change + assertFalse(callableToTest.getLimiterEnabled()); // Rate limiter is also disabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testNoUpdateBeforeAllowedTime() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant later = Instant.now().plus(java.time.Duration.ofHours(1)); + // Make sure rate will not be updated. + callableToTest.getNextRateUpdateTime().set(later); + double oldQps = callableToTest.getCurrentRate(); + + double factor = 0.3; + int periodSeconds = 10; + + RateLimitInfo info = + RateLimitInfo.newBuilder() + .setFactor(factor) + .setPeriod(Duration.newBuilder().setSeconds(periodSeconds).build()) + .build(); + + MutateRowsResponse response = MutateRowsResponse.newBuilder().setRateLimitInfo(info).build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread some time to update the rate. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change. + assertTrue(callableToTest.getLimiterEnabled()); // Still enabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testDoesNotDisableBeforeAllowedTime() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setLimiterEnabled(true); + + Instant later = Instant.now().plus(java.time.Duration.ofHours(1)); + // Make sure limiter will not be disabled. + callableToTest.getNextRateUpdateTime().set(later); + double oldQps = callableToTest.getCurrentRate(); + + // Missing RateLimitInfo disables rate limiting. + MutateRowsResponse response = MutateRowsResponse.newBuilder().build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread sometime to disable the rate limiter. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change on QPS. + assertTrue(callableToTest.getLimiterEnabled()); // Still enabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testEnableWithinPeriodDoesNotUpdateRate() throws Exception { + callableToTest.call(request, responseObserver, context); + callableToTest.setRate(1.5); + + Instant later = Instant.now().plus(java.time.Duration.ofHours(1)); + // Even though the rate update time is far in the future, enable is always allowed. + callableToTest.getNextRateUpdateTime().set(later); + double oldQps = callableToTest.getCurrentRate(); + + double factor = 0.3; + int periodSeconds = 600; + + RateLimitInfo info = + RateLimitInfo.newBuilder() + .setFactor(factor) + .setPeriod(Duration.newBuilder().setSeconds(periodSeconds).build()) + .build(); + + MutateRowsResponse response = MutateRowsResponse.newBuilder().setRateLimitInfo(info).build(); + + innerCallable.getObserver().onResponse(response); + + // Give the thread some time to enable the rate limiter. + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isEqualTo(oldQps); // No change on QPS due to QPS update time. + assertTrue(callableToTest.getLimiterEnabled()); // Rate limiting is enabled. + + innerCallable.getObserver().onComplete(); + } + + @Test + public void testErrorInfoLowerQPS() throws Exception { + callableToTest.call(request, responseObserver, context); + + Instant earlier = Instant.now().minus(java.time.Duration.ofHours(1)); + + // make sure QPS will be updated + callableToTest.getNextRateUpdateTime().set(earlier); + double oldQps = callableToTest.getCurrentRate(); + + innerCallable + .getObserver() + .onError( + new DeadlineExceededException( + new Throwable(), new FakeStatusCode(StatusCode.Code.DEADLINE_EXCEEDED), false)); + + // Give the thread sometime to update the QPS + Thread.sleep(100); + double newQps = callableToTest.getCurrentRate(); + + assertThat(newQps).isWithin(0.1).of(oldQps * RateLimitingServerStreamingCallable.MIN_FACTOR); + } + + @Test + public void testResponseIsPropagated() { + MutateRowsResponse expectedResponse = + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(0) + .setStatus(Status.newBuilder().setCode(Code.PERMISSION_DENIED_VALUE))) + .build(); + innerCallable = + new MockCallable() { + @Override + public void call( + MutateRowsRequest mutateRowsRequest, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + responseObserver.onResponse(expectedResponse); + responseObserver.onComplete(); + } + }; + + callableToTest = new RateLimitingServerStreamingCallable(innerCallable); + + ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); + + MutateRowsRequest req = + MutateRowsRequest.newBuilder() + .addEntries( + MutateRowsRequest.Entry.newBuilder() + .setRowKey(ByteString.copyFromUtf8("k1")) + .addMutations( + Mutation.newBuilder() + .setDeleteFromRow(Mutation.DeleteFromRow.getDefaultInstance()))) + .build(); + + callableToTest.call(req, mockObserver, context); + + Mockito.verify(mockObserver, Mockito.times(1)).onResponse(Mockito.eq(expectedResponse)); + } + + private static class MockResponseObserver implements ResponseObserver { + + private ResponseObserver observer; + + MockResponseObserver(ResponseObserver responseObserver) { + this.observer = responseObserver; + } + + @Override + public void onStart(StreamController streamController) { + observer.onStart(streamController); + } + + @Override + public void onResponse(MutateRowsResponse o) { + observer.onResponse(o); + } + + @Override + public void onError(Throwable throwable) { + observer.onError(throwable); + } + + @Override + public void onComplete() { + observer.onComplete(); + } + } + + private static class MockCallable + extends ServerStreamingCallable { + + private ResponseObserver observer; + + @Override + public void call( + MutateRowsRequest mutateRowsRequest, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + observer = new MockResponseObserver(responseObserver); + } + + ResponseObserver getObserver() { + return observer; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java new file mode 100644 index 000000000000..8b93a043f6ca --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2023 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.cloud.bigtable.data.v2.stub; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.UnavailableException; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +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.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +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.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.base.Stopwatch; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Queues; +import com.google.protobuf.Any; +import com.google.rpc.RetryInfo; +import io.grpc.ForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RetryInfoTest { + + private static final Metadata.Key ERROR_DETAILS_KEY = + Metadata.Key.of("grpc-status-details-bin", Metadata.BINARY_BYTE_MARSHALLER); + private static final TableId TABLE_ID = TableId.of("table"); + + private final Set methods = new HashSet<>(); + + private FakeBigtableService service; + private Server server; + private BigtableDataClient client; + + private final AtomicInteger attemptCounter = new AtomicInteger(); + private com.google.protobuf.Duration defaultDelay = + com.google.protobuf.Duration.newBuilder().setSeconds(2).setNanos(0).build(); + + @Before + public void setUp() throws IOException { + service = new FakeBigtableService(); + + ServerInterceptor serverInterceptor = + new ServerInterceptor() { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + return serverCallHandler.startCall( + new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { + @Override + public void close(Status status, Metadata trailers) { + if (trailers.containsKey(ERROR_DETAILS_KEY)) { + methods.add(serverCall.getMethodDescriptor().getBareMethodName()); + } + super.close(status, trailers); + } + }, + metadata); + } + }; + server = FakeServiceBuilder.create(service).intercept(serverInterceptor).start(); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance"); + + this.client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() { + if (client != null) { + client.close(); + } + if (server != null) { + server.shutdown(); + } + } + + @Test + public void testAllMethods() { + // Verify retry info is handled correctly for all the methods in data API. + verifyRetryInfoIsUsed(() -> client.readRow(TABLE_ID, "row"), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + }, + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.bulkMutateRows( + BulkMutation.create(TABLE_ID) + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed(() -> client.sampleRowKeys(TABLE_ID), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.checkAndMutateRow( + ConditionalRowMutation.create(TABLE_ID, "key") + .condition(Filters.FILTERS.value().regex("old-value")) + .then(Mutation.create().setCell("cf", "q", "v"))), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.readModifyWriteRow( + ReadModifyWriteRow.create(TABLE_ID, "row").append("cf", "q", "v")), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.readChangeStream(ReadChangeStreamQuery.create("table"))); + }, + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("table")); + }, + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> client.prepareStatement("SELECT * FROM table", new HashMap<>()), true); + // Verify that the new data API methods are tested or excluded. This is enforced by + // introspecting grpc + // method descriptors. + Set expected = + BigtableGrpc.getServiceDescriptor().getMethods().stream() + .map(MethodDescriptor::getBareMethodName) + .collect(Collectors.toSet()); + + // Exclude methods that don't support retry info + methods.add("PingAndWarm"); + methods.add("ExecuteQuery"); // TODO remove when retries are implemented + + // Session APIs. RetryInfo is handled differently + methods.add("OpenAuthorizedView"); + methods.add("OpenMaterializedView"); + methods.add("GetClientConfiguration"); + methods.add("OpenTable"); + + assertThat(methods).containsExactlyElementsIn(expected); + } + + @Test + public void testReadRowNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed(() -> client.readRow(TABLE_ID, "row"), false); + } + + @Test + public void testReadRowServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.readRow(TABLE_ID, "row"), true); + } + + @Test + public void testReadRowsNonRetraybleErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + }, + false); + } + + @Test + public void testReadRowsServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = Lists.newArrayList(client.readRows(Query.create(TABLE_ID))); + }, + true); + } + + @Test + public void testMutateRowsNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> + client.bulkMutateRows( + BulkMutation.create(TABLE_ID) + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + false); + } + + @Test + public void testMutateRowsServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.bulkMutateRows( + BulkMutation.create(TABLE_ID) + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + true); + } + + @Test + public void testMutateRowNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")), false); + } + + @Test + public void testMutateRowServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> client.mutateRow(RowMutation.create(TABLE_ID, "key").setCell("cf", "q", "v")), true); + } + + @Test + public void testSampleRowKeysNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed(() -> client.sampleRowKeys(TABLE_ID), false); + } + + @Test + public void testSampleRowKeysServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.sampleRowKeys(TABLE_ID), true); + } + + @Test + public void testCheckAndMutateServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.checkAndMutateRow( + ConditionalRowMutation.create(TABLE_ID, "key") + .condition(Filters.FILTERS.value().regex("old-value")) + .then(Mutation.create().setCell("cf", "q", "v"))), + false); + } + + @Test + public void testReadModifyWriteServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.readModifyWriteRow( + ReadModifyWriteRow.create(TABLE_ID, "row").append("cf", "q", "v")), + false); + } + + @Test + public void testReadChangeStreamNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.readChangeStream(ReadChangeStreamQuery.create("table"))); + }, + false); + } + + @Test + public void testReadChangeStreamServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.readChangeStream(ReadChangeStreamQuery.create("table"))); + }, + true); + } + + @Test + public void testGenerateInitialChangeStreamPartitionNonRetryableError() { + verifyRetryInfoIsUsed( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("table")); + }, + false); + } + + @Test + public void testGenerateInitialChangeStreamServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> { + @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") + ArrayList ignored = + Lists.newArrayList(client.generateInitialChangeStreamPartitions("table")); + }, + true); + } + + @Test + public void testPrepareQueryNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> client.prepareStatement("SELECT * FROM table", new HashMap<>()), false); + } + + @Test + public void testPrepareQueryServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.prepareStatement("SELECT * FROM table", new HashMap<>()), true); + } + + // Test the case where server returns retry info and client enables handling of retry info + private void verifyRetryInfoIsUsed(Runnable runnable, boolean retryableError) { + if (retryableError) { + enqueueRetryableExceptionWithDelay(defaultDelay); + } else { + @SuppressWarnings("ThrowableNotThrown") + ApiException ignored = enqueueNonRetryableExceptionWithDelay(defaultDelay); + } + Stopwatch stopwatch = Stopwatch.createStarted(); + runnable.run(); + stopwatch.stop(); + + assertThat(attemptCounter.get()).isEqualTo(2); + assertThat(stopwatch.elapsed()).isAtLeast(Duration.ofSeconds(defaultDelay.getSeconds())); + } + + // Test the case where server does not return retry info + private void verifyNoRetryInfo(Runnable runnable, boolean operationRetryable) { + verifyNoRetryInfo(runnable, operationRetryable, defaultDelay); + } + + // individual test can override the default delay + private void verifyNoRetryInfo( + Runnable runnable, boolean operationRetryable, com.google.protobuf.Duration delay) { + enqueueRetryableExceptionNoRetryInfo(); + + if (!operationRetryable) { + assertThrows("non retryable operation should fail", ApiException.class, runnable::run); + assertThat(attemptCounter.get()).isEqualTo(1); + } else { + Stopwatch stopwatch = Stopwatch.createStarted(); + runnable.run(); + stopwatch.stop(); + + assertThat(attemptCounter.get()).isEqualTo(2); + assertThat(stopwatch.elapsed()).isLessThan(Duration.ofSeconds(delay.getSeconds())); + } + + attemptCounter.set(0); + + ApiException expectedApiException = enqueueNonRetryableExceptionNoRetryInfo(); + + ApiException actualApiException = + assertThrows("non retryable error should fail", ApiException.class, runnable::run); + if (actualApiException instanceof MutateRowsException) { + assertThat( + ((MutateRowsException) actualApiException) + .getFailedMutations() + .get(0) + .getError() + .getStatusCode()) + .isEqualTo(expectedApiException.getStatusCode()); + } else { + assertThat(actualApiException.getStatusCode()) + .isEqualTo(expectedApiException.getStatusCode()); + } + + assertThat(attemptCounter.get()).isEqualTo(1); + } + + private void enqueueRetryableExceptionWithDelay(com.google.protobuf.Duration delay) { + Metadata trailers = new Metadata(); + RetryInfo retryInfo = RetryInfo.newBuilder().setRetryDelay(delay).build(); + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(ImmutableList.of(Any.pack(retryInfo))).build(); + byte[] status = + com.google.rpc.Status.newBuilder().addDetails(Any.pack(retryInfo)).build().toByteArray(); + trailers.put(ERROR_DETAILS_KEY, status); + + ApiException exception = + new UnavailableException( + new StatusRuntimeException(Status.UNAVAILABLE, trailers), + GrpcStatusCode.of(Status.Code.UNAVAILABLE), + true, + errorDetails); + + service.expectations.add(exception); + } + + private ApiException enqueueNonRetryableExceptionWithDelay(com.google.protobuf.Duration delay) { + Metadata trailers = new Metadata(); + RetryInfo retryInfo = RetryInfo.newBuilder().setRetryDelay(delay).build(); + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(ImmutableList.of(Any.pack(retryInfo))).build(); + byte[] status = + com.google.rpc.Status.newBuilder().addDetails(Any.pack(retryInfo)).build().toByteArray(); + trailers.put(ERROR_DETAILS_KEY, status); + + ApiException exception = + new InternalException( + new StatusRuntimeException(Status.INTERNAL, trailers), + GrpcStatusCode.of(Status.Code.INTERNAL), + false, + errorDetails); + + service.expectations.add(exception); + + return exception; + } + + private void enqueueRetryableExceptionNoRetryInfo() { + ApiException exception = + new UnavailableException( + new StatusRuntimeException(Status.UNAVAILABLE), + GrpcStatusCode.of(Status.Code.UNAVAILABLE), + true); + service.expectations.add(exception); + } + + private ApiException enqueueNonRetryableExceptionNoRetryInfo() { + ApiException exception = + new InternalException( + new StatusRuntimeException(Status.INTERNAL), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + + service.expectations.add(exception); + + return exception; + } + + private class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + Queue expectations = Queues.newArrayDeque(); + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(ReadRowsResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(MutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntriesBuilder().setIndex(i); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void sampleRowKeys( + SampleRowKeysRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(SampleRowKeysResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, + StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, + StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(ReadModifyWriteRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void generateInitialChangeStreamPartitions( + GenerateInitialChangeStreamPartitionsRequest request, + StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext(GenerateInitialChangeStreamPartitionsResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void readChangeStream( + ReadChangeStreamRequest request, + StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext( + ReadChangeStreamResponse.newBuilder() + .setCloseStream(ReadChangeStreamResponse.CloseStream.getDefaultInstance()) + .build()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + + @Override + public void prepareQuery( + PrepareQueryRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + responseObserver.onNext( + // Need to set metadata for response to parse + PrepareQueryResponse.newBuilder() + .setMetadata(metadata(columnMetadata("foo", stringType()))) + .build()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java new file mode 100644 index 000000000000..8bd40a363bbf --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java @@ -0,0 +1,130 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import io.grpc.Status.Code; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SampleRowKeysCallableWithRequestTest { + + private final RequestContext requestContext = + RequestContext.create("my-project", "my-instance", "my-profile"); + private FakeCallable inner; + private SampleRowKeysCallableWithRequest callable; + + @Before + public void setUp() { + inner = new FakeCallable(); + callable = new SampleRowKeysCallableWithRequest(inner, requestContext); + } + + @Test + public void requestIsCorrect() { + ApiFuture> ignored = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + assertThat(inner.request) + .isEqualTo( + com.google.bigtable.v2.SampleRowKeysRequest.newBuilder() + .setTableName( + NameUtil.formatTableName( + requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) + .setAppProfileId(requestContext.getAppProfileId()) + .build()); + } + + @Test + public void responseCorrectlyTransformed() throws Exception { + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + inner.response.set( + ImmutableList.of( + SampleRowKeysResponse.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key1")) + .setOffsetBytes(100) + .build(), + SampleRowKeysResponse.newBuilder() + .setRowKey(ByteString.copyFromUtf8("")) + .setOffsetBytes(1000) + .build())); + + assertThat(result.get(1, TimeUnit.SECONDS)) + .isEqualTo( + ImmutableList.of( + KeyOffset.create(ByteString.copyFromUtf8("key1"), 100), + KeyOffset.create(ByteString.EMPTY, 1000))); + } + + @Test + public void errorIsPropagated() throws Exception { + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + Throwable expectedError = + new NotFoundException("fake error", null, GrpcStatusCode.of(Code.NOT_FOUND), false); + inner.response.setException(expectedError); + + Throwable actualError = null; + try { + result.get(1, TimeUnit.SECONDS); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + + assertThat(actualError).isEqualTo(expectedError); + } + + static class FakeCallable + extends UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> { + com.google.bigtable.v2.SampleRowKeysRequest request; + ApiCallContext callContext; + SettableApiFuture> response = SettableApiFuture.create(); + + @Override + public ApiFuture> futureCall( + com.google.bigtable.v2.SampleRowKeysRequest request, ApiCallContext context) { + this.request = request; + this.callContext = context; + + return response; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SessionDeadlineTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SessionDeadlineTest.java new file mode 100644 index 000000000000..7df4fddd5e28 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SessionDeadlineTest.java @@ -0,0 +1,228 @@ +/* + * Copyright 2026 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.fail; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +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.TableId; +import io.grpc.Context; +import io.grpc.ForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.Base64; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class SessionDeadlineTest { + + private Server server; + private EnhancedBigtableStubSettings defaultSettings; + private FakeDataService fakeDataService; + + @Before + public void setUp() throws IOException { + fakeDataService = new FakeDataService(); + server = + NettyServerBuilder.forPort(0) + .addService(fakeDataService) + .intercept(new ResponseHeaderInterceptor()) + .build() + .start(); + + defaultSettings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .setAppProfileId("fake-app-profile") + .setCredentialsProvider(NoCredentialsProvider.create()) + .build() + .getStubSettings(); + } + + @After + public void tearDown() throws InterruptedException { + if (fakeDataService != null) { + fakeDataService.shutdown(); + } + if (server != null) { + server.shutdownNow(); + server.awaitTermination(); + } + } + + @Test(timeout = 1000) + public void testShortDeadlineCancellation() throws Exception { + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder().setSessionsEnabled(true).build(); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + Query request = Query.create(TableId.of("fake-table")).rowKey("row-key"); + + try (io.grpc.Context.CancellableContext ctx = + io.grpc.Context.current() + .withDeadlineAfter( + 5, + TimeUnit.MILLISECONDS, + settings.getBackgroundExecutorProvider().getExecutor())) { + + ctx.run( + () -> { + ApiFuture future = stub.readRowCallable().futureCall(request); + try { + future.get(); + fail("Should throw exception"); + } catch (ExecutionException e) { + assertThat(e).hasMessageThat().contains("DEADLINE_EXCEEDED"); + } catch (InterruptedException e) { + fail("Should not throw interrupted exception"); + } + }); + } + } + } + + @Test(timeout = 10000) + public void testMissedHeartbeat() throws Exception { + EnhancedBigtableStubSettings settings = + defaultSettings.toBuilder().setSessionsEnabled(true).build(); + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings)) { + Query request = Query.create(TableId.of("fake-table")).rowKey("row-key"); + + try (Context.CancellableContext ctx = + Context.current() + .withDeadlineAfter( + 1, TimeUnit.SECONDS, settings.getBackgroundExecutorProvider().getExecutor())) { + ctx.run( + () -> { + ApiFuture future = stub.readRowCallable().futureCall(request); + try { + future.get(); + fail("Should throw exception"); + } catch (ExecutionException e) { + assertThat(e).hasMessageThat().contains("missed heartbeat"); + } catch (InterruptedException e) { + fail("Should not throw interrupted exception"); + } + }); + } + } + } + + private static class FakeDataService extends BigtableGrpc.BigtableImplBase { + private final ScheduledExecutorService serverExecutor = Executors.newScheduledThreadPool(4); + + public void shutdown() { + serverExecutor.shutdownNow(); + } + + @Override + public void getClientConfiguration( + GetClientConfigurationRequest request, + StreamObserver responseObserver) { + responseObserver.onNext( + ClientConfiguration.newBuilder() + .setSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.newBuilder() + .setSessionLoad(1) + .build()) + .build()); + responseObserver.onCompleted(); + } + + @Override + public StreamObserver openTable( + StreamObserver responseObserver) { + return new StreamObserver() { + @Override + public void onNext(SessionRequest sessionRequest) { + if (sessionRequest.hasOpenSession()) { + responseObserver.onNext( + SessionResponse.newBuilder() + .setOpenSession(OpenSessionResponse.getDefaultInstance()) + .build()); + } else if (sessionRequest.hasVirtualRpc()) { + // Server hangs + } + } + + @Override + public void onError(Throwable t) {} + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + } + } + + private static class ResponseHeaderInterceptor implements ServerInterceptor { + @Override + public ServerCall.Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + return serverCallHandler.startCall( + new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { + @Override + public void sendHeaders(Metadata headers) { + Metadata.Key peerInfoKey = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + String encoded = + Base64.getUrlEncoder() + .encodeToString( + PeerInfo.newBuilder() + .setApplicationFrontendRegion("us-east1") + .build() + .toByteArray()); + headers.put(peerInfoKey, encoded); + super.sendHeaders(headers); + } + + @Override + public void close(io.grpc.Status status, Metadata trailers) { + super.close(status, trailers); + } + }, + metadata); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java new file mode 100644 index 000000000000..40f7e5b17ad7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java @@ -0,0 +1,284 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.Row; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracer; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.base.Preconditions; +import com.google.common.base.Supplier; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.Message; +import com.google.protobuf.StringValue; +import io.grpc.BindableService; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerServiceDefinition; +import io.grpc.stub.ServerCalls; +import io.grpc.stub.StreamObserver; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class SkipTrailersTest { + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TargetId TABLE_ID = TableId.of("fake-table"); + + private HackedBigtableService hackedService; + private Server server; + + @Mock private ApiTracerFactory tracerFactory; + private FakeTracer tracer = new FakeTracer(); + + private BigtableDataClient client; + + @Before + public void setUp() throws Exception { + hackedService = new HackedBigtableService(); + server = FakeServiceBuilder.create(hackedService).start(); + + when(tracerFactory.newTracer(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(tracer); + when(tracerFactory.withContext(Mockito.any())).thenReturn(tracerFactory); + + BigtableDataSettings.Builder clientBuilder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .setCredentialsProvider(NoCredentialsProvider.create()); + clientBuilder.stubSettings().setTracerFactory(tracerFactory); + + client = BigtableDataClient.create(clientBuilder.build()); + } + + @After + public void tearDown() throws Exception { + client.close(); + server.shutdown(); + } + + @Test + public void testReadRow() throws InterruptedException, ExecutionException { + ReadRowsResponse fakeResponse = + ReadRowsResponse.newBuilder() + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("fake-key")) + .setFamilyName(StringValue.newBuilder().setValue("cf")) + .setQualifier(BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q"))) + .setTimestampMicros(0) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build(); + test(() -> client.readRowAsync(TABLE_ID, "fake-key"), fakeResponse); + } + + @Test + public void testMutateRow() throws ExecutionException, InterruptedException { + test( + () -> client.mutateRowAsync(RowMutation.create(TABLE_ID, "fake-key")), + MutateRowResponse.getDefaultInstance()); + } + + @Test + public void testCheckAndMutateRow() throws ExecutionException, InterruptedException { + ConditionalRowMutation req = + ConditionalRowMutation.create(TABLE_ID, "fake-key") + .condition(Filters.FILTERS.pass()) + .then(Mutation.create().deleteRow()); + test(() -> client.checkAndMutateRowAsync(req), CheckAndMutateRowResponse.getDefaultInstance()); + } + + @Test + public void testRMW() throws ExecutionException, InterruptedException { + ReadModifyWriteRow req = ReadModifyWriteRow.create(TABLE_ID, "fake-key").append("cf", "q", "A"); + test( + () -> client.readModifyWriteRowAsync(req), + ReadModifyWriteRowResponse.newBuilder().setRow(Row.getDefaultInstance()).build()); + } + + private void test(Supplier> invoker, T fakeResponse) + throws InterruptedException, ExecutionException { + ApiFuture future = invoker.get(); + + // Wait for the call to start on the server + @SuppressWarnings("unchecked") + ServerRpc rpc = (ServerRpc) hackedService.rpcs.poll(30, TimeUnit.SECONDS); + Preconditions.checkNotNull( + rpc, "Timed out waiting for the call to be received by the mock server"); + + // Send the only row + rpc.getResponseStream().onNext(fakeResponse); + + // Ensure that the future resolves and does not throw an error + try { + future.get(1, TimeUnit.MINUTES); + } catch (TimeoutException e) { + throw new AssertionError( + "timed out waiting for the trailer optimization future to resolve", e); + } + + // The tracer will be notified in parallel to the future being resolved + // This normal and expected, but requires the test to wait a bit + for (int i = 10; i > 0; i--) { + try { + assertThat(tracer.getCallCount("operationFinishEarly")).isEqualTo(1); + break; + } catch (AssertionError e) { + if (i > 1) { + Thread.sleep(100); + } else { + throw e; + } + } + } + assertThat(tracer.getCallCount("operationSucceeded")).isEqualTo(0); + + // clean up + rpc.getResponseStream().onCompleted(); + + // Ensure that the tracer is invoked after the internal operation is complete + // Since we dont have a way to know exactly when this happens, we poll + for (int i = 10; i > 0; i--) { + try { + assertThat(tracer.getCallCount("operationSucceeded")).isEqualTo(1); + break; + } catch (AssertionError e) { + if (i > 1) { + Thread.sleep(100); + } else { + throw e; + } + } + } + } + + static class FakeTracer extends BigtableTracer { + ConcurrentHashMap callCounts = new ConcurrentHashMap<>(); + + @Override + public void operationFinishEarly() { + record("operationFinishEarly"); + } + + @Override + public void operationSucceeded() { + record("operationSucceeded"); + } + + private void record(String op) { + callCounts.computeIfAbsent(op, (ignored) -> new AtomicInteger()).getAndIncrement(); + } + + private int getCallCount(String op) { + return Optional.ofNullable(callCounts.get(op)).map(AtomicInteger::get).orElse(0); + } + } + + /** + * Hack the srvice definition to allow grpc server to simulate delayed trailers. This will augment + * the bigtable service definition to promote unary rpcs to server streaming + */ + class HackedBigtableService implements BindableService { + private final LinkedBlockingDeque> rpcs = new LinkedBlockingDeque<>(); + + @Override + public ServerServiceDefinition bindService() { + ServerServiceDefinition.Builder builder = + ServerServiceDefinition.builder(BigtableGrpc.SERVICE_NAME) + .addMethod( + BigtableGrpc.getPingAndWarmMethod(), + ServerCalls.asyncUnaryCall( + (ignored, observer) -> { + observer.onNext(PingAndWarmResponse.getDefaultInstance()); + observer.onCompleted(); + })) + .addMethod( + BigtableGrpc.getReadRowsMethod(), + ServerCalls.asyncServerStreamingCall( + (req, observer) -> rpcs.add(ServerRpc.create(req, observer)))); + ImmutableList> unaryDescriptors = + ImmutableList.of( + BigtableGrpc.getMutateRowMethod(), + BigtableGrpc.getCheckAndMutateRowMethod(), + BigtableGrpc.getReadModifyWriteRowMethod()); + + for (MethodDescriptor desc : unaryDescriptors) { + builder.addMethod( + desc.toBuilder().setType(MethodDescriptor.MethodType.SERVER_STREAMING).build(), + ServerCalls.asyncServerStreamingCall( + (req, observer) -> rpcs.add(ServerRpc.create(req, observer)))); + } + return builder.build(); + } + } + + @AutoValue + abstract static class ServerRpc { + abstract ReqT getRequest(); + + abstract StreamObserver getResponseStream(); + + static ServerRpc create(ReqT req, StreamObserver resp) { + // return new AutoValue__(req, resp); + return new AutoValue_SkipTrailersTest_ServerRpc<>(req, resp); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallableTest.java new file mode 100644 index 000000000000..856d732f5c9f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallableTest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockResponseObserver; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCall; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCallable; +import com.google.common.base.Functions; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class TransformingServerStreamingCallableTest { + @Test + public void testReqTransform() { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + TransformingServerStreamingCallable xform = + new TransformingServerStreamingCallable<>(inner, Object::toString, Functions.identity()); + + MockResponseObserver responseObserver = new MockResponseObserver<>(true); + xform.call(37, responseObserver); + + MockServerStreamingCall call = inner.popLastCall(); + assertThat(call.getRequest()).isEqualTo("37"); + } + + @Test + public void testRespTransform() { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + TransformingServerStreamingCallable xform = + new TransformingServerStreamingCallable<>(inner, Functions.identity(), Integer::parseInt); + + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + xform.call("req", outerObserver); + + MockServerStreamingCall call = inner.popLastCall(); + call.getController().getObserver().onResponse("37"); + + assertThat(outerObserver.popNextResponse()).isEqualTo(37); + } + + @Test + public void testError() { + MockServerStreamingCallable inner = new MockServerStreamingCallable<>(); + TransformingServerStreamingCallable xform = + new TransformingServerStreamingCallable<>( + inner, Functions.identity(), Functions.identity()); + + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + xform.call("req", outerObserver); + + MockServerStreamingCall call = inner.popLastCall(); + RuntimeException e = new RuntimeException("fake error"); + call.getController().getObserver().onError(e); + + assertThat(outerObserver.getFinalError()).isEqualTo(e); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java new file mode 100644 index 000000000000..a5201770ee53 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java @@ -0,0 +1,140 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamContinuationToken; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.CloseStream; +import com.google.cloud.bigtable.data.v2.models.DefaultChangeStreamRecordAdapter; +import com.google.cloud.bigtable.data.v2.models.Heartbeat; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.util.Collections; +import java.util.List; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +/** + * Additional tests in addition to {@link ReadChangeStreamMergingAcceptanceTest}. + * + *

All the ChangeStreamMutation tests are in {@link ReadChangeStreamMergingAcceptanceTest}. + */ +@RunWith(JUnit4.class) +public class ChangeStreamRecordMergingCallableTest { + + @Test + public void heartbeatTest() { + RowRange rowRange = RowRange.newBuilder().getDefaultInstanceForType(); + ReadChangeStreamResponse.Heartbeat heartbeatProto = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark(Timestamp.newBuilder().setSeconds(1000).build()) + .setContinuationToken( + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange)) + .setToken("random-token") + .build()) + .build(); + ReadChangeStreamResponse response = + ReadChangeStreamResponse.newBuilder().setHeartbeat(heartbeatProto).build(); + FakeStreamingApi.ServerStreamingStashCallable + inner = new ServerStreamingStashCallable<>(Collections.singletonList(response)); + + ChangeStreamRecordMergingCallable mergingCallable = + new ChangeStreamRecordMergingCallable<>(inner, new DefaultChangeStreamRecordAdapter()); + List results = + mergingCallable.all().call(ReadChangeStreamRequest.getDefaultInstance()); + + // Validate the result. + assertThat(results.size()).isEqualTo(1); + ChangeStreamRecord record = results.get(0); + Assert.assertTrue(record instanceof Heartbeat); + Heartbeat heartbeat = (Heartbeat) record; + assertThat(heartbeat.getChangeStreamContinuationToken().getPartition()) + .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); + assertThat(heartbeat.getChangeStreamContinuationToken().getToken()) + .isEqualTo(heartbeatProto.getContinuationToken().getToken()); + assertThat(heartbeat.getEstimatedLowWatermark()) + .isEqualTo( + Instant.ofEpochSecond( + heartbeatProto.getEstimatedLowWatermark().getSeconds(), + heartbeatProto.getEstimatedLowWatermark().getNanos())); + assertThat(heartbeat.getEstimatedLowWatermarkTime()) + .isEqualTo( + java.time.Instant.ofEpochSecond( + heartbeatProto.getEstimatedLowWatermark().getSeconds(), + heartbeatProto.getEstimatedLowWatermark().getNanos())); + } + + @Test + public void closeStreamTest() { + RowRange rowRange = + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8("")) + .setEndKeyOpen(ByteString.copyFromUtf8("")) + .build(); + StreamContinuationToken streamContinuationToken = + StreamContinuationToken.newBuilder() + .setPartition(StreamPartition.newBuilder().setRowRange(rowRange).build()) + .setToken("random-token") + .build(); + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder() + .addContinuationTokens(streamContinuationToken) + .addNewPartitions(StreamPartition.newBuilder().setRowRange(rowRange)) + .setStatus(Status.newBuilder().setCode(11)) + .build(); + ReadChangeStreamResponse response = + ReadChangeStreamResponse.newBuilder().setCloseStream(closeStreamProto).build(); + FakeStreamingApi.ServerStreamingStashCallable + inner = new ServerStreamingStashCallable<>(Collections.singletonList(response)); + + ChangeStreamRecordMergingCallable mergingCallable = + new ChangeStreamRecordMergingCallable<>(inner, new DefaultChangeStreamRecordAdapter()); + List results = + mergingCallable.all().call(ReadChangeStreamRequest.getDefaultInstance()); + + // Validate the result. + assertThat(results.size()).isEqualTo(1); + ChangeStreamRecord record = results.get(0); + Assert.assertTrue(record instanceof CloseStream); + CloseStream closeStream = (CloseStream) record; + assertThat(closeStream.getStatus().toProto()).isEqualTo(closeStreamProto.getStatus()); + assertThat(closeStream.getChangeStreamContinuationTokens().size()).isEqualTo(1); + ChangeStreamContinuationToken changeStreamContinuationToken = + closeStream.getChangeStreamContinuationTokens().get(0); + assertThat(changeStreamContinuationToken.getPartition()) + .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); + assertThat(changeStreamContinuationToken.getToken()) + .isEqualTo(streamContinuationToken.getToken()); + assertThat(closeStream.getNewPartitions().size()).isEqualTo(1); + assertThat(closeStream.getNewPartitions().get(0)) + .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachineTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachineTest.java new file mode 100644 index 000000000000..9cdd74f0deca --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachineTest.java @@ -0,0 +1,97 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.DefaultChangeStreamRecordAdapter; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ChangeStreamStateMachineTest { + ChangeStreamStateMachine changeStreamStateMachine; + + private ReadChangeStreamResponse.DataChange createDataChangeWithDeleteFamilyMods( + int numDeleteFamilyMod) { + ReadChangeStreamResponse.DataChange.Builder dataChangeBuilder = + ReadChangeStreamResponse.DataChange.newBuilder() + .setType(ReadChangeStreamResponse.DataChange.Type.USER) + .setSourceClusterId("fake-source-cluster-id") + .setRowKey(ByteString.copyFromUtf8("key")) + .setCommitTimestamp(Timestamp.newBuilder().setSeconds(100).build()) + .setTiebreaker(100); + for (int i = 0; i < numDeleteFamilyMod; ++i) { + Mutation deleteFromFamily = + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder().setFamilyName("fake-family-" + i).build()) + .build(); + dataChangeBuilder.addChunks( + ReadChangeStreamResponse.MutationChunk.newBuilder().setMutation(deleteFromFamily)); + } + dataChangeBuilder.setDone(true); + dataChangeBuilder.setEstimatedLowWatermark(Timestamp.newBuilder().setSeconds(1).build()); + dataChangeBuilder.setToken("fake-token"); + return dataChangeBuilder.build(); + } + + @Before + public void setUp() throws Exception { + changeStreamStateMachine = + new ChangeStreamStateMachine<>( + new DefaultChangeStreamRecordAdapter().createChangeStreamRecordBuilder()); + } + + @Test + public void testErrorHandlingStats() { + ReadChangeStreamResponse.DataChange dataChange = + ReadChangeStreamResponse.DataChange.newBuilder().build(); + + ChangeStreamStateMachine.InvalidInputException actualError = null; + try { + changeStreamStateMachine.handleDataChange(dataChange); + } catch (ChangeStreamStateMachine.InvalidInputException e) { + actualError = e; + } + + assertThat(actualError) + .hasMessageThat() + .containsMatch("AWAITING_NEW_STREAM_RECORD: First data change missing rowKey"); + assertThat(actualError).hasMessageThat().contains("numHeartbeats: 0"); + assertThat(actualError).hasMessageThat().contains("numCloseStreams: 0"); + assertThat(actualError).hasMessageThat().contains("numDataChanges: 1"); + assertThat(actualError).hasMessageThat().contains("numNonCellMods: 0"); + assertThat(actualError).hasMessageThat().contains("numCellChunks: 0"); + assertThat(actualError).hasMessageThat().contains("actualTotalSizeOfChunkedSetCell: 0"); + } + + @Test + public void testNoStackOverflowForManyMods() { + ReadChangeStreamResponse.DataChange dataChange = createDataChangeWithDeleteFamilyMods(500000); + changeStreamStateMachine.handleDataChange(dataChange); + ChangeStreamRecord result = changeStreamStateMachine.consumeChangeStreamRecord(); + assertThat(result).isInstanceOf(ChangeStreamMutation.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallableTest.java new file mode 100644 index 000000000000..885b1c6355f0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallableTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.changestream; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi; +import com.google.common.collect.Lists; +import com.google.common.truth.Truth; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class GenerateInitialChangeStreamPartitionsUserCallableTest { + private final RequestContext requestContext = + RequestContext.create("my-project", "my-instance", "my-profile"); + + @Test + public void requestIsCorrect() { + FakeStreamingApi.ServerStreamingStashCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + inner = new FakeStreamingApi.ServerStreamingStashCallable<>(Lists.newArrayList()); + GenerateInitialChangeStreamPartitionsUserCallable + generateInitialChangeStreamPartitionsUserCallable = + new GenerateInitialChangeStreamPartitionsUserCallable(inner, requestContext); + + generateInitialChangeStreamPartitionsUserCallable.all().call("my-table"); + assertThat(inner.getActualRequest()) + .isEqualTo( + GenerateInitialChangeStreamPartitionsRequest.newBuilder() + .setTableName( + NameUtil.formatTableName( + requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) + .setAppProfileId(requestContext.getAppProfileId()) + .build()); + } + + @Test + public void responseIsConverted() { + FakeStreamingApi.ServerStreamingStashCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + inner = + new FakeStreamingApi.ServerStreamingStashCallable<>( + Lists.newArrayList( + GenerateInitialChangeStreamPartitionsResponse.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange(RowRange.newBuilder().getDefaultInstanceForType()) + .build()) + .build())); + GenerateInitialChangeStreamPartitionsUserCallable + generateInitialChangeStreamPartitionsUserCallable = + new GenerateInitialChangeStreamPartitionsUserCallable(inner, requestContext); + + List results = + generateInitialChangeStreamPartitionsUserCallable.all().call("my-table"); + Truth.assertThat(results).containsExactly(ByteStringRange.create("", "")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java new file mode 100644 index 000000000000..ce278f50c8c9 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java @@ -0,0 +1,305 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.api.client.util.Lists; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.ReadChangeStreamResponse.DataChange; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamPartition; +import com.google.bigtable.v2.TimestampRange; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamContinuationToken; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.CloseStream; +import com.google.cloud.bigtable.data.v2.models.DefaultChangeStreamRecordAdapter; +import com.google.cloud.bigtable.data.v2.models.DeleteCells; +import com.google.cloud.bigtable.data.v2.models.DeleteFamily; +import com.google.cloud.bigtable.data.v2.models.Entry; +import com.google.cloud.bigtable.data.v2.models.Heartbeat; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.SetCell; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi; +import com.google.cloud.conformance.bigtable.v2.ChangeStreamTestDefinition.ChangeStreamTestFile; +import com.google.cloud.conformance.bigtable.v2.ChangeStreamTestDefinition.ReadChangeStreamTest; +import com.google.common.base.CaseFormat; +import com.google.protobuf.Timestamp; +import com.google.protobuf.util.JsonFormat; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +/** + * Parses and runs the acceptance tests for read change stream. Currently, this test is only used by + * the JAVA library. If in the future we need cross-language support, we should move the test proto + * to https://github.com/googleapis/conformance-tests/tree/main/bigtable/v2/proto/google/cloud/conformance/bigtable/v2 + * and the test data to https://github.com/googleapis/conformance-tests/blob/main/bigtable/v2/changestream.json + */ +@RunWith(Parameterized.class) +public class ReadChangeStreamMergingAcceptanceTest { + // Location: `google-cloud-bigtable/src/test/resources/changestream.json` + private static final String TEST_DATA_JSON_RESOURCE = "changestream.json"; + + private final ReadChangeStreamTest testCase; + + /** + * @param testData The serialized test data representing the test case. + * @param junitName Not used by the test, but used by the parameterized test runner as the name of + * the test. + */ + public ReadChangeStreamMergingAcceptanceTest( + ReadChangeStreamTest testData, @SuppressWarnings("unused") String junitName) { + this.testCase = testData; + } + + // Each tuple consists of [testData: ReadChangeStreamTest, junitName: String] + @Parameterized.Parameters(name = "{1}") + public static Collection data() throws IOException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + InputStream dataJson = cl.getResourceAsStream(TEST_DATA_JSON_RESOURCE); + assertWithMessage("Unable to load test definition: %s", TEST_DATA_JSON_RESOURCE) + .that(dataJson) + .isNotNull(); + + InputStreamReader reader = new InputStreamReader(dataJson, StandardCharsets.UTF_8); + ChangeStreamTestFile.Builder testBuilder = ChangeStreamTestFile.newBuilder(); + JsonFormat.parser().merge(reader, testBuilder); + ChangeStreamTestFile testDefinition = testBuilder.build(); + + List tests = testDefinition.getReadChangeStreamTestsList(); + ArrayList data = new ArrayList<>(tests.size()); + for (ReadChangeStreamTest test : tests) { + String junitName = + CaseFormat.LOWER_HYPHEN.to( + CaseFormat.LOWER_CAMEL, test.getDescription().replace(" ", "-")); + data.add(new Object[] {test, junitName}); + } + return data; + } + + @Test + public void test() throws Exception { + List responses = testCase.getApiResponsesList(); + + // Wrap the responses in a callable. + ServerStreamingCallable source = + new FakeStreamingApi.ServerStreamingStashCallable<>(responses); + ChangeStreamRecordMergingCallable mergingCallable = + new ChangeStreamRecordMergingCallable<>(source, new DefaultChangeStreamRecordAdapter()); + + // Invoke the callable to get the change stream records. + ServerStream stream = + mergingCallable.call(ReadChangeStreamRequest.getDefaultInstance()); + + // Transform the change stream records into ReadChangeStreamTest.Result's. + List actualResults = Lists.newArrayList(); + Exception error = null; + try { + for (ChangeStreamRecord record : stream) { + if (record instanceof Heartbeat) { + Heartbeat heartbeat = (Heartbeat) record; + ChangeStreamContinuationToken token = heartbeat.getChangeStreamContinuationToken(); + ReadChangeStreamResponse.Heartbeat heartbeatProto = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setContinuationToken( + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(token.getPartition().getStart()) + .setEndKeyOpen(token.getPartition().getEnd()) + .build()) + .build()) + .setToken(heartbeat.getChangeStreamContinuationToken().getToken()) + .build()) + .setEstimatedLowWatermark( + Timestamp.newBuilder() + .setSeconds(heartbeat.getEstimatedLowWatermark().getEpochSecond()) + .setNanos(heartbeat.getEstimatedLowWatermark().getNano()) + .build()) + .build(); + actualResults.add( + ReadChangeStreamTest.Result.newBuilder() + .setRecord( + ReadChangeStreamTest.TestChangeStreamRecord.newBuilder() + .setHeartbeat(heartbeatProto) + .build()) + .build()); + } else if (record instanceof CloseStream) { + CloseStream closeStream = (CloseStream) record; + ReadChangeStreamResponse.CloseStream.Builder builder = + ReadChangeStreamResponse.CloseStream.newBuilder() + .setStatus(closeStream.getStatus().toProto()); + for (ChangeStreamContinuationToken token : + closeStream.getChangeStreamContinuationTokens()) { + builder.addContinuationTokens( + StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(token.getPartition().getStart()) + .setEndKeyOpen(token.getPartition().getEnd()) + .build())) + .setToken(token.getToken()) + .build()); + } + for (ByteStringRange newPartition : closeStream.getNewPartitions()) { + builder.addNewPartitions( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(newPartition.getStart()) + .setEndKeyOpen(newPartition.getEnd()))); + } + ReadChangeStreamResponse.CloseStream closeStreamProto = builder.build(); + actualResults.add( + ReadChangeStreamTest.Result.newBuilder() + .setRecord( + ReadChangeStreamTest.TestChangeStreamRecord.newBuilder() + .setCloseStream(closeStreamProto) + .build()) + .build()); + } else if (record instanceof ChangeStreamMutation) { + ChangeStreamMutation changeStreamMutation = (ChangeStreamMutation) record; + ReadChangeStreamTest.TestChangeStreamMutation.Builder builder = + ReadChangeStreamTest.TestChangeStreamMutation.newBuilder(); + builder.setRowKey(changeStreamMutation.getRowKey()); + DataChange.Type type = DataChange.Type.UNRECOGNIZED; + if (changeStreamMutation.getType() == ChangeStreamMutation.MutationType.USER) { + type = DataChange.Type.USER; + } else if (changeStreamMutation.getType() + == ChangeStreamMutation.MutationType.GARBAGE_COLLECTION) { + type = DataChange.Type.GARBAGE_COLLECTION; + } + builder.setType(type); + if (changeStreamMutation.getSourceClusterId() != null) { + builder.setSourceClusterId(changeStreamMutation.getSourceClusterId()); + } + builder.setCommitTimestamp( + Timestamp.newBuilder() + .setSeconds(changeStreamMutation.getCommitTimestamp().getEpochSecond()) + .setNanos(changeStreamMutation.getCommitTimestamp().getNano()) + .build()); + builder.setTiebreaker(changeStreamMutation.getTieBreaker()); + builder.setToken(changeStreamMutation.getToken()); + builder.setEstimatedLowWatermark( + Timestamp.newBuilder() + .setSeconds(changeStreamMutation.getEstimatedLowWatermark().getEpochSecond()) + .setNanos(changeStreamMutation.getEstimatedLowWatermark().getNano()) + .build()); + for (Entry entry : changeStreamMutation.getEntries()) { + if (entry instanceof DeleteFamily) { + DeleteFamily deleteFamily = (DeleteFamily) entry; + builder.addMutations( + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder() + .setFamilyName(deleteFamily.getFamilyName()) + .build())); + } else if (entry instanceof DeleteCells) { + DeleteCells deleteCells = (DeleteCells) entry; + builder.addMutations( + Mutation.newBuilder() + .setDeleteFromColumn( + Mutation.DeleteFromColumn.newBuilder() + .setFamilyName(deleteCells.getFamilyName()) + .setColumnQualifier(deleteCells.getQualifier()) + .setTimeRange( + TimestampRange.newBuilder() + .setStartTimestampMicros( + deleteCells.getTimestampRange().getStart()) + .setEndTimestampMicros( + deleteCells.getTimestampRange().getEnd()) + .build()) + .build())); + } else if (entry instanceof SetCell) { + SetCell setCell = (SetCell) entry; + builder.addMutations( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName(setCell.getFamilyName()) + .setColumnQualifier(setCell.getQualifier()) + .setTimestampMicros(setCell.getTimestamp()) + .setValue(setCell.getValue()))); + } else { + throw new IllegalStateException("Unexpected Entry type"); + } + } + actualResults.add( + ReadChangeStreamTest.Result.newBuilder() + .setRecord( + ReadChangeStreamTest.TestChangeStreamRecord.newBuilder() + .setChangeStreamMutation(builder)) + .build()); + } else { + throw new IllegalStateException("Unexpected ChangeStreamRecord type"); + } + } + } catch (Exception e) { + error = e; + } + + // Verify the results. + if (expectsError(testCase)) { + assertThat(error).isNotNull(); + } else { + if (error != null) { + throw error; + } + } + + assertThat(getNonExceptionResults(testCase)).isEqualTo(actualResults); + } + + private static boolean expectsError(ReadChangeStreamTest testCase) { + List results = testCase.getResultsList(); + return !results.isEmpty() && results.get(results.size() - 1).getError(); + } + + private static List getNonExceptionResults( + ReadChangeStreamTest testCase) { + List results = testCase.getResultsList(); + List response = new ArrayList<>(); + + for (ReadChangeStreamTest.Result result : results) { + if (!result.getError()) { + response.add(result); + } + } + + return response; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java new file mode 100644 index 000000000000..80f14b02cfc3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java @@ -0,0 +1,500 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import com.google.bigtable.v2.RowRange; +import com.google.bigtable.v2.StreamContinuationToken; +import com.google.bigtable.v2.StreamContinuationTokens; +import com.google.bigtable.v2.StreamPartition; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.CloseStream; +import com.google.cloud.bigtable.data.v2.models.Heartbeat; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.collect.Lists; +import com.google.common.collect.Queues; +import com.google.common.truth.Truth; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcServerRule; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Queue; +import javax.annotation.Nonnull; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ReadChangeStreamRetryTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String TABLE_ID = "fake-table"; + private static final String START_KEY_CLOSED = "a"; + private static final String END_KEY_OPEN = "b"; + private static final String HEARTBEAT_TOKEN = "heartbeat-token"; + private static final String CLOSE_STREAM_TOKEN = "close-stream-token"; + private static final String DATA_CHANGE_TOKEN = "data-change-token"; + private static final Instant REQUEST_START_TIME = Instant.ofEpochSecond(0L, 1000L); + + @Rule public GrpcServerRule serverRule = new GrpcServerRule(); + private TestBigtableService service; + private BigtableDataClient client; + + @Before + public void setUp() throws IOException { + service = new TestBigtableService(); + serverRule.getServiceRegistry().addService(service); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilder() + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics(); + + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + .build(); + + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() { + if (client != null) { + client.close(); + } + } + + private StreamContinuationToken createStreamContinuationToken(@Nonnull String token) { + return StreamContinuationToken.newBuilder() + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8(START_KEY_CLOSED)) + .setEndKeyOpen(ByteString.copyFromUtf8(END_KEY_OPEN)) + .build()) + .build()) + .setToken(token) + .build(); + } + + private StreamPartition createNewPartitionForCloseStream() { + return StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8(START_KEY_CLOSED)) + .setEndKeyOpen(ByteString.copyFromUtf8(END_KEY_OPEN))) + .build(); + } + + private ReadChangeStreamResponse.Heartbeat createHeartbeat( + StreamContinuationToken streamContinuationToken) { + return ReadChangeStreamResponse.Heartbeat.newBuilder() + .setContinuationToken(streamContinuationToken) + .setEstimatedLowWatermark(Timestamp.newBuilder().setSeconds(1000).build()) + .build(); + } + + private ReadChangeStreamResponse.CloseStream createCloseStream(boolean isOk) { + ReadChangeStreamResponse.CloseStream.Builder builder = + ReadChangeStreamResponse.CloseStream.newBuilder(); + if (isOk) { + builder.setStatus(com.google.rpc.Status.newBuilder().setCode(0)); + } else { + builder + .setStatus(com.google.rpc.Status.newBuilder().setCode(11)) + .addContinuationTokens(createStreamContinuationToken(CLOSE_STREAM_TOKEN)) + .addNewPartitions(createNewPartitionForCloseStream()); + } + return builder.build(); + } + + private ReadChangeStreamResponse.DataChange createDataChange(boolean done) { + Mutation deleteFromFamily = + Mutation.newBuilder() + .setDeleteFromFamily( + Mutation.DeleteFromFamily.newBuilder().setFamilyName("fake-family").build()) + .build(); + ReadChangeStreamResponse.DataChange.Builder dataChangeBuilder = + ReadChangeStreamResponse.DataChange.newBuilder() + .setType(ReadChangeStreamResponse.DataChange.Type.USER) + .setSourceClusterId("fake-source-cluster-id") + .setRowKey(ByteString.copyFromUtf8("key")) + .setCommitTimestamp(Timestamp.newBuilder().setSeconds(100).build()) + .setTiebreaker(100) + .addChunks( + ReadChangeStreamResponse.MutationChunk.newBuilder().setMutation(deleteFromFamily)); + if (done) { + dataChangeBuilder.setDone(true); + dataChangeBuilder.setEstimatedLowWatermark(Timestamp.newBuilder().setSeconds(1).build()); + dataChangeBuilder.setToken(DATA_CHANGE_TOKEN); + } + return dataChangeBuilder.build(); + } + + // [{ReadChangeStreamResponse.Heartbeat}] -> [{Heartbeat}] + @Test + public void happyPathHeartbeatTest() { + ReadChangeStreamResponse heartbeatResponse = + ReadChangeStreamResponse.newBuilder() + .setHeartbeat(createHeartbeat(createStreamContinuationToken(HEARTBEAT_TOKEN))) + .build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(heartbeatResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof Heartbeat); + } + + // [{ReadChangeStreamResponse.CloseStream}] -> [{CloseStream}] + @Test + public void happyPathCloseStreamTest() { + ReadChangeStreamResponse closeStreamResponse = + ReadChangeStreamResponse.newBuilder().setCloseStream(createCloseStream(true)).build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(closeStreamResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof CloseStream); + } + + // [{DataChange(done==true)}] -> [{ReadChangeStreamMutation}] + @Test + public void happyPathCompleteDataChangeTest() { + // Setting `done==true` to complete the ChangeStreamMutation. + ReadChangeStreamResponse dataChangeResponse = + ReadChangeStreamResponse.newBuilder().setDataChange(createDataChange(true)).build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(dataChangeResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof ChangeStreamMutation); + } + + // [{UNAVAILABLE}, {ReadChangeStreamResponse.Heartbeat}] -> [{Heartbeat}] + @Test + public void singleHeartbeatImmediateRetryTest() { + ReadChangeStreamResponse heartbeatResponse = + ReadChangeStreamResponse.newBuilder() + .setHeartbeat(createHeartbeat(createStreamContinuationToken(HEARTBEAT_TOKEN))) + .build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWithStatus(Code.UNAVAILABLE)); + // Resume with the exact same request. + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(heartbeatResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof Heartbeat); + } + + // [{UNAVAILABLE}, {ReadChangeStreamResponse.CloseStream}] -> [{CloseStream}] + @Test + public void singleCloseStreamImmediateRetryTest() { + // CloseStream. + ReadChangeStreamResponse closeStreamResponse = + ReadChangeStreamResponse.newBuilder().setCloseStream(createCloseStream(false)).build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWithStatus(Code.UNAVAILABLE)); + // Resume with the exact same request. + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(closeStreamResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof CloseStream); + } + + // [{UNAVAILABLE}, {DataChange with done==true}] -> [{(ChangeStreamRecord) ChangeStreamMutation}] + @Test + public void singleCompleteDataChangeImmediateRetryTest() { + // DataChange + ReadChangeStreamResponse dataChangeResponse = + ReadChangeStreamResponse.newBuilder().setDataChange(createDataChange(true)).build(); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWithStatus(Code.UNAVAILABLE)); + // Resume with the exact same request. + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(dataChangeResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof ChangeStreamMutation); + } + + // [{ReadChangeStreamResponse.Heartbeat}, {UNAVAILABLE}] -> Resume with token from heartbeat. + @Test + public void errorAfterHeartbeatShouldResumeWithTokenTest() { + StreamContinuationToken streamContinuationToken = + createStreamContinuationToken(HEARTBEAT_TOKEN); + ReadChangeStreamResponse heartbeatResponse = + ReadChangeStreamResponse.newBuilder() + .setHeartbeat(createHeartbeat(streamContinuationToken)) + .build(); + service.expectations.add( + RpcExpectation.create() + .expectInitialRequest() + .respondWith(heartbeatResponse) + .respondWithStatus(Code.UNAVAILABLE)); + // Resume the request with the token from the Heartbeat. `startTime` is cleared. + // We don't care about the response here so just do expectRequest. + service.expectations.add( + RpcExpectation.create() + .expectRequest( + StreamContinuationTokens.newBuilder().addTokens(streamContinuationToken).build())); + List actualResults = getResults(); + // This is the Heartbeat we get before UNAVAILABLE. + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof Heartbeat); + } + + // [{DataChange with done==true}, {UNAVAILABLE}] -> Resume with token from DataChange. + @Test + public void errorAfterDataChangeWithDoneShouldResumeWithTokenTest() { + // DataChange + ReadChangeStreamResponse dataChangeResponse = + ReadChangeStreamResponse.newBuilder().setDataChange(createDataChange(true)).build(); + service.expectations.add( + RpcExpectation.create() + .expectInitialRequest() + .respondWith(dataChangeResponse) + .respondWithStatus(Code.UNAVAILABLE)); + // Resume the request with the token from the ChangeStreamMutation. `startTime` is cleared. + // We don't care about the response here so just do expectRequest. + service.expectations.add( + RpcExpectation.create() + .expectRequest( + StreamContinuationTokens.newBuilder() + .addTokens(createStreamContinuationToken(DATA_CHANGE_TOKEN)) + .build())); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof ChangeStreamMutation); + } + + // [{DataChange with done==false}, {UNAVAILABLE}] -> Resume with original request. + @Test + public void errorAfterDataChangeWithoutDoneShouldResumeWithTokenTest() { + // DataChange + ReadChangeStreamResponse dataChangeResponse = + ReadChangeStreamResponse.newBuilder().setDataChange(createDataChange(false)).build(); + service.expectations.add( + RpcExpectation.create() + .expectInitialRequest() + .respondWith(dataChangeResponse) + .respondWithStatus(Code.UNAVAILABLE)); + // Resume the request with the original request, because the previous DataChange didn't + // complete the ChangeStreamMutation(i.e. without `done==true`). + // We don't care about the response here so just do expectRequest. + service.expectations.add(RpcExpectation.create().expectInitialRequest()); + List actualResults = getResults(); + Truth.assertThat(actualResults).isEmpty(); + } + + // [{DataChange with done==true}, {Heartbeat}, {UNAVAILABLE}] -> Resume with token from Heartbeat. + @Test + public void shouldResumeWithLastTokenTest() { + // DataChange + ReadChangeStreamResponse dataChangeResponse = + ReadChangeStreamResponse.newBuilder().setDataChange(createDataChange(true)).build(); + // Heartbeat. + ReadChangeStreamResponse heartbeatResponse = + ReadChangeStreamResponse.newBuilder() + .setHeartbeat(createHeartbeat(createStreamContinuationToken(HEARTBEAT_TOKEN))) + .build(); + service.expectations.add( + RpcExpectation.create() + .expectInitialRequest() + .respondWith(dataChangeResponse) + .respondWith(heartbeatResponse) + .respondWithStatus(Code.UNAVAILABLE)); + // If we receive a DataChange with done==true and a Heartbeat then a retryable error, it should + // resume with the last token, which is the one from the heartbeat. + // If the original request reads with start_time, it'll be resumed with the continuation token. + // We don't care about the response here so just do expectRequest. + service.expectations.add( + RpcExpectation.create() + .expectRequest( + StreamContinuationTokens.newBuilder() + .addTokens(createStreamContinuationToken(HEARTBEAT_TOKEN)) + .build())); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(2); + Assert.assertTrue(actualResults.get(0) instanceof ChangeStreamMutation); + Assert.assertTrue(actualResults.get(1) instanceof Heartbeat); + } + + @Test + public void retryRstStreamExceptionTest() { + ApiException exception = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), + GrpcStatusCode.of(Code.INTERNAL), + false); + ReadChangeStreamResponse heartbeatResponse = + ReadChangeStreamResponse.newBuilder() + .setHeartbeat(createHeartbeat(createStreamContinuationToken(HEARTBEAT_TOKEN))) + .build(); + service.expectations.add( + RpcExpectation.create() + .expectInitialRequest() + .respondWithException(Code.INTERNAL, exception)); + service.expectations.add( + RpcExpectation.create().expectInitialRequest().respondWith(heartbeatResponse)); + List actualResults = getResults(); + assertThat(actualResults.size()).isEqualTo(1); + Assert.assertTrue(actualResults.get(0) instanceof Heartbeat); + } + + private List getResults() { + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create(TABLE_ID).startTime(REQUEST_START_TIME); + // Always give it this partition. We don't care. + ServerStream actualRecords = + client.readChangeStream(query.streamPartition(START_KEY_CLOSED, END_KEY_OPEN)); + List actualValues = Lists.newArrayList(); + for (ChangeStreamRecord record : actualRecords) { + actualValues.add(record); + } + return actualValues; + } + + private static class TestBigtableService extends BigtableGrpc.BigtableImplBase { + Queue expectations = Queues.newArrayDeque(); + int i = -1; + + @Override + public void readChangeStream( + ReadChangeStreamRequest request, + StreamObserver responseObserver) { + + RpcExpectation expectedRpc = expectations.poll(); + i++; + + Truth.assertWithMessage("Unexpected request#" + i + ":" + request.toString()) + .that(expectedRpc) + .isNotNull(); + Truth.assertWithMessage("Unexpected request#" + i) + .that(request) + .isEqualTo(expectedRpc.getExpectedRequest()); + + for (ReadChangeStreamResponse response : expectedRpc.responses) { + responseObserver.onNext(response); + } + if (expectedRpc.statusCode.toStatus().isOk()) { + responseObserver.onCompleted(); + } else if (expectedRpc.exception != null) { + responseObserver.onError(expectedRpc.exception); + } else { + responseObserver.onError(expectedRpc.statusCode.toStatus().asRuntimeException()); + } + } + } + + private static class RpcExpectation { + ReadChangeStreamRequest.Builder requestBuilder; + Status.Code statusCode; + ApiException exception; + List responses; + + private RpcExpectation() { + this.requestBuilder = + ReadChangeStreamRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setPartition( + StreamPartition.newBuilder() + .setRowRange( + RowRange.newBuilder() + .setStartKeyClosed(ByteString.copyFromUtf8(START_KEY_CLOSED)) + .setEndKeyOpen(ByteString.copyFromUtf8(END_KEY_OPEN)) + .build()) + .build()); + this.statusCode = Status.Code.OK; + this.responses = Lists.newArrayList(); + } + + static RpcExpectation create() { + return new RpcExpectation(); + } + + RpcExpectation expectInitialRequest() { + requestBuilder.setStartTime( + Timestamp.newBuilder() + .setSeconds(REQUEST_START_TIME.getEpochSecond()) + .setNanos(REQUEST_START_TIME.getNano())); + return this; + } + + RpcExpectation expectRequest(StreamContinuationTokens continuationTokens) { + requestBuilder.setContinuationTokens(continuationTokens); + return this; + } + + RpcExpectation respondWithStatus(Status.Code code) { + this.statusCode = code; + return this; + } + + RpcExpectation respondWithException(Status.Code code, ApiException exception) { + this.statusCode = code; + this.exception = exception; + return this; + } + + RpcExpectation respondWith(ReadChangeStreamResponse... responses) { + Collections.addAll(this.responses, responses); + return this; + } + + ReadChangeStreamRequest getExpectedRequest() { + return requestBuilder.build(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallableTest.java new file mode 100644 index 000000000000..84f9765ea602 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallableTest.java @@ -0,0 +1,50 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.changestream; + +import com.google.bigtable.v2.ReadChangeStreamRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.common.truth.Truth; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ReadChangeStreamUserCallableTest { + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create("fake-project", "fake-instance", "fake-profile"); + + @Test + public void testRequestIsConverted() { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(); + ReadChangeStreamUserCallable callable = + new ReadChangeStreamUserCallable<>(innerCallable, REQUEST_CONTEXT); + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create("fake-table") + .streamPartition("begin", "end") + .startTime(Instant.ofEpochSecond(0L, 1000L)) + .endTime(Instant.ofEpochSecond(0L, 2000L)) + .heartbeatDuration(Duration.ofSeconds(1)); + callable.call(query); + Truth.assertThat(innerCallable.getActualRequest()).isEqualTo(query.toProto(REQUEST_CONTEXT)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java new file mode 100644 index 000000000000..1aceebd64f69 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java @@ -0,0 +1,154 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.metrics; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.api.core.InternalApi; +import com.google.common.truth.Correspondence; +import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +@InternalApi +public class BuiltinMetricsTestUtils { + private static final Correspondence METRIC_DATA_BY_NAME = + Correspondence.transforming(MetricData::getName, "MetricData name"); + + private BuiltinMetricsTestUtils() {} + + public static MetricData getMetricData(InMemoryMetricReader reader, String metricName) { + String fullMetricName = metricName; + Collection allMetricData = Collections.emptyList(); + + // Fetch the MetricData with retries + for (int attemptsLeft = 10; attemptsLeft > 0; attemptsLeft--) { + allMetricData = reader.collectAllMetrics(); + List matchingMetadata = + allMetricData.stream() + .filter(md -> METRIC_DATA_BY_NAME.compare(md, fullMetricName)) + .collect(Collectors.toList()); + assertWithMessage( + "Found multiple MetricData with the same name: %s, in: %s", + fullMetricName, matchingMetadata) + .that(matchingMetadata.size()) + .isAtMost(1); + + if (!matchingMetadata.isEmpty()) { + return matchingMetadata.get(0); + } + + try { + Thread.sleep(100); + } catch (InterruptedException interruptedException) { + Thread.currentThread().interrupt(); + throw new RuntimeException(interruptedException); + } + } + + // MetricData was not found, assert on original collection to get a descriptive error message + assertThat(allMetricData).comparingElementsUsing(METRIC_DATA_BY_NAME).contains(fullMetricName); + throw new IllegalStateException( + "MetricData was missing then appeared, this should never happen"); + } + + public static long getAggregatedValue(MetricData metricData, Attributes attributes) { + assertThat(metricData.getData().getPoints().stream().map(PointData::getAttributes)) + .contains(attributes); + + switch (metricData.getType()) { + case HISTOGRAM: + HistogramPointData hd = + metricData.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return (long) hd.getSum() / hd.getCount(); + case LONG_SUM: + LongPointData ld = + metricData.getLongSumData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return ld.getValue(); + default: + return 0; + } + } + + public static double getAggregatedDoubleValue(MetricData metricData, Attributes attributes) { + assertThat(metricData.getData().getPoints().stream().map(PointData::getAttributes)) + .contains(attributes); + + switch (metricData.getType()) { + case HISTOGRAM: + HistogramPointData hd = + metricData.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return hd.getSum() / hd.getCount(); + case DOUBLE_GAUGE: + DoublePointData dd = + metricData.getDoubleGaugeData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return dd.getValue(); + default: + return 0.0; + } + } + + public static Timestamp getStartTimeSeconds(MetricData metricData, Attributes attributes) { + switch (metricData.getType()) { + case HISTOGRAM: + HistogramPointData hd = + metricData.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return Timestamps.fromNanos(hd.getStartEpochNanos()); + case LONG_SUM: + LongPointData ld = + metricData.getLongSumData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()) + .get(0); + return Timestamps.fromNanos(ld.getStartEpochNanos()); + default: + return Timestamp.getDefaultInstance(); + } + } + + public static void verifyAttributes(MetricData metricData, Attributes attributes) { + assertThat(metricData.getType()).isAnyOf(MetricDataType.HISTOGRAM, MetricDataType.LONG_SUM); + assertThat(metricData.getData().getPoints().stream().map(PointData::getAttributes)) + .contains(attributes); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java new file mode 100644 index 000000000000..a990424aee01 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java @@ -0,0 +1,293 @@ +/* + * 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.cloud.bigtable.data.v2.stub.metrics; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.BigtableGrpc.BigtableImplBase; +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.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.common.collect.Queues; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class StatsHeadersCallableTest { + private Server server; + + private final FakeService fakeService = new FakeService(); + + private EnhancedBigtableStub stub; + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final String APP_PROFILE_ID = "default"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + + private final int attemptCounts = 3; + private MetadataInterceptor metadataInterceptor; + + @Before + public void setUp() throws Exception { + metadataInterceptor = new MetadataInterceptor(); + server = FakeServiceBuilder.create(fakeService).intercept(metadataInterceptor).start(); + + EnhancedBigtableStubSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setAppProfileId(APP_PROFILE_ID) + .build() + .getStubSettings(); + stub = EnhancedBigtableStub.create(settings); + } + + @After + public void tearDown() { + if (stub != null) { + stub.close(); + } + if (server != null) { + server.shutdown(); + } + } + + @Test + public void testReadRowsHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.readRowsCallable().call(Query.create(TABLE_ID).rowKey("key")).iterator().next(); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Test + public void testReadRowHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.readRowCallable().futureCall(Query.create(TABLE_ID).rowKey("key")).get(); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Test + public void testMutateRowsHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.bulkMutateRowsCallable() + .futureCall(BulkMutation.create(TABLE_ID).add(RowMutationEntry.create("key"))) + .get(); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Test + public void testMutateRowHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.mutateRowCallable() + .futureCall(RowMutation.create(TABLE_ID, "key").setCell("f", "q", "value")) + .get(); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Deprecated + @Test + public void testSampleRowKeysHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.sampleRowKeysCallable().call(TABLE_ID.getTableId()).get(0); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Test + public void testSampleRowKeysWithRequestHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.sampleRowKeysCallableWithRequest().call(SampleRowKeysRequest.create(TABLE_ID)).get(0); + verifyHeaders(attemptCounts, startTimestamp); + } + + @Test + public void testCheckAndMutateHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.checkAndMutateRowCallable() + .call( + ConditionalRowMutation.create(TABLE_ID, "key") + .then(Mutation.create().setCell("f", "q", "value"))); + verifyHeaders(1, startTimestamp); + } + + @Test + public void testReadModifyWriteHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.readModifyWriteRowCallable() + .call(ReadModifyWriteRow.create(TABLE_ID, "key").append("f", "q", "value")); + verifyHeaders(1, startTimestamp); + } + + @Test + public void testMultipleRequests() throws Exception { + // Send multiple requests and make sure headers are set correctly + long startTimestamp = System.currentTimeMillis() * 1000; + stub.readRowsCallable().call(Query.create(TABLE_ID).rowKey("key")).iterator().next(); + verifyHeaders(attemptCounts, startTimestamp); + + startTimestamp = System.currentTimeMillis() * 1000; + stub.readRowsCallable().call(Query.create(TABLE_ID).rowKey("key")).iterator().next(); + verifyHeaders(1, startTimestamp); + } + + private static class MetadataInterceptor implements ServerInterceptor { + final BlockingQueue headers = Queues.newLinkedBlockingDeque(); + + @Override + public Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + headers.add(metadata); + return serverCallHandler.startCall(serverCall, metadata); + } + } + + private class FakeService extends BigtableImplBase { + AtomicInteger callCount = new AtomicInteger(0); + + @Override + public void readRows(ReadRowsRequest request, StreamObserver observer) { + if (callCount.get() < attemptCounts - 1) { + callCount.incrementAndGet(); + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + observer.onNext( + ReadRowsResponse.newBuilder() + .addChunks( + ReadRowsResponse.CellChunk.newBuilder() + .setCommitRow(true) + .setRowKey(ByteString.copyFromUtf8("a")) + .setFamilyName(StringValue.getDefaultInstance()) + .setQualifier(BytesValue.getDefaultInstance()) + .setValueSize(0)) + .build()); + observer.onCompleted(); + } + + @Override + public void mutateRow(MutateRowRequest request, StreamObserver observer) { + if (callCount.get() < attemptCounts - 1) { + callCount.incrementAndGet(); + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + observer.onNext(MutateRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void mutateRows(MutateRowsRequest request, StreamObserver observer) { + if (callCount.get() < attemptCounts - 1) { + callCount.incrementAndGet(); + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntriesBuilder().setIndex(i); + } + observer.onNext(builder.build()); + observer.onCompleted(); + } + + @Override + public void sampleRowKeys( + com.google.bigtable.v2.SampleRowKeysRequest request, + StreamObserver observer) { + if (callCount.get() < attemptCounts - 1) { + callCount.incrementAndGet(); + observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + return; + } + observer.onNext(SampleRowKeysResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, StreamObserver observer) { + observer.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, StreamObserver observer) { + observer.onNext(ReadModifyWriteRowResponse.getDefaultInstance()); + observer.onCompleted(); + } + } + + private void verifyHeaders(int expectedAttemptCounts, long startTimestamp) throws Exception { + assertThat(metadataInterceptor.headers).hasSize(expectedAttemptCounts); + long timestamp = startTimestamp; + + for (int i = 0; i < expectedAttemptCounts; i++) { + Metadata headers = metadataInterceptor.headers.take(); + String attemptCount = headers.get(Util.ATTEMPT_HEADER_KEY); + assertThat(attemptCount).isNotNull(); + assertThat(Integer.valueOf(attemptCount)).isEqualTo(i); + + String clientTimeStr = headers.get(Util.ATTEMPT_EPOCH_KEY); + assertThat(clientTimeStr).isNotNull(); + long clientTime = Long.valueOf(clientTimeStr); + assertThat(clientTime).isAtLeast(timestamp); + + timestamp = clientTime; + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java new file mode 100644 index 000000000000..60ec5193e45a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java @@ -0,0 +1,444 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.mutaterows; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.any; + +import com.google.api.core.AbstractApiFuture; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.UnavailableException; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsRequest.Entry; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import com.google.rpc.Status; +import java.time.Duration; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; + +@RunWith(JUnit4.class) +public class MutateRowsAttemptCallableTest { + private static final Status OK_STATUS_PROTO = + Status.newBuilder().setCode(com.google.rpc.Code.OK_VALUE).build(); + + private static final Status TRANSIENT_ERROR_STATUS_PROTO = + Status.newBuilder().setCode(com.google.rpc.Code.UNAVAILABLE_VALUE).build(); + + private static final Status PERMENANT_ERROR_STATUS_PROTO = + Status.newBuilder().setCode(com.google.rpc.Code.INVALID_ARGUMENT_VALUE).build(); + + private MockInnerCallable innerCallable; + private Set retryCodes; + private ApiCallContext callContext; + private MockRetryingFuture parentFuture; + private final RetryAlgorithm mockRetryAlgorithm = + Mockito.mock(RetryAlgorithm.class); + + @Before + public void setUp() { + innerCallable = new MockInnerCallable(); + retryCodes = ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); + callContext = GrpcCallContext.createDefault(); + parentFuture = new MockRetryingFuture(); + Mockito.when(mockRetryAlgorithm.shouldRetry(any(), any(), any(), any())) + .thenAnswer( + input -> { + Throwable throwable = input.getArgument(1); + return ((ApiException) throwable).isRetryable(); + }); + } + + @Test + public void singleEntrySuccessTest() throws Exception { + MutateRowsRequest request = + MutateRowsRequest.newBuilder().addEntries(Entry.getDefaultInstance()).build(); + innerCallable.response.add( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder().setIndex(0).setStatus(OK_STATUS_PROTO)) + .build()); + + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + attemptCallable.call(); + + // Attempt completed successfully + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); + + assertThat(result).isNotNull(); + assertThat(result.getFailedMutations()).hasSize(0); + assertThat(result.getIsRetryable()).isFalse(); + // innerCallable received the request + assertThat(innerCallable.lastRequest).isEqualTo(request); + } + + @Test + public void missingEntry() throws Exception { + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .addEntries(Entry.getDefaultInstance()) + .addEntries(Entry.getDefaultInstance()) + .build(); + innerCallable.response.add( + MutateRowsResponse.newBuilder() + .addEntries(MutateRowsResponse.Entry.newBuilder().setIndex(0)) + .build()); + + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + attemptCallable.call(); + + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); + + assertThat(result.getFailedMutations()).hasSize(1); + FailedMutation failedMutation = result.getFailedMutations().get(0); + assertThat(failedMutation.getIndex()).isEqualTo(1); + assertThat(failedMutation.getError()) + .hasMessageThat() + .contains("Missing entry response for entry 1"); + } + + @Test + public void testNoRpcTimeout() { + parentFuture.timedAttemptSettings = + parentFuture.timedAttemptSettings.toBuilder().setRpcTimeoutDuration(Duration.ZERO).build(); + + MutateRowsRequest request = + MutateRowsRequest.newBuilder().addEntries(Entry.getDefaultInstance()).build(); + + innerCallable.response.add( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder().setIndex(0).setStatus(OK_STATUS_PROTO)) + .build()); + + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + attemptCallable.call(); + + assertThat(innerCallable.lastContext.getTimeout()).isNull(); + } + + @Test + public void mixedTest() throws Exception { + // Setup the request & response + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .addEntries(Entry.getDefaultInstance()) + .addEntries(Entry.getDefaultInstance()) + .addEntries(Entry.getDefaultInstance()) + .build(); + + innerCallable.response.add( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder().setIndex(0).setStatus(OK_STATUS_PROTO)) + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(1) + .setStatus(TRANSIENT_ERROR_STATUS_PROTO)) + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(2) + .setStatus(PERMENANT_ERROR_STATUS_PROTO)) + .build()); + + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + + // Make the only call + attemptCallable.call(); + + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); + + // Entry expectations + @SuppressWarnings("ConstantConditions") + List failedMutations = result.getFailedMutations(); + assertThat(failedMutations).hasSize(2); + + assertThat(failedMutations.get(0).getIndex()).isEqualTo(1); + assertThat(failedMutations.get(0).getError().getStatusCode().getCode()) + .isEqualTo(Code.UNAVAILABLE); + assertThat(failedMutations.get(0).getError().isRetryable()).isTrue(); + + assertThat(failedMutations.get(1).getIndex()).isEqualTo(2); + assertThat(failedMutations.get(1).getError().getStatusCode().getCode()) + .isEqualTo(Code.INVALID_ARGUMENT); + assertThat(failedMutations.get(1).getError().isRetryable()).isFalse(); + } + + @Test + public void nextAttemptTest() throws Exception { + // Setup the request & response for the first call + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .addEntries(Entry.newBuilder().setRowKey(ByteString.copyFromUtf8("0-ok"))) + .addEntries(Entry.newBuilder().setRowKey(ByteString.copyFromUtf8("1-unavailable"))) + .addEntries(Entry.newBuilder().setRowKey(ByteString.copyFromUtf8("2-invalid"))) + .build(); + + innerCallable.response.add( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder().setIndex(0).setStatus(OK_STATUS_PROTO)) + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(1) + .setStatus(TRANSIENT_ERROR_STATUS_PROTO)) + .addEntries( + MutateRowsResponse.Entry.newBuilder() + .setIndex(2) + .setStatus(PERMENANT_ERROR_STATUS_PROTO)) + .build()); + + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + + // Make the first call + attemptCallable.call(); + + // Setup the request & response for the next call + innerCallable.response = + Lists.newArrayList( + MutateRowsResponse.newBuilder() + .addEntries( + MutateRowsResponse.Entry.newBuilder().setIndex(0).setStatus(OK_STATUS_PROTO)) + .build()); + attemptCallable.call(); + + // Make sure that only the entry with the transient error is resubmitted + assertThat(innerCallable.lastRequest.getEntriesCount()).isEqualTo(1); + assertThat(innerCallable.lastRequest.getEntries(0).getRowKey()) + .isEqualTo(ByteString.copyFromUtf8("1-unavailable")); + + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); + + // Entry expectations + @SuppressWarnings("ConstantConditions") + List failedMutations = result.getFailedMutations(); + assertThat(failedMutations).hasSize(1); + + assertThat(failedMutations.get(0).getIndex()).isEqualTo(2); + assertThat(failedMutations.get(0).getError().getStatusCode().getCode()) + .isEqualTo(Code.INVALID_ARGUMENT); + assertThat(failedMutations.get(0).getError().isRetryable()).isFalse(); + } + + @Test + public void rpcRetryableError() { + // Setup the request & response + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .addEntries(Entry.getDefaultInstance()) + .addEntries(Entry.getDefaultInstance()) + .build(); + + final UnavailableException rpcError = + new UnavailableException( + "fake error", null, GrpcStatusCode.of(io.grpc.Status.Code.UNAVAILABLE), true); + + UnaryCallable> innerCallable = + new UnaryCallable>() { + @Override + public ApiFuture> futureCall( + MutateRowsRequest request, ApiCallContext context) { + return ApiFutures.immediateFailedFuture(rpcError); + } + }; + + // Make the call + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + attemptCallable.call(); + + // Overall expectations: retryable error + Throwable actualError = null; + try { + parentFuture.attemptFuture.get(); + } catch (Throwable t) { + actualError = t.getCause(); + } + assertThat(actualError).isInstanceOf(MutateRowsException.class); + assertThat(((MutateRowsException) actualError).isRetryable()).isTrue(); + + // Entry expectations: both entries failed with an error whose cause is the rpc error + @SuppressWarnings("ConstantConditions") + List failedMutations = ((MutateRowsException) actualError).getFailedMutations(); + assertThat(failedMutations).hasSize(2); + + assertThat(failedMutations.get(0).getIndex()).isEqualTo(0); + assertThat(failedMutations.get(0).getError().isRetryable()).isTrue(); + assertThat(failedMutations.get(0).getError().getCause()).isEqualTo(rpcError); + + assertThat(failedMutations.get(1).getIndex()).isEqualTo(1); + assertThat(failedMutations.get(1).getError().isRetryable()).isTrue(); + assertThat(failedMutations.get(1).getError().getCause()).isEqualTo(rpcError); + } + + @Test + public void rpcPermanentError() { + // Setup the request & response + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .addEntries(Entry.getDefaultInstance()) + .addEntries(Entry.getDefaultInstance()) + .build(); + + final UnavailableException rpcError = + new UnavailableException( + "fake error", null, GrpcStatusCode.of(io.grpc.Status.Code.INVALID_ARGUMENT), false); + + UnaryCallable> innerCallable = + new UnaryCallable>() { + @Override + public ApiFuture> futureCall( + MutateRowsRequest request, ApiCallContext context) { + return ApiFutures.immediateFailedFuture(rpcError); + } + }; + + // Make the call + MutateRowsAttemptCallable attemptCallable = + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); + attemptCallable.setExternalFuture(parentFuture); + attemptCallable.call(); + + // Overall expectations: retryable error + Throwable actualError = null; + try { + parentFuture.attemptFuture.get(); + } catch (Throwable t) { + actualError = t.getCause(); + } + assertThat(actualError).isInstanceOf(MutateRowsException.class); + assertThat(((MutateRowsException) actualError).isRetryable()).isFalse(); + + // Entry expectations: both entries failed with an error whose cause is the rpc error + @SuppressWarnings("ConstantConditions") + List failedMutations = ((MutateRowsException) actualError).getFailedMutations(); + assertThat(failedMutations).hasSize(2); + + assertThat(failedMutations.get(0).getIndex()).isEqualTo(0); + assertThat(failedMutations.get(0).getError().isRetryable()).isFalse(); + assertThat(failedMutations.get(0).getError().getCause()).isEqualTo(rpcError); + + assertThat(failedMutations.get(1).getIndex()).isEqualTo(1); + assertThat(failedMutations.get(1).getError().isRetryable()).isFalse(); + assertThat(failedMutations.get(1).getError().getCause()).isEqualTo(rpcError); + } + + // + static class MockInnerCallable + extends UnaryCallable> { + List response = Lists.newArrayList(); + MutateRowsRequest lastRequest; + ApiCallContext lastContext; + + @Override + public ApiFuture> futureCall( + MutateRowsRequest request, ApiCallContext context) { + lastRequest = request; + lastContext = context; + + return ApiFutures.immediateFuture(response); + } + } + + static class MockRetryingFuture extends AbstractApiFuture + implements RetryingFuture { + ApiFuture attemptFuture; + + TimedAttemptSettings timedAttemptSettings; + + MockRetryingFuture() { + this(Duration.ofSeconds(5)); + } + + MockRetryingFuture(Duration totalTimeout) { + this.timedAttemptSettings = + TimedAttemptSettings.newBuilder() + .setRpcTimeoutDuration(Duration.ofSeconds(1)) + .setRetryDelayDuration(Duration.ZERO) + .setRandomizedRetryDelayDuration(Duration.ZERO) + .setAttemptCount(0) + .setFirstAttemptStartTimeNanos(0) + .setGlobalSettings( + RetrySettings.newBuilder().setTotalTimeoutDuration(totalTimeout).build()) + .build(); + } + + @Override + public void setAttemptFuture(ApiFuture attemptFuture) { + this.attemptFuture = attemptFuture; + } + + @Override + public TimedAttemptSettings getAttemptSettings() { + return timedAttemptSettings; + } + + @Override + public Callable getCallable() { + throw new UnsupportedOperationException("not used"); + } + + @Override + public ApiFuture peekAttemptResult() { + throw new UnsupportedOperationException("not used"); + } + + @Override + public ApiFuture getAttemptResult() { + throw new UnsupportedOperationException("not used"); + } + } + // +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java new file mode 100644 index 000000000000..11658d8792bd --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java @@ -0,0 +1,256 @@ +/* + * Copyright 2019 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.cloud.bigtable.data.v2.stub.mutaterows; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.batching.BatchEntry; +import com.google.api.gax.batching.BatchResource; +import com.google.api.gax.batching.BatchingRequestBuilder; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.UnavailableException; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.collect.ImmutableList; +import io.grpc.Status; +import io.grpc.Status.Code; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MutateRowsBatchingDescriptorTest { + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final String ROW_KEY = "fake-row-key"; + private static final String FAMILY = "fake-family"; + private static final String QUALIFIER = "fake-qualifier"; + private static final String VALUE = "fake-value"; + + private static final RequestContext requestContext = + RequestContext.create("fake-project", "fake-instance", "fake-profile"); + + @Test + public void countBytesTest() { + RowMutationEntry request = RowMutationEntry.create(ROW_KEY).setCell(FAMILY, QUALIFIER, VALUE); + long bytes = request.toProto().getSerializedSize(); + + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + assertThat(underTest.countBytes(request)).isEqualTo(bytes); + } + + @Test + public void requestBuilderTest() { + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + long timestamp = 10_000L; + BulkMutation bulkMutation = BulkMutation.create(TABLE_ID); + BatchingRequestBuilder requestBuilder = + underTest.newRequestBuilder(bulkMutation); + requestBuilder.add( + RowMutationEntry.create(ROW_KEY).setCell(FAMILY, QUALIFIER, timestamp, VALUE)); + requestBuilder.add( + RowMutationEntry.create("rowKey-2").setCell("family-2", "q", 20_000L, "some-value")); + + BulkMutation actualBulkMutation = requestBuilder.build(); + assertThat(actualBulkMutation.toProto(requestContext)) + .isEqualTo( + BulkMutation.create(TABLE_ID) + .add(ROW_KEY, Mutation.create().setCell(FAMILY, QUALIFIER, timestamp, VALUE)) + .add("rowKey-2", Mutation.create().setCell("family-2", "q", 20_000L, "some-value")) + .toProto(requestContext)); + } + + @Test + public void splitResponseTest() { + BatchEntry batchEntry1 = + BatchEntry.create( + RowMutationEntry.create("key1").deleteRow(), SettableApiFuture.create()); + BatchEntry batchEntry2 = + BatchEntry.create( + RowMutationEntry.create("key2").deleteRow(), SettableApiFuture.create()); + + List> batchResponse = + ImmutableList.of(batchEntry1, batchEntry2); + assertThat(batchResponse.get(0).getResultFuture().isDone()).isFalse(); + assertThat(batchResponse.get(1).getResultFuture().isDone()).isFalse(); + + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + underTest.splitResponse(MutateRowsAttemptResult.success(), batchResponse); + assertThat(batchResponse.get(0).getResultFuture().isDone()).isTrue(); + assertThat(batchResponse.get(1).getResultFuture().isDone()).isTrue(); + } + + @Test + public void splitResponsePartialErrorsTest() { + BatchEntry batchEntry1 = + BatchEntry.create( + RowMutationEntry.create("key1").deleteRow(), SettableApiFuture.create()); + BatchEntry batchEntry2 = + BatchEntry.create( + RowMutationEntry.create("key2").deleteRow(), SettableApiFuture.create()); + + List> batchResponse = + ImmutableList.of(batchEntry1, batchEntry2); + assertThat(batchResponse.get(0).getResultFuture().isDone()).isFalse(); + assertThat(batchResponse.get(1).getResultFuture().isDone()).isFalse(); + + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + underTest.splitResponse( + MutateRowsAttemptResult.create( + Collections.singletonList( + FailedMutation.create( + 0, + ApiExceptionFactory.createException( + "error message", null, GrpcStatusCode.of(Code.INTERNAL), false))), + true), + batchResponse); + assertThat(batchResponse.get(0).getResultFuture().isDone()).isTrue(); + assertThat(batchResponse.get(1).getResultFuture().isDone()).isTrue(); + + Throwable unexpectedError = null; + try { + batchResponse.get(1).getResultFuture().get(); + + } catch (Throwable t) { + unexpectedError = t; + } + assertThat(unexpectedError).isNull(); + + Throwable actualError = + assertThrows(ExecutionException.class, () -> batchResponse.get(0).getResultFuture().get()) + .getCause(); + + assertThat(actualError).isInstanceOf(InternalException.class); + assertThat(actualError).hasMessageThat().contains("error message"); + } + + @Test + public void splitExceptionTest() { + BatchEntry batchEntry1 = + BatchEntry.create( + RowMutationEntry.create("key1").deleteRow(), SettableApiFuture.create()); + BatchEntry batchEntry2 = + BatchEntry.create( + RowMutationEntry.create("key2").deleteRow(), SettableApiFuture.create()); + + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + final RuntimeException expectedEx = new RuntimeException("Caused while batching"); + List> batchResponses = + ImmutableList.of(batchEntry1, batchEntry2); + + underTest.splitException(expectedEx, batchResponses); + + for (BatchEntry response : batchResponses) { + try { + response.getResultFuture().get(); + } catch (ExecutionException | InterruptedException ex) { + assertThat(ex).hasCauseThat().isSameInstanceAs(expectedEx); + } + } + } + + @Test + public void splitExceptionWithFailedMutationsTest() { + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + Throwable actualThrowable = null; + BatchEntry batchEntry1 = + BatchEntry.create( + RowMutationEntry.create("key1").deleteRow(), SettableApiFuture.create()); + BatchEntry batchEntry2 = + BatchEntry.create( + RowMutationEntry.create("key2").deleteRow(), SettableApiFuture.create()); + BatchEntry batchEntry3 = + BatchEntry.create( + RowMutationEntry.create("key3").deleteRow(), SettableApiFuture.create()); + + // Threw an exception at 1st and 3rd entry + MutateRowsException serverError = + MutateRowsException.create( + null, + GrpcStatusCode.of(Status.Code.UNAVAILABLE), + ImmutableList.of( + MutateRowsException.FailedMutation.create( + 0, + new UnavailableException( + null, GrpcStatusCode.of(Status.Code.UNAVAILABLE), true)), + MutateRowsException.FailedMutation.create( + 2, + new DeadlineExceededException( + null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true))), + true); + underTest.splitException(serverError, ImmutableList.of(batchEntry1, batchEntry2, batchEntry3)); + + try { + batchEntry1.getResultFuture().get(); + } catch (ExecutionException | InterruptedException e) { + actualThrowable = e; + } + assertThat(actualThrowable) + .hasCauseThat() + .isEqualTo(serverError.getFailedMutations().get(0).getError()); + + // As there is no exception for 2nd entry so it should not throw any exception + actualThrowable = null; + try { + batchEntry2.getResultFuture().get(); + } catch (ExecutionException | InterruptedException e) { + actualThrowable = e; + } + assertThat(actualThrowable).isNull(); + + actualThrowable = null; + try { + batchEntry3.getResultFuture().get(); + } catch (ExecutionException | InterruptedException e) { + actualThrowable = e; + } + // The third response should has the last found failed mutation error. + assertThat(actualThrowable) + .hasCauseThat() + .isEqualTo(serverError.getFailedMutations().get(1).getError()); + } + + @Test + public void shouldFlushTest() { + MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); + RowMutationEntry entryWithManyMutations = RowMutationEntry.create("key1"); + for (int i = 0; i < 100000; i++) { + entryWithManyMutations.setCell("f", "q", "v" + i); + } + RowMutationEntry entryWithSingleEntry = RowMutationEntry.create("key1").setCell("f", "q", "v"); + BatchResource resourceWithManyMutations = underTest.createResource(entryWithManyMutations); + BatchResource resourceWithSingleMutation = underTest.createResource(entryWithSingleEntry); + + assertThat(resourceWithManyMutations.shouldFlush(1, 20 * 1000 * 1000)).isFalse(); + assertThat( + resourceWithManyMutations + .add(resourceWithSingleMutation) + .shouldFlush(3, 20 * 1000 * 1000)) + .isTrue(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.java new file mode 100644 index 000000000000..7f2de3e72844 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.java @@ -0,0 +1,111 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.mutaterows; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException.FailedMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.MutateRowsErrorConverterUnaryCallable; +import io.grpc.Status.Code; +import java.util.Collections; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class MutateRowsErrorConverterUnaryCallableTest { + private static final TableId TABLE_ID = TableId.of("fake-table"); + + @Mock private UnaryCallable innerCallable; + @Captor private ArgumentCaptor innerMutation; + private SettableApiFuture innerResult; + + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + @Before + public void setUp() { + innerResult = SettableApiFuture.create(); + Mockito.when(innerCallable.futureCall(innerMutation.capture(), Mockito.any())) + .thenReturn(innerResult); + } + + @Test + public void testSuccess() { + MutateRowsErrorConverterUnaryCallable callable = + new MutateRowsErrorConverterUnaryCallable(innerCallable); + + innerResult.set(MutateRowsAttemptResult.success()); + + Throwable unexpectedError = null; + try { + callable.call(BulkMutation.create(TABLE_ID)); + } catch (Throwable t) { + unexpectedError = t; + } + assertThat(unexpectedError).isNull(); + } + + @Test + public void testPartialFailure() { + MutateRowsErrorConverterUnaryCallable callable = + new MutateRowsErrorConverterUnaryCallable(innerCallable); + + innerResult.set( + MutateRowsAttemptResult.create( + Collections.singletonList( + FailedMutation.create( + 0, + ApiExceptionFactory.createException( + null, GrpcStatusCode.of(Code.INTERNAL), false))), + true)); + + MutateRowsException exception = + Assert.assertThrows( + MutateRowsException.class, () -> callable.call(BulkMutation.create(TABLE_ID))); + + assertThat(exception).isInstanceOf(MutateRowsException.class); + assertThat(exception.isRetryable()).isTrue(); + } + + @Test + public void testRPCFailure() { + MutateRowsErrorConverterUnaryCallable callable = + new MutateRowsErrorConverterUnaryCallable(innerCallable); + + innerResult.setException(new Exception("RPC error")); + + Exception exception = + Assert.assertThrows(Exception.class, () -> callable.call(BulkMutation.create(TABLE_ID))); + + assertThat(exception).isInstanceOf(Exception.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java new file mode 100644 index 000000000000..ce2f7a6c7ca1 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java @@ -0,0 +1,124 @@ +/* + * 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.google.cloud.bigtable.data.v2.stub.mutaterows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.InternalException; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.collect.Queues; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcServerRule; +import java.io.IOException; +import java.util.Queue; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MutateRowsRetryTest { + + @Rule public GrpcServerRule serverRule = new GrpcServerRule(); + + private FakeBigtableService service; + private BigtableDataClient client; + + private final AtomicInteger attemptCounter = new AtomicInteger(); + + @Before + public void setUp() throws IOException { + service = new FakeBigtableService(); + serverRule.getServiceRegistry().addService(service); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilder() + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics(); + + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + .build(); + + this.client = BigtableDataClient.create(settings.build()); + } + + @Test + public void testRetryRstStream() { + ApiException exception = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + + service.expectations.add(exception); + + try { + client.bulkMutateRows( + BulkMutation.create(TableId.of("fake-table")) + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))); + } catch (ApiException e) { + throw new AssertionError("Rst stream errors should be retried", e); + } + + Assert.assertEquals(2, attemptCounter.get()); + } + + private class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + Queue expectations = Queues.newArrayDeque(); + + @Override + public void mutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + attemptCounter.incrementAndGet(); + if (expectations.isEmpty()) { + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + builder.addEntriesBuilder().setIndex(i); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } else { + Exception expectedRpc = expectations.poll(); + responseObserver.onError(expectedRpc); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallableTest.java new file mode 100644 index 000000000000..80352bc7c507 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallableTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class FilterMarkerRowsCallableTest { + private final DefaultRowAdapter rowAdapter = new DefaultRowAdapter(); + + @Test + public void testEmpty() { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(); + FilterMarkerRowsCallable filterCallable = + new FilterMarkerRowsCallable<>(innerCallable, rowAdapter); + + ServerStream results = filterCallable.call(ReadRowsRequest.getDefaultInstance()); + + assertThat(results).isEmpty(); + } + + @Test + public void testOnlyMarker() { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Lists.newArrayList(buildScanMarker())); + FilterMarkerRowsCallable filterCallable = + new FilterMarkerRowsCallable<>(innerCallable, rowAdapter); + + ServerStream results = filterCallable.call(ReadRowsRequest.getDefaultInstance()); + + assertThat(results).isEmpty(); + } + + @Test + public void testRealRow() { + Row row = buildRealRow(); + + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Lists.newArrayList(row)); + FilterMarkerRowsCallable filterCallable = + new FilterMarkerRowsCallable<>(innerCallable, rowAdapter); + + ServerStream results = filterCallable.call(ReadRowsRequest.getDefaultInstance()); + + assertThat(results).containsExactly(row); + } + + @Test + public void testMixed() { + Row row = buildRealRow(); + Row markerRow = buildScanMarker(); + + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Lists.newArrayList(row, markerRow)); + FilterMarkerRowsCallable filterCallable = + new FilterMarkerRowsCallable<>(innerCallable, rowAdapter); + + ServerStream results = filterCallable.call(ReadRowsRequest.getDefaultInstance()); + + assertThat(results).containsExactly(row); + } + + private Row buildRealRow() { + RowBuilder rowBuilder = rowAdapter.createRowBuilder(); + rowBuilder.startRow(ByteString.copyFromUtf8("fake-key")); + rowBuilder.startCell( + "fake-family", + ByteString.copyFromUtf8("fake-qualifer"), + 1_000, + Lists.newArrayList(), + 0); + rowBuilder.cellValue(ByteString.copyFromUtf8("fake-value")); + rowBuilder.finishCell(); + return rowBuilder.finishRow(); + } + + private Row buildScanMarker() { + return rowAdapter.createRowBuilder().createScanMarkerRow(ByteString.copyFromUtf8("fake-key2")); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java new file mode 100644 index 000000000000..32571283a208 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java @@ -0,0 +1,136 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub.readrows; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.batching.BatchEntry; +import com.google.api.gax.batching.BatchingRequestBuilder; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +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.TableId; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadRowsBatchingDescriptorTest { + + private static final RowCell ROW_CELL = + RowCell.create( + "cf", + ByteString.copyFromUtf8("qualifier"), + 10000, + ImmutableList.of("label-1", "label-2"), + ByteString.copyFromUtf8("qualifier")); + private static final Row ROW_KEY_1_RESPONSE = + Row.create(ByteString.copyFromUtf8("row-key-1"), ImmutableList.of(ROW_CELL)); + private static final Row ROW_KEY_2_RESPONSE = + Row.create(ByteString.copyFromUtf8("row-key-2"), ImmutableList.of(ROW_CELL)); + + private final ReadRowsBatchingDescriptor underTest = new ReadRowsBatchingDescriptor(); + + @Test + public void splitResponseTest() throws Exception { + List> batchEntries = createBatchEntries("row-key-1", "row-key-2"); + underTest.splitResponse(ImmutableList.of(ROW_KEY_1_RESPONSE, ROW_KEY_2_RESPONSE), batchEntries); + + assertThat(batchEntries.get(0).getResultFuture().get()).isEqualTo(ROW_KEY_1_RESPONSE); + assertThat(batchEntries.get(1).getResultFuture().get()).isEqualTo(ROW_KEY_2_RESPONSE); + } + + @Test + public void splitResponseWithDuplicateKeysTest() throws Exception { + List> batchEntries = + createBatchEntries("row-key-1", "row-key-2", "row-key-1", "row-key-1"); + + underTest.splitResponse(ImmutableList.of(ROW_KEY_1_RESPONSE, ROW_KEY_2_RESPONSE), batchEntries); + + assertThat(batchEntries.get(0).getResultFuture().get()).isEqualTo(ROW_KEY_1_RESPONSE); + assertThat(batchEntries.get(1).getResultFuture().get()).isEqualTo(ROW_KEY_2_RESPONSE); + assertThat(batchEntries.get(2).getResultFuture().get()).isEqualTo(ROW_KEY_1_RESPONSE); + assertThat(batchEntries.get(3).getResultFuture().get()).isEqualTo(ROW_KEY_1_RESPONSE); + } + + @Test + public void splitResponseWithNonExistent() throws Exception { + List> batchEntries = + createBatchEntries("non-existent-1", "non-existent-2", "row-key-1"); + + underTest.splitResponse(ImmutableList.of(ROW_KEY_1_RESPONSE), batchEntries); + + assertThat(batchEntries.size()).isEqualTo(3); + assertThat(batchEntries.get(0).getResultFuture().get()).isNull(); + assertThat(batchEntries.get(1).getResultFuture().get()).isNull(); + assertThat(batchEntries.get(2).getResultFuture().get()).isEqualTo(ROW_KEY_1_RESPONSE); + } + + @Test + public void splitExceptionTest() { + RuntimeException expectedException = new RuntimeException("cannot scan the table"); + List> batchEntries = createBatchEntries("row-key-1", "row-key-2"); + underTest.splitException(expectedException, batchEntries); + for (BatchEntry resultEntry : batchEntries) { + try { + resultEntry.getResultFuture().get(); + } catch (Exception actualEx) { + assertThat(actualEx).hasCauseThat().isEqualTo(expectedException); + } + } + } + + @Test + public void countBytesTest() { + ByteString rowKey = ByteString.copyFromUtf8("testRowKey"); + long len = underTest.countBytes(rowKey); + assertThat(len).isEqualTo(rowKey.size()); + } + + @Test + public void requestBuilderTest() { + BatchingRequestBuilder requestBuilder = + underTest.newRequestBuilder(Query.create(TableId.of("table-Id"))); + requestBuilder.add(ByteString.copyFromUtf8("row-key-1")); + requestBuilder.add(ByteString.copyFromUtf8("row-key-2")); + + Query request = requestBuilder.build(); + + ReadRowsRequest readRowsRequest = + request.toProto(RequestContext.create("project", "instance", "appProfile")); + assertThat(readRowsRequest.getTableName()).contains("table-Id"); + assertThat(readRowsRequest.getRows().getRowKeysList()) + .isEqualTo( + ImmutableList.of( + ByteString.copyFromUtf8("row-key-1"), ByteString.copyFromUtf8("row-key-2"))); + } + + private List> createBatchEntries(String... rowKeys) { + ImmutableList.Builder> builder = ImmutableList.builder(); + + for (String rowKey : rowKeys) { + builder.add( + BatchEntry.create(ByteString.copyFromUtf8(rowKey), SettableApiFuture.create())); + } + return builder.build(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java new file mode 100644 index 000000000000..fa3a2030c0fe --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.cloud.conformance.bigtable.v2.TestDefinition.ReadRowsTest; +import com.google.cloud.conformance.bigtable.v2.TestDefinition.TestFile; +import com.google.common.base.CaseFormat; +import com.google.common.collect.Lists; +import com.google.protobuf.util.JsonFormat; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +/** Parses and runs the acceptance tests for read rows */ +@RunWith(Parameterized.class) +public class ReadRowsMergingAcceptanceTest { + private static final String TEST_DATA_JSON_RESOURCE = + "com/google/cloud/conformance/bigtable/v2/readrows.json"; + + private final ReadRowsTest testCase; + + /** + * @param testData The serialized test data representing the test case. + * @param junitName Not used by the test, but used by the parameterized test runner as the name of + * the test. + */ + public ReadRowsMergingAcceptanceTest( + ReadRowsTest testData, @SuppressWarnings("unused") String junitName) { + this.testCase = testData; + } + + // Each tuple consists of [testData: ReadRowsTest, junitName: String] + @Parameters(name = "{1}") + public static Collection data() throws IOException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + InputStream dataJson = cl.getResourceAsStream(TEST_DATA_JSON_RESOURCE); + assertWithMessage("Unable to load test definition: %s", TEST_DATA_JSON_RESOURCE) + .that(dataJson) + .isNotNull(); + + InputStreamReader reader = new InputStreamReader(dataJson, StandardCharsets.UTF_8); + TestFile.Builder testBuilder = TestFile.newBuilder(); + JsonFormat.parser().merge(reader, testBuilder); + TestFile testDefinition = testBuilder.build(); + + List tests = testDefinition.getReadRowsTestsList(); + ArrayList data = new ArrayList<>(tests.size()); + for (ReadRowsTest test : tests) { + String junitName = + CaseFormat.LOWER_HYPHEN.to( + CaseFormat.LOWER_CAMEL, test.getDescription().replace(" ", "-")); + data.add(new Object[] {test, junitName}); + } + return data; + } + + @Test + public void test() throws Exception { + List responses = Lists.newArrayList(); + + // Convert the chunks into a single ReadRowsResponse + for (CellChunk chunk : testCase.getChunksList()) { + ReadRowsResponse.Builder responseBuilder = ReadRowsResponse.newBuilder(); + responseBuilder.addChunks(chunk); + responses.add(responseBuilder.build()); + } + + // Wrap the responses in a callable + ServerStreamingCallable source = + new ServerStreamingStashCallable<>(responses); + RowMergingCallable mergingCallable = + new RowMergingCallable<>(source, new DefaultRowAdapter()); + + // Invoke the callable to get the merged rows + ServerStream stream = mergingCallable.call(ReadRowsRequest.getDefaultInstance()); + + // Read all of the rows and transform them into logical cells + List actualResults = Lists.newArrayList(); + Exception error = null; + + try { + for (Row row : stream) { + for (RowCell cell : row.getCells()) { + actualResults.add( + ReadRowsTest.Result.newBuilder() + .setRowKeyBytes(row.getKey()) + .setFamilyName(cell.getFamily()) + .setQualifierBytes(cell.getQualifier()) + .setTimestampMicros(cell.getTimestamp()) + .setValueBytes(cell.getValue()) + .setLabel(cell.getLabels().isEmpty() ? "" : cell.getLabels().get(0)) + .build()); + } + } + } catch (Exception e) { + error = e; + } + + // Verify the results + if (expectsError(testCase)) { + assertThat(error).isNotNull(); + } else { + if (error != null) { + throw error; + } + } + + assertThat(getNonExceptionResults(testCase)).isEqualTo(actualResults); + } + + private static boolean expectsError(ReadRowsTest rrt) { + List results = rrt.getResultsList(); + return !results.isEmpty() && results.get(results.size() - 1).getError(); + } + + private static List getNonExceptionResults(ReadRowsTest rrt) { + List results = rrt.getResultsList(); + + List response = new ArrayList<>(); + + for (ReadRowsTest.Result result : results) { + if (!result.getError()) { + response.add(result); + } + } + + return response; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java new file mode 100644 index 000000000000..599d7cae5ee2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java @@ -0,0 +1,836 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.UnavailableException; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.bigtable.v2.RowRange; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Range; +import com.google.common.truth.Truth; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import com.google.rpc.ErrorInfo; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.grpc.testing.GrpcServerRule; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.stream.Collectors; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadRowsRetryTest { + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("fake-table"); + private static final Metadata.Key ERROR_DETAILS_KEY = + Metadata.Key.of("grpc-status-details-bin", Metadata.BINARY_BYTE_MARSHALLER); + + @Rule public GrpcServerRule serverRule = new GrpcServerRule(); + private TestBigtableService service; + private BigtableDataClient client; + + @Before + public void setUp() throws IOException { + service = new TestBigtableService(); + serverRule.getServiceRegistry().addService(service); + + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilder() + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics(); + + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + .build(); + + client = BigtableDataClient.create(settings.build()); + } + + @After + public void tearDown() { + if (client != null) { + client.close(); + } + } + + @Test + public void happyPathTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest("k1") + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWith("k1", "r1", "r2")); + + List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); + assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + } + + @Test + public void immediateRetryTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest("k1") + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create() + .expectRequest("k1") + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWith("k1", "r1", "r2")); + + List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); + assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + } + + public ApiException createLargeRowException(String rowKey) { + ErrorInfo errorInfo = + ErrorInfo.newBuilder() + .setReason("LargeRowReadError") + .setDomain("bigtable.googleapis.com") + .putMetadata( + "rowKeyBase64Encoded", + Base64.getEncoder().encodeToString(rowKey.getBytes(StandardCharsets.UTF_8))) + .build(); + + Any packedErrorInfo = Any.pack(errorInfo); + + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(ImmutableList.of(packedErrorInfo)).build(); + + Metadata trailers = new Metadata(); + byte[] status = + com.google.rpc.Status.newBuilder().addDetails(Any.pack(errorInfo)).build().toByteArray(); + trailers.put(ERROR_DETAILS_KEY, status); + return new UnavailableException( + new StatusRuntimeException(Status.FAILED_PRECONDITION, trailers), + GrpcStatusCode.of(Code.FAILED_PRECONDITION), + false, + errorDetails); + } + + @Test + public void readRowsWithLimitSkippingLargeRowsTest() { + // Large rows is r2 for range r1 to r8 + ApiException largeRowExceptionWithTrailersR2 = createLargeRowException("r2"); + + List actualResults; + + // TEST - range end is large row || row limit + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r3")) + .expectRowLimit(2) + .respondWith("r1") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR2)); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r1", "r3").limit(2)); + assertThat(actualResults).containsExactly("r1").inOrder(); + + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r4", "r7")) + .expectRowLimit(2) + .respondWith("r4", "r5")); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r4", "r7").limit(2)); + assertThat(actualResults).containsExactly("r4", "r5").inOrder(); + } + + @Test + public void readRowsForRowKeyWithLargeRowsTest() { + // Large rows is r2 for range r1 to r8 + ApiException largeRowExceptionWithTrailersR7 = createLargeRowException("r7"); + List actualResults; + + service.expectations.add( + RpcExpectation.create() + .expectRequest("r1", "r7", "r4", "r8") + .respondWith("r1", "r4") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR7)); + service.expectations.add(RpcExpectation.create().expectRequest("r8").respondWith("r8")); + + actualResults = + getSkipLargeRowsResults( + Query.create(TABLE_ID).rowKey("r1").rowKey("r7").rowKey("r4").rowKey("r8")); + assertThat(actualResults).containsExactly("r1", "r4", "r8").inOrder(); + } + + /** + * This tests if in a read rows request RowRange includes large rows, those rows are omitted in + * the response. + */ + @Test + public void readRowRangeWithSkippingLargeRows() { + + // Large rows are r2, r3,r7 from r1 to r8 + ApiException largeRowExceptionWithTrailersR2 = createLargeRowException("r2"); + ApiException largeRowExceptionWithTrailersR3 = createLargeRowException("r3"); + ApiException largeRowExceptionWithTrailersR7 = createLargeRowException("r7"); + + List> rangeList; + List actualResults; + + // TEST - only query for large rows - should receive an empty response + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r2", "r4")) + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR2)); + + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.open("r2", "r4")) + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR3)); + + rangeList = new ArrayList<>(); + rangeList.add(Range.open("r2", "r3")); + rangeList.add(Range.open("r3", "r4")); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges(rangeList) + .respondWithStatus(Code.OK)); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r2", "r4")); + assertThat(actualResults.size()).isEqualTo(0); + + // TEST - range start is large row + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r3", "r5")) + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR3)); + + service.expectations.add( + RpcExpectation.create().expectRequest(Range.open("r3", "r5")).respondWith("r4")); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r3", "r5")); + assertThat(actualResults).containsExactly("r4").inOrder(); + + // TEST - range end is large row + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWith("r1") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR2)); + + rangeList = new ArrayList<>(); + rangeList.add(Range.open("r1", "r2")); + rangeList.add(Range.open("r2", "r3")); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges(rangeList) + .respondWithStatus(Code.OK)); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r1", "r3")); + assertThat(actualResults).containsExactly("r1").inOrder(); + + // r2 faulty + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r9")) + .respondWith("r1") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR2)); + + // r3 faulty + rangeList = new ArrayList<>(); + rangeList.add(Range.open("r1", "r2")); + rangeList.add(Range.open("r2", "r9")); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges(rangeList) + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR3)); + + rangeList = new ArrayList<>(); + rangeList.add(Range.open("r1", "r2")); + rangeList.add(Range.open("r2", "r3")); + rangeList.add(Range.open("r3", "r9")); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges(rangeList) + .respondWith("r4", "r5") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR7)); + + rangeList = new ArrayList<>(); + rangeList.add(Range.open("r5", "r7")); + rangeList.add(Range.open("r7", "r9")); + + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges(rangeList) + .respondWith("r6", "r8")); + + actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).range("r1", "r9")); + assertThat(actualResults).containsExactly("r1", "r4", "r5", "r6", "r8").inOrder(); + + // TEST - reverse query with large rows + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r3", "r7")) + .setReversed(true) + .respondWith("r6", "r5", "r4") + .respondWithException(Code.INTERNAL, largeRowExceptionWithTrailersR3)); + + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.open("r3", "r4")) + .setReversed(true) + .respondWithStatus(Code.OK)); + + actualResults = + getSkipLargeRowsResults(Query.create(TABLE_ID).range("r3", "r7").reversed(true)); + assertThat(actualResults).containsExactly("r6", "r5", "r4").inOrder(); + } + + @Test + public void readRowRangeWithUnboundedRanges() { + ApiException largeRowException = createLargeRowException("r3"); + + // Test case 1: Full table scan (unbounded start and end) + service.expectations.add( + RpcExpectation.create() + .respondWith("r1", "r2") + .respondWithException(Code.INTERNAL, largeRowException)); + + // After the large row error, the query should be split into two ranges + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.open("r2", "r3"), Range.greaterThan("r3"))) + .respondWith("r4") + .respondWithStatus(Code.OK)); + + List actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID)); + assertThat(actualResults).containsExactly("r1", "r2", "r4").inOrder(); + + // Test case 2: Unbounded end + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.atLeast("r2")) + .respondWith("r2") + .respondWithException(Code.INTERNAL, largeRowException)); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.open("r2", "r3"), Range.greaterThan("r3"))) + .respondWith("r4") + .respondWithStatus(Code.OK)); + + actualResults = + getSkipLargeRowsResults( + Query.create(TABLE_ID).range(ByteStringRange.unbounded().startClosed("r2"))); + assertThat(actualResults).containsExactly("r2", "r4").inOrder(); + + // Test case 3: Unbounded start + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.atMost("r4")) + .respondWith("r1", "r2") + .respondWithException(Code.INTERNAL, largeRowException)); + + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.open("r2", "r3"), Range.openClosed("r3", "r4"))) + .respondWith("r4") + .respondWithStatus(Code.OK)); + + actualResults = + getSkipLargeRowsResults( + Query.create(TABLE_ID).range(ByteStringRange.unbounded().endClosed("r4"))); + assertThat(actualResults).containsExactly("r1", "r2", "r4").inOrder(); + } + + @Test + public void readRowRangeWithUnboundedRangesReversed() { + ApiException largeRowException = createLargeRowException("r3"); + + // Test case 1: Full table scan (unbounded start and end) reversed + service.expectations.add( + RpcExpectation.create() + .setReversed(true) + .respondWith("r5", "r4") + .respondWithException(Code.INTERNAL, largeRowException)); + + // After the large row error, the query should be split into two ranges and retried + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.lessThan("r3"), Range.open("r3", "r4"))) + .setReversed(true) + .respondWith("r2", "r1") + .respondWithStatus(Code.OK)); + + List actualResults = getSkipLargeRowsResults(Query.create(TABLE_ID).reversed(true)); + assertThat(actualResults).containsExactly("r5", "r4", "r2", "r1").inOrder(); + + // Test case 2: Unbounded start reversed + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.atLeast("r2")) + .setReversed(true) + .respondWith("r5", "r4") + .respondWithException(Code.INTERNAL, largeRowException)); + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.closedOpen("r2", "r3"), Range.open("r3", "r4"))) + .setReversed(true) + .respondWith("r2") + .respondWithStatus(Code.OK)); + actualResults = + getSkipLargeRowsResults( + Query.create(TABLE_ID) + .range(ByteStringRange.unbounded().startClosed("r2")) + .reversed(true)); + assertThat(actualResults).containsExactly("r5", "r4", "r2").inOrder(); + + // Test case 3: Unbounded end reversed + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.atMost("r4")) + .setReversed(true) + .respondWith("r4") + .respondWithException(Code.INTERNAL, largeRowException)); + + service.expectations.add( + RpcExpectation.create() + .expectRequestForMultipleRowRanges( + ImmutableList.of(Range.lessThan("r3"), Range.open("r3", "r4"))) + .setReversed(true) + .respondWith("r2", "r1") + .respondWithStatus(Code.OK)); + actualResults = + getSkipLargeRowsResults( + Query.create(TABLE_ID) + .range(ByteStringRange.unbounded().endClosed("r4")) + .reversed(true)); + assertThat(actualResults).containsExactly("r4", "r2", "r1").inOrder(); + } + + @Test + public void multipleRetryTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r9")) + .respondWith("r1", "r2", "r3", "r4") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.open("r4", "r9")) + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.open("r4", "r9")) + .respondWith("r5", "r6", "r7") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create().expectRequest(Range.open("r7", "r9")).respondWith("r8")); + + List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r9")); + assertThat(actualResults) + .containsExactly("r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8") + .inOrder(); + } + + @Test + public void rowLimitTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r3")) + .expectRowLimit(2) + .respondWith("r1") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.open("r1", "r3")) + .expectRowLimit(1) + .respondWith("r2")); + + List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2)); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + } + + @Test + public void errorAfterRowLimitMetTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r3")) + .expectRowLimit(2) + .respondWith("r1", "r2") + .respondWithStatus(Code.UNAVAILABLE)); + + // Second retry request is handled locally in ReadRowsRetryCompletedCallable + + List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2)); + + assertThat(actualResults).containsExactly("r1", "r2"); + } + + @Test + public void errorAfterRequestCompleteTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r3")) + .expectRequest("r4") + .respondWith("r2", "r4") + .respondWithStatus(Code.UNAVAILABLE)); + + // Second retry request is handled locally in ReadRowsRetryCompletedCallable + + List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").rowKey("r4")); + + assertThat(actualResults).containsExactly("r2", "r4"); + } + + @Test + public void pointTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest("r1", "r2") + .respondWith("r1") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add(RpcExpectation.create().expectRequest("r2").respondWith("r2")); + + List actualResults = getResults(Query.create(TABLE_ID).rowKey("r1").rowKey("r2")); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + } + + @Test + public void fullTableScanTest() { + service.expectations.add( + RpcExpectation.create().respondWith("r1").respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create().expectRequest(Range.greaterThan("r1")).respondWith("r2")); + List actualResults = getResults(Query.create(TABLE_ID)); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + } + + @Test + public void retryUnboundedStartTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.lessThan("r9")) + .respondWith("r1") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create().expectRequest(Range.open("r1", "r9")).respondWith("r2")); + + List actualResults = + getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().endOpen("r9"))); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + } + + @Test + public void retryUnboundedEndTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.atLeast("r1")) + .respondWith("r1") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create().expectRequest(Range.greaterThan("r1")).respondWith("r2")); + + List actualResults = + getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().startClosed("r1"))); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + } + + @Test + public void retryWithLastScannedKeyTest() { + service.expectations.add( + RpcExpectation.create() + .expectRequest(Range.closedOpen("r1", "r9")) + .respondWithLastScannedKey("r5") + .respondWithStatus(Code.UNAVAILABLE)); + service.expectations.add( + RpcExpectation.create().expectRequest(Range.open("r5", "r9")).respondWith("r7")); + List actualResults = + getResults(Query.create(TABLE_ID).range(ByteStringRange.create("r1", "r9"))); + assertThat(actualResults).containsExactly("r7").inOrder(); + } + + @Test + public void retryRstStreamExceptionTest() { + ApiException exception = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), + GrpcStatusCode.of(Code.INTERNAL), + false); + service.expectations.add( + RpcExpectation.create() + .expectRequest("k1") + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWithException(Code.INTERNAL, exception)); + service.expectations.add( + RpcExpectation.create() + .expectRequest("k1") + .expectRequest(Range.closedOpen("r1", "r3")) + .respondWith("k1", "r1", "r2")); + + List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); + assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + } + + private List getResults(Query query) { + ServerStream actualRows = client.readRows(query); + List actualValues = Lists.newArrayList(); + for (Row row : actualRows) { + actualValues.add(row.getKey().toStringUtf8()); + } + return actualValues; + } + + private List getSkipLargeRowsResults(Query query) { + return client.skipLargeRowsCallable().all().call(query).stream() + .map(row -> row.getKey().toStringUtf8()) + .collect(Collectors.toList()); + } + + private static class TestBigtableService extends BigtableGrpc.BigtableImplBase { + Queue expectations = new LinkedBlockingDeque<>(); + int i = -1; + + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + + RpcExpectation expectedRpc = expectations.poll(); + assertThat(expectedRpc).isNotNull(); + i++; + + Truth.assertWithMessage("Unexpected request#" + i + ":" + request.toString()) + .that(expectedRpc) + .isNotNull(); + Truth.assertWithMessage("Unexpected request#" + i) + .that(request) + .isEqualTo(expectedRpc.getExpectedRequest()); + + for (ReadRowsResponse response : expectedRpc.responses) { + responseObserver.onNext(response); + } + if (expectedRpc.statusCode.toStatus().isOk()) { + responseObserver.onCompleted(); + } else if (expectedRpc.exception != null) { + responseObserver.onError(expectedRpc.exception); + } else { + responseObserver.onError(expectedRpc.statusCode.toStatus().asRuntimeException()); + } + } + } + + private static class RpcExpectation { + ReadRowsRequest.Builder requestBuilder; + Status.Code statusCode; + ApiException exception; + List responses; + + private RpcExpectation setReversed(boolean reverse) { + this.requestBuilder.setReversed(reverse); + return this; + } + + private RpcExpectation() { + this.requestBuilder = + ReadRowsRequest.newBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)); + this.statusCode = Status.Code.OK; + this.responses = Lists.newArrayList(); + } + + static RpcExpectation create() { + return new RpcExpectation(); + } + + RpcExpectation expectRequest(String... keys) { + for (String key : keys) { + requestBuilder.getRowsBuilder().addRowKeys(ByteString.copyFromUtf8(key)); + } + return this; + } + + RpcExpectation expectRequestForMultipleRowRanges(List> rowRanges) { + for (Range range : rowRanges) { + rowRangeBuilder(range); + } + return this; + } + + /** Build Row Range */ + RowRange rowRangeBuilder(Range range) { + + RowRange.Builder rowRange = requestBuilder.getRowsBuilder().addRowRangesBuilder(); + + if (range.hasLowerBound()) { + switch (range.lowerBoundType()) { + case CLOSED: + rowRange.setStartKeyClosed(ByteString.copyFromUtf8(range.lowerEndpoint())); + break; + case OPEN: + rowRange.setStartKeyOpen(ByteString.copyFromUtf8(range.lowerEndpoint())); + break; + default: + throw new IllegalArgumentException( + "Unexpected lowerBoundType: " + range.lowerBoundType()); + } + } else { + rowRange.clearStartKey(); + } + + if (range.hasUpperBound()) { + switch (range.upperBoundType()) { + case CLOSED: + rowRange.setEndKeyClosed(ByteString.copyFromUtf8(range.upperEndpoint())); + break; + case OPEN: + rowRange.setEndKeyOpen(ByteString.copyFromUtf8(range.upperEndpoint())); + break; + default: + throw new IllegalArgumentException( + "Unexpected upperBoundType: " + range.upperBoundType()); + } + } else { + rowRange.clearEndKey(); + } + return rowRange.build(); + } + + RpcExpectation expectRequest(Range range) { + RowRange.Builder rowRange = requestBuilder.getRowsBuilder().addRowRangesBuilder(); + + if (range.hasLowerBound()) { + switch (range.lowerBoundType()) { + case CLOSED: + rowRange.setStartKeyClosed(ByteString.copyFromUtf8(range.lowerEndpoint())); + break; + case OPEN: + rowRange.setStartKeyOpen(ByteString.copyFromUtf8(range.lowerEndpoint())); + break; + default: + throw new IllegalArgumentException( + "Unexpected lowerBoundType: " + range.lowerBoundType()); + } + } else { + rowRange.clearStartKey(); + } + + if (range.hasUpperBound()) { + switch (range.upperBoundType()) { + case CLOSED: + rowRange.setEndKeyClosed(ByteString.copyFromUtf8(range.upperEndpoint())); + break; + case OPEN: + rowRange.setEndKeyOpen(ByteString.copyFromUtf8(range.upperEndpoint())); + break; + default: + throw new IllegalArgumentException( + "Unexpected upperBoundType: " + range.upperBoundType()); + } + } else { + rowRange.clearEndKey(); + } + + return this; + } + + RpcExpectation expectRowLimit(int limit) { + requestBuilder.setRowsLimit(limit); + return this; + } + + RpcExpectation respondWithStatus(Status.Code code) { + this.statusCode = code; + return this; + } + + RpcExpectation respondWithException(Status.Code code, ApiException exception) { + this.statusCode = code; + this.exception = exception; + return this; + } + + RpcExpectation respondWith(String... responses) { + for (String response : responses) { + this.responses.add( + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8(response)) + .setFamilyName(StringValue.newBuilder().setValue("family").build()) + .setQualifier(BytesValue.newBuilder().setValue(ByteString.EMPTY).build()) + .setTimestampMicros(10_000) + .setValue(ByteString.copyFromUtf8("value")) + .setCommitRow(true)) + .build()); + } + return this; + } + + RpcExpectation respondWithLastScannedKey(String key) { + this.responses.add( + ReadRowsResponse.newBuilder().setLastScannedRowKey(ByteString.copyFromUtf8(key)).build()); + return this; + } + + ReadRowsRequest getExpectedRequest() { + return requestBuilder.build(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java new file mode 100644 index 000000000000..3e1a652050fc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +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.TableId; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.common.truth.Truth; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ReadRowsUserCallableTest { + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create("fake-project", "fake-instance", "fake-profile"); + + @Test + public void testRequestConverted() { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(); + ReadRowsUserCallable callable = new ReadRowsUserCallable<>(innerCallable, REQUEST_CONTEXT); + Query query = Query.create(TableId.of("fake-table")); + + callable.call(query); + + Truth.assertThat(innerCallable.getActualRequest()).isEqualTo(query.toProto(REQUEST_CONTEXT)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java new file mode 100644 index 000000000000..5e9ce44aeb08 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java @@ -0,0 +1,118 @@ +/* + * Copyright 2018 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.cloud.bigtable.data.v2.stub.readrows; + +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.ReadRowsResponse.CellChunk; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.common.collect.Lists; +import com.google.common.truth.Truth; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import java.util.List; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * Additional tests in addition to {@link + * com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsMergingAcceptanceTest}. At some point + * they should be reintegrated into the json file. + */ +@RunWith(JUnit4.class) +public class RowMergingCallableTest { + @Test + public void scanMarker() { + ReadRowsResponse.Builder rrr = ReadRowsResponse.newBuilder(); + rrr.addChunksBuilder() + .setRowKey(ByteString.copyFromUtf8("key0")) + .setFamilyName(StringValue.of("f1")) + .setQualifier(BytesValue.of(ByteString.copyFromUtf8("q1"))) + .setCommitRow(true); + + FakeStreamingApi.ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList( + // send a row + rrr.build(), + // send a scan marker + ReadRowsResponse.newBuilder() + .setLastScannedRowKey(ByteString.copyFromUtf8("key1")) + .build())); + + RowMergingCallable rowMergingCallable = + new RowMergingCallable<>(inner, new DefaultRowAdapter()); + List results = rowMergingCallable.all().call(ReadRowsRequest.getDefaultInstance()); + + Truth.assertThat(results) + .containsExactly( + Row.create( + ByteString.copyFromUtf8("key0"), + Lists.newArrayList( + RowCell.create( + "f1", + ByteString.copyFromUtf8("q1"), + 0, + Lists.newArrayList(), + ByteString.EMPTY))), + Row.create(ByteString.copyFromUtf8("key1"), Lists.newArrayList())); + } + + @Test + public void invalidMarkerInCell() { + FakeStreamingApi.ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList( + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key1")) + .setFamilyName(StringValue.newBuilder().setValue("family")) + .setQualifier(BytesValue.newBuilder().setValue(ByteString.EMPTY)) + .setTimestampMicros(1_000) + .setValue(ByteString.copyFromUtf8("a")) + .setValueSize(2)) + .build(), + // send a scan marker + ReadRowsResponse.newBuilder() + .setLastScannedRowKey(ByteString.copyFromUtf8("key1")) + .build(), + // finish the cell & row + ReadRowsResponse.newBuilder() + .addChunks( + CellChunk.newBuilder() + .setValue(ByteString.copyFromUtf8("b")) + .setValueSize(0) + .setCommitRow(true)) + .build())); + RowMergingCallable rowMergingCallable = + new RowMergingCallable<>(inner, new DefaultRowAdapter()); + + Throwable actualError = null; + try { + rowMergingCallable.all().call(ReadRowsRequest.getDefaultInstance()); + } catch (Throwable t) { + actualError = t; + } + Truth.assertThat(actualError).isInstanceOf(IllegalStateException.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java new file mode 100644 index 000000000000..4fe2762146f4 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +package com.google.cloud.bigtable.data.v2.stub.readrows; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.protobuf.ByteString; +import com.google.protobuf.BytesValue; +import com.google.protobuf.StringValue; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class StateMachineTest { + StateMachine stateMachine; + + @Before + public void setUp() throws Exception { + stateMachine = new StateMachine<>(new DefaultRowAdapter().createRowBuilder(), false); + } + + @Test + public void testErrorHandlingStats() { + StateMachine.InvalidInputException actualError = null; + + ReadRowsResponse.CellChunk chunk = + ReadRowsResponse.CellChunk.newBuilder() + .setRowKey(ByteString.copyFromUtf8("my-key1")) + .setFamilyName(StringValue.newBuilder().setValue("my-family")) + .setQualifier(BytesValue.newBuilder().setValue(ByteString.copyFromUtf8("q"))) + .setTimestampMicros(1_000) + .setValue(ByteString.copyFromUtf8("my-value")) + .setCommitRow(true) + .build(); + try { + stateMachine.handleChunk(chunk); + stateMachine.consumeRow(); + + stateMachine.handleChunk( + chunk.toBuilder().setRowKey(ByteString.copyFromUtf8("my-key2")).build()); + stateMachine.consumeRow(); + + stateMachine.handleChunk( + chunk.toBuilder() + .setRowKey(ByteString.copyFromUtf8("my-key3")) + .setValueSize(123) // invalid value size + .build()); + } catch (StateMachine.InvalidInputException e) { + actualError = e; + } + + assertThat(actualError).hasMessageThat().containsMatch("last5Keys: .*my-key1.*my-key2"); + assertThat(actualError).hasMessageThat().contains("numScannedNotifications: 0"); + assertThat(actualError).hasMessageThat().contains("numChunksProcessed: 3"); + assertThat(actualError).hasMessageThat().contains("numCellsInRow: 0"); + assertThat(actualError).hasMessageThat().contains("numCellsInLastRow: 1"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContextTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContextTest.java new file mode 100644 index 000000000000..14cfd25f6629 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContextTest.java @@ -0,0 +1,186 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.ApiFutures; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatementRefreshTimeoutException; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.FakePreparedStatement; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import io.grpc.Deadline; +import io.grpc.Status.Code; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ExecuteQueryCallContextTest { + private static final ByteString PREPARED_QUERY = ByteString.copyFromUtf8("test"); + private static final com.google.bigtable.v2.ResultSetMetadata METADATA = + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", bytesType())); + private static final Map> PARAM_TYPES = + ImmutableMap.of("foo", SqlType.string()); + private static final PreparedStatement PREPARED_STATEMENT = + preparedStatement( + PrepareResponse.fromProto(prepareResponse(PREPARED_QUERY, METADATA)), PARAM_TYPES); + + @Test + public void testToRequest() { + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext( + PREPARED_STATEMENT.bind().setStringParam("foo", "val").build(), + SettableApiFuture.create()); + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + ExecuteQueryRequest request = + callContext.buildRequestWithDeadline(requestContext, Deadline.after(1, TimeUnit.MINUTES)); + + assertThat(request.getPreparedQuery()).isEqualTo(PREPARED_QUERY); + assertThat(request.getAppProfileId()).isEqualTo("profile"); + assertThat(request.getInstanceName()) + .isEqualTo(NameUtil.formatInstanceName("project", "instance")); + assertThat(request.getParamsMap().get("foo").getStringValue()).isEqualTo("val"); + assertThat(request.getParamsMap().get("foo").getType()).isEqualTo(stringType()); + } + + @Test + public void testFirstResponseReceived() throws ExecutionException, InterruptedException { + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext( + PREPARED_STATEMENT.bind().setStringParam("foo", "val").build(), mdFuture); + + callContext.finalizeMetadata(); + assertThat(mdFuture.isDone()).isTrue(); + assertThat(mdFuture.get()).isEqualTo(ProtoResultSetMetadata.fromProto(METADATA)); + } + + @Test + public void testSetMetadataException() { + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext( + PREPARED_STATEMENT.bind().setStringParam("foo", "val").build(), mdFuture); + + callContext.setMetadataException(new RuntimeException("test")); + assertThat(mdFuture.isDone()).isTrue(); + ExecutionException e = assertThrows(ExecutionException.class, mdFuture::get); + assertThat(e.getCause()).isInstanceOf(RuntimeException.class); + } + + @Test + public void testBuildRequestAttemptDeadline() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + SettableApiFuture mdFuture = SettableApiFuture.create(); + PreparedQueryData initialPlan = PreparedQueryData.create(SettableApiFuture.create()); + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create( + new FakePreparedStatement() + // Reuse the same plan since we wont call refresh + .withUpdatedPlans(initialPlan, initialPlan) + .bind() + .build(), + mdFuture); + + assertThrows( + PreparedStatementRefreshTimeoutException.class, + () -> + callContext.buildRequestWithDeadline( + requestContext, Deadline.after(2, TimeUnit.MILLISECONDS))); + } + + @Test + public void testHardRefreshUpdatesPreparedQuery() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext(new FakePreparedStatement().bind().build(), mdFuture); + + callContext.triggerImmediateRefreshOfPreparedQuery(); + ExecuteQueryRequest updatedRequest = + callContext.buildRequestWithDeadline( + requestContext, Deadline.after(10, TimeUnit.MILLISECONDS)); + assertThat(updatedRequest.getPreparedQuery()) + .isEqualTo(ByteString.copyFromUtf8("refreshedPlan")); + } + + @Test + public void testResumeToken() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext(new FakePreparedStatement().bind().build(), mdFuture); + callContext.setLatestResumeToken(ByteString.copyFromUtf8("token")); + + assertThat(callContext.hasResumeToken()).isTrue(); + assertThat( + callContext + .buildRequestWithDeadline( + requestContext, Deadline.after(100, TimeUnit.MILLISECONDS)) + .getResumeToken()) + .isEqualTo(ByteString.copyFromUtf8("token")); + } + + @Test + public void testPrepareExceptionIsRetryable() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext( + new FakePreparedStatement() + .withUpdatedPlans( + PreparedQueryData.create( + ApiFutures.immediateFailedFuture( + new DeadlineExceededException( + null, GrpcStatusCode.of(Code.DEADLINE_EXCEEDED), false))), + null) + .bind() + .build(), + mdFuture); + + ApiException e = + assertThrows( + ApiException.class, + () -> + callContext.buildRequestWithDeadline( + requestContext, Deadline.after(10, TimeUnit.MILLISECONDS))); + assertThat(e.isRetryable()).isTrue(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java new file mode 100644 index 000000000000..0d51e2d8f000 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java @@ -0,0 +1,189 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Server; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.time.Duration; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ExecuteQueryCallableTest { + + private static final class FakePreparedStatement extends PreparedStatementImpl { + + public FakePreparedStatement() { + super( + PrepareResponse.fromProto(prepareResponse(metadata(columnMetadata("foo", stringType())))), + new HashMap<>(), + null, + null); + } + + @Override + public synchronized PreparedQueryData markExpiredAndStartRefresh( + PreparedQueryVersion expiredPreparedQueryVersion) { + return getLatestPrepareResponse(); + } + + @Override + public void assertUsingSameStub(EnhancedBigtableStub stub) {} + } + + private static final PreparedStatement PREPARED_STATEMENT = new FakePreparedStatement(); + + private Server server; + private FakeService fakeService = new FakeService(); + private EnhancedBigtableStub stub; + + @Before + public void setup() throws IOException { + server = FakeServiceBuilder.create(fakeService).start(); + + BigtableDataSettings settings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build(); + + stub = EnhancedBigtableStub.create(settings.getStubSettings()); + } + + @After + public void tearDown() { + stub.close(); + server.shutdown(); + } + + @Test + public void testCallContextAndServerStreamSetup() { + SqlRow row = + ProtoSqlRow.create( + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("test", stringType()))), + Collections.singletonList(stringValue("foo"))); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Collections.singletonList(row)); + ExecuteQueryCallable callable = new ExecuteQueryCallable(innerCallable); + SqlServerStream stream = callable.call(PREPARED_STATEMENT.bind().build()); + + assertThat(stream.metadataFuture()) + .isEqualTo(innerCallable.getActualRequest().resultSetMetadataFuture()); + Iterator responseIterator = stream.rows().iterator(); + assertThat(responseIterator.next()).isEqualTo(row); + assertThat(responseIterator.hasNext()).isFalse(); + } + + @Test + public void testExecuteQueryRequestsSetDefaultDeadline() { + SqlServerStream stream = stub.executeQueryCallable().call(PREPARED_STATEMENT.bind().build()); + // We don't care about this, just assert we get a response + boolean rowReceived = false; + for (@SuppressWarnings("UnusedVariable") SqlRow ignored : stream.rows()) { + rowReceived = true; + } + assertThat(rowReceived).isTrue(); + // We have 30m default, we give it a wide range to avoid flakiness, this is mostly just + // checking that some default is set + assertThat(fakeService.deadlineMillisRemaining).isLessThan(1800000L); + } + + @Test + public void testExecuteQueryRequestsRespectDeadline() throws IOException { + BigtableDataSettings.Builder overrideSettings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance"); + overrideSettings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(10)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10)) + .build()); + + try (EnhancedBigtableStub overrideDeadline = + EnhancedBigtableStub.create(overrideSettings.build().getStubSettings())) { + SqlServerStream streamOverride = + overrideDeadline.executeQueryCallable().call(PREPARED_STATEMENT.bind().build()); + Iterator overrideIterator = streamOverride.rows().iterator(); + // We don't care about this but are reusing the fake service that tests retries + assertThrows(DeadlineExceededException.class, overrideIterator::next); + } + } + + private static class FakeService extends BigtableGrpc.BigtableImplBase { + + private long deadlineMillisRemaining; + + @Override + public void executeQuery( + ExecuteQueryRequest request, StreamObserver responseObserver) { + Deadline deadline = Context.current().getDeadline(); + if (deadline != null) { + deadlineMillisRemaining = deadline.timeRemaining(TimeUnit.MILLISECONDS); + } else { + // set to max long when deadline isn't set + deadlineMillisRemaining = Long.MAX_VALUE; + } + // Sleep for 100ms to trigger deadline exceeded for tests with a shorter deadline + try { + Thread.sleep(100); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + responseObserver.onNext(partialResultSetWithoutToken(stringValue("foo"))); + responseObserver.onNext(partialResultSetWithToken(stringValue("bar"))); + responseObserver.onCompleted(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategyTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategyTest.java new file mode 100644 index 000000000000..d42529209fc3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategyTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.protobuf.ByteString; +import io.grpc.Deadline; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ExecuteQueryResumptionStrategyTest { + + @Test + public void tracksResumeToken() throws ExecutionException, InterruptedException { + ExecuteQueryResumptionStrategy resumptionStrategy = new ExecuteQueryResumptionStrategy(); + + PreparedStatement preparedStatement = + preparedStatement(metadata(columnMetadata("s", stringType()))); + SettableApiFuture mdFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + SqlProtoFactory.callContext(preparedStatement.bind().build(), mdFuture); + + resumptionStrategy.processResponse( + partialResultSetWithToken(ByteString.copyFromUtf8("token"), stringValue("s"))); + // This should not change the token + resumptionStrategy.processResponse(partialResultSetWithoutToken(stringValue("bar"))); + + ExecuteQueryCallContext updatedCallContext = resumptionStrategy.getResumeRequest(callContext); + assertThat( + updatedCallContext.buildRequestWithDeadline( + RequestContext.create("project", "instance", "profile"), + Deadline.after(1, TimeUnit.MINUTES))) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setInstanceName(NameUtil.formatInstanceName("project", "instance")) + .setAppProfileId("profile") + .setPreparedQuery(ByteString.copyFromUtf8("foo")) + .setResumeToken(ByteString.copyFromUtf8("token")) + .build()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java new file mode 100644 index 000000000000..d6c41397b156 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java @@ -0,0 +1,897 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSets; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.planRefreshError; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.tokenOnlyResultSet; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.InternalException; +import com.google.api.gax.rpc.StatusCode; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.ResultSetMetadata; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatementRefreshTimeoutException; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.ExecuteRpcExpectation; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.PrepareRpcExpectation; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.TestBigtableSqlService; +import com.google.cloud.bigtable.gaxx.reframing.IncompleteStreamException; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.testing.GrpcServerRule; +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.time.Duration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ExecuteQueryRetryTest { + private static final ByteString PREPARED_QUERY = ByteString.copyFromUtf8("foo"); + private static final ResultSetMetadata DEFAULT_METADATA = + metadata(columnMetadata("strCol", stringType())); + + @Rule public GrpcServerRule serverRule = new GrpcServerRule(); + private TestBigtableSqlService service; + private BigtableDataClient client; + private PreparedStatement preparedStatement; + + public static BigtableDataSettings.Builder defaultSettings(GrpcServerRule serverRule) { + BigtableDataSettings.Builder settings = + BigtableDataSettings.newBuilder() + .setProjectId(TestBigtableSqlService.DEFAULT_PROJECT_ID) + .setInstanceId(TestBigtableSqlService.DEFAULT_INSTANCE_ID) + .setAppProfileId(TestBigtableSqlService.DEFAULT_APP_PROFILE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()); + + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + .build(); + // Remove log noise from client side metrics + settings.setMetricsProvider(NoopMetricsProvider.INSTANCE).disableInternalMetrics(); + return settings; + } + + @Before + public void setUp() throws IOException { + service = new TestBigtableSqlService(); + serverRule.getServiceRegistry().addService(service); + client = BigtableDataClient.create(defaultSettings(serverRule).build()); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith(prepareResponse(PREPARED_QUERY, DEFAULT_METADATA))); + preparedStatement = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + // Reset the count of RPCs + service.prepareCount--; + } + + @After + public void tearDown() { + if (client != null) { + client.close(); + } + } + + @Test + public void testAllSuccesses() { + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith( + partialResultSetWithoutToken(stringValue("foo")), + partialResultSetWithoutToken(stringValue("bar")), + partialResultSetWithToken(stringValue("baz")))); + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.getMetadata().getColumns()).hasSize(1); + assertThat(rs.getMetadata().getColumns().get(0).name()).isEqualTo("strCol"); + assertThat(rs.getMetadata().getColumns().get(0).type()).isEqualTo(SqlType.string()); + + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("bar"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("baz"); + assertThat(rs.next()).isFalse(); + rs.close(); + } + + @Test + public void testRetryOnInitialError() { + // - First attempt immediately fails + // - Second attempt returns 'foo', w a token, and succeeds + // Expect result to be 'foo' + service.addExpectation(ExecuteRpcExpectation.create().respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create().respondWith(partialResultSetWithToken(stringValue("foo")))); + + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isFalse(); + rs.close(); + assertThat(service.executeCount).isEqualTo(2); + } + + @Test + public void testResumptionToken() { + // - First attempt gets a response with a token, and then fails with unavailable + // - Second Expects the request to contain the previous token, and returns a new response w + // token and then fails with unavailable + // - Third expects the request to contain the second token, returns a new response w token + // and then succeeds + // We expect the results to contain all of the returned data (no reset batches) + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("token1"), stringValue("foo"))) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withResumeToken(ByteString.copyFromUtf8("token1")) + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("token2"), stringValue("bar"))) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withResumeToken(ByteString.copyFromUtf8("token2")) + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("final"), stringValue("baz")))); + + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("bar"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("baz"); + assertThat(rs.next()).isFalse(); + rs.close(); + assertThat(service.executeCount).isEqualTo(3); + } + + @Test + public void testResetOnResumption() { + // - First attempt returns 'foo' with 'token1', then 'discard' w no token, then fails + // - Second attempt should resume w 'token1', returns an incomplete batch of two chunks. First + // chunk contains the reset bit and a some data, second contains some data, we fail w/o + // returning the final chunk w a token. + // - Third attempt should resume w 'token1', we return 'baz' w reset & a token, succeed + // Expect the results to be 'foo' and 'baz' + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("token1"), stringValue("foo")), + // This is after the token so should be dropped + partialResultSetWithoutToken(stringValue("discard"))) + .respondWithStatus(Code.UNAVAILABLE)); + List chunkedResponses = + partialResultSets( + 3, + true, + ByteString.copyFromUtf8("token2"), + stringValue("longerStringDiscard"), + stringValue("discard")); + service.addExpectation( + ExecuteRpcExpectation.create() + .withResumeToken(ByteString.copyFromUtf8("token1")) + // Skip the last response, so we don't send a new token + .respondWith(chunkedResponses.get(0), chunkedResponses.get(1)) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withResumeToken(ByteString.copyFromUtf8("token1")) + .respondWith( + partialResultSets(1, true, ByteString.copyFromUtf8("final"), stringValue("baz")) + .get(0))); + + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("baz"); + assertThat(rs.next()).isFalse(); + rs.close(); + assertThat(service.executeCount).isEqualTo(3); + } + + @Test + public void testErrorAfterFinalData() { + // - First attempt returns 'foo', 'bar', 'baz' w 'finalToken' but fails w unavailable + // - Second attempt uses 'finalToken' and succeeds + // Expect results to be 'foo', 'bar', 'baz' + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith( + partialResultSetWithoutToken(stringValue("foo")), + partialResultSetWithoutToken(stringValue("bar")), + partialResultSetWithToken( + ByteString.copyFromUtf8("finalToken"), stringValue("baz"))) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create().withResumeToken(ByteString.copyFromUtf8("finalToken"))); + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.getMetadata().getColumns()).hasSize(1); + assertThat(rs.getMetadata().getColumns().get(0).name()).isEqualTo("strCol"); + assertThat(rs.getMetadata().getColumns().get(0).type()).isEqualTo(SqlType.string()); + + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("bar"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("baz"); + assertThat(rs.next()).isFalse(); + rs.close(); + } + + @Test + public void permanentErrorPropagatesToMetadata() { + service.addExpectation(ExecuteRpcExpectation.create().respondWithStatus(Code.INVALID_ARGUMENT)); + + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + ApiException e = assertThrows(ApiException.class, rs::getMetadata); + assertThat(e.getStatusCode().getCode()).isEqualTo(StatusCode.Code.INVALID_ARGUMENT); + } + + @Test + public void exhaustedRetriesPropagatesToMetadata() throws IOException { + int attempts = + EnhancedBigtableStubSettings.newBuilder() + .executeQuerySettings() + .getRetrySettings() + .getMaxAttempts(); + assertThat(attempts).isGreaterThan(1); + for (int i = 0; i < attempts; i++) { + service.addExpectation(ExecuteRpcExpectation.create().respondWithStatus(Code.UNAVAILABLE)); + } + + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + ApiException e = assertThrows(ApiException.class, rs::getMetadata); + assertThat(e.getStatusCode().getCode()).isEqualTo(StatusCode.Code.UNAVAILABLE); + } + + @Test + public void retryableErrorWithSuccessfulRetryDoesNotPropagateToMetadata() { + service.addExpectation(ExecuteRpcExpectation.create().respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation(ExecuteRpcExpectation.create().respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith(tokenOnlyResultSet(ByteString.copyFromUtf8("t")))); + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThat(rs.getMetadata().getColumns()).hasSize(1); + } + + @Test + public void preservesParamsOnRetry() { + Map> paramTypes = ImmutableMap.of("strParam", SqlType.string()); + PreparedStatement preparedStatementWithParams = + SqlProtoFactory.preparedStatement( + metadata(columnMetadata("strCol", stringType())), paramTypes); + Map params = + ImmutableMap.of("strParam", stringValue("foo").toBuilder().setType(stringType()).build()); + service.addExpectation( + ExecuteRpcExpectation.create() + .withParams(params) + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("token1"), stringValue("foo"))) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withParams(params) + .withResumeToken(ByteString.copyFromUtf8("token1")) + .respondWith( + partialResultSetWithToken(ByteString.copyFromUtf8("token2"), stringValue("bar")))); + + ResultSet rs = + client.executeQuery( + preparedStatementWithParams.bind().setStringParam("strParam", "foo").build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("bar"); + assertThat(rs.next()).isFalse(); + } + + @Test + public void failsOnCompleteWithOpenPartialBatch() { + // Return 'foo' with no token, followed by ok + // This should throw an error, as the backend has violated its contract + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWith(partialResultSetWithoutToken(stringValue("foo"))) + .respondWithStatus(Code.OK)); + ResultSet rs = client.executeQuery(preparedStatement.bind().build()); + assertThrows(IncompleteStreamException.class, rs::next); + } + + @Test + public void retryOnExpiredPlan() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("bytesCol", bytesType()))))); + // change the schema on refresh (this can happen for SELECT * queries for example) + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("baz"), + metadata(columnMetadata("strCol", stringType()))))); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("baz")) + .respondWith(partialResultSetWithToken(stringValue("foo")))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void planRefreshAfterInitialPartialBatch() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("bytesCol", bytesType()))))); + // change the schema on refresh (this can happen for SELECT * queries for example) + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("baz"), + metadata(columnMetadata("strCol", stringType()))))); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWith(partialResultSetWithoutToken(bytesValue("b"))) + .respondWithStatus(Code.UNAVAILABLE)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + // This creates one response w reset=true and a token + List singleResponseBatch = partialResultSets(1, stringValue("foo")); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("baz")) + .respondWith(singleResponseBatch.get(0))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("foo"); + assertThat(rs.next()).isFalse(); + assertThat(rs.getMetadata().getColumnType("strCol")).isEqualTo(SqlType.string()); + assertThat(service.executeCount).isEqualTo(3); + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void planRefreshErrorAfterFirstTokenCausesError() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("bytesCol", bytesType()))))); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWith(partialResultSetWithToken(bytesValue("b"))) + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + // We received a token so the client yields the data + assertThat(rs.getBytes("bytesCol").toStringUtf8()).isEqualTo("b"); + IllegalStateException e = assertThrows(IllegalStateException.class, rs::next); + assertThat(e.getCause()).isInstanceOf(FailedPreconditionException.class); + } + + @Test + public void preparedStatementCanBeGarbageCollected() throws InterruptedException { + // Check for memory leaks since the PreparedStatement handles background refresh + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + service.addExpectation( + ExecuteRpcExpectation.create().respondWith(partialResultSetWithToken(stringValue("s")))); + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + WeakReference prepareWeakRef = new WeakReference<>(ps); + ResultSet rs = client.executeQuery(ps.bind().build()); + WeakReference resultSetWeakRef = new WeakReference<>(rs); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + rs.close(); + // Note that the result set holds a reference to the ResultSetMetadata that lives in + // the PreparedStatement. So prepare won't be gc'd until the ResultSet is null. + rs = null; + ps = null; + for (int i = 0; i < 5; i++) { + // This isn't guaranteed to run GC, so call it a few times. Testing has shown that this + // is enough to prevent any flakes in 1000 runs + System.gc(); + Thread.sleep(10); + } + assertThat(resultSetWeakRef.get()).isNull(); + assertThat(prepareWeakRef.get()).isNull(); + } + + @Test + public void planRefreshRespectsExecuteTotalTimeout() throws IOException { + BigtableDataSettings.Builder settings = defaultSettings(serverRule); + settings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setMaxAttempts(10) + .setTotalTimeoutDuration(Duration.ofMillis(30)) + .build()) + .build(); + settings.stubSettings().build(); + BigtableDataClient clientWithTimeout = BigtableDataClient.create(settings.build()); + + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + service.addExpectation( + PrepareRpcExpectation.create() + .withDelay(Duration.ofSeconds(2)) + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + + PreparedStatement ps = + clientWithTimeout.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = clientWithTimeout.executeQuery(ps.bind().build()); + assertThrows(PreparedStatementRefreshTimeoutException.class, rs::next); + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void planRefreshRespectsAttemptTimeout() throws IOException { + BigtableDataSettings.Builder settings = defaultSettings(serverRule); + settings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + // First attempt triggers plan refresh retry. + // Second should time out + .setMaxAttempts(2) + .setInitialRpcTimeoutDuration(Duration.ofMillis(500)) + .setMaxRpcTimeoutDuration(Duration.ofMinutes(500)) + .setTotalTimeoutDuration(Duration.ZERO) + .build()) + .build(); + settings.stubSettings().build(); + BigtableDataClient clientWithTimeout = BigtableDataClient.create(settings.build()); + + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + // called after failed precondition + service.addExpectation( + PrepareRpcExpectation.create() + .withDelay(Duration.ofSeconds(2)) + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + + PreparedStatement ps = + clientWithTimeout.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = clientWithTimeout.executeQuery(ps.bind().build()); + assertThrows(PreparedStatementRefreshTimeoutException.class, rs::next); + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void executeRetriesPlanRefreshErrors() throws IOException { + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWithStatus(Code.UNAVAILABLE)); + // called after unavailable + service.addExpectation( + PrepareRpcExpectation.create() + .withDelay(Duration.ofSeconds(2)) + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(3); + } + + @Test + public void prepareFailuresBurnExecuteAttempts() throws IOException { + BigtableDataSettings.Builder settings = defaultSettings(serverRule); + settings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + .setMaxAttempts(4) + .setInitialRpcTimeoutDuration(Duration.ofMinutes(10)) + .setMaxRpcTimeoutDuration(Duration.ofMinutes(10)) + .setTotalTimeoutDuration(Duration.ofMinutes(50)) + .build()) + .build(); + settings.stubSettings().build(); + BigtableDataClient clientWithTimeout = BigtableDataClient.create(settings.build()); + + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Attempt 1 - Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + // Attempt 2 + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWithStatus(Code.INTERNAL)); + // Attempt 3 + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWithStatus(Code.INTERNAL)); + // Attempt 4 + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWithStatus(Code.INTERNAL)); + // This is triggered by the failure in attempt 4. It succeeds + // but isn't used bc execute stops retrying + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + + PreparedStatement ps = + clientWithTimeout.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = clientWithTimeout.executeQuery(ps.bind().build()); + assertThrows(ApiException.class, rs::next); + // initial success plus 3 refresh failures, plus (maybe) refresh triggered by the final failure + assertThat(service.prepareCount).isGreaterThan(3); + } + + @Test + public void canRetryAfterRefreshAttemptTimeout() throws IOException { + BigtableDataSettings.Builder settings = defaultSettings(serverRule); + settings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + // First attempt triggers plan refresh retry. + // Second should time out, third should succeed + .setMaxAttempts(3) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(1)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(1)) + .setTotalTimeoutDuration(Duration.ofSeconds(5)) + .build()) + .build(); + settings.stubSettings().build(); + BigtableDataClient clientWithTimeout = BigtableDataClient.create(settings.build()); + + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Attempt 1 - Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + // Attempt 2 + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + // first refresh attempt times out, but then it succeeds + .withDelay(Duration.ofMillis(1500)) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = + clientWithTimeout.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = clientWithTimeout.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(2); + } + + @Test + public void prepareRefreshTimeIsFactoredIntoExecuteAttemptTimeout() throws IOException { + BigtableDataSettings.Builder settings = defaultSettings(serverRule); + settings + .stubSettings() + .executeQuerySettings() + .setRetrySettings( + RetrySettings.newBuilder() + // First attempt triggers plan refresh retry. + // Second should time out, third should succeed + .setMaxAttempts(2) + .setInitialRpcTimeoutDuration(Duration.ofMillis(500)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(500)) + .setTotalTimeoutDuration(Duration.ofMinutes(500)) + .build()) + .build(); + settings.stubSettings().build(); + BigtableDataClient clientWithTimeout = BigtableDataClient.create(settings.build()); + // Initially return a prepare response without delay + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + // Attempt 1 - Trigger plan refresh + service.addExpectation( + ExecuteRpcExpectation.create() + .respondWithException(Code.FAILED_PRECONDITION, planRefreshError())); + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + // Burn most of the execute attempt timeout and succeed + .withDelay(Duration.ofMillis(350)) + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("bar"), + metadata(columnMetadata("strCol", stringType()))))); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("bar")) + // Should timeout bc we used 350 ms on prepare refresh and have 500ms timeout + .withDelay(Duration.ofMillis(350)) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = + clientWithTimeout.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = clientWithTimeout.executeQuery(ps.bind().build()); + ApiException e = assertThrows(ApiException.class, rs::next); + assertThat(e.getStatusCode().getCode()).isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // initial success plus one refresh + assertThat(service.prepareCount).isEqualTo(2); + // refresh error plus timed out req + assertThat(service.executeCount).isEqualTo(2); + } + + @Test + public void retriesRstStreamError() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + ApiException rstStreamException = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + service.addExpectation( + ExecuteRpcExpectation.create().respondWithException(Code.INTERNAL, rstStreamException)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("foo")) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(1); + } + + @Test + public void retriesRetriableAuthException() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + ApiException authException = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription( + "Authentication backend internal server error. Please retry")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + service.addExpectation( + ExecuteRpcExpectation.create().respondWithException(Code.INTERNAL, authException)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("foo")) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(1); + } + + @Test + public void retriesGoAwayException() { + service.addExpectation( + PrepareRpcExpectation.create() + .withSql("SELECT * FROM table") + .respondWith( + prepareResponse( + ByteString.copyFromUtf8("foo"), + metadata(columnMetadata("strCol", stringType()))))); + ApiException authException = + new InternalException( + new StatusRuntimeException( + Status.INTERNAL.withDescription("Stream closed before write could take place")), + GrpcStatusCode.of(Status.Code.INTERNAL), + false); + service.addExpectation( + ExecuteRpcExpectation.create().respondWithException(Code.INTERNAL, authException)); + service.addExpectation( + ExecuteRpcExpectation.create() + .withPreparedQuery(ByteString.copyFromUtf8("foo")) + .respondWith(partialResultSetWithToken(stringValue("s")))); + + PreparedStatement ps = client.prepareStatement("SELECT * FROM table", new HashMap<>()); + ResultSet rs = client.executeQuery(ps.bind().build()); + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("strCol")).isEqualTo("s"); + assertThat(rs.next()).isFalse(); + assertThat(service.executeCount).isEqualTo(2); + assertThat(service.prepareCount).isEqualTo(1); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallableTest.java new file mode 100644 index 000000000000..9312d3ffe5dc --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallableTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2025 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.sql.MetadataErrorHandlingCallable.MetadataErrorHandlingObserver; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockResponseObserver; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCall; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCallable; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockStreamController; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class MetadataErrorHandlingCallableTest { + private ExecuteQueryCallContext callContext; + private MockResponseObserver outerObserver; + private SettableApiFuture metadataFuture; + private MetadataErrorHandlingCallable.MetadataErrorHandlingObserver observer; + + @Before + public void setUp() { + metadataFuture = SettableApiFuture.create(); + PreparedStatement preparedStatement = + preparedStatement( + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", int64Type()))); + + callContext = SqlProtoFactory.callContext(preparedStatement.bind().build(), metadataFuture); + outerObserver = new MockResponseObserver<>(true); + observer = new MetadataErrorHandlingObserver(outerObserver, callContext); + } + + // cancel will manifest as an onError call so these are testing both cancellation and + // other exceptions + @Test + public void observer_passesThroughErrorAndSetsMetadataException() { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(callContext, observer); + MockServerStreamingCall lastCall = innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + innerController.getObserver().onError(new CancellationException("Cancelled")); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThrows(ExecutionException.class, metadataFuture::get); + ExecutionException e = assertThrows(ExecutionException.class, metadataFuture::get); + assertThat(e.getCause()).isInstanceOf(CancellationException.class); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isInstanceOf(CancellationException.class); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallableTest.java new file mode 100644 index 000000000000..3511f51eaecb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallableTest.java @@ -0,0 +1,338 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.planRefreshError; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.prepareResponse; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.api.core.ApiClock; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.core.FakeApiClock; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.cloud.bigtable.data.v2.stub.sql.PlanRefreshingCallable.PlanRefreshingObserver; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.FakePreparedStatement; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockResponseObserver; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCall; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCallable; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockStreamController; +import com.google.protobuf.ByteString; +import io.grpc.Deadline; +import io.grpc.Status.Code; +import java.time.Duration; +import java.time.Instant; +import java.util.Collections; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class PlanRefreshingCallableTest { + + private static final ExecuteQueryRequest FAKE_REQUEST = ExecuteQueryRequest.newBuilder().build(); + private static final com.google.bigtable.v2.ResultSetMetadata METADATA = + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", int64Type())); + private static final ExecuteQueryResponse DATA = + partialResultSetWithToken(stringValue("fooVal"), int64Value(100)); + + ExecuteQueryCallContext callContext; + MockResponseObserver outerObserver; + SettableApiFuture metadataFuture; + PlanRefreshingObserver observer; + RetrySettings retrySettings; + ApiClock clock; + + @Before + public void setUp() { + metadataFuture = SettableApiFuture.create(); + PreparedStatement preparedStatement = + preparedStatement( + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", int64Type()))); + + retrySettings = + EnhancedBigtableStubSettings.newBuilder().executeQuerySettings().retrySettings().build(); + clock = new FakeApiClock(System.nanoTime()); + callContext = ExecuteQueryCallContext.create(preparedStatement.bind().build(), metadataFuture); + outerObserver = new MockResponseObserver<>(true); + observer = new PlanRefreshingObserver(outerObserver, callContext); + } + + @Test + public void observer_doesNotSetFutureUntilTokenReceived() + throws ExecutionException, InterruptedException { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, observer); + MockServerStreamingCall lastCall = + innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + innerController.getObserver().onResponse(partialResultSetWithoutToken(stringValue("foo"))); + assertFalse(callContext.resultSetMetadataFuture().isDone()); + innerController.getObserver().onResponse(partialResultSetWithToken(stringValue("bar"))); + assertTrue(callContext.resultSetMetadataFuture().isDone()); + assertThat(callContext.resultSetMetadataFuture().get()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA)); + } + + @Test + public void observer_setsFutureAndPassesThroughResponses() + throws ExecutionException, InterruptedException { + // This has a token so it should finalize the metadata + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Collections.singletonList(DATA)); + innerCallable.call(FAKE_REQUEST, observer); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThat(metadataFuture.get()).isEqualTo(ProtoResultSetMetadata.fromProto(METADATA)); + assertThat(outerObserver.popNextResponse()).isEqualTo(DATA); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void observer_passThroughOnStart() { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, observer); + MockServerStreamingCall lastCall = + innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + assertThat(outerObserver.getController()).isEqualTo(innerController); + } + + @Test + public void observer_onCompleteWithNoData_resolvesMetadata() + throws InterruptedException, ExecutionException { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, observer); + MockServerStreamingCall lastCall = + innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + innerController.getObserver().onComplete(); + assertThat(metadataFuture.get()).isEqualTo(ProtoResultSetMetadata.fromProto(METADATA)); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void testCallable() throws ExecutionException, InterruptedException { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Collections.singletonList(DATA)); + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + PlanRefreshingCallable callable = new PlanRefreshingCallable(innerCallable, requestContext); + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + SettableApiFuture metadataFuture = SettableApiFuture.create(); + PreparedStatement preparedStatement = + preparedStatement( + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", int64Type()))); + + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create(preparedStatement.bind().build(), metadataFuture); + + callable.call(callContext, outerObserver); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThat(metadataFuture.get()).isEqualTo(ProtoResultSetMetadata.fromProto(METADATA)); + assertThat(outerObserver.popNextResponse()).isEqualTo(DATA); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void testPlanRefreshError() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + PlanRefreshingCallable planRefreshingCallable = + new PlanRefreshingCallable(innerCallable, requestContext); + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create(new FakePreparedStatement().bind().build(), metadataFuture); + + planRefreshingCallable.call(callContext, outerObserver); + innerCallable.popLastCall().getController().getObserver().onError(planRefreshError()); + ApiException e = (ApiException) outerObserver.getFinalError(); + + assertThat(e.isRetryable()).isTrue(); + assertThat(callContext.resultSetMetadataFuture().isDone()).isFalse(); + ExecuteQueryRequest nextRequest = + callContext.buildRequestWithDeadline( + requestContext, Deadline.after(1, TimeUnit.MILLISECONDS)); + assertThat(nextRequest.getPreparedQuery()).isEqualTo(ByteString.copyFromUtf8("refreshedPlan")); + } + + @Test + public void testPlanRefreshErrorAfterToken() { + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + PlanRefreshingCallable planRefreshingCallable = + new PlanRefreshingCallable(innerCallable, requestContext); + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create(new FakePreparedStatement().bind().build(), metadataFuture); + + planRefreshingCallable.call(callContext, outerObserver); + ResponseObserver innerObserver = + innerCallable.popLastCall().getController().getObserver(); + innerObserver.onResponse(partialResultSetWithToken(stringValue("foo"))); + innerObserver.onError(planRefreshError()); + + Throwable t = outerObserver.getFinalError(); + assertThat(t).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testIsPlanRefreshError() { + assertThat(PlanRefreshingCallable.isPlanRefreshError(planRefreshError())).isTrue(); + assertFalse( + PlanRefreshingCallable.isPlanRefreshError( + new FailedPreconditionException( + "A different failed precondition", + null, + GrpcStatusCode.of(Code.FAILED_PRECONDITION), + false))); + } + + @Test + public void planRefreshDelayIsFactoredIntoExecuteTimeout() throws InterruptedException { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + RequestContext requestContext = RequestContext.create("project", "instance", "profile"); + PlanRefreshingCallable callable = new PlanRefreshingCallable(innerCallable, requestContext); + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + SettableApiFuture metadataFuture = SettableApiFuture.create(); + SettableApiFuture prepareFuture = SettableApiFuture.create(); + PreparedStatement preparedStatement = + new FakePreparedStatement().withUpdatedPlans(PreparedQueryData.create(prepareFuture), null); + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create(preparedStatement.bind().build(), metadataFuture); + + // This deadline is used for the prepare call and the ultimate execute call after + // that completes. It needs to leave a lot of margin for error for the scheduler below to + // be slower than expected to resolve. Previously 100ms deadline was not enough. + Duration originalAttemptTimeout = Duration.ofSeconds(5); + @SuppressWarnings("UnusedVariable") + ScheduledFuture ignored = + scheduler.schedule( + () -> { + prepareFuture.set( + PrepareResponse.fromProto( + prepareResponse( + ByteString.copyFromUtf8("initialPlan"), + metadata(columnMetadata("strCol", stringType()))))); + }, + 50, + TimeUnit.MILLISECONDS); + ApiCallContext context = + GrpcCallContext.createDefault().withTimeoutDuration(originalAttemptTimeout); + // prepare takes 50 ms to resolve. Despite that the execute timeout should be around 100ms from + // now (w padding) + Deadline paddedDeadlineAtStartOfCall = + Deadline.after(originalAttemptTimeout.toMillis() + 5, TimeUnit.MILLISECONDS); + callable.call(callContext, outerObserver, context); + scheduler.shutdown(); + scheduler.awaitTermination(30, TimeUnit.SECONDS); + // Make sure prepare didn't time out and return an error. + // Otherwise, the observer should not be done + assertFalse(outerObserver.isDone()); + GrpcCallContext grpcCallContext = + (GrpcCallContext) innerCallable.popLastCall().getApiCallContext(); + Deadline executeDeadline = grpcCallContext.getCallOptions().getDeadline(); + assertThat(executeDeadline.isBefore(paddedDeadlineAtStartOfCall)).isTrue(); + } + + @Test + public void testGetDeadlineWithAttemptTimeout() { + GrpcCallContext callContext = + GrpcCallContext.createDefault().withTimeoutDuration(Duration.ofMinutes(1)); + // startTimeOfOverallRequest doesn't matter here + Deadline deadline = PlanRefreshingCallable.getDeadline(callContext, Instant.now()); + long millisRemaining = deadline.timeRemaining(TimeUnit.MILLISECONDS); + assertThat(millisRemaining).isLessThan((60 * 1000) + 1); + // Give some padding in case tests are very slow + assertThat(millisRemaining).isGreaterThan(58 * 1000); + } + + @Test + public void testGetDeadlineWithTotalTimeout() { + GrpcCallContext callContext = + GrpcCallContext.createDefault() + .withRetrySettings( + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMinutes(1)) + .build()); + Deadline deadline = PlanRefreshingCallable.getDeadline(callContext, Instant.now()); + long millisRemaining = deadline.timeRemaining(TimeUnit.MILLISECONDS); + assertThat(millisRemaining).isLessThan((60 * 1000) + 1); + // Give some padding in case tests are very slow + assertThat(millisRemaining).isGreaterThan(58 * 1000); + } + + @Test + public void testAttemptTimeoutUsedOverTotalTimeout() { + GrpcCallContext callContext = + GrpcCallContext.createDefault() + .withTimeoutDuration(Duration.ofMinutes(1)) + .withRetrySettings( + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofHours(1)) + .build()); + Deadline deadline = PlanRefreshingCallable.getDeadline(callContext, Instant.now()); + long millisRemaining = deadline.timeRemaining(TimeUnit.MILLISECONDS); + assertThat(millisRemaining).isLessThan((60 * 1000) + 1); + // Give some padding in case tests are very slow + assertThat(millisRemaining).isGreaterThan(58 * 1000); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineSubject.java new file mode 100644 index 000000000000..e9f6bf09e662 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineSubject.java @@ -0,0 +1,70 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import com.google.common.truth.Truth; +import java.util.ArrayDeque; +import java.util.Queue; +import javax.annotation.Nullable; + +/** Truth subject for {@link ProtoRowsMergingStateMachine}. Intended for ease-of-use in testing. */ +public final class ProtoRowsMergingStateMachineSubject extends Subject { + + private final ProtoRowsMergingStateMachine actual; + + private ProtoRowsMergingStateMachineSubject( + FailureMetadata metadata, @Nullable ProtoRowsMergingStateMachine actual) { + super(metadata, actual); + this.actual = actual; + } + + public static Factory + stateMachine() { + return ProtoRowsMergingStateMachineSubject::new; + } + + public static ProtoRowsMergingStateMachineSubject assertThat( + @Nullable ProtoRowsMergingStateMachine actual) { + return assertAbout(stateMachine()).that(actual); + } + + public void hasCompleteBatches(boolean expectation) { + if (expectation) { + check("hasCompleteBatch()").that(actual.hasCompleteBatches()).isTrue(); + } else { + check("hasCompleteBatch()").that(actual.hasCompleteBatches()).isFalse(); + } + } + + public void isBatchInProgress(boolean expectation) { + if (expectation) { + check("isBatchInProgress()").that(actual.isBatchInProgress()).isTrue(); + } else { + check("isBatchInProgress()").that(actual.isBatchInProgress()).isFalse(); + } + } + + public void populateQueueYields(SqlRow... expectedRows) { + Queue actualQueue = new ArrayDeque<>(); + actual.populateQueue(actualQueue); + Truth.assertThat(actualQueue).containsExactlyElementsIn(expectedRows); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java new file mode 100644 index 000000000000..9da5224cf2ea --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java @@ -0,0 +1,684 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.ProtoRowsMergingStateMachineSubject.assertThat; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.checksum; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSets; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.structValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.tokenOnlyResultSet; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiExceptions; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.PartialResultSet; +import com.google.bigtable.v2.ProtoRows; +import com.google.bigtable.v2.ProtoRowsBatch; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.common.Type; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.ArrayDeque; +import java.util.List; +import org.junit.Test; +import org.junit.experimental.runners.Enclosed; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +// Use enclosed runner so we can put parameterized and non-parameterized cases in the same test +// suite +@RunWith(Enclosed.class) +public final class ProtoRowsMergingStateMachineTest { + + public static final class IndividualTests { + @Test + public void stateMachine_hasCompleteBatches_falseWhenEmpty() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + assertThat(stateMachine).hasCompleteBatches(false); + } + + @Test + public void stateMachine_hasCompleteBatches_falseWhenAwaitingPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).hasCompleteBatches(false); + } + + @Test + public void stateMachine_hasCompleteBatches_trueWhenAwaitingBatchConsume() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("bar")).getResults()); + assertThat(stateMachine).hasCompleteBatches(true); + } + + @Test + public void stateMachine_isBatchInProgress_falseWhenEmpty() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + assertThat(stateMachine).isBatchInProgress(false); + } + + @Test + public void stateMachine_isBatchInProgress_trueWhenAwaitingPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).isBatchInProgress(true); + } + + @Test + public void stateMachine_isBatchInProgress_trueWhenAwaitingBatchConsume() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).isBatchInProgress(true); + } + + @Test + public void stateMachine_consumeRow_throwsExceptionWhenColumnsArentComplete() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType()), columnMetadata("b", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + // this is a valid partial result set so we don't expect an error until we call populateQueue + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("foo")).getResults()); + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + } + + @Test + public void stateMachine_consumeRow_throwsExceptionWhenAwaitingPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + // this doesn't have a token so we shouldn't allow results to be processed + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + } + + @Test + public void stateMachine_mergesPartialBatches() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + List partialBatches = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + for (ExecuteQueryResponse res : partialBatches) { + stateMachine.addPartialResultSet(res.getResults()); + } + + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("foo"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("bar"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("baz")))); + } + + @Test + @SuppressWarnings("InlineMeInliner") + public void stateMachine_mergesPartialBatches_withRandomChunks() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("map", mapType(stringType(), bytesType())))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + Value mapVal = + mapValue( + mapElement( + stringValue(Strings.repeat("a", 10)), bytesValue(Strings.repeat("aVal", 100))), + mapElement(stringValue("b"), bytesValue(Strings.repeat("bVal", 100)))); + ProtoRows rows = ProtoRows.newBuilder().addValues(mapVal).build(); + ByteString chunk1 = rows.toByteString().substring(0, 100); + ByteString chunk2 = rows.toByteString().substring(100); + + stateMachine.addPartialResultSet( + PartialResultSet.newBuilder() + .setProtoRowsBatch(ProtoRowsBatch.newBuilder().setBatchData(chunk1).build()) + .build()); + stateMachine.addPartialResultSet( + PartialResultSet.newBuilder() + .setResumeToken(ByteString.copyFromUtf8("token")) + .setProtoRowsBatch(ProtoRowsBatch.newBuilder().setBatchData(chunk2).build()) + .setBatchChecksum(checksum(rows.toByteString())) + .build()); + + assertThat(stateMachine) + .populateQueueYields(ProtoSqlRow.create(metadata, ImmutableList.of(mapVal))); + } + + @Test + public void stateMachine_reconstructsRowWithMultipleColumns() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata( + columnMetadata("a", stringType()), + columnMetadata("b", bytesType()), + columnMetadata("c", arrayType(stringType())), + columnMetadata("d", mapType(stringType(), bytesType())))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + Value stringVal = stringValue("test"); + stateMachine.addPartialResultSet(partialResultSetWithoutToken(stringVal).getResults()); + Value bytesVal = bytesValue("bytes"); + stateMachine.addPartialResultSet(partialResultSetWithoutToken(bytesVal).getResults()); + Value arrayVal = arrayValue(stringValue("foo"), stringValue("bar")); + stateMachine.addPartialResultSet(partialResultSetWithoutToken(arrayVal).getResults()); + Value mapVal = + mapValue( + mapElement(stringValue("a"), bytesValue("aVal")), + mapElement(stringValue("b"), bytesValue("bVal"))); + stateMachine.addPartialResultSet(partialResultSetWithToken(mapVal).getResults()); + + assertThat(stateMachine).hasCompleteBatches(true); + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create( + metadata, ImmutableList.of(stringVal, bytesVal, arrayVal, mapVal))); + + // Once we consume a completed row the state machine should be reset + assertThat(stateMachine).hasCompleteBatches(false); + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + assertThat(stateMachine).isBatchInProgress(false); + } + + @Test + public void stateMachine_throwsExceptionWhenValuesDontMatchSchema() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType()), columnMetadata("b", bytesType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + // values in wrong order + stateMachine.addPartialResultSet( + partialResultSetWithToken(bytesValue("test"), stringValue("test")).getResults()); + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + } + + @Test + public void stateMachine_handlesResumeTokenWithNoValues() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + stateMachine.addPartialResultSet(partialResultSetWithToken().getResults()); + assertThat(stateMachine).populateQueueYields(new ProtoSqlRow[] {}); + } + + @Test + public void stateMachine_handlesResumeTokenWithOpenBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("test")).getResults()); + stateMachine.addPartialResultSet( + tokenOnlyResultSet(ByteString.copyFromUtf8("token")).getResults()); + assertThat(stateMachine) + .populateQueueYields(ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("test")))); + } + + @Test + public void addPartialResultSet_throwsExceptionWhenAwaitingRowConsume() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("test")).getResults()); + + assertThrows( + IllegalStateException.class, + () -> + stateMachine.addPartialResultSet( + partialResultSetWithToken(stringValue("test2")).getResults())); + } + + @Test + public void stateMachine_throwsExceptionOnChecksumMismatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + // Override the checksum of the final response + PartialResultSet lastResultsWithBadChecksum = + responses.get(2).getResults().toBuilder().setBatchChecksum(1234).build(); + + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet(responses.get(0).getResults()); + stateMachine.addPartialResultSet(responses.get(1).getResults()); + + assertThrows( + IllegalStateException.class, + () -> stateMachine.addPartialResultSet(lastResultsWithBadChecksum)); + } + + @Test + public void stateMachine_handlesResetOnPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + // Initial response here has reset bit set + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + stateMachine.addPartialResultSet(responses.get(0).getResults()); + stateMachine.addPartialResultSet(responses.get(1).getResults()); + + // The two results above should be discarded by reset + for (ExecuteQueryResponse response : responses) { + stateMachine.addPartialResultSet(response.getResults()); + } + + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("foo"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("bar"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("baz")))); + } + + @Test + public void stateMachine_handlesResetWithUncommittedBatches() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + // Create 2 batches split into multiple chunks. Neither containing a resume token + List firstBatch = + partialResultSets( + 2, + true, + ByteString.EMPTY, + stringValue("foo"), + stringValue("bar"), + stringValue("baz")); + List secondBatch = + partialResultSets( + 3, false, ByteString.EMPTY, stringValue("a"), stringValue("b"), stringValue("c")); + + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + for (ExecuteQueryResponse res : firstBatch) { + stateMachine.addPartialResultSet(res.getResults()); + } + for (ExecuteQueryResponse res : secondBatch) { + stateMachine.addPartialResultSet(res.getResults()); + } + // Nothing should be yielded yet + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + + List resetBatch = + partialResultSets( + 2, + true, + ByteString.EMPTY, + stringValue("foo2"), + stringValue("bar2"), + stringValue("baz2")); + List batchAfterReset = + partialResultSets( + 3, + false, + ByteString.copyFromUtf8("token"), + stringValue("a2"), + stringValue("b2"), + stringValue("c2")); + for (ExecuteQueryResponse res : resetBatch) { + stateMachine.addPartialResultSet(res.getResults()); + } + for (ExecuteQueryResponse res : batchAfterReset) { + stateMachine.addPartialResultSet(res.getResults()); + } + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("foo2"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("bar2"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("baz2"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("a2"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("b2"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("c2")))); + } + + @Test + public void stateMachine_handlesMultipleCompleteBatchesBeforeToken() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + // Create 2 batches split into multiple chunks. Neither containing a resume token + List firstBatch = + partialResultSets( + 2, + true, + ByteString.EMPTY, + stringValue("foo"), + stringValue("bar"), + stringValue("baz")); + List secondBatch = + partialResultSets( + 3, false, ByteString.EMPTY, stringValue("a"), stringValue("b"), stringValue("c")); + + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + for (ExecuteQueryResponse res : firstBatch) { + stateMachine.addPartialResultSet(res.getResults()); + } + for (ExecuteQueryResponse res : secondBatch) { + stateMachine.addPartialResultSet(res.getResults()); + } + // Nothing should be yielded yet + assertThrows( + IllegalStateException.class, () -> stateMachine.populateQueue(new ArrayDeque<>())); + ExecuteQueryResponse resultWithToken = partialResultSetWithToken(stringValue("final")); + stateMachine.addPartialResultSet(resultWithToken.getResults()); + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("foo"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("bar"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("baz"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("a"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("b"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("c"))), + ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("final")))); + } + + @Test + public void stateMachine_throwsExceptionWithChecksumButNoData() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + PartialResultSet invalid = PartialResultSet.newBuilder().setBatchChecksum(1234).build(); + assertThrows(IllegalStateException.class, () -> stateMachine.addPartialResultSet(invalid)); + } + + @Test + public void stateMachine_resolvesMetadataOnlyAfterFirstToken() { + final boolean[] metadataHasBeenAccessed = {false}; + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = + new ProtoRowsMergingStateMachine( + () -> { + // hacky way to check if supplier has been resolved + // This is in an array so the variable can be final + metadataHasBeenAccessed[0] = true; + return metadata; + }); + + stateMachine.addPartialResultSet(partialResultSetWithoutToken(stringValue("s")).getResults()); + assertFalse(metadataHasBeenAccessed[0]); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("b")).getResults()); + assertTrue(metadataHasBeenAccessed[0]); + } + + @Test + public void stateMachine_handlesSchemaChangeAfterResetOfInitialBatch() { + SettableApiFuture mdFuture = SettableApiFuture.create(); + ProtoRowsMergingStateMachine stateMachine = + new ProtoRowsMergingStateMachine( + () -> ApiExceptions.callAndTranslateApiException(mdFuture)); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("discard")).getResults()); + + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", bytesType()), columnMetadata("b", int64Type()))); + mdFuture.set(metadata); + List retryResponses = + partialResultSets(2, bytesValue("bytes"), int64Value(123)); + for (ExecuteQueryResponse res : retryResponses) { + stateMachine.addPartialResultSet(res.getResults()); + } + assertThat(stateMachine) + .populateQueueYields( + ProtoSqlRow.create(metadata, ImmutableList.of(bytesValue("bytes"), int64Value(123)))); + } + + @Test + public void stateMachine_throwsExceptionWithTokenAndIncompleteBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + List responses = + partialResultSets(2, stringValue("foo"), stringValue("bar")); + stateMachine.addPartialResultSet(responses.get(0).getResults()); + // We haven't added the second response above, this should error + assertThrows( + IllegalStateException.class, + () -> + stateMachine.addPartialResultSet( + tokenOnlyResultSet(ByteString.copyFromUtf8("token")).getResults())); + } + + @Test + public void isBatchInProgress_trueWithUncommitedCompleteBatches() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).isBatchInProgress(true); + } + + @Test + public void hasCompleteBatches_falseWithUncommitedCompleteBatches() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(() -> metadata); + + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).hasCompleteBatches(false); + } + } + + @RunWith(Parameterized.class) + public static final class ParameterizedTests { + + public ParameterizedTests(SqlType.Code typeCode) { + this.typeCase = typeCode; + } + + private final SqlType.Code typeCase; + + @Parameters + public static SqlType.Code[] valueTypes() { + return SqlType.Code.values(); + } + + @Test + @SuppressWarnings("UnnecessaryDefaultInEnumSwitch") + public void testValidateSupportsAllTypes() { + switch (typeCase) { + case STRING: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.string(), bytesValue("test"))); + break; + case BYTES: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.bytes(), stringValue("test"))); + break; + case INT64: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.int64(), stringValue("test"))); + break; + case BOOL: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.bool(), stringValue("test"))); + break; + case FLOAT32: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.float32(), stringValue("test"))); + break; + case FLOAT64: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.float64(), stringValue("test"))); + break; + case TIMESTAMP: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.timestamp(), stringValue("test"))); + break; + case DATE: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.date(), stringValue("test"))); + break; + case ARRAY: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.arrayOf(SqlType.string()), stringValue("test"))); + // It should check nested values match + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.arrayOf(SqlType.string()), + arrayValue(stringValue("test"), bytesValue("test")))); + break; + case STRUCT: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.fromProto(structType(stringType(), bytesType())), + stringValue("test"))); + // It should check nested values match + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.fromProto(structType(stringType(), bytesType())), + structValue(stringValue("test"), stringValue("test")))); + break; + case MAP: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.mapOf(SqlType.string(), SqlType.string()), stringValue("test"))); + // It should check nested values match + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.mapOf(SqlType.string(), SqlType.bytes()), + mapValue( + mapElement(stringValue("key"), bytesValue("val")), + mapElement(stringValue("key2"), stringValue("val2"))))); + // It should check all map elements contain only one key and one value because map + // elements + // are represented as structs which are represented as an array of fields. + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + SqlType.mapOf(SqlType.string(), SqlType.bytes()), + mapValue( + mapElement(stringValue("key"), bytesValue("val")), + structValue( + stringValue("key2"), bytesValue("val2"), bytesValue("val3"))))); + break; + case PROTO: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + Type.SchemalessProto.create("test", "my_bundle"), stringValue("test"))); + break; + case ENUM: + assertThrows( + IllegalStateException.class, + () -> + ProtoRowsMergingStateMachine.validateValueAndType( + Type.SchemalessEnum.create("test", "my_bundle"), bytesValue("val"))); + break; + default: + assertWithMessage( + "Unknown TypeCase " + + typeCase.name() + + " seen. Check if" + + " SerializedProtoRowsMergingStateMachine.validateValueAndType supports all" + + " types.") + .fail(); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java new file mode 100644 index 000000000000..1a3441a2092a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java @@ -0,0 +1,633 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import com.google.api.core.ApiFutures; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.FailedPreconditionException; +import com.google.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ColumnMetadata; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.PartialResultSet; +import com.google.bigtable.v2.PrepareQueryRequest; +import com.google.bigtable.v2.PrepareQueryResponse; +import com.google.bigtable.v2.ProtoRows; +import com.google.bigtable.v2.ProtoRowsBatch; +import com.google.bigtable.v2.ProtoSchema; +import com.google.bigtable.v2.ResultSetMetadata; +import com.google.bigtable.v2.Type; +import com.google.bigtable.v2.Type.Struct.Field; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.PrepareResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryData; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl.PreparedQueryVersion; +import com.google.cloud.bigtable.data.v2.internal.QueryParamUtil; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import com.google.common.truth.Truth; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.PreconditionFailure.Violation; +import com.google.type.Date; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingDeque; +import javax.annotation.Nullable; + +// TODO rename this to SqlApiTestUtils +/** Utilities for creating sql proto objects in tests */ +public class SqlProtoFactory { + + private static final HashFunction CRC32C = Hashing.crc32c(); + private static final Metadata.Key ERROR_DETAILS_KEY = + Metadata.Key.of("grpc-status-details-bin", Metadata.BINARY_BYTE_MARSHALLER); + + private SqlProtoFactory() {} + + public static ApiException planRefreshError() { + Metadata trailers = new Metadata(); + PreconditionFailure failure = + PreconditionFailure.newBuilder() + .addViolations(Violation.newBuilder().setType("PREPARED_QUERY_EXPIRED").build()) + .build(); + ErrorDetails refreshErrorDetails = + ErrorDetails.builder().setRawErrorMessages(ImmutableList.of(Any.pack(failure))).build(); + byte[] status = + com.google.rpc.Status.newBuilder().addDetails(Any.pack(failure)).build().toByteArray(); + // This needs to be in trailers in order to round trip + trailers.put(ERROR_DETAILS_KEY, status); + + // This is not initially retryable, the PlanRefreshingCallable overrides this. + return new FailedPreconditionException( + new StatusRuntimeException(Status.FAILED_PRECONDITION, trailers), + GrpcStatusCode.of(Code.FAILED_PRECONDITION), + false, + refreshErrorDetails); + } + + public static PrepareQueryResponse prepareResponse( + ByteString preparedQuery, ResultSetMetadata metadata, Instant validUntil) { + return PrepareQueryResponse.newBuilder() + .setPreparedQuery(preparedQuery) + // set validUntil a year in the future so these plans never expire in test runs + .setValidUntil( + Timestamp.newBuilder() + .setSeconds(validUntil.getEpochSecond()) + .setNanos(validUntil.getNano()) + .build()) + .setMetadata(metadata) + .build(); + } + + public static PrepareQueryResponse prepareResponse( + ByteString preparedQuery, ResultSetMetadata metadata) { + return prepareResponse(preparedQuery, metadata, Instant.now().plus(Duration.ofDays(365))); + } + + public static PrepareQueryResponse prepareResponse(ResultSetMetadata metadata) { + return prepareResponse(ByteString.copyFromUtf8("foo"), metadata); + } + + public static PreparedStatementImpl preparedStatement(ResultSetMetadata metadata) { + return preparedStatement(metadata, new HashMap<>()); + } + + public static PreparedStatementImpl preparedStatement( + ResultSetMetadata metadata, Map> paramTypes) { + // We never expire the test prepare response so it's safe to null the stub and request + return preparedStatement(PrepareResponse.fromProto(prepareResponse(metadata)), paramTypes); + } + + public static PreparedStatementImpl preparedStatement( + PrepareResponse response, Map> paramTypes) { + return new FakePreparedStatement(response, paramTypes); + } + + public static ExecuteQueryCallContext callContext(BoundStatement boundStatement) { + return callContext(boundStatement, SettableApiFuture.create()); + } + + public static ExecuteQueryCallContext callContext( + BoundStatement boundStatement, + SettableApiFuture mdFuture) { + return ExecuteQueryCallContext.create(boundStatement, mdFuture); + } + + public static ColumnMetadata columnMetadata(String name, Type type) { + return ColumnMetadata.newBuilder().setName(name).setType(type).build(); + } + + public static Type stringType() { + return Type.newBuilder().setStringType(Type.String.getDefaultInstance()).build(); + } + + public static Type bytesType() { + return Type.newBuilder().setBytesType(Type.Bytes.getDefaultInstance()).build(); + } + + public static Type int64Type() { + return Type.newBuilder().setInt64Type(Type.Int64.getDefaultInstance()).build(); + } + + public static Type boolType() { + return Type.newBuilder().setBoolType(Type.Bool.getDefaultInstance()).build(); + } + + public static Type float32Type() { + return Type.newBuilder().setFloat32Type(Type.Float32.getDefaultInstance()).build(); + } + + public static Type float64Type() { + return Type.newBuilder().setFloat64Type(Type.Float64.getDefaultInstance()).build(); + } + + public static Type timestampType() { + return Type.newBuilder().setTimestampType(Type.Timestamp.getDefaultInstance()).build(); + } + + public static Type dateType() { + return Type.newBuilder().setDateType(Type.Date.getDefaultInstance()).build(); + } + + public static Type aggregateSumType() { + return Type.newBuilder() + .setAggregateType( + Type.Aggregate.newBuilder().setSum(Type.Aggregate.Sum.getDefaultInstance())) + .build(); + } + + public static Type arrayType(Type elementType) { + return Type.newBuilder() + .setArrayType(Type.Array.newBuilder().setElementType(elementType).build()) + .build(); + } + + public static Type structType(Type... fieldTypes) { + Field[] fields = new Field[fieldTypes.length]; + for (int i = 0; i < fieldTypes.length; i++) { + fields[i] = Type.Struct.Field.newBuilder().setType(fieldTypes[i]).build(); + } + return structType(fields); + } + + public static Type structType(Field... fields) { + return Type.newBuilder() + .setStructType(Type.Struct.newBuilder().addAllFields(Arrays.asList(fields)).build()) + .build(); + } + + public static Field structField(String name, Type type) { + return Type.Struct.Field.newBuilder().setFieldName(name).setType(type).build(); + } + + public static Type mapType(Type keyType, Type valueType) { + return Type.newBuilder() + .setMapType(Type.Map.newBuilder().setKeyType(keyType).setValueType(valueType).build()) + .build(); + } + + public static Type protoType(String messageName, String schemaBundleId) { + return Type.newBuilder() + .setProtoType( + Type.Proto.newBuilder().setMessageName(messageName).setSchemaBundleId(schemaBundleId)) + .build(); + } + + public static Type enumType(String enumName, String schemaBundleId) { + return Type.newBuilder() + .setEnumType(Type.Enum.newBuilder().setEnumName(enumName).setSchemaBundleId(schemaBundleId)) + .build(); + } + + public static Value nullValue() { + return Value.newBuilder().build(); + } + + public static Value stringValue(String contents) { + return Value.newBuilder().setStringValue(contents).build(); + } + + public static Value bytesValue(String contents) { + return Value.newBuilder().setBytesValue(ByteString.copyFromUtf8(contents)).build(); + } + + public static Value bytesValue(byte[] contents) { + return Value.newBuilder().setBytesValue(ByteString.copyFrom(contents)).build(); + } + + public static Value int64Value(long data) { + return Value.newBuilder().setIntValue(data).build(); + } + + public static Value floatValue(double data) { + return Value.newBuilder().setFloatValue(data).build(); + } + + public static Value boolValue(boolean data) { + return Value.newBuilder().setBoolValue(data).build(); + } + + public static Value timestampValue(long seconds, int nanos) { + return Value.newBuilder() + .setTimestampValue(Timestamp.newBuilder().setSeconds(seconds).setNanos(nanos).build()) + .build(); + } + + public static Value dateValue(int year, int month, int day) { + return Value.newBuilder() + .setDateValue(Date.newBuilder().setYear(year).setMonth(month).setDay(day).build()) + .build(); + } + + public static Value arrayValue(Value... elements) { + return Value.newBuilder() + .setArrayValue(ArrayValue.newBuilder().addAllValues(Arrays.asList(elements))) + .build(); + } + + public static Value structValue(Value... fields) { + return arrayValue(fields); + } + + public static Value mapValue(Value... elements) { + return arrayValue(elements); + } + + public static Value mapElement(Value... fields) { + return structValue(fields); + } + + /** Creates a single response representing a complete batch, with no token */ + public static ExecuteQueryResponse partialResultSetWithoutToken(Value... values) { + return partialResultSets(1, false, ByteString.EMPTY, values).get(0); + } + + /** Creates a single response representing a complete batch, with a resume token of 'test' */ + public static ExecuteQueryResponse partialResultSetWithToken(Value... values) { + return partialResultSets(1, false, ByteString.copyFromUtf8("test"), values).get(0); + } + + /** Creates a single response representing a complete batch, with a resume token of token */ + public static ExecuteQueryResponse partialResultSetWithToken(ByteString token, Value... values) { + return partialResultSets(1, false, token, values).get(0); + } + + public static ExecuteQueryResponse tokenOnlyResultSet(ByteString token) { + return ExecuteQueryResponse.newBuilder() + .setResults(PartialResultSet.newBuilder().setResumeToken(token)) + .build(); + } + + /** + * splits values across specified number of batches. Sets reset on first response, and resume + * token on final response + */ + public static ImmutableList partialResultSets( + int batches, Value... values) { + return partialResultSets(batches, true, ByteString.copyFromUtf8("test"), values); + } + + /** + * @param batches number of {@link ProtoRowsBatch}s to split values across + * @param reset whether to set the reset bit on the first response + * @param resumeToken resumption token for the final response. Unset if empty + * @param values List of values to split across batches + * @return List of responses with length equal to number of batches + */ + public static ImmutableList partialResultSets( + int batches, boolean reset, ByteString resumeToken, Value... values) { + ProtoRows protoRows = ProtoRows.newBuilder().addAllValues(Arrays.asList(values)).build(); + ByteString batchData = protoRows.toByteString(); + int batch_checksum = checksum(batchData); + ImmutableList.Builder responses = ImmutableList.builder(); + int batchSize = batchData.size() / batches; + for (int i = 0; i < batches; i++) { + boolean finalBatch = i == batches - 1; + int batchStart = i * batchSize; + int batchEnd = finalBatch ? batchData.size() : batchStart + batchSize; + ProtoRowsBatch.Builder batchBuilder = ProtoRowsBatch.newBuilder(); + batchBuilder.setBatchData(batchData.substring(batchStart, batchEnd)); + PartialResultSet.Builder resultSetBuilder = PartialResultSet.newBuilder(); + if (reset && i == 0) { + resultSetBuilder.setReset(true); + } + if (finalBatch) { + resultSetBuilder.setBatchChecksum(batch_checksum); + if (!resumeToken.isEmpty()) { + resultSetBuilder.setResumeToken(resumeToken); + } + } + resultSetBuilder.setProtoRowsBatch(batchBuilder.build()); + responses.add(ExecuteQueryResponse.newBuilder().setResults(resultSetBuilder.build()).build()); + } + return responses.build(); + } + + public static ResultSetMetadata metadata(ColumnMetadata... columnMetadata) { + ProtoSchema schema = + ProtoSchema.newBuilder().addAllColumns(Arrays.asList(columnMetadata)).build(); + return ResultSetMetadata.newBuilder().setProtoSchema(schema).build(); + } + + public static int checksum(ByteString bytes) { + return CRC32C.hashBytes(bytes.toByteArray()).asInt(); + } + + /** Used to test ExecuteQuery and PrepareQuery APIs using the RpcExpectations below */ + public static class TestBigtableSqlService extends BigtableGrpc.BigtableImplBase { + public static final String DEFAULT_PROJECT_ID = "fake-project"; + public static final String DEFAULT_INSTANCE_ID = "fake-instance"; + public static final String DEFAULT_APP_PROFILE_ID = "fake-app-profile"; + public static final ByteString DEFAULT_PREPARED_QUERY = ByteString.copyFromUtf8("foo"); + Queue executeExpectations = new LinkedBlockingDeque<>(); + Queue prepareExpectations = new LinkedBlockingDeque<>(); + int executeCount = 0; + public int prepareCount = 0; + + public void addExpectation(ExecuteRpcExpectation expectation) { + executeExpectations.add(expectation); + } + + public void addExpectation(PrepareRpcExpectation expectation) { + prepareExpectations.add(expectation); + } + + @Override + public void executeQuery( + ExecuteQueryRequest request, StreamObserver responseObserver) { + ExecuteRpcExpectation expectedRpc = executeExpectations.poll(); + executeCount++; + int requestIndex = executeCount - 1; + + Truth.assertWithMessage("Unexpected request#" + requestIndex + ":" + request.toString()) + .that(expectedRpc) + .isNotNull(); + Truth.assertWithMessage("Unexpected request#" + requestIndex) + .that(request) + .isEqualTo(expectedRpc.getExpectedRequest()); + + try { + Thread.sleep(expectedRpc.delay.toMillis()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + for (ExecuteQueryResponse response : expectedRpc.responses) { + responseObserver.onNext(response); + } + if (expectedRpc.statusCode.toStatus().isOk()) { + responseObserver.onCompleted(); + } else if (expectedRpc.exception != null) { + responseObserver.onError(expectedRpc.exception); + } else { + responseObserver.onError(expectedRpc.statusCode.toStatus().asRuntimeException()); + } + } + + @Override + public void prepareQuery( + PrepareQueryRequest request, StreamObserver responseObserver) { + PrepareRpcExpectation expectedRpc = prepareExpectations.poll(); + prepareCount++; + int requestIndex = prepareCount - 1; + + Truth.assertWithMessage("Unexpected request#" + requestIndex + ":" + request.toString()) + .that(expectedRpc) + .isNotNull(); + Truth.assertWithMessage("Unexpected request#" + requestIndex) + .that(request) + .isEqualTo(expectedRpc.getExpectedRequest()); + + try { + Thread.sleep(expectedRpc.delay.toMillis()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + if (expectedRpc.statusCode == Code.OK) { + responseObserver.onNext(expectedRpc.response); + responseObserver.onCompleted(); + } else { + responseObserver.onError(expectedRpc.statusCode.toStatus().asRuntimeException()); + } + } + } + + public static class ExecuteRpcExpectation { + ExecuteQueryRequest.Builder request; + Status.Code statusCode; + @Nullable ApiException exception; + List responses; + Duration delay; + + private ExecuteRpcExpectation() { + this.request = ExecuteQueryRequest.newBuilder(); + this.request.setPreparedQuery(TestBigtableSqlService.DEFAULT_PREPARED_QUERY); + this.request.setInstanceName( + NameUtil.formatInstanceName( + TestBigtableSqlService.DEFAULT_PROJECT_ID, + TestBigtableSqlService.DEFAULT_INSTANCE_ID)); + this.request.setAppProfileId(TestBigtableSqlService.DEFAULT_APP_PROFILE_ID); + this.statusCode = Code.OK; + this.responses = new ArrayList<>(); + this.delay = Duration.ZERO; + } + + public static ExecuteRpcExpectation create() { + return new ExecuteRpcExpectation(); + } + + public ExecuteRpcExpectation withResumeToken(ByteString resumeToken) { + this.request.setResumeToken(resumeToken); + return this; + } + + public ExecuteRpcExpectation withDelay(Duration delay) { + this.delay = delay; + return this; + } + + public ExecuteRpcExpectation withParams(Map params) { + this.request.putAllParams(params); + return this; + } + + public ExecuteRpcExpectation withPreparedQuery(ByteString preparedQuery) { + this.request.setPreparedQuery(preparedQuery); + return this; + } + + public ExecuteRpcExpectation respondWithStatus(Status.Code code) { + this.statusCode = code; + return this; + } + + public ExecuteRpcExpectation respondWithException(Status.Code code, ApiException exception) { + this.statusCode = code; + this.exception = exception; + return this; + } + + public ExecuteRpcExpectation respondWith(ExecuteQueryResponse... responses) { + this.responses = Arrays.asList(responses); + return this; + } + + ExecuteQueryRequest getExpectedRequest() { + return this.request.build(); + } + } + + public static class PrepareRpcExpectation { + PrepareQueryRequest.Builder request; + Status.Code statusCode; + PrepareQueryResponse response; + Duration delay; + + private PrepareRpcExpectation() { + this.request = PrepareQueryRequest.newBuilder(); + this.request.setInstanceName( + NameUtil.formatInstanceName( + TestBigtableSqlService.DEFAULT_PROJECT_ID, + TestBigtableSqlService.DEFAULT_INSTANCE_ID)); + this.request.setAppProfileId(TestBigtableSqlService.DEFAULT_APP_PROFILE_ID); + this.statusCode = Code.OK; + this.delay = Duration.ZERO; + } + + public static PrepareRpcExpectation create() { + return new PrepareRpcExpectation(); + } + + public PrepareRpcExpectation withSql(String sqlQuery) { + this.request.setQuery(sqlQuery); + return this; + } + + public PrepareRpcExpectation withParamTypes(Map> paramTypes) { + Map protoParamTypes = new HashMap<>(); + for (Map.Entry> entry : paramTypes.entrySet()) { + Type proto = QueryParamUtil.convertToQueryParamProto(entry.getValue()); + protoParamTypes.put(entry.getKey(), proto); + } + this.request.putAllParamTypes(protoParamTypes); + return this; + } + + public PrepareRpcExpectation respondWithStatus(Status.Code code) { + this.statusCode = code; + return this; + } + + public PrepareRpcExpectation respondWith(PrepareQueryResponse res) { + this.response = res; + return this; + } + + public PrepareRpcExpectation withDelay(Duration delay) { + this.delay = delay; + return this; + } + + PrepareQueryRequest getExpectedRequest() { + return this.request.build(); + } + } + + /** + * Fake prepared statement for testing. Note that the schema changes on calls to hard refresh. + * This is used to test plan updates propagate. + */ + public static final class FakePreparedStatement extends PreparedStatementImpl { + private static final PrepareResponse DEFAULT_INITIAL_RESPONSE = + PrepareResponse.fromProto( + prepareResponse( + ByteString.copyFromUtf8("initialPlan"), + metadata(columnMetadata("strCol", stringType())))); + private static final PreparedQueryData DEFAULT_INITIAL_PLAN = + PreparedQueryData.create(ApiFutures.immediateFuture(DEFAULT_INITIAL_RESPONSE)); + private static final PreparedQueryData DEFAULT_PLAN_ON_REFRESH = + PreparedQueryData.create( + ApiFutures.immediateFuture( + PrepareResponse.fromProto( + prepareResponse( + ByteString.copyFromUtf8("refreshedPlan"), + metadata(columnMetadata("bytesColl", bytesType())))))); + + private PreparedQueryData initialPlan; + private PreparedQueryData planOnRefresh; + + public FakePreparedStatement() { + super(DEFAULT_INITIAL_RESPONSE, new HashMap<>(), null, null); + this.initialPlan = DEFAULT_INITIAL_PLAN; + this.planOnRefresh = DEFAULT_PLAN_ON_REFRESH; + } + + public FakePreparedStatement( + PrepareResponse prepareResponse, Map> paramTypes) { + super(prepareResponse, paramTypes, null, null); + this.initialPlan = PreparedQueryData.create(ApiFutures.immediateFuture(prepareResponse)); + // Don't expect an refresh using this configuration + this.planOnRefresh = null; + } + + FakePreparedStatement withUpdatedPlans( + PreparedQueryData initialPlan, PreparedQueryData planOnRefresh) { + this.initialPlan = initialPlan; + this.planOnRefresh = planOnRefresh; + return this; + } + + @Override + public PreparedQueryData getLatestPrepareResponse() { + Preconditions.checkState( + initialPlan != null, "Trying to refresh FakePreparedStatement without planOnRefresh set"); + return initialPlan; + } + + @Override + public synchronized PreparedQueryData markExpiredAndStartRefresh( + PreparedQueryVersion expiredPreparedQueryVersion) { + return planOnRefresh; + } + + @Override + public void assertUsingSameStub(EnhancedBigtableStub stub) {} + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java new file mode 100644 index 000000000000..cb2c068939af --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.PartialResultSet; +import com.google.bigtable.v2.ProtoRows; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public final class SqlProtoFactoryTest { + + @Test + public void serializedProtoRows_canRoundTrip() throws InvalidProtocolBufferException { + ExecuteQueryResponse response = + partialResultSetWithToken( + SqlProtoFactory.stringValue("string"), SqlProtoFactory.bytesValue("bytes")); + PartialResultSet results = response.getResults(); + + assertThat(results.getResumeToken()).isEqualTo(ByteString.copyFromUtf8("test")); + ProtoRows protoRows = ProtoRows.parseFrom(results.getProtoRowsBatch().getBatchData()); + assertThat(protoRows.getValuesCount()).isEqualTo(2); + assertThat(protoRows.getValuesList().get(0).getStringValue()).isEqualTo("string"); + assertThat(protoRows.getValuesList().get(1).getBytesValue()) + .isEqualTo(ByteString.copyFromUtf8("bytes")); + } + + @Test + public void testPlanRefreshError() { + ApiException planRefreshError = SqlProtoFactory.planRefreshError(); + assertThat(planRefreshError.getStatusCode().getCode()).isEqualTo(Code.FAILED_PRECONDITION); + ErrorDetails details = planRefreshError.getErrorDetails(); + assertThat(details.getPreconditionFailure()).isNotNull(); + assertThat(details.getPreconditionFailure().getViolationsList()).isNotEmpty(); + assertThat(details.getPreconditionFailure().getViolationsList().get(0).getType()) + .isEqualTo("PREPARED_QUERY_EXPIRED"); + assertThat(PlanRefreshingCallable.isPlanRefreshError(planRefreshError)).isTrue(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerSubject.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerSubject.java new file mode 100644 index 000000000000..6a6f2bc1d0f3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerSubject.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import javax.annotation.Nullable; + +/** Truth subject for {@link SqlRowMerger}. Intended for ease-of-use in testing. */ +final class SqlRowMergerSubject extends Subject { + + private final @Nullable SqlRowMerger actual; + + private SqlRowMergerSubject(FailureMetadata metadata, @Nullable SqlRowMerger actual) { + super(metadata, actual); + this.actual = actual; + } + + public static Factory sqlRowMerger() { + return SqlRowMergerSubject::new; + } + + public static SqlRowMergerSubject assertThat(@Nullable SqlRowMerger actual) { + return assertAbout(sqlRowMerger()).that(actual); + } + + public void hasPartialFrame(boolean expectation) { + if (expectation) { + check("hasPartialFrame()").that(actual.hasPartialFrame()).isTrue(); + } else { + check("hasPartialFrame()").that(actual.hasPartialFrame()).isFalse(); + } + } + + public void hasFullFrame(boolean expectation) { + if (expectation) { + check("hasFullFrame()").that(actual.hasFullFrame()).isTrue(); + } else { + check("hasFullFrame()").that(actual.hasFullFrame()).isFalse(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java new file mode 100644 index 000000000000..d61d9d5f2056 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java @@ -0,0 +1,323 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.internal.SqlRowSubject.assertThat; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.bytesValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapElement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.mapValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSets; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.tokenOnlyResultSet; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMergerSubject.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.PartialResultSet; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SqlRowMergerTest { + + static Supplier toSupplier( + com.google.bigtable.v2.ResultSetMetadata metadataProto) { + return () -> ProtoResultSetMetadata.fromProto(metadataProto); + } + + @Test + public void sqlRowMerger_handlesEmptyState() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_handlesMetadata() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata( + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("strByteMap", mapType(stringType(), bytesType()))); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_doesntResolveMetadataUntilFirstPush() { + SqlRowMerger merger = + new SqlRowMerger( + () -> { + throw new RuntimeException("test"); + }); + + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + assertThrows( + RuntimeException.class, () -> merger.push(ExecuteQueryResponse.getDefaultInstance())); + } + + @Test + public void hasPartialFrame_trueWithPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + SqlRowMerger merger = new SqlRowMerger(() -> metadata); + // Initial response here has reset bit set + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + merger.push(responses.get(0)); + merger.push(responses.get(1)); + assertThat(merger).hasPartialFrame(true); + } + + @Test + public void hasPartialFrame_trueWithUncommittedBatch() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + assertThat(merger).hasPartialFrame(true); + } + + @Test + public void hasPartialFrame_trueWithFullRow() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + merger.push(partialResultSetWithToken(stringValue("test"), bytesValue("test"))); + assertThat(merger).hasPartialFrame(true); + } + + @Test + public void push_failsOnCompleteBatchWithIncompleteRow() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + assertThrows( + IllegalStateException.class, + () -> merger.push(partialResultSetWithToken(stringValue("test")))); + } + + @Test + public void hasFullFrame_trueWithFullRow() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + merger.push(partialResultSetWithToken(bytesValue("test"))); + assertThat(merger).hasFullFrame(true); + } + + @Test + public void hasFullFrame_falseWithIncompleteBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + SqlRowMerger merger = new SqlRowMerger(() -> metadata); + // Initial response here has reset bit set + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + merger.push(responses.get(0)); + merger.push(responses.get(1)); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void hasFullFrame_falseWithUncommittedBatches() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_handlesResponseStream() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata( + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("strByteMap", mapType(stringType(), bytesType()))); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataProto); + + // Three logical rows worth of values split across two responses + Value[] values = { + // first response + stringValue("test"), + bytesValue("bytes"), + arrayValue(stringValue("foo"), stringValue("bar")), + mapValue(mapElement(stringValue("key"), bytesValue("bytes"))), + stringValue("test2"), + // second response + bytesValue("bytes2"), + arrayValue(stringValue("foo2"), stringValue("bar2")), + mapValue(mapElement(stringValue("key2"), bytesValue("bytes2"))), + stringValue("test3"), + bytesValue("bytes3"), + arrayValue(stringValue("foo3"), stringValue("bar3")), + mapValue(mapElement(stringValue("key3"), bytesValue("bytes3"))) + }; + merger.push(partialResultSetWithoutToken(Arrays.copyOf(values, 5))); + merger.push(partialResultSetWithToken(Arrays.copyOfRange(values, 5, 12))); + assertThat(merger.pop()) + .isEqualTo(ProtoSqlRow.create(metadata, ImmutableList.copyOf(Arrays.copyOf(values, 4)))); + assertThat(merger.pop()) + .isEqualTo( + ProtoSqlRow.create(metadata, ImmutableList.copyOf(Arrays.copyOfRange(values, 4, 8)))); + assertThat(merger.pop()) + .isEqualTo( + ProtoSqlRow.create(metadata, ImmutableList.copyOf(Arrays.copyOfRange(values, 8, 12)))); + } + + @Test + public void sqlRowMerger_handlesReset() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + SqlRowMerger merger = new SqlRowMerger(() -> metadata); + // Initial response here has reset bit set + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + merger.push(responses.get(0)); + merger.push(responses.get(1)); + assertThat(merger).hasPartialFrame(true); + assertThat(merger).hasFullFrame(false); + + for (ExecuteQueryResponse res : responses) { + merger.push(res); + } + assertThat(merger).hasFullFrame(true); + assertThat(merger.pop()) + .isEqualTo(ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("foo")))); + assertThat(merger.pop()) + .isEqualTo(ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("bar")))); + assertThat(merger.pop()) + .isEqualTo(ProtoSqlRow.create(metadata, ImmutableList.of(stringValue("baz")))); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_throwsExceptionOnChecksumMismatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto(metadata(columnMetadata("a", stringType()))); + SqlRowMerger merger = new SqlRowMerger(() -> metadata); + List responses = + partialResultSets(3, stringValue("foo"), stringValue("bar"), stringValue("baz")); + + // Override the checksum of the final response + PartialResultSet lastResultsWithBadChecksum = + responses.get(2).getResults().toBuilder().setBatchChecksum(1234).build(); + ExecuteQueryResponse badChecksum = + ExecuteQueryResponse.newBuilder().setResults(lastResultsWithBadChecksum).build(); + merger.push(responses.get(0)); + merger.push(responses.get(1)); + assertThrows(IllegalStateException.class, () -> merger.push(badChecksum)); + } + + @Test + public void sqlRowMerger_handlesTokenWithUncommittedBatches() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataProto); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + merger.push(partialResultSetWithoutToken(bytesValue("test"))); + merger.push(tokenOnlyResultSet(ByteString.copyFromUtf8("token"))); + + assertThat(merger).hasPartialFrame(true); + assertThat(merger).hasFullFrame(true); + assertThat(merger.pop()) + .isEqualTo( + ProtoSqlRow.create( + metadata, ImmutableList.of(stringValue("test"), bytesValue("test")))); + } + + @Test + public void sqlRowMerger_handlesTokensWithNoData() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + merger.push(tokenOnlyResultSet(ByteString.copyFromUtf8("token1"))); + merger.push(tokenOnlyResultSet(ByteString.copyFromUtf8("token2"))); + merger.push(tokenOnlyResultSet(ByteString.copyFromUtf8("token3"))); + + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_handlesLeadingTokens() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataProto); + merger.push(tokenOnlyResultSet(ByteString.copyFromUtf8("token1"))); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + merger.push(partialResultSetWithToken(bytesValue("test"))); + + assertThat(merger).hasPartialFrame(true); + assertThat(merger).hasFullFrame(true); + assertThat(merger.pop()) + .isEqualTo( + ProtoSqlRow.create( + metadata, ImmutableList.of(stringValue("test"), bytesValue("test")))); + } + + @Test + public void addValue_failsOnMetadataResponse() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + + ExecuteQueryResponse deprecatedMetadataResponse = + ExecuteQueryResponse.newBuilder().setMetadata(metadataProto).build(); + assertThrows(IllegalStateException.class, () -> merger.push(deprecatedMetadataResponse)); + } + + @Test + public void pop_failsWhenQueueIsEmpty() { + com.google.bigtable.v2.ResultSetMetadata metadataProto = + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())); + SqlRowMerger merger = new SqlRowMerger(toSupplier(metadataProto)); + assertThrows(NullPointerException.class, merger::pop); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java new file mode 100644 index 000000000000..fd6f0e230238 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java @@ -0,0 +1,143 @@ +/* + * Copyright 2024 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.cloud.bigtable.data.v2.stub.sql; + +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.arrayValue; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.callContext; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.columnMetadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Type; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.int64Value; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.metadata; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.partialResultSetWithoutToken; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.preparedStatement; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringType; +import static com.google.cloud.bigtable.data.v2.stub.sql.SqlProtoFactory.stringValue; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.internal.PreparedStatementImpl; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * We have much more extensive testing of the row merging in {@link + * com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMergerTest}. The Callable is a simple wrapper + * around this, so we don't need to duplicate all of the tests. + */ +@RunWith(JUnit4.class) +public class SqlRowMergingCallableTest { + + @Test + public void testMerging() throws ExecutionException, InterruptedException { + ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList( + partialResultSetWithoutToken( + stringValue("foo"), + int64Value(1), + arrayValue(stringValue("foo"), stringValue("bar"))), + partialResultSetWithToken(stringValue("test"), int64Value(10), arrayValue()))); + + PreparedStatementImpl preparedStatement = + preparedStatement( + metadata( + columnMetadata("stringCol", stringType()), + columnMetadata("intCol", int64Type()), + columnMetadata("arrayCol", arrayType(stringType())))); + BoundStatement boundStatement = preparedStatement.bind().build(); + ResultSetMetadata metadata = + preparedStatement.getLatestPrepareResponse().prepareFuture().get().resultSetMetadata(); + SettableApiFuture mdFuture = SettableApiFuture.create(); + mdFuture.set(metadata); + SqlRowMergingCallable rowMergingCallable = new SqlRowMergingCallable(inner); + ServerStream results = rowMergingCallable.call(callContext(boundStatement, mdFuture)); + List resultsList = results.stream().collect(Collectors.toList()); + assertThat(resultsList) + .containsExactly( + ProtoSqlRow.create( + metadata, + Arrays.asList( + stringValue("foo"), + int64Value(1), + arrayValue(stringValue("foo"), stringValue("bar")))), + ProtoSqlRow.create( + metadata, Arrays.asList(stringValue("test"), int64Value(10), arrayValue()))); + } + + @Test + public void testError() throws ExecutionException, InterruptedException { + PreparedStatementImpl preparedStatement = + preparedStatement( + metadata( + columnMetadata("stringCol", stringType()), + columnMetadata("intCol", int64Type()), + columnMetadata("arrayCol", arrayType(stringType())))); + BoundStatement boundStatement = preparedStatement.bind().build(); + + // empty response is invalid + ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList(ExecuteQueryResponse.getDefaultInstance())); + + SqlRowMergingCallable rowMergingCallable = new SqlRowMergingCallable(inner); + SettableApiFuture mdFuture = SettableApiFuture.create(); + mdFuture.set( + preparedStatement.getLatestPrepareResponse().prepareFuture().get().resultSetMetadata()); + ServerStream results = rowMergingCallable.call(callContext(boundStatement)); + + assertThrows(IllegalStateException.class, () -> results.iterator().next()); + } + + @Test + public void testMetdataFutureError() { + PreparedStatement preparedStatement = + preparedStatement( + metadata( + columnMetadata("stringCol", stringType()), + columnMetadata("intCol", int64Type()), + columnMetadata("arrayCol", arrayType(stringType())))); + BoundStatement boundStatement = preparedStatement.bind().build(); + + // empty response is invalid + ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList(ExecuteQueryResponse.getDefaultInstance())); + + SqlRowMergingCallable rowMergingCallable = new SqlRowMergingCallable(inner); + SettableApiFuture mdFuture = SettableApiFuture.create(); + mdFuture.setException(new RuntimeException("test")); + ServerStream results = rowMergingCallable.call(callContext(boundStatement, mdFuture)); + + assertThrows(RuntimeException.class, () -> results.iterator().next()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java new file mode 100644 index 000000000000..7fb35308ea67 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java @@ -0,0 +1,185 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.common.collect.ImmutableSet; +import io.grpc.ManagedChannel; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; + +@RunWith(JUnit4.class) +public class BigtableChannelPoolSettingsTest { + + @Test + public void testToBigtableChannelPoolSettingsAllFieldsSetCopiesCorrectly() throws Exception { + ChannelPoolSettings originalSettings = + ChannelPoolSettings.builder() + .setMinRpcsPerChannel(10) + .setMaxRpcsPerChannel(50) + .setMinChannelCount(5) + .setMaxChannelCount(100) + .setInitialChannelCount(20) + .setPreemptiveRefreshEnabled(true) + .build(); + + BigtableChannelPoolSettings copiedSettings = + BigtableChannelPoolSettings.copyFrom(originalSettings); + assertSettingsCopiedCorrectly(originalSettings, copiedSettings); + } + + @Test + public void testEntryRetainReleaseByType() { + ManagedChannel mockChannel = Mockito.mock(ManagedChannel.class); + BigtableChannelPool.Entry entry = new BigtableChannelPool.Entry(mockChannel); + + // Test Unary + assertThat(entry.retain(false)).isTrue(); // Unary + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(1); + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(1); + // Test Unary release + entry.release(false); + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(0); + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + + // Test Streaming + assertThat(entry.retain(true)).isTrue(); // Streaming + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(0); + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(1); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(1); + // Test Streaming again + assertThat(entry.retain(true)).isTrue(); // Streaming again + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(2); + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(2); + + entry.release(true); + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(1); + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(1); + + entry.release(true); + assertThat(entry.outstandingStreamingRpcs.get()).isEqualTo(0); + assertThat(entry.outstandingUnaryRpcs.get()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + + // Test Error Counting + entry.incrementErrorCount(); + assertThat(entry.getAndResetErrorCount()).isEqualTo(1); + assertThat(entry.getAndResetErrorCount()).isEqualTo(0); // Should be reset + + entry.incrementErrorCount(); + entry.incrementErrorCount(); + assertThat(entry.getAndResetErrorCount()).isEqualTo(2); + assertThat(entry.getAndResetErrorCount()).isEqualTo(0); + + // Test Success Counting + entry.incrementSuccessCount(); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(1); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); // Should be reset + + entry.incrementSuccessCount(); + entry.incrementSuccessCount(); + entry.incrementSuccessCount(); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(3); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + + // Test Mixed Error and Success Counting + entry.incrementErrorCount(); + entry.incrementSuccessCount(); + entry.incrementSuccessCount(); + entry.incrementErrorCount(); + entry.incrementSuccessCount(); + + assertThat(entry.getAndResetErrorCount()).isEqualTo(2); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(3); + + // Verify reset after mixed + assertThat(entry.getAndResetErrorCount()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + + // Ensure retain/release doesn't affect error/success counts + entry.incrementErrorCount(); + entry.retain(false); + entry.release(false); + assertThat(entry.getAndResetErrorCount()).isEqualTo(1); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + } + + @Test + public void testToBigtableChannelPoolSettingsDefaultValuesCopiesCorrectly() throws Exception { + ChannelPoolSettings originalSettings = ChannelPoolSettings.builder().build(); + BigtableChannelPoolSettings copiedSettings = + BigtableChannelPoolSettings.copyFrom(originalSettings); + assertSettingsCopiedCorrectly(originalSettings, copiedSettings); + } + + private void assertSettingsCopiedCorrectly( + ChannelPoolSettings originalSettings, BigtableChannelPoolSettings copiedSettings) + throws Exception { + + Set supportedGetters = + ImmutableSet.of( + "getMinRpcsPerChannel", + "getMaxRpcsPerChannel", + "getMinChannelCount", + "getMaxChannelCount", + "getInitialChannelCount", + "isPreemptiveRefreshEnabled", + "isStaticSize"); + + Set actualGetters = + Arrays.stream(ChannelPoolSettings.class.getDeclaredMethods()) + .filter( + method -> + Modifier.isPublic(method.getModifiers()) + && Modifier.isAbstract(method.getModifiers()) + && (method.getName().startsWith("get") + || method.getName().startsWith("is"))) + .map(Method::getName) + .collect(Collectors.toSet()); + + // If this fails then we need to add support for the additional attributes on the gax + // ChannelPool by updating the BigtableChannelPoolSettings.copyFrom method + assertThat(supportedGetters).containsAtLeastElementsIn(actualGetters); + + assertThat(originalSettings.getInitialChannelCount()) + .isEqualTo(copiedSettings.getInitialChannelCount()); + assertThat(originalSettings.getMaxChannelCount()) + .isEqualTo(copiedSettings.getMaxChannelCount()); + assertThat(originalSettings.getMinChannelCount()) + .isEqualTo(copiedSettings.getMinChannelCount()); + assertThat(originalSettings.getMaxRpcsPerChannel()) + .isEqualTo(copiedSettings.getMaxRpcsPerChannel()); + assertThat(originalSettings.getMinRpcsPerChannel()) + .isEqualTo(copiedSettings.getMinRpcsPerChannel()); + assertThat(originalSettings.getInitialChannelCount()) + .isEqualTo(copiedSettings.getInitialChannelCount()); + assertThat(originalSettings.isPreemptiveRefreshEnabled()) + .isEqualTo(copiedSettings.isPreemptiveRefreshEnabled()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolTest.java new file mode 100644 index 000000000000..6719a70d89c0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolTest.java @@ -0,0 +1,236 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +import com.google.common.collect.Iterables; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class BigtableChannelPoolTest { + @Rule public final MockitoRule mockito = MockitoJUnit.rule(); + + @Mock private Supplier mockChannelFactory; + @Mock private ChannelPrimer mockChannelPrimer; + @Mock private ManagedChannel mockChannel; + @Mock private ClientCall mockClientCall; + + private MethodDescriptor unaryMethodDescriptor; + private MethodDescriptor streamingMethodDescriptor; + + @Captor private ArgumentCaptor> listenerCaptor; + + private BigtableChannelPool channelPool; + private ScheduledExecutorService executorService; + + private static class StringMarshaller implements MethodDescriptor.Marshaller { + @Override + public InputStream stream(String value) { + return null; // Not used in this test + } + + @Override + public String parse(InputStream stream) { + return null; // Not used in this test + } + } + + @Before + public void setUp() throws IOException { + when(mockChannelFactory.get()).thenReturn(mockChannel); + when(mockChannel.newCall( + ArgumentMatchers.>any(), any(CallOptions.class))) + .thenReturn(mockClientCall); + // Setup MethodDescriptors + // Initialize real MethodDescriptor instances + MethodDescriptor.Marshaller marshaller = new StringMarshaller(); + unaryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName(MethodDescriptor.generateFullMethodName("bigtable", "MutateRow")) + .setRequestMarshaller(marshaller) + .setResponseMarshaller(marshaller) + .build(); + + streamingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(MethodDescriptor.generateFullMethodName("bigtable", "ReadRows")) + .setRequestMarshaller(marshaller) + .setResponseMarshaller(marshaller) + .build(); + + executorService = Executors.newSingleThreadScheduledExecutor(); + + BigtableChannelPoolSettings settings = + BigtableChannelPoolSettings.builder() + .setInitialChannelCount(1) + .setMinChannelCount(1) + .setMaxChannelCount(1) + .build(); + channelPool = + new BigtableChannelPool(settings, mockChannelFactory, mockChannelPrimer, executorService); + + // Capture the listener when start is called + // Configure mockClientCall.start to capture the listener + doNothing().when(mockClientCall).start(listenerCaptor.capture(), any(Metadata.class)); + } + + private BigtableChannelPool.Entry getSingleEntry() { + List infos = channelPool.getChannelInfos(); + return (BigtableChannelPool.Entry) Iterables.getOnlyElement(infos); + } + + private ClientCall.Listener startCall(MethodDescriptor method) { + ClientCall call = channelPool.newCall(method, CallOptions.DEFAULT); + call.start(mock(ClientCall.Listener.class), new Metadata()); + return listenerCaptor.getValue(); + } + + @Test + public void testUnaryRpcSuccess() { + BigtableChannelPool.Entry entry = getSingleEntry(); + + // Before call + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(0); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + + ClientCall.Listener listener = startCall(unaryMethodDescriptor); + + // After start + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(1); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(1); + + // Simulate call success + listener.onClose(Status.OK, new Metadata()); + + // After close + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(0); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(1); + assertThat(entry.getAndResetErrorCount()).isEqualTo(0); + } + + @Test + public void testUnaryRpcFailure() { + BigtableChannelPool.Entry entry = getSingleEntry(); + ClientCall.Listener listener = startCall(unaryMethodDescriptor); + + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(1); + + // Simulate call failure + listener.onClose(Status.UNAVAILABLE, new Metadata()); + + // After close + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + assertThat(entry.getAndResetErrorCount()).isEqualTo(1); + } + + @Test + public void testStreamingRpcSuccess() { + BigtableChannelPool.Entry entry = getSingleEntry(); + + ClientCall.Listener listener = startCall(streamingMethodDescriptor); + + // After start + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(0); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(1); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(1); + + // Simulate call success + listener.onClose(Status.OK, new Metadata()); + + // After close + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(1); + assertThat(entry.getAndResetErrorCount()).isEqualTo(0); + } + + @Test + public void testStreamingRpcFailure() { + BigtableChannelPool.Entry entry = getSingleEntry(); + ClientCall.Listener listener = startCall(streamingMethodDescriptor); + + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(1); + + // Simulate call failure + listener.onClose(Status.DEADLINE_EXCEEDED, new Metadata()); + + // After close + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + assertThat(entry.getAndResetErrorCount()).isEqualTo(1); + } + + @Test + public void testMixedRpcs() { + BigtableChannelPool.Entry entry = getSingleEntry(); + + // 1 Unary OK + startCall(unaryMethodDescriptor).onClose(Status.OK, new Metadata()); + // 1 Unary Fail + startCall(unaryMethodDescriptor).onClose(Status.INTERNAL, new Metadata()); + // 1 Streaming OK + startCall(streamingMethodDescriptor).onClose(Status.OK, new Metadata()); + // 2 Streaming Fail + startCall(streamingMethodDescriptor).onClose(Status.CANCELLED, new Metadata()); + ClientCall.Listener streamingListener = startCall(streamingMethodDescriptor); + + // Before the last one closes + assertThat(entry.getOutstandingUnaryRpcs()).isEqualTo(0); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(1); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(2); // 1 Unary + 1 Streaming + assertThat(entry.getAndResetErrorCount()).isEqualTo(2); // 1 Unary + 1 Streaming + + // Close the last one + streamingListener.onClose(Status.UNKNOWN, new Metadata()); + assertThat(entry.getOutstandingStreamingRpcs()).isEqualTo(0); + assertThat(entry.getAndResetSuccessCount()).isEqualTo(0); + assertThat(entry.getAndResetErrorCount()).isEqualTo(1); // The last failure + assertThat(entry.totalOutstandingRpcs()).isEqualTo(0); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java new file mode 100644 index 000000000000..aaa68b175d7f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -0,0 +1,189 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPoolHealthChecker.ProbeResult; +import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.ListeningScheduledExecutorService; +import com.google.common.util.concurrent.testing.TestingExecutors; +import io.grpc.ManagedChannel; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class ChannelPoolHealthCheckerTest { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); + @Mock private BigtableChannelPrimer mockPrimer; + private ListeningScheduledExecutorService executor; + private FakeClock fakeClock; + private ChannelPoolHealthChecker healthChecker; + private List channelList; + + @Before + public void setUp() { + executor = TestingExecutors.sameThreadScheduledExecutor(); + channelList = new ArrayList<>(); + Supplier> entrySupplier = () -> ImmutableList.copyOf(channelList); + + fakeClock = new FakeClock(Instant.parse("2025-08-01T10:00:00Z")); + healthChecker = new ChannelPoolHealthChecker(entrySupplier, mockPrimer, executor, fakeClock); + } + + // Helper method to create test entries + private Entry createTestEntry() { + ManagedChannel mockChannel = Mockito.mock(ManagedChannel.class); + return new Entry(mockChannel); + } + + @After + public void tearDown() { + executor.shutdownNow(); + } + + @Test + public void testOnComplete_successUpdatesCounters() { + Entry entry = createTestEntry(); + channelList.add(entry); + + SettableApiFuture successFuture = SettableApiFuture.create(); + Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel())) + .thenReturn(successFuture); + + healthChecker.runProbes(); + + successFuture.set(PingAndWarmResponse.getDefaultInstance()); + + assertThat(entry.successfulProbesInWindow.get()).isEqualTo(1); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testOnComplete_cancellationIsFailure() { + Entry entry = createTestEntry(); + channelList.add(entry); + + SettableApiFuture hangingFuture = SettableApiFuture.create(); + Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel())) + .thenReturn(hangingFuture); + + healthChecker.runProbes(); + + hangingFuture.cancel(true); + + assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); + assertThat(entry.successfulProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testPruning_removesOldProbesAndCounters() { + Entry entry = createTestEntry(); + healthChecker.addProbeResult(entry, ProbeResult.create(fakeClock.instant(), false)); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); + + fakeClock.increment(Duration.ofMinutes(6)); + healthChecker.pruneHistory(entry); // Manually call for direct testing + + assertThat(entry.probeHistory).isEmpty(); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testEviction_selectsUnhealthyChannel() { + Entry healthyEntry = createTestEntry(); + Entry badEntry = createTestEntry(); + Entry worseEntry = createTestEntry(); + + // A channel needs at least 4 probes to be considered for eviction + healthyEntry.successfulProbesInWindow.set(10); // 0% failure -> healthy + badEntry.failedProbesInWindow.set(3); // 3/13 = 23% failure -> healthy + badEntry.successfulProbesInWindow.set(10); + worseEntry.failedProbesInWindow.set(10); // 10/10 = 100% failure -> unhealthy + + channelList.addAll(Arrays.asList(healthyEntry, badEntry, worseEntry)); + + healthChecker.detectAndRemoveOutlierEntries(); + + // Assert that only the unhealthy channel was evicted + Mockito.verify(worseEntry.getManagedChannel()).enterIdle(); + Mockito.verify(badEntry.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(healthyEntry.getManagedChannel(), Mockito.never()).enterIdle(); + } + + @Test + public void testEviction_selectsMostUnhealthyChannel() { + Entry healthyEntry = createTestEntry(); + Entry badEntry = createTestEntry(); + Entry worseEntry = createTestEntry(); + + // A channel needs at least 4 probes to be considered for eviction + healthyEntry.successfulProbesInWindow.set(10); // 0% failure -> healthy + badEntry.failedProbesInWindow.set(8); // 8/13 = 61% failure -> unhealthy + badEntry.successfulProbesInWindow.set(10); + worseEntry.failedProbesInWindow.set(10); // 10/10 = 100% failure -> most unhealthy + + channelList.addAll(Arrays.asList(healthyEntry, badEntry, worseEntry)); + + healthChecker.detectAndRemoveOutlierEntries(); + + // Assert that only the unhealthy channel was evicted + Mockito.verify(worseEntry.getManagedChannel()).enterIdle(); + Mockito.verify(badEntry.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(healthyEntry.getManagedChannel(), Mockito.never()).enterIdle(); + } + + @Test + public void testCircuitBreaker_preventsEviction() { + Entry entry1 = createTestEntry(); + Entry entry2 = createTestEntry(); + Entry entry3 = createTestEntry(); + channelList.addAll(Arrays.asList(entry1, entry2, entry3)); + + // Set failure counts to exceed 60% SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD with at least + // MIN_PROBES_FOR_EVALUATION (4) failures + for (Entry entry : channelList) { + entry.failedProbesInWindow.set(4); // 4 failures, 0 successes = 100% failure rate + } + + healthChecker.detectAndRemoveOutlierEntries(); + + // The circuit breaker should engage because 3/3 channels (100%) are unhealthy, + // which is greater than the 70% POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT threshold. + Mockito.verify(entry1.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(entry2.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(entry3.getManagedChannel(), Mockito.never()).enterIdle(); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java new file mode 100644 index 000000000000..5e8e00b040c3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java @@ -0,0 +1,25 @@ +/* + * Copyright 2025 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.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; + +@InternalApi +public interface HealthChecker { + void start(); + + void stop(); +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java new file mode 100644 index 000000000000..6adc71cae0c0 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.reframing; + +import static com.google.common.truth.Truth.assertWithMessage; + +import com.google.api.gax.rpc.StreamController; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable.StreamControllerStash; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockResponseObserver; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCall; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockServerStreamingCallable; +import com.google.cloud.bigtable.gaxx.testing.MockStreamingApi.MockStreamController; +import com.google.common.base.Joiner; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Queues; +import com.google.common.truth.Truth; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mockito; + +@RunWith(JUnit4.class) +public class ReframingResponseObserverTest { + private ExecutorService executor; + + @Before + public void setUp() throws Exception { + executor = Executors.newCachedThreadPool(); + } + + @After + public void tearDown() throws Exception { + executor.shutdownNow(); + } + + @Test + public void testUnsolicitedResponseError() throws Exception { + // Have the outer observer request manual flow control + MockResponseObserver outerObserver = new MockResponseObserver<>(false); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + MockServerStreamingCallable innerCallable = new MockServerStreamingCallable<>(); + + innerCallable.call("request", middleware); + MockServerStreamingCall lastCall = innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + // Nothing was requested by the outer observer (thats also in manual flow control) + Preconditions.checkState(innerController.popLastPull() == 0); + + Throwable error = null; + try { + // send an unsolicited response + innerController.getObserver().onResponse("a"); + } catch (Throwable t) { + error = t; + } + + Truth.assertThat(error).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testConcurrentRequestAfterClose() throws Exception { + // Have the outer observer request manual flow control + GatedMockResponseObserver outerObserver = new GatedMockResponseObserver(false); + outerObserver.completeBreakpoint.enable(); + + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + MockServerStreamingCallable innerCallable = new MockServerStreamingCallable<>(); + + innerCallable.call("request", middleware); + + MockServerStreamingCall lastCall = innerCallable.popLastCall(); + final MockStreamController innerController = lastCall.getController(); + + // Asynchronously start the delivery loop for a completion by notifying the innermost + // observer, which will bubble up to the outer GatedMockResponseObserver and hit the + // completeBreakpoint. + Future completeFuture = + executor.submit( + new Runnable() { + @Override + public void run() { + innerController.getObserver().onComplete(); + } + }); + + // Wait until the delivery loop started in the other thread. + outerObserver.completeBreakpoint.awaitArrival(); + // Concurrently request the next message. + outerObserver.getController().request(1); + // Resume the other thread + outerObserver.completeBreakpoint.release(); + + // Should have no errors delivered. + Truth.assertThat(outerObserver.getFinalError()).isNull(); + + // Should have no errors thrown. + Throwable error = null; + try { + completeFuture.get(); + } catch (ExecutionException e) { + error = e.getCause(); + } + Truth.assertThat(error).isNull(); + } + + @Test + public void testOneToOne() throws InterruptedException { + // Have the outer observer request manual flow control + MockResponseObserver outerObserver = new MockResponseObserver<>(false); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a")); + + innerCallable.call("request", middleware); + + // simple path: downstream requests 1 response, the request is proxied to upstream & upstream + // delivers. + outerObserver.getController().request(1); + + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.isDone()).isTrue(); + } + + @Test + public void testOneToOneAuto() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a", "b")); + innerCallable.call("request", middleware); + + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("b"); + Truth.assertThat(outerObserver.isDone()).isTrue(); + } + + @Test + public void testManyToOne() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(false); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a-b")); + innerCallable.call("request", middleware); + + Preconditions.checkState(outerObserver.popNextResponse() == null); + + // First downstream request makes the upstream over produce + outerObserver.getController().request(1); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo(null); + Truth.assertThat(outerObserver.isDone()).isFalse(); + + // Next downstream request should fetch from buffer + outerObserver.getController().request(1); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("b"); + + // Make sure completion is delivered + Truth.assertThat(outerObserver.isDone()).isTrue(); + } + + @Test + public void testManyToOneAuto() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a-b")); + innerCallable.call("request", middleware); + + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("b"); + Truth.assertThat(outerObserver.isDone()).isTrue(); + } + + @Test + public void testManyToOneCancelEarly() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(false); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(1)); + MockServerStreamingCallable innerCallable = new MockServerStreamingCallable<>(); + innerCallable.call("request", middleware); + + MockServerStreamingCall lastCall = innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + outerObserver.getController().request(1); + innerController.getObserver().onResponse("a-b"); + + outerObserver.popNextResponse(); + outerObserver.getController().cancel(); + + Truth.assertThat(innerController.isCancelled()).isTrue(); + innerController.getObserver().onError(new RuntimeException("Some other upstream error")); + + Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(CancellationException.class); + } + + @Test + public void testOneToMany() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(false); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(2)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a", "b")); + innerCallable.call("request", middleware); + + Preconditions.checkState(outerObserver.popNextResponse() == null); + outerObserver.getController().request(1); + + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a-b"); + Truth.assertThat(outerObserver.isDone()).isTrue(); + Truth.assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void testOneToManyAuto() throws InterruptedException { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(2)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a", "b")); + innerCallable.call("request", middleware); + + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a-b"); + Truth.assertThat(outerObserver.isDone()).isTrue(); + Truth.assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void testOneToManyIncomplete() { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(2)); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a")); + innerCallable.call("request", middleware); + + // Make sure completion is delivered + Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(IncompleteStreamException.class); + } + + @Test + public void testConcurrentCancel() throws InterruptedException { + final MockResponseObserver outerObserver = new MockResponseObserver<>(true); + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, new DasherizingReframer(2)); + MockServerStreamingCallable innerCallable = new MockServerStreamingCallable<>(); + + innerCallable.call("request", middleware); + MockServerStreamingCall lastCall = innerCallable.popLastCall(); + final MockStreamController innerController = lastCall.getController(); + + final CountDownLatch latch = new CountDownLatch(2); + + @SuppressWarnings("UnusedVariable") + Future ignored = + executor.submit( + () -> { + while (!outerObserver.isDone()) { + outerObserver.popNextResponse(); + } + latch.countDown(); + }); + + @SuppressWarnings("UnusedVariable") + Future ignored2 = + executor.submit( + new Runnable() { + @Override + public void run() { + while (!innerController.isCancelled()) { + if (innerController.popLastPull() > 0) { + innerController.getObserver().onResponse("a"); + } + } + innerController + .getObserver() + .onError(new RuntimeException("Some other upstream error")); + latch.countDown(); + } + }); + + outerObserver.getController().cancel(); + + Truth.assertThat(latch.await(1, TimeUnit.MINUTES)).isTrue(); + } + + @Test + public void testReframerPushError() throws Exception { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + Reframer reframer = + new DasherizingReframer(1) { + @Override + public void push(String response) { + if ("boom".equals(response)) { + throw new IllegalStateException("fake error"); + } + super.push(response); + } + }; + + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, reframer); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a", "boom", "c")); + + innerCallable.call("request", middleware); + + Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class); + Truth.assertThat(outerObserver.getFinalError()).hasMessageThat().isEqualTo("fake error"); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.popNextResponse()).isNull(); + } + + @Test + public void testReframerPopError() { + final AtomicInteger popCount = new AtomicInteger(); + + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + Reframer reframer = + new DasherizingReframer(1) { + @Override + public String pop() { + if (popCount.incrementAndGet() == 2) { + throw new IllegalStateException("fake error"); + } + return super.pop(); + } + }; + + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, reframer); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(ImmutableList.of("a", "boom", "c")); + + innerCallable.call("request", middleware); + StreamControllerStash lastCall = innerCallable.popLastCall(); + + Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class); + Truth.assertThat(outerObserver.getFinalError()).hasMessageThat().isEqualTo("fake error"); + Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a"); + Truth.assertThat(outerObserver.popNextResponse()).isNull(); + Truth.assertThat(popCount.get()).isEqualTo(2); + + Truth.assertThat(lastCall.getError()).isInstanceOf(CancellationException.class); + Truth.assertThat(lastCall.getNumDelivered()).isEqualTo(2); + } + + /** + * Test the scenario where the reframer throws an exception on incoming data and the upstream + * throws an exception during cleanup when cancel is called. + */ + @Test + public void testFailedRecoveryHandling() { + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + final RuntimeException fakeReframerError = new RuntimeException("fake reframer error"); + + Reframer brokenReframer = + new Reframer() { + @Override + public void push(String ignored) { + throw fakeReframerError; + } + + @Override + public boolean hasFullFrame() { + return false; + } + + @Override + public boolean hasPartialFrame() { + return false; + } + + @Override + public String pop() { + throw new IllegalStateException("should not be called"); + } + }; + ReframingResponseObserver middleware = + new ReframingResponseObserver<>(outerObserver, brokenReframer); + + // Configure the mock inner controller to fail cancellation. + StreamController mockInnerController = Mockito.mock(StreamController.class); + RuntimeException fakeCancelError = new RuntimeException("fake cancel error"); + Mockito.doThrow(fakeCancelError).when(mockInnerController).cancel(); + + // Jumpstart a call & feed it data + middleware.onStartImpl(mockInnerController); + middleware.onResponseImpl("1"); + + // Make sure that the outer observer was notified with the reframer, which contains a suppressed + // cancellation error. + Throwable finalError = outerObserver.getFinalError(); + Truth.assertThat(finalError).isSameInstanceAs(fakeReframerError); + Truth.assertThat(ImmutableList.of(finalError.getSuppressed())).hasSize(1); + Truth.assertThat(finalError.getSuppressed()[0]).isInstanceOf(IllegalStateException.class); + Truth.assertThat(finalError.getSuppressed()[0]) + .hasMessageThat() + .isEqualTo("Failed to cancel upstream while recovering from an unexpected error"); + Truth.assertThat(finalError.getSuppressed()[0].getCause()).isSameInstanceAs(fakeCancelError); + } + + /** + * Test race between a request() and onComplete (b/295866356). This will stress the concurrency + * primitives in deliver() by running a many iterations across many threads. Some race conditions + * are very subtle and are very rare, so bugs in the implementation would present themselves as + * flakes in this test. All flakes of this test should be investigated as a failure. + */ + @Test + public void testRequestAndCompleteRaceCondition() throws Throwable { + int concurrency = 20; + int iterations = 20_000; + + ExecutorService executor = Executors.newFixedThreadPool(concurrency); + + List> results = new ArrayList<>(); + + for (int i = 0; i < concurrency; i++) { + Future result = + executor.submit( + (Callable) + () -> { + for (int j = 0; j < iterations; j++) { + requestAndCompleteRaceConditionIteration(); + } + return null; + }); + results.add(result); + } + + executor.shutdown(); + + for (Future result : results) { + try { + result.get(); + } catch (ExecutionException e) { + throw e.getCause(); + } + } + } + + private static void requestAndCompleteRaceConditionIteration() + throws InterruptedException, ExecutionException { + MockStreamingApi.MockResponseObserver observer = + new MockStreamingApi.MockResponseObserver<>(false); + ReframingResponseObserver underTest = + new ReframingResponseObserver<>( + observer, new ReframingResponseObserverTest.DasherizingReframer(1)); + + // This is intentionally not a Phaser, the Phaser seems to drastically reduce the reproduction + // rate of the + // original race condition. + CountDownLatch readySignal = new CountDownLatch(2); + CompletableFuture startSignal = new CompletableFuture<>(); + + ExecutorService executor = Executors.newFixedThreadPool(2); + + Future f1 = + executor.submit( + () -> { + // no setup, tell controller thread we are ready and wait for the start signal + readySignal.countDown(); + startSignal.get(); + + // Race start + underTest.onComplete(); + // Race end + + return null; + }); + + Future f2 = + executor.submit( + () -> { + // Setup before race - simulate that the ServerStream iterator got one row and is now + // checking if there + // is another. This is the lead up to the race with grpc's onComplete + underTest.onStart( + new StreamController() { + @Override + public void cancel() {} + + @Override + public void disableAutoInboundFlowControl() {} + + @Override + public void request(int count) {} + }); + observer.getController().request(1); + underTest.onResponse("moo"); + + // Setup complete, tell controller thread we are ready and wait for the start signal + readySignal.countDown(); + startSignal.get(); + + // Race start + observer.getController().request(1); + // Race end + + return null; + }); + executor.shutdown(); + + // Wait for worker setup + readySignal.await(); + // Tell workers to race + startSignal.complete(null); + + // Wait workers to finish + f1.get(); + f2.get(); + + // the outer observer should be told of the completion of rpc + assertWithMessage("outer observer should not hang").that(observer.isDone()).isTrue(); + } + + /** + * A simple implementation of a {@link Reframer}. The input string is split by dash, and the + * output is concatenated by dashes. The test can verify M:N behavior by adjusting the + * partsPerResponse parameter and the number of dashes in the input. + */ + static class DasherizingReframer implements Reframer { + final Queue buffer = Queues.newArrayDeque(); + final int partsPerResponse; + + DasherizingReframer(int partsPerResponse) { + this.partsPerResponse = partsPerResponse; + } + + @Override + public void push(String response) { + buffer.addAll(Arrays.asList(response.split("-"))); + } + + @Override + public boolean hasFullFrame() { + return buffer.size() >= partsPerResponse; + } + + @Override + public boolean hasPartialFrame() { + return !buffer.isEmpty(); + } + + @Override + public String pop() { + String[] parts = new String[partsPerResponse]; + + for (int i = 0; i < partsPerResponse; i++) { + parts[i] = buffer.poll(); + } + return Joiner.on("-").join(parts); + } + } + + static class GatedMockResponseObserver extends MockResponseObserver { + final Breakpoint completeBreakpoint = new Breakpoint(); + final Breakpoint errorBreakpoint = new Breakpoint(); + + public GatedMockResponseObserver(boolean autoFlowControl) { + super(autoFlowControl); + } + + @Override + protected void onErrorImpl(Throwable t) { + super.onErrorImpl(t); + errorBreakpoint.arrive(); + } + + @Override + protected void onCompleteImpl() { + super.onCompleteImpl(); + completeBreakpoint.arrive(); + } + } + + static class Breakpoint { + private volatile CountDownLatch arriveLatch = new CountDownLatch(0); + private volatile CountDownLatch leaveLatch = new CountDownLatch(0); + + public void enable() { + arriveLatch = new CountDownLatch(1); + leaveLatch = new CountDownLatch(1); + } + + public void arrive() { + arriveLatch.countDown(); + try { + leaveLatch.await(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + void awaitArrival() { + try { + arriveLatch.await(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + public void release() { + leaveLatch.countDown(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java new file mode 100644 index 000000000000..51c4f378807c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.testing; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.StatusCode; + +@InternalApi("for testing") +public class FakeStatusCode implements StatusCode { + private final Code code; + + public FakeStatusCode(Code code) { + this.code = code; + } + + @Override + public Code getCode() { + return code; + } + + @Override + public Code getTransportCode() { + return getCode(); + } + + @Override + @SuppressWarnings("EqualsGetClass") + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + FakeStatusCode that = (FakeStatusCode) o; + + return code == that.code; + } + + @Override + public int hashCode() { + return code != null ? code.hashCode() : 0; + } + + public static FakeStatusCode of(Code code) { + return new FakeStatusCode(code); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStreamingApi.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStreamingApi.java new file mode 100644 index 000000000000..20c3a766372f --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStreamingApi.java @@ -0,0 +1,238 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.testing; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.StreamController; +import com.google.common.base.Preconditions; +import com.google.common.collect.Queues; +import java.util.ArrayList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; + +@InternalApi("for testing") +public class FakeStreamingApi { + public static class ServerStreamingStashCallable + extends ServerStreamingCallable { + private ApiCallContext context; + private ResponseObserver actualObserver; + private RequestT actualRequest; + private List responseList; + private final BlockingQueue> calls = + Queues.newLinkedBlockingQueue(); + + public ServerStreamingStashCallable() { + responseList = new ArrayList<>(); + } + + public ServerStreamingStashCallable(List responseList) { + this.responseList = responseList; + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + Preconditions.checkNotNull(request); + Preconditions.checkNotNull(responseObserver); + this.actualRequest = request; + this.actualObserver = responseObserver; + this.context = context; + + StreamControllerStash controller = + new StreamControllerStash<>(responseList, responseObserver); + calls.add(controller); + controller.start(); + } + + public StreamControllerStash popLastCall() { + try { + return calls.poll(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } + } + + public ApiCallContext getContext() { + return context; + } + + public ResponseObserver getActualObserver() { + return actualObserver; + } + + public RequestT getActualRequest() { + return actualRequest; + } + + // Minimal implementation of back pressure aware stream controller. Not threadsafe + public static class StreamControllerStash implements StreamController { + final ResponseObserver observer; + final Queue queue; + boolean autoFlowControl = true; + long numPending; + long numDelivered; + Throwable error; + boolean delivering, closed; + + public StreamControllerStash( + List responseList, ResponseObserver observer) { + this.observer = observer; + this.queue = Queues.newArrayDeque(responseList); + } + + public Throwable getError() { + return error; + } + + public long getNumDelivered() { + return numDelivered; + } + + public void start() { + observer.onStart(this); + if (autoFlowControl) { + numPending = Integer.MAX_VALUE; + } + deliver(); + } + + @Override + public void disableAutoInboundFlowControl() { + autoFlowControl = false; + } + + @Override + public void request(int count) { + numPending += count; + deliver(); + } + + @Override + public void cancel() { + error = new CancellationException("User cancelled stream"); + deliver(); + } + + private void deliver() { + if (delivering || closed) return; + delivering = true; + + try { + while (error == null && numPending > 0 && !queue.isEmpty()) { + numPending--; + numDelivered++; + observer.onResponse(queue.poll()); + } + + if (error != null || queue.isEmpty()) { + if (error != null) { + observer.onError(error); + } else { + observer.onComplete(); + } + closed = true; + } + } finally { + delivering = false; + } + } + } + } + + public static class ClientStreamingStashCallable + extends ClientStreamingCallable { + private ApiCallContext context; + private ApiStreamObserver responseObserver; + private AccumulatingStreamObserver requestObserver; + private ResponseT response; + + public ClientStreamingStashCallable() {} + + public ClientStreamingStashCallable(ResponseT response) { + this.response = response; + } + + @Override + public ApiStreamObserver clientStreamingCall( + ApiStreamObserver responseObserver, ApiCallContext context) { + Preconditions.checkNotNull(responseObserver); + this.responseObserver = responseObserver; + this.context = context; + this.requestObserver = new AccumulatingStreamObserver<>(); + return requestObserver; + } + + public ApiCallContext getContext() { + return context; + } + + public ApiStreamObserver getActualObserver() { + return responseObserver; + } + + public List getActualRequests() { + return requestObserver.getValues(); + } + + private void sendResponses() { + responseObserver.onNext(response); + responseObserver.onCompleted(); + } + + private class AccumulatingStreamObserver implements ApiStreamObserver { + private List requestList = new ArrayList<>(); + private Throwable error; + private boolean completed = false; + + @Override + public void onNext(T value) { + requestList.add(value); + } + + @Override + public void onError(Throwable t) { + error = t; + } + + @Override + public void onCompleted() { + completed = true; + ClientStreamingStashCallable.this.sendResponses(); + } + + public List getValues() { + if (!completed) { + throw new IllegalStateException("Stream not completed."); + } + if (error != null) { + throw ApiExceptionFactory.createException(error, FakeStatusCode.of(Code.UNKNOWN), false); + } + return requestList; + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java new file mode 100644 index 000000000000..f82f1fed4599 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java @@ -0,0 +1,204 @@ +/* + * Copyright 2018 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.cloud.bigtable.gaxx.testing; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StateCheckingResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.common.collect.Queues; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class MockStreamingApi { + public static class MockServerStreamingCallable + extends ServerStreamingCallable { + private final BlockingQueue> calls = + Queues.newLinkedBlockingDeque(); + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + MockStreamController controller = new MockStreamController<>(responseObserver); + calls.add(new MockServerStreamingCall<>(request, controller, context)); + responseObserver.onStart(controller); + } + + public MockServerStreamingCall popLastCall() { + try { + return calls.poll(1, TimeUnit.SECONDS); + } catch (Throwable e) { + return null; + } + } + } + + public static class MockServerStreamingCall { + private final RequestT request; + private final MockStreamController controller; + private final ApiCallContext apiCallContext; + + public MockServerStreamingCall( + RequestT request, + MockStreamController controller, + @Nullable ApiCallContext apiCallContext) { + this.request = request; + this.controller = controller; + this.apiCallContext = apiCallContext; + } + + public RequestT getRequest() { + return request; + } + + public MockStreamController getController() { + return controller; + } + + public ApiCallContext getApiCallContext() { + return apiCallContext; + } + } + + public static class MockStreamController implements StreamController { + private final ResponseObserver downstreamObserver; + private final BlockingQueue pulls = Queues.newLinkedBlockingQueue(); + private SettableApiFuture cancelFuture = SettableApiFuture.create(); + private boolean autoFlowControl = true; + + public MockStreamController(ResponseObserver downstreamObserver) { + this.downstreamObserver = downstreamObserver; + } + + @Override + public void disableAutoInboundFlowControl() { + autoFlowControl = false; + } + + @Override + public void request(int count) { + pulls.add(count); + } + + @Override + public void cancel() { + cancelFuture.set(true); + } + + public ResponseObserver getObserver() { + return downstreamObserver; + } + + public boolean isAutoFlowControlEnabled() { + return autoFlowControl; + } + + public boolean isCancelled() { + return cancelFuture.isDone(); + } + + public void waitForCancel() { + try { + cancelFuture.get(1, TimeUnit.SECONDS); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public int popLastPull() { + Integer results; + + try { + results = pulls.poll(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } + + if (results == null) { + return 0; + } else { + return results; + } + } + } + + public static class MockResponseObserver extends StateCheckingResponseObserver { + private final boolean autoFlowControl; + private StreamController controller; + private final BlockingQueue responses = Queues.newLinkedBlockingDeque(); + private final SettableApiFuture done = SettableApiFuture.create(); + + public MockResponseObserver(boolean autoFlowControl) { + this.autoFlowControl = autoFlowControl; + } + + @Override + protected void onStartImpl(StreamController controller) { + this.controller = controller; + if (!autoFlowControl) { + controller.disableAutoInboundFlowControl(); + } + } + + @Override + protected void onResponseImpl(T response) { + responses.add(response); + } + + @Override + protected void onErrorImpl(Throwable t) { + done.setException(t); + } + + @Override + protected void onCompleteImpl() { + done.set(null); + } + + public StreamController getController() { + return controller; + } + + public T popNextResponse() { + try { + return responses.poll(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } + } + + public Throwable getFinalError() { + try { + done.get(1, TimeUnit.SECONDS); + return null; + } catch (ExecutionException e) { + return e.getCause(); + } catch (Throwable t) { + return t; + } + } + + public boolean isDone() { + return done.isDone(); + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/package-info.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/package-info.java new file mode 100644 index 000000000000..88b002ff5a56 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 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. + */ +/** + * Test helper utilities that were copied from gax to support testing of Bigtable agnostic + * utilities. + */ +package com.google.cloud.bigtable.gaxx.testing; diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.java new file mode 100644 index 000000000000..70e6a579aca3 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.java @@ -0,0 +1,75 @@ +/* + * Copyright 2024 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.cloud.bigtable.misc_utilities; + +import com.google.api.gax.rpc.UnavailableException; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.FamilySubsets; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class AuthorizedViewTestHelper { + + public static String AUTHORIZED_VIEW_ROW_PREFIX = "row#"; + public static String AUTHORIZED_VIEW_COLUMN_QUALIFIER = "qualifier"; + + private static final Logger logger = Logger.getLogger(AuthorizedViewTestHelper.class.getName()); + + public static AuthorizedView createTestAuthorizedView(TestEnvRule testEnvRule) + throws InterruptedException { + TableId tableId = testEnvRule.env().getTableId(); + String authorizedViewId = UUID.randomUUID().toString(); + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(tableId.getTableId(), authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix(AUTHORIZED_VIEW_ROW_PREFIX) + .setFamilySubsets( + testEnvRule.env().getFamilyId(), + FamilySubsets.create() + .addQualifierPrefix(AUTHORIZED_VIEW_COLUMN_QUALIFIER))) + .setDeletionProtection(false); + int retryCount = 0; + int maxRetries = 10; + while (true) { + try { + return testEnvRule.env().getTableAdminClient().createAuthorizedView(request); + } catch (UnavailableException e) { + if (++retryCount == maxRetries) { + throw e; + } + logger.log( + Level.INFO, + "Retrying createAuthorizedView " + + authorizedViewId + + " in table " + + tableId + + ", retryCount: " + + retryCount); + // Exponential backoff delay starting at 100ms. + double expSleep = 100 * Math.pow(2, retryCount); + Thread.sleep(Math.min((long) expSleep, TimeUnit.MINUTES.toMillis(1))); + } + } + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java new file mode 100644 index 000000000000..4c3ecd2744be --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java @@ -0,0 +1,39 @@ +/* + * 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.cloud.bigtable.misc_utilities; + +import com.google.common.truth.Correspondence; +import java.lang.reflect.Method; +import java.util.Arrays; + +/** + * A {@link Correspondence} to compare methods names, parameters and return types in different + * classes. An example usage is to make sure a child class is implementing all the methods in the + * non-abstract parent class. + */ +public class MethodComparator { + + public static final Correspondence METHOD_CORRESPONDENCE = + Correspondence.from( + MethodComparator::compareMethods, "compare method names, parameters and return types"); + + private static boolean compareMethods(Method actual, Method expected) { + return actual.getName().equals(expected.getName()) + && Arrays.equals(actual.getParameterTypes(), expected.getParameterTypes()) + && actual.getModifiers() == expected.getModifiers() + && actual.getReturnType().equals(expected.getReturnType()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/SimpleGceRawRead.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/SimpleGceRawRead.java new file mode 100644 index 000000000000..0847c2f8078b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/SimpleGceRawRead.java @@ -0,0 +1,102 @@ +/* + * Copyright 2019 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.cloud.bigtable.misc_utilities; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import io.grpc.ManagedChannel; +import io.grpc.alts.ComputeEngineChannelBuilder; +import java.util.Iterator; +import java.util.Map; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Simple utility to debug connection issues. + * + *

It enables verbose gRPC logging and does a simple read using a GCE channel builder. + * + *

{@code
+ * mvn install
+ *
+ * mvn test-compile exec:java \
+ *   -pl google-cloud-bigtable \
+ *   -Dexec.mainClass=com.google.cloud.bigtable.misc_utilities.SimpleGceRawRead \
+ *   -Dexec.classpathScope=test \
+ *   -Dbigtable.project=gcloud-devel \
+ *   -Dbigtable.instance=google-cloud-bigtable \
+ *   -Dbigtable.table=integration-tests \
+ *   -Dbigtable.data-endpoint="bigtable.googleapis.com"
+ * }
+ */ +public class SimpleGceRawRead { + + public static void main(String[] args) { + configureLogging(); + + String projectId = System.getProperty("bigtable.project", "gcloud-devel"); + String instanceId = System.getProperty("bigtable.instance", "google-cloud-bigtable"); + String tableId = System.getProperty("bigtable.table", "integration-tests"); + + String endpoint = System.getProperty("bigtable.data-endpoint", "bigtable.googleapis.com"); + String tableName = + String.format("projects/%s/instances/%s/tables/%s", projectId, instanceId, tableId); + + System.out.printf(">>>>>>>>> Trying to connect to: %s, to read %s%n%n%n", endpoint, tableName); + + ManagedChannel channel = + ComputeEngineChannelBuilder.forAddress(endpoint, 443) + .disableServiceConfigLookUp() + .defaultServiceConfig(newServiceConfig()) + .build(); + try { + BigtableGrpc.BigtableBlockingStub stub = BigtableGrpc.newBlockingStub(channel); + + Iterator iter = + stub.readRows( + ReadRowsRequest.newBuilder().setTableName(tableName).setRowsLimit(1).build()); + System.out.printf("%n%n>>>>>>>>> Success Rows Read: %d%n%n", Lists.newArrayList(iter).size()); + } finally { + channel.shutdown(); + } + } + + /** Enable verbose gRPC logging */ + private static void configureLogging() { + Logger.getLogger("io.grpc").setLevel(Level.ALL); + Logger.getLogger("io.grpc.netty.shaded").setLevel(Level.ALL); + + ConsoleHandler stderr = new ConsoleHandler(); + stderr.setLevel(Level.ALL); + + Logger.getLogger("").addHandler(stderr); + } + + private static Map newServiceConfig() { + ImmutableMap pickFirstStrategy = + ImmutableMap.of("pick_first", ImmutableMap.of()); + ImmutableMap childPolicy = + ImmutableMap.of("childPolicy", ImmutableList.of(pickFirstStrategy)); + ImmutableMap grpcLbPolicy = + ImmutableMap.of("grpclb", childPolicy); + return ImmutableMap.of("loadBalancingConfig", ImmutableList.of(grpcLbPolicy)); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/package-info.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/package-info.java new file mode 100644 index 000000000000..d5a6bea9113e --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 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. + */ +/** + * Miscellaneous developer utilities that can be executed by the developer to debug issues. + * + *

These are not meant to be used as automated tests, but more so for interactive use to debug + * issues. + */ +package com.google.cloud.bigtable.misc_utilities; diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java new file mode 100644 index 000000000000..f4bef019810b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java @@ -0,0 +1,142 @@ +/* + * Copyright 2018 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.cloud.bigtable.test_helpers.env; + +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.Cluster; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Defines the interface of a target environment. + * + *

This allows for integration tests to run against either production or an emulator. + */ +public abstract class AbstractTestEnv { + private String primaryClusterId = null; + + public enum ConnectionMode { + DEFAULT, + REQUIRE_CFE, + REQUIRE_DIRECT_PATH, + REQUIRE_DIRECT_PATH_IPV4 + } + + abstract void start() throws Exception; + + abstract void stop() throws Exception; + + public abstract BigtableDataClient getDataClient(); + + public abstract BigtableTableAdminClient getTableAdminClient(); + + public abstract BigtableTableAdminClient getTableAdminClientForInstance(String instanceId) + throws IOException; + + public abstract BigtableInstanceAdminClient getInstanceAdminClient(); + + public abstract BigtableDataSettings getDataClientSettings(); + + public abstract BigtableInstanceAdminSettings getInstanceAdminClientSettings(); + + public abstract BigtableTableAdminSettings getTableAdminSettings(); + + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + /** Try to guess the primary cluster id */ + public synchronized String getPrimaryClusterId() { + if (primaryClusterId != null) { + return primaryClusterId; + } + + List clusters = getInstanceAdminClient().listClusters(getInstanceId()); + Map byId = new HashMap<>(); + for (Cluster cluster : clusters) { + byId.put(cluster.getId(), cluster); + } + + Cluster cluster = byId.get(getInstanceId()); + + if (cluster == null) { + // gcloud-devel setup + cluster = byId.get(getInstanceId() + "-cluster"); + } + if (cluster == null) { + cluster = byId.get(getInstanceId() + "-c0"); + } + primaryClusterId = + Preconditions.checkNotNull( + cluster, + "Failed to guess the primary cluster for projects/%s/instances/%s", + getProjectId(), + getInstanceId()) + .getId(); + return primaryClusterId; + } + + public abstract TableId getTableId(); + + public abstract String getKmsKeyName(); + + public String getFamilyId() { + return "cf"; + } + + public boolean isInstanceAdminSupported() { + return true; + } + + public ConnectionMode getConnectionMode() { + String modeStr = + MoreObjects.firstNonNull( + System.getProperty("bigtable.connection-mode"), ConnectionMode.DEFAULT.name()); + + return ConnectionMode.valueOf(modeStr); + } + + public boolean shouldWaitForCmekKeyStatusUpdate() { + return Boolean.getBoolean("bigtable.wait-for-cmek-key-status"); + } + + public String getPrimaryZone() { + return "us-central1-b"; + } + + public String getSecondaryZone() { + return "us-east1-b"; + } + + /** + * Returns test zones that can be used for intra-region testing. This might overlap with primary + * and secondary zones + */ + public List getMultipleZonesInSameRegion() { + return ImmutableList.of("us-east1-b", "us-east1-c"); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java new file mode 100644 index 000000000000..fe849af468b2 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java @@ -0,0 +1,421 @@ +/* + * Copyright 2018 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.cloud.bigtable.test_helpers.env; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StubSettings; +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.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.common.base.MoreObjects; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * Test environment that uses an existing bigtable table. The table must have a pre-existing family + * {@code cf}. The target table is configured via the system properties: + * + *

    + *
  • {@code bigtable.project} + *
  • {@code bigtable.instance} + *
  • {@code bigtable.table} + *
+ */ +public class CloudEnv extends AbstractTestEnv { + private static final Predicate DIRECT_PATH_IPV6_MATCHER = + new Predicate() { + @Override + public boolean apply(InetSocketAddress input) { + return input.toString().startsWith("2001:4860:8040"); + } + }; + private static final Predicate DIRECT_PATH_IPV4_MATCHER = + new Predicate() { + @Override + public boolean apply(InetSocketAddress input) { + return input.toString().startsWith("34.126"); + } + }; + + private static final String DATA_ENDPOINT_PROPERTY_NAME = "bigtable.data-endpoint"; + private static final String ADMIN_ENDPOINT_PROPERTY_NAME = "bigtable.admin-endpoint"; + private static final String DATA_JWT_OVERRIDE_PROPERTY_NAME = "bigtable.data-jwt-audience"; + + private static final String PROJECT_PROPERTY_NAME = "bigtable.project"; + private static final String INSTANCE_PROPERTY_NAME = "bigtable.instance"; + private static final String APP_PROFILE_PROPERTY_NAME = "bigtable.app_profile"; + private static final String TABLE_PROPERTY_NAME = "bigtable.table"; + private static final String CMEK_KMS_KEY_PROPERTY_NAME = "bigtable.kms_key_name"; + + private static final String TRACING_COOKIE_PROPERTY_NAME = "bigtable.tracing_cookie"; + + private final String projectId; + private final String instanceId; + private final TableId tableId; + private final String kmsKeyName; + + private final BigtableDataSettings.Builder dataSettings; + private final BigtableTableAdminSettings.Builder tableAdminSettings; + private final BigtableInstanceAdminSettings.Builder instanceAdminSettings; + @Nullable private final String appProfileId; + + private BigtableDataClient dataClient; + private BigtableTableAdminClient tableAdminClient; + private BigtableInstanceAdminClient instanceAdminClient; + + static CloudEnv fromSystemProperties() { + return new CloudEnv( + getOptionalProperty(DATA_ENDPOINT_PROPERTY_NAME, ""), + getOptionalProperty(ADMIN_ENDPOINT_PROPERTY_NAME, ""), + getOptionalProperty(DATA_JWT_OVERRIDE_PROPERTY_NAME, ""), + getOptionalProperty(CMEK_KMS_KEY_PROPERTY_NAME, ""), + getRequiredProperty(PROJECT_PROPERTY_NAME), + getRequiredProperty(INSTANCE_PROPERTY_NAME), + getOptionalProperty(APP_PROFILE_PROPERTY_NAME), + TableId.of(getRequiredProperty(TABLE_PROPERTY_NAME)), + getOptionalProperty(TRACING_COOKIE_PROPERTY_NAME)); + } + + private CloudEnv( + @Nullable String dataEndpoint, + @Nullable String adminEndpoint, + @Nullable String jwtAudienceOverride, + @Nullable String kmsKeyName, + String projectId, + String instanceId, + @Nullable String appProfileId, + TableId tableId, + @Nullable String tracingCookie) { + this.projectId = projectId; + this.instanceId = instanceId; + this.appProfileId = appProfileId; + this.tableId = tableId; + this.kmsKeyName = kmsKeyName; + + this.dataSettings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId); + if (!Strings.isNullOrEmpty(dataEndpoint)) { + dataSettings.stubSettings().setEndpoint(dataEndpoint); + } + if (!Strings.isNullOrEmpty(appProfileId)) { + dataSettings.setAppProfileId(appProfileId); + } + if (!Strings.isNullOrEmpty(jwtAudienceOverride)) { + dataSettings.stubSettings().setJwtAudience(jwtAudienceOverride); + } + + configureConnection(dataSettings.stubSettings()); + configureUserAgent(dataSettings.stubSettings()); + + if (tracingCookie != null) { + injectTracingCookie(tracingCookie, dataSettings.stubSettings()); + } + + this.tableAdminSettings = + BigtableTableAdminSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId); + if (!Strings.isNullOrEmpty(adminEndpoint)) { + this.tableAdminSettings.stubSettings().setEndpoint(adminEndpoint); + } + + this.instanceAdminSettings = BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId); + if (!Strings.isNullOrEmpty(adminEndpoint)) { + this.instanceAdminSettings.stubSettings().setEndpoint(adminEndpoint); + } + } + + private static void injectTracingCookie( + String tracingCookie, EnhancedBigtableStubSettings.Builder settings) { + HeaderProvider oldHeaderProvider = settings.getHeaderProvider(); + settings.setHeaderProvider( + () -> + Optional.ofNullable(oldHeaderProvider) + .map(p -> ImmutableMap.builder().putAll(p.getHeaders())) + .orElse(ImmutableMap.builder()) + .put("cookie", tracingCookie) + .build()); + } + + private void configureConnection(StubSettings.Builder stubSettings) { + // Build an remote address restricting interceptor + final ClientInterceptor interceptor; + + switch (getConnectionMode()) { + case DEFAULT: + // nothing special + return; + case REQUIRE_DIRECT_PATH: + interceptor = + buildRemoteAddrInterceptor( + "DirectPath IPv4 or IPv6", + Predicates.or(DIRECT_PATH_IPV4_MATCHER, DIRECT_PATH_IPV6_MATCHER)); + break; + case REQUIRE_DIRECT_PATH_IPV4: + interceptor = + buildRemoteAddrInterceptor("DirectPath IPv4", Predicates.or(DIRECT_PATH_IPV4_MATCHER)); + break; + case REQUIRE_CFE: + interceptor = + buildRemoteAddrInterceptor( + "a CFE ip", + Predicates.not(Predicates.or(DIRECT_PATH_IPV4_MATCHER, DIRECT_PATH_IPV6_MATCHER))); + break; + default: + throw new IllegalStateException("Unexpected ConnectionMode: " + getConnectionMode()); + } + + final ClientInterceptor appProfileInterceptor = + appProfileId != null ? new AppProfileInterceptor() : null; + + // Inject the interceptor into the channel provider, taking care to preserve existing channel + // configurator + InstantiatingGrpcChannelProvider.Builder channelProvider = + ((InstantiatingGrpcChannelProvider) stubSettings.getTransportChannelProvider()).toBuilder(); + + @SuppressWarnings("rawtypes") + final ApiFunction oldConfigurator = + channelProvider.getChannelConfigurator(); + + @SuppressWarnings("rawtypes") + final ApiFunction newConfigurator = + new ApiFunction() { + @Override + @SuppressWarnings("rawtypes") + public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { + if (oldConfigurator != null) { + builder = oldConfigurator.apply(builder); + } + builder = builder.intercept(interceptor); + if (appProfileInterceptor != null) { + builder = builder.intercept(appProfileInterceptor); + } + return builder; + } + }; + channelProvider.setChannelConfigurator(newConfigurator); + stubSettings.setTransportChannelProvider(channelProvider.build()); + } + + private ClientInterceptor buildRemoteAddrInterceptor( + final String msg, final Predicate predicate) { + return new ClientInterceptor() { + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + final ClientCall clientCall = next.newCall(method, callOptions); + + return new SimpleForwardingClientCall(clientCall) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + // Check peer IP after connection is established. + SocketAddress remoteAddr = + clientCall.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + + if (!predicate.apply((InetSocketAddress) remoteAddr)) { + throw new RuntimeException( + String.format( + "Synthetically aborting the current request because it did not adhere" + + " to the test environment's requirement ." + + " Expected %s, but ip was: %s", + msg, remoteAddr)); + } + super.onHeaders(headers); + } + }, + headers); + } + }; + } + }; + } + + private class AppProfileInterceptor implements ClientInterceptor { + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + String reqParams = + headers.get( + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER)); + if (reqParams == null || !reqParams.contains("app_profile_id=" + appProfileId)) { + responseListener.onClose( + Status.FAILED_PRECONDITION.withDescription( + "Integration test was configured to run with app profile: " + + appProfileId + + ", but found a different app profile in the headers: " + + reqParams), + new Metadata()); + return; + } + super.start(responseListener, headers); + } + }; + } + } + + private void configureUserAgent(EnhancedBigtableStubSettings.Builder stubSettings) { + String newUserAgent = "java-bigtable-int-test"; + + // Use the existing user-agent to use as a prefix + Map existingHeaders = + MoreObjects.firstNonNull(stubSettings.getHeaderProvider(), FixedHeaderProvider.create()) + .getHeaders(); + String existingUserAgent = existingHeaders.get("user-agent"); + if (existingUserAgent != null) { + newUserAgent = existingUserAgent + " " + newUserAgent; + } + + Map newHeaders = new HashMap<>(existingHeaders); + newHeaders.put("user-agent", newUserAgent); + + stubSettings.setHeaderProvider(FixedHeaderProvider.create(newHeaders)); + } + + @Override + void start() throws IOException { + dataClient = BigtableDataClient.create(dataSettings.build()); + tableAdminClient = BigtableTableAdminClient.create(tableAdminSettings.build()); + instanceAdminClient = BigtableInstanceAdminClient.create(instanceAdminSettings.build()); + } + + @Override + void stop() { + dataClient.close(); + tableAdminClient.close(); + instanceAdminClient.close(); + } + + @Override + public BigtableDataClient getDataClient() { + return dataClient; + } + + @Override + public BigtableTableAdminClient getTableAdminClient() { + return tableAdminClient; + } + + @Override + public BigtableTableAdminClient getTableAdminClientForInstance(String instanceId) + throws IOException { + BigtableTableAdminSettings.Builder settings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(tableAdminSettings.getProjectId()) + .setInstanceId(instanceId); + settings.stubSettings().setEndpoint(tableAdminSettings.stubSettings().getEndpoint()); + return BigtableTableAdminClient.create(settings.build()); + } + + @Override + public BigtableInstanceAdminClient getInstanceAdminClient() { + return instanceAdminClient; + } + + @Override + public BigtableDataSettings getDataClientSettings() { + return dataSettings.build(); + } + + @Override + public BigtableInstanceAdminSettings getInstanceAdminClientSettings() { + try { + return instanceAdminSettings.build(); + } catch (IOException e) { + throw new IllegalStateException( + "Caught unexpected error building instance admin settings", e); + } + } + + @Override + public BigtableTableAdminSettings getTableAdminSettings() { + try { + return tableAdminSettings.build(); + } catch (IOException e) { + throw new IllegalStateException("Caught unexpected error building table admin settings", e); + } + } + + @Override + public String getProjectId() { + return projectId; + } + + @Override + public String getInstanceId() { + return instanceId; + } + + @Override + public TableId getTableId() { + return tableId; + } + + @Override + public String getKmsKeyName() { + return kmsKeyName; + } + + @Nullable + private static String getOptionalProperty(String prop) { + return System.getProperty(prop); + } + + private static String getOptionalProperty(String prop, String defaultValue) { + return MoreObjects.firstNonNull(System.getProperty(prop), defaultValue); + } + + private static String getRequiredProperty(String prop) { + String value = System.getProperty(prop); + if (value == null || value.isEmpty()) { + throw new RuntimeException("Missing system property: " + prop); + } + return value; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java new file mode 100644 index 000000000000..2ba3bd72c11d --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java @@ -0,0 +1,151 @@ +/* + * Copyright 2018 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.cloud.bigtable.test_helpers.env; + +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.CreateTableRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; +import com.google.cloud.bigtable.emulator.v2.Emulator; +import com.google.common.base.Strings; +import java.io.IOException; +import java.nio.file.Paths; + +public class EmulatorEnv extends AbstractTestEnv { + private static final String EMULATOR_OVERRIDE_PROPERTY_NAME = "bigtable.emulator-path"; + + private static final String PROJECT_ID = "fake-project"; + private static final String INSTANCE_ID = "fake-instance"; + private static final TableId TABLE_ID = TableId.of("default-table"); + + private Emulator emulator; + private BigtableTableAdminClient tableAdminClient; + private BigtableDataClient dataClient; + + private BigtableDataSettings dataSettings; + private BigtableTableAdminSettings tableAdminSettings; + + public static EmulatorEnv createBundled() { + return new EmulatorEnv(); + } + + private EmulatorEnv() {} + + @Override + void start() throws Exception { + String overridePath = System.getProperty(EMULATOR_OVERRIDE_PROPERTY_NAME); + if (!Strings.isNullOrEmpty(overridePath)) { + emulator = Emulator.createFromPath(Paths.get(overridePath)); + } else { + emulator = Emulator.createBundled(); + } + emulator.start(); + + dataSettings = + BigtableDataSettings.newBuilderForEmulator(emulator.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() + .build(); + + dataClient = BigtableDataClient.create(dataSettings); + + tableAdminSettings = + BigtableTableAdminSettings.newBuilderForEmulator(emulator.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build(); + + tableAdminClient = BigtableTableAdminClient.create(tableAdminSettings); + + tableAdminClient.createTable( + CreateTableRequest.of(TABLE_ID.getTableId()).addFamily(getFamilyId())); + } + + @Override + void stop() { + tableAdminClient.close(); + dataClient.close(); + emulator.stop(); + } + + @Override + public BigtableDataSettings getDataClientSettings() { + return dataSettings; + } + + @Override + public BigtableInstanceAdminSettings getInstanceAdminClientSettings() { + throw new UnsupportedOperationException("instance admin is not support by the emulator"); + } + + @Override + public BigtableTableAdminSettings getTableAdminSettings() { + return tableAdminSettings; + } + + @Override + public String getProjectId() { + return PROJECT_ID; + } + + @Override + public String getInstanceId() { + return INSTANCE_ID; + } + + @Override + public TableId getTableId() { + return TABLE_ID; + } + + @Override + public BigtableDataClient getDataClient() { + return dataClient; + } + + @Override + public BigtableTableAdminClient getTableAdminClient() { + return tableAdminClient; + } + + @Override + public BigtableTableAdminClient getTableAdminClientForInstance(String instanceId) + throws IOException { + throw new UnsupportedOperationException("Could not create a table admin for another instance."); + } + + @Override + public BigtableInstanceAdminClient getInstanceAdminClient() { + throw new UnsupportedOperationException("InstanceAdminClient is not supported with emulator"); + } + + @Override + public String getKmsKeyName() { + throw new UnsupportedOperationException("CMEK is not supported with emulator"); + } + + @Override + public boolean isInstanceAdminSupported() { + return false; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/PrefixGenerator.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/PrefixGenerator.java new file mode 100644 index 000000000000..e003e5a6c8eb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/PrefixGenerator.java @@ -0,0 +1,76 @@ +/* + * Copyright 2018 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.cloud.bigtable.test_helpers.env; + +import java.time.Instant; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Logger; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +public class PrefixGenerator implements TestRule { + private static final Logger LOGGER = Logger.getLogger(TestEnvRule.class.getName()); + + static final String PREFIX = "temp-"; + private static final AtomicInteger prefixCounter = new AtomicInteger(0); + private static final int SUFFIX = new Random().nextInt(Integer.MAX_VALUE); + + private String testName; + + @Override + public Statement apply(final Statement base, final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + before(description); + + try { + base.evaluate(); + } finally { + after(); + } + } + }; + } + + private void before(Description description) { + testName = description.toString(); + } + + private void after() { + testName = null; + } + + public String newPrefix() { + return newPrefix(testName); + } + + public static String newPrefix(String source) { + // Sortable resource prefix - time, process identifier, serial counterck + String prefix = + String.format( + "%s-%x-%x", newTimePrefix(Instant.now()), SUFFIX, prefixCounter.getAndIncrement()); + + LOGGER.info(source + ": newPrefix: " + prefix); + return prefix; + } + + static String newTimePrefix(Instant instant) { + return String.format(PREFIX + "08%x", instant.getEpochSecond()); + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java new file mode 100644 index 000000000000..dcf0938a5c8b --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java @@ -0,0 +1,377 @@ +/* + * Copyright 2018 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.cloud.bigtable.test_helpers.env; + +import static com.google.common.truth.TruthJUnit.assume; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.models.Cluster; +import com.google.cloud.bigtable.admin.v2.models.Instance; +import com.google.cloud.bigtable.admin.v2.models.LogicalView; +import com.google.cloud.bigtable.admin.v2.models.MaterializedView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateLogicalViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateMaterializedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.UpdateTableRequest; +import com.google.common.collect.ImmutableSet; +import java.io.IOException; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * JUnit rule to start and stop the target test environment. + * + *

The environment can be specified via the system property {@code bigtable.env}. The choices + * are: + * + *

    + *
  • {@code emulator}: uses the cbtemulator component that can be installed by gcloud + *
  • {@code prod}: uses a pre-existing production table. The target table is defined using + * system properties listed in {@link CloudEnv} and application default credentials + *
  • {@code direct_path}: uses a pre-existing table in the direct path test environment. The + * target table is defined using system properties listed in {@link CloudEnv} and application + * default credentials + *
+ * + *

By default, {@code emulator} will be used + * + *

Also, when the system property {@code bigtable.grpc-log-dir} is set, it will enable fine + * grained gRPC logging to the configured path. + */ +public class TestEnvRule implements TestRule { + + private static final Logger LOGGER = Logger.getLogger(TestEnvRule.class.getName()); + private static final String BIGTABLE_EMULATOR_HOST_ENV_VAR = "BIGTABLE_EMULATOR_HOST"; + private static final String ENV_PROPERTY = "bigtable.env"; + private static final String env = System.getProperty(ENV_PROPERTY, "emulator"); + + private AbstractTestEnv testEnv; + + private Handler grpcLogHandler; + private static final Set GRPC_LOGGER_NAMES = + ImmutableSet.of("io.grpc", "io.grpc.netty.shaded"); + + @Override + public Statement apply(final Statement base, final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + TestEnvRule.this.before(description); + + try { + base.evaluate(); + } finally { + TestEnvRule.this.after(); + } + } + }; + } + + protected void before(Description description) throws Throwable { + assume() + .withMessage( + "Integration tests can't run with the BIGTABLE_EMULATOR_HOST environment variable set" + + ". Please use the emulator-it maven profile instead") + .that(System.getenv()) + .doesNotContainKey(BIGTABLE_EMULATOR_HOST_ENV_VAR); + + switch (env) { + case "emulator": + testEnv = EmulatorEnv.createBundled(); + break; + case "cloud": + testEnv = CloudEnv.fromSystemProperties(); + break; + default: + throw new IllegalArgumentException( + String.format( + "Unknown env: %s. Please set the system property %s to either 'emulator' or" + + " 'cloud'.", + env, ENV_PROPERTY)); + } + testEnv.start(); + } + + private void after() { + try { + cleanUpStale(); + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Failed to cleanup environment", e); + } + + try { + testEnv.stop(); + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Failed to stop the environment", e); + } + testEnv = null; + teardownLogging(); + } + + private void teardownLogging() { + if (grpcLogHandler == null) { + return; + } + + for (String grpcLoggerName : GRPC_LOGGER_NAMES) { + Logger.getLogger(grpcLoggerName).removeHandler(grpcLogHandler); + } + grpcLogHandler.flush(); + grpcLogHandler = null; + } + + void cleanUpStale() throws ExecutionException, InterruptedException, IOException { + // Sortable resource prefix - time, process identifier, serial counterck + String stalePrefix = PrefixGenerator.newTimePrefix(Instant.now().minus(1, ChronoUnit.DAYS)); + + cleanupStaleTables(stalePrefix); + if (env().isInstanceAdminSupported()) { + cleanUpStaleAppProfile(stalePrefix); + cleanUpStaleClusters(stalePrefix); + cleanUpStaleInstances(stalePrefix); + } + } + + /** + * Clean up AppProfile that were dynamically created in the default instance that have been + * orphaned. + */ + private void cleanupStaleTables(String stalePrefix) { + LOGGER.info("Start cleaning up stale tables with stalePrefix=" + stalePrefix); + for (String tableId : env().getTableAdminClient().listTables()) { + if (!tableId.startsWith(PrefixGenerator.PREFIX)) { + LOGGER.info("Skip cleaning up table: " + tableId); + continue; + } + if (stalePrefix.compareTo(tableId) > 0) { + LOGGER.info("Preparing stale table for delete: " + tableId); + prepTableForDelete(tableId); + try { + LOGGER.info("Deleting stable table: " + tableId); + env().getTableAdminClient().deleteTable(tableId); + } catch (NotFoundException e) { + LOGGER.log(Level.WARNING, "Deleting stale table failed: " + tableId, e); + } + } + } + } + + private void prepTableForDelete(String tableId) { + if (!(env() instanceof EmulatorEnv)) { + // unprotect table + Table table = env().getTableAdminClient().getTable(tableId); + if (table.isDeletionProtected() || table.getChangeStreamRetention() != null) { + env() + .getTableAdminClient() + .updateTable( + UpdateTableRequest.of(tableId) + .setDeletionProtection(false) + .disableChangeStreamRetention()); + } + + // Unprotected views + for (String viewId : env().getTableAdminClient().listAuthorizedViews(tableId)) { + try { + env() + .getTableAdminClient() + .updateAuthorizedView( + UpdateAuthorizedViewRequest.of(tableId, viewId).setDeletionProtection(false)); + } catch (NotFoundException ignored) { + // nothing to clean up, the view was already deleted + } + } + } + } + + /** + * Clean up AppProfile that were dynamically created in the default instance that have been + * orphaned. + */ + private void cleanUpStaleAppProfile(String stalePrefix) { + for (AppProfile appProfile : + env().getInstanceAdminClient().listAppProfiles(env().getInstanceId())) { + if (!appProfile.getId().startsWith(PrefixGenerator.PREFIX)) { + continue; + } + boolean isNewerThanStale = appProfile.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + try { + env() + .getInstanceAdminClient() + .deleteAppProfile(env().getInstanceId(), appProfile.getId(), true); + } catch (NotFoundException ignored) { + // nothing to clean up, the app profile was already deleted + } + } + } + + /** + * Clean up clusters that were dynamically created in the default instance that have been + * orphaned. + */ + private void cleanUpStaleClusters(String stalePrefix) + throws ExecutionException, InterruptedException { + for (Cluster cluster : env().getInstanceAdminClient().listClusters(env().getInstanceId())) { + if (!cluster.getId().startsWith(PrefixGenerator.PREFIX)) { + continue; + } + boolean isNewerThanStale = cluster.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + + try { + deleteBackups(env().getTableAdminClient(), cluster.getId()); + } catch (NotFoundException ignored) { + // nothing to clean up, the backup was already deleted + } + try { + env().getInstanceAdminClient().deleteCluster(env().getInstanceId(), cluster.getId()); + } catch (NotFoundException ignored) { + // nothing to clean up, the cluster was already deleted + } + } + } + + private void prepInstanceForDelete(String instanceId) { + if (env() instanceof EmulatorEnv) { + return; + } + // Unprotected MaterializedViews. + for (MaterializedView materializedView : + env().getInstanceAdminClient().listMaterializedViews(instanceId)) { + try { + env() + .getInstanceAdminClient() + .updateMaterializedView( + UpdateMaterializedViewRequest.of(instanceId, materializedView.getId()) + .setDeletionProtection(false)); + } catch (NotFoundException ignored) { + // nothing to clean up, the materialized view was already deleted + } + } + // Unprotected LogicalViews. + for (LogicalView logicalView : env().getInstanceAdminClient().listLogicalViews(instanceId)) { + try { + env() + .getInstanceAdminClient() + .updateLogicalView( + UpdateLogicalViewRequest.of(instanceId, logicalView.getId()) + .setDeletionProtection(false)); + } catch (NotFoundException ignored) { + // nothing to clean up, the logical view was already deleted + } + } + } + + /** Clean up dynamically created (non-default) instances that have been orphaned. */ + private void cleanUpStaleInstances(String stalePrefix) + throws IOException, ExecutionException, InterruptedException { + for (Instance instance : env().getInstanceAdminClient().listInstances()) { + if (!instance.getId().startsWith(PrefixGenerator.PREFIX)) { + continue; + } + boolean isNewerThanStale = instance.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + prepInstanceForDelete(instance.getId()); + try { + deleteInstance(instance.getId()); + } catch (NotFoundException ignored) { + // nothing to clean up, the instance was already deleted + } + } + } + + /** Delete an instance with all of its resources. */ + private void deleteInstance(String instanceId) + throws IOException, ExecutionException, InterruptedException { + BigtableTableAdminSettings settings = + env().getTableAdminSettings().toBuilder().setInstanceId(instanceId).build(); + + // Delete all child resources (backups & clusters) that wont be automatically deleted + try (BigtableTableAdminClient tableAdmin = BigtableTableAdminClient.create(settings)) { + List clusters = env().getInstanceAdminClient().listClusters(instanceId); + + boolean isFirstCluster = true; + + for (Cluster cluster : clusters) { + deleteBackups(tableAdmin, cluster.getId()); + // Skip the first cluster so that it can be delete by deleteInstance (instances can't exist + // without clusters) + if (!isFirstCluster) { + try { + env().getInstanceAdminClient().deleteCluster(instanceId, cluster.getId()); + } catch (NotFoundException ignored) { + // nothing to clean up, the cluster was already deleted + } + } + isFirstCluster = false; + } + } + + // Delete everything else + try { + env().getInstanceAdminClient().deleteInstance(instanceId); + } catch (NotFoundException ignored) { + // nothing to clean up, the instance was already deleted + } + } + + private void deleteBackups(BigtableTableAdminClient tableAdmin, String clusterId) + throws ExecutionException, InterruptedException { + List> futures = new ArrayList<>(); + + for (String backupId : tableAdmin.listBackups(clusterId)) { + ApiFuture f = tableAdmin.deleteBackupAsync(clusterId, backupId); + futures.add(f); + } + + for (ApiFuture future : futures) { + try { + future.get(); + } catch (ExecutionException e) { + // Ignore not found + if (e.getCause() instanceof NotFoundException) { + continue; + } + throw e; + } + } + } + + public AbstractTestEnv env() { + return testEnv; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/proto/album.proto b/java-bigtable/google-cloud-bigtable/src/test/proto/album.proto new file mode 100644 index 000000000000..900c2c62db87 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/proto/album.proto @@ -0,0 +1,36 @@ +/* + * Copyright 2025 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. + */ + +syntax = "proto3"; + +import "singer.proto"; + +package com.google.cloud.bigtable.data.v2.test; +option java_outer_classname = "AlbumProto"; +option java_package = "com.google.cloud.bigtable.data.v2.test"; + +enum Format { + CD = 0; + DIGITAL = 1; +} + +message Album { + Singer artist = 1; + string title = 2; + int32 release_year = 3; + Format format = 4; +} + diff --git a/java-bigtable/google-cloud-bigtable/src/test/proto/changestream_tests.proto b/java-bigtable/google-cloud-bigtable/src/test/proto/changestream_tests.proto new file mode 100644 index 000000000000..82f0fff49279 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/proto/changestream_tests.proto @@ -0,0 +1,63 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.conformance.bigtable.v2; + +import "google/bigtable/v2/bigtable.proto"; +import "google/protobuf/timestamp.proto"; +import "google/bigtable/v2/data.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2.Tests.Conformance"; +option java_outer_classname = "ChangeStreamTestDefinition"; +option java_package = "com.google.cloud.conformance.bigtable.v2"; +option go_package = "google/cloud/conformance/bigtable/v2"; + +message ChangeStreamTestFile { + repeated ReadChangeStreamTest read_change_stream_tests = 1; +} + +message ReadChangeStreamTest { + + message TestChangeStreamMutation { + bytes row_key = 1; + google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 2; + string source_cluster_id = 3; + google.protobuf.Timestamp commit_timestamp = 4; + int64 tiebreaker = 5; + string token = 6; + google.protobuf.Timestamp estimated_low_watermark = 7; + repeated google.bigtable.v2.Mutation mutations = 8; + } + + message TestChangeStreamRecord { + oneof record { + google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 1; + google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 2; + TestChangeStreamMutation change_stream_mutation = 3; + } + } + + // Expected results of reading the change stream. + // Only the last result can be an error. + message Result { + TestChangeStreamRecord record = 1; + bool error = 2; + } + + string description = 1; + repeated google.bigtable.v2.ReadChangeStreamResponse api_responses = 2; + repeated Result results = 3; +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto b/java-bigtable/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto new file mode 100644 index 000000000000..bf2c5eec5a05 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +import "google/bigtable/v2/bigtable.proto"; +import "google/bigtable/v2/session.proto"; +import "google/protobuf/duration.proto"; +import "google/rpc/status.proto"; + +package google.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; +option java_multiple_files = true; +option java_package = "com.google.bigtable.v2"; +option java_outer_classname = "FakeSessionProto"; + +service FakeSession { + rpc OpenSession(stream SessionRequest) returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_TEST; + } +} + +message OpenFakeSessionRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TEST; + + google.protobuf.Duration go_away_delay = 2; + + // session set up phase + message StreamError { + google.rpc.Status status = 1; + map metadata = 2; + + // create a session but return a stream error after the delay + google.protobuf.Duration delay = 3; + } + + StreamError stream_error = 3; + SessionParametersResponse session_params = 4; + + // session steady phase + message Action { + google.protobuf.Duration delay = 1; + oneof payload { + VirtualRpcResponse response = 2; + ErrorResponse error_response = 3; + } + } + message ActionList { + bool repeat = 1; // if we should reuse the same action + repeated Action actions = 2; + } + map vrpc_actions = 6; + google.bigtable.v2.SessionRefreshConfig refresh_config = 7; + google.protobuf.Duration refresh_config_delay = 8; +} + +message OpenFakeSessionResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TEST; +} + +message FakeSessionOpRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TEST; + + oneof payload { + SessionFakeScriptedRequest scripted_request = 1; + } +} + +message SessionFakeScriptedRequest { + int64 tag = 1; +} + +message SessionFakeScriptedResponse { + string message = 1; +} + +message FakeSessionOpResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TEST; + + oneof payload { + SessionFakeScriptedResponse scripted = 1; + } +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/proto/singer.proto b/java-bigtable/google-cloud-bigtable/src/test/proto/singer.proto new file mode 100644 index 000000000000..838b85fbe6ea --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/proto/singer.proto @@ -0,0 +1,34 @@ +/* + * Copyright 2025 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. + */ + +syntax = "proto3"; + +package com.google.cloud.bigtable.data.v2.test; +option java_outer_classname = "SingerProto"; +option java_package = "com.google.cloud.bigtable.data.v2.test"; + +enum Genre { + POP = 0; + JAZZ = 1; + FOLK = 2; + ROCK = 3; +} + +message Singer { + string name = 1; + Genre genre = 2; +} + diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/changestream.json b/java-bigtable/google-cloud-bigtable/src/test/resources/changestream.json new file mode 100644 index 000000000000..661bf1b4cb7c --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/changestream.json @@ -0,0 +1,1451 @@ +{ + "readChangeStreamTests": [ + { + "description": "1 heartbeat", + "api_responses": [ + { + "heartbeat": { + "continuation_token": { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "" + } + }, + "token": "heartbeat-token" + }, + "estimated_low_watermark": "2022-07-01T00:00:00Z" + } + } + ], + "results": [ + { + "record" : { + "heartbeat": { + "continuation_token": { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "" + } + }, + "token": "heartbeat-token" + }, + "estimated_low_watermark": "2022-07-01T00:00:00Z" + } + }, + "error": false + } + ] + }, + { + "description": "1 CloseStream", + "api_responses": [ + { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + }, + { + "partition": { + "row_range": { + "start_key_closed": "0000000000000001", + "end_key_open": "0000000000000003" + } + }, + "token": "close-stream-token-2" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + }, + { + "row_range": { + "start_key_closed": "0000000000000002", + "end_key_open": "0000000000000003" + } + } + ] + } + } + ], + "results": [ + { + "record" : { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + }, + { + "partition": { + "row_range": { + "start_key_closed": "0000000000000001", + "end_key_open": "0000000000000003" + } + }, + "token": "close-stream-token-2" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + }, + { + "row_range": { + "start_key_closed": "0000000000000002", + "end_key_open": "0000000000000003" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 heartbeat + 1 CloseStream", + "api_responses": [ + { + "heartbeat": { + "continuation_token": { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "" + } + }, + "token": "heartbeat-token" + }, + "estimated_low_watermark": "2022-07-01T00:00:00Z" + } + }, + { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + } + ] + } + } + ], + "results": [ + { + "record" : { + "heartbeat": { + "continuation_token": { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "" + } + }, + "token": "heartbeat-token" + }, + "estimated_low_watermark": "2022-07-01T00:00:00Z" + } + }, + "error": false + }, + { + "record" : { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 logical mutation no chunking([{DF,DC,SC}]->ChangeStreamMutation{DF,DC,SC})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + }, + { + "mutation": { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + } + }, + { + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + }, + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 incomplete logical mutation(missing `done: true`)", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ] + } + } + ], + "results": [ + { + "error": true + } + ] + }, + { + "description": "GC mutation no source cluster id", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "GARBAGE_COLLECTION", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "GARBAGE_COLLECTION", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 chunked SetCell([{SC_chunk1(v)}, {SC_chunk2(alue-VAL)}]->ChangeStreamMutation{SC(value-VAL)})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "ChunkedValueSize mismatch for a chunked SetCell([{SC_chunk1(v)}, {SC_chunk2(alue-VAL)}]->error)", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 1 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "error": true + } + ] + }, + { + "description": "1 chunked SetCell([{SC_chunk1(v)}, {SC_chunk2(alue-VAL)}, {SC_chunk3(-VAL)}]->ChangeStreamMutation{SC(value-VAL-VAL)})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 13 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 13 + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 9, + "chunked_value_size": 13, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "LVZBTA==" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFMLVZBTA==" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "2 chunked SetCells([{SC1_chunk1(v)}, {SC1_chunk2(alue-VAL), SC2_chunk1(v)}, {SC2_chunk2(alue-VAL)}]->ChangeStreamMutation{SC1(value-VAL),SC2(value-VAL)})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + }, + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + }, + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 chunked SetCell + 1 unchunked SetCell([{SC1_chunk1(v)}, {SC1_chunk2(alue-VAL), SC2(value-VAL)}]->ChangeStreamMutation{SC1(value-VAL),SC2(value-VAL)})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + }, + { + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + }, + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 unchunked SetCell + 1 chunked SetCell([{SC1(v), SC2_chunk1(v)}, {SC2_chunk2(alue-VAL)}]->ChangeStreamMutation{SC1(v),SC2(value-VAL)})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + }, + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + }, + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 mod + 1 chunked SetCell + 1 mod([{DF1,SC_chunk1(v)}, {SC_chunk2(alue-VAL), DF2}]->ChangeStreamMutation{DF1,SC(value-VAL),DF2})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + }, + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + }, + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + }, + { + "delete_from_family": { + "family_name": "family" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "1 chunked SetCell + many nonchunked mods([{SC_chunk1(v)}, {SC_chunk2(alue-VAL),DF,DC}]->ChangeStreamMutation{SC(value-VAL),DF,DC})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "chunk_info": { + "chunked_value_size": 9 + }, + "mutation": { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dg==" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "chunk_info": { + "chunked_value_offset": 1, + "chunked_value_size": 9, + "last_chunk": true + }, + "mutation": { + "set_cell": { + "value": "YWx1ZS1WQUw=" + } + } + }, + { + "mutation": { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + } + }, + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "set_cell": { + "family_name": "family", + "column_qualifier": "0000000000000000", + "timestamp_micros": 1000, + "value": "dmFsdWUtVkFM" + } + }, + { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + }, + { + "delete_from_family": { + "family_name": "family" + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "non SetCell chunking([{DF1},{DF2,DC}]->ChangeStreamMutation{DF1,DF2,DC})", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + }, + { + "mutation": { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + } + } + ], + "done": true + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "delete_from_column" : { + "family_name": "family", + "column_qualifier": "dg==", + "time_range": { + "start_timestamp_micros": 5000, + "end_timestamp_micros": 15000 + } + } + } + ] + } + }, + "error": false + } + ] + }, + { + "description": "2 logical mutations with non SetCell chunking + CloseStream([{Change1_DF1}, {Change1_DF2}, {Change2_DF3}, {Change2_DF4}, {CloseStream}]->[ChangeStreamMutation1{DF1,DF2}),ChangeStreamMutation2{DF3,DF4}),CloseStream]", + "api_responses": [ + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ], + "done": true + } + }, + { + "data_change": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ] + } + }, + { + "data_change": { + "type": "CONTINUATION", + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "chunks": [ + { + "mutation": { + "delete_from_family": { + "family_name": "family" + } + } + } + ], + "done": true + } + }, + { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + }, + { + "partition": { + "row_range": { + "start_key_closed": "0000000000000001", + "end_key_open": "0000000000000003" + } + }, + "token": "close-stream-token-2" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + }, + { + "row_range": { + "start_key_closed": "0000000000000002", + "end_key_open": "0000000000000003" + } + } + ] + } + } + ], + "results": [ + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "delete_from_family": { + "family_name": "family" + } + } + ] + } + }, + "error": false + }, + { + "record": { + "change_stream_mutation": { + "row_key": "0000000000000000", + "type": "USER", + "source_cluster_id": "source-cluster-id", + "commit_timestamp": "2022-07-01T00:00:00Z", + "tiebreaker": 100, + "token": "data-change-token", + "estimated_low_watermark": "2022-07-01T00:00:00Z", + "mutations": [ + { + "delete_from_family": { + "family_name": "family" + } + }, + { + "delete_from_family": { + "family_name": "family" + } + } + ] + } + }, + "error": false + }, + { + "record" : { + "close_stream": { + "status": { + "code": "11", + "message": "Partition boundaries are misaligned." + }, + "continuation_tokens": [ + { + "partition": { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000001" + } + }, + "token": "close-stream-token-1" + }, + { + "partition": { + "row_range": { + "start_key_closed": "0000000000000001", + "end_key_open": "0000000000000003" + } + }, + "token": "close-stream-token-2" + } + ], + "new_partitions": [ + { + "row_range": { + "start_key_closed": "", + "end_key_open": "0000000000000002" + } + }, + { + "row_range": { + "start_key_closed": "0000000000000002", + "end_key_open": "0000000000000003" + } + } + ] + } + }, + "error": false + } + ] + } + ] +} \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/logging-verbose.properties b/java-bigtable/google-cloud-bigtable/src/test/resources/logging-verbose.properties new file mode 100644 index 000000000000..58e1b79ef6cb --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/logging-verbose.properties @@ -0,0 +1,11 @@ +# Verbose logging configuration used by enable-verbose-grpc-logs profile. +handlers= java.util.logging.ConsoleHandler +.level= FINEST + +# hide "Connecting to the Bigtable emulator at localhost:XXXX" lines +com.google.cloud.bigtable.data.v2.BigtableDataSettings.level=WARNING +java.util.logging.ConsoleHandler.level = FINEST + +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter +# [YYYY-MM-DD HH:MM:SS.sss] [level] (loggerName): message +java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL.%1$tN] [%4$-7s] (%2$s): %5$s%n diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/logging.properties b/java-bigtable/google-cloud-bigtable/src/test/resources/logging.properties new file mode 100644 index 000000000000..e181b45a01e8 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/logging.properties @@ -0,0 +1,12 @@ +handlers= java.util.logging.ConsoleHandler +.level= INFO + +# hide "Connecting to the Bigtable emulator at localhost:XXXX" lines +com.google.cloud.bigtable.data.v2.BigtableDataSettings.level=WARNING +java.util.logging.ConsoleHandler.level = INFO + +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter +# time [level] loggerName: message +java.util.logging.SimpleFormatter.format=%1$tT [%4$-7s] %2$s: %5$s %6$s%n + + diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb b/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb new file mode 100644 index 000000000000..c9ac4086f5d7 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb @@ -0,0 +1,6 @@ + +q +proto_schema_bundle.proto#gcloud.bigtable.schema_bundles.test"' +Author + +first_name ( R firstNamebproto3 \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.proto b/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.proto new file mode 100644 index 000000000000..e03f0ccccbef --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/proto_schema_bundle.proto @@ -0,0 +1,22 @@ +/* +Copyright 2025 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. +*/ +// The `proto_schema_bundle.pb` binary is generated from this source file, via command: +// protoc --include_imports --descriptor_set_out=proto_schema_bundle.pb proto_schema_bundle.proto + +syntax = "proto3"; + +package gcloud.bigtable.schema_bundles.test; + +message Author { + string first_name = 1; +} diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb b/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb new file mode 100644 index 000000000000..21f877a2fe11 --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb @@ -0,0 +1,7 @@ + +– +!updated_proto_schema_bundle.proto#gcloud.bigtable.schema_bundles.test"D +Author + +first_name ( R firstName + last_name ( RlastNamebproto3 \ No newline at end of file diff --git a/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.proto b/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.proto new file mode 100644 index 000000000000..e9894cabd20a --- /dev/null +++ b/java-bigtable/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.proto @@ -0,0 +1,23 @@ +/* +Copyright 2025 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. +*/ +// The `updated_proto_schema_bundle.pb` binary is generated from this source file, via command: +// protoc --include_imports --descriptor_set_out=updated_proto_schema_bundle.pb updated_proto_schema_bundle.proto + +syntax = "proto3"; + +package gcloud.bigtable.schema_bundles.test; + +message Author { + string first_name = 1; + string last_name = 2; +} diff --git a/java-bigtable/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..68aac3bcaccf --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -0,0 +1,20 @@ + + + + + + 7012 + com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc$AsyncService + *LogicalView* + + + 7012 + com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc$AsyncService + *MaterializedView* + + + 7012 + com/google/bigtable/admin/v2/BigtableTableAdminGrpc$AsyncService + * + + diff --git a/java-bigtable/grpc-google-cloud-bigtable-admin-v2/pom.xml b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/pom.xml new file mode 100644 index 000000000000..7cbe39f5b08e --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -0,0 +1,101 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + grpc-google-cloud-bigtable-admin-v2 + GRPC library for grpc-google-cloud-bigtable-admin-v2 + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-protobuf + compile + + + io.grpc + grpc-stub + compile + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + compile + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../proto-google-cloud-bigtable-admin-v2/target/site/apidocs/ + + + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java new file mode 100644 index 000000000000..241ed9138f2b --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java @@ -0,0 +1,4461 @@ +/* + * Copyright 2026 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.admin.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

+ * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+ * Clusters. Provides access to the Instance and Cluster schemas only, not the
+ * tables' metadata or data stored in those tables.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class BigtableInstanceAdminGrpc { + + private BigtableInstanceAdminGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.bigtable.admin.v2.BigtableInstanceAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateInstance", + requestType = com.google.bigtable.admin.v2.CreateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateInstanceRequest, com.google.longrunning.Operation> + getCreateInstanceMethod; + if ((getCreateInstanceMethod = BigtableInstanceAdminGrpc.getCreateInstanceMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getCreateInstanceMethod = BigtableInstanceAdminGrpc.getCreateInstanceMethod) == null) { + BigtableInstanceAdminGrpc.getCreateInstanceMethod = + getCreateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetInstanceRequest, com.google.bigtable.admin.v2.Instance> + getGetInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstance", + requestType = com.google.bigtable.admin.v2.GetInstanceRequest.class, + responseType = com.google.bigtable.admin.v2.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetInstanceRequest, com.google.bigtable.admin.v2.Instance> + getGetInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetInstanceRequest, com.google.bigtable.admin.v2.Instance> + getGetInstanceMethod; + if ((getGetInstanceMethod = BigtableInstanceAdminGrpc.getGetInstanceMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetInstanceMethod = BigtableInstanceAdminGrpc.getGetInstanceMethod) == null) { + BigtableInstanceAdminGrpc.getGetInstanceMethod = + getGetInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Instance.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListInstancesRequest, + com.google.bigtable.admin.v2.ListInstancesResponse> + getListInstancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInstances", + requestType = com.google.bigtable.admin.v2.ListInstancesRequest.class, + responseType = com.google.bigtable.admin.v2.ListInstancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListInstancesRequest, + com.google.bigtable.admin.v2.ListInstancesResponse> + getListInstancesMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListInstancesRequest, + com.google.bigtable.admin.v2.ListInstancesResponse> + getListInstancesMethod; + if ((getListInstancesMethod = BigtableInstanceAdminGrpc.getListInstancesMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListInstancesMethod = BigtableInstanceAdminGrpc.getListInstancesMethod) == null) { + BigtableInstanceAdminGrpc.getListInstancesMethod = + getListInstancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListInstancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListInstancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance> + getUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateInstance", + requestType = com.google.bigtable.admin.v2.Instance.class, + responseType = com.google.bigtable.admin.v2.Instance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance> + getUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance> + getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = BigtableInstanceAdminGrpc.getUpdateInstanceMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getUpdateInstanceMethod = BigtableInstanceAdminGrpc.getUpdateInstanceMethod) == null) { + BigtableInstanceAdminGrpc.getUpdateInstanceMethod = + getUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Instance.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Instance.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.longrunning.Operation> + getPartialUpdateInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PartialUpdateInstance", + requestType = com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.longrunning.Operation> + getPartialUpdateInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.longrunning.Operation> + getPartialUpdateInstanceMethod; + if ((getPartialUpdateInstanceMethod = BigtableInstanceAdminGrpc.getPartialUpdateInstanceMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getPartialUpdateInstanceMethod = + BigtableInstanceAdminGrpc.getPartialUpdateInstanceMethod) + == null) { + BigtableInstanceAdminGrpc.getPartialUpdateInstanceMethod = + getPartialUpdateInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PartialUpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier( + "PartialUpdateInstance")) + .build(); + } + } + } + return getPartialUpdateInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteInstanceRequest, com.google.protobuf.Empty> + getDeleteInstanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteInstance", + requestType = com.google.bigtable.admin.v2.DeleteInstanceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteInstanceRequest, com.google.protobuf.Empty> + getDeleteInstanceMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteInstanceRequest, com.google.protobuf.Empty> + getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = BigtableInstanceAdminGrpc.getDeleteInstanceMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getDeleteInstanceMethod = BigtableInstanceAdminGrpc.getDeleteInstanceMethod) == null) { + BigtableInstanceAdminGrpc.getDeleteInstanceMethod = + getDeleteInstanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteInstanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.bigtable.admin.v2.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = BigtableInstanceAdminGrpc.getCreateClusterMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getCreateClusterMethod = BigtableInstanceAdminGrpc.getCreateClusterMethod) == null) { + BigtableInstanceAdminGrpc.getCreateClusterMethod = + getCreateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetClusterRequest, com.google.bigtable.admin.v2.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.bigtable.admin.v2.GetClusterRequest.class, + responseType = com.google.bigtable.admin.v2.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetClusterRequest, com.google.bigtable.admin.v2.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetClusterRequest, com.google.bigtable.admin.v2.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = BigtableInstanceAdminGrpc.getGetClusterMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetClusterMethod = BigtableInstanceAdminGrpc.getGetClusterMethod) == null) { + BigtableInstanceAdminGrpc.getGetClusterMethod = + getGetClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Cluster.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListClustersRequest, + com.google.bigtable.admin.v2.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.bigtable.admin.v2.ListClustersRequest.class, + responseType = com.google.bigtable.admin.v2.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListClustersRequest, + com.google.bigtable.admin.v2.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListClustersRequest, + com.google.bigtable.admin.v2.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = BigtableInstanceAdminGrpc.getListClustersMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListClustersMethod = BigtableInstanceAdminGrpc.getListClustersMethod) == null) { + BigtableInstanceAdminGrpc.getListClustersMethod = + getListClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.Cluster, com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.bigtable.admin.v2.Cluster.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.Cluster, com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor + getUpdateClusterMethod; + if ((getUpdateClusterMethod = BigtableInstanceAdminGrpc.getUpdateClusterMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getUpdateClusterMethod = BigtableInstanceAdminGrpc.getUpdateClusterMethod) == null) { + BigtableInstanceAdminGrpc.getUpdateClusterMethod = + getUpdateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Cluster.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.longrunning.Operation> + getPartialUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PartialUpdateCluster", + requestType = com.google.bigtable.admin.v2.PartialUpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.longrunning.Operation> + getPartialUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.longrunning.Operation> + getPartialUpdateClusterMethod; + if ((getPartialUpdateClusterMethod = BigtableInstanceAdminGrpc.getPartialUpdateClusterMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getPartialUpdateClusterMethod = + BigtableInstanceAdminGrpc.getPartialUpdateClusterMethod) + == null) { + BigtableInstanceAdminGrpc.getPartialUpdateClusterMethod = + getPartialUpdateClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PartialUpdateCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("PartialUpdateCluster")) + .build(); + } + } + } + return getPartialUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.bigtable.admin.v2.DeleteClusterRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = BigtableInstanceAdminGrpc.getDeleteClusterMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getDeleteClusterMethod = BigtableInstanceAdminGrpc.getDeleteClusterMethod) == null) { + BigtableInstanceAdminGrpc.getDeleteClusterMethod = + getDeleteClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getCreateAppProfileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAppProfile", + requestType = com.google.bigtable.admin.v2.CreateAppProfileRequest.class, + responseType = com.google.bigtable.admin.v2.AppProfile.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getCreateAppProfileMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getCreateAppProfileMethod; + if ((getCreateAppProfileMethod = BigtableInstanceAdminGrpc.getCreateAppProfileMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getCreateAppProfileMethod = BigtableInstanceAdminGrpc.getCreateAppProfileMethod) + == null) { + BigtableInstanceAdminGrpc.getCreateAppProfileMethod = + getCreateAppProfileMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAppProfile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateAppProfileRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.AppProfile.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("CreateAppProfile")) + .build(); + } + } + } + return getCreateAppProfileMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getGetAppProfileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAppProfile", + requestType = com.google.bigtable.admin.v2.GetAppProfileRequest.class, + responseType = com.google.bigtable.admin.v2.AppProfile.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getGetAppProfileMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile> + getGetAppProfileMethod; + if ((getGetAppProfileMethod = BigtableInstanceAdminGrpc.getGetAppProfileMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetAppProfileMethod = BigtableInstanceAdminGrpc.getGetAppProfileMethod) == null) { + BigtableInstanceAdminGrpc.getGetAppProfileMethod = + getGetAppProfileMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAppProfile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetAppProfileRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.AppProfile.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetAppProfile")) + .build(); + } + } + } + return getGetAppProfileMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAppProfilesRequest, + com.google.bigtable.admin.v2.ListAppProfilesResponse> + getListAppProfilesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAppProfiles", + requestType = com.google.bigtable.admin.v2.ListAppProfilesRequest.class, + responseType = com.google.bigtable.admin.v2.ListAppProfilesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAppProfilesRequest, + com.google.bigtable.admin.v2.ListAppProfilesResponse> + getListAppProfilesMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAppProfilesRequest, + com.google.bigtable.admin.v2.ListAppProfilesResponse> + getListAppProfilesMethod; + if ((getListAppProfilesMethod = BigtableInstanceAdminGrpc.getListAppProfilesMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListAppProfilesMethod = BigtableInstanceAdminGrpc.getListAppProfilesMethod) + == null) { + BigtableInstanceAdminGrpc.getListAppProfilesMethod = + getListAppProfilesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAppProfiles")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListAppProfilesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListAppProfilesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListAppProfiles")) + .build(); + } + } + } + return getListAppProfilesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAppProfileRequest, com.google.longrunning.Operation> + getUpdateAppProfileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAppProfile", + requestType = com.google.bigtable.admin.v2.UpdateAppProfileRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAppProfileRequest, com.google.longrunning.Operation> + getUpdateAppProfileMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAppProfileRequest, com.google.longrunning.Operation> + getUpdateAppProfileMethod; + if ((getUpdateAppProfileMethod = BigtableInstanceAdminGrpc.getUpdateAppProfileMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getUpdateAppProfileMethod = BigtableInstanceAdminGrpc.getUpdateAppProfileMethod) + == null) { + BigtableInstanceAdminGrpc.getUpdateAppProfileMethod = + getUpdateAppProfileMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateAppProfile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateAppProfileRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("UpdateAppProfile")) + .build(); + } + } + } + return getUpdateAppProfileMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAppProfileRequest, com.google.protobuf.Empty> + getDeleteAppProfileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAppProfile", + requestType = com.google.bigtable.admin.v2.DeleteAppProfileRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAppProfileRequest, com.google.protobuf.Empty> + getDeleteAppProfileMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAppProfileRequest, com.google.protobuf.Empty> + getDeleteAppProfileMethod; + if ((getDeleteAppProfileMethod = BigtableInstanceAdminGrpc.getDeleteAppProfileMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getDeleteAppProfileMethod = BigtableInstanceAdminGrpc.getDeleteAppProfileMethod) + == null) { + BigtableInstanceAdminGrpc.getDeleteAppProfileMethod = + getDeleteAppProfileMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAppProfile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteAppProfileRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("DeleteAppProfile")) + .build(); + } + } + } + return getDeleteAppProfileMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = BigtableInstanceAdminGrpc.getGetIamPolicyMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetIamPolicyMethod = BigtableInstanceAdminGrpc.getGetIamPolicyMethod) == null) { + BigtableInstanceAdminGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = BigtableInstanceAdminGrpc.getSetIamPolicyMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getSetIamPolicyMethod = BigtableInstanceAdminGrpc.getSetIamPolicyMethod) == null) { + BigtableInstanceAdminGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = BigtableInstanceAdminGrpc.getTestIamPermissionsMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getTestIamPermissionsMethod = BigtableInstanceAdminGrpc.getTestIamPermissionsMethod) + == null) { + BigtableInstanceAdminGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListHotTablets", + requestType = com.google.bigtable.admin.v2.ListHotTabletsRequest.class, + responseType = com.google.bigtable.admin.v2.ListHotTabletsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod; + if ((getListHotTabletsMethod = BigtableInstanceAdminGrpc.getListHotTabletsMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListHotTabletsMethod = BigtableInstanceAdminGrpc.getListHotTabletsMethod) == null) { + BigtableInstanceAdminGrpc.getListHotTabletsMethod = + getListHotTabletsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListHotTablets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListHotTabletsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListHotTabletsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListHotTablets")) + .build(); + } + } + } + return getListHotTabletsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, com.google.longrunning.Operation> + getCreateLogicalViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateLogicalView", + requestType = com.google.bigtable.admin.v2.CreateLogicalViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, com.google.longrunning.Operation> + getCreateLogicalViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, com.google.longrunning.Operation> + getCreateLogicalViewMethod; + if ((getCreateLogicalViewMethod = BigtableInstanceAdminGrpc.getCreateLogicalViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getCreateLogicalViewMethod = BigtableInstanceAdminGrpc.getCreateLogicalViewMethod) + == null) { + BigtableInstanceAdminGrpc.getCreateLogicalViewMethod = + getCreateLogicalViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateLogicalView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateLogicalViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("CreateLogicalView")) + .build(); + } + } + } + return getCreateLogicalViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView> + getGetLogicalViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLogicalView", + requestType = com.google.bigtable.admin.v2.GetLogicalViewRequest.class, + responseType = com.google.bigtable.admin.v2.LogicalView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView> + getGetLogicalViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView> + getGetLogicalViewMethod; + if ((getGetLogicalViewMethod = BigtableInstanceAdminGrpc.getGetLogicalViewMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetLogicalViewMethod = BigtableInstanceAdminGrpc.getGetLogicalViewMethod) == null) { + BigtableInstanceAdminGrpc.getGetLogicalViewMethod = + getGetLogicalViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLogicalView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetLogicalViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.LogicalView.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetLogicalView")) + .build(); + } + } + } + return getGetLogicalViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, + com.google.bigtable.admin.v2.ListLogicalViewsResponse> + getListLogicalViewsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLogicalViews", + requestType = com.google.bigtable.admin.v2.ListLogicalViewsRequest.class, + responseType = com.google.bigtable.admin.v2.ListLogicalViewsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, + com.google.bigtable.admin.v2.ListLogicalViewsResponse> + getListLogicalViewsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, + com.google.bigtable.admin.v2.ListLogicalViewsResponse> + getListLogicalViewsMethod; + if ((getListLogicalViewsMethod = BigtableInstanceAdminGrpc.getListLogicalViewsMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListLogicalViewsMethod = BigtableInstanceAdminGrpc.getListLogicalViewsMethod) + == null) { + BigtableInstanceAdminGrpc.getListLogicalViewsMethod = + getListLogicalViewsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLogicalViews")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListLogicalViewsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListLogicalViewsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListLogicalViews")) + .build(); + } + } + } + return getListLogicalViewsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, com.google.longrunning.Operation> + getUpdateLogicalViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateLogicalView", + requestType = com.google.bigtable.admin.v2.UpdateLogicalViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, com.google.longrunning.Operation> + getUpdateLogicalViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, com.google.longrunning.Operation> + getUpdateLogicalViewMethod; + if ((getUpdateLogicalViewMethod = BigtableInstanceAdminGrpc.getUpdateLogicalViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getUpdateLogicalViewMethod = BigtableInstanceAdminGrpc.getUpdateLogicalViewMethod) + == null) { + BigtableInstanceAdminGrpc.getUpdateLogicalViewMethod = + getUpdateLogicalViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateLogicalView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("UpdateLogicalView")) + .build(); + } + } + } + return getUpdateLogicalViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteLogicalViewRequest, com.google.protobuf.Empty> + getDeleteLogicalViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteLogicalView", + requestType = com.google.bigtable.admin.v2.DeleteLogicalViewRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteLogicalViewRequest, com.google.protobuf.Empty> + getDeleteLogicalViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteLogicalViewRequest, com.google.protobuf.Empty> + getDeleteLogicalViewMethod; + if ((getDeleteLogicalViewMethod = BigtableInstanceAdminGrpc.getDeleteLogicalViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getDeleteLogicalViewMethod = BigtableInstanceAdminGrpc.getDeleteLogicalViewMethod) + == null) { + BigtableInstanceAdminGrpc.getDeleteLogicalViewMethod = + getDeleteLogicalViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteLogicalView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("DeleteLogicalView")) + .build(); + } + } + } + return getDeleteLogicalViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.longrunning.Operation> + getCreateMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateMaterializedView", + requestType = com.google.bigtable.admin.v2.CreateMaterializedViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.longrunning.Operation> + getCreateMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.longrunning.Operation> + getCreateMaterializedViewMethod; + if ((getCreateMaterializedViewMethod = + BigtableInstanceAdminGrpc.getCreateMaterializedViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getCreateMaterializedViewMethod = + BigtableInstanceAdminGrpc.getCreateMaterializedViewMethod) + == null) { + BigtableInstanceAdminGrpc.getCreateMaterializedViewMethod = + getCreateMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier( + "CreateMaterializedView")) + .build(); + } + } + } + return getCreateMaterializedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView> + getGetMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMaterializedView", + requestType = com.google.bigtable.admin.v2.GetMaterializedViewRequest.class, + responseType = com.google.bigtable.admin.v2.MaterializedView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView> + getGetMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView> + getGetMaterializedViewMethod; + if ((getGetMaterializedViewMethod = BigtableInstanceAdminGrpc.getGetMaterializedViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getGetMaterializedViewMethod = BigtableInstanceAdminGrpc.getGetMaterializedViewMethod) + == null) { + BigtableInstanceAdminGrpc.getGetMaterializedViewMethod = + getGetMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetMaterializedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("GetMaterializedView")) + .build(); + } + } + } + return getGetMaterializedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListMaterializedViewsRequest, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse> + getListMaterializedViewsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMaterializedViews", + requestType = com.google.bigtable.admin.v2.ListMaterializedViewsRequest.class, + responseType = com.google.bigtable.admin.v2.ListMaterializedViewsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListMaterializedViewsRequest, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse> + getListMaterializedViewsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListMaterializedViewsRequest, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse> + getListMaterializedViewsMethod; + if ((getListMaterializedViewsMethod = BigtableInstanceAdminGrpc.getListMaterializedViewsMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListMaterializedViewsMethod = + BigtableInstanceAdminGrpc.getListMaterializedViewsMethod) + == null) { + BigtableInstanceAdminGrpc.getListMaterializedViewsMethod = + getListMaterializedViewsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListMaterializedViews")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListMaterializedViewsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier( + "ListMaterializedViews")) + .build(); + } + } + } + return getListMaterializedViewsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.longrunning.Operation> + getUpdateMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateMaterializedView", + requestType = com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.longrunning.Operation> + getUpdateMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.longrunning.Operation> + getUpdateMaterializedViewMethod; + if ((getUpdateMaterializedViewMethod = + BigtableInstanceAdminGrpc.getUpdateMaterializedViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getUpdateMaterializedViewMethod = + BigtableInstanceAdminGrpc.getUpdateMaterializedViewMethod) + == null) { + BigtableInstanceAdminGrpc.getUpdateMaterializedViewMethod = + getUpdateMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier( + "UpdateMaterializedView")) + .build(); + } + } + } + return getUpdateMaterializedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest, com.google.protobuf.Empty> + getDeleteMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteMaterializedView", + requestType = com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest, com.google.protobuf.Empty> + getDeleteMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest, com.google.protobuf.Empty> + getDeleteMaterializedViewMethod; + if ((getDeleteMaterializedViewMethod = + BigtableInstanceAdminGrpc.getDeleteMaterializedViewMethod) + == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getDeleteMaterializedViewMethod = + BigtableInstanceAdminGrpc.getDeleteMaterializedViewMethod) + == null) { + BigtableInstanceAdminGrpc.getDeleteMaterializedViewMethod = + getDeleteMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier( + "DeleteMaterializedView")) + .build(); + } + } + } + return getDeleteMaterializedViewMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static BigtableInstanceAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableInstanceAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminStub(channel, callOptions); + } + }; + return BigtableInstanceAdminStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static BigtableInstanceAdminBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableInstanceAdminBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminBlockingV2Stub(channel, callOptions); + } + }; + return BigtableInstanceAdminBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BigtableInstanceAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableInstanceAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminBlockingStub(channel, callOptions); + } + }; + return BigtableInstanceAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static BigtableInstanceAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableInstanceAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminFutureStub(channel, callOptions); + } + }; + return BigtableInstanceAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create an instance within a project.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + default void createInstance( + com.google.bigtable.admin.v2.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about an instance.
+     * 
+ */ + default void getInstance( + com.google.bigtable.admin.v2.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists information about instances in a project.
+     * 
+ */ + default void listInstances( + com.google.bigtable.admin.v2.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInstancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an instance within a project. This method updates only the display
+     * name and type for an Instance. To update other Instance properties, such as
+     * labels, use PartialUpdateInstance.
+     * 
+ */ + default void updateInstance( + com.google.bigtable.admin.v2.Instance request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates an instance within a project. This method can modify all
+     * fields of an Instance and is the preferred way to update an Instance.
+     * 
+ */ + default void partialUpdateInstance( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPartialUpdateInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete an instance from a project.
+     * 
+ */ + default void deleteInstance( + com.google.bigtable.admin.v2.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteInstanceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a cluster within an instance.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + default void createCluster( + com.google.bigtable.admin.v2.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a cluster.
+     * 
+ */ + default void getCluster( + com.google.bigtable.admin.v2.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists information about clusters in an instance.
+     * 
+ */ + default void listClusters( + com.google.bigtable.admin.v2.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a cluster within an instance.
+     * Note that UpdateCluster does not support updating
+     * cluster_config.cluster_autoscaling_config. In order to update it, you
+     * must use PartialUpdateCluster.
+     * 
+ */ + default void updateCluster( + com.google.bigtable.admin.v2.Cluster request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Partially updates a cluster within a project. This method is the preferred
+     * way to update a Cluster.
+     * To enable and update autoscaling, set
+     * cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
+     * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
+     * are ignored. Note that an update cannot simultaneously set serve_nodes to
+     * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
+     * also specify both in the update_mask.
+     * To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
+     * and explicitly set a serve_node count via the update_mask.
+     * 
+ */ + default void partialUpdateCluster( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPartialUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a cluster from an instance.
+     * 
+ */ + default void deleteCluster( + com.google.bigtable.admin.v2.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an app profile within an instance.
+     * 
+ */ + default void createAppProfile( + com.google.bigtable.admin.v2.CreateAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAppProfileMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about an app profile.
+     * 
+ */ + default void getAppProfile( + com.google.bigtable.admin.v2.GetAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAppProfileMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists information about app profiles in an instance.
+     * 
+ */ + default void listAppProfiles( + com.google.bigtable.admin.v2.ListAppProfilesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAppProfilesMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an app profile within an instance.
+     * 
+ */ + default void updateAppProfile( + com.google.bigtable.admin.v2.UpdateAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAppProfileMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an app profile from an instance.
+     * 
+ */ + default void deleteAppProfile( + com.google.bigtable.admin.v2.DeleteAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAppProfileMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for an instance resource. Returns an empty
+     * policy if an instance exists but does not have a policy set.
+     * 
+ */ + default void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on an instance resource. Replaces any
+     * existing policy.
+     * 
+ */ + default void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified instance resource.
+     * 
+ */ + default void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists hot tablets in a cluster, within the time range provided. Hot
+     * tablets are ordered based on CPU usage.
+     * 
+ */ + default void listHotTablets( + com.google.bigtable.admin.v2.ListHotTabletsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListHotTabletsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a logical view within an instance.
+     * 
+ */ + default void createLogicalView( + com.google.bigtable.admin.v2.CreateLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateLogicalViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a logical view.
+     * 
+ */ + default void getLogicalView( + com.google.bigtable.admin.v2.GetLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLogicalViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists information about logical views in an instance.
+     * 
+ */ + default void listLogicalViews( + com.google.bigtable.admin.v2.ListLogicalViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLogicalViewsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a logical view within an instance.
+     * 
+ */ + default void updateLogicalView( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateLogicalViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a logical view from an instance.
+     * 
+ */ + default void deleteLogicalView( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteLogicalViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a materialized view within an instance.
+     * 
+ */ + default void createMaterializedView( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateMaterializedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information about a materialized view.
+     * 
+ */ + default void getMaterializedView( + com.google.bigtable.admin.v2.GetMaterializedViewRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetMaterializedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists information about materialized views in an instance.
+     * 
+ */ + default void listMaterializedViews( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMaterializedViewsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a materialized view within an instance.
+     * 
+ */ + default void updateMaterializedView( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateMaterializedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a materialized view from an instance.
+     * 
+ */ + default void deleteMaterializedView( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteMaterializedViewMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service BigtableInstanceAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public abstract static class BigtableInstanceAdminImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return BigtableInstanceAdminGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service BigtableInstanceAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public static final class BigtableInstanceAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private BigtableInstanceAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableInstanceAdminStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an instance within a project.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public void createInstance( + com.google.bigtable.admin.v2.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about an instance.
+     * 
+ */ + public void getInstance( + com.google.bigtable.admin.v2.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists information about instances in a project.
+     * 
+ */ + public void listInstances( + com.google.bigtable.admin.v2.ListInstancesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an instance within a project. This method updates only the display
+     * name and type for an Instance. To update other Instance properties, such as
+     * labels, use PartialUpdateInstance.
+     * 
+ */ + public void updateInstance( + com.google.bigtable.admin.v2.Instance request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Partially updates an instance within a project. This method can modify all
+     * fields of an Instance and is the preferred way to update an Instance.
+     * 
+ */ + public void partialUpdateInstance( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPartialUpdateInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete an instance from a project.
+     * 
+ */ + public void deleteInstance( + com.google.bigtable.admin.v2.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a cluster within an instance.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public void createCluster( + com.google.bigtable.admin.v2.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a cluster.
+     * 
+ */ + public void getCluster( + com.google.bigtable.admin.v2.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists information about clusters in an instance.
+     * 
+ */ + public void listClusters( + com.google.bigtable.admin.v2.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a cluster within an instance.
+     * Note that UpdateCluster does not support updating
+     * cluster_config.cluster_autoscaling_config. In order to update it, you
+     * must use PartialUpdateCluster.
+     * 
+ */ + public void updateCluster( + com.google.bigtable.admin.v2.Cluster request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Partially updates a cluster within a project. This method is the preferred
+     * way to update a Cluster.
+     * To enable and update autoscaling, set
+     * cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
+     * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
+     * are ignored. Note that an update cannot simultaneously set serve_nodes to
+     * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
+     * also specify both in the update_mask.
+     * To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
+     * and explicitly set a serve_node count via the update_mask.
+     * 
+ */ + public void partialUpdateCluster( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPartialUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a cluster from an instance.
+     * 
+ */ + public void deleteCluster( + com.google.bigtable.admin.v2.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an app profile within an instance.
+     * 
+ */ + public void createAppProfile( + com.google.bigtable.admin.v2.CreateAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAppProfileMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about an app profile.
+     * 
+ */ + public void getAppProfile( + com.google.bigtable.admin.v2.GetAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAppProfileMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists information about app profiles in an instance.
+     * 
+ */ + public void listAppProfiles( + com.google.bigtable.admin.v2.ListAppProfilesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAppProfilesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an app profile within an instance.
+     * 
+ */ + public void updateAppProfile( + com.google.bigtable.admin.v2.UpdateAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAppProfileMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an app profile from an instance.
+     * 
+ */ + public void deleteAppProfile( + com.google.bigtable.admin.v2.DeleteAppProfileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAppProfileMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for an instance resource. Returns an empty
+     * policy if an instance exists but does not have a policy set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on an instance resource. Replaces any
+     * existing policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified instance resource.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists hot tablets in a cluster, within the time range provided. Hot
+     * tablets are ordered based on CPU usage.
+     * 
+ */ + public void listHotTablets( + com.google.bigtable.admin.v2.ListHotTabletsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListHotTabletsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a logical view within an instance.
+     * 
+ */ + public void createLogicalView( + com.google.bigtable.admin.v2.CreateLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateLogicalViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a logical view.
+     * 
+ */ + public void getLogicalView( + com.google.bigtable.admin.v2.GetLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLogicalViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists information about logical views in an instance.
+     * 
+ */ + public void listLogicalViews( + com.google.bigtable.admin.v2.ListLogicalViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLogicalViewsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a logical view within an instance.
+     * 
+ */ + public void updateLogicalView( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateLogicalViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a logical view from an instance.
+     * 
+ */ + public void deleteLogicalView( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteLogicalViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a materialized view within an instance.
+     * 
+ */ + public void createMaterializedView( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateMaterializedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information about a materialized view.
+     * 
+ */ + public void getMaterializedView( + com.google.bigtable.admin.v2.GetMaterializedViewRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMaterializedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists information about materialized views in an instance.
+     * 
+ */ + public void listMaterializedViews( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMaterializedViewsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a materialized view within an instance.
+     * 
+ */ + public void updateMaterializedView( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMaterializedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a materialized view from an instance.
+     * 
+ */ + public void deleteMaterializedView( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteMaterializedViewMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service BigtableInstanceAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public static final class BigtableInstanceAdminBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableInstanceAdminBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableInstanceAdminBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Create an instance within a project.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.longrunning.Operation createInstance( + com.google.bigtable.admin.v2.CreateInstanceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.Instance getInstance( + com.google.bigtable.admin.v2.GetInstanceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about instances in a project.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListInstancesResponse listInstances( + com.google.bigtable.admin.v2.ListInstancesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an instance within a project. This method updates only the display
+     * name and type for an Instance. To update other Instance properties, such as
+     * labels, use PartialUpdateInstance.
+     * 
+ */ + public com.google.bigtable.admin.v2.Instance updateInstance( + com.google.bigtable.admin.v2.Instance request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates an instance within a project. This method can modify all
+     * fields of an Instance and is the preferred way to update an Instance.
+     * 
+ */ + public com.google.longrunning.Operation partialUpdateInstance( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPartialUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an instance from a project.
+     * 
+ */ + public com.google.protobuf.Empty deleteInstance( + com.google.bigtable.admin.v2.DeleteInstanceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a cluster within an instance.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.bigtable.admin.v2.CreateClusterRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a cluster.
+     * 
+ */ + public com.google.bigtable.admin.v2.Cluster getCluster( + com.google.bigtable.admin.v2.GetClusterRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about clusters in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListClustersResponse listClusters( + com.google.bigtable.admin.v2.ListClustersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a cluster within an instance.
+     * Note that UpdateCluster does not support updating
+     * cluster_config.cluster_autoscaling_config. In order to update it, you
+     * must use PartialUpdateCluster.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.bigtable.admin.v2.Cluster request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a cluster within a project. This method is the preferred
+     * way to update a Cluster.
+     * To enable and update autoscaling, set
+     * cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
+     * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
+     * are ignored. Note that an update cannot simultaneously set serve_nodes to
+     * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
+     * also specify both in the update_mask.
+     * To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
+     * and explicitly set a serve_node count via the update_mask.
+     * 
+ */ + public com.google.longrunning.Operation partialUpdateCluster( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPartialUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a cluster from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteCluster( + com.google.bigtable.admin.v2.DeleteClusterRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an app profile within an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.AppProfile createAppProfile( + com.google.bigtable.admin.v2.CreateAppProfileRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about an app profile.
+     * 
+ */ + public com.google.bigtable.admin.v2.AppProfile getAppProfile( + com.google.bigtable.admin.v2.GetAppProfileRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about app profiles in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListAppProfilesResponse listAppProfiles( + com.google.bigtable.admin.v2.ListAppProfilesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListAppProfilesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an app profile within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateAppProfile( + com.google.bigtable.admin.v2.UpdateAppProfileRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an app profile from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteAppProfile( + com.google.bigtable.admin.v2.DeleteAppProfileRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for an instance resource. Returns an empty
+     * policy if an instance exists but does not have a policy set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on an instance resource. Replaces any
+     * existing policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified instance resource.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists hot tablets in a cluster, within the time range provided. Hot
+     * tablets are ordered based on CPU usage.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListHotTabletsResponse listHotTablets( + com.google.bigtable.admin.v2.ListHotTabletsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListHotTabletsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a logical view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation createLogicalView( + com.google.bigtable.admin.v2.CreateLogicalViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a logical view.
+     * 
+ */ + public com.google.bigtable.admin.v2.LogicalView getLogicalView( + com.google.bigtable.admin.v2.GetLogicalViewRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about logical views in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListLogicalViewsResponse listLogicalViews( + com.google.bigtable.admin.v2.ListLogicalViewsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLogicalViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a logical view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateLogicalView( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a logical view from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteLogicalView( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a materialized view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation createMaterializedView( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a materialized view.
+     * 
+ */ + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView( + com.google.bigtable.admin.v2.GetMaterializedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about materialized views in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListMaterializedViewsResponse listMaterializedViews( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMaterializedViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a materialized view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateMaterializedView( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a materialized view from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteMaterializedView( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteMaterializedViewMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service BigtableInstanceAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public static final class BigtableInstanceAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableInstanceAdminBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableInstanceAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an instance within a project.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.longrunning.Operation createInstance( + com.google.bigtable.admin.v2.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.Instance getInstance( + com.google.bigtable.admin.v2.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about instances in a project.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListInstancesResponse listInstances( + com.google.bigtable.admin.v2.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an instance within a project. This method updates only the display
+     * name and type for an Instance. To update other Instance properties, such as
+     * labels, use PartialUpdateInstance.
+     * 
+ */ + public com.google.bigtable.admin.v2.Instance updateInstance( + com.google.bigtable.admin.v2.Instance request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates an instance within a project. This method can modify all
+     * fields of an Instance and is the preferred way to update an Instance.
+     * 
+ */ + public com.google.longrunning.Operation partialUpdateInstance( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPartialUpdateInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete an instance from a project.
+     * 
+ */ + public com.google.protobuf.Empty deleteInstance( + com.google.bigtable.admin.v2.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a cluster within an instance.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.bigtable.admin.v2.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a cluster.
+     * 
+ */ + public com.google.bigtable.admin.v2.Cluster getCluster( + com.google.bigtable.admin.v2.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about clusters in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListClustersResponse listClusters( + com.google.bigtable.admin.v2.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a cluster within an instance.
+     * Note that UpdateCluster does not support updating
+     * cluster_config.cluster_autoscaling_config. In order to update it, you
+     * must use PartialUpdateCluster.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.bigtable.admin.v2.Cluster request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Partially updates a cluster within a project. This method is the preferred
+     * way to update a Cluster.
+     * To enable and update autoscaling, set
+     * cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
+     * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
+     * are ignored. Note that an update cannot simultaneously set serve_nodes to
+     * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
+     * also specify both in the update_mask.
+     * To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
+     * and explicitly set a serve_node count via the update_mask.
+     * 
+ */ + public com.google.longrunning.Operation partialUpdateCluster( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPartialUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a cluster from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteCluster( + com.google.bigtable.admin.v2.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an app profile within an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.AppProfile createAppProfile( + com.google.bigtable.admin.v2.CreateAppProfileRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about an app profile.
+     * 
+ */ + public com.google.bigtable.admin.v2.AppProfile getAppProfile( + com.google.bigtable.admin.v2.GetAppProfileRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about app profiles in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListAppProfilesResponse listAppProfiles( + com.google.bigtable.admin.v2.ListAppProfilesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAppProfilesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an app profile within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateAppProfile( + com.google.bigtable.admin.v2.UpdateAppProfileRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an app profile from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteAppProfile( + com.google.bigtable.admin.v2.DeleteAppProfileRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAppProfileMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for an instance resource. Returns an empty
+     * policy if an instance exists but does not have a policy set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on an instance resource. Replaces any
+     * existing policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified instance resource.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists hot tablets in a cluster, within the time range provided. Hot
+     * tablets are ordered based on CPU usage.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListHotTabletsResponse listHotTablets( + com.google.bigtable.admin.v2.ListHotTabletsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListHotTabletsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a logical view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation createLogicalView( + com.google.bigtable.admin.v2.CreateLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a logical view.
+     * 
+ */ + public com.google.bigtable.admin.v2.LogicalView getLogicalView( + com.google.bigtable.admin.v2.GetLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about logical views in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListLogicalViewsResponse listLogicalViews( + com.google.bigtable.admin.v2.ListLogicalViewsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLogicalViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a logical view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateLogicalView( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a logical view from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteLogicalView( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteLogicalViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a materialized view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation createMaterializedView( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information about a materialized view.
+     * 
+ */ + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView( + com.google.bigtable.admin.v2.GetMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists information about materialized views in an instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListMaterializedViewsResponse listMaterializedViews( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMaterializedViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a materialized view within an instance.
+     * 
+ */ + public com.google.longrunning.Operation updateMaterializedView( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMaterializedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a materialized view from an instance.
+     * 
+ */ + public com.google.protobuf.Empty deleteMaterializedView( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteMaterializedViewMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * BigtableInstanceAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable Instances and
+   * Clusters. Provides access to the Instance and Cluster schemas only, not the
+   * tables' metadata or data stored in those tables.
+   * 
+ */ + public static final class BigtableInstanceAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private BigtableInstanceAdminFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableInstanceAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create an instance within a project.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createInstance(com.google.bigtable.admin.v2.CreateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getInstance(com.google.bigtable.admin.v2.GetInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists information about instances in a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListInstancesResponse> + listInstances(com.google.bigtable.admin.v2.ListInstancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an instance within a project. This method updates only the display
+     * name and type for an Instance. To update other Instance properties, such as
+     * labels, use PartialUpdateInstance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateInstance(com.google.bigtable.admin.v2.Instance request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates an instance within a project. This method can modify all
+     * fields of an Instance and is the preferred way to update an Instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + partialUpdateInstance(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPartialUpdateInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete an instance from a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteInstance(com.google.bigtable.admin.v2.DeleteInstanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a cluster within an instance.
+     * Note that exactly one of Cluster.serve_nodes and
+     * Cluster.cluster_config.cluster_autoscaling_config can be set. If
+     * serve_nodes is set to non-zero, then the cluster is manually scaled. If
+     * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
+     * enabled.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.bigtable.admin.v2.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getCluster(com.google.bigtable.admin.v2.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists information about clusters in an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListClustersResponse> + listClusters(com.google.bigtable.admin.v2.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a cluster within an instance.
+     * Note that UpdateCluster does not support updating
+     * cluster_config.cluster_autoscaling_config. In order to update it, you
+     * must use PartialUpdateCluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.bigtable.admin.v2.Cluster request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Partially updates a cluster within a project. This method is the preferred
+     * way to update a Cluster.
+     * To enable and update autoscaling, set
+     * cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
+     * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
+     * are ignored. Note that an update cannot simultaneously set serve_nodes to
+     * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
+     * also specify both in the update_mask.
+     * To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
+     * and explicitly set a serve_node count via the update_mask.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + partialUpdateCluster(com.google.bigtable.admin.v2.PartialUpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPartialUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a cluster from an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.bigtable.admin.v2.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an app profile within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.AppProfile> + createAppProfile(com.google.bigtable.admin.v2.CreateAppProfileRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAppProfileMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about an app profile.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.AppProfile> + getAppProfile(com.google.bigtable.admin.v2.GetAppProfileRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAppProfileMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists information about app profiles in an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListAppProfilesResponse> + listAppProfiles(com.google.bigtable.admin.v2.ListAppProfilesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAppProfilesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an app profile within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAppProfile(com.google.bigtable.admin.v2.UpdateAppProfileRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAppProfileMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an app profile from an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAppProfileMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the access control policy for an instance resource. Returns an empty
+     * policy if an instance exists but does not have a policy set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy on an instance resource. Replaces any
+     * existing policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified instance resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists hot tablets in a cluster, within the time range provided. Hot
+     * tablets are ordered based on CPU usage.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListHotTabletsResponse> + listHotTablets(com.google.bigtable.admin.v2.ListHotTabletsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListHotTabletsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a logical view within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createLogicalView(com.google.bigtable.admin.v2.CreateLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateLogicalViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a logical view.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.LogicalView> + getLogicalView(com.google.bigtable.admin.v2.GetLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLogicalViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists information about logical views in an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListLogicalViewsResponse> + listLogicalViews(com.google.bigtable.admin.v2.ListLogicalViewsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLogicalViewsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a logical view within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateLogicalView(com.google.bigtable.admin.v2.UpdateLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateLogicalViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a logical view from an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteLogicalView(com.google.bigtable.admin.v2.DeleteLogicalViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteLogicalViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a materialized view within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createMaterializedView(com.google.bigtable.admin.v2.CreateMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateMaterializedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information about a materialized view.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.MaterializedView> + getMaterializedView(com.google.bigtable.admin.v2.GetMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMaterializedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists information about materialized views in an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListMaterializedViewsResponse> + listMaterializedViews(com.google.bigtable.admin.v2.ListMaterializedViewsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMaterializedViewsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a materialized view within an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateMaterializedView(com.google.bigtable.admin.v2.UpdateMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMaterializedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a materialized view from an instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteMaterializedView(com.google.bigtable.admin.v2.DeleteMaterializedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteMaterializedViewMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_INSTANCE = 0; + private static final int METHODID_GET_INSTANCE = 1; + private static final int METHODID_LIST_INSTANCES = 2; + private static final int METHODID_UPDATE_INSTANCE = 3; + private static final int METHODID_PARTIAL_UPDATE_INSTANCE = 4; + private static final int METHODID_DELETE_INSTANCE = 5; + private static final int METHODID_CREATE_CLUSTER = 6; + private static final int METHODID_GET_CLUSTER = 7; + private static final int METHODID_LIST_CLUSTERS = 8; + private static final int METHODID_UPDATE_CLUSTER = 9; + private static final int METHODID_PARTIAL_UPDATE_CLUSTER = 10; + private static final int METHODID_DELETE_CLUSTER = 11; + private static final int METHODID_CREATE_APP_PROFILE = 12; + private static final int METHODID_GET_APP_PROFILE = 13; + private static final int METHODID_LIST_APP_PROFILES = 14; + private static final int METHODID_UPDATE_APP_PROFILE = 15; + private static final int METHODID_DELETE_APP_PROFILE = 16; + private static final int METHODID_GET_IAM_POLICY = 17; + private static final int METHODID_SET_IAM_POLICY = 18; + private static final int METHODID_TEST_IAM_PERMISSIONS = 19; + private static final int METHODID_LIST_HOT_TABLETS = 20; + private static final int METHODID_CREATE_LOGICAL_VIEW = 21; + private static final int METHODID_GET_LOGICAL_VIEW = 22; + private static final int METHODID_LIST_LOGICAL_VIEWS = 23; + private static final int METHODID_UPDATE_LOGICAL_VIEW = 24; + private static final int METHODID_DELETE_LOGICAL_VIEW = 25; + private static final int METHODID_CREATE_MATERIALIZED_VIEW = 26; + private static final int METHODID_GET_MATERIALIZED_VIEW = 27; + private static final int METHODID_LIST_MATERIALIZED_VIEWS = 28; + private static final int METHODID_UPDATE_MATERIALIZED_VIEW = 29; + private static final int METHODID_DELETE_MATERIALIZED_VIEW = 30; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance( + (com.google.bigtable.admin.v2.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance( + (com.google.bigtable.admin.v2.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances( + (com.google.bigtable.admin.v2.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance( + (com.google.bigtable.admin.v2.Instance) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PARTIAL_UPDATE_INSTANCE: + serviceImpl.partialUpdateInstance( + (com.google.bigtable.admin.v2.PartialUpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance( + (com.google.bigtable.admin.v2.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.bigtable.admin.v2.CreateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.bigtable.admin.v2.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CLUSTERS: + serviceImpl.listClusters( + (com.google.bigtable.admin.v2.ListClustersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.bigtable.admin.v2.Cluster) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PARTIAL_UPDATE_CLUSTER: + serviceImpl.partialUpdateCluster( + (com.google.bigtable.admin.v2.PartialUpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.bigtable.admin.v2.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_APP_PROFILE: + serviceImpl.createAppProfile( + (com.google.bigtable.admin.v2.CreateAppProfileRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_APP_PROFILE: + serviceImpl.getAppProfile( + (com.google.bigtable.admin.v2.GetAppProfileRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_APP_PROFILES: + serviceImpl.listAppProfiles( + (com.google.bigtable.admin.v2.ListAppProfilesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_APP_PROFILE: + serviceImpl.updateAppProfile( + (com.google.bigtable.admin.v2.UpdateAppProfileRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_APP_PROFILE: + serviceImpl.deleteAppProfile( + (com.google.bigtable.admin.v2.DeleteAppProfileRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_HOT_TABLETS: + serviceImpl.listHotTablets( + (com.google.bigtable.admin.v2.ListHotTabletsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_LOGICAL_VIEW: + serviceImpl.createLogicalView( + (com.google.bigtable.admin.v2.CreateLogicalViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_LOGICAL_VIEW: + serviceImpl.getLogicalView( + (com.google.bigtable.admin.v2.GetLogicalViewRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_LOGICAL_VIEWS: + serviceImpl.listLogicalViews( + (com.google.bigtable.admin.v2.ListLogicalViewsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_LOGICAL_VIEW: + serviceImpl.updateLogicalView( + (com.google.bigtable.admin.v2.UpdateLogicalViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_LOGICAL_VIEW: + serviceImpl.deleteLogicalView( + (com.google.bigtable.admin.v2.DeleteLogicalViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_MATERIALIZED_VIEW: + serviceImpl.createMaterializedView( + (com.google.bigtable.admin.v2.CreateMaterializedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_MATERIALIZED_VIEW: + serviceImpl.getMaterializedView( + (com.google.bigtable.admin.v2.GetMaterializedViewRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MATERIALIZED_VIEWS: + serviceImpl.listMaterializedViews( + (com.google.bigtable.admin.v2.ListMaterializedViewsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.bigtable.admin.v2.ListMaterializedViewsResponse>) + responseObserver); + break; + case METHODID_UPDATE_MATERIALIZED_VIEW: + serviceImpl.updateMaterializedView( + (com.google.bigtable.admin.v2.UpdateMaterializedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_MATERIALIZED_VIEW: + serviceImpl.deleteMaterializedView( + (com.google.bigtable.admin.v2.DeleteMaterializedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateInstanceRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_INSTANCE))) + .addMethod( + getGetInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetInstanceRequest, + com.google.bigtable.admin.v2.Instance>(service, METHODID_GET_INSTANCE))) + .addMethod( + getListInstancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListInstancesRequest, + com.google.bigtable.admin.v2.ListInstancesResponse>( + service, METHODID_LIST_INSTANCES))) + .addMethod( + getUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance>( + service, METHODID_UPDATE_INSTANCE))) + .addMethod( + getPartialUpdateInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.longrunning.Operation>(service, METHODID_PARTIAL_UPDATE_INSTANCE))) + .addMethod( + getDeleteInstanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteInstanceRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_INSTANCE))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_CLUSTER))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetClusterRequest, + com.google.bigtable.admin.v2.Cluster>(service, METHODID_GET_CLUSTER))) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListClustersRequest, + com.google.bigtable.admin.v2.ListClustersResponse>( + service, METHODID_LIST_CLUSTERS))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.Cluster, com.google.longrunning.Operation>( + service, METHODID_UPDATE_CLUSTER))) + .addMethod( + getPartialUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_PARTIAL_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_CLUSTER))) + .addMethod( + getCreateAppProfileMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile>(service, METHODID_CREATE_APP_PROFILE))) + .addMethod( + getGetAppProfileMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetAppProfileRequest, + com.google.bigtable.admin.v2.AppProfile>(service, METHODID_GET_APP_PROFILE))) + .addMethod( + getListAppProfilesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListAppProfilesRequest, + com.google.bigtable.admin.v2.ListAppProfilesResponse>( + service, METHODID_LIST_APP_PROFILES))) + .addMethod( + getUpdateAppProfileMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateAppProfileRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_APP_PROFILE))) + .addMethod( + getDeleteAppProfileMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteAppProfileRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_APP_PROFILE))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + service, METHODID_TEST_IAM_PERMISSIONS))) + .addMethod( + getListHotTabletsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse>( + service, METHODID_LIST_HOT_TABLETS))) + .addMethod( + getCreateLogicalViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_LOGICAL_VIEW))) + .addMethod( + getGetLogicalViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView>(service, METHODID_GET_LOGICAL_VIEW))) + .addMethod( + getListLogicalViewsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, + com.google.bigtable.admin.v2.ListLogicalViewsResponse>( + service, METHODID_LIST_LOGICAL_VIEWS))) + .addMethod( + getUpdateLogicalViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_LOGICAL_VIEW))) + .addMethod( + getDeleteLogicalViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteLogicalViewRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_LOGICAL_VIEW))) + .addMethod( + getCreateMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_MATERIALIZED_VIEW))) + .addMethod( + getGetMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetMaterializedViewRequest, + com.google.bigtable.admin.v2.MaterializedView>( + service, METHODID_GET_MATERIALIZED_VIEW))) + .addMethod( + getListMaterializedViewsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListMaterializedViewsRequest, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse>( + service, METHODID_LIST_MATERIALIZED_VIEWS))) + .addMethod( + getUpdateMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_MATERIALIZED_VIEW))) + .addMethod( + getDeleteMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_MATERIALIZED_VIEW))) + .build(); + } + + private abstract static class BigtableInstanceAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BigtableInstanceAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("BigtableInstanceAdmin"); + } + } + + private static final class BigtableInstanceAdminFileDescriptorSupplier + extends BigtableInstanceAdminBaseDescriptorSupplier { + BigtableInstanceAdminFileDescriptorSupplier() {} + } + + private static final class BigtableInstanceAdminMethodDescriptorSupplier + extends BigtableInstanceAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + BigtableInstanceAdminMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BigtableInstanceAdminFileDescriptorSupplier()) + .addMethod(getCreateInstanceMethod()) + .addMethod(getGetInstanceMethod()) + .addMethod(getListInstancesMethod()) + .addMethod(getUpdateInstanceMethod()) + .addMethod(getPartialUpdateInstanceMethod()) + .addMethod(getDeleteInstanceMethod()) + .addMethod(getCreateClusterMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getListClustersMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getPartialUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getCreateAppProfileMethod()) + .addMethod(getGetAppProfileMethod()) + .addMethod(getListAppProfilesMethod()) + .addMethod(getUpdateAppProfileMethod()) + .addMethod(getDeleteAppProfileMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .addMethod(getListHotTabletsMethod()) + .addMethod(getCreateLogicalViewMethod()) + .addMethod(getGetLogicalViewMethod()) + .addMethod(getListLogicalViewsMethod()) + .addMethod(getUpdateLogicalViewMethod()) + .addMethod(getDeleteLogicalViewMethod()) + .addMethod(getCreateMaterializedViewMethod()) + .addMethod(getGetMaterializedViewMethod()) + .addMethod(getListMaterializedViewsMethod()) + .addMethod(getUpdateMaterializedViewMethod()) + .addMethod(getDeleteMaterializedViewMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java new file mode 100644 index 000000000000..c827b0c4a76b --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java @@ -0,0 +1,5082 @@ +/* + * Copyright 2026 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.admin.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for creating, configuring, and deleting Cloud Bigtable tables.
+ * Provides access to the table schemas only, not the data stored within
+ * the tables.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class BigtableTableAdminGrpc { + + private BigtableTableAdminGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.bigtable.admin.v2.BigtableTableAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableRequest, com.google.bigtable.admin.v2.Table> + getCreateTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTable", + requestType = com.google.bigtable.admin.v2.CreateTableRequest.class, + responseType = com.google.bigtable.admin.v2.Table.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableRequest, com.google.bigtable.admin.v2.Table> + getCreateTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableRequest, com.google.bigtable.admin.v2.Table> + getCreateTableMethod; + if ((getCreateTableMethod = BigtableTableAdminGrpc.getCreateTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCreateTableMethod = BigtableTableAdminGrpc.getCreateTableMethod) == null) { + BigtableTableAdminGrpc.getCreateTableMethod = + getCreateTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Table.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CreateTable")) + .build(); + } + } + } + return getCreateTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.longrunning.Operation> + getCreateTableFromSnapshotMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTableFromSnapshot", + requestType = com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.longrunning.Operation> + getCreateTableFromSnapshotMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.longrunning.Operation> + getCreateTableFromSnapshotMethod; + if ((getCreateTableFromSnapshotMethod = BigtableTableAdminGrpc.getCreateTableFromSnapshotMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCreateTableFromSnapshotMethod = + BigtableTableAdminGrpc.getCreateTableFromSnapshotMethod) + == null) { + BigtableTableAdminGrpc.getCreateTableFromSnapshotMethod = + getCreateTableFromSnapshotMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateTableFromSnapshot")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CreateTableFromSnapshot")) + .build(); + } + } + } + return getCreateTableFromSnapshotMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListTablesRequest, + com.google.bigtable.admin.v2.ListTablesResponse> + getListTablesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTables", + requestType = com.google.bigtable.admin.v2.ListTablesRequest.class, + responseType = com.google.bigtable.admin.v2.ListTablesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListTablesRequest, + com.google.bigtable.admin.v2.ListTablesResponse> + getListTablesMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListTablesRequest, + com.google.bigtable.admin.v2.ListTablesResponse> + getListTablesMethod; + if ((getListTablesMethod = BigtableTableAdminGrpc.getListTablesMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getListTablesMethod = BigtableTableAdminGrpc.getListTablesMethod) == null) { + BigtableTableAdminGrpc.getListTablesMethod = + getListTablesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTables")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListTablesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ListTables")) + .build(); + } + } + } + return getListTablesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetTableRequest, com.google.bigtable.admin.v2.Table> + getGetTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTable", + requestType = com.google.bigtable.admin.v2.GetTableRequest.class, + responseType = com.google.bigtable.admin.v2.Table.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetTableRequest, com.google.bigtable.admin.v2.Table> + getGetTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetTableRequest, com.google.bigtable.admin.v2.Table> + getGetTableMethod; + if ((getGetTableMethod = BigtableTableAdminGrpc.getGetTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetTableMethod = BigtableTableAdminGrpc.getGetTableMethod) == null) { + BigtableTableAdminGrpc.getGetTableMethod = + getGetTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetTableRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Table.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetTable")) + .build(); + } + } + } + return getGetTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateTableRequest, com.google.longrunning.Operation> + getUpdateTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateTable", + requestType = com.google.bigtable.admin.v2.UpdateTableRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateTableRequest, com.google.longrunning.Operation> + getUpdateTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateTableRequest, com.google.longrunning.Operation> + getUpdateTableMethod; + if ((getUpdateTableMethod = BigtableTableAdminGrpc.getUpdateTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getUpdateTableMethod = BigtableTableAdminGrpc.getUpdateTableMethod) == null) { + BigtableTableAdminGrpc.getUpdateTableMethod = + getUpdateTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateTableRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("UpdateTable")) + .build(); + } + } + } + return getUpdateTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty> + getDeleteTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTable", + requestType = com.google.bigtable.admin.v2.DeleteTableRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty> + getDeleteTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty> + getDeleteTableMethod; + if ((getDeleteTableMethod = BigtableTableAdminGrpc.getDeleteTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDeleteTableMethod = BigtableTableAdminGrpc.getDeleteTableMethod) == null) { + BigtableTableAdminGrpc.getDeleteTableMethod = + getDeleteTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteTableRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DeleteTable")) + .build(); + } + } + } + return getDeleteTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UndeleteTableRequest, com.google.longrunning.Operation> + getUndeleteTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteTable", + requestType = com.google.bigtable.admin.v2.UndeleteTableRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UndeleteTableRequest, com.google.longrunning.Operation> + getUndeleteTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UndeleteTableRequest, com.google.longrunning.Operation> + getUndeleteTableMethod; + if ((getUndeleteTableMethod = BigtableTableAdminGrpc.getUndeleteTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getUndeleteTableMethod = BigtableTableAdminGrpc.getUndeleteTableMethod) == null) { + BigtableTableAdminGrpc.getUndeleteTableMethod = + getUndeleteTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UndeleteTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UndeleteTableRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("UndeleteTable")) + .build(); + } + } + } + return getUndeleteTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.longrunning.Operation> + getCreateAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAuthorizedView", + requestType = com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.longrunning.Operation> + getCreateAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.longrunning.Operation> + getCreateAuthorizedViewMethod; + if ((getCreateAuthorizedViewMethod = BigtableTableAdminGrpc.getCreateAuthorizedViewMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCreateAuthorizedViewMethod = BigtableTableAdminGrpc.getCreateAuthorizedViewMethod) + == null) { + BigtableTableAdminGrpc.getCreateAuthorizedViewMethod = + getCreateAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CreateAuthorizedView")) + .build(); + } + } + } + return getCreateAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse> + getListAuthorizedViewsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAuthorizedViews", + requestType = com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.class, + responseType = com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse> + getListAuthorizedViewsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse> + getListAuthorizedViewsMethod; + if ((getListAuthorizedViewsMethod = BigtableTableAdminGrpc.getListAuthorizedViewsMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getListAuthorizedViewsMethod = BigtableTableAdminGrpc.getListAuthorizedViewsMethod) + == null) { + BigtableTableAdminGrpc.getListAuthorizedViewsMethod = + getListAuthorizedViewsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAuthorizedViews")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ListAuthorizedViews")) + .build(); + } + } + } + return getListAuthorizedViewsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView> + getGetAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAuthorizedView", + requestType = com.google.bigtable.admin.v2.GetAuthorizedViewRequest.class, + responseType = com.google.bigtable.admin.v2.AuthorizedView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView> + getGetAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView> + getGetAuthorizedViewMethod; + if ((getGetAuthorizedViewMethod = BigtableTableAdminGrpc.getGetAuthorizedViewMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetAuthorizedViewMethod = BigtableTableAdminGrpc.getGetAuthorizedViewMethod) + == null) { + BigtableTableAdminGrpc.getGetAuthorizedViewMethod = + getGetAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetAuthorizedView")) + .build(); + } + } + } + return getGetAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.longrunning.Operation> + getUpdateAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAuthorizedView", + requestType = com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.longrunning.Operation> + getUpdateAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.longrunning.Operation> + getUpdateAuthorizedViewMethod; + if ((getUpdateAuthorizedViewMethod = BigtableTableAdminGrpc.getUpdateAuthorizedViewMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getUpdateAuthorizedViewMethod = BigtableTableAdminGrpc.getUpdateAuthorizedViewMethod) + == null) { + BigtableTableAdminGrpc.getUpdateAuthorizedViewMethod = + getUpdateAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("UpdateAuthorizedView")) + .build(); + } + } + } + return getUpdateAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, com.google.protobuf.Empty> + getDeleteAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAuthorizedView", + requestType = com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, com.google.protobuf.Empty> + getDeleteAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, com.google.protobuf.Empty> + getDeleteAuthorizedViewMethod; + if ((getDeleteAuthorizedViewMethod = BigtableTableAdminGrpc.getDeleteAuthorizedViewMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDeleteAuthorizedViewMethod = BigtableTableAdminGrpc.getDeleteAuthorizedViewMethod) + == null) { + BigtableTableAdminGrpc.getDeleteAuthorizedViewMethod = + getDeleteAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DeleteAuthorizedView")) + .build(); + } + } + } + return getDeleteAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, + com.google.bigtable.admin.v2.Table> + getModifyColumnFamiliesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ModifyColumnFamilies", + requestType = com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.class, + responseType = com.google.bigtable.admin.v2.Table.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, + com.google.bigtable.admin.v2.Table> + getModifyColumnFamiliesMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, + com.google.bigtable.admin.v2.Table> + getModifyColumnFamiliesMethod; + if ((getModifyColumnFamiliesMethod = BigtableTableAdminGrpc.getModifyColumnFamiliesMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getModifyColumnFamiliesMethod = BigtableTableAdminGrpc.getModifyColumnFamiliesMethod) + == null) { + BigtableTableAdminGrpc.getModifyColumnFamiliesMethod = + getModifyColumnFamiliesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ModifyColumnFamilies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Table.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ModifyColumnFamilies")) + .build(); + } + } + } + return getModifyColumnFamiliesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty> + getDropRowRangeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DropRowRange", + requestType = com.google.bigtable.admin.v2.DropRowRangeRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty> + getDropRowRangeMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty> + getDropRowRangeMethod; + if ((getDropRowRangeMethod = BigtableTableAdminGrpc.getDropRowRangeMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDropRowRangeMethod = BigtableTableAdminGrpc.getDropRowRangeMethod) == null) { + BigtableTableAdminGrpc.getDropRowRangeMethod = + getDropRowRangeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DropRowRange")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DropRowRangeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DropRowRange")) + .build(); + } + } + } + return getDropRowRangeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> + getGenerateConsistencyTokenMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateConsistencyToken", + requestType = com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.class, + responseType = com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> + getGenerateConsistencyTokenMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> + getGenerateConsistencyTokenMethod; + if ((getGenerateConsistencyTokenMethod = + BigtableTableAdminGrpc.getGenerateConsistencyTokenMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGenerateConsistencyTokenMethod = + BigtableTableAdminGrpc.getGenerateConsistencyTokenMethod) + == null) { + BigtableTableAdminGrpc.getGenerateConsistencyTokenMethod = + getGenerateConsistencyTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateConsistencyToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier( + "GenerateConsistencyToken")) + .build(); + } + } + } + return getGenerateConsistencyTokenMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CheckConsistencyRequest, + com.google.bigtable.admin.v2.CheckConsistencyResponse> + getCheckConsistencyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CheckConsistency", + requestType = com.google.bigtable.admin.v2.CheckConsistencyRequest.class, + responseType = com.google.bigtable.admin.v2.CheckConsistencyResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CheckConsistencyRequest, + com.google.bigtable.admin.v2.CheckConsistencyResponse> + getCheckConsistencyMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CheckConsistencyRequest, + com.google.bigtable.admin.v2.CheckConsistencyResponse> + getCheckConsistencyMethod; + if ((getCheckConsistencyMethod = BigtableTableAdminGrpc.getCheckConsistencyMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCheckConsistencyMethod = BigtableTableAdminGrpc.getCheckConsistencyMethod) + == null) { + BigtableTableAdminGrpc.getCheckConsistencyMethod = + getCheckConsistencyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CheckConsistency")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CheckConsistencyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CheckConsistencyResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CheckConsistency")) + .build(); + } + } + } + return getCheckConsistencyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.SnapshotTableRequest, com.google.longrunning.Operation> + getSnapshotTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SnapshotTable", + requestType = com.google.bigtable.admin.v2.SnapshotTableRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.SnapshotTableRequest, com.google.longrunning.Operation> + getSnapshotTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.SnapshotTableRequest, com.google.longrunning.Operation> + getSnapshotTableMethod; + if ((getSnapshotTableMethod = BigtableTableAdminGrpc.getSnapshotTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getSnapshotTableMethod = BigtableTableAdminGrpc.getSnapshotTableMethod) == null) { + BigtableTableAdminGrpc.getSnapshotTableMethod = + getSnapshotTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SnapshotTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.SnapshotTableRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("SnapshotTable")) + .build(); + } + } + } + return getSnapshotTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSnapshotRequest, com.google.bigtable.admin.v2.Snapshot> + getGetSnapshotMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSnapshot", + requestType = com.google.bigtable.admin.v2.GetSnapshotRequest.class, + responseType = com.google.bigtable.admin.v2.Snapshot.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSnapshotRequest, com.google.bigtable.admin.v2.Snapshot> + getGetSnapshotMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSnapshotRequest, com.google.bigtable.admin.v2.Snapshot> + getGetSnapshotMethod; + if ((getGetSnapshotMethod = BigtableTableAdminGrpc.getGetSnapshotMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetSnapshotMethod = BigtableTableAdminGrpc.getGetSnapshotMethod) == null) { + BigtableTableAdminGrpc.getGetSnapshotMethod = + getGetSnapshotMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSnapshot")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Snapshot.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetSnapshot")) + .build(); + } + } + } + return getGetSnapshotMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSnapshotsRequest, + com.google.bigtable.admin.v2.ListSnapshotsResponse> + getListSnapshotsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSnapshots", + requestType = com.google.bigtable.admin.v2.ListSnapshotsRequest.class, + responseType = com.google.bigtable.admin.v2.ListSnapshotsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSnapshotsRequest, + com.google.bigtable.admin.v2.ListSnapshotsResponse> + getListSnapshotsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSnapshotsRequest, + com.google.bigtable.admin.v2.ListSnapshotsResponse> + getListSnapshotsMethod; + if ((getListSnapshotsMethod = BigtableTableAdminGrpc.getListSnapshotsMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getListSnapshotsMethod = BigtableTableAdminGrpc.getListSnapshotsMethod) == null) { + BigtableTableAdminGrpc.getListSnapshotsMethod = + getListSnapshotsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSnapshots")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListSnapshotsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListSnapshotsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ListSnapshots")) + .build(); + } + } + } + return getListSnapshotsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSnapshotRequest, com.google.protobuf.Empty> + getDeleteSnapshotMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSnapshot", + requestType = com.google.bigtable.admin.v2.DeleteSnapshotRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSnapshotRequest, com.google.protobuf.Empty> + getDeleteSnapshotMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSnapshotRequest, com.google.protobuf.Empty> + getDeleteSnapshotMethod; + if ((getDeleteSnapshotMethod = BigtableTableAdminGrpc.getDeleteSnapshotMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDeleteSnapshotMethod = BigtableTableAdminGrpc.getDeleteSnapshotMethod) == null) { + BigtableTableAdminGrpc.getDeleteSnapshotMethod = + getDeleteSnapshotMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSnapshot")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteSnapshotRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DeleteSnapshot")) + .build(); + } + } + } + return getDeleteSnapshotMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBackup", + requestType = com.google.bigtable.admin.v2.CreateBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateBackupRequest, com.google.longrunning.Operation> + getCreateBackupMethod; + if ((getCreateBackupMethod = BigtableTableAdminGrpc.getCreateBackupMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCreateBackupMethod = BigtableTableAdminGrpc.getCreateBackupMethod) == null) { + BigtableTableAdminGrpc.getCreateBackupMethod = + getCreateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CreateBackup")) + .build(); + } + } + } + return getCreateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetBackupRequest, com.google.bigtable.admin.v2.Backup> + getGetBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBackup", + requestType = com.google.bigtable.admin.v2.GetBackupRequest.class, + responseType = com.google.bigtable.admin.v2.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetBackupRequest, com.google.bigtable.admin.v2.Backup> + getGetBackupMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetBackupRequest, com.google.bigtable.admin.v2.Backup> + getGetBackupMethod; + if ((getGetBackupMethod = BigtableTableAdminGrpc.getGetBackupMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetBackupMethod = BigtableTableAdminGrpc.getGetBackupMethod) == null) { + BigtableTableAdminGrpc.getGetBackupMethod = + getGetBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetBackup")) + .build(); + } + } + } + return getGetBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateBackupRequest, com.google.bigtable.admin.v2.Backup> + getUpdateBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBackup", + requestType = com.google.bigtable.admin.v2.UpdateBackupRequest.class, + responseType = com.google.bigtable.admin.v2.Backup.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateBackupRequest, com.google.bigtable.admin.v2.Backup> + getUpdateBackupMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateBackupRequest, com.google.bigtable.admin.v2.Backup> + getUpdateBackupMethod; + if ((getUpdateBackupMethod = BigtableTableAdminGrpc.getUpdateBackupMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getUpdateBackupMethod = BigtableTableAdminGrpc.getUpdateBackupMethod) == null) { + BigtableTableAdminGrpc.getUpdateBackupMethod = + getUpdateBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.Backup.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("UpdateBackup")) + .build(); + } + } + } + return getUpdateBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBackup", + requestType = com.google.bigtable.admin.v2.DeleteBackupRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty> + getDeleteBackupMethod; + if ((getDeleteBackupMethod = BigtableTableAdminGrpc.getDeleteBackupMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDeleteBackupMethod = BigtableTableAdminGrpc.getDeleteBackupMethod) == null) { + BigtableTableAdminGrpc.getDeleteBackupMethod = + getDeleteBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteBackupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DeleteBackup")) + .build(); + } + } + } + return getDeleteBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListBackupsRequest, + com.google.bigtable.admin.v2.ListBackupsResponse> + getListBackupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBackups", + requestType = com.google.bigtable.admin.v2.ListBackupsRequest.class, + responseType = com.google.bigtable.admin.v2.ListBackupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListBackupsRequest, + com.google.bigtable.admin.v2.ListBackupsResponse> + getListBackupsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListBackupsRequest, + com.google.bigtable.admin.v2.ListBackupsResponse> + getListBackupsMethod; + if ((getListBackupsMethod = BigtableTableAdminGrpc.getListBackupsMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getListBackupsMethod = BigtableTableAdminGrpc.getListBackupsMethod) == null) { + BigtableTableAdminGrpc.getListBackupsMethod = + getListBackupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBackups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListBackupsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListBackupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ListBackups")) + .build(); + } + } + } + return getListBackupsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.RestoreTableRequest, com.google.longrunning.Operation> + getRestoreTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestoreTable", + requestType = com.google.bigtable.admin.v2.RestoreTableRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.RestoreTableRequest, com.google.longrunning.Operation> + getRestoreTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.RestoreTableRequest, com.google.longrunning.Operation> + getRestoreTableMethod; + if ((getRestoreTableMethod = BigtableTableAdminGrpc.getRestoreTableMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getRestoreTableMethod = BigtableTableAdminGrpc.getRestoreTableMethod) == null) { + BigtableTableAdminGrpc.getRestoreTableMethod = + getRestoreTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RestoreTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.RestoreTableRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("RestoreTable")) + .build(); + } + } + } + return getRestoreTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CopyBackupRequest, com.google.longrunning.Operation> + getCopyBackupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CopyBackup", + requestType = com.google.bigtable.admin.v2.CopyBackupRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CopyBackupRequest, com.google.longrunning.Operation> + getCopyBackupMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CopyBackupRequest, com.google.longrunning.Operation> + getCopyBackupMethod; + if ((getCopyBackupMethod = BigtableTableAdminGrpc.getCopyBackupMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCopyBackupMethod = BigtableTableAdminGrpc.getCopyBackupMethod) == null) { + BigtableTableAdminGrpc.getCopyBackupMethod = + getCopyBackupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CopyBackup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CopyBackupRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CopyBackup")) + .build(); + } + } + } + return getCopyBackupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = BigtableTableAdminGrpc.getGetIamPolicyMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetIamPolicyMethod = BigtableTableAdminGrpc.getGetIamPolicyMethod) == null) { + BigtableTableAdminGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = BigtableTableAdminGrpc.getSetIamPolicyMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getSetIamPolicyMethod = BigtableTableAdminGrpc.getSetIamPolicyMethod) == null) { + BigtableTableAdminGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = BigtableTableAdminGrpc.getTestIamPermissionsMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getTestIamPermissionsMethod = BigtableTableAdminGrpc.getTestIamPermissionsMethod) + == null) { + BigtableTableAdminGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, com.google.longrunning.Operation> + getCreateSchemaBundleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSchemaBundle", + requestType = com.google.bigtable.admin.v2.CreateSchemaBundleRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, com.google.longrunning.Operation> + getCreateSchemaBundleMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, + com.google.longrunning.Operation> + getCreateSchemaBundleMethod; + if ((getCreateSchemaBundleMethod = BigtableTableAdminGrpc.getCreateSchemaBundleMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getCreateSchemaBundleMethod = BigtableTableAdminGrpc.getCreateSchemaBundleMethod) + == null) { + BigtableTableAdminGrpc.getCreateSchemaBundleMethod = + getCreateSchemaBundleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSchemaBundle")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("CreateSchemaBundle")) + .build(); + } + } + } + return getCreateSchemaBundleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest, com.google.longrunning.Operation> + getUpdateSchemaBundleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSchemaBundle", + requestType = com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest, com.google.longrunning.Operation> + getUpdateSchemaBundleMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest, + com.google.longrunning.Operation> + getUpdateSchemaBundleMethod; + if ((getUpdateSchemaBundleMethod = BigtableTableAdminGrpc.getUpdateSchemaBundleMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getUpdateSchemaBundleMethod = BigtableTableAdminGrpc.getUpdateSchemaBundleMethod) + == null) { + BigtableTableAdminGrpc.getUpdateSchemaBundleMethod = + getUpdateSchemaBundleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSchemaBundle")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("UpdateSchemaBundle")) + .build(); + } + } + } + return getUpdateSchemaBundleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle> + getGetSchemaBundleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSchemaBundle", + requestType = com.google.bigtable.admin.v2.GetSchemaBundleRequest.class, + responseType = com.google.bigtable.admin.v2.SchemaBundle.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle> + getGetSchemaBundleMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle> + getGetSchemaBundleMethod; + if ((getGetSchemaBundleMethod = BigtableTableAdminGrpc.getGetSchemaBundleMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getGetSchemaBundleMethod = BigtableTableAdminGrpc.getGetSchemaBundleMethod) == null) { + BigtableTableAdminGrpc.getGetSchemaBundleMethod = + getGetSchemaBundleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSchemaBundle")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.GetSchemaBundleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("GetSchemaBundle")) + .build(); + } + } + } + return getGetSchemaBundleMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSchemaBundlesRequest, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse> + getListSchemaBundlesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSchemaBundles", + requestType = com.google.bigtable.admin.v2.ListSchemaBundlesRequest.class, + responseType = com.google.bigtable.admin.v2.ListSchemaBundlesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSchemaBundlesRequest, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse> + getListSchemaBundlesMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListSchemaBundlesRequest, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse> + getListSchemaBundlesMethod; + if ((getListSchemaBundlesMethod = BigtableTableAdminGrpc.getListSchemaBundlesMethod) == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getListSchemaBundlesMethod = BigtableTableAdminGrpc.getListSchemaBundlesMethod) + == null) { + BigtableTableAdminGrpc.getListSchemaBundlesMethod = + getListSchemaBundlesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSchemaBundles")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListSchemaBundlesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("ListSchemaBundles")) + .build(); + } + } + } + return getListSchemaBundlesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest, com.google.protobuf.Empty> + getDeleteSchemaBundleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSchemaBundle", + requestType = com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest, com.google.protobuf.Empty> + getDeleteSchemaBundleMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest, com.google.protobuf.Empty> + getDeleteSchemaBundleMethod; + if ((getDeleteSchemaBundleMethod = BigtableTableAdminGrpc.getDeleteSchemaBundleMethod) + == null) { + synchronized (BigtableTableAdminGrpc.class) { + if ((getDeleteSchemaBundleMethod = BigtableTableAdminGrpc.getDeleteSchemaBundleMethod) + == null) { + BigtableTableAdminGrpc.getDeleteSchemaBundleMethod = + getDeleteSchemaBundleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSchemaBundle")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableTableAdminMethodDescriptorSupplier("DeleteSchemaBundle")) + .build(); + } + } + } + return getDeleteSchemaBundleMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static BigtableTableAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableTableAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminStub(channel, callOptions); + } + }; + return BigtableTableAdminStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static BigtableTableAdminBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableTableAdminBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminBlockingV2Stub(channel, callOptions); + } + }; + return BigtableTableAdminBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BigtableTableAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableTableAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminBlockingStub(channel, callOptions); + } + }; + return BigtableTableAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static BigtableTableAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableTableAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminFutureStub(channel, callOptions); + } + }; + return BigtableTableAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a new table in the specified instance.
+     * The table can be created with a full set of initial column families,
+     * specified in the request.
+     * 
+ */ + default void createTable( + com.google.bigtable.admin.v2.CreateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new table from the specified snapshot. The target table must
+     * not exist. The snapshot and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + default void createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTableFromSnapshotMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all tables served from a specified instance.
+     * 
+ */ + default void listTables( + com.google.bigtable.admin.v2.ListTablesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTablesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified table.
+     * 
+ */ + default void getTable( + com.google.bigtable.admin.v2.GetTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a specified table.
+     * 
+ */ + default void updateTable( + com.google.bigtable.admin.v2.UpdateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a specified table and all of its data.
+     * 
+ */ + default void deleteTable( + com.google.bigtable.admin.v2.DeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Restores a specified table which was accidentally deleted.
+     * 
+ */ + default void undeleteTable( + com.google.bigtable.admin.v2.UndeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new AuthorizedView in a table.
+     * 
+ */ + default void createAuthorizedView( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all AuthorizedViews from a specific table.
+     * 
+ */ + default void listAuthorizedViews( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAuthorizedViewsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets information from a specified AuthorizedView.
+     * 
+ */ + default void getAuthorizedView( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an AuthorizedView in a table.
+     * 
+ */ + default void updateAuthorizedView( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a specified AuthorizedView.
+     * 
+ */ + default void deleteAuthorizedView( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Performs a series of column family modifications on the specified table.
+     * Either all or none of the modifications will occur before this method
+     * returns, but data requests received prior to that point may see a table
+     * where only some modifications have taken effect.
+     * 
+ */ + default void modifyColumnFamilies( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getModifyColumnFamiliesMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently drop/delete a row range from a specified table. The request can
+     * specify whether to delete all rows in a table, or only those that match a
+     * particular prefix.
+     * 
+ */ + default void dropRowRange( + com.google.bigtable.admin.v2.DropRowRangeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDropRowRangeMethod(), responseObserver); + } + + /** + * + * + *
+     * Generates a consistency token for a Table, which can be used in
+     * CheckConsistency to check whether mutations to the table that finished
+     * before this call started have been replicated. The tokens will be available
+     * for 90 days.
+     * 
+ */ + default void generateConsistencyToken( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateConsistencyTokenMethod(), responseObserver); + } + + /** + * + * + *
+     * Checks replication consistency based on a consistency token, that is, if
+     * replication has caught up based on the conditions specified in the token
+     * and the check request.
+     * 
+ */ + default void checkConsistency( + com.google.bigtable.admin.v2.CheckConsistencyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCheckConsistencyMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new snapshot in the specified cluster from the specified
+     * source table. The cluster and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + default void snapshotTable( + com.google.bigtable.admin.v2.SnapshotTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSnapshotTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + default void getSnapshot( + com.google.bigtable.admin.v2.GetSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSnapshotMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all snapshots associated with the specified cluster.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + default void listSnapshots( + com.google.bigtable.admin.v2.ListSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSnapshotsMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + default void deleteSnapshot( + com.google.bigtable.admin.v2.DeleteSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSnapshotMethod(), responseObserver); + } + + /** + * + * + *
+     * Starts creating a new Cloud Bigtable Backup.  The returned backup
+     * [long-running operation][google.longrunning.Operation] can be used to
+     * track creation of the backup. The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
+     * returned operation will stop the creation and delete the backup.
+     * 
+ */ + default void createBackup( + com.google.bigtable.admin.v2.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + default void getBackup( + com.google.bigtable.admin.v2.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + default void updateBackup( + com.google.bigtable.admin.v2.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a pending or completed Cloud Bigtable backup.
+     * 
+ */ + default void deleteBackup( + com.google.bigtable.admin.v2.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Cloud Bigtable backups. Returns both completed and pending
+     * backups.
+     * 
+ */ + default void listBackups( + com.google.bigtable.admin.v2.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); + } + + /** + * + * + *
+     * Create a new table by restoring from a completed backup.  The
+     * returned table [long-running operation][google.longrunning.Operation] can
+     * be used to track the progress of the operation, and to cancel it.  The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
+     * [response][google.longrunning.Operation.response] type is
+     * [Table][google.bigtable.admin.v2.Table], if successful.
+     * 
+ */ + default void restoreTable( + com.google.bigtable.admin.v2.RestoreTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreTableMethod(), responseObserver); + } + + /** + * + * + *
+     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
+     * located in the destination instance and project.
+     * 
+ */ + default void copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCopyBackupMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for a Bigtable resource.
+     * Returns an empty policy if the resource exists but does not have a policy
+     * set.
+     * 
+ */ + default void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on a Bigtable resource.
+     * Replaces any existing policy.
+     * 
+ */ + default void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified Bigtable
+     * resource.
+     * 
+ */ + default void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new schema bundle in the specified table.
+     * 
+ */ + default void createSchemaBundle( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSchemaBundleMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a schema bundle in the specified table.
+     * 
+ */ + default void updateSchemaBundle( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSchemaBundleMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified schema bundle.
+     * 
+ */ + default void getSchemaBundle( + com.google.bigtable.admin.v2.GetSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSchemaBundleMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all schema bundles associated with the specified table.
+     * 
+ */ + default void listSchemaBundles( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSchemaBundlesMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a schema bundle in the specified table.
+     * 
+ */ + default void deleteSchemaBundle( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSchemaBundleMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service BigtableTableAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public abstract static class BigtableTableAdminImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return BigtableTableAdminGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service BigtableTableAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public static final class BigtableTableAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private BigtableTableAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableTableAdminStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new table in the specified instance.
+     * The table can be created with a full set of initial column families,
+     * specified in the request.
+     * 
+ */ + public void createTable( + com.google.bigtable.admin.v2.CreateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new table from the specified snapshot. The target table must
+     * not exist. The snapshot and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public void createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all tables served from a specified instance.
+     * 
+ */ + public void listTables( + com.google.bigtable.admin.v2.ListTablesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTablesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified table.
+     * 
+ */ + public void getTable( + com.google.bigtable.admin.v2.GetTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTableMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a specified table.
+     * 
+ */ + public void updateTable( + com.google.bigtable.admin.v2.UpdateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a specified table and all of its data.
+     * 
+ */ + public void deleteTable( + com.google.bigtable.admin.v2.DeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Restores a specified table which was accidentally deleted.
+     * 
+ */ + public void undeleteTable( + com.google.bigtable.admin.v2.UndeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new AuthorizedView in a table.
+     * 
+ */ + public void createAuthorizedView( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAuthorizedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all AuthorizedViews from a specific table.
+     * 
+ */ + public void listAuthorizedViews( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAuthorizedViewsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets information from a specified AuthorizedView.
+     * 
+ */ + public void getAuthorizedView( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAuthorizedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an AuthorizedView in a table.
+     * 
+ */ + public void updateAuthorizedView( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAuthorizedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes a specified AuthorizedView.
+     * 
+ */ + public void deleteAuthorizedView( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAuthorizedViewMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Performs a series of column family modifications on the specified table.
+     * Either all or none of the modifications will occur before this method
+     * returns, but data requests received prior to that point may see a table
+     * where only some modifications have taken effect.
+     * 
+ */ + public void modifyColumnFamilies( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getModifyColumnFamiliesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently drop/delete a row range from a specified table. The request can
+     * specify whether to delete all rows in a table, or only those that match a
+     * particular prefix.
+     * 
+ */ + public void dropRowRange( + com.google.bigtable.admin.v2.DropRowRangeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDropRowRangeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generates a consistency token for a Table, which can be used in
+     * CheckConsistency to check whether mutations to the table that finished
+     * before this call started have been replicated. The tokens will be available
+     * for 90 days.
+     * 
+ */ + public void generateConsistencyToken( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateConsistencyTokenMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Checks replication consistency based on a consistency token, that is, if
+     * replication has caught up based on the conditions specified in the token
+     * and the check request.
+     * 
+ */ + public void checkConsistency( + com.google.bigtable.admin.v2.CheckConsistencyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCheckConsistencyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new snapshot in the specified cluster from the specified
+     * source table. The cluster and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public void snapshotTable( + com.google.bigtable.admin.v2.SnapshotTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSnapshotTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public void getSnapshot( + com.google.bigtable.admin.v2.GetSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all snapshots associated with the specified cluster.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public void listSnapshots( + com.google.bigtable.admin.v2.ListSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public void deleteSnapshot( + com.google.bigtable.admin.v2.DeleteSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts creating a new Cloud Bigtable Backup.  The returned backup
+     * [long-running operation][google.longrunning.Operation] can be used to
+     * track creation of the backup. The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
+     * returned operation will stop the creation and delete the backup.
+     * 
+ */ + public void createBackup( + com.google.bigtable.admin.v2.CreateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public void getBackup( + com.google.bigtable.admin.v2.GetBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public void updateBackup( + com.google.bigtable.admin.v2.UpdateBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a pending or completed Cloud Bigtable backup.
+     * 
+ */ + public void deleteBackup( + com.google.bigtable.admin.v2.DeleteBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Cloud Bigtable backups. Returns both completed and pending
+     * backups.
+     * 
+ */ + public void listBackups( + com.google.bigtable.admin.v2.ListBackupsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a new table by restoring from a completed backup.  The
+     * returned table [long-running operation][google.longrunning.Operation] can
+     * be used to track the progress of the operation, and to cancel it.  The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
+     * [response][google.longrunning.Operation.response] type is
+     * [Table][google.bigtable.admin.v2.Table], if successful.
+     * 
+ */ + public void restoreTable( + com.google.bigtable.admin.v2.RestoreTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestoreTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
+     * located in the destination instance and project.
+     * 
+ */ + public void copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCopyBackupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy for a Bigtable resource.
+     * Returns an empty policy if the resource exists but does not have a policy
+     * set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on a Bigtable resource.
+     * Replaces any existing policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified Bigtable
+     * resource.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new schema bundle in the specified table.
+     * 
+ */ + public void createSchemaBundle( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSchemaBundleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a schema bundle in the specified table.
+     * 
+ */ + public void updateSchemaBundle( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSchemaBundleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets metadata information about the specified schema bundle.
+     * 
+ */ + public void getSchemaBundle( + com.google.bigtable.admin.v2.GetSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSchemaBundleMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all schema bundles associated with the specified table.
+     * 
+ */ + public void listSchemaBundles( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSchemaBundlesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a schema bundle in the specified table.
+     * 
+ */ + public void deleteSchemaBundle( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSchemaBundleMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service BigtableTableAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public static final class BigtableTableAdminBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableTableAdminBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableTableAdminBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new table in the specified instance.
+     * The table can be created with a full set of initial column families,
+     * specified in the request.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table createTable( + com.google.bigtable.admin.v2.CreateTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new table from the specified snapshot. The target table must
+     * not exist. The snapshot and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.longrunning.Operation createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateTableFromSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all tables served from a specified instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListTablesResponse listTables( + com.google.bigtable.admin.v2.ListTablesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListTablesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified table.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table getTable( + com.google.bigtable.admin.v2.GetTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a specified table.
+     * 
+ */ + public com.google.longrunning.Operation updateTable( + com.google.bigtable.admin.v2.UpdateTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes a specified table and all of its data.
+     * 
+ */ + public com.google.protobuf.Empty deleteTable( + com.google.bigtable.admin.v2.DeleteTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a specified table which was accidentally deleted.
+     * 
+ */ + public com.google.longrunning.Operation undeleteTable( + com.google.bigtable.admin.v2.UndeleteTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUndeleteTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new AuthorizedView in a table.
+     * 
+ */ + public com.google.longrunning.Operation createAuthorizedView( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all AuthorizedViews from a specific table.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListAuthorizedViewsResponse listAuthorizedViews( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListAuthorizedViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information from a specified AuthorizedView.
+     * 
+ */ + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an AuthorizedView in a table.
+     * 
+ */ + public com.google.longrunning.Operation updateAuthorizedView( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes a specified AuthorizedView.
+     * 
+ */ + public com.google.protobuf.Empty deleteAuthorizedView( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Performs a series of column family modifications on the specified table.
+     * Either all or none of the modifications will occur before this method
+     * returns, but data requests received prior to that point may see a table
+     * where only some modifications have taken effect.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table modifyColumnFamilies( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getModifyColumnFamiliesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently drop/delete a row range from a specified table. The request can
+     * specify whether to delete all rows in a table, or only those that match a
+     * particular prefix.
+     * 
+ */ + public com.google.protobuf.Empty dropRowRange( + com.google.bigtable.admin.v2.DropRowRangeRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDropRowRangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a consistency token for a Table, which can be used in
+     * CheckConsistency to check whether mutations to the table that finished
+     * before this call started have been replicated. The tokens will be available
+     * for 90 days.
+     * 
+ */ + public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGenerateConsistencyTokenMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Checks replication consistency based on a consistency token, that is, if
+     * replication has caught up based on the conditions specified in the token
+     * and the check request.
+     * 
+ */ + public com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency( + com.google.bigtable.admin.v2.CheckConsistencyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCheckConsistencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new snapshot in the specified cluster from the specified
+     * source table. The cluster and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.longrunning.Operation snapshotTable( + com.google.bigtable.admin.v2.SnapshotTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSnapshotTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.bigtable.admin.v2.Snapshot getSnapshot( + com.google.bigtable.admin.v2.GetSnapshotRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all snapshots associated with the specified cluster.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListSnapshotsResponse listSnapshots( + com.google.bigtable.admin.v2.ListSnapshotsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSnapshotsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.protobuf.Empty deleteSnapshot( + com.google.bigtable.admin.v2.DeleteSnapshotRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts creating a new Cloud Bigtable Backup.  The returned backup
+     * [long-running operation][google.longrunning.Operation] can be used to
+     * track creation of the backup. The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
+     * returned operation will stop the creation and delete the backup.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.bigtable.admin.v2.CreateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.bigtable.admin.v2.Backup getBackup( + com.google.bigtable.admin.v2.GetBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.bigtable.admin.v2.Backup updateBackup( + com.google.bigtable.admin.v2.UpdateBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a pending or completed Cloud Bigtable backup.
+     * 
+ */ + public com.google.protobuf.Empty deleteBackup( + com.google.bigtable.admin.v2.DeleteBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Cloud Bigtable backups. Returns both completed and pending
+     * backups.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListBackupsResponse listBackups( + com.google.bigtable.admin.v2.ListBackupsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a new table by restoring from a completed backup.  The
+     * returned table [long-running operation][google.longrunning.Operation] can
+     * be used to track the progress of the operation, and to cancel it.  The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
+     * [response][google.longrunning.Operation.response] type is
+     * [Table][google.bigtable.admin.v2.Table], if successful.
+     * 
+ */ + public com.google.longrunning.Operation restoreTable( + com.google.bigtable.admin.v2.RestoreTableRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRestoreTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
+     * located in the destination instance and project.
+     * 
+ */ + public com.google.longrunning.Operation copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCopyBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for a Bigtable resource.
+     * Returns an empty policy if the resource exists but does not have a policy
+     * set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on a Bigtable resource.
+     * Replaces any existing policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified Bigtable
+     * resource.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new schema bundle in the specified table.
+     * 
+ */ + public com.google.longrunning.Operation createSchemaBundle( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a schema bundle in the specified table.
+     * 
+ */ + public com.google.longrunning.Operation updateSchemaBundle( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified schema bundle.
+     * 
+ */ + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle( + com.google.bigtable.admin.v2.GetSchemaBundleRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all schema bundles associated with the specified table.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListSchemaBundlesResponse listSchemaBundles( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSchemaBundlesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a schema bundle in the specified table.
+     * 
+ */ + public com.google.protobuf.Empty deleteSchemaBundle( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSchemaBundleMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service BigtableTableAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public static final class BigtableTableAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableTableAdminBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableTableAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new table in the specified instance.
+     * The table can be created with a full set of initial column families,
+     * specified in the request.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table createTable( + com.google.bigtable.admin.v2.CreateTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new table from the specified snapshot. The target table must
+     * not exist. The snapshot and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.longrunning.Operation createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTableFromSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all tables served from a specified instance.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListTablesResponse listTables( + com.google.bigtable.admin.v2.ListTablesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTablesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified table.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table getTable( + com.google.bigtable.admin.v2.GetTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a specified table.
+     * 
+ */ + public com.google.longrunning.Operation updateTable( + com.google.bigtable.admin.v2.UpdateTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes a specified table and all of its data.
+     * 
+ */ + public com.google.protobuf.Empty deleteTable( + com.google.bigtable.admin.v2.DeleteTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Restores a specified table which was accidentally deleted.
+     * 
+ */ + public com.google.longrunning.Operation undeleteTable( + com.google.bigtable.admin.v2.UndeleteTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new AuthorizedView in a table.
+     * 
+ */ + public com.google.longrunning.Operation createAuthorizedView( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all AuthorizedViews from a specific table.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListAuthorizedViewsResponse listAuthorizedViews( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAuthorizedViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets information from a specified AuthorizedView.
+     * 
+ */ + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an AuthorizedView in a table.
+     * 
+ */ + public com.google.longrunning.Operation updateAuthorizedView( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes a specified AuthorizedView.
+     * 
+ */ + public com.google.protobuf.Empty deleteAuthorizedView( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAuthorizedViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Performs a series of column family modifications on the specified table.
+     * Either all or none of the modifications will occur before this method
+     * returns, but data requests received prior to that point may see a table
+     * where only some modifications have taken effect.
+     * 
+ */ + public com.google.bigtable.admin.v2.Table modifyColumnFamilies( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getModifyColumnFamiliesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently drop/delete a row range from a specified table. The request can
+     * specify whether to delete all rows in a table, or only those that match a
+     * particular prefix.
+     * 
+ */ + public com.google.protobuf.Empty dropRowRange( + com.google.bigtable.admin.v2.DropRowRangeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDropRowRangeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates a consistency token for a Table, which can be used in
+     * CheckConsistency to check whether mutations to the table that finished
+     * before this call started have been replicated. The tokens will be available
+     * for 90 days.
+     * 
+ */ + public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateConsistencyTokenMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Checks replication consistency based on a consistency token, that is, if
+     * replication has caught up based on the conditions specified in the token
+     * and the check request.
+     * 
+ */ + public com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency( + com.google.bigtable.admin.v2.CheckConsistencyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCheckConsistencyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new snapshot in the specified cluster from the specified
+     * source table. The cluster and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.longrunning.Operation snapshotTable( + com.google.bigtable.admin.v2.SnapshotTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSnapshotTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.bigtable.admin.v2.Snapshot getSnapshot( + com.google.bigtable.admin.v2.GetSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all snapshots associated with the specified cluster.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListSnapshotsResponse listSnapshots( + com.google.bigtable.admin.v2.ListSnapshotsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSnapshotsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.protobuf.Empty deleteSnapshot( + com.google.bigtable.admin.v2.DeleteSnapshotRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts creating a new Cloud Bigtable Backup.  The returned backup
+     * [long-running operation][google.longrunning.Operation] can be used to
+     * track creation of the backup. The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
+     * returned operation will stop the creation and delete the backup.
+     * 
+ */ + public com.google.longrunning.Operation createBackup( + com.google.bigtable.admin.v2.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.bigtable.admin.v2.Backup getBackup( + com.google.bigtable.admin.v2.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.bigtable.admin.v2.Backup updateBackup( + com.google.bigtable.admin.v2.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a pending or completed Cloud Bigtable backup.
+     * 
+ */ + public com.google.protobuf.Empty deleteBackup( + com.google.bigtable.admin.v2.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Cloud Bigtable backups. Returns both completed and pending
+     * backups.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListBackupsResponse listBackups( + com.google.bigtable.admin.v2.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a new table by restoring from a completed backup.  The
+     * returned table [long-running operation][google.longrunning.Operation] can
+     * be used to track the progress of the operation, and to cancel it.  The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
+     * [response][google.longrunning.Operation.response] type is
+     * [Table][google.bigtable.admin.v2.Table], if successful.
+     * 
+ */ + public com.google.longrunning.Operation restoreTable( + com.google.bigtable.admin.v2.RestoreTableRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestoreTableMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
+     * located in the destination instance and project.
+     * 
+ */ + public com.google.longrunning.Operation copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCopyBackupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy for a Bigtable resource.
+     * Returns an empty policy if the resource exists but does not have a policy
+     * set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on a Bigtable resource.
+     * Replaces any existing policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified Bigtable
+     * resource.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new schema bundle in the specified table.
+     * 
+ */ + public com.google.longrunning.Operation createSchemaBundle( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a schema bundle in the specified table.
+     * 
+ */ + public com.google.longrunning.Operation updateSchemaBundle( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified schema bundle.
+     * 
+ */ + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle( + com.google.bigtable.admin.v2.GetSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSchemaBundleMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all schema bundles associated with the specified table.
+     * 
+ */ + public com.google.bigtable.admin.v2.ListSchemaBundlesResponse listSchemaBundles( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSchemaBundlesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a schema bundle in the specified table.
+     * 
+ */ + public com.google.protobuf.Empty deleteSchemaBundle( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSchemaBundleMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service BigtableTableAdmin. + * + *
+   * Service for creating, configuring, and deleting Cloud Bigtable tables.
+   * Provides access to the table schemas only, not the data stored within
+   * the tables.
+   * 
+ */ + public static final class BigtableTableAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private BigtableTableAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableTableAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableTableAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new table in the specified instance.
+     * The table can be created with a full set of initial column families,
+     * specified in the request.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createTable(com.google.bigtable.admin.v2.CreateTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new table from the specified snapshot. The target table must
+     * not exist. The snapshot and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all tables served from a specified instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListTablesResponse> + listTables(com.google.bigtable.admin.v2.ListTablesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTablesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getTable(com.google.bigtable.admin.v2.GetTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateTable(com.google.bigtable.admin.v2.UpdateTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes a specified table and all of its data.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Restores a specified table which was accidentally deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeleteTable(com.google.bigtable.admin.v2.UndeleteTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeleteTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new AuthorizedView in a table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAuthorizedView(com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAuthorizedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all AuthorizedViews from a specific table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse> + listAuthorizedViews(com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAuthorizedViewsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets information from a specified AuthorizedView.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.AuthorizedView> + getAuthorizedView(com.google.bigtable.admin.v2.GetAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAuthorizedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an AuthorizedView in a table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAuthorizedView(com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAuthorizedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes a specified AuthorizedView.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAuthorizedView(com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAuthorizedViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Performs a series of column family modifications on the specified table.
+     * Either all or none of the modifications will occur before this method
+     * returns, but data requests received prior to that point may see a table
+     * where only some modifications have taken effect.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + modifyColumnFamilies(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getModifyColumnFamiliesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently drop/delete a row range from a specified table. The request can
+     * specify whether to delete all rows in a table, or only those that match a
+     * particular prefix.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDropRowRangeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates a consistency token for a Table, which can be used in
+     * CheckConsistency to check whether mutations to the table that finished
+     * before this call started have been replicated. The tokens will be available
+     * for 90 days.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> + generateConsistencyToken( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateConsistencyTokenMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Checks replication consistency based on a consistency token, that is, if
+     * replication has caught up based on the conditions specified in the token
+     * and the check request.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.CheckConsistencyResponse> + checkConsistency(com.google.bigtable.admin.v2.CheckConsistencyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCheckConsistencyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new snapshot in the specified cluster from the specified
+     * source table. The cluster and the table must be in the same instance.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + snapshotTable(com.google.bigtable.admin.v2.SnapshotTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSnapshotTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getSnapshot(com.google.bigtable.admin.v2.GetSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all snapshots associated with the specified cluster.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListSnapshotsResponse> + listSnapshots(com.google.bigtable.admin.v2.ListSnapshotsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes the specified snapshot.
+     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+     * feature is not currently available to most Cloud Bigtable customers. This
+     * feature might be changed in backward-incompatible ways and is not
+     * recommended for production use. It is not subject to any SLA or deprecation
+     * policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSnapshot(com.google.bigtable.admin.v2.DeleteSnapshotRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Starts creating a new Cloud Bigtable Backup.  The returned backup
+     * [long-running operation][google.longrunning.Operation] can be used to
+     * track creation of the backup. The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
+     * [response][google.longrunning.Operation.response] field type is
+     * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
+     * returned operation will stop the creation and delete the backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBackup(com.google.bigtable.admin.v2.CreateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets metadata on a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBackup(com.google.bigtable.admin.v2.GetBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a pending or completed Cloud Bigtable Backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBackup(com.google.bigtable.admin.v2.UpdateBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a pending or completed Cloud Bigtable backup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBackup(com.google.bigtable.admin.v2.DeleteBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Cloud Bigtable backups. Returns both completed and pending
+     * backups.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListBackupsResponse> + listBackups(com.google.bigtable.admin.v2.ListBackupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a new table by restoring from a completed backup.  The
+     * returned table [long-running operation][google.longrunning.Operation] can
+     * be used to track the progress of the operation, and to cancel it.  The
+     * [metadata][google.longrunning.Operation.metadata] field type is
+     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
+     * [response][google.longrunning.Operation.response] type is
+     * [Table][google.bigtable.admin.v2.Table], if successful.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + restoreTable(com.google.bigtable.admin.v2.RestoreTableRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestoreTableMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
+     * located in the destination instance and project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + copyBackup(com.google.bigtable.admin.v2.CopyBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCopyBackupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the access control policy for a Bigtable resource.
+     * Returns an empty policy if the resource exists but does not have a policy
+     * set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy on a Bigtable resource.
+     * Replaces any existing policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns permissions that the caller has on the specified Bigtable
+     * resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new schema bundle in the specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSchemaBundle(com.google.bigtable.admin.v2.CreateSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSchemaBundleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a schema bundle in the specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSchemaBundle(com.google.bigtable.admin.v2.UpdateSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSchemaBundleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets metadata information about the specified schema bundle.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.SchemaBundle> + getSchemaBundle(com.google.bigtable.admin.v2.GetSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSchemaBundleMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all schema bundles associated with the specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.admin.v2.ListSchemaBundlesResponse> + listSchemaBundles(com.google.bigtable.admin.v2.ListSchemaBundlesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSchemaBundlesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a schema bundle in the specified table.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSchemaBundle(com.google.bigtable.admin.v2.DeleteSchemaBundleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSchemaBundleMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_TABLE = 0; + private static final int METHODID_CREATE_TABLE_FROM_SNAPSHOT = 1; + private static final int METHODID_LIST_TABLES = 2; + private static final int METHODID_GET_TABLE = 3; + private static final int METHODID_UPDATE_TABLE = 4; + private static final int METHODID_DELETE_TABLE = 5; + private static final int METHODID_UNDELETE_TABLE = 6; + private static final int METHODID_CREATE_AUTHORIZED_VIEW = 7; + private static final int METHODID_LIST_AUTHORIZED_VIEWS = 8; + private static final int METHODID_GET_AUTHORIZED_VIEW = 9; + private static final int METHODID_UPDATE_AUTHORIZED_VIEW = 10; + private static final int METHODID_DELETE_AUTHORIZED_VIEW = 11; + private static final int METHODID_MODIFY_COLUMN_FAMILIES = 12; + private static final int METHODID_DROP_ROW_RANGE = 13; + private static final int METHODID_GENERATE_CONSISTENCY_TOKEN = 14; + private static final int METHODID_CHECK_CONSISTENCY = 15; + private static final int METHODID_SNAPSHOT_TABLE = 16; + private static final int METHODID_GET_SNAPSHOT = 17; + private static final int METHODID_LIST_SNAPSHOTS = 18; + private static final int METHODID_DELETE_SNAPSHOT = 19; + private static final int METHODID_CREATE_BACKUP = 20; + private static final int METHODID_GET_BACKUP = 21; + private static final int METHODID_UPDATE_BACKUP = 22; + private static final int METHODID_DELETE_BACKUP = 23; + private static final int METHODID_LIST_BACKUPS = 24; + private static final int METHODID_RESTORE_TABLE = 25; + private static final int METHODID_COPY_BACKUP = 26; + private static final int METHODID_GET_IAM_POLICY = 27; + private static final int METHODID_SET_IAM_POLICY = 28; + private static final int METHODID_TEST_IAM_PERMISSIONS = 29; + private static final int METHODID_CREATE_SCHEMA_BUNDLE = 30; + private static final int METHODID_UPDATE_SCHEMA_BUNDLE = 31; + private static final int METHODID_GET_SCHEMA_BUNDLE = 32; + private static final int METHODID_LIST_SCHEMA_BUNDLES = 33; + private static final int METHODID_DELETE_SCHEMA_BUNDLE = 34; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_TABLE: + serviceImpl.createTable( + (com.google.bigtable.admin.v2.CreateTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_TABLE_FROM_SNAPSHOT: + serviceImpl.createTableFromSnapshot( + (com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TABLES: + serviceImpl.listTables( + (com.google.bigtable.admin.v2.ListTablesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_TABLE: + serviceImpl.getTable( + (com.google.bigtable.admin.v2.GetTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_TABLE: + serviceImpl.updateTable( + (com.google.bigtable.admin.v2.UpdateTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TABLE: + serviceImpl.deleteTable( + (com.google.bigtable.admin.v2.DeleteTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_TABLE: + serviceImpl.undeleteTable( + (com.google.bigtable.admin.v2.UndeleteTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_AUTHORIZED_VIEW: + serviceImpl.createAuthorizedView( + (com.google.bigtable.admin.v2.CreateAuthorizedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_AUTHORIZED_VIEWS: + serviceImpl.listAuthorizedViews( + (com.google.bigtable.admin.v2.ListAuthorizedViewsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse>) + responseObserver); + break; + case METHODID_GET_AUTHORIZED_VIEW: + serviceImpl.getAuthorizedView( + (com.google.bigtable.admin.v2.GetAuthorizedViewRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_AUTHORIZED_VIEW: + serviceImpl.updateAuthorizedView( + (com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_AUTHORIZED_VIEW: + serviceImpl.deleteAuthorizedView( + (com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MODIFY_COLUMN_FAMILIES: + serviceImpl.modifyColumnFamilies( + (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DROP_ROW_RANGE: + serviceImpl.dropRowRange( + (com.google.bigtable.admin.v2.DropRowRangeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_CONSISTENCY_TOKEN: + serviceImpl.generateConsistencyToken( + (com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) request, + (io.grpc.stub.StreamObserver< + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse>) + responseObserver); + break; + case METHODID_CHECK_CONSISTENCY: + serviceImpl.checkConsistency( + (com.google.bigtable.admin.v2.CheckConsistencyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SNAPSHOT_TABLE: + serviceImpl.snapshotTable( + (com.google.bigtable.admin.v2.SnapshotTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SNAPSHOT: + serviceImpl.getSnapshot( + (com.google.bigtable.admin.v2.GetSnapshotRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SNAPSHOTS: + serviceImpl.listSnapshots( + (com.google.bigtable.admin.v2.ListSnapshotsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SNAPSHOT: + serviceImpl.deleteSnapshot( + (com.google.bigtable.admin.v2.DeleteSnapshotRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BACKUP: + serviceImpl.createBackup( + (com.google.bigtable.admin.v2.CreateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BACKUP: + serviceImpl.getBackup( + (com.google.bigtable.admin.v2.GetBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BACKUP: + serviceImpl.updateBackup( + (com.google.bigtable.admin.v2.UpdateBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BACKUP: + serviceImpl.deleteBackup( + (com.google.bigtable.admin.v2.DeleteBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BACKUPS: + serviceImpl.listBackups( + (com.google.bigtable.admin.v2.ListBackupsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RESTORE_TABLE: + serviceImpl.restoreTable( + (com.google.bigtable.admin.v2.RestoreTableRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COPY_BACKUP: + serviceImpl.copyBackup( + (com.google.bigtable.admin.v2.CopyBackupRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SCHEMA_BUNDLE: + serviceImpl.createSchemaBundle( + (com.google.bigtable.admin.v2.CreateSchemaBundleRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SCHEMA_BUNDLE: + serviceImpl.updateSchemaBundle( + (com.google.bigtable.admin.v2.UpdateSchemaBundleRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SCHEMA_BUNDLE: + serviceImpl.getSchemaBundle( + (com.google.bigtable.admin.v2.GetSchemaBundleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SCHEMA_BUNDLES: + serviceImpl.listSchemaBundles( + (com.google.bigtable.admin.v2.ListSchemaBundlesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SCHEMA_BUNDLE: + serviceImpl.deleteSchemaBundle( + (com.google.bigtable.admin.v2.DeleteSchemaBundleRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateTableRequest, + com.google.bigtable.admin.v2.Table>(service, METHODID_CREATE_TABLE))) + .addMethod( + getCreateTableFromSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.longrunning.Operation>( + service, METHODID_CREATE_TABLE_FROM_SNAPSHOT))) + .addMethod( + getListTablesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListTablesRequest, + com.google.bigtable.admin.v2.ListTablesResponse>( + service, METHODID_LIST_TABLES))) + .addMethod( + getGetTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetTableRequest, + com.google.bigtable.admin.v2.Table>(service, METHODID_GET_TABLE))) + .addMethod( + getUpdateTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateTableRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_TABLE))) + .addMethod( + getDeleteTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TABLE))) + .addMethod( + getUndeleteTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UndeleteTableRequest, + com.google.longrunning.Operation>(service, METHODID_UNDELETE_TABLE))) + .addMethod( + getCreateAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_AUTHORIZED_VIEW))) + .addMethod( + getListAuthorizedViewsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse>( + service, METHODID_LIST_AUTHORIZED_VIEWS))) + .addMethod( + getGetAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetAuthorizedViewRequest, + com.google.bigtable.admin.v2.AuthorizedView>( + service, METHODID_GET_AUTHORIZED_VIEW))) + .addMethod( + getUpdateAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_AUTHORIZED_VIEW))) + .addMethod( + getDeleteAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_AUTHORIZED_VIEW))) + .addMethod( + getModifyColumnFamiliesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, + com.google.bigtable.admin.v2.Table>(service, METHODID_MODIFY_COLUMN_FAMILIES))) + .addMethod( + getDropRowRangeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty>( + service, METHODID_DROP_ROW_RANGE))) + .addMethod( + getGenerateConsistencyTokenMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse>( + service, METHODID_GENERATE_CONSISTENCY_TOKEN))) + .addMethod( + getCheckConsistencyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CheckConsistencyRequest, + com.google.bigtable.admin.v2.CheckConsistencyResponse>( + service, METHODID_CHECK_CONSISTENCY))) + .addMethod( + getSnapshotTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.SnapshotTableRequest, + com.google.longrunning.Operation>(service, METHODID_SNAPSHOT_TABLE))) + .addMethod( + getGetSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetSnapshotRequest, + com.google.bigtable.admin.v2.Snapshot>(service, METHODID_GET_SNAPSHOT))) + .addMethod( + getListSnapshotsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListSnapshotsRequest, + com.google.bigtable.admin.v2.ListSnapshotsResponse>( + service, METHODID_LIST_SNAPSHOTS))) + .addMethod( + getDeleteSnapshotMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteSnapshotRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SNAPSHOT))) + .addMethod( + getCreateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateBackupRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_BACKUP))) + .addMethod( + getGetBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetBackupRequest, + com.google.bigtable.admin.v2.Backup>(service, METHODID_GET_BACKUP))) + .addMethod( + getUpdateBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateBackupRequest, + com.google.bigtable.admin.v2.Backup>(service, METHODID_UPDATE_BACKUP))) + .addMethod( + getDeleteBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BACKUP))) + .addMethod( + getListBackupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListBackupsRequest, + com.google.bigtable.admin.v2.ListBackupsResponse>( + service, METHODID_LIST_BACKUPS))) + .addMethod( + getRestoreTableMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.RestoreTableRequest, + com.google.longrunning.Operation>(service, METHODID_RESTORE_TABLE))) + .addMethod( + getCopyBackupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CopyBackupRequest, + com.google.longrunning.Operation>(service, METHODID_COPY_BACKUP))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + service, METHODID_TEST_IAM_PERMISSIONS))) + .addMethod( + getCreateSchemaBundleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SCHEMA_BUNDLE))) + .addMethod( + getUpdateSchemaBundleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_SCHEMA_BUNDLE))) + .addMethod( + getGetSchemaBundleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.GetSchemaBundleRequest, + com.google.bigtable.admin.v2.SchemaBundle>( + service, METHODID_GET_SCHEMA_BUNDLE))) + .addMethod( + getListSchemaBundlesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.ListSchemaBundlesRequest, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse>( + service, METHODID_LIST_SCHEMA_BUNDLES))) + .addMethod( + getDeleteSchemaBundleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_SCHEMA_BUNDLE))) + .build(); + } + + private abstract static class BigtableTableAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BigtableTableAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("BigtableTableAdmin"); + } + } + + private static final class BigtableTableAdminFileDescriptorSupplier + extends BigtableTableAdminBaseDescriptorSupplier { + BigtableTableAdminFileDescriptorSupplier() {} + } + + private static final class BigtableTableAdminMethodDescriptorSupplier + extends BigtableTableAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + BigtableTableAdminMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BigtableTableAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BigtableTableAdminFileDescriptorSupplier()) + .addMethod(getCreateTableMethod()) + .addMethod(getCreateTableFromSnapshotMethod()) + .addMethod(getListTablesMethod()) + .addMethod(getGetTableMethod()) + .addMethod(getUpdateTableMethod()) + .addMethod(getDeleteTableMethod()) + .addMethod(getUndeleteTableMethod()) + .addMethod(getCreateAuthorizedViewMethod()) + .addMethod(getListAuthorizedViewsMethod()) + .addMethod(getGetAuthorizedViewMethod()) + .addMethod(getUpdateAuthorizedViewMethod()) + .addMethod(getDeleteAuthorizedViewMethod()) + .addMethod(getModifyColumnFamiliesMethod()) + .addMethod(getDropRowRangeMethod()) + .addMethod(getGenerateConsistencyTokenMethod()) + .addMethod(getCheckConsistencyMethod()) + .addMethod(getSnapshotTableMethod()) + .addMethod(getGetSnapshotMethod()) + .addMethod(getListSnapshotsMethod()) + .addMethod(getDeleteSnapshotMethod()) + .addMethod(getCreateBackupMethod()) + .addMethod(getGetBackupMethod()) + .addMethod(getUpdateBackupMethod()) + .addMethod(getDeleteBackupMethod()) + .addMethod(getListBackupsMethod()) + .addMethod(getRestoreTableMethod()) + .addMethod(getCopyBackupMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .addMethod(getCreateSchemaBundleMethod()) + .addMethod(getUpdateSchemaBundleMethod()) + .addMethod(getGetSchemaBundleMethod()) + .addMethod(getListSchemaBundlesMethod()) + .addMethod(getDeleteSchemaBundleMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-bigtable/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml b/java-bigtable/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..142d0f217ee2 --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml @@ -0,0 +1,10 @@ + + + + + + 7012 + com/google/bigtable/v2/BigtableGrpc$AsyncService + *prepareQuery(* + + diff --git a/java-bigtable/grpc-google-cloud-bigtable-v2/pom.xml b/java-bigtable/grpc-google-cloud-bigtable-v2/pom.xml new file mode 100644 index 000000000000..bc7337955548 --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-v2/pom.xml @@ -0,0 +1,93 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + grpc-google-cloud-bigtable-v2 + GRPC library for grpc-google-cloud-bigtable-v2 + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + compile + + + com.google.protobuf + protobuf-java + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../proto-google-cloud-bigtable-v2/target/site/apidocs/ + + + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-bigtable/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java b/java-bigtable/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java new file mode 100644 index 000000000000..2dc40ecdec88 --- /dev/null +++ b/java-bigtable/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java @@ -0,0 +1,2164 @@ +/* + * Copyright 2026 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 static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for reading from and writing to existing Bigtable tables.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class BigtableGrpc { + + private BigtableGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.bigtable.v2.Bigtable"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadRowsRequest, com.google.bigtable.v2.ReadRowsResponse> + getReadRowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadRows", + requestType = com.google.bigtable.v2.ReadRowsRequest.class, + responseType = com.google.bigtable.v2.ReadRowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadRowsRequest, com.google.bigtable.v2.ReadRowsResponse> + getReadRowsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadRowsRequest, com.google.bigtable.v2.ReadRowsResponse> + getReadRowsMethod; + if ((getReadRowsMethod = BigtableGrpc.getReadRowsMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getReadRowsMethod = BigtableGrpc.getReadRowsMethod) == null) { + BigtableGrpc.getReadRowsMethod = + getReadRowsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadRows")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadRowsResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("ReadRows")) + .build(); + } + } + } + return getReadRowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SampleRowKeysRequest, com.google.bigtable.v2.SampleRowKeysResponse> + getSampleRowKeysMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SampleRowKeys", + requestType = com.google.bigtable.v2.SampleRowKeysRequest.class, + responseType = com.google.bigtable.v2.SampleRowKeysResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SampleRowKeysRequest, com.google.bigtable.v2.SampleRowKeysResponse> + getSampleRowKeysMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SampleRowKeysRequest, + com.google.bigtable.v2.SampleRowKeysResponse> + getSampleRowKeysMethod; + if ((getSampleRowKeysMethod = BigtableGrpc.getSampleRowKeysMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getSampleRowKeysMethod = BigtableGrpc.getSampleRowKeysMethod) == null) { + BigtableGrpc.getSampleRowKeysMethod = + getSampleRowKeysMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SampleRowKeys")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("SampleRowKeys")) + .build(); + } + } + } + return getSampleRowKeysMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowRequest, com.google.bigtable.v2.MutateRowResponse> + getMutateRowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MutateRow", + requestType = com.google.bigtable.v2.MutateRowRequest.class, + responseType = com.google.bigtable.v2.MutateRowResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowRequest, com.google.bigtable.v2.MutateRowResponse> + getMutateRowMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowRequest, com.google.bigtable.v2.MutateRowResponse> + getMutateRowMethod; + if ((getMutateRowMethod = BigtableGrpc.getMutateRowMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getMutateRowMethod = BigtableGrpc.getMutateRowMethod) == null) { + BigtableGrpc.getMutateRowMethod = + getMutateRowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MutateRow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.MutateRowRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.MutateRowResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("MutateRow")) + .build(); + } + } + } + return getMutateRowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowsRequest, com.google.bigtable.v2.MutateRowsResponse> + getMutateRowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MutateRows", + requestType = com.google.bigtable.v2.MutateRowsRequest.class, + responseType = com.google.bigtable.v2.MutateRowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowsRequest, com.google.bigtable.v2.MutateRowsResponse> + getMutateRowsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.MutateRowsRequest, com.google.bigtable.v2.MutateRowsResponse> + getMutateRowsMethod; + if ((getMutateRowsMethod = BigtableGrpc.getMutateRowsMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getMutateRowsMethod = BigtableGrpc.getMutateRowsMethod) == null) { + BigtableGrpc.getMutateRowsMethod = + getMutateRowsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MutateRows")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.MutateRowsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.MutateRowsResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("MutateRows")) + .build(); + } + } + } + return getMutateRowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.CheckAndMutateRowRequest, + com.google.bigtable.v2.CheckAndMutateRowResponse> + getCheckAndMutateRowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CheckAndMutateRow", + requestType = com.google.bigtable.v2.CheckAndMutateRowRequest.class, + responseType = com.google.bigtable.v2.CheckAndMutateRowResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.CheckAndMutateRowRequest, + com.google.bigtable.v2.CheckAndMutateRowResponse> + getCheckAndMutateRowMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.CheckAndMutateRowRequest, + com.google.bigtable.v2.CheckAndMutateRowResponse> + getCheckAndMutateRowMethod; + if ((getCheckAndMutateRowMethod = BigtableGrpc.getCheckAndMutateRowMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getCheckAndMutateRowMethod = BigtableGrpc.getCheckAndMutateRowMethod) == null) { + BigtableGrpc.getCheckAndMutateRowMethod = + getCheckAndMutateRowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CheckAndMutateRow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.CheckAndMutateRowRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.CheckAndMutateRowResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("CheckAndMutateRow")) + .build(); + } + } + } + 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> + getReadModifyWriteRowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadModifyWriteRow", + requestType = com.google.bigtable.v2.ReadModifyWriteRowRequest.class, + responseType = com.google.bigtable.v2.ReadModifyWriteRowResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadModifyWriteRowRequest, + com.google.bigtable.v2.ReadModifyWriteRowResponse> + getReadModifyWriteRowMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadModifyWriteRowRequest, + com.google.bigtable.v2.ReadModifyWriteRowResponse> + getReadModifyWriteRowMethod; + if ((getReadModifyWriteRowMethod = BigtableGrpc.getReadModifyWriteRowMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getReadModifyWriteRowMethod = BigtableGrpc.getReadModifyWriteRowMethod) == null) { + BigtableGrpc.getReadModifyWriteRowMethod = + getReadModifyWriteRowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadModifyWriteRow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadModifyWriteRowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadModifyWriteRowResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("ReadModifyWriteRow")) + .build(); + } + } + } + return getReadModifyWriteRowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + getGenerateInitialChangeStreamPartitionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateInitialChangeStreamPartitions", + requestType = com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.class, + responseType = com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + getGenerateInitialChangeStreamPartitionsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + getGenerateInitialChangeStreamPartitionsMethod; + if ((getGenerateInitialChangeStreamPartitionsMethod = + BigtableGrpc.getGenerateInitialChangeStreamPartitionsMethod) + == null) { + synchronized (BigtableGrpc.class) { + if ((getGenerateInitialChangeStreamPartitionsMethod = + BigtableGrpc.getGenerateInitialChangeStreamPartitionsMethod) + == null) { + BigtableGrpc.getGenerateInitialChangeStreamPartitionsMethod = + getGenerateInitialChangeStreamPartitionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "GenerateInitialChangeStreamPartitions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier( + "GenerateInitialChangeStreamPartitions")) + .build(); + } + } + } + return getGenerateInitialChangeStreamPartitionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadChangeStreamRequest, + com.google.bigtable.v2.ReadChangeStreamResponse> + getReadChangeStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadChangeStream", + requestType = com.google.bigtable.v2.ReadChangeStreamRequest.class, + responseType = com.google.bigtable.v2.ReadChangeStreamResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadChangeStreamRequest, + com.google.bigtable.v2.ReadChangeStreamResponse> + getReadChangeStreamMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.ReadChangeStreamRequest, + com.google.bigtable.v2.ReadChangeStreamResponse> + getReadChangeStreamMethod; + if ((getReadChangeStreamMethod = BigtableGrpc.getReadChangeStreamMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getReadChangeStreamMethod = BigtableGrpc.getReadChangeStreamMethod) == null) { + BigtableGrpc.getReadChangeStreamMethod = + getReadChangeStreamMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadChangeStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadChangeStreamRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ReadChangeStreamResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("ReadChangeStream")) + .build(); + } + } + } + return getReadChangeStreamMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.PrepareQueryRequest, com.google.bigtable.v2.PrepareQueryResponse> + getPrepareQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PrepareQuery", + requestType = com.google.bigtable.v2.PrepareQueryRequest.class, + responseType = com.google.bigtable.v2.PrepareQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.PrepareQueryRequest, com.google.bigtable.v2.PrepareQueryResponse> + getPrepareQueryMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.PrepareQueryRequest, com.google.bigtable.v2.PrepareQueryResponse> + getPrepareQueryMethod; + if ((getPrepareQueryMethod = BigtableGrpc.getPrepareQueryMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getPrepareQueryMethod = BigtableGrpc.getPrepareQueryMethod) == null) { + BigtableGrpc.getPrepareQueryMethod = + getPrepareQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PrepareQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PrepareQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PrepareQueryResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("PrepareQuery")) + .build(); + } + } + } + return getPrepareQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.ExecuteQueryRequest, com.google.bigtable.v2.ExecuteQueryResponse> + getExecuteQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExecuteQuery", + requestType = com.google.bigtable.v2.ExecuteQueryRequest.class, + responseType = com.google.bigtable.v2.ExecuteQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.ExecuteQueryRequest, com.google.bigtable.v2.ExecuteQueryResponse> + getExecuteQueryMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.ExecuteQueryRequest, com.google.bigtable.v2.ExecuteQueryResponse> + getExecuteQueryMethod; + if ((getExecuteQueryMethod = BigtableGrpc.getExecuteQueryMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getExecuteQueryMethod = BigtableGrpc.getExecuteQueryMethod) == null) { + BigtableGrpc.getExecuteQueryMethod = + getExecuteQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExecuteQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ExecuteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ExecuteQueryResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("ExecuteQuery")) + .build(); + } + } + } + return getExecuteQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetClientConfiguration", + requestType = com.google.bigtable.v2.GetClientConfigurationRequest.class, + responseType = com.google.bigtable.v2.ClientConfiguration.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod; + if ((getGetClientConfigurationMethod = BigtableGrpc.getGetClientConfigurationMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getGetClientConfigurationMethod = BigtableGrpc.getGetClientConfigurationMethod) + == null) { + BigtableGrpc.getGetClientConfigurationMethod = + getGetClientConfigurationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetClientConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.GetClientConfigurationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ClientConfiguration.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("GetClientConfiguration")) + .build(); + } + } + } + return getGetClientConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenTable", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod; + if ((getOpenTableMethod = BigtableGrpc.getOpenTableMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenTableMethod = BigtableGrpc.getOpenTableMethod) == null) { + BigtableGrpc.getOpenTableMethod = + getOpenTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OpenTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("OpenTable")) + .build(); + } + } + } + return getOpenTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenAuthorizedView", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod; + if ((getOpenAuthorizedViewMethod = BigtableGrpc.getOpenAuthorizedViewMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenAuthorizedViewMethod = BigtableGrpc.getOpenAuthorizedViewMethod) == null) { + BigtableGrpc.getOpenAuthorizedViewMethod = + getOpenAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OpenAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("OpenAuthorizedView")) + .build(); + } + } + } + return getOpenAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenMaterializedView", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod; + if ((getOpenMaterializedViewMethod = BigtableGrpc.getOpenMaterializedViewMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenMaterializedViewMethod = BigtableGrpc.getOpenMaterializedViewMethod) == null) { + BigtableGrpc.getOpenMaterializedViewMethod = + getOpenMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "OpenMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("OpenMaterializedView")) + .build(); + } + } + } + return getOpenMaterializedViewMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static BigtableStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableStub(channel, callOptions); + } + }; + return BigtableStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static BigtableBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableBlockingV2Stub(channel, callOptions); + } + }; + return BigtableBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static BigtableBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableBlockingStub(channel, callOptions); + } + }; + return BigtableBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static BigtableFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public BigtableFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableFutureStub(channel, callOptions); + } + }; + return BigtableFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Streams back the contents of all requested rows in key order, optionally
+     * applying the same Reader filter to each. Depending on their size,
+     * rows and cells may be broken up across multiple responses, but
+     * atomicity of each row will still be preserved. See the
+     * ReadRowsResponse documentation for details.
+     * 
+ */ + default void readRows( + com.google.bigtable.v2.ReadRowsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadRowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a sample of row keys in the table. The returned row keys will
+     * delimit contiguous sections of the table of approximately equal size,
+     * which can be used to break up the data for distributed tasks like
+     * mapreduces.
+     * 
+ */ + default void sampleRowKeys( + com.google.bigtable.v2.SampleRowKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSampleRowKeysMethod(), responseObserver); + } + + /** + * + * + *
+     * Mutates a row atomically. Cells already present in the row are left
+     * unchanged unless explicitly changed by `mutation`.
+     * 
+ */ + default void mutateRow( + com.google.bigtable.v2.MutateRowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowMethod(), responseObserver); + } + + /** + * + * + *
+     * Mutates multiple rows in a batch. Each individual row is mutated
+     * atomically as in MutateRow, but the entire batch is not executed
+     * atomically.
+     * 
+ */ + default void mutateRows( + com.google.bigtable.v2.MutateRowsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Mutates a row atomically based on the output of a predicate Reader filter.
+     * 
+ */ + default void checkAndMutateRow( + com.google.bigtable.v2.CheckAndMutateRowRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCheckAndMutateRowMethod(), responseObserver); + } + + /** + * + * + *
+     * Warm up associated instance metadata for this connection.
+     * This call is not required but may be useful for connection keep-alive.
+     * 
+ */ + default void pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPingAndWarmMethod(), responseObserver); + } + + /** + * + * + *
+     * 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
+     * timestamp is the greater of the existing timestamp or the current server
+     * time. The method returns the new contents of all modified cells.
+     * 
+ */ + default void readModifyWriteRow( + com.google.bigtable.v2.ReadModifyWriteRowRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReadModifyWriteRowMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the current list of partitions that make up the table's
+     * change stream. The union of partitions will cover the entire keyspace.
+     * Partitions can be read with `ReadChangeStream`.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + default void generateInitialChangeStreamPartitions( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest request, + io.grpc.stub.StreamObserver< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateInitialChangeStreamPartitionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Reads changes from a table's change stream. Changes will
+     * reflect both user-initiated mutations and mutations that are caused by
+     * garbage collection.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + default void readChangeStream( + com.google.bigtable.v2.ReadChangeStreamRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReadChangeStreamMethod(), responseObserver); + } + + /** + * + * + *
+     * Prepares a GoogleSQL query for execution on a particular Bigtable instance.
+     * 
+ */ + default void prepareQuery( + com.google.bigtable.v2.PrepareQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPrepareQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * Executes a SQL query against a particular Bigtable instance.
+     * 
+ */ + default void executeQuery( + com.google.bigtable.v2.ExecuteQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExecuteQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default void getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetClientConfigurationMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openTable( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenTableMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openAuthorizedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openMaterializedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenMaterializedViewMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Bigtable. + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public abstract static class BigtableImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return BigtableGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Bigtable. + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public static final class BigtableStub extends io.grpc.stub.AbstractAsyncStub { + private BigtableStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableStub(channel, callOptions); + } + + /** + * + * + *
+     * Streams back the contents of all requested rows in key order, optionally
+     * applying the same Reader filter to each. Depending on their size,
+     * rows and cells may be broken up across multiple responses, but
+     * atomicity of each row will still be preserved. See the
+     * ReadRowsResponse documentation for details.
+     * 
+ */ + public void readRows( + com.google.bigtable.v2.ReadRowsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getReadRowsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Returns a sample of row keys in the table. The returned row keys will
+     * delimit contiguous sections of the table of approximately equal size,
+     * which can be used to break up the data for distributed tasks like
+     * mapreduces.
+     * 
+ */ + public void sampleRowKeys( + com.google.bigtable.v2.SampleRowKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getSampleRowKeysMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Mutates a row atomically. Cells already present in the row are left
+     * unchanged unless explicitly changed by `mutation`.
+     * 
+ */ + public void mutateRow( + com.google.bigtable.v2.MutateRowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMutateRowMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Mutates multiple rows in a batch. Each individual row is mutated
+     * atomically as in MutateRow, but the entire batch is not executed
+     * atomically.
+     * 
+ */ + public void mutateRows( + com.google.bigtable.v2.MutateRowsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getMutateRowsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Mutates a row atomically based on the output of a predicate Reader filter.
+     * 
+ */ + public void checkAndMutateRow( + com.google.bigtable.v2.CheckAndMutateRowRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCheckAndMutateRowMethod(), getCallOptions()), + request, + 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); + } + + /** + * + * + *
+     * 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
+     * timestamp is the greater of the existing timestamp or the current server
+     * time. The method returns the new contents of all modified cells.
+     * 
+ */ + public void readModifyWriteRow( + com.google.bigtable.v2.ReadModifyWriteRowRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReadModifyWriteRowMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the current list of partitions that make up the table's
+     * change stream. The union of partitions will cover the entire keyspace.
+     * Partitions can be read with `ReadChangeStream`.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + public void generateInitialChangeStreamPartitions( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest request, + io.grpc.stub.StreamObserver< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGenerateInitialChangeStreamPartitionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reads changes from a table's change stream. Changes will
+     * reflect both user-initiated mutations and mutations that are caused by
+     * garbage collection.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + public void readChangeStream( + com.google.bigtable.v2.ReadChangeStreamRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getReadChangeStreamMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Prepares a GoogleSQL query for execution on a particular Bigtable instance.
+     * 
+ */ + public void prepareQuery( + com.google.bigtable.v2.PrepareQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPrepareQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Executes a SQL query against a particular Bigtable instance.
+     * 
+ */ + public void executeQuery( + com.google.bigtable.v2.ExecuteQueryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getExecuteQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public void getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClientConfigurationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openTable( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenTableMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openAuthorizedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenAuthorizedViewMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openMaterializedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenMaterializedViewMethod(), getCallOptions()), + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Bigtable. + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public static final class BigtableBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Streams back the contents of all requested rows in key order, optionally
+     * applying the same Reader filter to each. Depending on their size,
+     * rows and cells may be broken up across multiple responses, but
+     * atomicity of each row will still be preserved. See the
+     * ReadRowsResponse documentation for details.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall readRows( + com.google.bigtable.v2.ReadRowsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getReadRowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a sample of row keys in the table. The returned row keys will
+     * delimit contiguous sections of the table of approximately equal size,
+     * which can be used to break up the data for distributed tasks like
+     * mapreduces.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + sampleRowKeys(com.google.bigtable.v2.SampleRowKeysRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getSampleRowKeysMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates a row atomically. Cells already present in the row are left
+     * unchanged unless explicitly changed by `mutation`.
+     * 
+ */ + public com.google.bigtable.v2.MutateRowResponse mutateRow( + com.google.bigtable.v2.MutateRowRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getMutateRowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates multiple rows in a batch. Each individual row is mutated
+     * atomically as in MutateRow, but the entire batch is not executed
+     * atomically.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall mutateRows( + com.google.bigtable.v2.MutateRowsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getMutateRowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates a row atomically based on the output of a predicate Reader filter.
+     * 
+ */ + public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow( + com.google.bigtable.v2.CheckAndMutateRowRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + 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) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPingAndWarmMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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
+     * timestamp is the greater of the existing timestamp or the current server
+     * time. The method returns the new contents of all modified cells.
+     * 
+ */ + public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow( + com.google.bigtable.v2.ReadModifyWriteRowRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReadModifyWriteRowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the current list of partitions that make up the table's
+     * change stream. The union of partitions will cover the entire keyspace.
+     * Partitions can be read with `ReadChangeStream`.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + ?, com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse> + generateInitialChangeStreamPartitions( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), + getGenerateInitialChangeStreamPartitionsMethod(), + getCallOptions(), + request); + } + + /** + * + * + *
+     * Reads changes from a table's change stream. Changes will
+     * reflect both user-initiated mutations and mutations that are caused by
+     * garbage collection.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + readChangeStream(com.google.bigtable.v2.ReadChangeStreamRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getReadChangeStreamMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Prepares a GoogleSQL query for execution on a particular Bigtable instance.
+     * 
+ */ + public com.google.bigtable.v2.PrepareQueryResponse prepareQuery( + com.google.bigtable.v2.PrepareQueryRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPrepareQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Executes a SQL query against a particular Bigtable instance.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + executeQuery(com.google.bigtable.v2.ExecuteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExecuteQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.bigtable.v2.ClientConfiguration getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetClientConfigurationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openTable() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenTableMethod(), getCallOptions()); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openAuthorizedView() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenAuthorizedViewMethod(), getCallOptions()); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openMaterializedView() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenMaterializedViewMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Bigtable. + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public static final class BigtableBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private BigtableBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Streams back the contents of all requested rows in key order, optionally
+     * applying the same Reader filter to each. Depending on their size,
+     * rows and cells may be broken up across multiple responses, but
+     * atomicity of each row will still be preserved. See the
+     * ReadRowsResponse documentation for details.
+     * 
+ */ + public java.util.Iterator readRows( + com.google.bigtable.v2.ReadRowsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getReadRowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a sample of row keys in the table. The returned row keys will
+     * delimit contiguous sections of the table of approximately equal size,
+     * which can be used to break up the data for distributed tasks like
+     * mapreduces.
+     * 
+ */ + public java.util.Iterator sampleRowKeys( + com.google.bigtable.v2.SampleRowKeysRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getSampleRowKeysMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates a row atomically. Cells already present in the row are left
+     * unchanged unless explicitly changed by `mutation`.
+     * 
+ */ + public com.google.bigtable.v2.MutateRowResponse mutateRow( + com.google.bigtable.v2.MutateRowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMutateRowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates multiple rows in a batch. Each individual row is mutated
+     * atomically as in MutateRow, but the entire batch is not executed
+     * atomically.
+     * 
+ */ + public java.util.Iterator mutateRows( + com.google.bigtable.v2.MutateRowsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getMutateRowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Mutates a row atomically based on the output of a predicate Reader filter.
+     * 
+ */ + public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow( + com.google.bigtable.v2.CheckAndMutateRowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + 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); + } + + /** + * + * + *
+     * 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
+     * timestamp is the greater of the existing timestamp or the current server
+     * time. The method returns the new contents of all modified cells.
+     * 
+ */ + public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow( + com.google.bigtable.v2.ReadModifyWriteRowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReadModifyWriteRowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the current list of partitions that make up the table's
+     * change stream. The union of partitions will cover the entire keyspace.
+     * Partitions can be read with `ReadChangeStream`.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + public java.util.Iterator + generateInitialChangeStreamPartitions( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), + getGenerateInitialChangeStreamPartitionsMethod(), + getCallOptions(), + request); + } + + /** + * + * + *
+     * Reads changes from a table's change stream. Changes will
+     * reflect both user-initiated mutations and mutations that are caused by
+     * garbage collection.
+     * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
+     * 
+ */ + public java.util.Iterator readChangeStream( + com.google.bigtable.v2.ReadChangeStreamRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getReadChangeStreamMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Prepares a GoogleSQL query for execution on a particular Bigtable instance.
+     * 
+ */ + public com.google.bigtable.v2.PrepareQueryResponse prepareQuery( + com.google.bigtable.v2.PrepareQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPrepareQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Executes a SQL query against a particular Bigtable instance.
+     * 
+ */ + public java.util.Iterator executeQuery( + com.google.bigtable.v2.ExecuteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExecuteQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.bigtable.v2.ClientConfiguration getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClientConfigurationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Bigtable. + * + *
+   * Service for reading from and writing to existing Bigtable tables.
+   * 
+ */ + public static final class BigtableFutureStub + extends io.grpc.stub.AbstractFutureStub { + private BigtableFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Mutates a row atomically. Cells already present in the row are left
+     * unchanged unless explicitly changed by `mutation`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.MutateRowResponse> + mutateRow(com.google.bigtable.v2.MutateRowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMutateRowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Mutates a row atomically based on the output of a predicate Reader filter.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.CheckAndMutateRowResponse> + checkAndMutateRow(com.google.bigtable.v2.CheckAndMutateRowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + 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); + } + + /** + * + * + *
+     * 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
+     * timestamp is the greater of the existing timestamp or the current server
+     * time. The method returns the new contents of all modified cells.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.ReadModifyWriteRowResponse> + readModifyWriteRow(com.google.bigtable.v2.ReadModifyWriteRowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReadModifyWriteRowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Prepares a GoogleSQL query for execution on a particular Bigtable instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.PrepareQueryResponse> + prepareQuery(com.google.bigtable.v2.PrepareQueryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPrepareQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.ClientConfiguration> + getClientConfiguration(com.google.bigtable.v2.GetClientConfigurationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClientConfigurationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_READ_ROWS = 0; + private static final int METHODID_SAMPLE_ROW_KEYS = 1; + 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_PING_AND_WARM = 5; + private static final int METHODID_READ_MODIFY_WRITE_ROW = 6; + private static final int METHODID_GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS = 7; + private static final int METHODID_READ_CHANGE_STREAM = 8; + private static final int METHODID_PREPARE_QUERY = 9; + private static final int METHODID_EXECUTE_QUERY = 10; + private static final int METHODID_GET_CLIENT_CONFIGURATION = 11; + private static final int METHODID_OPEN_TABLE = 12; + private static final int METHODID_OPEN_AUTHORIZED_VIEW = 13; + private static final int METHODID_OPEN_MATERIALIZED_VIEW = 14; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_READ_ROWS: + serviceImpl.readRows( + (com.google.bigtable.v2.ReadRowsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SAMPLE_ROW_KEYS: + serviceImpl.sampleRowKeys( + (com.google.bigtable.v2.SampleRowKeysRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_MUTATE_ROW: + serviceImpl.mutateRow( + (com.google.bigtable.v2.MutateRowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_MUTATE_ROWS: + serviceImpl.mutateRows( + (com.google.bigtable.v2.MutateRowsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CHECK_AND_MUTATE_ROW: + serviceImpl.checkAndMutateRow( + (com.google.bigtable.v2.CheckAndMutateRowRequest) request, + (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, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS: + serviceImpl.generateInitialChangeStreamPartitions( + (com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse>) + responseObserver); + break; + case METHODID_READ_CHANGE_STREAM: + serviceImpl.readChangeStream( + (com.google.bigtable.v2.ReadChangeStreamRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PREPARE_QUERY: + serviceImpl.prepareQuery( + (com.google.bigtable.v2.PrepareQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXECUTE_QUERY: + serviceImpl.executeQuery( + (com.google.bigtable.v2.ExecuteQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CLIENT_CONFIGURATION: + serviceImpl.getClientConfiguration( + (com.google.bigtable.v2.GetClientConfigurationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_OPEN_TABLE: + return (io.grpc.stub.StreamObserver) + serviceImpl.openTable( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_OPEN_AUTHORIZED_VIEW: + return (io.grpc.stub.StreamObserver) + serviceImpl.openAuthorizedView( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_OPEN_MATERIALIZED_VIEW: + return (io.grpc.stub.StreamObserver) + serviceImpl.openMaterializedView( + (io.grpc.stub.StreamObserver) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getReadRowsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.ReadRowsRequest, + com.google.bigtable.v2.ReadRowsResponse>(service, METHODID_READ_ROWS))) + .addMethod( + getSampleRowKeysMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SampleRowKeysRequest, + com.google.bigtable.v2.SampleRowKeysResponse>( + service, METHODID_SAMPLE_ROW_KEYS))) + .addMethod( + getMutateRowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.MutateRowRequest, + com.google.bigtable.v2.MutateRowResponse>(service, METHODID_MUTATE_ROW))) + .addMethod( + getMutateRowsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.MutateRowsRequest, + com.google.bigtable.v2.MutateRowsResponse>(service, METHODID_MUTATE_ROWS))) + .addMethod( + getCheckAndMutateRowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.CheckAndMutateRowRequest, + com.google.bigtable.v2.CheckAndMutateRowResponse>( + service, METHODID_CHECK_AND_MUTATE_ROW))) + .addMethod( + getPingAndWarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.PingAndWarmRequest, + com.google.bigtable.v2.PingAndWarmResponse>(service, METHODID_PING_AND_WARM))) + .addMethod( + getReadModifyWriteRowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.ReadModifyWriteRowRequest, + com.google.bigtable.v2.ReadModifyWriteRowResponse>( + service, METHODID_READ_MODIFY_WRITE_ROW))) + .addMethod( + getGenerateInitialChangeStreamPartitionsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse>( + service, METHODID_GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS))) + .addMethod( + getReadChangeStreamMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.ReadChangeStreamRequest, + com.google.bigtable.v2.ReadChangeStreamResponse>( + service, METHODID_READ_CHANGE_STREAM))) + .addMethod( + getPrepareQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.PrepareQueryRequest, + com.google.bigtable.v2.PrepareQueryResponse>(service, METHODID_PREPARE_QUERY))) + .addMethod( + getExecuteQueryMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.ExecuteQueryRequest, + com.google.bigtable.v2.ExecuteQueryResponse>(service, METHODID_EXECUTE_QUERY))) + .addMethod( + getGetClientConfigurationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration>( + service, METHODID_GET_CLIENT_CONFIGURATION))) + .addMethod( + getOpenTableMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_TABLE))) + .addMethod( + getOpenAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_AUTHORIZED_VIEW))) + .addMethod( + getOpenMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_MATERIALIZED_VIEW))) + .build(); + } + + private abstract static class BigtableBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + BigtableBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.bigtable.v2.BigtableProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Bigtable"); + } + } + + private static final class BigtableFileDescriptorSupplier extends BigtableBaseDescriptorSupplier { + BigtableFileDescriptorSupplier() {} + } + + private static final class BigtableMethodDescriptorSupplier extends BigtableBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + BigtableMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (BigtableGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new BigtableFileDescriptorSupplier()) + .addMethod(getReadRowsMethod()) + .addMethod(getSampleRowKeysMethod()) + .addMethod(getMutateRowMethod()) + .addMethod(getMutateRowsMethod()) + .addMethod(getCheckAndMutateRowMethod()) + .addMethod(getPingAndWarmMethod()) + .addMethod(getReadModifyWriteRowMethod()) + .addMethod(getGenerateInitialChangeStreamPartitionsMethod()) + .addMethod(getReadChangeStreamMethod()) + .addMethod(getPrepareQueryMethod()) + .addMethod(getExecuteQueryMethod()) + .addMethod(getGetClientConfigurationMethod()) + .addMethod(getOpenTableMethod()) + .addMethod(getOpenAuthorizedViewMethod()) + .addMethod(getOpenMaterializedViewMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-bigtable/owlbot.py b/java-bigtable/owlbot.py new file mode 100644 index 000000000000..de2ac32738c6 --- /dev/null +++ b/java-bigtable/owlbot.py @@ -0,0 +1,61 @@ +# Copyright 2026 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. + +import synthtool as s +from synthtool.languages import java + +'This script is used to synthesize generated parts of this library.' +import re +import os.path +data_internal_only = ['owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java', 'owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java', 'owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java', 'owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java'] +def make_internal_only(sources): + """Annotates all toplevel classes with `@InternalOnly`""" + s.replace(sources, before='^(import (?!static).*?\\n)\\n', after='\\1import com.google.api.core.InternalApi;\\n\\n', flags=re.MULTILINE | re.DOTALL) + s.replace(sources, before='/\\*\\*.+?\\*/\\n(?:^@[^\\n]*\\n)*(?=public [a-zA-B ]*class)', after='/** For internal use only. */\n@Generated("by gapic-generator")\n@InternalApi\n', flags=re.MULTILINE | re.DOTALL) + +for library in s.get_staging_dirs(): + # put any special-case replacements here + make_internal_only(data_internal_only) + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtable.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtable.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java') + if os.path.exists('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java'): + os.remove('owl-bot-staging/v2/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java') + s.replace(f'{library}/**/BaseBigtable*AdminClient.java', 'public static final BaseBigtable(.*)AdminClient create\\(', 'protected static BaseBigtable\\1AdminClient create(') + s.move(library) +s.remove_staging_dirs() +java.common_templates( + monorepo=True, + excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) diff --git a/java-bigtable/pom.xml b/java-bigtable/pom.xml new file mode 100644 index 000000000000..2e42b1e4cddc --- /dev/null +++ b/java-bigtable/pom.xml @@ -0,0 +1,364 @@ + + + 4.0.0 + + google-cloud-bigtable-parent + pom + 2.77.2-SNAPSHOT + Google Cloud Bigtable Parent + https://github.com/googleapis/google-cloud-java + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.86.0 + ../google-cloud-jar-parent/pom.xml + + + + + garrettjonesgoogle + Garrett Jones + garrettjones@google.com + Google + + Developer + + + + pongad + Michael Darakananda + pongad@google.com + Google + + Developer + + + + shinfan + Shin Fan + shinfan@google.com + Google + + Developer + + + + michaelbausor + Micheal Bausor + michaelbausor@google.com + Google + + Developer + + + + vam-google + Vadym Matsishevskyi + vam@google.com + Google + + Developer + + + + tswast + Tim Swast + tswast@google.com + Google + + Developer + + + + neozwu + Neo Wu + neowu@google.com + Google + + Developer + + + + lesv + Les Vogel + lesv@google.com + Google + + Developer + + + + schmidt_sebastian + Sebastian Schmidt + mrschmidt@google.com + Google + + Developer + + + + andreamlin + Andrea Lin + andrealin@google.com + + Developer + + + + hzyi-google + Hanzhen Yi + hzyi@google.com + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/google-cloud-java.git + scm:git:git@github.com:googleapis/google-cloud-java.git + https://github.com/googleapis/google-cloud-java + HEAD + + + https://github.com/googleapis/google-cloud-java/issues + GitHub Issues + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-bigtable-parent + https://googleapis.dev/java/google-api-grpc/latest + + + 2.38.0 + + + + + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + + + com.google.cloud + google-cloud-bigtable + 2.77.2-SNAPSHOT + + + com.google.cloud + google-cloud-conformance-tests + 0.3.7 + + + com.google.truth + truth + 1.4.4 + + + com.google.truth.extensions + truth-proto-extension + 1.4.4 + + + + com.google.protobuf + protobuf-java + + + + + junit + junit + 4.13.2 + + + org.mockito + mockito-bom + + 4.11.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + + false + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.8.0 + + + aggregate + false + site + + aggregate + + + + + **/com/google/bigtable/** + + + + + + + + none + protected + true + ${project.build.directory}/javadoc + + + + + + **/com/google/cloud/bigtable/gaxx/** + + + **/com/google/cloud/bigtable/admin/v2/internal/** + + + **/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java + + + **/com/google/cloud/bigtable/data/v2/internal/** + **/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java + **/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java + **/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java + **/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java + **/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java + **/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java + **/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java + **/com/google/cloud/bigtable/data/v2/stub/mutaterows/** + **/com/google/cloud/bigtable/data/v2/stub/readrows/** + **/com/google/cloud/bigtable/data/v2/stub/metrics/** + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + org.apache.maven.plugins + maven-dependency-plugin + + true + + + + + + + + docFX + + ${env.KOKORO_GFILE_DIR}/java-docfx-doclet-1.9.0.jar + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + com.microsoft.doclet.DocFxDoclet + false + + ${docletPath} + + -outputpath ${project.build.directory}/docfx-yml + -projectname ${project.artifactId} + + + -excludeclasses com\.google\.cloud\.bigtable\.admin\.v2\.internal\..*:com\.google\.cloud\.bigtable\.data\.v2\.(internal\.|(Base.*).*|stub\.(?!Enhanced.*StubSettings).*) + + -excludepackages com\.google\.(bigtable\.v2|bigtable\.admin\.v2|cloud\.bigtable\.stats) + + + + + + aggregate + + aggregate + + + + + + + + + bulkTests + + true + + + + + + google-cloud-bigtable + grpc-google-cloud-bigtable-admin-v2 + grpc-google-cloud-bigtable-v2 + proto-google-cloud-bigtable-admin-v2 + proto-google-cloud-bigtable-v2 + google-cloud-bigtable-emulator-core + google-cloud-bigtable-emulator + google-cloud-bigtable-bom + google-cloud-bigtable-deps-bom + + + diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml b/java-bigtable/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..6ad718d75ff8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -0,0 +1,86 @@ + + + + + 7012 + com/google/bigtable/admin/v2/TableOrBuilder + *Restore* + + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + boolean has*(*) + + + + + 7006 + com/google/bigtable/admin/v2/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/bigtable/admin/v2/** + * addRepeatedField(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * clear() + ** + + + 7006 + com/google/bigtable/admin/v2/** + * clearField(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * clearOneof(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * clone() + ** + + + 7006 + com/google/bigtable/admin/v2/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * setField(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * setRepeatedField(*) + ** + + + 7006 + com/google/bigtable/admin/v2/** + * setUnknownFields(*) + ** + + \ No newline at end of file diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/pom.xml b/java-bigtable/proto-google-cloud-bigtable-admin-v2/pom.xml new file mode 100644 index 000000000000..38b8ccea3175 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -0,0 +1,70 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.77.2-SNAPSHOT + proto-google-cloud-bigtable-admin-v2 + PROTO library for proto-google-cloud-bigtable-admin-v2 + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + com.google.api + api-common + compile + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-common-protos + compile + + + com.google.api.grpc + proto-google-iam-v1 + compile + + + com.google.protobuf + protobuf-java + compile + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java new file mode 100644 index 000000000000..4d28d82aac62 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java @@ -0,0 +1,6845 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A configuration object describing how Cloud Bigtable should treat traffic
+ * from a particular end user application.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile} + */ +@com.google.protobuf.Generated +public final class AppProfile extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile) + AppProfileOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AppProfile"); + } + + // Use AppProfile.newBuilder() to construct. + private AppProfile(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AppProfile() { + name_ = ""; + etag_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.class, + com.google.bigtable.admin.v2.AppProfile.Builder.class); + } + + /** + * + * + *
+   * Possible priorities for an app profile. Note that higher priority writes
+   * can sometimes queue behind lower priority writes to the same tablet, as
+   * writes must be strictly sequenced in the durability log.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.AppProfile.Priority} + */ + public enum Priority implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.
+     * 
+ * + * PRIORITY_UNSPECIFIED = 0; + */ + PRIORITY_UNSPECIFIED(0), + /** PRIORITY_LOW = 1; */ + PRIORITY_LOW(1), + /** PRIORITY_MEDIUM = 2; */ + PRIORITY_MEDIUM(2), + /** PRIORITY_HIGH = 3; */ + PRIORITY_HIGH(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Priority"); + } + + /** + * + * + *
+     * Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.
+     * 
+ * + * PRIORITY_UNSPECIFIED = 0; + */ + public static final int PRIORITY_UNSPECIFIED_VALUE = 0; + + /** PRIORITY_LOW = 1; */ + public static final int PRIORITY_LOW_VALUE = 1; + + /** PRIORITY_MEDIUM = 2; */ + public static final int PRIORITY_MEDIUM_VALUE = 2; + + /** PRIORITY_HIGH = 3; */ + public static final int PRIORITY_HIGH_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Priority valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Priority forNumber(int value) { + switch (value) { + case 0: + return PRIORITY_UNSPECIFIED; + case 1: + return PRIORITY_LOW; + case 2: + return PRIORITY_MEDIUM; + case 3: + return PRIORITY_HIGH; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Priority findValueByNumber(int number) { + return Priority.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.AppProfile.getDescriptor().getEnumTypes().get(0); + } + + private static final Priority[] VALUES = values(); + + public static Priority valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Priority(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.AppProfile.Priority) + } + + public interface MultiClusterRoutingUseAnyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @return A list containing the clusterIds. + */ + java.util.List getClusterIdsList(); + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @return The count of clusterIds. + */ + int getClusterIdsCount(); + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the element to return. + * @return The clusterIds at the given index. + */ + java.lang.String getClusterIds(int index); + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the clusterIds at the given index. + */ + com.google.protobuf.ByteString getClusterIdsBytes(int index); + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return Whether the rowAffinity field is set. + */ + boolean hasRowAffinity(); + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return The rowAffinity. + */ + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity getRowAffinity(); + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityOrBuilder + getRowAffinityOrBuilder(); + + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.AffinityCase + getAffinityCase(); + } + + /** + * + * + *
+   * Read/write requests are routed to the nearest cluster in the instance, and
+   * will fail over to the nearest cluster that is available in the event of
+   * transient errors or delays. Clusters in a region are considered
+   * equidistant. Choosing this option sacrifices read-your-writes consistency
+   * to improve availability.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} + */ + public static final class MultiClusterRoutingUseAny extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + MultiClusterRoutingUseAnyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MultiClusterRoutingUseAny"); + } + + // Use MultiClusterRoutingUseAny.newBuilder() to construct. + private MultiClusterRoutingUseAny(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MultiClusterRoutingUseAny() { + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.class, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder.class); + } + + public interface RowAffinityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * If enabled, Bigtable will route the request based on the row key of the
+     * request, rather than randomly. Instead, each row key will be assigned
+     * to a cluster, and will stick to that cluster. If clusters are added or
+     * removed, then this may affect which row keys stick to which clusters.
+     * To avoid this, users can use a cluster group to specify which clusters
+     * are to be used. In this case, new clusters that are not a part of the
+     * cluster group will not be routed to, and routing will be unaffected by
+     * the new cluster. Moreover, clusters specified in the cluster group cannot
+     * be deleted unless removed from the cluster group.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} + */ + public static final class RowAffinity extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + RowAffinityOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowAffinity"); + } + + // Use RowAffinity.newBuilder() to construct. + private RowAffinity(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RowAffinity() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.class, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity other = + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + 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.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + 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.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * If enabled, Bigtable will route the request based on the row key of the
+       * request, rather than randomly. Instead, each row key will be assigned
+       * to a cluster, and will stick to that cluster. If clusters are added or
+       * removed, then this may affect which row keys stick to which clusters.
+       * To avoid this, users can use a cluster group to specify which clusters
+       * are to be used. In this case, new clusters that are not a part of the
+       * cluster group will not be routed to, and routing will be unaffected by
+       * the new cluster. Moreover, clusters specified in the cluster group cannot
+       * be deleted unless removed from the cluster group.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .class, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + build() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + buildPartial() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity result = + new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity( + this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) { + return mergeFrom( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity other) { + if (other + == com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + private static final com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowAffinity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int affinityCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object affinity_; + + public enum AffinityCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ROW_AFFINITY(3), + AFFINITY_NOT_SET(0); + private final int value; + + private AffinityCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AffinityCase valueOf(int value) { + return forNumber(value); + } + + public static AffinityCase forNumber(int value) { + switch (value) { + case 3: + return ROW_AFFINITY; + case 0: + return AFFINITY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AffinityCase getAffinityCase() { + return AffinityCase.forNumber(affinityCase_); + } + + public static final int CLUSTER_IDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList clusterIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @return A list containing the clusterIds. + */ + public com.google.protobuf.ProtocolStringList getClusterIdsList() { + return clusterIds_; + } + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @return The count of clusterIds. + */ + public int getClusterIdsCount() { + return clusterIds_.size(); + } + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the element to return. + * @return The clusterIds at the given index. + */ + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(index); + } + + /** + * + * + *
+     * The set of clusters to route to. The order is ignored; clusters will be
+     * tried in order of distance. If left empty, all clusters are eligible.
+     * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the clusterIds at the given index. + */ + public com.google.protobuf.ByteString getClusterIdsBytes(int index) { + return clusterIds_.getByteString(index); + } + + public static final int ROW_AFFINITY_FIELD_NUMBER = 3; + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return Whether the rowAffinity field is set. + */ + @java.lang.Override + public boolean hasRowAffinity() { + return affinityCase_ == 3; + } + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return The rowAffinity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getRowAffinity() { + if (affinityCase_ == 3) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + + /** + * + * + *
+     * Row affinity sticky routing based on the row key of the request.
+     * Requests that span multiple rows are routed non-deterministically.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityOrBuilder + getRowAffinityOrBuilder() { + if (affinityCase_ == 3) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + + 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 { + for (int i = 0; i < clusterIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, clusterIds_.getRaw(i)); + } + if (affinityCase_ == 3) { + output.writeMessage( + 3, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < clusterIds_.size(); i++) { + dataSize += computeStringSizeNoTag(clusterIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getClusterIdsList().size(); + } + if (affinityCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_); + } + size += getUnknownFields().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.admin.v2.AppProfile.MultiClusterRoutingUseAny)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other = + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) obj; + + if (!getClusterIdsList().equals(other.getClusterIdsList())) return false; + if (!getAffinityCase().equals(other.getAffinityCase())) return false; + switch (affinityCase_) { + case 3: + if (!getRowAffinity().equals(other.getRowAffinity())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getClusterIdsCount() > 0) { + hash = (37 * hash) + CLUSTER_IDS_FIELD_NUMBER; + hash = (53 * hash) + getClusterIdsList().hashCode(); + } + switch (affinityCase_) { + case 3: + hash = (37 * hash) + ROW_AFFINITY_FIELD_NUMBER; + hash = (53 * hash) + getRowAffinity().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny 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.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny 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.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile.MultiClusterRoutingUseAny 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Read/write requests are routed to the nearest cluster in the instance, and
+     * will fail over to the nearest cluster that is available in the event of
+     * transient errors or delays. Clusters in a region are considered
+     * equidistant. Choosing this option sacrifices read-your-writes consistency
+     * to improve availability.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.class, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (rowAffinityBuilder_ != null) { + rowAffinityBuilder_.clear(); + } + affinityCase_ = 0; + affinity_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny build() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny buildPartial() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result = + new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + clusterIds_.makeImmutable(); + result.clusterIds_ = clusterIds_; + } + } + + private void buildPartialOneofs( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result) { + result.affinityCase_ = affinityCase_; + result.affinity_ = this.affinity_; + if (affinityCase_ == 3 && rowAffinityBuilder_ != null) { + result.affinity_ = rowAffinityBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) { + return mergeFrom( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other) { + if (other + == com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) return this; + if (!other.clusterIds_.isEmpty()) { + if (clusterIds_.isEmpty()) { + clusterIds_ = other.clusterIds_; + bitField0_ |= 0x00000001; + } else { + ensureClusterIdsIsMutable(); + clusterIds_.addAll(other.clusterIds_); + } + onChanged(); + } + switch (other.getAffinityCase()) { + case ROW_AFFINITY: + { + mergeRowAffinity(other.getRowAffinity()); + break; + } + case AFFINITY_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureClusterIdsIsMutable(); + clusterIds_.add(s); + break; + } // case 10 + case 26: + { + input.readMessage( + internalGetRowAffinityFieldBuilder().getBuilder(), extensionRegistry); + affinityCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int affinityCase_ = 0; + private java.lang.Object affinity_; + + public AffinityCase getAffinityCase() { + return AffinityCase.forNumber(affinityCase_); + } + + public Builder clearAffinity() { + affinityCase_ = 0; + affinity_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList clusterIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureClusterIdsIsMutable() { + if (!clusterIds_.isModifiable()) { + clusterIds_ = new com.google.protobuf.LazyStringArrayList(clusterIds_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @return A list containing the clusterIds. + */ + public com.google.protobuf.ProtocolStringList getClusterIdsList() { + clusterIds_.makeImmutable(); + return clusterIds_; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @return The count of clusterIds. + */ + public int getClusterIdsCount() { + return clusterIds_.size(); + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the element to return. + * @return The clusterIds at the given index. + */ + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(index); + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the clusterIds at the given index. + */ + public com.google.protobuf.ByteString getClusterIdsBytes(int index) { + return clusterIds_.getByteString(index); + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param index The index to set the value at. + * @param value The clusterIds to set. + * @return This builder for chaining. + */ + public Builder setClusterIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterIdsIsMutable(); + clusterIds_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param value The clusterIds to add. + * @return This builder for chaining. + */ + public Builder addClusterIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterIdsIsMutable(); + clusterIds_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param values The clusterIds to add. + * @return This builder for chaining. + */ + public Builder addAllClusterIds(java.lang.Iterable values) { + ensureClusterIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterIds_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @return This builder for chaining. + */ + public Builder clearClusterIds() { + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * The set of clusters to route to. The order is ignored; clusters will be
+       * tried in order of distance. If left empty, all clusters are eligible.
+       * 
+ * + * repeated string cluster_ids = 1; + * + * @param value The bytes of the clusterIds to add. + * @return This builder for chaining. + */ + public Builder addClusterIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureClusterIdsIsMutable(); + clusterIds_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinityOrBuilder> + rowAffinityBuilder_; + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return Whether the rowAffinity field is set. + */ + @java.lang.Override + public boolean hasRowAffinity() { + return affinityCase_ == 3; + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return The rowAffinity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getRowAffinity() { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } else { + if (affinityCase_ == 3) { + return rowAffinityBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity value) { + if (rowAffinityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + affinity_ = value; + onChanged(); + } else { + rowAffinityBuilder_.setMessage(value); + } + affinityCase_ = 3; + return this; + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder + builderForValue) { + if (rowAffinityBuilder_ == null) { + affinity_ = builderForValue.build(); + onChanged(); + } else { + rowAffinityBuilder_.setMessage(builderForValue.build()); + } + affinityCase_ = 3; + return this; + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder mergeRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity value) { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3 + && affinity_ + != com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance()) { + affinity_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .newBuilder( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity) + affinity_) + .mergeFrom(value) + .buildPartial(); + } else { + affinity_ = value; + } + onChanged(); + } else { + if (affinityCase_ == 3) { + rowAffinityBuilder_.mergeFrom(value); + } else { + rowAffinityBuilder_.setMessage(value); + } + } + affinityCase_ = 3; + return this; + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder clearRowAffinity() { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3) { + affinityCase_ = 0; + affinity_ = null; + onChanged(); + } + } else { + if (affinityCase_ == 3) { + affinityCase_ = 0; + affinity_ = null; + } + rowAffinityBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder + getRowAffinityBuilder() { + return internalGetRowAffinityFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityOrBuilder + getRowAffinityOrBuilder() { + if ((affinityCase_ == 3) && (rowAffinityBuilder_ != null)) { + return rowAffinityBuilder_.getMessageOrBuilder(); + } else { + if (affinityCase_ == 3) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Row affinity sticky routing based on the row key of the request.
+       * Requests that span multiple rows are routed non-deterministically.
+       * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinityOrBuilder> + internalGetRowAffinityFieldBuilder() { + if (rowAffinityBuilder_ == null) { + if (!(affinityCase_ == 3)) { + affinity_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + rowAffinityBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinityOrBuilder>( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_, + getParentForChildren(), + isClean()); + affinity_ = null; + } + affinityCase_ = 3; + onChanged(); + return rowAffinityBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + private static final com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); + } + + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultiClusterRoutingUseAny parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile.MultiClusterRoutingUseAny + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SingleClusterRoutingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The cluster to which read/write requests should be routed.
+     * 
+ * + * string cluster_id = 1; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + + /** + * + * + *
+     * The cluster to which read/write requests should be routed.
+     * 
+ * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+     * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
+     * allowed by this app profile. It is unsafe to send these requests to
+     * the same table/row/column in multiple clusters.
+     * 
+ * + * bool allow_transactional_writes = 2; + * + * @return The allowTransactionalWrites. + */ + boolean getAllowTransactionalWrites(); + } + + /** + * + * + *
+   * Unconditionally routes all read/write requests to a specific cluster.
+   * This option preserves read-your-writes consistency but does not improve
+   * availability.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.SingleClusterRouting} + */ + public static final class SingleClusterRouting extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + SingleClusterRoutingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SingleClusterRouting"); + } + + // Use SingleClusterRouting.newBuilder() to construct. + private SingleClusterRouting(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SingleClusterRouting() { + clusterId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.class, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder.class); + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + + /** + * + * + *
+     * The cluster to which read/write requests should be routed.
+     * 
+ * + * string cluster_id = 1; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + + /** + * + * + *
+     * The cluster to which read/write requests should be routed.
+     * 
+ * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_TRANSACTIONAL_WRITES_FIELD_NUMBER = 2; + private boolean allowTransactionalWrites_ = false; + + /** + * + * + *
+     * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
+     * allowed by this app profile. It is unsafe to send these requests to
+     * the same table/row/column in multiple clusters.
+     * 
+ * + * bool allow_transactional_writes = 2; + * + * @return The allowTransactionalWrites. + */ + @java.lang.Override + public boolean getAllowTransactionalWrites() { + return allowTransactionalWrites_; + } + + 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.GeneratedMessage.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, clusterId_); + } + if (allowTransactionalWrites_ != false) { + output.writeBool(2, allowTransactionalWrites_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, clusterId_); + } + if (allowTransactionalWrites_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowTransactionalWrites_); + } + size += getUnknownFields().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.admin.v2.AppProfile.SingleClusterRouting)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting other = + (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) obj; + + if (!getClusterId().equals(other.getClusterId())) return false; + if (getAllowTransactionalWrites() != other.getAllowTransactionalWrites()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + hash = (37 * hash) + ALLOW_TRANSACTIONAL_WRITES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowTransactionalWrites()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting 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.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting 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.admin.v2.AppProfile.SingleClusterRouting parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile.SingleClusterRouting 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Unconditionally routes all read/write requests to a specific cluster.
+     * This option preserves read-your-writes consistency but does not improve
+     * availability.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.SingleClusterRouting} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.class, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clusterId_ = ""; + allowTransactionalWrites_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting build() { + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting buildPartial() { + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting result = + new com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowTransactionalWrites_ = allowTransactionalWrites_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) { + return mergeFrom((com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting other) { + if (other + == com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance()) + return this; + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAllowTransactionalWrites() != false) { + setAllowTransactionalWrites(other.getAllowTransactionalWrites()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + allowTransactionalWrites_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object clusterId_ = ""; + + /** + * + * + *
+       * The cluster to which read/write requests should be routed.
+       * 
+ * + * string cluster_id = 1; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The cluster to which read/write requests should be routed.
+       * 
+ * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The cluster to which read/write requests should be routed.
+       * 
+ * + * string cluster_id = 1; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The cluster to which read/write requests should be routed.
+       * 
+ * + * string cluster_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The cluster to which read/write requests should be routed.
+       * 
+ * + * string cluster_id = 1; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean allowTransactionalWrites_; + + /** + * + * + *
+       * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
+       * allowed by this app profile. It is unsafe to send these requests to
+       * the same table/row/column in multiple clusters.
+       * 
+ * + * bool allow_transactional_writes = 2; + * + * @return The allowTransactionalWrites. + */ + @java.lang.Override + public boolean getAllowTransactionalWrites() { + return allowTransactionalWrites_; + } + + /** + * + * + *
+       * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
+       * allowed by this app profile. It is unsafe to send these requests to
+       * the same table/row/column in multiple clusters.
+       * 
+ * + * bool allow_transactional_writes = 2; + * + * @param value The allowTransactionalWrites to set. + * @return This builder for chaining. + */ + public Builder setAllowTransactionalWrites(boolean value) { + + allowTransactionalWrites_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
+       * allowed by this app profile. It is unsafe to send these requests to
+       * the same table/row/column in multiple clusters.
+       * 
+ * + * bool allow_transactional_writes = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowTransactionalWrites() { + bitField0_ = (bitField0_ & ~0x00000002); + allowTransactionalWrites_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + private static final com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting(); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingleClusterRouting parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile.SingleClusterRouting + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StandardIsolationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.StandardIsolation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The enum numeric value on the wire for priority. + */ + int getPriorityValue(); + + /** + * + * + *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The priority. + */ + com.google.bigtable.admin.v2.AppProfile.Priority getPriority(); + } + + /** + * + * + *
+   * Standard options for isolating this app profile's traffic from other use
+   * cases.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.StandardIsolation} + */ + public static final class StandardIsolation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.StandardIsolation) + StandardIsolationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StandardIsolation"); + } + + // Use StandardIsolation.newBuilder() to construct. + private StandardIsolation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StandardIsolation() { + priority_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.class, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder.class); + } + + public static final int PRIORITY_FIELD_NUMBER = 1; + private int priority_ = 0; + + /** + * + * + *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Override + public int getPriorityValue() { + return priority_; + } + + /** + * + * + *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The priority. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { + com.google.bigtable.admin.v2.AppProfile.Priority result = + com.google.bigtable.admin.v2.AppProfile.Priority.forNumber(priority_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.Priority.UNRECOGNIZED + : result; + } + + 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 (priority_ + != com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, priority_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (priority_ + != com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, priority_); + } + size += getUnknownFields().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.admin.v2.AppProfile.StandardIsolation)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.StandardIsolation other = + (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) obj; + + if (priority_ != other.priority_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + priority_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation 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.admin.v2.AppProfile.StandardIsolation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation 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.admin.v2.AppProfile.StandardIsolation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile.StandardIsolation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Standard options for isolating this app profile's traffic from other use
+     * cases.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.StandardIsolation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile.StandardIsolation) + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.class, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + priority_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation build() { + com.google.bigtable.admin.v2.AppProfile.StandardIsolation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation buildPartial() { + com.google.bigtable.admin.v2.AppProfile.StandardIsolation result = + new com.google.bigtable.admin.v2.AppProfile.StandardIsolation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AppProfile.StandardIsolation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.priority_ = priority_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AppProfile.StandardIsolation) { + return mergeFrom((com.google.bigtable.admin.v2.AppProfile.StandardIsolation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AppProfile.StandardIsolation other) { + if (other == com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance()) + return this; + if (other.priority_ != 0) { + setPriorityValue(other.getPriorityValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + priority_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int priority_ = 0; + + /** + * + * + *
+       * The priority of requests sent using this app profile.
+       * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Override + public int getPriorityValue() { + return priority_; + } + + /** + * + * + *
+       * The priority of requests sent using this app profile.
+       * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @param value The enum numeric value on the wire for priority to set. + * @return This builder for chaining. + */ + public Builder setPriorityValue(int value) { + priority_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The priority of requests sent using this app profile.
+       * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return The priority. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { + com.google.bigtable.admin.v2.AppProfile.Priority result = + com.google.bigtable.admin.v2.AppProfile.Priority.forNumber(priority_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.Priority.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The priority of requests sent using this app profile.
+       * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(com.google.bigtable.admin.v2.AppProfile.Priority value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + priority_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The priority of requests sent using this app profile.
+       * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 1; + * + * @return This builder for chaining. + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00000001); + priority_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.StandardIsolation) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.StandardIsolation) + private static final com.google.bigtable.admin.v2.AppProfile.StandardIsolation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.StandardIsolation(); + } + + public static com.google.bigtable.admin.v2.AppProfile.StandardIsolation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StandardIsolation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile.StandardIsolation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DataBoostIsolationReadOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return Whether the computeBillingOwner field is set. + */ + boolean hasComputeBillingOwner(); + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The enum numeric value on the wire for computeBillingOwner. + */ + int getComputeBillingOwnerValue(); + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The computeBillingOwner. + */ + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + getComputeBillingOwner(); + } + + /** + * + * + *
+   * Data Boost is a serverless compute capability that lets you run
+   * high-throughput read jobs and queries on your Bigtable data, without
+   * impacting the performance of the clusters that handle your application
+   * traffic. Data Boost supports read-only use cases with single-cluster
+   * routing.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} + */ + public static final class DataBoostIsolationReadOnly extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + DataBoostIsolationReadOnlyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataBoostIsolationReadOnly"); + } + + // Use DataBoostIsolationReadOnly.newBuilder() to construct. + private DataBoostIsolationReadOnly(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataBoostIsolationReadOnly() { + computeBillingOwner_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.class, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder.class); + } + + /** + * + * + *
+     * Compute Billing Owner specifies how usage should be accounted when using
+     * Data Boost. Compute Billing Owner also configures which Cloud Project is
+     * charged for relevant quota.
+     * 
+ * + * Protobuf enum {@code + * google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner} + */ + public enum ComputeBillingOwner implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified value.
+       * 
+ * + * COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + */ + COMPUTE_BILLING_OWNER_UNSPECIFIED(0), + /** + * + * + *
+       * The host Cloud Project containing the targeted Bigtable Instance /
+       * Table pays for compute.
+       * 
+ * + * HOST_PAYS = 1; + */ + HOST_PAYS(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComputeBillingOwner"); + } + + /** + * + * + *
+       * Unspecified value.
+       * 
+ * + * COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + */ + public static final int COMPUTE_BILLING_OWNER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The host Cloud Project containing the targeted Bigtable Instance /
+       * Table pays for compute.
+       * 
+ * + * HOST_PAYS = 1; + */ + public static final int HOST_PAYS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ComputeBillingOwner valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ComputeBillingOwner forNumber(int value) { + switch (value) { + case 0: + return COMPUTE_BILLING_OWNER_UNSPECIFIED; + case 1: + return HOST_PAYS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ComputeBillingOwner findValueByNumber(int number) { + return ComputeBillingOwner.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ComputeBillingOwner[] VALUES = values(); + + public static ComputeBillingOwner valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ComputeBillingOwner(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner) + } + + private int bitField0_; + public static final int COMPUTE_BILLING_OWNER_FIELD_NUMBER = 1; + private int computeBillingOwner_ = 0; + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return Whether the computeBillingOwner field is set. + */ + @java.lang.Override + public boolean hasComputeBillingOwner() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The enum numeric value on the wire for computeBillingOwner. + */ + @java.lang.Override + public int getComputeBillingOwnerValue() { + return computeBillingOwner_; + } + + /** + * + * + *
+     * The Compute Billing Owner for this Data Boost App Profile.
+     * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The computeBillingOwner. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + getComputeBillingOwner() { + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + result = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + .forNumber(computeBillingOwner_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + .UNRECOGNIZED + : result; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(1, computeBillingOwner_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, computeBillingOwner_); + } + size += getUnknownFields().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.admin.v2.AppProfile.DataBoostIsolationReadOnly)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly other = + (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) obj; + + if (hasComputeBillingOwner() != other.hasComputeBillingOwner()) return false; + if (hasComputeBillingOwner()) { + if (computeBillingOwner_ != other.computeBillingOwner_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasComputeBillingOwner()) { + hash = (37 * hash) + COMPUTE_BILLING_OWNER_FIELD_NUMBER; + hash = (53 * hash) + computeBillingOwner_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly 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.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly 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.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile.DataBoostIsolationReadOnly 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Data Boost is a serverless compute capability that lets you run
+     * high-throughput read jobs and queries on your Bigtable data, without
+     * impacting the performance of the clusters that handle your application
+     * traffic. Data Boost supports read-only use cases with single-cluster
+     * routing.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.class, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + computeBillingOwner_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly build() { + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly buildPartial() { + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly result = + new com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.computeBillingOwner_ = computeBillingOwner_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) { + return mergeFrom( + (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly other) { + if (other + == com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance()) return this; + if (other.hasComputeBillingOwner()) { + setComputeBillingOwnerValue(other.getComputeBillingOwnerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + computeBillingOwner_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int computeBillingOwner_ = 0; + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return Whether the computeBillingOwner field is set. + */ + @java.lang.Override + public boolean hasComputeBillingOwner() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The enum numeric value on the wire for computeBillingOwner. + */ + @java.lang.Override + public int getComputeBillingOwnerValue() { + return computeBillingOwner_; + } + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @param value The enum numeric value on the wire for computeBillingOwner to set. + * @return This builder for chaining. + */ + public Builder setComputeBillingOwnerValue(int value) { + computeBillingOwner_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return The computeBillingOwner. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + getComputeBillingOwner() { + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + result = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .ComputeBillingOwner.forNumber(computeBillingOwner_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @param value The computeBillingOwner to set. + * @return This builder for chaining. + */ + public Builder setComputeBillingOwner( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + computeBillingOwner_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The Compute Billing Owner for this Data Boost App Profile.
+       * 
+ * + * + * optional .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner compute_billing_owner = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearComputeBillingOwner() { + bitField0_ = (bitField0_ & ~0x00000001); + computeBillingOwner_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + private static final com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly(); + } + + public static com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataBoostIsolationReadOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int routingPolicyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object routingPolicy_; + + public enum RoutingPolicyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MULTI_CLUSTER_ROUTING_USE_ANY(5), + SINGLE_CLUSTER_ROUTING(6), + ROUTINGPOLICY_NOT_SET(0); + private final int value; + + private RoutingPolicyCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RoutingPolicyCase valueOf(int value) { + return forNumber(value); + } + + public static RoutingPolicyCase forNumber(int value) { + switch (value) { + case 5: + return MULTI_CLUSTER_ROUTING_USE_ANY; + case 6: + return SINGLE_CLUSTER_ROUTING; + case 0: + return ROUTINGPOLICY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RoutingPolicyCase getRoutingPolicyCase() { + return RoutingPolicyCase.forNumber(routingPolicyCase_); + } + + private int isolationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object isolation_; + + public enum IsolationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + @java.lang.Deprecated + PRIORITY(7), + STANDARD_ISOLATION(11), + DATA_BOOST_ISOLATION_READ_ONLY(10), + ISOLATION_NOT_SET(0); + private final int value; + + private IsolationCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IsolationCase valueOf(int value) { + return forNumber(value); + } + + public static IsolationCase forNumber(int value) { + switch (value) { + case 7: + return PRIORITY; + case 11: + return STANDARD_ISOLATION; + case 10: + return DATA_BOOST_ISOLATION_READ_ONLY; + case 0: + return ISOLATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public IsolationCase getIsolationCase() { + return IsolationCase.forNumber(isolationCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the app profile. Values are of the form
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the app profile. Values are of the form
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @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 ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Strongly validated etag for optimistic concurrency control. Preserve the
+   * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+   * fail the request if there has been a modification in the mean time. The
+   * `update_mask` of the request need not include `etag` for this protection
+   * to apply.
+   * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+   * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+   * details.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Strongly validated etag for optimistic concurrency control. Preserve the
+   * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+   * fail the request if there has been a modification in the mean time. The
+   * `update_mask` of the request need not include `etag` for this protection
+   * to apply.
+   * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+   * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+   * details.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Long form description of the use case for this AppProfile.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Long form description of the use case for this AppProfile.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MULTI_CLUSTER_ROUTING_USE_ANY_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return Whether the multiClusterRoutingUseAny field is set. + */ + @java.lang.Override + public boolean hasMultiClusterRoutingUseAny() { + return routingPolicyCase_ == 5; + } + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return The multiClusterRoutingUseAny. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + getMultiClusterRoutingUseAny() { + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.getDefaultInstance(); + } + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder + getMultiClusterRoutingUseAnyOrBuilder() { + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.getDefaultInstance(); + } + + public static final int SINGLE_CLUSTER_ROUTING_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return Whether the singleClusterRouting field is set. + */ + @java.lang.Override + public boolean hasSingleClusterRouting() { + return routingPolicyCase_ == 6; + } + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return The singleClusterRouting. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClusterRouting() { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder + getSingleClusterRoutingOrBuilder() { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + + public static final int PRIORITY_FIELD_NUMBER = 7; + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return Whether the priority field is set. + */ + @java.lang.Deprecated + public boolean hasPriority() { + return isolationCase_ == 7; + } + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Deprecated + public int getPriorityValue() { + if (isolationCase_ == 7) { + return (java.lang.Integer) isolation_; + } + return 0; + } + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The priority. + */ + @java.lang.Deprecated + public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { + if (isolationCase_ == 7) { + com.google.bigtable.admin.v2.AppProfile.Priority result = + com.google.bigtable.admin.v2.AppProfile.Priority.forNumber( + (java.lang.Integer) isolation_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.Priority.UNRECOGNIZED + : result; + } + return com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_UNSPECIFIED; + } + + public static final int STANDARD_ISOLATION_FIELD_NUMBER = 11; + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return Whether the standardIsolation field is set. + */ + @java.lang.Override + public boolean hasStandardIsolation() { + return isolationCase_ == 11; + } + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return The standardIsolation. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation getStandardIsolation() { + if (isolationCase_ == 11) { + return (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder + getStandardIsolationOrBuilder() { + if (isolationCase_ == 11) { + return (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + + public static final int DATA_BOOST_ISOLATION_READ_ONLY_FIELD_NUMBER = 10; + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return Whether the dataBoostIsolationReadOnly field is set. + */ + @java.lang.Override + public boolean hasDataBoostIsolationReadOnly() { + return isolationCase_ == 10; + } + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return The dataBoostIsolationReadOnly. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDataBoostIsolationReadOnly() { + if (isolationCase_ == 10) { + return (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.getDefaultInstance(); + } + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder + getDataBoostIsolationReadOnlyOrBuilder() { + if (isolationCase_ == 10) { + return (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.getDefaultInstance(); + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + if (routingPolicyCase_ == 5) { + output.writeMessage( + 5, (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_); + } + if (routingPolicyCase_ == 6) { + output.writeMessage( + 6, (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); + } + if (isolationCase_ == 7) { + output.writeEnum(7, ((java.lang.Integer) isolation_)); + } + if (isolationCase_ == 10) { + output.writeMessage( + 10, (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_); + } + if (isolationCase_ == 11) { + output.writeMessage( + 11, (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + if (routingPolicyCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_); + } + if (routingPolicyCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); + } + if (isolationCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 7, ((java.lang.Integer) isolation_)); + } + if (isolationCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_); + } + if (isolationCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_); + } + size += getUnknownFields().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.admin.v2.AppProfile)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile other = (com.google.bigtable.admin.v2.AppProfile) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getRoutingPolicyCase().equals(other.getRoutingPolicyCase())) return false; + switch (routingPolicyCase_) { + case 5: + if (!getMultiClusterRoutingUseAny().equals(other.getMultiClusterRoutingUseAny())) + return false; + break; + case 6: + if (!getSingleClusterRouting().equals(other.getSingleClusterRouting())) return false; + break; + case 0: + default: + } + if (!getIsolationCase().equals(other.getIsolationCase())) return false; + switch (isolationCase_) { + case 7: + if (getPriorityValue() != other.getPriorityValue()) return false; + break; + case 11: + if (!getStandardIsolation().equals(other.getStandardIsolation())) return false; + break; + case 10: + if (!getDataBoostIsolationReadOnly().equals(other.getDataBoostIsolationReadOnly())) + return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + switch (routingPolicyCase_) { + case 5: + hash = (37 * hash) + MULTI_CLUSTER_ROUTING_USE_ANY_FIELD_NUMBER; + hash = (53 * hash) + getMultiClusterRoutingUseAny().hashCode(); + break; + case 6: + hash = (37 * hash) + SINGLE_CLUSTER_ROUTING_FIELD_NUMBER; + hash = (53 * hash) + getSingleClusterRouting().hashCode(); + break; + case 0: + default: + } + switch (isolationCase_) { + case 7: + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriorityValue(); + break; + case 11: + hash = (37 * hash) + STANDARD_ISOLATION_FIELD_NUMBER; + hash = (53 * hash) + getStandardIsolation().hashCode(); + break; + case 10: + hash = (37 * hash) + DATA_BOOST_ISOLATION_READ_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getDataBoostIsolationReadOnly().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile 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.admin.v2.AppProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile 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.admin.v2.AppProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AppProfile 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A configuration object describing how Cloud Bigtable should treat traffic
+   * from a particular end user application.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AppProfile) + com.google.bigtable.admin.v2.AppProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.class, + com.google.bigtable.admin.v2.AppProfile.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AppProfile.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + description_ = ""; + if (multiClusterRoutingUseAnyBuilder_ != null) { + multiClusterRoutingUseAnyBuilder_.clear(); + } + if (singleClusterRoutingBuilder_ != null) { + singleClusterRoutingBuilder_.clear(); + } + if (standardIsolationBuilder_ != null) { + standardIsolationBuilder_.clear(); + } + if (dataBoostIsolationReadOnlyBuilder_ != null) { + dataBoostIsolationReadOnlyBuilder_.clear(); + } + routingPolicyCase_ = 0; + routingPolicy_ = null; + isolationCase_ = 0; + isolation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile build() { + com.google.bigtable.admin.v2.AppProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile buildPartial() { + com.google.bigtable.admin.v2.AppProfile result = + new com.google.bigtable.admin.v2.AppProfile(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AppProfile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.AppProfile result) { + result.routingPolicyCase_ = routingPolicyCase_; + result.routingPolicy_ = this.routingPolicy_; + if (routingPolicyCase_ == 5 && multiClusterRoutingUseAnyBuilder_ != null) { + result.routingPolicy_ = multiClusterRoutingUseAnyBuilder_.build(); + } + if (routingPolicyCase_ == 6 && singleClusterRoutingBuilder_ != null) { + result.routingPolicy_ = singleClusterRoutingBuilder_.build(); + } + result.isolationCase_ = isolationCase_; + result.isolation_ = this.isolation_; + if (isolationCase_ == 11 && standardIsolationBuilder_ != null) { + result.isolation_ = standardIsolationBuilder_.build(); + } + if (isolationCase_ == 10 && dataBoostIsolationReadOnlyBuilder_ != null) { + result.isolation_ = dataBoostIsolationReadOnlyBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AppProfile) { + return mergeFrom((com.google.bigtable.admin.v2.AppProfile) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AppProfile other) { + if (other == com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getRoutingPolicyCase()) { + case MULTI_CLUSTER_ROUTING_USE_ANY: + { + mergeMultiClusterRoutingUseAny(other.getMultiClusterRoutingUseAny()); + break; + } + case SINGLE_CLUSTER_ROUTING: + { + mergeSingleClusterRouting(other.getSingleClusterRouting()); + break; + } + case ROUTINGPOLICY_NOT_SET: + { + break; + } + } + switch (other.getIsolationCase()) { + case PRIORITY: + { + setPriorityValue(other.getPriorityValue()); + break; + } + case STANDARD_ISOLATION: + { + mergeStandardIsolation(other.getStandardIsolation()); + break; + } + case DATA_BOOST_ISOLATION_READ_ONLY: + { + mergeDataBoostIsolationReadOnly(other.getDataBoostIsolationReadOnly()); + break; + } + case ISOLATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + internalGetMultiClusterRoutingUseAnyFieldBuilder().getBuilder(), + extensionRegistry); + routingPolicyCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetSingleClusterRoutingFieldBuilder().getBuilder(), extensionRegistry); + routingPolicyCase_ = 6; + break; + } // case 50 + case 56: + { + int rawValue = input.readEnum(); + isolationCase_ = 7; + isolation_ = rawValue; + break; + } // case 56 + case 82: + { + input.readMessage( + internalGetDataBoostIsolationReadOnlyFieldBuilder().getBuilder(), + extensionRegistry); + isolationCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetStandardIsolationFieldBuilder().getBuilder(), extensionRegistry); + isolationCase_ = 11; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int routingPolicyCase_ = 0; + private java.lang.Object routingPolicy_; + + public RoutingPolicyCase getRoutingPolicyCase() { + return RoutingPolicyCase.forNumber(routingPolicyCase_); + } + + public Builder clearRoutingPolicy() { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + return this; + } + + private int isolationCase_ = 0; + private java.lang.Object isolation_; + + public IsolationCase getIsolationCase() { + return IsolationCase.forNumber(isolationCase_); + } + + public Builder clearIsolation() { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the app profile. Values are of the form
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the app profile. Values are of the form
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the app profile. Values are of the form
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the app profile. Values are of the form
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the app profile. Values are of the form
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Strongly validated etag for optimistic concurrency control. Preserve the
+     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+     * fail the request if there has been a modification in the mean time. The
+     * `update_mask` of the request need not include `etag` for this protection
+     * to apply.
+     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+     * details.
+     * 
+ * + * string etag = 2; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Strongly validated etag for optimistic concurrency control. Preserve the
+     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+     * fail the request if there has been a modification in the mean time. The
+     * `update_mask` of the request need not include `etag` for this protection
+     * to apply.
+     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+     * details.
+     * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Strongly validated etag for optimistic concurrency control. Preserve the
+     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+     * fail the request if there has been a modification in the mean time. The
+     * `update_mask` of the request need not include `etag` for this protection
+     * to apply.
+     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+     * details.
+     * 
+ * + * string etag = 2; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Strongly validated etag for optimistic concurrency control. Preserve the
+     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+     * fail the request if there has been a modification in the mean time. The
+     * `update_mask` of the request need not include `etag` for this protection
+     * to apply.
+     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+     * details.
+     * 
+ * + * string etag = 2; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Strongly validated etag for optimistic concurrency control. Preserve the
+     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+     * fail the request if there has been a modification in the mean time. The
+     * `update_mask` of the request need not include `etag` for this protection
+     * to apply.
+     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+     * details.
+     * 
+ * + * string etag = 2; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Long form description of the use case for this AppProfile.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Long form description of the use case for this AppProfile.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Long form description of the use case for this AppProfile.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Long form description of the use case for this AppProfile.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Long form description of the use case for this AppProfile.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder> + multiClusterRoutingUseAnyBuilder_; + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return Whether the multiClusterRoutingUseAny field is set. + */ + @java.lang.Override + public boolean hasMultiClusterRoutingUseAny() { + return routingPolicyCase_ == 5; + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return The multiClusterRoutingUseAny. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + getMultiClusterRoutingUseAny() { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } else { + if (routingPolicyCase_ == 5) { + return multiClusterRoutingUseAnyBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny value) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingPolicy_ = value; + onChanged(); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(value); + } + routingPolicyCase_ = 5; + return this; + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder builderForValue) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + routingPolicy_ = builderForValue.build(); + onChanged(); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(builderForValue.build()); + } + routingPolicyCase_ = 5; + return this; + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder mergeMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny value) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5 + && routingPolicy_ + != com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) { + routingPolicy_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + routingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + routingPolicy_ = value; + } + onChanged(); + } else { + if (routingPolicyCase_ == 5) { + multiClusterRoutingUseAnyBuilder_.mergeFrom(value); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(value); + } + } + routingPolicyCase_ = 5; + return this; + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder clearMultiClusterRoutingUseAny() { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + } + } else { + if (routingPolicyCase_ == 5) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + } + multiClusterRoutingUseAnyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder + getMultiClusterRoutingUseAnyBuilder() { + return internalGetMultiClusterRoutingUseAnyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder + getMultiClusterRoutingUseAnyOrBuilder() { + if ((routingPolicyCase_ == 5) && (multiClusterRoutingUseAnyBuilder_ != null)) { + return multiClusterRoutingUseAnyBuilder_.getMessageOrBuilder(); + } else { + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Use a multi-cluster routing policy.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder> + internalGetMultiClusterRoutingUseAnyFieldBuilder() { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (!(routingPolicyCase_ == 5)) { + routingPolicy_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } + multiClusterRoutingUseAnyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder>( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_, + getParentForChildren(), + isClean()); + routingPolicy_ = null; + } + routingPolicyCase_ = 5; + onChanged(); + return multiClusterRoutingUseAnyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder> + singleClusterRoutingBuilder_; + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return Whether the singleClusterRouting field is set. + */ + @java.lang.Override + public boolean hasSingleClusterRouting() { + return routingPolicyCase_ == 6; + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return The singleClusterRouting. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClusterRouting() { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } else { + if (routingPolicyCase_ == 6) { + return singleClusterRoutingBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public Builder setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting value) { + if (singleClusterRoutingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingPolicy_ = value; + onChanged(); + } else { + singleClusterRoutingBuilder_.setMessage(value); + } + routingPolicyCase_ = 6; + return this; + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public Builder setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder builderForValue) { + if (singleClusterRoutingBuilder_ == null) { + routingPolicy_ = builderForValue.build(); + onChanged(); + } else { + singleClusterRoutingBuilder_.setMessage(builderForValue.build()); + } + routingPolicyCase_ = 6; + return this; + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public Builder mergeSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting value) { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6 + && routingPolicy_ + != com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + .getDefaultInstance()) { + routingPolicy_ = + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + routingPolicy_ = value; + } + onChanged(); + } else { + if (routingPolicyCase_ == 6) { + singleClusterRoutingBuilder_.mergeFrom(value); + } else { + singleClusterRoutingBuilder_.setMessage(value); + } + } + routingPolicyCase_ = 6; + return this; + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public Builder clearSingleClusterRouting() { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + } + } else { + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + } + singleClusterRoutingBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder + getSingleClusterRoutingBuilder() { + return internalGetSingleClusterRoutingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder + getSingleClusterRoutingOrBuilder() { + if ((routingPolicyCase_ == 6) && (singleClusterRoutingBuilder_ != null)) { + return singleClusterRoutingBuilder_.getMessageOrBuilder(); + } else { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Use a single-cluster routing policy.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder> + internalGetSingleClusterRoutingFieldBuilder() { + if (singleClusterRoutingBuilder_ == null) { + if (!(routingPolicyCase_ == 6)) { + routingPolicy_ = + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + singleClusterRoutingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder, + com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder>( + (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_, + getParentForChildren(), + isClean()); + routingPolicy_ = null; + } + routingPolicyCase_ = 6; + onChanged(); + return singleClusterRoutingBuilder_; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return Whether the priority field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPriority() { + return isolationCase_ == 7; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Override + @java.lang.Deprecated + public int getPriorityValue() { + if (isolationCase_ == 7) { + return ((java.lang.Integer) isolation_).intValue(); + } + return 0; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @param value The enum numeric value on the wire for priority to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPriorityValue(int value) { + isolationCase_ = 7; + isolation_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The priority. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { + if (isolationCase_ == 7) { + com.google.bigtable.admin.v2.AppProfile.Priority result = + com.google.bigtable.admin.v2.AppProfile.Priority.forNumber( + (java.lang.Integer) isolation_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.Priority.UNRECOGNIZED + : result; + } + return com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_UNSPECIFIED; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @param value The priority to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setPriority(com.google.bigtable.admin.v2.AppProfile.Priority value) { + if (value == null) { + throw new NullPointerException(); + } + isolationCase_ = 7; + isolation_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * This field has been deprecated in favor of `standard_isolation.priority`.
+     * If you set this field, `standard_isolation.priority` will be set instead.
+     *
+     * The priority of requests sent using this app profile.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearPriority() { + if (isolationCase_ == 7) { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.StandardIsolation, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder, + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder> + standardIsolationBuilder_; + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return Whether the standardIsolation field is set. + */ + @java.lang.Override + public boolean hasStandardIsolation() { + return isolationCase_ == 11; + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return The standardIsolation. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation getStandardIsolation() { + if (standardIsolationBuilder_ == null) { + if (isolationCase_ == 11) { + return (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } else { + if (isolationCase_ == 11) { + return standardIsolationBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + public Builder setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation value) { + if (standardIsolationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + isolation_ = value; + onChanged(); + } else { + standardIsolationBuilder_.setMessage(value); + } + isolationCase_ = 11; + return this; + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + public Builder setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder builderForValue) { + if (standardIsolationBuilder_ == null) { + isolation_ = builderForValue.build(); + onChanged(); + } else { + standardIsolationBuilder_.setMessage(builderForValue.build()); + } + isolationCase_ = 11; + return this; + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + public Builder mergeStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation value) { + if (standardIsolationBuilder_ == null) { + if (isolationCase_ == 11 + && isolation_ + != com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance()) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_) + .mergeFrom(value) + .buildPartial(); + } else { + isolation_ = value; + } + onChanged(); + } else { + if (isolationCase_ == 11) { + standardIsolationBuilder_.mergeFrom(value); + } else { + standardIsolationBuilder_.setMessage(value); + } + } + isolationCase_ = 11; + return this; + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + public Builder clearStandardIsolation() { + if (standardIsolationBuilder_ == null) { + if (isolationCase_ == 11) { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + } + } else { + if (isolationCase_ == 11) { + isolationCase_ = 0; + isolation_ = null; + } + standardIsolationBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder + getStandardIsolationBuilder() { + return internalGetStandardIsolationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder + getStandardIsolationOrBuilder() { + if ((isolationCase_ == 11) && (standardIsolationBuilder_ != null)) { + return standardIsolationBuilder_.getMessageOrBuilder(); + } else { + if (isolationCase_ == 11) { + return (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The standard options used for isolating this app profile's traffic from
+     * other use cases.
+     * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.StandardIsolation, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder, + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder> + internalGetStandardIsolationFieldBuilder() { + if (standardIsolationBuilder_ == null) { + if (!(isolationCase_ == 11)) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); + } + standardIsolationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.StandardIsolation, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder, + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder>( + (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_, + getParentForChildren(), + isClean()); + isolation_ = null; + } + isolationCase_ = 11; + onChanged(); + return standardIsolationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder> + dataBoostIsolationReadOnlyBuilder_; + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return Whether the dataBoostIsolationReadOnly field is set. + */ + @java.lang.Override + public boolean hasDataBoostIsolationReadOnly() { + return isolationCase_ == 10; + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return The dataBoostIsolationReadOnly. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDataBoostIsolationReadOnly() { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (isolationCase_ == 10) { + return (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); + } else { + if (isolationCase_ == 10) { + return dataBoostIsolationReadOnlyBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + public Builder setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly value) { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + isolation_ = value; + onChanged(); + } else { + dataBoostIsolationReadOnlyBuilder_.setMessage(value); + } + isolationCase_ = 10; + return this; + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + public Builder setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder + builderForValue) { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + isolation_ = builderForValue.build(); + onChanged(); + } else { + dataBoostIsolationReadOnlyBuilder_.setMessage(builderForValue.build()); + } + isolationCase_ = 10; + return this; + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + public Builder mergeDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly value) { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (isolationCase_ == 10 + && isolation_ + != com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance()) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + isolation_) + .mergeFrom(value) + .buildPartial(); + } else { + isolation_ = value; + } + onChanged(); + } else { + if (isolationCase_ == 10) { + dataBoostIsolationReadOnlyBuilder_.mergeFrom(value); + } else { + dataBoostIsolationReadOnlyBuilder_.setMessage(value); + } + } + isolationCase_ = 10; + return this; + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + public Builder clearDataBoostIsolationReadOnly() { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (isolationCase_ == 10) { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + } + } else { + if (isolationCase_ == 10) { + isolationCase_ = 0; + isolation_ = null; + } + dataBoostIsolationReadOnlyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder + getDataBoostIsolationReadOnlyBuilder() { + return internalGetDataBoostIsolationReadOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder + getDataBoostIsolationReadOnlyOrBuilder() { + if ((isolationCase_ == 10) && (dataBoostIsolationReadOnlyBuilder_ != null)) { + return dataBoostIsolationReadOnlyBuilder_.getMessageOrBuilder(); + } else { + if (isolationCase_ == 10) { + return (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_; + } + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Specifies that this app profile is intended for read-only usage via the
+     * Data Boost feature.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder> + internalGetDataBoostIsolationReadOnlyFieldBuilder() { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (!(isolationCase_ == 10)) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); + } + dataBoostIsolationReadOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder>( + (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_, + getParentForChildren(), + isClean()); + isolation_ = null; + } + isolationCase_ = 10; + onChanged(); + return dataBoostIsolationReadOnlyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile) + private static final com.google.bigtable.admin.v2.AppProfile DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile(); + } + + public static com.google.bigtable.admin.v2.AppProfile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppProfile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AppProfile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java new file mode 100644 index 000000000000..4bf12b0cc86d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2026 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.admin.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 AppProfileName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_APP_PROFILE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/appProfiles/{app_profile}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String appProfile; + + @Deprecated + protected AppProfileName() { + project = null; + instance = null; + appProfile = null; + } + + private AppProfileName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + appProfile = Preconditions.checkNotNull(builder.getAppProfile()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getAppProfile() { + return appProfile; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AppProfileName of(String project, String instance, String appProfile) { + return newBuilder().setProject(project).setInstance(instance).setAppProfile(appProfile).build(); + } + + public static String format(String project, String instance, String appProfile) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setAppProfile(appProfile) + .build() + .toString(); + } + + public static AppProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_APP_PROFILE.validatedMatch( + formattedString, "AppProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("app_profile")); + } + + 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 (AppProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_APP_PROFILE.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); + } + if (appProfile != null) { + fieldMapBuilder.put("app_profile", appProfile); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_APP_PROFILE.instantiate( + "project", project, "instance", instance, "app_profile", appProfile); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AppProfileName that = ((AppProfileName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.appProfile, that.appProfile); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(appProfile); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/appProfiles/{app_profile}. */ + public static class Builder { + private String project; + private String instance; + private String appProfile; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getAppProfile() { + return appProfile; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setAppProfile(String appProfile) { + this.appProfile = appProfile; + return this; + } + + private Builder(AppProfileName appProfileName) { + this.project = appProfileName.project; + this.instance = appProfileName.instance; + this.appProfile = appProfileName.appProfile; + } + + public AppProfileName build() { + return new AppProfileName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java new file mode 100644 index 000000000000..3bb0f90a5d1a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java @@ -0,0 +1,357 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface AppProfileOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the app profile. Values are of the form
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the app profile. Values are of the form
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Strongly validated etag for optimistic concurrency control. Preserve the
+   * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+   * fail the request if there has been a modification in the mean time. The
+   * `update_mask` of the request need not include `etag` for this protection
+   * to apply.
+   * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+   * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+   * details.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Strongly validated etag for optimistic concurrency control. Preserve the
+   * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
+   * fail the request if there has been a modification in the mean time. The
+   * `update_mask` of the request need not include `etag` for this protection
+   * to apply.
+   * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
+   * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
+   * details.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Long form description of the use case for this AppProfile.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Long form description of the use case for this AppProfile.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return Whether the multiClusterRoutingUseAny field is set. + */ + boolean hasMultiClusterRoutingUseAny(); + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + * + * @return The multiClusterRoutingUseAny. + */ + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny getMultiClusterRoutingUseAny(); + + /** + * + * + *
+   * Use a multi-cluster routing policy.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder + getMultiClusterRoutingUseAnyOrBuilder(); + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return Whether the singleClusterRouting field is set. + */ + boolean hasSingleClusterRouting(); + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * + * @return The singleClusterRouting. + */ + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClusterRouting(); + + /** + * + * + *
+   * Use a single-cluster routing policy.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder + getSingleClusterRoutingOrBuilder(); + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return Whether the priority field is set. + */ + @java.lang.Deprecated + boolean hasPriority(); + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The enum numeric value on the wire for priority. + */ + @java.lang.Deprecated + int getPriorityValue(); + + /** + * + * + *
+   * This field has been deprecated in favor of `standard_isolation.priority`.
+   * If you set this field, `standard_isolation.priority` will be set instead.
+   *
+   * The priority of requests sent using this app profile.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=448 + * @return The priority. + */ + @java.lang.Deprecated + com.google.bigtable.admin.v2.AppProfile.Priority getPriority(); + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return Whether the standardIsolation field is set. + */ + boolean hasStandardIsolation(); + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + * + * @return The standardIsolation. + */ + com.google.bigtable.admin.v2.AppProfile.StandardIsolation getStandardIsolation(); + + /** + * + * + *
+   * The standard options used for isolating this app profile's traffic from
+   * other use cases.
+   * 
+ * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; + */ + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder + getStandardIsolationOrBuilder(); + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return Whether the dataBoostIsolationReadOnly field is set. + */ + boolean hasDataBoostIsolationReadOnly(); + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + * + * @return The dataBoostIsolationReadOnly. + */ + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + getDataBoostIsolationReadOnly(); + + /** + * + * + *
+   * Specifies that this app profile is intended for read-only usage via the
+   * Data Boost feature.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + * + */ + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder + getDataBoostIsolationReadOnlyOrBuilder(); + + com.google.bigtable.admin.v2.AppProfile.RoutingPolicyCase getRoutingPolicyCase(); + + com.google.bigtable.admin.v2.AppProfile.IsolationCase getIsolationCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java new file mode 100644 index 000000000000..585753b1e903 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java @@ -0,0 +1,3770 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
+ * can configure access to each Authorized View independently from the table and
+ * use the existing Data APIs to access the subset of data.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView} + */ +@com.google.protobuf.Generated +public final class AuthorizedView extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView) + AuthorizedViewOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizedView"); + } + + // Use AuthorizedView.newBuilder() to construct. + private AuthorizedView(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuthorizedView() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.class, + com.google.bigtable.admin.v2.AuthorizedView.Builder.class); + } + + /** + * + * + *
+   * Defines a subset of an AuthorizedView's fields.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.AuthorizedView.ResponseView} + */ + public enum ResponseView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Uses the default view for each method as documented in the request.
+     * 
+ * + * RESPONSE_VIEW_UNSPECIFIED = 0; + */ + RESPONSE_VIEW_UNSPECIFIED(0), + /** + * + * + *
+     * Only populates `name`.
+     * 
+ * + * NAME_ONLY = 1; + */ + NAME_ONLY(1), + /** + * + * + *
+     * Only populates the AuthorizedView's basic metadata. This includes:
+     * name, deletion_protection, etag.
+     * 
+ * + * BASIC = 2; + */ + BASIC(2), + /** + * + * + *
+     * Populates every fields.
+     * 
+ * + * FULL = 3; + */ + FULL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResponseView"); + } + + /** + * + * + *
+     * Uses the default view for each method as documented in the request.
+     * 
+ * + * RESPONSE_VIEW_UNSPECIFIED = 0; + */ + public static final int RESPONSE_VIEW_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Only populates `name`.
+     * 
+ * + * NAME_ONLY = 1; + */ + public static final int NAME_ONLY_VALUE = 1; + + /** + * + * + *
+     * Only populates the AuthorizedView's basic metadata. This includes:
+     * name, deletion_protection, etag.
+     * 
+ * + * BASIC = 2; + */ + public static final int BASIC_VALUE = 2; + + /** + * + * + *
+     * Populates every fields.
+     * 
+ * + * FULL = 3; + */ + public static final int FULL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResponseView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResponseView forNumber(int value) { + switch (value) { + case 0: + return RESPONSE_VIEW_UNSPECIFIED; + case 1: + return NAME_ONLY; + case 2: + return BASIC; + case 3: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResponseView findValueByNumber(int number) { + return ResponseView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.AuthorizedView.getDescriptor().getEnumTypes().get(0); + } + + private static final ResponseView[] VALUES = values(); + + public static ResponseView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResponseView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.AuthorizedView.ResponseView) + } + + public interface FamilySubsetsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @return A list containing the qualifiers. + */ + java.util.List getQualifiersList(); + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @return The count of qualifiers. + */ + int getQualifiersCount(); + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @param index The index of the element to return. + * @return The qualifiers at the given index. + */ + com.google.protobuf.ByteString getQualifiers(int index); + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return A list containing the qualifierPrefixes. + */ + java.util.List getQualifierPrefixesList(); + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return The count of qualifierPrefixes. + */ + int getQualifierPrefixesCount(); + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param index The index of the element to return. + * @return The qualifierPrefixes at the given index. + */ + com.google.protobuf.ByteString getQualifierPrefixes(int index); + } + + /** + * + * + *
+   * Subsets of a column family that are included in this AuthorizedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView.FamilySubsets} + */ + public static final class FamilySubsets extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + FamilySubsetsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FamilySubsets"); + } + + // Use FamilySubsets.newBuilder() to construct. + private FamilySubsets(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FamilySubsets() { + qualifiers_ = emptyList(com.google.protobuf.ByteString.class); + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.class, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder.class); + } + + public static final int QUALIFIERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList qualifiers_ = + emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @return A list containing the qualifiers. + */ + @java.lang.Override + public java.util.List getQualifiersList() { + return qualifiers_; + } + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @return The count of qualifiers. + */ + public int getQualifiersCount() { + return qualifiers_.size(); + } + + /** + * + * + *
+     * Individual exact column qualifiers to be included in the AuthorizedView.
+     * 
+ * + * repeated bytes qualifiers = 1; + * + * @param index The index of the element to return. + * @return The qualifiers at the given index. + */ + public com.google.protobuf.ByteString getQualifiers(int index) { + return qualifiers_.get(index); + } + + public static final int QUALIFIER_PREFIXES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return A list containing the qualifierPrefixes. + */ + @java.lang.Override + public java.util.List getQualifierPrefixesList() { + return qualifierPrefixes_; + } + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return The count of qualifierPrefixes. + */ + public int getQualifierPrefixesCount() { + return qualifierPrefixes_.size(); + } + + /** + * + * + *
+     * Prefixes for qualifiers to be included in the AuthorizedView. Every
+     * qualifier starting with one of these prefixes is included in the
+     * AuthorizedView. To provide access to all qualifiers, include the empty
+     * string as a prefix
+     * ("").
+     * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param index The index of the element to return. + * @return The qualifierPrefixes at the given index. + */ + public com.google.protobuf.ByteString getQualifierPrefixes(int index) { + return qualifierPrefixes_.get(index); + } + + 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 { + for (int i = 0; i < qualifiers_.size(); i++) { + output.writeBytes(1, qualifiers_.get(i)); + } + for (int i = 0; i < qualifierPrefixes_.size(); i++) { + output.writeBytes(2, qualifierPrefixes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < qualifiers_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(qualifiers_.get(i)); + } + size += dataSize; + size += 1 * getQualifiersList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < qualifierPrefixes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag( + qualifierPrefixes_.get(i)); + } + size += dataSize; + size += 1 * getQualifierPrefixesList().size(); + } + size += getUnknownFields().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.admin.v2.AuthorizedView.FamilySubsets)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets other = + (com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) obj; + + if (!getQualifiersList().equals(other.getQualifiersList())) return false; + if (!getQualifierPrefixesList().equals(other.getQualifierPrefixesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getQualifiersCount() > 0) { + hash = (37 * hash) + QUALIFIERS_FIELD_NUMBER; + hash = (53 * hash) + getQualifiersList().hashCode(); + } + if (getQualifierPrefixesCount() > 0) { + hash = (37 * hash) + QUALIFIER_PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getQualifierPrefixesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets 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.admin.v2.AuthorizedView.FamilySubsets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets 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.admin.v2.AuthorizedView.FamilySubsets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AuthorizedView.FamilySubsets 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Subsets of a column family that are included in this AuthorizedView.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView.FamilySubsets} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.class, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + qualifiers_ = emptyList(com.google.protobuf.ByteString.class); + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets build() { + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets buildPartial() { + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets result = + new com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + qualifiers_.makeImmutable(); + result.qualifiers_ = qualifiers_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + qualifierPrefixes_.makeImmutable(); + result.qualifierPrefixes_ = qualifierPrefixes_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) { + return mergeFrom((com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets other) { + if (other == com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.getDefaultInstance()) + return this; + if (!other.qualifiers_.isEmpty()) { + if (qualifiers_.isEmpty()) { + qualifiers_ = other.qualifiers_; + qualifiers_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureQualifiersIsMutable(); + qualifiers_.addAll(other.qualifiers_); + } + onChanged(); + } + if (!other.qualifierPrefixes_.isEmpty()) { + if (qualifierPrefixes_.isEmpty()) { + qualifierPrefixes_ = other.qualifierPrefixes_; + qualifierPrefixes_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureQualifierPrefixesIsMutable(); + qualifierPrefixes_.addAll(other.qualifierPrefixes_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureQualifiersIsMutable(); + qualifiers_.add(v); + break; + } // case 10 + case 18: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureQualifierPrefixesIsMutable(); + qualifierPrefixes_.add(v); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList + qualifiers_ = emptyList(com.google.protobuf.ByteString.class); + + private void ensureQualifiersIsMutable() { + if (!qualifiers_.isModifiable()) { + qualifiers_ = makeMutableCopy(qualifiers_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @return A list containing the qualifiers. + */ + public java.util.List getQualifiersList() { + qualifiers_.makeImmutable(); + return qualifiers_; + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @return The count of qualifiers. + */ + public int getQualifiersCount() { + return qualifiers_.size(); + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @param index The index of the element to return. + * @return The qualifiers at the given index. + */ + public com.google.protobuf.ByteString getQualifiers(int index) { + return qualifiers_.get(index); + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @param index The index to set the value at. + * @param value The qualifiers to set. + * @return This builder for chaining. + */ + public Builder setQualifiers(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifiersIsMutable(); + qualifiers_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @param value The qualifiers to add. + * @return This builder for chaining. + */ + public Builder addQualifiers(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifiersIsMutable(); + qualifiers_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @param values The qualifiers to add. + * @return This builder for chaining. + */ + public Builder addAllQualifiers( + java.lang.Iterable values) { + ensureQualifiersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, qualifiers_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Individual exact column qualifiers to be included in the AuthorizedView.
+       * 
+ * + * repeated bytes qualifiers = 1; + * + * @return This builder for chaining. + */ + public Builder clearQualifiers() { + qualifiers_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.ProtobufList + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + + private void ensureQualifierPrefixesIsMutable() { + if (!qualifierPrefixes_.isModifiable()) { + qualifierPrefixes_ = makeMutableCopy(qualifierPrefixes_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return A list containing the qualifierPrefixes. + */ + public java.util.List getQualifierPrefixesList() { + qualifierPrefixes_.makeImmutable(); + return qualifierPrefixes_; + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return The count of qualifierPrefixes. + */ + public int getQualifierPrefixesCount() { + return qualifierPrefixes_.size(); + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param index The index of the element to return. + * @return The qualifierPrefixes at the given index. + */ + public com.google.protobuf.ByteString getQualifierPrefixes(int index) { + return qualifierPrefixes_.get(index); + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param index The index to set the value at. + * @param value The qualifierPrefixes to set. + * @return This builder for chaining. + */ + public Builder setQualifierPrefixes(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifierPrefixesIsMutable(); + qualifierPrefixes_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param value The qualifierPrefixes to add. + * @return This builder for chaining. + */ + public Builder addQualifierPrefixes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQualifierPrefixesIsMutable(); + qualifierPrefixes_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @param values The qualifierPrefixes to add. + * @return This builder for chaining. + */ + public Builder addAllQualifierPrefixes( + java.lang.Iterable values) { + ensureQualifierPrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, qualifierPrefixes_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Prefixes for qualifiers to be included in the AuthorizedView. Every
+       * qualifier starting with one of these prefixes is included in the
+       * AuthorizedView. To provide access to all qualifiers, include the empty
+       * string as a prefix
+       * ("").
+       * 
+ * + * repeated bytes qualifier_prefixes = 2; + * + * @return This builder for chaining. + */ + public Builder clearQualifierPrefixes() { + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + private static final com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets(); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FamilySubsets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AuthorizedView.FamilySubsets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SubsetViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AuthorizedView.SubsetView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return A list containing the rowPrefixes. + */ + java.util.List getRowPrefixesList(); + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return The count of rowPrefixes. + */ + int getRowPrefixesCount(); + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param index The index of the element to return. + * @return The rowPrefixes at the given index. + */ + com.google.protobuf.ByteString getRowPrefixes(int index); + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + int getFamilySubsetsCount(); + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + boolean containsFamilySubsets(java.lang.String key); + + /** Use {@link #getFamilySubsetsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getFamilySubsets(); + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + java.util.Map + getFamilySubsetsMap(); + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + /* nullable */ + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getFamilySubsetsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets defaultValue); + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getFamilySubsetsOrThrow( + java.lang.String key); + } + + /** + * + * + *
+   * Defines a simple AuthorizedView that is a subset of the underlying Table.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView.SubsetView} + */ + public static final class SubsetView extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView.SubsetView) + SubsetViewOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SubsetView"); + } + + // Use SubsetView.newBuilder() to construct. + private SubsetView(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SubsetView() { + rowPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetFamilySubsets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.class, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder.class); + } + + public static final int ROW_PREFIXES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList rowPrefixes_ = + emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return A list containing the rowPrefixes. + */ + @java.lang.Override + public java.util.List getRowPrefixesList() { + return rowPrefixes_; + } + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return The count of rowPrefixes. + */ + public int getRowPrefixesCount() { + return rowPrefixes_.size(); + } + + /** + * + * + *
+     * Row prefixes to be included in the AuthorizedView.
+     * To provide access to all rows, include the empty string as a prefix ("").
+     * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param index The index of the element to return. + * @return The rowPrefixes at the given index. + */ + public com.google.protobuf.ByteString getRowPrefixes(int index) { + return rowPrefixes_.get(index); + } + + public static final int FAMILY_SUBSETS_FIELD_NUMBER = 2; + + private static final class FamilySubsetsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + familySubsets_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + internalGetFamilySubsets() { + if (familySubsets_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FamilySubsetsDefaultEntryHolder.defaultEntry); + } + return familySubsets_; + } + + public int getFamilySubsetsCount() { + return internalGetFamilySubsets().getMap().size(); + } + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public boolean containsFamilySubsets(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFamilySubsets().getMap().containsKey(key); + } + + /** Use {@link #getFamilySubsetsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + getFamilySubsets() { + return getFamilySubsetsMap(); + } + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + getFamilySubsetsMap() { + return internalGetFamilySubsets().getMap(); + } + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets + getFamilySubsetsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetFamilySubsets().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Map from column family name to the columns in this family to be included
+     * in the AuthorizedView.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getFamilySubsetsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetFamilySubsets().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + for (int i = 0; i < rowPrefixes_.size(); i++) { + output.writeBytes(1, rowPrefixes_.get(i)); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetFamilySubsets(), FamilySubsetsDefaultEntryHolder.defaultEntry, 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < rowPrefixes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(rowPrefixes_.get(i)); + } + size += dataSize; + size += 1 * getRowPrefixesList().size(); + } + for (java.util.Map.Entry< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + entry : internalGetFamilySubsets().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + familySubsets__ = + FamilySubsetsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, familySubsets__); + } + size += getUnknownFields().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.admin.v2.AuthorizedView.SubsetView)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AuthorizedView.SubsetView other = + (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) obj; + + if (!getRowPrefixesList().equals(other.getRowPrefixesList())) return false; + if (!internalGetFamilySubsets().equals(other.internalGetFamilySubsets())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRowPrefixesCount() > 0) { + hash = (37 * hash) + ROW_PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getRowPrefixesList().hashCode(); + } + if (!internalGetFamilySubsets().getMap().isEmpty()) { + hash = (37 * hash) + FAMILY_SUBSETS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFamilySubsets().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView 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.admin.v2.AuthorizedView.SubsetView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView 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.admin.v2.AuthorizedView.SubsetView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AuthorizedView.SubsetView 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Defines a simple AuthorizedView that is a subset of the underlying Table.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView.SubsetView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AuthorizedView.SubsetView) + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetFamilySubsets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableFamilySubsets(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.class, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + internalGetMutableFamilySubsets().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView build() { + com.google.bigtable.admin.v2.AuthorizedView.SubsetView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView buildPartial() { + com.google.bigtable.admin.v2.AuthorizedView.SubsetView result = + new com.google.bigtable.admin.v2.AuthorizedView.SubsetView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AuthorizedView.SubsetView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + rowPrefixes_.makeImmutable(); + result.rowPrefixes_ = rowPrefixes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.familySubsets_ = + internalGetFamilySubsets().build(FamilySubsetsDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AuthorizedView.SubsetView) { + return mergeFrom((com.google.bigtable.admin.v2.AuthorizedView.SubsetView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AuthorizedView.SubsetView other) { + if (other == com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance()) + return this; + if (!other.rowPrefixes_.isEmpty()) { + if (rowPrefixes_.isEmpty()) { + rowPrefixes_ = other.rowPrefixes_; + rowPrefixes_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureRowPrefixesIsMutable(); + rowPrefixes_.addAll(other.rowPrefixes_); + } + onChanged(); + } + internalGetMutableFamilySubsets().mergeFrom(other.internalGetFamilySubsets()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureRowPrefixesIsMutable(); + rowPrefixes_.add(v); + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + familySubsets__ = + input.readMessage( + FamilySubsetsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableFamilySubsets() + .ensureBuilderMap() + .put(familySubsets__.getKey(), familySubsets__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList + rowPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + + private void ensureRowPrefixesIsMutable() { + if (!rowPrefixes_.isModifiable()) { + rowPrefixes_ = makeMutableCopy(rowPrefixes_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return A list containing the rowPrefixes. + */ + public java.util.List getRowPrefixesList() { + rowPrefixes_.makeImmutable(); + return rowPrefixes_; + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return The count of rowPrefixes. + */ + public int getRowPrefixesCount() { + return rowPrefixes_.size(); + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param index The index of the element to return. + * @return The rowPrefixes at the given index. + */ + public com.google.protobuf.ByteString getRowPrefixes(int index) { + return rowPrefixes_.get(index); + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param index The index to set the value at. + * @param value The rowPrefixes to set. + * @return This builder for chaining. + */ + public Builder setRowPrefixes(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowPrefixesIsMutable(); + rowPrefixes_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param value The rowPrefixes to add. + * @return This builder for chaining. + */ + public Builder addRowPrefixes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowPrefixesIsMutable(); + rowPrefixes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @param values The rowPrefixes to add. + * @return This builder for chaining. + */ + public Builder addAllRowPrefixes( + java.lang.Iterable values) { + ensureRowPrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowPrefixes_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Row prefixes to be included in the AuthorizedView.
+       * To provide access to all rows, include the empty string as a prefix ("").
+       * 
+ * + * repeated bytes row_prefixes = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowPrefixes() { + rowPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private static final class FamilySubsetsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> { + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets build( + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) { + return (com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) val; + } + return ((com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + defaultEntry() { + return FamilySubsetsDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final FamilySubsetsConverter familySubsetsConverter = + new FamilySubsetsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder> + familySubsets_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder> + internalGetFamilySubsets() { + if (familySubsets_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(familySubsetsConverter); + } + return familySubsets_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder> + internalGetMutableFamilySubsets() { + if (familySubsets_ == null) { + familySubsets_ = new com.google.protobuf.MapFieldBuilder<>(familySubsetsConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return familySubsets_; + } + + public int getFamilySubsetsCount() { + return internalGetFamilySubsets().ensureBuilderMap().size(); + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public boolean containsFamilySubsets(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFamilySubsets().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getFamilySubsetsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + getFamilySubsets() { + return getFamilySubsetsMap(); + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + getFamilySubsetsMap() { + return internalGetFamilySubsets().getImmutableMap(); + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets + getFamilySubsetsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder> + map = internalGetMutableFamilySubsets().ensureBuilderMap(); + return map.containsKey(key) ? familySubsetsConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets getFamilySubsetsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder> + map = internalGetMutableFamilySubsets().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return familySubsetsConverter.build(map.get(key)); + } + + public Builder clearFamilySubsets() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableFamilySubsets().clear(); + return this; + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + public Builder removeFamilySubsets(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableFamilySubsets().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + getMutableFamilySubsets() { + bitField0_ |= 0x00000002; + return internalGetMutableFamilySubsets().ensureMessageMap(); + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + public Builder putFamilySubsets( + java.lang.String key, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableFamilySubsets().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + public Builder putAllFamilySubsets( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFamilySubsets().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
+       * Map from column family name to the columns in this family to be included
+       * in the AuthorizedView.
+       * 
+ * + * + * map<string, .google.bigtable.admin.v2.AuthorizedView.FamilySubsets> family_subsets = 2; + * + */ + public com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder + putFamilySubsetsBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder> + builderMap = internalGetMutableFamilySubsets().ensureBuilderMap(); + com.google.bigtable.admin.v2.AuthorizedView.FamilySubsetsOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) { + entry = ((com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.AuthorizedView.FamilySubsets.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AuthorizedView.SubsetView) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AuthorizedView.SubsetView) + private static final com.google.bigtable.admin.v2.AuthorizedView.SubsetView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AuthorizedView.SubsetView(); + } + + public static com.google.bigtable.admin.v2.AuthorizedView.SubsetView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsetView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AuthorizedView.SubsetView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int authorizedViewCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object authorizedView_; + + public enum AuthorizedViewCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SUBSET_VIEW(2), + AUTHORIZEDVIEW_NOT_SET(0); + private final int value; + + private AuthorizedViewCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AuthorizedViewCase valueOf(int value) { + return forNumber(value); + } + + public static AuthorizedViewCase forNumber(int value) { + switch (value) { + case 2: + return SUBSET_VIEW; + case 0: + return AUTHORIZEDVIEW_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AuthorizedViewCase getAuthorizedViewCase() { + return AuthorizedViewCase.forNumber(authorizedViewCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The name of this AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+   * Identifier. The name of this AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 SUBSET_VIEW_FIELD_NUMBER = 2; + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return Whether the subsetView field is set. + */ + @java.lang.Override + public boolean hasSubsetView() { + return authorizedViewCase_ == 2; + } + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return The subsetView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView getSubsetView() { + if (authorizedViewCase_ == 2) { + return (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_; + } + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder getSubsetViewOrBuilder() { + if (authorizedViewCase_ == 2) { + return (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_; + } + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * The etag for this AuthorizedView.
+   * If this is provided on update, it must match the server's etag. The server
+   * returns ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * The etag for this AuthorizedView.
+   * If this is provided on update, it must match the server's etag. The server
+   * returns ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELETION_PROTECTION_FIELD_NUMBER = 4; + private boolean deletionProtection_ = false; + + /** + * + * + *
+   * Set to true to make the AuthorizedView protected against deletion.
+   * The parent Table and containing Instance cannot be deleted if an
+   * AuthorizedView has this bit set.
+   * 
+ * + * bool deletion_protection = 4; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (authorizedViewCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (deletionProtection_ != false) { + output.writeBool(4, deletionProtection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (authorizedViewCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (deletionProtection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, deletionProtection_); + } + size += getUnknownFields().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.admin.v2.AuthorizedView)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AuthorizedView other = + (com.google.bigtable.admin.v2.AuthorizedView) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getDeletionProtection() != other.getDeletionProtection()) return false; + if (!getAuthorizedViewCase().equals(other.getAuthorizedViewCase())) return false; + switch (authorizedViewCase_) { + case 2: + if (!getSubsetView().equals(other.getSubsetView())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DELETION_PROTECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtection()); + switch (authorizedViewCase_) { + case 2: + hash = (37 * hash) + SUBSET_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getSubsetView().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView 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.admin.v2.AuthorizedView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView 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.admin.v2.AuthorizedView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AuthorizedView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AuthorizedView 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
+   * can configure access to each Authorized View independently from the table and
+   * use the existing Data APIs to access the subset of data.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AuthorizedView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AuthorizedView) + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AuthorizedView.class, + com.google.bigtable.admin.v2.AuthorizedView.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AuthorizedView.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (subsetViewBuilder_ != null) { + subsetViewBuilder_.clear(); + } + etag_ = ""; + deletionProtection_ = false; + authorizedViewCase_ = 0; + authorizedView_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView build() { + com.google.bigtable.admin.v2.AuthorizedView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView buildPartial() { + com.google.bigtable.admin.v2.AuthorizedView result = + new com.google.bigtable.admin.v2.AuthorizedView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AuthorizedView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deletionProtection_ = deletionProtection_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.AuthorizedView result) { + result.authorizedViewCase_ = authorizedViewCase_; + result.authorizedView_ = this.authorizedView_; + if (authorizedViewCase_ == 2 && subsetViewBuilder_ != null) { + result.authorizedView_ = subsetViewBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AuthorizedView) { + return mergeFrom((com.google.bigtable.admin.v2.AuthorizedView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AuthorizedView other) { + if (other == com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDeletionProtection() != false) { + setDeletionProtection(other.getDeletionProtection()); + } + switch (other.getAuthorizedViewCase()) { + case SUBSET_VIEW: + { + mergeSubsetView(other.getSubsetView()); + break; + } + case AUTHORIZEDVIEW_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSubsetViewFieldBuilder().getBuilder(), extensionRegistry); + authorizedViewCase_ = 2; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + deletionProtection_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int authorizedViewCase_ = 0; + private java.lang.Object authorizedView_; + + public AuthorizedViewCase getAuthorizedViewCase() { + return AuthorizedViewCase.forNumber(authorizedViewCase_); + } + + public Builder clearAuthorizedView() { + authorizedViewCase_ = 0; + authorizedView_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The name of this AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The name of this AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The name of this AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of this AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of this AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView.SubsetView, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder, + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder> + subsetViewBuilder_; + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return Whether the subsetView field is set. + */ + @java.lang.Override + public boolean hasSubsetView() { + return authorizedViewCase_ == 2; + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return The subsetView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView getSubsetView() { + if (subsetViewBuilder_ == null) { + if (authorizedViewCase_ == 2) { + return (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_; + } + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } else { + if (authorizedViewCase_ == 2) { + return subsetViewBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + public Builder setSubsetView(com.google.bigtable.admin.v2.AuthorizedView.SubsetView value) { + if (subsetViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizedView_ = value; + onChanged(); + } else { + subsetViewBuilder_.setMessage(value); + } + authorizedViewCase_ = 2; + return this; + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + public Builder setSubsetView( + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder builderForValue) { + if (subsetViewBuilder_ == null) { + authorizedView_ = builderForValue.build(); + onChanged(); + } else { + subsetViewBuilder_.setMessage(builderForValue.build()); + } + authorizedViewCase_ = 2; + return this; + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + public Builder mergeSubsetView(com.google.bigtable.admin.v2.AuthorizedView.SubsetView value) { + if (subsetViewBuilder_ == null) { + if (authorizedViewCase_ == 2 + && authorizedView_ + != com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance()) { + authorizedView_ = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.newBuilder( + (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_) + .mergeFrom(value) + .buildPartial(); + } else { + authorizedView_ = value; + } + onChanged(); + } else { + if (authorizedViewCase_ == 2) { + subsetViewBuilder_.mergeFrom(value); + } else { + subsetViewBuilder_.setMessage(value); + } + } + authorizedViewCase_ = 2; + return this; + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + public Builder clearSubsetView() { + if (subsetViewBuilder_ == null) { + if (authorizedViewCase_ == 2) { + authorizedViewCase_ = 0; + authorizedView_ = null; + onChanged(); + } + } else { + if (authorizedViewCase_ == 2) { + authorizedViewCase_ = 0; + authorizedView_ = null; + } + subsetViewBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + public com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder getSubsetViewBuilder() { + return internalGetSubsetViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder + getSubsetViewOrBuilder() { + if ((authorizedViewCase_ == 2) && (subsetViewBuilder_ != null)) { + return subsetViewBuilder_.getMessageOrBuilder(); + } else { + if (authorizedViewCase_ == 2) { + return (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_; + } + return com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An AuthorizedView permitting access to an explicit subset of a Table.
+     * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView.SubsetView, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder, + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder> + internalGetSubsetViewFieldBuilder() { + if (subsetViewBuilder_ == null) { + if (!(authorizedViewCase_ == 2)) { + authorizedView_ = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + subsetViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView.SubsetView, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder, + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder>( + (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_, + getParentForChildren(), + isClean()); + authorizedView_ = null; + } + authorizedViewCase_ = 2; + onChanged(); + return subsetViewBuilder_; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * The etag for this AuthorizedView.
+     * If this is provided on update, it must match the server's etag. The server
+     * returns ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The etag for this AuthorizedView.
+     * If this is provided on update, it must match the server's etag. The server
+     * returns ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The etag for this AuthorizedView.
+     * If this is provided on update, it must match the server's etag. The server
+     * returns ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The etag for this AuthorizedView.
+     * If this is provided on update, it must match the server's etag. The server
+     * returns ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The etag for this AuthorizedView.
+     * If this is provided on update, it must match the server's etag. The server
+     * returns ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean deletionProtection_; + + /** + * + * + *
+     * Set to true to make the AuthorizedView protected against deletion.
+     * The parent Table and containing Instance cannot be deleted if an
+     * AuthorizedView has this bit set.
+     * 
+ * + * bool deletion_protection = 4; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + /** + * + * + *
+     * Set to true to make the AuthorizedView protected against deletion.
+     * The parent Table and containing Instance cannot be deleted if an
+     * AuthorizedView has this bit set.
+     * 
+ * + * bool deletion_protection = 4; + * + * @param value The deletionProtection to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtection(boolean value) { + + deletionProtection_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true to make the AuthorizedView protected against deletion.
+     * The parent Table and containing Instance cannot be deleted if an
+     * AuthorizedView has this bit set.
+     * 
+ * + * bool deletion_protection = 4; + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtection() { + bitField0_ = (bitField0_ & ~0x00000008); + deletionProtection_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AuthorizedView) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AuthorizedView) + private static final com.google.bigtable.admin.v2.AuthorizedView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AuthorizedView(); + } + + public static com.google.bigtable.admin.v2.AuthorizedView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizedView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AuthorizedView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java new file mode 100644 index 000000000000..47c2d1a75b49 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2026 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.admin.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 AuthorizedViewName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String table; + private final String authorizedView; + + @Deprecated + protected AuthorizedViewName() { + project = null; + instance = null; + table = null; + authorizedView = null; + } + + private AuthorizedViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + table = Preconditions.checkNotNull(builder.getTable()); + authorizedView = Preconditions.checkNotNull(builder.getAuthorizedView()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getAuthorizedView() { + return authorizedView; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AuthorizedViewName of( + String project, String instance, String table, String authorizedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setAuthorizedView(authorizedView) + .build(); + } + + public static String format( + String project, String instance, String table, String authorizedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setAuthorizedView(authorizedView) + .build() + .toString(); + } + + public static AuthorizedViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.validatedMatch( + formattedString, "AuthorizedViewName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("table"), + matchMap.get("authorized_view")); + } + + 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 (AuthorizedViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.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); + } + if (table != null) { + fieldMapBuilder.put("table", table); + } + if (authorizedView != null) { + fieldMapBuilder.put("authorized_view", authorizedView); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.instantiate( + "project", + project, + "instance", + instance, + "table", + table, + "authorized_view", + authorizedView); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AuthorizedViewName that = ((AuthorizedViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.table, that.table) + && Objects.equals(this.authorizedView, that.authorizedView); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(table); + h *= 1000003; + h ^= Objects.hashCode(authorizedView); + return h; + } + + /** + * Builder for + * projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}. + */ + public static class Builder { + private String project; + private String instance; + private String table; + private String authorizedView; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getAuthorizedView() { + return authorizedView; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setTable(String table) { + this.table = table; + return this; + } + + public Builder setAuthorizedView(String authorizedView) { + this.authorizedView = authorizedView; + return this; + } + + private Builder(AuthorizedViewName authorizedViewName) { + this.project = authorizedViewName.project; + this.instance = authorizedViewName.instance; + this.table = authorizedViewName.table; + this.authorizedView = authorizedViewName.authorizedView; + } + + public AuthorizedViewName build() { + return new AuthorizedViewName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java new file mode 100644 index 000000000000..ba46de74aad2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface AuthorizedViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AuthorizedView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of this AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The name of this AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return Whether the subsetView field is set. + */ + boolean hasSubsetView(); + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + * + * @return The subsetView. + */ + com.google.bigtable.admin.v2.AuthorizedView.SubsetView getSubsetView(); + + /** + * + * + *
+   * An AuthorizedView permitting access to an explicit subset of a Table.
+   * 
+ * + * .google.bigtable.admin.v2.AuthorizedView.SubsetView subset_view = 2; + */ + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder getSubsetViewOrBuilder(); + + /** + * + * + *
+   * The etag for this AuthorizedView.
+   * If this is provided on update, it must match the server's etag. The server
+   * returns ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * The etag for this AuthorizedView.
+   * If this is provided on update, it must match the server's etag. The server
+   * returns ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Set to true to make the AuthorizedView protected against deletion.
+   * The parent Table and containing Instance cannot be deleted if an
+   * AuthorizedView has this bit set.
+   * 
+ * + * bool deletion_protection = 4; + * + * @return The deletionProtection. + */ + boolean getDeletionProtection(); + + com.google.bigtable.admin.v2.AuthorizedView.AuthorizedViewCase getAuthorizedViewCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java new file mode 100644 index 000000000000..2bda6d07ff62 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java @@ -0,0 +1,599 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Limits for the number of nodes a Cluster can autoscale up/down to.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AutoscalingLimits} + */ +@com.google.protobuf.Generated +public final class AutoscalingLimits extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AutoscalingLimits) + AutoscalingLimitsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AutoscalingLimits"); + } + + // Use AutoscalingLimits.newBuilder() to construct. + private AutoscalingLimits(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AutoscalingLimits() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingLimits_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AutoscalingLimits.class, + com.google.bigtable.admin.v2.AutoscalingLimits.Builder.class); + } + + public static final int MIN_SERVE_NODES_FIELD_NUMBER = 1; + private int minServeNodes_ = 0; + + /** + * + * + *
+   * Required. Minimum number of nodes to scale down to.
+   * 
+ * + * int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The minServeNodes. + */ + @java.lang.Override + public int getMinServeNodes() { + return minServeNodes_; + } + + public static final int MAX_SERVE_NODES_FIELD_NUMBER = 2; + private int maxServeNodes_ = 0; + + /** + * + * + *
+   * Required. Maximum number of nodes to scale up to.
+   * 
+ * + * int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The maxServeNodes. + */ + @java.lang.Override + public int getMaxServeNodes() { + return maxServeNodes_; + } + + 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 (minServeNodes_ != 0) { + output.writeInt32(1, minServeNodes_); + } + if (maxServeNodes_ != 0) { + output.writeInt32(2, maxServeNodes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minServeNodes_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, minServeNodes_); + } + if (maxServeNodes_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxServeNodes_); + } + size += getUnknownFields().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.admin.v2.AutoscalingLimits)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AutoscalingLimits other = + (com.google.bigtable.admin.v2.AutoscalingLimits) obj; + + if (getMinServeNodes() != other.getMinServeNodes()) return false; + if (getMaxServeNodes() != other.getMaxServeNodes()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MIN_SERVE_NODES_FIELD_NUMBER; + hash = (53 * hash) + getMinServeNodes(); + hash = (37 * hash) + MAX_SERVE_NODES_FIELD_NUMBER; + hash = (53 * hash) + getMaxServeNodes(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits 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.admin.v2.AutoscalingLimits parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits 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.admin.v2.AutoscalingLimits parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AutoscalingLimits 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Limits for the number of nodes a Cluster can autoscale up/down to.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AutoscalingLimits} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AutoscalingLimits) + com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingLimits_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AutoscalingLimits.class, + com.google.bigtable.admin.v2.AutoscalingLimits.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AutoscalingLimits.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minServeNodes_ = 0; + maxServeNodes_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingLimits getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingLimits build() { + com.google.bigtable.admin.v2.AutoscalingLimits result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingLimits buildPartial() { + com.google.bigtable.admin.v2.AutoscalingLimits result = + new com.google.bigtable.admin.v2.AutoscalingLimits(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AutoscalingLimits result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minServeNodes_ = minServeNodes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxServeNodes_ = maxServeNodes_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AutoscalingLimits) { + return mergeFrom((com.google.bigtable.admin.v2.AutoscalingLimits) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AutoscalingLimits other) { + if (other == com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance()) return this; + if (other.getMinServeNodes() != 0) { + setMinServeNodes(other.getMinServeNodes()); + } + if (other.getMaxServeNodes() != 0) { + setMaxServeNodes(other.getMaxServeNodes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + minServeNodes_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxServeNodes_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int minServeNodes_; + + /** + * + * + *
+     * Required. Minimum number of nodes to scale down to.
+     * 
+ * + * int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The minServeNodes. + */ + @java.lang.Override + public int getMinServeNodes() { + return minServeNodes_; + } + + /** + * + * + *
+     * Required. Minimum number of nodes to scale down to.
+     * 
+ * + * int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The minServeNodes to set. + * @return This builder for chaining. + */ + public Builder setMinServeNodes(int value) { + + minServeNodes_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Minimum number of nodes to scale down to.
+     * 
+ * + * int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMinServeNodes() { + bitField0_ = (bitField0_ & ~0x00000001); + minServeNodes_ = 0; + onChanged(); + return this; + } + + private int maxServeNodes_; + + /** + * + * + *
+     * Required. Maximum number of nodes to scale up to.
+     * 
+ * + * int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The maxServeNodes. + */ + @java.lang.Override + public int getMaxServeNodes() { + return maxServeNodes_; + } + + /** + * + * + *
+     * Required. Maximum number of nodes to scale up to.
+     * 
+ * + * int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The maxServeNodes to set. + * @return This builder for chaining. + */ + public Builder setMaxServeNodes(int value) { + + maxServeNodes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Maximum number of nodes to scale up to.
+     * 
+ * + * int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMaxServeNodes() { + bitField0_ = (bitField0_ & ~0x00000002); + maxServeNodes_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AutoscalingLimits) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AutoscalingLimits) + private static final com.google.bigtable.admin.v2.AutoscalingLimits DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AutoscalingLimits(); + } + + public static com.google.bigtable.admin.v2.AutoscalingLimits getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoscalingLimits parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AutoscalingLimits getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java new file mode 100644 index 000000000000..b68006991af3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface AutoscalingLimitsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AutoscalingLimits) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Minimum number of nodes to scale down to.
+   * 
+ * + * int32 min_serve_nodes = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The minServeNodes. + */ + int getMinServeNodes(); + + /** + * + * + *
+   * Required. Maximum number of nodes to scale up to.
+   * 
+ * + * int32 max_serve_nodes = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The maxServeNodes. + */ + int getMaxServeNodes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java new file mode 100644 index 000000000000..c002885620e4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java @@ -0,0 +1,633 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The Autoscaling targets for a Cluster. These determine the recommended nodes.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AutoscalingTargets} + */ +@com.google.protobuf.Generated +public final class AutoscalingTargets extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AutoscalingTargets) + AutoscalingTargetsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AutoscalingTargets"); + } + + // Use AutoscalingTargets.newBuilder() to construct. + private AutoscalingTargets(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AutoscalingTargets() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingTargets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AutoscalingTargets.class, + com.google.bigtable.admin.v2.AutoscalingTargets.Builder.class); + } + + public static final int CPU_UTILIZATION_PERCENT_FIELD_NUMBER = 2; + private int cpuUtilizationPercent_ = 0; + + /** + * + * + *
+   * The cpu utilization that the Autoscaler should be trying to achieve.
+   * This number is on a scale from 0 (no utilization) to
+   * 100 (total utilization), and is limited between 10 and 80, otherwise it
+   * will return INVALID_ARGUMENT error.
+   * 
+ * + * int32 cpu_utilization_percent = 2; + * + * @return The cpuUtilizationPercent. + */ + @java.lang.Override + public int getCpuUtilizationPercent() { + return cpuUtilizationPercent_; + } + + public static final int STORAGE_UTILIZATION_GIB_PER_NODE_FIELD_NUMBER = 3; + private int storageUtilizationGibPerNode_ = 0; + + /** + * + * + *
+   * The storage utilization that the Autoscaler should be trying to achieve.
+   * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
+   * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
+   * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
+   * it will be treated as if it were set to the default value: 2560 for SSD,
+   * 8192 for HDD.
+   * 
+ * + * int32 storage_utilization_gib_per_node = 3; + * + * @return The storageUtilizationGibPerNode. + */ + @java.lang.Override + public int getStorageUtilizationGibPerNode() { + return storageUtilizationGibPerNode_; + } + + 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 (cpuUtilizationPercent_ != 0) { + output.writeInt32(2, cpuUtilizationPercent_); + } + if (storageUtilizationGibPerNode_ != 0) { + output.writeInt32(3, storageUtilizationGibPerNode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cpuUtilizationPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, cpuUtilizationPercent_); + } + if (storageUtilizationGibPerNode_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(3, storageUtilizationGibPerNode_); + } + size += getUnknownFields().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.admin.v2.AutoscalingTargets)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AutoscalingTargets other = + (com.google.bigtable.admin.v2.AutoscalingTargets) obj; + + if (getCpuUtilizationPercent() != other.getCpuUtilizationPercent()) return false; + if (getStorageUtilizationGibPerNode() != other.getStorageUtilizationGibPerNode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CPU_UTILIZATION_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getCpuUtilizationPercent(); + hash = (37 * hash) + STORAGE_UTILIZATION_GIB_PER_NODE_FIELD_NUMBER; + hash = (53 * hash) + getStorageUtilizationGibPerNode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets 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.admin.v2.AutoscalingTargets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets 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.admin.v2.AutoscalingTargets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.AutoscalingTargets 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The Autoscaling targets for a Cluster. These determine the recommended nodes.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.AutoscalingTargets} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.AutoscalingTargets) + com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingTargets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AutoscalingTargets.class, + com.google.bigtable.admin.v2.AutoscalingTargets.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.AutoscalingTargets.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cpuUtilizationPercent_ = 0; + storageUtilizationGibPerNode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingTargets getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingTargets build() { + com.google.bigtable.admin.v2.AutoscalingTargets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingTargets buildPartial() { + com.google.bigtable.admin.v2.AutoscalingTargets result = + new com.google.bigtable.admin.v2.AutoscalingTargets(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.AutoscalingTargets result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuUtilizationPercent_ = cpuUtilizationPercent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.storageUtilizationGibPerNode_ = storageUtilizationGibPerNode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.AutoscalingTargets) { + return mergeFrom((com.google.bigtable.admin.v2.AutoscalingTargets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.AutoscalingTargets other) { + if (other == com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance()) + return this; + if (other.getCpuUtilizationPercent() != 0) { + setCpuUtilizationPercent(other.getCpuUtilizationPercent()); + } + if (other.getStorageUtilizationGibPerNode() != 0) { + setStorageUtilizationGibPerNode(other.getStorageUtilizationGibPerNode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: + { + cpuUtilizationPercent_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: + { + storageUtilizationGibPerNode_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int cpuUtilizationPercent_; + + /** + * + * + *
+     * The cpu utilization that the Autoscaler should be trying to achieve.
+     * This number is on a scale from 0 (no utilization) to
+     * 100 (total utilization), and is limited between 10 and 80, otherwise it
+     * will return INVALID_ARGUMENT error.
+     * 
+ * + * int32 cpu_utilization_percent = 2; + * + * @return The cpuUtilizationPercent. + */ + @java.lang.Override + public int getCpuUtilizationPercent() { + return cpuUtilizationPercent_; + } + + /** + * + * + *
+     * The cpu utilization that the Autoscaler should be trying to achieve.
+     * This number is on a scale from 0 (no utilization) to
+     * 100 (total utilization), and is limited between 10 and 80, otherwise it
+     * will return INVALID_ARGUMENT error.
+     * 
+ * + * int32 cpu_utilization_percent = 2; + * + * @param value The cpuUtilizationPercent to set. + * @return This builder for chaining. + */ + public Builder setCpuUtilizationPercent(int value) { + + cpuUtilizationPercent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cpu utilization that the Autoscaler should be trying to achieve.
+     * This number is on a scale from 0 (no utilization) to
+     * 100 (total utilization), and is limited between 10 and 80, otherwise it
+     * will return INVALID_ARGUMENT error.
+     * 
+ * + * int32 cpu_utilization_percent = 2; + * + * @return This builder for chaining. + */ + public Builder clearCpuUtilizationPercent() { + bitField0_ = (bitField0_ & ~0x00000001); + cpuUtilizationPercent_ = 0; + onChanged(); + return this; + } + + private int storageUtilizationGibPerNode_; + + /** + * + * + *
+     * The storage utilization that the Autoscaler should be trying to achieve.
+     * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
+     * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
+     * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
+     * it will be treated as if it were set to the default value: 2560 for SSD,
+     * 8192 for HDD.
+     * 
+ * + * int32 storage_utilization_gib_per_node = 3; + * + * @return The storageUtilizationGibPerNode. + */ + @java.lang.Override + public int getStorageUtilizationGibPerNode() { + return storageUtilizationGibPerNode_; + } + + /** + * + * + *
+     * The storage utilization that the Autoscaler should be trying to achieve.
+     * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
+     * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
+     * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
+     * it will be treated as if it were set to the default value: 2560 for SSD,
+     * 8192 for HDD.
+     * 
+ * + * int32 storage_utilization_gib_per_node = 3; + * + * @param value The storageUtilizationGibPerNode to set. + * @return This builder for chaining. + */ + public Builder setStorageUtilizationGibPerNode(int value) { + + storageUtilizationGibPerNode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The storage utilization that the Autoscaler should be trying to achieve.
+     * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
+     * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
+     * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
+     * it will be treated as if it were set to the default value: 2560 for SSD,
+     * 8192 for HDD.
+     * 
+ * + * int32 storage_utilization_gib_per_node = 3; + * + * @return This builder for chaining. + */ + public Builder clearStorageUtilizationGibPerNode() { + bitField0_ = (bitField0_ & ~0x00000002); + storageUtilizationGibPerNode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AutoscalingTargets) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AutoscalingTargets) + private static final com.google.bigtable.admin.v2.AutoscalingTargets DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AutoscalingTargets(); + } + + public static com.google.bigtable.admin.v2.AutoscalingTargets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoscalingTargets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.AutoscalingTargets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java new file mode 100644 index 000000000000..d0f15adb8be9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface AutoscalingTargetsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AutoscalingTargets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The cpu utilization that the Autoscaler should be trying to achieve.
+   * This number is on a scale from 0 (no utilization) to
+   * 100 (total utilization), and is limited between 10 and 80, otherwise it
+   * will return INVALID_ARGUMENT error.
+   * 
+ * + * int32 cpu_utilization_percent = 2; + * + * @return The cpuUtilizationPercent. + */ + int getCpuUtilizationPercent(); + + /** + * + * + *
+   * The storage utilization that the Autoscaler should be trying to achieve.
+   * This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
+   * cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
+   * otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
+   * it will be treated as if it were set to the default value: 2560 for SSD,
+   * 8192 for HDD.
+   * 
+ * + * int32 storage_utilization_gib_per_node = 3; + * + * @return The storageUtilizationGibPerNode. + */ + int getStorageUtilizationGibPerNode(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java new file mode 100644 index 000000000000..c77f088df5f6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java @@ -0,0 +1,3532 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A backup of a Cloud Bigtable table.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Backup} + */ +@com.google.protobuf.Generated +public final class Backup extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Backup) + BackupOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Backup"); + } + + // Use Backup.newBuilder() to construct. + private Backup(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Backup() { + name_ = ""; + sourceTable_ = ""; + sourceBackup_ = ""; + state_ = 0; + backupType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Backup.class, + com.google.bigtable.admin.v2.Backup.Builder.class); + } + + /** + * + * + *
+   * Indicates the current state of the backup.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Backup.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup may fail with `FAILED_PRECONDITION` in this state.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The backup is complete and ready for use.
+     * 
+ * + * READY = 2; + */ + READY(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The pending backup is still being created. Operations on the
+     * backup may fail with `FAILED_PRECONDITION` in this state.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + + /** + * + * + *
+     * The backup is complete and ready for use.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return READY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Backup.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Backup.State) + } + + /** + * + * + *
+   * The type of the backup.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Backup.BackupType} + */ + public enum BackupType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + BACKUP_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The default type for Cloud Bigtable managed backups. Supported for
+     * backups created in both HDD and SSD instances. Requires optimization when
+     * restored to a table in an SSD instance.
+     * 
+ * + * STANDARD = 1; + */ + STANDARD(1), + /** + * + * + *
+     * A backup type with faster restore to SSD performance. Only supported for
+     * backups created in SSD instances. A new SSD table restored from a hot
+     * backup reaches production performance more quickly than a standard
+     * backup.
+     * 
+ * + * HOT = 2; + */ + HOT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupType"); + } + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * BACKUP_TYPE_UNSPECIFIED = 0; + */ + public static final int BACKUP_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The default type for Cloud Bigtable managed backups. Supported for
+     * backups created in both HDD and SSD instances. Requires optimization when
+     * restored to a table in an SSD instance.
+     * 
+ * + * STANDARD = 1; + */ + public static final int STANDARD_VALUE = 1; + + /** + * + * + *
+     * A backup type with faster restore to SSD performance. Only supported for
+     * backups created in SSD instances. A new SSD table restored from a hot
+     * backup reaches production performance more quickly than a standard
+     * backup.
+     * 
+ * + * HOT = 2; + */ + public static final int HOT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BackupType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BackupType forNumber(int value) { + switch (value) { + case 0: + return BACKUP_TYPE_UNSPECIFIED; + case 1: + return STANDARD; + case 2: + return HOT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BackupType findValueByNumber(int number) { + return BackupType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Backup.getDescriptor().getEnumTypes().get(1); + } + + private static final BackupType[] VALUES = values(); + + public static BackupType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BackupType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Backup.BackupType) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/
+   * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+   * The final segment of the name must be between 1 and 50 characters
+   * in length.
+   *
+   * The backup is stored in the cluster identified by the prefix of the backup
+   * name of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/
+   * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+   * The final segment of the name must be between 1 and 50 characters
+   * in length.
+   *
+   * The backup is stored in the cluster identified by the prefix of the backup
+   * name of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * string name = 1; + * + * @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 SOURCE_TABLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+   * Required. Immutable. Name of the table from which this backup was created.
+   * This needs to be in the same instance as the backup. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{source_table}`.
+   * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceTable. + */ + @java.lang.Override + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + 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(); + sourceTable_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. Name of the table from which this backup was created.
+   * This needs to be in the same instance as the backup. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{source_table}`.
+   * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceTable. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + 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(); + sourceBackup_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp expireTime_; + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + public static final int START_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int SIZE_BYTES_FIELD_NUMBER = 6; + private long sizeBytes_ = 0L; + + /** + * + * + *
+   * Output only. Size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.State getState() { + com.google.bigtable.admin.v2.Backup.State result = + com.google.bigtable.admin.v2.Backup.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Backup.State.UNRECOGNIZED : result; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 9; + private com.google.bigtable.admin.v2.EncryptionInfo encryptionInfo_; + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int BACKUP_TYPE_FIELD_NUMBER = 11; + private int backupType_ = 0; + + /** + * + * + *
+   * Indicates the backup type of the backup.
+   * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+   * Indicates the backup type of the backup.
+   * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The backupType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.BackupType getBackupType() { + com.google.bigtable.admin.v2.Backup.BackupType result = + com.google.bigtable.admin.v2.Backup.BackupType.forNumber(backupType_); + return result == null ? com.google.bigtable.admin.v2.Backup.BackupType.UNRECOGNIZED : result; + } + + public static final int HOT_TO_STANDARD_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp hotToStandardTime_; + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return Whether the hotToStandardTime field is set. + */ + @java.lang.Override + public boolean hasHotToStandardTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return The hotToStandardTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getHotToStandardTime() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; + } + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getHotToStandardTimeOrBuilder() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sourceTable_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getExpireTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getEndTime()); + } + if (sizeBytes_ != 0L) { + output.writeInt64(6, sizeBytes_); + } + if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, sourceBackup_); + } + if (backupType_ + != com.google.bigtable.admin.v2.Backup.BackupType.BACKUP_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(11, backupType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getHotToStandardTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sourceTable_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); + } + if (sizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, sizeBytes_); + } + if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEncryptionInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, sourceBackup_); + } + if (backupType_ + != com.google.bigtable.admin.v2.Backup.BackupType.BACKUP_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, backupType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getHotToStandardTime()); + } + size += getUnknownFields().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.admin.v2.Backup)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Backup other = (com.google.bigtable.admin.v2.Backup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSourceTable().equals(other.getSourceTable())) return false; + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (getSizeBytes() != other.getSizeBytes()) return false; + if (state_ != other.state_) return false; + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } + if (backupType_ != other.backupType_) return false; + if (hasHotToStandardTime() != other.hasHotToStandardTime()) return false; + if (hasHotToStandardTime()) { + if (!getHotToStandardTime().equals(other.getHotToStandardTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SOURCE_TABLE_FIELD_NUMBER; + hash = (53 * hash) + getSourceTable().hashCode(); + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } + hash = (37 * hash) + BACKUP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + backupType_; + if (hasHotToStandardTime()) { + hash = (37 * hash) + HOT_TO_STANDARD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getHotToStandardTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Backup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Backup 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.admin.v2.Backup parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Backup 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.admin.v2.Backup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Backup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Backup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Backup parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Backup parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Backup parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Backup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Backup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Backup 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A backup of a Cloud Bigtable table.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Backup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Backup) + com.google.bigtable.admin.v2.BackupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Backup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Backup.class, + com.google.bigtable.admin.v2.Backup.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Backup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpireTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetEncryptionInfoFieldBuilder(); + internalGetHotToStandardTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sourceTable_ = ""; + sourceBackup_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + sizeBytes_ = 0L; + state_ = 0; + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + backupType_ = 0; + hotToStandardTime_ = null; + if (hotToStandardTimeBuilder_ != null) { + hotToStandardTimeBuilder_.dispose(); + hotToStandardTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Backup_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Backup getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Backup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Backup build() { + com.google.bigtable.admin.v2.Backup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Backup buildPartial() { + com.google.bigtable.admin.v2.Backup result = new com.google.bigtable.admin.v2.Backup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceTable_ = sourceTable_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceBackup_ = sourceBackup_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sizeBytes_ = sizeBytes_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.encryptionInfo_ = + encryptionInfoBuilder_ == null ? encryptionInfo_ : encryptionInfoBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.backupType_ = backupType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.hotToStandardTime_ = + hotToStandardTimeBuilder_ == null + ? hotToStandardTime_ + : hotToStandardTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Backup) { + return mergeFrom((com.google.bigtable.admin.v2.Backup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Backup other) { + if (other == com.google.bigtable.admin.v2.Backup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSourceTable().isEmpty()) { + sourceTable_ = other.sourceTable_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSourceBackup().isEmpty()) { + sourceBackup_ = other.sourceBackup_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.getSizeBytes() != 0L) { + setSizeBytes(other.getSizeBytes()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } + if (other.backupType_ != 0) { + setBackupTypeValue(other.getBackupTypeValue()); + } + if (other.hasHotToStandardTime()) { + mergeHotToStandardTime(other.getHotToStandardTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sourceTable_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + sizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 74: + { + input.readMessage( + internalGetEncryptionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + sourceBackup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 82 + case 88: + { + backupType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 98: + { + input.readMessage( + internalGetHotToStandardTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/
+     * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+     * The final segment of the name must be between 1 and 50 characters
+     * in length.
+     *
+     * The backup is stored in the cluster identified by the prefix of the backup
+     * name of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/
+     * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+     * The final segment of the name must be between 1 and 50 characters
+     * in length.
+     *
+     * The backup is stored in the cluster identified by the prefix of the backup
+     * name of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/
+     * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+     * The final segment of the name must be between 1 and 50 characters
+     * in length.
+     *
+     * The backup is stored in the cluster identified by the prefix of the backup
+     * name of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/
+     * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+     * The final segment of the name must be between 1 and 50 characters
+     * in length.
+     *
+     * The backup is stored in the cluster identified by the prefix of the backup
+     * name of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * A globally unique identifier for the backup which cannot be
+     * changed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/
+     * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+     * The final segment of the name must be between 1 and 50 characters
+     * in length.
+     *
+     * The backup is stored in the cluster identified by the prefix of the backup
+     * name of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+     * Required. Immutable. Name of the table from which this backup was created.
+     * This needs to be in the same instance as the backup. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{source_table}`.
+     * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceTable. + */ + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceTable_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. Name of the table from which this backup was created.
+     * This needs to be in the same instance as the backup. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{source_table}`.
+     * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceTable. + */ + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. Name of the table from which this backup was created.
+     * This needs to be in the same instance as the backup. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{source_table}`.
+     * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceTable_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. Name of the table from which this backup was created.
+     * This needs to be in the same instance as the backup. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{source_table}`.
+     * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceTable() { + sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. Name of the table from which this backup was created.
+     * This needs to be in the same instance as the backup. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{source_table}`.
+     * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceTable_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + sourceBackup_ = getDefaultInstance().getSourceBackup(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000008); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + + /** + * + * + *
+     * Required. The expiration time of the backup.
+     * When creating a backup or updating its `expire_time`, the value must be
+     * greater than the backup creation time by:
+     * - At least 6 hours
+     * - At most 90 days
+     *
+     * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * Output only. `start_time` is the time that the backup was started
+     * (i.e. approximately the time the
+     * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+     * request is received).  The row data in this backup will be no older than
+     * this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * Output only. `end_time` is the time that the backup was finished. The row
+     * data in the backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private long sizeBytes_; + + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + @java.lang.Override + public long getSizeBytes() { + return sizeBytes_; + } + + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(long value) { + + sizeBytes_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Size of the backup in bytes.
+     * 
+ * + * int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000040); + sizeBytes_ = 0L; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.State getState() { + com.google.bigtable.admin.v2.Backup.State result = + com.google.bigtable.admin.v2.Backup.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Backup.State.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.bigtable.admin.v2.Backup.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000080); + state_ = 0; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + } else { + encryptionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); + } else { + encryptionInfo_ = value; + } + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + if (encryptionInfo_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + bitField0_ = (bitField0_ & ~0x00000100); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetEncryptionInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + internalGetEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + private int backupType_ = 0; + + /** + * + * + *
+     * Indicates the backup type of the backup.
+     * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + + /** + * + * + *
+     * Indicates the backup type of the backup.
+     * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @param value The enum numeric value on the wire for backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupTypeValue(int value) { + backupType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates the backup type of the backup.
+     * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The backupType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.BackupType getBackupType() { + com.google.bigtable.admin.v2.Backup.BackupType result = + com.google.bigtable.admin.v2.Backup.BackupType.forNumber(backupType_); + return result == null ? com.google.bigtable.admin.v2.Backup.BackupType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Indicates the backup type of the backup.
+     * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @param value The backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupType(com.google.bigtable.admin.v2.Backup.BackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + backupType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates the backup type of the backup.
+     * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearBackupType() { + bitField0_ = (bitField0_ & ~0x00000200); + backupType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp hotToStandardTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + hotToStandardTimeBuilder_; + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return Whether the hotToStandardTime field is set. + */ + public boolean hasHotToStandardTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return The hotToStandardTime. + */ + public com.google.protobuf.Timestamp getHotToStandardTime() { + if (hotToStandardTimeBuilder_ == null) { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; + } else { + return hotToStandardTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public Builder setHotToStandardTime(com.google.protobuf.Timestamp value) { + if (hotToStandardTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hotToStandardTime_ = value; + } else { + hotToStandardTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public Builder setHotToStandardTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (hotToStandardTimeBuilder_ == null) { + hotToStandardTime_ = builderForValue.build(); + } else { + hotToStandardTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public Builder mergeHotToStandardTime(com.google.protobuf.Timestamp value) { + if (hotToStandardTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && hotToStandardTime_ != null + && hotToStandardTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getHotToStandardTimeBuilder().mergeFrom(value); + } else { + hotToStandardTime_ = value; + } + } else { + hotToStandardTimeBuilder_.mergeFrom(value); + } + if (hotToStandardTime_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public Builder clearHotToStandardTime() { + bitField0_ = (bitField0_ & ~0x00000400); + hotToStandardTime_ = null; + if (hotToStandardTimeBuilder_ != null) { + hotToStandardTimeBuilder_.dispose(); + hotToStandardTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public com.google.protobuf.Timestamp.Builder getHotToStandardTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetHotToStandardTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + public com.google.protobuf.TimestampOrBuilder getHotToStandardTimeOrBuilder() { + if (hotToStandardTimeBuilder_ != null) { + return hotToStandardTimeBuilder_.getMessageOrBuilder(); + } else { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; + } + } + + /** + * + * + *
+     * The time at which the hot backup will be converted to a standard backup.
+     * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+     * hot backup to a standard backup. This value must be greater than the backup
+     * creation time by:
+     * - At least 24 hours
+     *
+     * This field only applies for hot backups. When creating or updating a
+     * standard backup, attempting to set this field will fail the request.
+     * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetHotToStandardTimeFieldBuilder() { + if (hotToStandardTimeBuilder_ == null) { + hotToStandardTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getHotToStandardTime(), getParentForChildren(), isClean()); + hotToStandardTime_ = null; + } + return hotToStandardTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Backup) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Backup) + private static final com.google.bigtable.admin.v2.Backup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Backup(); + } + + public static com.google.bigtable.admin.v2.Backup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Backup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Backup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java new file mode 100644 index 000000000000..070bffc4784f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java @@ -0,0 +1,1597 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Information about a backup.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.BackupInfo} + */ +@com.google.protobuf.Generated +public final class BackupInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.BackupInfo) + BackupInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackupInfo"); + } + + // Use BackupInfo.newBuilder() to construct. + private BackupInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackupInfo() { + backup_ = ""; + sourceTable_ = ""; + sourceBackup_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_BackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.BackupInfo.class, + com.google.bigtable.admin.v2.BackupInfo.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + + /** + * + * + *
+   * Output only. Name of the backup.
+   * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backup. + */ + @java.lang.Override + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + 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(); + backup_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Name of the backup.
+   * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int SOURCE_TABLE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+   * Output only. Name of the table the backup was created from.
+   * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceTable. + */ + @java.lang.Override + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + 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(); + sourceTable_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Name of the table the backup was created from.
+   * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceTable. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + 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(); + sourceBackup_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = 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.GeneratedMessage.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, backup_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, sourceTable_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, sourceBackup_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, backup_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, sourceTable_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, sourceBackup_); + } + size += getUnknownFields().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.admin.v2.BackupInfo)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.BackupInfo other = (com.google.bigtable.admin.v2.BackupInfo) obj; + + if (!getBackup().equals(other.getBackup())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getSourceTable().equals(other.getSourceTable())) return false; + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + SOURCE_TABLE_FIELD_NUMBER; + hash = (53 * hash) + getSourceTable().hashCode(); + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.BackupInfo 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.admin.v2.BackupInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.BackupInfo 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.admin.v2.BackupInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.BackupInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.BackupInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information about a backup.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.BackupInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.BackupInfo) + com.google.bigtable.admin.v2.BackupInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_BackupInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.BackupInfo.class, + com.google.bigtable.admin.v2.BackupInfo.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.BackupInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backup_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + sourceTable_ = ""; + sourceBackup_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_BackupInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo build() { + com.google.bigtable.admin.v2.BackupInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo buildPartial() { + com.google.bigtable.admin.v2.BackupInfo result = + new com.google.bigtable.admin.v2.BackupInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.BackupInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backup_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sourceTable_ = sourceTable_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sourceBackup_ = sourceBackup_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.BackupInfo) { + return mergeFrom((com.google.bigtable.admin.v2.BackupInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.BackupInfo other) { + if (other == com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance()) return this; + if (!other.getBackup().isEmpty()) { + backup_ = other.backup_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getSourceTable().isEmpty()) { + sourceTable_ = other.sourceTable_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getSourceBackup().isEmpty()) { + sourceBackup_ = other.sourceBackup_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + backup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + sourceTable_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 82: + { + sourceBackup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object backup_ = ""; + + /** + * + * + *
+     * Output only. Name of the backup.
+     * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = backup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup.
+     * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = backup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup.
+     * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup.
+     * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup.
+     * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backup_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * Output only. The time that the backup was started. Row data in the backup
+     * will be no older than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * Output only. This time that the backup was finished. Row data in the
+     * backup will be no newer than this timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+     * Output only. Name of the table the backup was created from.
+     * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceTable. + */ + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceTable_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the table the backup was created from.
+     * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceTable. + */ + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the table the backup was created from.
+     * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceTable_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the table the backup was created from.
+     * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSourceTable() { + sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the table the backup was created from.
+     * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceTable_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceBackup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + sourceBackup_ = getDefaultInstance().getSourceBackup(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Name of the backup from which this backup was copied. If a
+     * backup is not created by copying a backup, this field will be empty. Values
+     * are of the form:
+     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+     * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceBackup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.BackupInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.BackupInfo) + private static final com.google.bigtable.admin.v2.BackupInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.BackupInfo(); + } + + public static com.google.bigtable.admin.v2.BackupInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackupInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.BackupInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java new file mode 100644 index 000000000000..740dc7228fac --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface BackupInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.BackupInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the backup.
+   * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The backup. + */ + java.lang.String getBackup(); + + /** + * + * + *
+   * Output only. Name of the backup.
+   * 
+ * + * string backup = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Output only. The time that the backup was started. Row data in the backup
+   * will be no older than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * Output only. This time that the backup was finished. Row data in the
+   * backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Name of the table the backup was created from.
+   * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceTable. + */ + java.lang.String getSourceTable(); + + /** + * + * + *
+   * Output only. Name of the table the backup was created from.
+   * 
+ * + * string source_table = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceTable. + */ + com.google.protobuf.ByteString getSourceTableBytes(); + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java new file mode 100644 index 000000000000..9899f0aad2de --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2026 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.admin.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 BackupName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_CLUSTER_BACKUP = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String cluster; + private final String backup; + + @Deprecated + protected BackupName() { + project = null; + instance = null; + cluster = null; + backup = null; + } + + private BackupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + backup = Preconditions.checkNotNull(builder.getBackup()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public String getBackup() { + return backup; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BackupName of(String project, String instance, String cluster, String backup) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setCluster(cluster) + .setBackup(backup) + .build(); + } + + public static String format(String project, String instance, String cluster, String backup) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setCluster(cluster) + .setBackup(backup) + .build() + .toString(); + } + + public static BackupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_CLUSTER_BACKUP.validatedMatch( + formattedString, "BackupName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("cluster"), + matchMap.get("backup")); + } + + 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 (BackupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_CLUSTER_BACKUP.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); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (backup != null) { + fieldMapBuilder.put("backup", backup); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_CLUSTER_BACKUP.instantiate( + "project", project, "instance", instance, "cluster", cluster, "backup", backup); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BackupName that = ((BackupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.backup, that.backup); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(cluster); + h *= 1000003; + h ^= Objects.hashCode(backup); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}. */ + public static class Builder { + private String project; + private String instance; + private String cluster; + private String backup; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public String getBackup() { + return backup; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setBackup(String backup) { + this.backup = backup; + return this; + } + + private Builder(BackupName backupName) { + this.project = backupName.project; + this.instance = backupName.instance; + this.cluster = backupName.cluster; + this.backup = backupName.backup; + } + + public BackupName build() { + return new BackupName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java new file mode 100644 index 000000000000..d41f103a66b0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java @@ -0,0 +1,461 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface BackupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Backup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/
+   * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+   * The final segment of the name must be between 1 and 50 characters
+   * in length.
+   *
+   * The backup is stored in the cluster identified by the prefix of the backup
+   * name of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * A globally unique identifier for the backup which cannot be
+   * changed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/
+   * backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
+   * The final segment of the name must be between 1 and 50 characters
+   * in length.
+   *
+   * The backup is stored in the cluster identified by the prefix of the backup
+   * name of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. Name of the table from which this backup was created.
+   * This needs to be in the same instance as the backup. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{source_table}`.
+   * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sourceTable. + */ + java.lang.String getSourceTable(); + + /** + * + * + *
+   * Required. Immutable. Name of the table from which this backup was created.
+   * This needs to be in the same instance as the backup. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{source_table}`.
+   * 
+ * + * + * string source_table = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for sourceTable. + */ + com.google.protobuf.ByteString getSourceTableBytes(); + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + + /** + * + * + *
+   * Output only. Name of the backup from which this backup was copied. If a
+   * backup is not created by copying a backup, this field will be empty. Values
+   * are of the form:
+   * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
+   * 
+ * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
+   * Required. The expiration time of the backup.
+   * When creating a backup or updating its `expire_time`, the value must be
+   * greater than the backup creation time by:
+   * - At least 6 hours
+   * - At most 90 days
+   *
+   * Once the `expire_time` has passed, Cloud Bigtable will delete the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Output only. `start_time` is the time that the backup was started
+   * (i.e. approximately the time the
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
+   * request is received).  The row data in this backup will be no older than
+   * this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * Output only. `end_time` is the time that the backup was finished. The row
+   * data in the backup will be no newer than this timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Size of the backup in bytes.
+   * 
+ * + * int64 size_bytes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeBytes. + */ + long getSizeBytes(); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The current state of the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.Backup.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.bigtable.admin.v2.Backup.State getState(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); + + /** + * + * + *
+   * Indicates the backup type of the backup.
+   * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The enum numeric value on the wire for backupType. + */ + int getBackupTypeValue(); + + /** + * + * + *
+   * Indicates the backup type of the backup.
+   * 
+ * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The backupType. + */ + com.google.bigtable.admin.v2.Backup.BackupType getBackupType(); + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return Whether the hotToStandardTime field is set. + */ + boolean hasHotToStandardTime(); + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return The hotToStandardTime. + */ + com.google.protobuf.Timestamp getHotToStandardTime(); + + /** + * + * + *
+   * The time at which the hot backup will be converted to a standard backup.
+   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
+   * hot backup to a standard backup. This value must be greater than the backup
+   * creation time by:
+   * - At least 24 hours
+   *
+   * This field only applies for hot backups. When creating or updating a
+   * standard backup, attempting to set this field will fail the request.
+   * 
+ * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + com.google.protobuf.TimestampOrBuilder getHotToStandardTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java new file mode 100644 index 000000000000..7d1bf5db908c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java @@ -0,0 +1,995 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class BigtableInstanceAdminProto extends com.google.protobuf.GeneratedFile { + private BigtableInstanceAdminProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BigtableInstanceAdminProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/bigtable/admin/v2/bigtable_inst" + + "ance_admin.proto\022\030google.bigtable.admin." + + "v2\032\034google/api/annotations.proto\032\027google" + + "/api/client.proto\032\037google/api/field_beha" + + "vior.proto\032\031google/api/resource.proto\032\'g" + + "oogle/bigtable/admin/v2/instance.proto\032\036" + + "google/iam/v1/iam_policy.proto\032\032google/i" + + "am/v1/policy.proto\032#google/longrunning/o" + + "perations.proto\032\033google/protobuf/empty.p" + + "roto\032 google/protobuf/field_mask.proto\032\037" + + "google/protobuf/timestamp.proto\"\333\002\n\025Crea" + + "teInstanceRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A" + + "-\n+cloudresourcemanager.googleapis.com/P" + + "roject\022\030\n\013instance_id\030\002 \001(\tB\003\340A\002\0229\n\010inst" + + "ance\030\003 \001(\0132\".google.bigtable.admin.v2.In" + + "stanceB\003\340A\002\022T\n\010clusters\030\004 \003(\0132=.google.b" + + "igtable.admin.v2.CreateInstanceRequest.C" + + "lustersEntryB\003\340A\002\032R\n\rClustersEntry\022\013\n\003ke" + + "y\030\001 \001(\t\0220\n\005value\030\002 \001(\0132!.google.bigtable" + + ".admin.v2.Cluster:\0028\001\"Q\n\022GetInstanceRequ" + + "est\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bigtableadmin" + + ".googleapis.com/Instance\"o\n\024ListInstance" + + "sRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022\022\n" + + "\npage_token\030\002 \001(\t\"\201\001\n\025ListInstancesRespo" + + "nse\0225\n\tinstances\030\001 \003(\0132\".google.bigtable" + + ".admin.v2.Instance\022\030\n\020failed_locations\030\002" + + " \003(\t\022\027\n\017next_page_token\030\003 \001(\t\"\217\001\n\034Partia" + + "lUpdateInstanceRequest\0229\n\010instance\030\001 \001(\013" + + "2\".google.bigtable.admin.v2.InstanceB\003\340A" + + "\002\0224\n\013update_mask\030\002 \001(\0132\032.google.protobuf" + + ".FieldMaskB\003\340A\002\"T\n\025DeleteInstanceRequest" + + "\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bigtableadmin.go" + + "ogleapis.com/Instance\"\247\001\n\024CreateClusterR" + + "equest\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%bigtable" + + "admin.googleapis.com/Instance\022\027\n\ncluster" + + "_id\030\002 \001(\tB\003\340A\002\0227\n\007cluster\030\003 \001(\0132!.google" + + ".bigtable.admin.v2.ClusterB\003\340A\002\"O\n\021GetCl" + + "usterRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$bigt" + + "ableadmin.googleapis.com/Cluster\"h\n\023List" + + "ClustersRequest\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\022" + + "\n\npage_token\030\002 \001(\t\"~\n\024ListClustersRespon" + + "se\0223\n\010clusters\030\001 \003(\0132!.google.bigtable.a" + + "dmin.v2.Cluster\022\030\n\020failed_locations\030\002 \003(" + + "\t\022\027\n\017next_page_token\030\003 \001(\t\"R\n\024DeleteClus" + + "terRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$bigtab" + + "leadmin.googleapis.com/Cluster\"\306\001\n\026Creat" + + "eInstanceMetadata\022I\n\020original_request\030\001 " + + "\001(\0132/.google.bigtable.admin.v2.CreateIns" + + "tanceRequest\0220\n\014request_time\030\002 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022/\n\013finish_time\030\003 " + + "\001(\0132\032.google.protobuf.Timestamp\"\315\001\n\026Upda" + + "teInstanceMetadata\022P\n\020original_request\030\001" + + " \001(\01326.google.bigtable.admin.v2.PartialU" + + "pdateInstanceRequest\0220\n\014request_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022/\n\013finish" + + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" + + "\373\004\n\025CreateClusterMetadata\022H\n\020original_re" + + "quest\030\001 \001(\0132..google.bigtable.admin.v2.C" + + "reateClusterRequest\0220\n\014request_time\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\022/\n\013finish_" + + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022K" + + "\n\006tables\030\004 \003(\0132;.google.bigtable.admin.v" + + "2.CreateClusterMetadata.TablesEntry\032\371\001\n\r" + + "TableProgress\022\034\n\024estimated_size_bytes\030\002 " + + "\001(\003\022\036\n\026estimated_copied_bytes\030\003 \001(\003\022R\n\005s" + + "tate\030\004 \001(\0162C.google.bigtable.admin.v2.Cr" + + "eateClusterMetadata.TableProgress.State\"" + + "V\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PENDI" + + "NG\020\001\022\013\n\007COPYING\020\002\022\r\n\tCOMPLETED\020\003\022\r\n\tCANC" + + "ELLED\020\004\032l\n\013TablesEntry\022\013\n\003key\030\001 \001(\t\022L\n\005v" + + "alue\030\002 \001(\0132=.google.bigtable.admin.v2.Cr" + + "eateClusterMetadata.TableProgress:\0028\001\"\267\001" + + "\n\025UpdateClusterMetadata\022;\n\020original_requ" + + "est\030\001 \001(\0132!.google.bigtable.admin.v2.Clu" + + "ster\0220\n\014request_time\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\"\322\001\n\034PartialUpdat" + + "eClusterMetadata\0220\n\014request_time\030\001 \001(\0132\032" + + ".google.protobuf.Timestamp\022/\n\013finish_tim" + + "e\030\002 \001(\0132\032.google.protobuf.Timestamp\022O\n\020o" + + "riginal_request\030\003 \001(\01325.google.bigtable." + + "admin.v2.PartialUpdateClusterRequest\"\214\001\n" + + "\033PartialUpdateClusterRequest\0227\n\007cluster\030" + + "\001 \001(\0132!.google.bigtable.admin.v2.Cluster" + + "B\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMaskB\003\340A\002\"\316\001\n\027CreateAppProfile" + + "Request\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%bigtabl" + + "eadmin.googleapis.com/Instance\022\033\n\016app_pr" + + "ofile_id\030\002 \001(\tB\003\340A\002\022>\n\013app_profile\030\003 \001(\013" + + "2$.google.bigtable.admin.v2.AppProfileB\003" + + "\340A\002\022\027\n\017ignore_warnings\030\004 \001(\010\"U\n\024GetAppPr" + + "ofileRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'bigt" + + "ableadmin.googleapis.com/AppProfile\"~\n\026L" + + "istAppProfilesRequest\022=\n\006parent\030\001 \001(\tB-\340" + + "A\002\372A\'\n%bigtableadmin.googleapis.com/Inst" + + "ance\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\002 " + + "\001(\t\"\210\001\n\027ListAppProfilesResponse\022:\n\014app_p" + + "rofiles\030\001 \003(\0132$.google.bigtable.admin.v2" + + ".AppProfile\022\027\n\017next_page_token\030\002 \001(\t\022\030\n\020" + + "failed_locations\030\003 \003(\t\"\250\001\n\027UpdateAppProf" + + "ileRequest\022>\n\013app_profile\030\001 \001(\0132$.google" + + ".bigtable.admin.v2.AppProfileB\003\340A\002\0224\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "askB\003\340A\002\022\027\n\017ignore_warnings\030\003 \001(\010\"v\n\027Del" + + "eteAppProfileRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372" + + "A)\n\'bigtableadmin.googleapis.com/AppProf" + + "ile\022\034\n\017ignore_warnings\030\002 \001(\010B\003\340A\002\"\032\n\030Upd" + + "ateAppProfileMetadata\"\332\001\n\025ListHotTablets" + + "Request\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$bigtabl" + + "eadmin.googleapis.com/Cluster\022.\n\nstart_t" + + "ime\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timest" + + "amp\022\021\n\tpage_size\030\004 \001(\005\022\022\n\npage_token\030\005 \001" + + "(\t\"k\n\026ListHotTabletsResponse\0228\n\013hot_tabl" + + "ets\030\001 \003(\0132#.google.bigtable.admin.v2.Hot" + + "Tablet\022\027\n\017next_page_token\030\002 \001(\t\"\271\001\n\030Crea" + + "teLogicalViewRequest\022=\n\006parent\030\001 \001(\tB-\340A" + + "\002\372A\'\n%bigtableadmin.googleapis.com/Insta" + + "nce\022\034\n\017logical_view_id\030\002 \001(\tB\003\340A\002\022@\n\014log" + + "ical_view\030\003 \001(\0132%.google.bigtable.admin." + + "v2.LogicalViewB\003\340A\002\"\307\001\n\031CreateLogicalVie" + + "wMetadata\022L\n\020original_request\030\001 \001(\01322.go" + + "ogle.bigtable.admin.v2.CreateLogicalView" + + "Request\022.\n\nstart_time\030\002 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022,\n\010end_time\030\003 \001(\0132\032.goog" + + "le.protobuf.Timestamp\"W\n\025GetLogicalViewR" + + "equest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(bigtablead" + + "min.googleapis.com/LogicalView\"\214\001\n\027ListL" + + "ogicalViewsRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372" + + "A*\022(bigtableadmin.googleapis.com/Logical" + + "View\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_tok" + + "en\030\003 \001(\tB\003\340A\001\"q\n\030ListLogicalViewsRespons" + + "e\022<\n\rlogical_views\030\001 \003(\0132%.google.bigtab" + + "le.admin.v2.LogicalView\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"\222\001\n\030UpdateLogicalViewRequest\022@\n" + + "\014logical_view\030\001 \001(\0132%.google.bigtable.ad" + + "min.v2.LogicalViewB\003\340A\002\0224\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\307\001" + + "\n\031UpdateLogicalViewMetadata\022L\n\020original_" + + "request\030\001 \001(\01322.google.bigtable.admin.v2" + + ".UpdateLogicalViewRequest\022.\n\nstart_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\022,\n\010end" + + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" + + "m\n\030DeleteLogicalViewRequest\022>\n\004name\030\001 \001(" + + "\tB0\340A\002\372A*\n(bigtableadmin.googleapis.com/" + + "LogicalView\022\021\n\004etag\030\002 \001(\tB\003\340A\001\"\315\001\n\035Creat" + + "eMaterializedViewRequest\022=\n\006parent\030\001 \001(\t" + + "B-\340A\002\372A\'\n%bigtableadmin.googleapis.com/I" + + "nstance\022!\n\024materialized_view_id\030\002 \001(\tB\003\340" + + "A\002\022J\n\021materialized_view\030\003 \001(\0132*.google.b" + + "igtable.admin.v2.MaterializedViewB\003\340A\002\"\321" + + "\001\n\036CreateMaterializedViewMetadata\022Q\n\020ori" + + "ginal_request\030\001 \001(\01327.google.bigtable.ad" + + "min.v2.CreateMaterializedViewRequest\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tamp\022,\n\010end_time\030\003 \001(\0132\032.google.protobuf" + + ".Timestamp\"a\n\032GetMaterializedViewRequest" + + "\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-bigtableadmin.go" + + "ogleapis.com/MaterializedView\"\226\001\n\034ListMa" + + "terializedViewsRequest\022E\n\006parent\030\001 \001(\tB5" + + "\340A\002\372A/\022-bigtableadmin.googleapis.com/Mat" + + "erializedView\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n" + + "\npage_token\030\003 \001(\tB\003\340A\001\"\200\001\n\035ListMateriali" + + "zedViewsResponse\022F\n\022materialized_views\030\001" + + " \003(\0132*.google.bigtable.admin.v2.Material" + + "izedView\022\027\n\017next_page_token\030\002 \001(\t\"\241\001\n\035Up" + + "dateMaterializedViewRequest\022J\n\021materiali" + + "zed_view\030\001 \001(\0132*.google.bigtable.admin.v" + + "2.MaterializedViewB\003\340A\002\0224\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\321\001" + + "\n\036UpdateMaterializedViewMetadata\022Q\n\020orig" + + "inal_request\030\001 \001(\01327.google.bigtable.adm" + + "in.v2.UpdateMaterializedViewRequest\022.\n\ns" + + "tart_time\030\002 \001(\0132\032.google.protobuf.Timest" + + "amp\022,\n\010end_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\"w\n\035DeleteMaterializedViewReque" + + "st\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-bigtableadmin." + + "googleapis.com/MaterializedView\022\021\n\004etag\030" + + "\002 \001(\tB\003\340A\0012\3466\n\025BigtableInstanceAdmin\022\332\001\n" + + "\016CreateInstance\022/.google.bigtable.admin." + + "v2.CreateInstanceRequest\032\035.google.longru" + + "nning.Operation\"x\312A\"\n\010Instance\022\026CreateIn" + + "stanceMetadata\332A$parent,instance_id,inst" + + "ance,clusters\202\323\344\223\002&\"!/v2/{parent=project" + + "s/*}/instances:\001*\022\221\001\n\013GetInstance\022,.goog" + + "le.bigtable.admin.v2.GetInstanceRequest\032" + + "\".google.bigtable.admin.v2.Instance\"0\332A\004" + + "name\202\323\344\223\002#\022!/v2/{name=projects/*/instanc" + + "es/*}\022\244\001\n\rListInstances\022..google.bigtabl" + + "e.admin.v2.ListInstancesRequest\032/.google" + + ".bigtable.admin.v2.ListInstancesResponse" + + "\"2\332A\006parent\202\323\344\223\002#\022!/v2/{parent=projects/" + + "*}/instances\022\206\001\n\016UpdateInstance\022\".google" + + ".bigtable.admin.v2.Instance\032\".google.big" + + "table.admin.v2.Instance\",\202\323\344\223\002&\032!/v2/{na" + + "me=projects/*/instances/*}:\001*\022\350\001\n\025Partia" + + "lUpdateInstance\0226.google.bigtable.admin." + + "v2.PartialUpdateInstanceRequest\032\035.google" + + ".longrunning.Operation\"x\312A\"\n\010Instance\022\026U" + + "pdateInstanceMetadata\332A\024instance,update_" + + "mask\202\323\344\223\00262*/v2/{instance.name=projects/" + + "*/instances/*}:\010instance\022\213\001\n\016DeleteInsta" + + "nce\022/.google.bigtable.admin.v2.DeleteIns" + + "tanceRequest\032\026.google.protobuf.Empty\"0\332A" + + "\004name\202\323\344\223\002#*!/v2/{name=projects/*/instan" + + "ces/*}\022\334\001\n\rCreateCluster\022..google.bigtab" + + "le.admin.v2.CreateClusterRequest\032\035.googl" + + "e.longrunning.Operation\"|\312A \n\007Cluster\022\025C" + + "reateClusterMetadata\332A\031parent,cluster_id" + + ",cluster\202\323\344\223\0027\",/v2/{parent=projects/*/i" + + "nstances/*}/clusters:\007cluster\022\231\001\n\nGetClu" + + "ster\022+.google.bigtable.admin.v2.GetClust" + + "erRequest\032!.google.bigtable.admin.v2.Clu" + + "ster\";\332A\004name\202\323\344\223\002.\022,/v2/{name=projects/" + + "*/instances/*/clusters/*}\022\254\001\n\014ListCluste" + + "rs\022-.google.bigtable.admin.v2.ListCluste" + + "rsRequest\032..google.bigtable.admin.v2.Lis" + + "tClustersResponse\"=\332A\006parent\202\323\344\223\002.\022,/v2/" + + "{parent=projects/*/instances/*}/clusters" + + "\022\255\001\n\rUpdateCluster\022!.google.bigtable.adm" + + "in.v2.Cluster\032\035.google.longrunning.Opera" + + "tion\"Z\312A \n\007Cluster\022\025UpdateClusterMetadat" + + "a\202\323\344\223\0021\032,/v2/{name=projects/*/instances/" + + "*/clusters/*}:\001*\022\364\001\n\024PartialUpdateCluste" + + "r\0225.google.bigtable.admin.v2.PartialUpda" + + "teClusterRequest\032\035.google.longrunning.Op" + + "eration\"\205\001\312A\'\n\007Cluster\022\034PartialUpdateClu" + + "sterMetadata\332A\023cluster,update_mask\202\323\344\223\002?" + + "24/v2/{cluster.name=projects/*/instances" + + "/*/clusters/*}:\007cluster\022\224\001\n\rDeleteCluste" + + "r\022..google.bigtable.admin.v2.DeleteClust" + + "erRequest\032\026.google.protobuf.Empty\";\332A\004na" + + "me\202\323\344\223\002.*,/v2/{name=projects/*/instances" + + "/*/clusters/*}\022\325\001\n\020CreateAppProfile\0221.go" + + "ogle.bigtable.admin.v2.CreateAppProfileR" + + "equest\032$.google.bigtable.admin.v2.AppPro" + + "file\"h\332A!parent,app_profile_id,app_profi" + + "le\202\323\344\223\002>\"//v2/{parent=projects/*/instanc" + + "es/*}/appProfiles:\013app_profile\022\245\001\n\rGetAp" + + "pProfile\022..google.bigtable.admin.v2.GetA" + + "ppProfileRequest\032$.google.bigtable.admin" + + ".v2.AppProfile\">\332A\004name\202\323\344\223\0021\022//v2/{name" + + "=projects/*/instances/*/appProfiles/*}\022\270" + + "\001\n\017ListAppProfiles\0220.google.bigtable.adm" + + "in.v2.ListAppProfilesRequest\0321.google.bi" + + "gtable.admin.v2.ListAppProfilesResponse\"" + + "@\332A\006parent\202\323\344\223\0021\022//v2/{parent=projects/*" + + "/instances/*}/appProfiles\022\372\001\n\020UpdateAppP" + + "rofile\0221.google.bigtable.admin.v2.Update" + + "AppProfileRequest\032\035.google.longrunning.O" + + "peration\"\223\001\312A&\n\nAppProfile\022\030UpdateAppPro" + + "fileMetadata\332A\027app_profile,update_mask\202\323" + + "\344\223\002J2;/v2/{app_profile.name=projects/*/i" + + "nstances/*/appProfiles/*}:\013app_profile\022\264" + + "\001\n\020DeleteAppProfile\0221.google.bigtable.ad" + + "min.v2.DeleteAppProfileRequest\032\026.google." + + "protobuf.Empty\"U\332A\004name\332A\024name,ignore_wa" + + "rnings\202\323\344\223\0021*//v2/{name=projects/*/insta" + + "nces/*/appProfiles/*}\022\252\002\n\014GetIamPolicy\022\"" + + ".google.iam.v1.GetIamPolicyRequest\032\025.goo" + + "gle.iam.v1.Policy\"\336\001\332A\010resource\202\323\344\223\002\314\001\"2" + + "/v2/{resource=projects/*/instances/*}:ge" + + "tIamPolicy:\001*ZK\"F/v2/{resource=projects/" + + "*/instances/*/materializedViews/*}:getIa" + + "mPolicy:\001*ZF\"A/v2/{resource=projects/*/i" + + "nstances/*/logicalViews/*}:getIamPolicy:" + + "\001*\022\261\002\n\014SetIamPolicy\022\".google.iam.v1.SetI" + + "amPolicyRequest\032\025.google.iam.v1.Policy\"\345" + + "\001\332A\017resource,policy\202\323\344\223\002\314\001\"2/v2/{resourc" + + "e=projects/*/instances/*}:setIamPolicy:\001" + + "*ZK\"F/v2/{resource=projects/*/instances/" + + "*/materializedViews/*}:setIamPolicy:\001*ZF" + + "\"A/v2/{resource=projects/*/instances/*/l" + + "ogicalViews/*}:setIamPolicy:\001*\022\350\002\n\022TestI" + + "amPermissions\022(.google.iam.v1.TestIamPer" + + "missionsRequest\032).google.iam.v1.TestIamP" + + "ermissionsResponse\"\374\001\332A\024resource,permiss" + + "ions\202\323\344\223\002\336\001\"8/v2/{resource=projects/*/in" + + "stances/*}:testIamPermissions:\001*ZQ\"L/v2/" + + "{resource=projects/*/instances/*/materia" + + "lizedViews/*}:testIamPermissions:\001*ZL\"G/" + + "v2/{resource=projects/*/instances/*/logi" + + "calViews/*}:testIamPermissions:\001*\022\277\001\n\016Li" + + "stHotTablets\022/.google.bigtable.admin.v2." + + "ListHotTabletsRequest\0320.google.bigtable." + + "admin.v2.ListHotTabletsResponse\"J\332A\006pare" + + "nt\202\323\344\223\002;\0229/v2/{parent=projects/*/instanc" + + "es/*/clusters/*}/hotTablets\022\200\002\n\021CreateLo" + + "gicalView\0222.google.bigtable.admin.v2.Cre" + + "ateLogicalViewRequest\032\035.google.longrunni" + + "ng.Operation\"\227\001\312A(\n\013LogicalView\022\031CreateL" + + "ogicalViewMetadata\332A#parent,logical_view" + + ",logical_view_id\202\323\344\223\002@\"0/v2/{parent=proj" + + "ects/*/instances/*}/logicalViews:\014logica" + + "l_view\022\251\001\n\016GetLogicalView\022/.google.bigta" + + "ble.admin.v2.GetLogicalViewRequest\032%.goo" + + "gle.bigtable.admin.v2.LogicalView\"?\332A\004na" + + "me\202\323\344\223\0022\0220/v2/{name=projects/*/instances" + + "/*/logicalViews/*}\022\274\001\n\020ListLogicalViews\022" + + "1.google.bigtable.admin.v2.ListLogicalVi" + + "ewsRequest\0322.google.bigtable.admin.v2.Li" + + "stLogicalViewsResponse\"A\332A\006parent\202\323\344\223\0022\022" + + "0/v2/{parent=projects/*/instances/*}/log" + + "icalViews\022\202\002\n\021UpdateLogicalView\0222.google" + + ".bigtable.admin.v2.UpdateLogicalViewRequ" + + "est\032\035.google.longrunning.Operation\"\231\001\312A(" + + "\n\013LogicalView\022\031UpdateLogicalViewMetadata" + + "\332A\030logical_view,update_mask\202\323\344\223\002M2=/v2/{" + + "logical_view.name=projects/*/instances/*" + + "/logicalViews/*}:\014logical_view\022\240\001\n\021Delet" + + "eLogicalView\0222.google.bigtable.admin.v2." + + "DeleteLogicalViewRequest\032\026.google.protob" + + "uf.Empty\"?\332A\004name\202\323\344\223\0022*0/v2/{name=proje" + + "cts/*/instances/*/logicalViews/*}\022\250\002\n\026Cr" + + "eateMaterializedView\0227.google.bigtable.a" + + "dmin.v2.CreateMaterializedViewRequest\032\035." + + "google.longrunning.Operation\"\265\001\312A2\n\020Mate" + + "rializedView\022\036CreateMaterializedViewMeta" + + "data\332A-parent,materialized_view,material" + + "ized_view_id\202\323\344\223\002J\"5/v2/{parent=projects" + + "/*/instances/*}/materializedViews:\021mater" + + "ialized_view\022\275\001\n\023GetMaterializedView\0224.g" + + "oogle.bigtable.admin.v2.GetMaterializedV" + + "iewRequest\032*.google.bigtable.admin.v2.Ma" + + "terializedView\"D\332A\004name\202\323\344\223\0027\0225/v2/{name" + + "=projects/*/instances/*/materializedView" + + "s/*}\022\320\001\n\025ListMaterializedViews\0226.google." + + "bigtable.admin.v2.ListMaterializedViewsR" + + "equest\0327.google.bigtable.admin.v2.ListMa" + + "terializedViewsResponse\"F\332A\006parent\202\323\344\223\0027" + + "\0225/v2/{parent=projects/*/instances/*}/ma" + + "terializedViews\022\252\002\n\026UpdateMaterializedVi" + + "ew\0227.google.bigtable.admin.v2.UpdateMate" + + "rializedViewRequest\032\035.google.longrunning" + + ".Operation\"\267\001\312A2\n\020MaterializedView\022\036Upda" + + "teMaterializedViewMetadata\332A\035materialize" + + "d_view,update_mask\202\323\344\223\002\\2G/v2/{materiali" + + "zed_view.name=projects/*/instances/*/mat" + + "erializedViews/*}:\021materialized_view\022\257\001\n" + + "\026DeleteMaterializedView\0227.google.bigtabl" + + "e.admin.v2.DeleteMaterializedViewRequest" + + "\032\026.google.protobuf.Empty\"D\332A\004name\202\323\344\223\0027*" + + "5/v2/{name=projects/*/instances/*/materi" + + "alizedViews/*}\032\232\003\312A\034bigtableadmin.google" + + "apis.com\322A\367\002https://www.googleapis.com/a" + + "uth/bigtable.admin,https://www.googleapi" + + "s.com/auth/bigtable.admin.cluster,https:" + + "//www.googleapis.com/auth/bigtable.admin" + + ".instance,https://www.googleapis.com/aut" + + "h/cloud-bigtable.admin,https://www.googl" + + "eapis.com/auth/cloud-bigtable.admin.clus" + + "ter,https://www.googleapis.com/auth/clou" + + "d-platform,https://www.googleapis.com/au" + + "th/cloud-platform.read-onlyB\335\001\n\034com.goog" + + "le.bigtable.admin.v2B\032BigtableInstanceAd" + + "minProtoP\001Z8cloud.google.com/go/bigtable" + + "/admin/apiv2/adminpb;adminpb\252\002\036Google.Cl" + + "oud.Bigtable.Admin.V2\312\002\036Google\\Cloud\\Big" + + "table\\Admin\\V2\352\002\"Google::Cloud::Bigtable" + + "::Admin::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.bigtable.admin.v2.InstanceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "Clusters", + }); + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_descriptor = + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "FailedLocations", "NextPageToken", + }); + internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor, + new java.lang.String[] { + "Instance", "UpdateMask", + }); + internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", + }); + internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor, + new java.lang.String[] { + "Clusters", "FailedLocations", "NextPageToken", + }); + internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "RequestTime", "FinishTime", + }); + internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "RequestTime", "FinishTime", + }); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "RequestTime", "FinishTime", "Tables", + }); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor = + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor, + new java.lang.String[] { + "EstimatedSizeBytes", "EstimatedCopiedBytes", "State", + }); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_descriptor = + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "RequestTime", "FinishTime", + }); + internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor, + new java.lang.String[] { + "RequestTime", "FinishTime", "OriginalRequest", + }); + internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor, + new java.lang.String[] { + "Cluster", "UpdateMask", + }); + internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor, + new java.lang.String[] { + "Parent", "AppProfileId", "AppProfile", "IgnoreWarnings", + }); + internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor, + new java.lang.String[] { + "AppProfiles", "NextPageToken", "FailedLocations", + }); + internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor, + new java.lang.String[] { + "AppProfile", "UpdateMask", "IgnoreWarnings", + }); + internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor = + getDescriptor().getMessageType(22); + internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor, + new java.lang.String[] { + "Name", "IgnoreWarnings", + }); + internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor, + new java.lang.String[] { + "Parent", "StartTime", "EndTime", "PageSize", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor, + new java.lang.String[] { + "HotTablets", "NextPageToken", + }); + internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor, + new java.lang.String[] { + "Parent", "LogicalViewId", "LogicalView", + }); + internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor = + getDescriptor().getMessageType(27); + internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "StartTime", "EndTime", + }); + internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor = + getDescriptor().getMessageType(28); + internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor = + getDescriptor().getMessageType(30); + internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor, + new java.lang.String[] { + "LogicalViews", "NextPageToken", + }); + internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor, + new java.lang.String[] { + "LogicalView", "UpdateMask", + }); + internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "StartTime", "EndTime", + }); + internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor, + new java.lang.String[] { + "Parent", "MaterializedViewId", "MaterializedView", + }); + internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "StartTime", "EndTime", + }); + internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(36); + internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor = + getDescriptor().getMessageType(37); + internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor = + getDescriptor().getMessageType(38); + internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor, + new java.lang.String[] { + "MaterializedViews", "NextPageToken", + }); + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(39); + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor, + new java.lang.String[] { + "MaterializedView", "UpdateMask", + }); + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor = + getDescriptor().getMessageType(40); + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor, + new java.lang.String[] { + "OriginalRequest", "StartTime", "EndTime", + }); + internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(41); + internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.bigtable.admin.v2.InstanceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java new file mode 100644 index 000000000000..dad424b0555d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java @@ -0,0 +1,1199 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class BigtableTableAdminProto extends com.google.protobuf.GeneratedFile { + private BigtableTableAdminProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BigtableTableAdminProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_RestoreTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_RestoreTableMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_RestoreTableMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DropRowRangeRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DropRowRangeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListTablesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateTableMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateTableMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UndeleteTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UndeleteTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_SnapshotTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_SnapshotTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateBackupMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateBackupMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListBackupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListBackupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListBackupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListBackupsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CopyBackupRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CopyBackupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CopyBackupMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CopyBackupMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "3google/bigtable/admin/v2/bigtable_tabl" + + "e_admin.proto\022\030google.bigtable.admin.v2\032" + + "\034google/api/annotations.proto\032\027google/ap" + + "i/client.proto\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032%goog" + + "le/bigtable/admin/v2/common.proto\032$googl" + + "e/bigtable/admin/v2/table.proto\032\036google/" + + "iam/v1/iam_policy.proto\032\032google/iam/v1/p" + + "olicy.proto\032#google/longrunning/operatio" + + "ns.proto\032\036google/protobuf/duration.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\261\001\n" + + "\023RestoreTableRequest\022=\n" + + "\006parent\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\025\n" + + "\010table_id\030\002 \001(\tB\003\340A\002\022:\n" + + "\006backup\030\003 \001(\tB(\372A%\n" + + "#bigtableadmin.googleapis.com/BackupH\000B\010\n" + + "\006source\"\230\002\n" + + "\024RestoreTableMetadata\022\014\n" + + "\004name\030\001 \001(\t\022@\n" + + "\013source_type\030\002 \001(\0162+.google.bigtable.admin.v2.RestoreSourceType\022;\n" + + "\013backup_info\030\003 \001(\0132$.google.bigtable.admin.v2.BackupInfoH\000\022%\n" + + "\035optimize_table_operation_name\030\004 \001(\t\022=\n" + + "\010progress\030\005 \001(\0132+.google.bigtable.admin.v2.OperationProgressB\r\n" + + "\013source_info\"l\n" + + "\035OptimizeRestoredTableMetadata\022\014\n" + + "\004name\030\001 \001(\t\022=\n" + + "\010progress\030\002" + + " \001(\0132+.google.bigtable.admin.v2.OperationProgress\"\201\002\n" + + "\022CreateTableRequest\022=\n" + + "\006parent\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\025\n" + + "\010table_id\030\002 \001(\tB\003\340A\002\0223\n" + + "\005table\030\003 \001(\0132\037.google.bigtable.admin.v2.TableB\003\340A\002\022J\n" + + "\016initial_splits\030\004" + + " \003(\01322.google.bigtable.admin.v2.CreateTableRequest.Split\032\024\n" + + "\005Split\022\013\n" + + "\003key\030\001 \001(\014\"\276\001\n" + + "\036CreateTableFromSnapshotRequest\022=\n" + + "\006parent\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\025\n" + + "\010table_id\030\002 \001(\tB\003\340A\002\022F\n" + + "\017source_snapshot\030\003 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Snapshot\"\231\001\n" + + "\023DropRowRangeRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022\030\n" + + "\016row_key_prefix\030\002 \001(\014H\000\022$\n" + + "\032delete_all_data_from_table\030\003 \001(\010H\000B\010\n" + + "\006target\"\255\001\n" + + "\021ListTablesRequest\022=\n" + + "\006parent\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\0222\n" + + "\004view\030\002 \001(\0162$.google.bigtable.admin.v2.Table.View\022\021\n" + + "\tpage_size\030\004 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"^\n" + + "\022ListTablesResponse\022/\n" + + "\006tables\030\001 \003(\0132\037.google.bigtable.admin.v2.Table\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\177\n" + + "\017GetTableRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\0222\n" + + "\004view\030\002 \001(\0162$.google.bigtable.admin.v2.Table.View\"\235\001\n" + + "\022UpdateTableRequest\0223\n" + + "\005table\030\001 \001(\0132\037.google.bigtable.admin.v2.TableB\003\340A\002\0224\n" + + "\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\022\034\n" + + "\017ignore_warnings\030\003 \001(\010B\003\340A\001\"\201\001\n" + + "\023UpdateTableMetadata\022\014\n" + + "\004name\030\001 \001(\t\022.\n" + + "\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"N\n" + + "\022DeleteTableRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\"P\n" + + "\024UndeleteTableRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\"\203\001\n" + + "\025UndeleteTableMetadata\022\014\n" + + "\004name\030\001 \001(\t\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\263\003\n" + + "\033ModifyColumnFamiliesRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022^\n" + + "\r" + + "modifications\030\002 \003(\0132B.google.bigtable.a" + + "dmin.v2.ModifyColumnFamiliesRequest.ModificationB\003\340A\002\022\034\n" + + "\017ignore_warnings\030\003 \001(\010B\003\340A\001\032\333\001\n" + + "\014Modification\022\n\n" + + "\002id\030\001 \001(\t\0228\n" + + "\006create\030\002 \001(\0132&.google.bigtable.admin.v2.ColumnFamilyH\000\0228\n" + + "\006update\030\003 \001(\0132&.google.bigtable.admin.v2.ColumnFamilyH\000\022\016\n" + + "\004drop\030\004 \001(\010H\000\0224\n" + + "\013update_mask\030\006 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001B\005\n" + + "\003mod\"[\n" + + "\037GenerateConsistencyTokenRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\"=\n" + + " GenerateConsistencyTokenResponse\022\031\n" + + "\021consistency_token\030\001 \001(\t\"\262\002\n" + + "\027CheckConsistencyRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022\036\n" + + "\021consistency_token\030\002 \001(\tB\003\340A\002\022Y\n" + + "\033standard_read_remote_writes\030\003" + + " \001(\01322.google.bigtable.admin.v2.StandardReadRemoteWritesH\000\022Z\n" + + "\034data_boost_read_local_writes\030\004 \001(\01322.google.bi" + + "gtable.admin.v2.DataBoostReadLocalWritesH\000B\006\n" + + "\004mode\"\032\n" + + "\030StandardReadRemoteWrites\"\032\n" + + "\030DataBoostReadLocalWrites\".\n" + + "\030CheckConsistencyResponse\022\022\n\n" + + "consistent\030\001 \001(\010\"\346\001\n" + + "\024SnapshotTableRequest\0228\n" + + "\004name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022=\n" + + "\007cluster\030\002 \001(\tB,\340A\002\372A&\n" + + "$bigtableadmin.googleapis.com/Cluster\022\030\n" + + "\013snapshot_id\030\003 \001(\tB\003\340A\002\022&\n" + + "\003ttl\030\004 \001(\0132\031.google.protobuf.Duration\022\023\n" + + "\013description\030\005 \001(\t\"Q\n" + + "\022GetSnapshotRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Snapshot\"{\n" + + "\024ListSnapshotsRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n" + + "$bigtableadmin.googleapis.com/Cluster\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"g\n" + + "\025ListSnapshotsResponse\0225\n" + + "\tsnapshots\030\001 \003(\0132\".google.bigtable.admin.v2.Snapshot\022\027\n" + + "\017next_page_token\030\002 \001(\t\"T\n" + + "\025DeleteSnapshotRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Snapshot\"\304\001\n" + + "\025SnapshotTableMetadata\022H\n" + + "\020original_request\030\001 \001(\0132." + + ".google.bigtable.admin.v2.SnapshotTableRequest\0220\n" + + "\014request_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013finish_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\330\001\n" + + "\037CreateTableFromSnapshotMetadata\022R\n" + + "\020original_request\030\001" + + " \001(\01328.google.bigtable.admin.v2.CreateTableFromSnapshotRequest\0220\n" + + "\014request_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013finish_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\242\001\n" + + "\023CreateBackupRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n" + + "$bigtableadmin.googleapis.com/Cluster\022\026\n" + + "\tbackup_id\030\002 \001(\tB\003\340A\002\0225\n" + + "\006backup\030\003 \001(\0132" + + " .google.bigtable.admin.v2.BackupB\003\340A\002\"\230\001\n" + + "\024CreateBackupMetadata\022\014\n" + + "\004name\030\001 \001(\t\022\024\n" + + "\014source_table\030\002 \001(\t\022.\n\n" + + "start_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\004 \001(\0132\032.google.protobuf.Timestamp\"\202\001\n" + + "\023UpdateBackupRequest\0225\n" + + "\006backup\030\001 \001(\0132 .google.bigtable.admin.v2.BackupB\003\340A\002\0224\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"M\n" + + "\020GetBackupRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#bigtableadmin.googleapis.com/Backup\"P\n" + + "\023DeleteBackupRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#bigtableadmin.googleapis.com/Backup\"\233\001\n" + + "\022ListBackupsRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n" + + "$bigtableadmin.googleapis.com/Cluster\022\016\n" + + "\006filter\030\002 \001(\t\022\020\n" + + "\010order_by\030\003 \001(\t\022\021\n" + + "\tpage_size\030\004 \001(\005\022\022\n\n" + + "page_token\030\005 \001(\t\"a\n" + + "\023ListBackupsResponse\0221\n" + + "\007backups\030\001 \003(\0132 .google.bigtable.admin.v2.Backup\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\343\001\n" + + "\021CopyBackupRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n" + + "$bigtableadmin.googleapis.com/Cluster\022\026\n" + + "\tbackup_id\030\002 \001(\tB\003\340A\002\022B\n\r" + + "source_backup\030\003 \001(\tB+\340A\002\372A%\n" + + "#bigtableadmin.googleapis.com/Backup\0224\n" + + "\013expire_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\002\"\315\001\n" + + "\022CopyBackupMetadata\0226\n" + + "\004name\030\001 \001(\tB(\372A%\n" + + "#bigtableadmin.googleapis.com/Backup\022@\n" + + "\022source_backup_info\030\002 \001(\0132$.google.bigtable.admin.v2.BackupInfo\022=\n" + + "\010progress\030\003" + + " \001(\0132+.google.bigtable.admin.v2.OperationProgress\"\313\001\n" + + "\033CreateAuthorizedViewRequest\022C\n" + + "\006parent\030\001 \001(" + + "\tB3\340A\002\372A-\022+bigtableadmin.googleapis.com/AuthorizedView\022\037\n" + + "\022authorized_view_id\030\002 \001(\tB\003\340A\002\022F\n" + + "\017authorized_view\030\003 \001(\0132(.googl" + + "e.bigtable.admin.v2.AuthorizedViewB\003\340A\002\"\322\001\n" + + "\034CreateAuthorizedViewMetadata\022O\n" + + "\020original_request\030\001" + + " \001(\01325.google.bigtable.admin.v2.CreateAuthorizedViewRequest\0220\n" + + "\014request_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013finish_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\334\001\n" + + "\032ListAuthorizedViewsRequest\022C\n" + + "\006parent\030\001 \001(" + + "\tB3\340A\002\372A-\022+bigtableadmin.googleapis.com/AuthorizedView\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\022H\n" + + "\004view\030\004" + + " \001(\01625.google.bigtable.admin.v2.AuthorizedView.ResponseViewB\003\340A\001\"z\n" + + "\033ListAuthorizedViewsResponse\022B\n" + + "\020authorized_views\030\001" + + " \003(\0132(.google.bigtable.admin.v2.AuthorizedView\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\247\001\n" + + "\030GetAuthorizedViewRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022H\n" + + "\004view\030\002 \001(\01625.google.b" + + "igtable.admin.v2.AuthorizedView.ResponseViewB\003\340A\001\"\271\001\n" + + "\033UpdateAuthorizedViewRequest\022F\n" + + "\017authorized_view\030\001" + + " \001(\0132(.google.bigtable.admin.v2.AuthorizedViewB\003\340A\002\0224\n" + + "\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022\034\n" + + "\017ignore_warnings\030\003 \001(\010B\003\340A\001\"\322\001\n" + + "\034UpdateAuthorizedViewMetadata\022O\n" + + "\020original_request\030\001" + + " \001(\01325.google.bigtable.admin.v2.UpdateAuthorizedViewRequest\0220\n" + + "\014request_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013finish_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"s\n" + + "\033DeleteAuthorizedViewRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\"\272\001\n" + + "\031CreateSchemaBundleRequest\022:\n" + + "\006parent\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022\035\n" + + "\020schema_bundle_id\030\002 \001(\tB\003\340A\002\022B\n\r" + + "schema_bundle\030\003" + + " \001(\0132&.google.bigtable.admin.v2.SchemaBundleB\003\340A\002\"\210\001\n" + + "\032CreateSchemaBundleMetadata\022\014\n" + + "\004name\030\001 \001(\t\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\263\001\n" + + "\031UpdateSchemaBundleRequest\022B\n\r" + + "schema_bundle\030\001" + + " \001(\0132&.google.bigtable.admin.v2.SchemaBundleB\003\340A\002\0224\n" + + "\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022\034\n" + + "\017ignore_warnings\030\003 \001(\010B\003\340A\001\"\210\001\n" + + "\032UpdateSchemaBundleMetadata\022\014\n" + + "\004name\030\001 \001(\t\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"Y\n" + + "\026GetSchemaBundleRequest\022?\n" + + "\004name\030\001 \001(\tB1\340A\002\372A+\n" + + ")bigtableadmin.googleapis.com/SchemaBundle\"\204\001\n" + + "\030ListSchemaBundlesRequest\022A\n" + + "\006parent\030\001 \001(\tB1\340A\002\372A+" + + "\022)bigtableadmin.googleapis.com/SchemaBundle\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"t\n" + + "\031ListSchemaBundlesResponse\022>\n" + + "\016schema_bundles\030\001 \003(\0132&.google.bigtable.admin.v2.SchemaBundle\022\027\n" + + "\017next_page_token\030\002 \001(\t\"o\n" + + "\031DeleteSchemaBundleRequest\022?\n" + + "\004name\030\001 \001(\tB1\340A\002\372A+\n" + + ")bigtableadmin.googleapis.com/SchemaBundle\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\0012\222@\n" + + "\022BigtableTableAdmin\022\253\001\n" + + "\013CreateTable\022,.google.bigtable.admin.v2.CreateTableRequest\032\037" + + ".google.bigtable.admin.v2.Table\"M\332A\025pare" + + "nt,table_id,table\202\323\344\223\002/\"*/v2/{parent=projects/*/instances/*}/tables:\001*\022\212\002\n" + + "\027CreateTableFromSnapshot\0228.google.bigtable.adm" + + "in.v2.CreateTableFromSnapshotRequest\032\035.google.longrunning.Operation\"\225\001\312A(\n" + + "\005Table\022\037CreateTableFromSnapshotMetadata\332A\037pare" + + "nt,table_id,source_snapshot\202\323\344\223\002B\"=/v2/{" + + "parent=projects/*/instances/*}/tables:createFromSnapshot:\001*\022\244\001\n\n" + + "ListTables\022+.google.bigtable.admin.v2.ListTablesRequest\032" + + ",.google.bigtable.admin.v2.ListTablesRes" + + "ponse\";\332A\006parent\202\323\344\223\002,\022*/v2/{parent=projects/*/instances/*}/tables\022\221\001\n" + + "\010GetTable\022).google.bigtable.admin.v2.GetTableReque" + + "st\032\037.google.bigtable.admin.v2.Table\"9\332A\004" + + "name\202\323\344\223\002,\022*/v2/{name=projects/*/instances/*/tables/*}\022\316\001\n" + + "\013UpdateTable\022,.google." + + "bigtable.admin.v2.UpdateTableRequest\032\035.google.longrunning.Operation\"r\312A\034\n" + + "\005Table\022\023UpdateTableMetadata\332A\021table,update_mask" + + "\202\323\344\223\002920/v2/{table.name=projects/*/instances/*/tables/*}:\005table\022\216\001\n" + + "\013DeleteTable\022,.google.bigtable.admin.v2.DeleteTableRe" + + "quest\032\026.google.protobuf.Empty\"9\332A\004name\202\323" + + "\344\223\002,**/v2/{name=projects/*/instances/*/tables/*}\022\306\001\n\r" + + "UndeleteTable\022..google.bigt" + + "able.admin.v2.UndeleteTableRequest\032\035.google.longrunning.Operation\"f\312A\036\n" + + "\005Table\022\025UndeleteTableMetadata\332A\004name\202\323\344\223\0028\"3/v2/{" + + "name=projects/*/instances/*/tables/*}:undelete:\001*\022\241\002\n" + + "\024CreateAuthorizedView\0225.google.bigtable.admin.v2.CreateAuthorizedVi" + + "ewRequest\032\035.google.longrunning.Operation\"\262\001\312A.\n" + + "\016AuthorizedView\022\034CreateAuthorizedViewMetadata\332A)parent,authorized_view,au" + + "thorized_view_id\202\323\344\223\002O\"\022\022*" + + " + * Change stream configuration. + * + * + * Protobuf type {@code google.bigtable.admin.v2.ChangeStreamConfig} + */ +@com.google.protobuf.Generated +public final class ChangeStreamConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ChangeStreamConfig) + ChangeStreamConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChangeStreamConfig"); + } + + // Use ChangeStreamConfig.newBuilder() to construct. + private ChangeStreamConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ChangeStreamConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ChangeStreamConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ChangeStreamConfig.class, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder.class); + } + + private int bitField0_; + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + @java.lang.Override + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionPeriod() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRetentionPeriod()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetentionPeriod()); + } + size += getUnknownFields().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.admin.v2.ChangeStreamConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ChangeStreamConfig other = + (com.google.bigtable.admin.v2.ChangeStreamConfig) obj; + + if (hasRetentionPeriod() != other.hasRetentionPeriod()) return false; + if (hasRetentionPeriod()) { + if (!getRetentionPeriod().equals(other.getRetentionPeriod())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRetentionPeriod()) { + hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPeriod().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig 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.admin.v2.ChangeStreamConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig 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.admin.v2.ChangeStreamConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ChangeStreamConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Change stream configuration.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ChangeStreamConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ChangeStreamConfig) + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ChangeStreamConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ChangeStreamConfig.class, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ChangeStreamConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetentionPeriodFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfig getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfig build() { + com.google.bigtable.admin.v2.ChangeStreamConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfig buildPartial() { + com.google.bigtable.admin.v2.ChangeStreamConfig result = + new com.google.bigtable.admin.v2.ChangeStreamConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ChangeStreamConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionPeriod_ = + retentionPeriodBuilder_ == null ? retentionPeriod_ : retentionPeriodBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ChangeStreamConfig) { + return mergeFrom((com.google.bigtable.admin.v2.ChangeStreamConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ChangeStreamConfig other) { + if (other == com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance()) + return this; + if (other.hasRetentionPeriod()) { + mergeRetentionPeriod(other.getRetentionPeriod()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + public com.google.protobuf.Duration getRetentionPeriod() { + if (retentionPeriodBuilder_ == null) { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } else { + return retentionPeriodBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPeriod_ = value; + } else { + retentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionPeriodBuilder_ == null) { + retentionPeriod_ = builderForValue.build(); + } else { + retentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder mergeRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retentionPeriod_ != null + && retentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionPeriodBuilder().mergeFrom(value); + } else { + retentionPeriod_ = value; + } + } else { + retentionPeriodBuilder_.mergeFrom(value); + } + if (retentionPeriod_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public Builder clearRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRetentionPeriodFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + if (retentionPeriodBuilder_ != null) { + return retentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + } + + /** + * + * + *
+     * How long the change stream should be retained. Change stream data older
+     * than the retention period will not be returned when reading the change
+     * stream from the table.
+     * Values must be at least 1 day and at most 7 days, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ChangeStreamConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ChangeStreamConfig) + private static final com.google.bigtable.admin.v2.ChangeStreamConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ChangeStreamConfig(); + } + + public static com.google.bigtable.admin.v2.ChangeStreamConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChangeStreamConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ChangeStreamConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java new file mode 100644 index 000000000000..bac567617464 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ChangeStreamConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ChangeStreamConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + + /** + * + * + *
+   * How long the change stream should be retained. Change stream data older
+   * than the retention period will not be returned when reading the change
+   * stream from the table.
+   * Values must be at least 1 day and at most 7 days, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration retention_period = 1; + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java new file mode 100644 index 000000000000..716d13ce6c28 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java @@ -0,0 +1,1600 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyRequest} + */ +@com.google.protobuf.Generated +public final class CheckConsistencyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CheckConsistencyRequest) + CheckConsistencyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckConsistencyRequest"); + } + + // Use CheckConsistencyRequest.newBuilder() to construct. + private CheckConsistencyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CheckConsistencyRequest() { + name_ = ""; + consistencyToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CheckConsistencyRequest.class, + com.google.bigtable.admin.v2.CheckConsistencyRequest.Builder.class); + } + + private int modeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object mode_; + + public enum ModeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STANDARD_READ_REMOTE_WRITES(3), + DATA_BOOST_READ_LOCAL_WRITES(4), + MODE_NOT_SET(0); + private final int value; + + private ModeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModeCase valueOf(int value) { + return forNumber(value); + } + + public static ModeCase forNumber(int value) { + switch (value) { + case 3: + return STANDARD_READ_REMOTE_WRITES; + case 4: + return DATA_BOOST_READ_LOCAL_WRITES; + case 0: + return MODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the Table for which to check replication
+   * consistency. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 Table for which to check replication
+   * consistency. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 CONSISTENCY_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object consistencyToken_ = ""; + + /** + * + * + *
+   * Required. The token created using GenerateConsistencyToken for the Table.
+   * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The consistencyToken. + */ + @java.lang.Override + public java.lang.String getConsistencyToken() { + java.lang.Object ref = consistencyToken_; + 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(); + consistencyToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The token created using GenerateConsistencyToken for the Table.
+   * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for consistencyToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsistencyTokenBytes() { + java.lang.Object ref = consistencyToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consistencyToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STANDARD_READ_REMOTE_WRITES_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return Whether the standardReadRemoteWrites field is set. + */ + @java.lang.Override + public boolean hasStandardReadRemoteWrites() { + return modeCase_ == 3; + } + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return The standardReadRemoteWrites. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWrites getStandardReadRemoteWrites() { + if (modeCase_ == 3) { + return (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_; + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder + getStandardReadRemoteWritesOrBuilder() { + if (modeCase_ == 3) { + return (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_; + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + + public static final int DATA_BOOST_READ_LOCAL_WRITES_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return Whether the dataBoostReadLocalWrites field is set. + */ + @java.lang.Override + public boolean hasDataBoostReadLocalWrites() { + return modeCase_ == 4; + } + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return The dataBoostReadLocalWrites. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDataBoostReadLocalWrites() { + if (modeCase_ == 4) { + return (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_; + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder + getDataBoostReadLocalWritesOrBuilder() { + if (modeCase_ == 4) { + return (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_; + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consistencyToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, consistencyToken_); + } + if (modeCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); + } + if (modeCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consistencyToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, consistencyToken_); + } + if (modeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); + } + if (modeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + size += getUnknownFields().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.admin.v2.CheckConsistencyRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CheckConsistencyRequest other = + (com.google.bigtable.admin.v2.CheckConsistencyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getConsistencyToken().equals(other.getConsistencyToken())) return false; + if (!getModeCase().equals(other.getModeCase())) return false; + switch (modeCase_) { + case 3: + if (!getStandardReadRemoteWrites().equals(other.getStandardReadRemoteWrites())) + return false; + break; + case 4: + if (!getDataBoostReadLocalWrites().equals(other.getDataBoostReadLocalWrites())) + return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONSISTENCY_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getConsistencyToken().hashCode(); + switch (modeCase_) { + case 3: + hash = (37 * hash) + STANDARD_READ_REMOTE_WRITES_FIELD_NUMBER; + hash = (53 * hash) + getStandardReadRemoteWrites().hashCode(); + break; + case 4: + hash = (37 * hash) + DATA_BOOST_READ_LOCAL_WRITES_FIELD_NUMBER; + hash = (53 * hash) + getDataBoostReadLocalWrites().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest 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.admin.v2.CheckConsistencyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest 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.admin.v2.CheckConsistencyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CheckConsistencyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CheckConsistencyRequest) + com.google.bigtable.admin.v2.CheckConsistencyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CheckConsistencyRequest.class, + com.google.bigtable.admin.v2.CheckConsistencyRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CheckConsistencyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + consistencyToken_ = ""; + if (standardReadRemoteWritesBuilder_ != null) { + standardReadRemoteWritesBuilder_.clear(); + } + if (dataBoostReadLocalWritesBuilder_ != null) { + dataBoostReadLocalWritesBuilder_.clear(); + } + modeCase_ = 0; + mode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CheckConsistencyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyRequest build() { + com.google.bigtable.admin.v2.CheckConsistencyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyRequest buildPartial() { + com.google.bigtable.admin.v2.CheckConsistencyRequest result = + new com.google.bigtable.admin.v2.CheckConsistencyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CheckConsistencyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consistencyToken_ = consistencyToken_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.CheckConsistencyRequest result) { + result.modeCase_ = modeCase_; + result.mode_ = this.mode_; + if (modeCase_ == 3 && standardReadRemoteWritesBuilder_ != null) { + result.mode_ = standardReadRemoteWritesBuilder_.build(); + } + if (modeCase_ == 4 && dataBoostReadLocalWritesBuilder_ != null) { + result.mode_ = dataBoostReadLocalWritesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CheckConsistencyRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CheckConsistencyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyRequest other) { + if (other == com.google.bigtable.admin.v2.CheckConsistencyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getConsistencyToken().isEmpty()) { + consistencyToken_ = other.consistencyToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getModeCase()) { + case STANDARD_READ_REMOTE_WRITES: + { + mergeStandardReadRemoteWrites(other.getStandardReadRemoteWrites()); + break; + } + case DATA_BOOST_READ_LOCAL_WRITES: + { + mergeDataBoostReadLocalWrites(other.getDataBoostReadLocalWrites()); + break; + } + case MODE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + consistencyToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetStandardReadRemoteWritesFieldBuilder().getBuilder(), + extensionRegistry); + modeCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDataBoostReadLocalWritesFieldBuilder().getBuilder(), + extensionRegistry); + modeCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int modeCase_ = 0; + private java.lang.Object mode_; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public Builder clearMode() { + modeCase_ = 0; + mode_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the Table for which to check replication
+     * consistency. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 Table for which to check replication
+     * consistency. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 Table for which to check replication
+     * consistency. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the Table for which to check replication
+     * consistency. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the Table for which to check replication
+     * consistency. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object consistencyToken_ = ""; + + /** + * + * + *
+     * Required. The token created using GenerateConsistencyToken for the Table.
+     * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The consistencyToken. + */ + public java.lang.String getConsistencyToken() { + java.lang.Object ref = consistencyToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consistencyToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The token created using GenerateConsistencyToken for the Table.
+     * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for consistencyToken. + */ + public com.google.protobuf.ByteString getConsistencyTokenBytes() { + java.lang.Object ref = consistencyToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consistencyToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The token created using GenerateConsistencyToken for the Table.
+     * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The consistencyToken to set. + * @return This builder for chaining. + */ + public Builder setConsistencyToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consistencyToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The token created using GenerateConsistencyToken for the Table.
+     * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearConsistencyToken() { + consistencyToken_ = getDefaultInstance().getConsistencyToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The token created using GenerateConsistencyToken for the Table.
+     * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for consistencyToken to set. + * @return This builder for chaining. + */ + public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consistencyToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.StandardReadRemoteWrites, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder, + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder> + standardReadRemoteWritesBuilder_; + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return Whether the standardReadRemoteWrites field is set. + */ + @java.lang.Override + public boolean hasStandardReadRemoteWrites() { + return modeCase_ == 3; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return The standardReadRemoteWrites. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWrites getStandardReadRemoteWrites() { + if (standardReadRemoteWritesBuilder_ == null) { + if (modeCase_ == 3) { + return (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_; + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } else { + if (modeCase_ == 3) { + return standardReadRemoteWritesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + public Builder setStandardReadRemoteWrites( + com.google.bigtable.admin.v2.StandardReadRemoteWrites value) { + if (standardReadRemoteWritesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + standardReadRemoteWritesBuilder_.setMessage(value); + } + modeCase_ = 3; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + public Builder setStandardReadRemoteWrites( + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder builderForValue) { + if (standardReadRemoteWritesBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + standardReadRemoteWritesBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 3; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + public Builder mergeStandardReadRemoteWrites( + com.google.bigtable.admin.v2.StandardReadRemoteWrites value) { + if (standardReadRemoteWritesBuilder_ == null) { + if (modeCase_ == 3 + && mode_ + != com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance()) { + mode_ = + com.google.bigtable.admin.v2.StandardReadRemoteWrites.newBuilder( + (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 3) { + standardReadRemoteWritesBuilder_.mergeFrom(value); + } else { + standardReadRemoteWritesBuilder_.setMessage(value); + } + } + modeCase_ = 3; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + public Builder clearStandardReadRemoteWrites() { + if (standardReadRemoteWritesBuilder_ == null) { + if (modeCase_ == 3) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 3) { + modeCase_ = 0; + mode_ = null; + } + standardReadRemoteWritesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + public com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder + getStandardReadRemoteWritesBuilder() { + return internalGetStandardReadRemoteWritesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder + getStandardReadRemoteWritesOrBuilder() { + if ((modeCase_ == 3) && (standardReadRemoteWritesBuilder_ != null)) { + return standardReadRemoteWritesBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 3) { + return (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_; + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Checks that reads using an app profile with `StandardIsolation` can
+     * see all writes committed before the token was created, even if the
+     * read and write target different clusters.
+     * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.StandardReadRemoteWrites, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder, + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder> + internalGetStandardReadRemoteWritesFieldBuilder() { + if (standardReadRemoteWritesBuilder_ == null) { + if (!(modeCase_ == 3)) { + mode_ = com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + standardReadRemoteWritesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.StandardReadRemoteWrites, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder, + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder>( + (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 3; + onChanged(); + return standardReadRemoteWritesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.DataBoostReadLocalWrites, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder, + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder> + dataBoostReadLocalWritesBuilder_; + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return Whether the dataBoostReadLocalWrites field is set. + */ + @java.lang.Override + public boolean hasDataBoostReadLocalWrites() { + return modeCase_ == 4; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return The dataBoostReadLocalWrites. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDataBoostReadLocalWrites() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4) { + return (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_; + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } else { + if (modeCase_ == 4) { + return dataBoostReadLocalWritesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder setDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites value) { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(value); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder setDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder builderForValue) { + if (dataBoostReadLocalWritesBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder mergeDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites value) { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4 + && mode_ + != com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance()) { + mode_ = + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.newBuilder( + (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 4) { + dataBoostReadLocalWritesBuilder_.mergeFrom(value); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(value); + } + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder clearDataBoostReadLocalWrites() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + } + dataBoostReadLocalWritesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder + getDataBoostReadLocalWritesBuilder() { + return internalGetDataBoostReadLocalWritesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder + getDataBoostReadLocalWritesOrBuilder() { + if ((modeCase_ == 4) && (dataBoostReadLocalWritesBuilder_ != null)) { + return dataBoostReadLocalWritesBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 4) { + return (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_; + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+     * can see all writes committed before the token was created, but only if
+     * the read and write target the same cluster.
+     * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.DataBoostReadLocalWrites, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder, + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder> + internalGetDataBoostReadLocalWritesFieldBuilder() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (!(modeCase_ == 4)) { + mode_ = com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + dataBoostReadLocalWritesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.DataBoostReadLocalWrites, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder, + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder>( + (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 4; + onChanged(); + return dataBoostReadLocalWritesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CheckConsistencyRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CheckConsistencyRequest) + private static final com.google.bigtable.admin.v2.CheckConsistencyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CheckConsistencyRequest(); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckConsistencyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CheckConsistencyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java new file mode 100644 index 000000000000..95dbad6897ab --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CheckConsistencyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CheckConsistencyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the Table for which to check replication
+   * consistency. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 Table for which to check replication
+   * consistency. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The token created using GenerateConsistencyToken for the Table.
+   * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The consistencyToken. + */ + java.lang.String getConsistencyToken(); + + /** + * + * + *
+   * Required. The token created using GenerateConsistencyToken for the Table.
+   * 
+ * + * string consistency_token = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for consistencyToken. + */ + com.google.protobuf.ByteString getConsistencyTokenBytes(); + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return Whether the standardReadRemoteWrites field is set. + */ + boolean hasStandardReadRemoteWrites(); + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + * + * @return The standardReadRemoteWrites. + */ + com.google.bigtable.admin.v2.StandardReadRemoteWrites getStandardReadRemoteWrites(); + + /** + * + * + *
+   * Checks that reads using an app profile with `StandardIsolation` can
+   * see all writes committed before the token was created, even if the
+   * read and write target different clusters.
+   * 
+ * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder + getStandardReadRemoteWritesOrBuilder(); + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return Whether the dataBoostReadLocalWrites field is set. + */ + boolean hasDataBoostReadLocalWrites(); + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return The dataBoostReadLocalWrites. + */ + com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDataBoostReadLocalWrites(); + + /** + * + * + *
+   * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
+   * can see all writes committed before the token was created, but only if
+   * the read and write target the same cluster.
+   * 
+ * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder + getDataBoostReadLocalWritesOrBuilder(); + + com.google.bigtable.admin.v2.CheckConsistencyRequest.ModeCase getModeCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java new file mode 100644 index 000000000000..aa27ddf03570 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java @@ -0,0 +1,510 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyResponse} + */ +@com.google.protobuf.Generated +public final class CheckConsistencyResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CheckConsistencyResponse) + CheckConsistencyResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckConsistencyResponse"); + } + + // Use CheckConsistencyResponse.newBuilder() to construct. + private CheckConsistencyResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CheckConsistencyResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CheckConsistencyResponse.class, + com.google.bigtable.admin.v2.CheckConsistencyResponse.Builder.class); + } + + public static final int CONSISTENT_FIELD_NUMBER = 1; + private boolean consistent_ = false; + + /** + * + * + *
+   * True only if the token is consistent. A token is consistent if replication
+   * has caught up with the restrictions specified in the request.
+   * 
+ * + * bool consistent = 1; + * + * @return The consistent. + */ + @java.lang.Override + public boolean getConsistent() { + return consistent_; + } + + 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 (consistent_ != false) { + output.writeBool(1, consistent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (consistent_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, consistent_); + } + size += getUnknownFields().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.admin.v2.CheckConsistencyResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CheckConsistencyResponse other = + (com.google.bigtable.admin.v2.CheckConsistencyResponse) obj; + + if (getConsistent() != other.getConsistent()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONSISTENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getConsistent()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse 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.admin.v2.CheckConsistencyResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse 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.admin.v2.CheckConsistencyResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CheckConsistencyResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CheckConsistencyResponse) + com.google.bigtable.admin.v2.CheckConsistencyResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CheckConsistencyResponse.class, + com.google.bigtable.admin.v2.CheckConsistencyResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CheckConsistencyResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consistent_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CheckConsistencyResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyResponse build() { + com.google.bigtable.admin.v2.CheckConsistencyResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CheckConsistencyResponse buildPartial() { + com.google.bigtable.admin.v2.CheckConsistencyResponse result = + new com.google.bigtable.admin.v2.CheckConsistencyResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CheckConsistencyResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consistent_ = consistent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CheckConsistencyResponse) { + return mergeFrom((com.google.bigtable.admin.v2.CheckConsistencyResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyResponse other) { + if (other == com.google.bigtable.admin.v2.CheckConsistencyResponse.getDefaultInstance()) + return this; + if (other.getConsistent() != false) { + setConsistent(other.getConsistent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + consistent_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean consistent_; + + /** + * + * + *
+     * True only if the token is consistent. A token is consistent if replication
+     * has caught up with the restrictions specified in the request.
+     * 
+ * + * bool consistent = 1; + * + * @return The consistent. + */ + @java.lang.Override + public boolean getConsistent() { + return consistent_; + } + + /** + * + * + *
+     * True only if the token is consistent. A token is consistent if replication
+     * has caught up with the restrictions specified in the request.
+     * 
+ * + * bool consistent = 1; + * + * @param value The consistent to set. + * @return This builder for chaining. + */ + public Builder setConsistent(boolean value) { + + consistent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * True only if the token is consistent. A token is consistent if replication
+     * has caught up with the restrictions specified in the request.
+     * 
+ * + * bool consistent = 1; + * + * @return This builder for chaining. + */ + public Builder clearConsistent() { + bitField0_ = (bitField0_ & ~0x00000001); + consistent_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CheckConsistencyResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CheckConsistencyResponse) + private static final com.google.bigtable.admin.v2.CheckConsistencyResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CheckConsistencyResponse(); + } + + public static com.google.bigtable.admin.v2.CheckConsistencyResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckConsistencyResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CheckConsistencyResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java new file mode 100644 index 000000000000..c3c94a6805cf --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CheckConsistencyResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CheckConsistencyResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * True only if the token is consistent. A token is consistent if replication
+   * has caught up with the restrictions specified in the request.
+   * 
+ * + * bool consistent = 1; + * + * @return The consistent. + */ + boolean getConsistent(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java new file mode 100644 index 000000000000..a82c231f2dcd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java @@ -0,0 +1,5149 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A resizable group of nodes in a particular cloud location, capable
+ * of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
+ * [Instance][google.bigtable.admin.v2.Instance].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster} + */ +@com.google.protobuf.Generated +public final class Cluster extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster) + ClusterOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Cluster"); + } + + // Use Cluster.newBuilder() to construct. + private Cluster(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Cluster() { + name_ = ""; + location_ = ""; + state_ = 0; + nodeScalingFactor_ = 0; + defaultStorageType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.class, + com.google.bigtable.admin.v2.Cluster.Builder.class); + } + + /** + * + * + *
+   * Possible states of a cluster.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the cluster could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + STATE_NOT_KNOWN(0), + /** + * + * + *
+     * The cluster has been successfully created and is ready to serve requests.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The cluster is currently being created, and may be destroyed
+     * if the creation process encounters an error.
+     * A cluster may not be able to serve requests while being created.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + /** + * + * + *
+     * The cluster is currently being resized, and may revert to its previous
+     * node count if the process encounters an error.
+     * A cluster is still capable of serving requests while being resized,
+     * but may exhibit performance as if its number of allocated nodes is
+     * between the starting and requested states.
+     * 
+ * + * RESIZING = 3; + */ + RESIZING(3), + /** + * + * + *
+     * The cluster has no backing nodes. The data (tables) still
+     * exist, but no operations can be performed on the cluster.
+     * 
+ * + * DISABLED = 4; + */ + DISABLED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + + /** + * + * + *
+     * The state of the cluster could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + public static final int STATE_NOT_KNOWN_VALUE = 0; + + /** + * + * + *
+     * The cluster has been successfully created and is ready to serve requests.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + + /** + * + * + *
+     * The cluster is currently being created, and may be destroyed
+     * if the creation process encounters an error.
+     * A cluster may not be able to serve requests while being created.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + + /** + * + * + *
+     * The cluster is currently being resized, and may revert to its previous
+     * node count if the process encounters an error.
+     * A cluster is still capable of serving requests while being resized,
+     * but may exhibit performance as if its number of allocated nodes is
+     * between the starting and requested states.
+     * 
+ * + * RESIZING = 3; + */ + public static final int RESIZING_VALUE = 3; + + /** + * + * + *
+     * The cluster has no backing nodes. The data (tables) still
+     * exist, but no operations can be performed on the cluster.
+     * 
+ * + * DISABLED = 4; + */ + public static final int DISABLED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_NOT_KNOWN; + case 1: + return READY; + case 2: + return CREATING; + case 3: + return RESIZING; + case 4: + return DISABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.State) + } + + /** + * + * + *
+   * Possible node scaling factors of the clusters. Node scaling delivers better
+   * latency and more throughput by removing node boundaries.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Cluster.NodeScalingFactor} + */ + public enum NodeScalingFactor implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
+     * 
+ * + * NODE_SCALING_FACTOR_UNSPECIFIED = 0; + */ + NODE_SCALING_FACTOR_UNSPECIFIED(0), + /** + * + * + *
+     * The cluster is running with a scaling factor of 1.
+     * 
+ * + * NODE_SCALING_FACTOR_1X = 1; + */ + NODE_SCALING_FACTOR_1X(1), + /** + * + * + *
+     * The cluster is running with a scaling factor of 2.
+     * All node count values must be in increments of 2 with this scaling factor
+     * enabled, otherwise an INVALID_ARGUMENT error will be returned.
+     * 
+ * + * NODE_SCALING_FACTOR_2X = 2; + */ + NODE_SCALING_FACTOR_2X(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "NodeScalingFactor"); + } + + /** + * + * + *
+     * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
+     * 
+ * + * NODE_SCALING_FACTOR_UNSPECIFIED = 0; + */ + public static final int NODE_SCALING_FACTOR_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The cluster is running with a scaling factor of 1.
+     * 
+ * + * NODE_SCALING_FACTOR_1X = 1; + */ + public static final int NODE_SCALING_FACTOR_1X_VALUE = 1; + + /** + * + * + *
+     * The cluster is running with a scaling factor of 2.
+     * All node count values must be in increments of 2 with this scaling factor
+     * enabled, otherwise an INVALID_ARGUMENT error will be returned.
+     * 
+ * + * NODE_SCALING_FACTOR_2X = 2; + */ + public static final int NODE_SCALING_FACTOR_2X_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NodeScalingFactor valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NodeScalingFactor forNumber(int value) { + switch (value) { + case 0: + return NODE_SCALING_FACTOR_UNSPECIFIED; + case 1: + return NODE_SCALING_FACTOR_1X; + case 2: + return NODE_SCALING_FACTOR_2X; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NodeScalingFactor findValueByNumber(int number) { + return NodeScalingFactor.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(1); + } + + private static final NodeScalingFactor[] VALUES = values(); + + public static NodeScalingFactor valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NodeScalingFactor(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.NodeScalingFactor) + } + + public interface ClusterAutoscalingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingLimits field is set. + */ + boolean hasAutoscalingLimits(); + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingLimits. + */ + com.google.bigtable.admin.v2.AutoscalingLimits getAutoscalingLimits(); + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder getAutoscalingLimitsOrBuilder(); + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingTargets field is set. + */ + boolean hasAutoscalingTargets(); + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingTargets. + */ + com.google.bigtable.admin.v2.AutoscalingTargets getAutoscalingTargets(); + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder getAutoscalingTargetsOrBuilder(); + } + + /** + * + * + *
+   * Autoscaling config for a cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} + */ + public static final class ClusterAutoscalingConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + ClusterAutoscalingConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClusterAutoscalingConfig"); + } + + // Use ClusterAutoscalingConfig.newBuilder() to construct. + private ClusterAutoscalingConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClusterAutoscalingConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.class, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder.class); + } + + private int bitField0_; + public static final int AUTOSCALING_LIMITS_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.AutoscalingLimits autoscalingLimits_; + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingLimits field is set. + */ + @java.lang.Override + public boolean hasAutoscalingLimits() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingLimits. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingLimits getAutoscalingLimits() { + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; + } + + /** + * + * + *
+     * Required. Autoscaling limits for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder getAutoscalingLimitsOrBuilder() { + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; + } + + public static final int AUTOSCALING_TARGETS_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.AutoscalingTargets autoscalingTargets_; + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingTargets field is set. + */ + @java.lang.Override + public boolean hasAutoscalingTargets() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingTargets. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingTargets getAutoscalingTargets() { + return autoscalingTargets_ == null + ? com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance() + : autoscalingTargets_; + } + + /** + * + * + *
+     * Required. Autoscaling targets for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder + getAutoscalingTargetsOrBuilder() { + return autoscalingTargets_ == null + ? com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance() + : autoscalingTargets_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAutoscalingLimits()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getAutoscalingTargets()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAutoscalingLimits()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAutoscalingTargets()); + } + size += getUnknownFields().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.admin.v2.Cluster.ClusterAutoscalingConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig other = + (com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) obj; + + if (hasAutoscalingLimits() != other.hasAutoscalingLimits()) return false; + if (hasAutoscalingLimits()) { + if (!getAutoscalingLimits().equals(other.getAutoscalingLimits())) return false; + } + if (hasAutoscalingTargets() != other.hasAutoscalingTargets()) return false; + if (hasAutoscalingTargets()) { + if (!getAutoscalingTargets().equals(other.getAutoscalingTargets())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAutoscalingLimits()) { + hash = (37 * hash) + AUTOSCALING_LIMITS_FIELD_NUMBER; + hash = (53 * hash) + getAutoscalingLimits().hashCode(); + } + if (hasAutoscalingTargets()) { + hash = (37 * hash) + AUTOSCALING_TARGETS_FIELD_NUMBER; + hash = (53 * hash) + getAutoscalingTargets().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig 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.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig 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.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Cluster.ClusterAutoscalingConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Autoscaling config for a cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.class, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAutoscalingLimitsFieldBuilder(); + internalGetAutoscalingTargetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + autoscalingLimits_ = null; + if (autoscalingLimitsBuilder_ != null) { + autoscalingLimitsBuilder_.dispose(); + autoscalingLimitsBuilder_ = null; + } + autoscalingTargets_ = null; + if (autoscalingTargetsBuilder_ != null) { + autoscalingTargetsBuilder_.dispose(); + autoscalingTargetsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig build() { + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig buildPartial() { + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig result = + new com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.autoscalingLimits_ = + autoscalingLimitsBuilder_ == null + ? autoscalingLimits_ + : autoscalingLimitsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.autoscalingTargets_ = + autoscalingTargetsBuilder_ == null + ? autoscalingTargets_ + : autoscalingTargetsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) { + return mergeFrom((com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig other) { + if (other + == com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance()) + return this; + if (other.hasAutoscalingLimits()) { + mergeAutoscalingLimits(other.getAutoscalingLimits()); + } + if (other.hasAutoscalingTargets()) { + mergeAutoscalingTargets(other.getAutoscalingTargets()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetAutoscalingLimitsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetAutoscalingTargetsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.AutoscalingLimits autoscalingLimits_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingLimits, + com.google.bigtable.admin.v2.AutoscalingLimits.Builder, + com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder> + autoscalingLimitsBuilder_; + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingLimits field is set. + */ + public boolean hasAutoscalingLimits() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingLimits. + */ + public com.google.bigtable.admin.v2.AutoscalingLimits getAutoscalingLimits() { + if (autoscalingLimitsBuilder_ == null) { + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; + } else { + return autoscalingLimitsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAutoscalingLimits(com.google.bigtable.admin.v2.AutoscalingLimits value) { + if (autoscalingLimitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autoscalingLimits_ = value; + } else { + autoscalingLimitsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAutoscalingLimits( + com.google.bigtable.admin.v2.AutoscalingLimits.Builder builderForValue) { + if (autoscalingLimitsBuilder_ == null) { + autoscalingLimits_ = builderForValue.build(); + } else { + autoscalingLimitsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAutoscalingLimits(com.google.bigtable.admin.v2.AutoscalingLimits value) { + if (autoscalingLimitsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && autoscalingLimits_ != null + && autoscalingLimits_ + != com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance()) { + getAutoscalingLimitsBuilder().mergeFrom(value); + } else { + autoscalingLimits_ = value; + } + } else { + autoscalingLimitsBuilder_.mergeFrom(value); + } + if (autoscalingLimits_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAutoscalingLimits() { + bitField0_ = (bitField0_ & ~0x00000001); + autoscalingLimits_ = null; + if (autoscalingLimitsBuilder_ != null) { + autoscalingLimitsBuilder_.dispose(); + autoscalingLimitsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AutoscalingLimits.Builder getAutoscalingLimitsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAutoscalingLimitsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder + getAutoscalingLimitsOrBuilder() { + if (autoscalingLimitsBuilder_ != null) { + return autoscalingLimitsBuilder_.getMessageOrBuilder(); + } else { + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; + } + } + + /** + * + * + *
+       * Required. Autoscaling limits for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingLimits, + com.google.bigtable.admin.v2.AutoscalingLimits.Builder, + com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder> + internalGetAutoscalingLimitsFieldBuilder() { + if (autoscalingLimitsBuilder_ == null) { + autoscalingLimitsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingLimits, + com.google.bigtable.admin.v2.AutoscalingLimits.Builder, + com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder>( + getAutoscalingLimits(), getParentForChildren(), isClean()); + autoscalingLimits_ = null; + } + return autoscalingLimitsBuilder_; + } + + private com.google.bigtable.admin.v2.AutoscalingTargets autoscalingTargets_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingTargets, + com.google.bigtable.admin.v2.AutoscalingTargets.Builder, + com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder> + autoscalingTargetsBuilder_; + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the autoscalingTargets field is set. + */ + public boolean hasAutoscalingTargets() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The autoscalingTargets. + */ + public com.google.bigtable.admin.v2.AutoscalingTargets getAutoscalingTargets() { + if (autoscalingTargetsBuilder_ == null) { + return autoscalingTargets_ == null + ? com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance() + : autoscalingTargets_; + } else { + return autoscalingTargetsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAutoscalingTargets(com.google.bigtable.admin.v2.AutoscalingTargets value) { + if (autoscalingTargetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autoscalingTargets_ = value; + } else { + autoscalingTargetsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAutoscalingTargets( + com.google.bigtable.admin.v2.AutoscalingTargets.Builder builderForValue) { + if (autoscalingTargetsBuilder_ == null) { + autoscalingTargets_ = builderForValue.build(); + } else { + autoscalingTargetsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAutoscalingTargets( + com.google.bigtable.admin.v2.AutoscalingTargets value) { + if (autoscalingTargetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && autoscalingTargets_ != null + && autoscalingTargets_ + != com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance()) { + getAutoscalingTargetsBuilder().mergeFrom(value); + } else { + autoscalingTargets_ = value; + } + } else { + autoscalingTargetsBuilder_.mergeFrom(value); + } + if (autoscalingTargets_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAutoscalingTargets() { + bitField0_ = (bitField0_ & ~0x00000002); + autoscalingTargets_ = null; + if (autoscalingTargetsBuilder_ != null) { + autoscalingTargetsBuilder_.dispose(); + autoscalingTargetsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AutoscalingTargets.Builder + getAutoscalingTargetsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAutoscalingTargetsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder + getAutoscalingTargetsOrBuilder() { + if (autoscalingTargetsBuilder_ != null) { + return autoscalingTargetsBuilder_.getMessageOrBuilder(); + } else { + return autoscalingTargets_ == null + ? com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance() + : autoscalingTargets_; + } + } + + /** + * + * + *
+       * Required. Autoscaling targets for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingTargets, + com.google.bigtable.admin.v2.AutoscalingTargets.Builder, + com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder> + internalGetAutoscalingTargetsFieldBuilder() { + if (autoscalingTargetsBuilder_ == null) { + autoscalingTargetsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AutoscalingTargets, + com.google.bigtable.admin.v2.AutoscalingTargets.Builder, + com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder>( + getAutoscalingTargets(), getParentForChildren(), isClean()); + autoscalingTargets_ = null; + } + return autoscalingTargetsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) + private static final com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterAutoscalingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Cluster.ClusterAutoscalingConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ClusterConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.ClusterConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return Whether the clusterAutoscalingConfig field is set. + */ + boolean hasClusterAutoscalingConfig(); + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return The clusterAutoscalingConfig. + */ + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig getClusterAutoscalingConfig(); + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder + getClusterAutoscalingConfigOrBuilder(); + } + + /** + * + * + *
+   * Configuration for a cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterConfig} + */ + public static final class ClusterConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster.ClusterConfig) + ClusterConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClusterConfig"); + } + + // Use ClusterConfig.newBuilder() to construct. + private ClusterConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClusterConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.class, + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder.class); + } + + private int bitField0_; + public static final int CLUSTER_AUTOSCALING_CONFIG_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig clusterAutoscalingConfig_; + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return Whether the clusterAutoscalingConfig field is set. + */ + @java.lang.Override + public boolean hasClusterAutoscalingConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return The clusterAutoscalingConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + getClusterAutoscalingConfig() { + return clusterAutoscalingConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance() + : clusterAutoscalingConfig_; + } + + /** + * + * + *
+     * Autoscaling configuration for this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder + getClusterAutoscalingConfigOrBuilder() { + return clusterAutoscalingConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance() + : clusterAutoscalingConfig_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getClusterAutoscalingConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getClusterAutoscalingConfig()); + } + size += getUnknownFields().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.admin.v2.Cluster.ClusterConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Cluster.ClusterConfig other = + (com.google.bigtable.admin.v2.Cluster.ClusterConfig) obj; + + if (hasClusterAutoscalingConfig() != other.hasClusterAutoscalingConfig()) return false; + if (hasClusterAutoscalingConfig()) { + if (!getClusterAutoscalingConfig().equals(other.getClusterAutoscalingConfig())) + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasClusterAutoscalingConfig()) { + hash = (37 * hash) + CLUSTER_AUTOSCALING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getClusterAutoscalingConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig 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.admin.v2.Cluster.ClusterConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig 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.admin.v2.Cluster.ClusterConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Cluster.ClusterConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Configuration for a cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Cluster.ClusterConfig) + com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.class, + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterAutoscalingConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clusterAutoscalingConfig_ = null; + if (clusterAutoscalingConfigBuilder_ != null) { + clusterAutoscalingConfigBuilder_.dispose(); + clusterAutoscalingConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfig getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfig build() { + com.google.bigtable.admin.v2.Cluster.ClusterConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfig buildPartial() { + com.google.bigtable.admin.v2.Cluster.ClusterConfig result = + new com.google.bigtable.admin.v2.Cluster.ClusterConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Cluster.ClusterConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clusterAutoscalingConfig_ = + clusterAutoscalingConfigBuilder_ == null + ? clusterAutoscalingConfig_ + : clusterAutoscalingConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Cluster.ClusterConfig) { + return mergeFrom((com.google.bigtable.admin.v2.Cluster.ClusterConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster.ClusterConfig other) { + if (other == com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance()) + return this; + if (other.hasClusterAutoscalingConfig()) { + mergeClusterAutoscalingConfig(other.getClusterAutoscalingConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetClusterAutoscalingConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + clusterAutoscalingConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder> + clusterAutoscalingConfigBuilder_; + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return Whether the clusterAutoscalingConfig field is set. + */ + public boolean hasClusterAutoscalingConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + * + * @return The clusterAutoscalingConfig. + */ + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + getClusterAutoscalingConfig() { + if (clusterAutoscalingConfigBuilder_ == null) { + return clusterAutoscalingConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance() + : clusterAutoscalingConfig_; + } else { + return clusterAutoscalingConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public Builder setClusterAutoscalingConfig( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig value) { + if (clusterAutoscalingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterAutoscalingConfig_ = value; + } else { + clusterAutoscalingConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public Builder setClusterAutoscalingConfig( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder builderForValue) { + if (clusterAutoscalingConfigBuilder_ == null) { + clusterAutoscalingConfig_ = builderForValue.build(); + } else { + clusterAutoscalingConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public Builder mergeClusterAutoscalingConfig( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig value) { + if (clusterAutoscalingConfigBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && clusterAutoscalingConfig_ != null + && clusterAutoscalingConfig_ + != com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + .getDefaultInstance()) { + getClusterAutoscalingConfigBuilder().mergeFrom(value); + } else { + clusterAutoscalingConfig_ = value; + } + } else { + clusterAutoscalingConfigBuilder_.mergeFrom(value); + } + if (clusterAutoscalingConfig_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public Builder clearClusterAutoscalingConfig() { + bitField0_ = (bitField0_ & ~0x00000001); + clusterAutoscalingConfig_ = null; + if (clusterAutoscalingConfigBuilder_ != null) { + clusterAutoscalingConfigBuilder_.dispose(); + clusterAutoscalingConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder + getClusterAutoscalingConfigBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetClusterAutoscalingConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder + getClusterAutoscalingConfigOrBuilder() { + if (clusterAutoscalingConfigBuilder_ != null) { + return clusterAutoscalingConfigBuilder_.getMessageOrBuilder(); + } else { + return clusterAutoscalingConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance() + : clusterAutoscalingConfig_; + } + } + + /** + * + * + *
+       * Autoscaling configuration for this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig cluster_autoscaling_config = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder> + internalGetClusterAutoscalingConfigFieldBuilder() { + if (clusterAutoscalingConfigBuilder_ == null) { + clusterAutoscalingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder>( + getClusterAutoscalingConfig(), getParentForChildren(), isClean()); + clusterAutoscalingConfig_ = null; + } + return clusterAutoscalingConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster.ClusterConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Cluster.ClusterConfig) + private static final com.google.bigtable.admin.v2.Cluster.ClusterConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster.ClusterConfig(); + } + + public static com.google.bigtable.admin.v2.Cluster.ClusterConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Cluster.ClusterConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EncryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.EncryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     * 1) The Cloud Bigtable service account associated with the project that
+     * contains this cluster must be granted the
+     * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     * 2) Only regional keys can be used and the region of the CMEK key must
+     * match the region of the cluster.
+     * Values are of the form
+     * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     * 1) The Cloud Bigtable service account associated with the project that
+     * contains this cluster must be granted the
+     * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     * 2) Only regional keys can be used and the region of the CMEK key must
+     * match the region of the cluster.
+     * Values are of the form
+     * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + } + + /** + * + * + *
+   * Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
+   * cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.EncryptionConfig} + */ + public static final class EncryptionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster.EncryptionConfig) + EncryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EncryptionConfig"); + } + + // Use EncryptionConfig.newBuilder() to construct. + private EncryptionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EncryptionConfig() { + kmsKeyName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.class, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     * 1) The Cloud Bigtable service account associated with the project that
+     * contains this cluster must be granted the
+     * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     * 2) Only regional keys can be used and the region of the CMEK key must
+     * match the region of the cluster.
+     * Values are of the form
+     * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     * 1) The Cloud Bigtable service account associated with the project that
+     * contains this cluster must be granted the
+     * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     * 2) Only regional keys can be used and the region of the CMEK key must
+     * match the region of the cluster.
+     * Values are of the form
+     * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = 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.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kmsKeyName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kmsKeyName_); + } + size += getUnknownFields().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.admin.v2.Cluster.EncryptionConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Cluster.EncryptionConfig other = + (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig 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.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig 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.admin.v2.Cluster.EncryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Cluster.EncryptionConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
+     * cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.EncryptionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Cluster.EncryptionConfig) + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.class, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Cluster.EncryptionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig build() { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig buildPartial() { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig result = + new com.google.bigtable.admin.v2.Cluster.EncryptionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Cluster.EncryptionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Cluster.EncryptionConfig) { + return mergeFrom((com.google.bigtable.admin.v2.Cluster.EncryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster.EncryptionConfig other) { + if (other == com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       * 1) The Cloud Bigtable service account associated with the project that
+       * contains this cluster must be granted the
+       * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       * 2) Only regional keys can be used and the region of the CMEK key must
+       * match the region of the cluster.
+       * Values are of the form
+       * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       * 1) The Cloud Bigtable service account associated with the project that
+       * contains this cluster must be granted the
+       * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       * 2) Only regional keys can be used and the region of the CMEK key must
+       * match the region of the cluster.
+       * Values are of the form
+       * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       * 1) The Cloud Bigtable service account associated with the project that
+       * contains this cluster must be granted the
+       * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       * 2) Only regional keys can be used and the region of the CMEK key must
+       * match the region of the cluster.
+       * Values are of the form
+       * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       * 1) The Cloud Bigtable service account associated with the project that
+       * contains this cluster must be granted the
+       * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       * 2) Only regional keys can be used and the region of the CMEK key must
+       * match the region of the cluster.
+       * Values are of the form
+       * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       * 1) The Cloud Bigtable service account associated with the project that
+       * contains this cluster must be granted the
+       * `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       * 2) Only regional keys can be used and the region of the CMEK key must
+       * match the region of the cluster.
+       * Values are of the form
+       * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster.EncryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Cluster.EncryptionConfig) + private static final com.google.bigtable.admin.v2.Cluster.EncryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int configCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object config_; + + public enum ConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CLUSTER_CONFIG(7), + CONFIG_NOT_SET(0); + private final int value; + + private ConfigCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 7: + return CLUSTER_CONFIG; + case 0: + return CONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @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 LOCATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Immutable. The location where this cluster's nodes and storage reside. For
+   * best performance, clients should be located as close as possible to this
+   * cluster. Currently only zones are supported, so values should be of the
+   * form `projects/{project}/locations/{zone}`.
+   * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Immutable. The location where this cluster's nodes and storage reside. For
+   * best performance, clients should be located as close as possible to this
+   * cluster. Currently only zones are supported, so values should be of the
+   * form `projects/{project}/locations/{zone}`.
+   * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The current state of the cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The current state of the cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.State getState() { + com.google.bigtable.admin.v2.Cluster.State result = + com.google.bigtable.admin.v2.Cluster.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Cluster.State.UNRECOGNIZED : result; + } + + public static final int SERVE_NODES_FIELD_NUMBER = 4; + private int serveNodes_ = 0; + + /** + * + * + *
+   * The number of nodes in the cluster. If no value is set,
+   * Cloud Bigtable automatically allocates nodes based on your data footprint
+   * and optimized for 50% storage utilization.
+   * 
+ * + * int32 serve_nodes = 4; + * + * @return The serveNodes. + */ + @java.lang.Override + public int getServeNodes() { + return serveNodes_; + } + + public static final int NODE_SCALING_FACTOR_FIELD_NUMBER = 9; + private int nodeScalingFactor_ = 0; + + /** + * + * + *
+   * Immutable. The node scaling factor of this cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeScalingFactor. + */ + @java.lang.Override + public int getNodeScalingFactorValue() { + return nodeScalingFactor_; + } + + /** + * + * + *
+   * Immutable. The node scaling factor of this cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeScalingFactor. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.NodeScalingFactor getNodeScalingFactor() { + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor result = + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.forNumber(nodeScalingFactor_); + return result == null + ? com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.UNRECOGNIZED + : result; + } + + public static final int CLUSTER_CONFIG_FIELD_NUMBER = 7; + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return Whether the clusterConfig field is set. + */ + @java.lang.Override + public boolean hasClusterConfig() { + return configCase_ == 7; + } + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return The clusterConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfig getClusterConfig() { + if (configCase_ == 7) { + return (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_; + } + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterConfigOrBuilder() { + if (configCase_ == 7) { + return (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_; + } + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + + public static final int DEFAULT_STORAGE_TYPE_FIELD_NUMBER = 5; + private int defaultStorageType_ = 0; + + /** + * + * + *
+   * Immutable. The type of storage used by this cluster to serve its
+   * parent instance's tables, unless explicitly overridden.
+   * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for defaultStorageType. + */ + @java.lang.Override + public int getDefaultStorageTypeValue() { + return defaultStorageType_; + } + + /** + * + * + *
+   * Immutable. The type of storage used by this cluster to serve its
+   * parent instance's tables, unless explicitly overridden.
+   * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The defaultStorageType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StorageType getDefaultStorageType() { + com.google.bigtable.admin.v2.StorageType result = + com.google.bigtable.admin.v2.StorageType.forNumber(defaultStorageType_); + return result == null ? com.google.bigtable.admin.v2.StorageType.UNRECOGNIZED : result; + } + + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 6; + private com.google.bigtable.admin.v2.Cluster.EncryptionConfig encryptionConfig_; + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, location_); + } + if (state_ != com.google.bigtable.admin.v2.Cluster.State.STATE_NOT_KNOWN.getNumber()) { + output.writeEnum(3, state_); + } + if (serveNodes_ != 0) { + output.writeInt32(4, serveNodes_); + } + if (defaultStorageType_ + != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, defaultStorageType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getEncryptionConfig()); + } + if (configCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_); + } + if (nodeScalingFactor_ + != com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.NODE_SCALING_FACTOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, nodeScalingFactor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, location_); + } + if (state_ != com.google.bigtable.admin.v2.Cluster.State.STATE_NOT_KNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (serveNodes_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, serveNodes_); + } + if (defaultStorageType_ + != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, defaultStorageType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEncryptionConfig()); + } + if (configCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_); + } + if (nodeScalingFactor_ + != com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.NODE_SCALING_FACTOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, nodeScalingFactor_); + } + size += getUnknownFields().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.admin.v2.Cluster)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Cluster other = (com.google.bigtable.admin.v2.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (state_ != other.state_) return false; + if (getServeNodes() != other.getServeNodes()) return false; + if (nodeScalingFactor_ != other.nodeScalingFactor_) return false; + if (defaultStorageType_ != other.defaultStorageType_) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } + if (!getConfigCase().equals(other.getConfigCase())) return false; + switch (configCase_) { + case 7: + if (!getClusterConfig().equals(other.getClusterConfig())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + SERVE_NODES_FIELD_NUMBER; + hash = (53 * hash) + getServeNodes(); + hash = (37 * hash) + NODE_SCALING_FACTOR_FIELD_NUMBER; + hash = (53 * hash) + nodeScalingFactor_; + hash = (37 * hash) + DEFAULT_STORAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + defaultStorageType_; + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } + switch (configCase_) { + case 7: + hash = (37 * hash) + CLUSTER_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getClusterConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster 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.admin.v2.Cluster parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster 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.admin.v2.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Cluster 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A resizable group of nodes in a particular cloud location, capable
+   * of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
+   * [Instance][google.bigtable.admin.v2.Instance].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Cluster) + com.google.bigtable.admin.v2.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.class, + com.google.bigtable.admin.v2.Cluster.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Cluster.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncryptionConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + location_ = ""; + state_ = 0; + serveNodes_ = 0; + nodeScalingFactor_ = 0; + if (clusterConfigBuilder_ != null) { + clusterConfigBuilder_.clear(); + } + defaultStorageType_ = 0; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + configCase_ = 0; + config_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster build() { + com.google.bigtable.admin.v2.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster buildPartial() { + com.google.bigtable.admin.v2.Cluster result = new com.google.bigtable.admin.v2.Cluster(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.serveNodes_ = serveNodes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.nodeScalingFactor_ = nodeScalingFactor_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.defaultStorageType_ = defaultStorageType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.encryptionConfig_ = + encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Cluster result) { + result.configCase_ = configCase_; + result.config_ = this.config_; + if (configCase_ == 7 && clusterConfigBuilder_ != null) { + result.config_ = clusterConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Cluster) { + return mergeFrom((com.google.bigtable.admin.v2.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster other) { + if (other == com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.getServeNodes() != 0) { + setServeNodes(other.getServeNodes()); + } + if (other.nodeScalingFactor_ != 0) { + setNodeScalingFactorValue(other.getNodeScalingFactorValue()); + } + if (other.defaultStorageType_ != 0) { + setDefaultStorageTypeValue(other.getDefaultStorageTypeValue()); + } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } + switch (other.getConfigCase()) { + case CLUSTER_CONFIG: + { + mergeClusterConfig(other.getClusterConfig()); + break; + } + case CONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + serveNodes_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + defaultStorageType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 40 + case 50: + { + input.readMessage( + internalGetEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetClusterConfigFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 7; + break; + } // case 58 + case 72: + { + nodeScalingFactor_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public Builder clearConfig() { + configCase_ = 0; + config_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Immutable. The location where this cluster's nodes and storage reside. For
+     * best performance, clients should be located as close as possible to this
+     * cluster. Currently only zones are supported, so values should be of the
+     * form `projects/{project}/locations/{zone}`.
+     * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Immutable. The location where this cluster's nodes and storage reside. For
+     * best performance, clients should be located as close as possible to this
+     * cluster. Currently only zones are supported, so values should be of the
+     * form `projects/{project}/locations/{zone}`.
+     * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Immutable. The location where this cluster's nodes and storage reside. For
+     * best performance, clients should be located as close as possible to this
+     * cluster. Currently only zones are supported, so values should be of the
+     * form `projects/{project}/locations/{zone}`.
+     * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The location where this cluster's nodes and storage reside. For
+     * best performance, clients should be located as close as possible to this
+     * cluster. Currently only zones are supported, so values should be of the
+     * form `projects/{project}/locations/{zone}`.
+     * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The location where this cluster's nodes and storage reside. For
+     * best performance, clients should be located as close as possible to this
+     * cluster. Currently only zones are supported, so values should be of the
+     * form `projects/{project}/locations/{zone}`.
+     * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The current state of the cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.State getState() { + com.google.bigtable.admin.v2.Cluster.State result = + com.google.bigtable.admin.v2.Cluster.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Cluster.State.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The current state of the cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.bigtable.admin.v2.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private int serveNodes_; + + /** + * + * + *
+     * The number of nodes in the cluster. If no value is set,
+     * Cloud Bigtable automatically allocates nodes based on your data footprint
+     * and optimized for 50% storage utilization.
+     * 
+ * + * int32 serve_nodes = 4; + * + * @return The serveNodes. + */ + @java.lang.Override + public int getServeNodes() { + return serveNodes_; + } + + /** + * + * + *
+     * The number of nodes in the cluster. If no value is set,
+     * Cloud Bigtable automatically allocates nodes based on your data footprint
+     * and optimized for 50% storage utilization.
+     * 
+ * + * int32 serve_nodes = 4; + * + * @param value The serveNodes to set. + * @return This builder for chaining. + */ + public Builder setServeNodes(int value) { + + serveNodes_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The number of nodes in the cluster. If no value is set,
+     * Cloud Bigtable automatically allocates nodes based on your data footprint
+     * and optimized for 50% storage utilization.
+     * 
+ * + * int32 serve_nodes = 4; + * + * @return This builder for chaining. + */ + public Builder clearServeNodes() { + bitField0_ = (bitField0_ & ~0x00000008); + serveNodes_ = 0; + onChanged(); + return this; + } + + private int nodeScalingFactor_ = 0; + + /** + * + * + *
+     * Immutable. The node scaling factor of this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeScalingFactor. + */ + @java.lang.Override + public int getNodeScalingFactorValue() { + return nodeScalingFactor_; + } + + /** + * + * + *
+     * Immutable. The node scaling factor of this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for nodeScalingFactor to set. + * @return This builder for chaining. + */ + public Builder setNodeScalingFactorValue(int value) { + nodeScalingFactor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The node scaling factor of this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeScalingFactor. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.NodeScalingFactor getNodeScalingFactor() { + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor result = + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.forNumber(nodeScalingFactor_); + return result == null + ? com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Immutable. The node scaling factor of this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nodeScalingFactor to set. + * @return This builder for chaining. + */ + public Builder setNodeScalingFactor( + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + nodeScalingFactor_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The node scaling factor of this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNodeScalingFactor() { + bitField0_ = (bitField0_ & ~0x00000010); + nodeScalingFactor_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterConfig, + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder> + clusterConfigBuilder_; + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return Whether the clusterConfig field is set. + */ + @java.lang.Override + public boolean hasClusterConfig() { + return configCase_ == 7; + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return The clusterConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfig getClusterConfig() { + if (clusterConfigBuilder_ == null) { + if (configCase_ == 7) { + return (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_; + } + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } else { + if (configCase_ == 7) { + return clusterConfigBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + public Builder setClusterConfig(com.google.bigtable.admin.v2.Cluster.ClusterConfig value) { + if (clusterConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + clusterConfigBuilder_.setMessage(value); + } + configCase_ = 7; + return this; + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + public Builder setClusterConfig( + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder builderForValue) { + if (clusterConfigBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + clusterConfigBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 7; + return this; + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + public Builder mergeClusterConfig(com.google.bigtable.admin.v2.Cluster.ClusterConfig value) { + if (clusterConfigBuilder_ == null) { + if (configCase_ == 7 + && config_ != com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance()) { + config_ = + com.google.bigtable.admin.v2.Cluster.ClusterConfig.newBuilder( + (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 7) { + clusterConfigBuilder_.mergeFrom(value); + } else { + clusterConfigBuilder_.setMessage(value); + } + } + configCase_ = 7; + return this; + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + public Builder clearClusterConfig() { + if (clusterConfigBuilder_ == null) { + if (configCase_ == 7) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 7) { + configCase_ = 0; + config_ = null; + } + clusterConfigBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + public com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder getClusterConfigBuilder() { + return internalGetClusterConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterConfigOrBuilder() { + if ((configCase_ == 7) && (clusterConfigBuilder_ != null)) { + return clusterConfigBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 7) { + return (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_; + } + return com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Configuration for this cluster.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterConfig, + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder> + internalGetClusterConfigFieldBuilder() { + if (clusterConfigBuilder_ == null) { + if (!(configCase_ == 7)) { + config_ = com.google.bigtable.admin.v2.Cluster.ClusterConfig.getDefaultInstance(); + } + clusterConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.ClusterConfig, + com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder, + com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder>( + (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 7; + onChanged(); + return clusterConfigBuilder_; + } + + private int defaultStorageType_ = 0; + + /** + * + * + *
+     * Immutable. The type of storage used by this cluster to serve its
+     * parent instance's tables, unless explicitly overridden.
+     * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for defaultStorageType. + */ + @java.lang.Override + public int getDefaultStorageTypeValue() { + return defaultStorageType_; + } + + /** + * + * + *
+     * Immutable. The type of storage used by this cluster to serve its
+     * parent instance's tables, unless explicitly overridden.
+     * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for defaultStorageType to set. + * @return This builder for chaining. + */ + public Builder setDefaultStorageTypeValue(int value) { + defaultStorageType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The type of storage used by this cluster to serve its
+     * parent instance's tables, unless explicitly overridden.
+     * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The defaultStorageType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StorageType getDefaultStorageType() { + com.google.bigtable.admin.v2.StorageType result = + com.google.bigtable.admin.v2.StorageType.forNumber(defaultStorageType_); + return result == null ? com.google.bigtable.admin.v2.StorageType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Immutable. The type of storage used by this cluster to serve its
+     * parent instance's tables, unless explicitly overridden.
+     * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The defaultStorageType to set. + * @return This builder for chaining. + */ + public Builder setDefaultStorageType(com.google.bigtable.admin.v2.StorageType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + defaultStorageType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The type of storage used by this cluster to serve its
+     * parent instance's tables, unless explicitly overridden.
+     * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearDefaultStorageType() { + bitField0_ = (bitField0_ & ~0x00000040); + defaultStorageType_ = 0; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Cluster.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + } else { + encryptionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); + } else { + encryptionConfig_ = value; + } + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + if (encryptionConfig_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearEncryptionConfig() { + bitField0_ = (bitField0_ & ~0x00000080); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); + encryptionConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder + getEncryptionConfigBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetEncryptionConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder> + internalGetEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Cluster) + private static final com.google.bigtable.admin.v2.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster(); + } + + public static com.google.bigtable.admin.v2.Cluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java new file mode 100644 index 000000000000..52f98c06f406 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2026 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.admin.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 ClusterName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_CLUSTER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/clusters/{cluster}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String cluster; + + @Deprecated + protected ClusterName() { + project = null; + instance = null; + cluster = null; + } + + private ClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClusterName of(String project, String instance, String cluster) { + return newBuilder().setProject(project).setInstance(instance).setCluster(cluster).build(); + } + + public static String format(String project, String instance, String cluster) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setCluster(cluster) + .build() + .toString(); + } + + public static ClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_CLUSTER.validatedMatch( + formattedString, "ClusterName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("cluster")); + } + + 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 (ClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_CLUSTER.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); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_CLUSTER.instantiate( + "project", project, "instance", instance, "cluster", cluster); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ClusterName that = ((ClusterName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.cluster, that.cluster); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(cluster); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/clusters/{cluster}. */ + public static class Builder { + private String project; + private String instance; + private String cluster; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + private Builder(ClusterName clusterName) { + this.project = clusterName.project; + this.instance = clusterName.instance; + this.cluster = clusterName.cluster; + } + + public ClusterName build() { + return new ClusterName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java new file mode 100644 index 000000000000..627d2af276c3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java @@ -0,0 +1,281 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The location where this cluster's nodes and storage reside. For
+   * best performance, clients should be located as close as possible to this
+   * cluster. Currently only zones are supported, so values should be of the
+   * form `projects/{project}/locations/{zone}`.
+   * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Immutable. The location where this cluster's nodes and storage reside. For
+   * best performance, clients should be located as close as possible to this
+   * cluster. Currently only zones are supported, so values should be of the
+   * form `projects/{project}/locations/{zone}`.
+   * 
+ * + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. The current state of the cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The current state of the cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.bigtable.admin.v2.Cluster.State getState(); + + /** + * + * + *
+   * The number of nodes in the cluster. If no value is set,
+   * Cloud Bigtable automatically allocates nodes based on your data footprint
+   * and optimized for 50% storage utilization.
+   * 
+ * + * int32 serve_nodes = 4; + * + * @return The serveNodes. + */ + int getServeNodes(); + + /** + * + * + *
+   * Immutable. The node scaling factor of this cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeScalingFactor. + */ + int getNodeScalingFactorValue(); + + /** + * + * + *
+   * Immutable. The node scaling factor of this cluster.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeScalingFactor. + */ + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor getNodeScalingFactor(); + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return Whether the clusterConfig field is set. + */ + boolean hasClusterConfig(); + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + * + * @return The clusterConfig. + */ + com.google.bigtable.admin.v2.Cluster.ClusterConfig getClusterConfig(); + + /** + * + * + *
+   * Configuration for this cluster.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; + */ + com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterConfigOrBuilder(); + + /** + * + * + *
+   * Immutable. The type of storage used by this cluster to serve its
+   * parent instance's tables, unless explicitly overridden.
+   * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for defaultStorageType. + */ + int getDefaultStorageTypeValue(); + + /** + * + * + *
+   * Immutable. The type of storage used by this cluster to serve its
+   * parent instance's tables, unless explicitly overridden.
+   * 
+ * + * + * .google.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The defaultStorageType. + */ + com.google.bigtable.admin.v2.StorageType getDefaultStorageType(); + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig(); + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + com.google.bigtable.admin.v2.Cluster.ConfigCase getConfigCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java new file mode 100644 index 000000000000..370ad98c4934 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A set of columns within a table which share a common configuration.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ColumnFamily} + */ +@com.google.protobuf.Generated +public final class ColumnFamily extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ColumnFamily) + ColumnFamilyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ColumnFamily"); + } + + // Use ColumnFamily.newBuilder() to construct. + private ColumnFamily(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ColumnFamily() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ColumnFamily.class, + com.google.bigtable.admin.v2.ColumnFamily.Builder.class); + } + + private int bitField0_; + public static final int GC_RULE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.GcRule gcRule_; + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return Whether the gcRule field is set. + */ + @java.lang.Override + public boolean hasGcRule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return The gcRule. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule getGcRule() { + return gcRule_ == null ? com.google.bigtable.admin.v2.GcRule.getDefaultInstance() : gcRule_; + } + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() { + return gcRule_ == null ? com.google.bigtable.admin.v2.GcRule.getDefaultInstance() : gcRule_; + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.Type valueType_; + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return Whether the valueType field is set. + */ + @java.lang.Override + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getValueType() { + return valueType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : valueType_; + } + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() { + return valueType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : valueType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getGcRule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getValueType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcRule()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getValueType()); + } + size += getUnknownFields().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.admin.v2.ColumnFamily)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ColumnFamily other = + (com.google.bigtable.admin.v2.ColumnFamily) obj; + + if (hasGcRule() != other.hasGcRule()) return false; + if (hasGcRule()) { + if (!getGcRule().equals(other.getGcRule())) return false; + } + if (hasValueType() != other.hasValueType()) return false; + if (hasValueType()) { + if (!getValueType().equals(other.getValueType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcRule()) { + hash = (37 * hash) + GC_RULE_FIELD_NUMBER; + hash = (53 * hash) + getGcRule().hashCode(); + } + if (hasValueType()) { + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ColumnFamily 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.admin.v2.ColumnFamily parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ColumnFamily 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.admin.v2.ColumnFamily parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ColumnFamily parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ColumnFamily 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A set of columns within a table which share a common configuration.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ColumnFamily} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ColumnFamily) + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ColumnFamily.class, + com.google.bigtable.admin.v2.ColumnFamily.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ColumnFamily.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetGcRuleFieldBuilder(); + internalGetValueTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcRule_ = null; + if (gcRuleBuilder_ != null) { + gcRuleBuilder_.dispose(); + gcRuleBuilder_ = null; + } + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily build() { + com.google.bigtable.admin.v2.ColumnFamily result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily buildPartial() { + com.google.bigtable.admin.v2.ColumnFamily result = + new com.google.bigtable.admin.v2.ColumnFamily(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ColumnFamily result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcRule_ = gcRuleBuilder_ == null ? gcRule_ : gcRuleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueType_ = valueTypeBuilder_ == null ? valueType_ : valueTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ColumnFamily) { + return mergeFrom((com.google.bigtable.admin.v2.ColumnFamily) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ColumnFamily other) { + if (other == com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()) return this; + if (other.hasGcRule()) { + mergeGcRule(other.getGcRule()); + } + if (other.hasValueType()) { + mergeValueType(other.getValueType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetGcRuleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage( + internalGetValueTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.GcRule gcRule_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + gcRuleBuilder_; + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return Whether the gcRule field is set. + */ + public boolean hasGcRule() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return The gcRule. + */ + public com.google.bigtable.admin.v2.GcRule getGcRule() { + if (gcRuleBuilder_ == null) { + return gcRule_ == null ? com.google.bigtable.admin.v2.GcRule.getDefaultInstance() : gcRule_; + } else { + return gcRuleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public Builder setGcRule(com.google.bigtable.admin.v2.GcRule value) { + if (gcRuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcRule_ = value; + } else { + gcRuleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public Builder setGcRule(com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (gcRuleBuilder_ == null) { + gcRule_ = builderForValue.build(); + } else { + gcRuleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public Builder mergeGcRule(com.google.bigtable.admin.v2.GcRule value) { + if (gcRuleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcRule_ != null + && gcRule_ != com.google.bigtable.admin.v2.GcRule.getDefaultInstance()) { + getGcRuleBuilder().mergeFrom(value); + } else { + gcRule_ = value; + } + } else { + gcRuleBuilder_.mergeFrom(value); + } + if (gcRule_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public Builder clearGcRule() { + bitField0_ = (bitField0_ & ~0x00000001); + gcRule_ = null; + if (gcRuleBuilder_ != null) { + gcRuleBuilder_.dispose(); + gcRuleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder getGcRuleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetGcRuleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() { + if (gcRuleBuilder_ != null) { + return gcRuleBuilder_.getMessageOrBuilder(); + } else { + return gcRule_ == null ? com.google.bigtable.admin.v2.GcRule.getDefaultInstance() : gcRule_; + } + } + + /** + * + * + *
+     * Garbage collection rule specified as a protobuf.
+     * Must serialize to at most 500 bytes.
+     *
+     * NOTE: Garbage collection executes opportunistically in the background, and
+     * so it's possible for reads to return a cell even if it matches the active
+     * GC expression for its family.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + internalGetGcRuleFieldBuilder() { + if (gcRuleBuilder_ == null) { + gcRuleBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder>( + getGcRule(), getParentForChildren(), isClean()); + gcRule_ = null; + } + return gcRuleBuilder_; + } + + private com.google.bigtable.admin.v2.Type valueType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + valueTypeBuilder_; + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return Whether the valueType field is set. + */ + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return The valueType. + */ + public com.google.bigtable.admin.v2.Type getValueType() { + if (valueTypeBuilder_ == null) { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } else { + return valueTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + } else { + valueTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (valueTypeBuilder_ == null) { + valueType_ = builderForValue.build(); + } else { + valueTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder mergeValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && valueType_ != null + && valueType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getValueTypeBuilder().mergeFrom(value); + } else { + valueType_ = value; + } + } else { + valueTypeBuilder_.mergeFrom(value); + } + if (valueType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000002); + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public com.google.bigtable.admin.v2.Type.Builder getValueTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetValueTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() { + if (valueTypeBuilder_ != null) { + return valueTypeBuilder_.getMessageOrBuilder(); + } else { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } + } + + /** + * + * + *
+     * The type of data stored in each of this family's cell values, including its
+     * full encoding. If omitted, the family only serves raw untyped bytes.
+     *
+     * For now, only the `Aggregate` type is supported.
+     *
+     * `Aggregate` can only be set at family creation and is immutable afterwards.
+     *
+     *
+     * If `value_type` is `Aggregate`, written data must be compatible with:
+     * * `value_type.input_type` for `AddInput` mutations
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getValueType(), getParentForChildren(), isClean()); + valueType_ = null; + } + return valueTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ColumnFamily) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ColumnFamily) + private static final com.google.bigtable.admin.v2.ColumnFamily DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ColumnFamily(); + } + + public static com.google.bigtable.admin.v2.ColumnFamily getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColumnFamily parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ColumnFamily getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java new file mode 100644 index 000000000000..27e90d41e5aa --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ColumnFamilyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ColumnFamily) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return Whether the gcRule field is set. + */ + boolean hasGcRule(); + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + * + * @return The gcRule. + */ + com.google.bigtable.admin.v2.GcRule getGcRule(); + + /** + * + * + *
+   * Garbage collection rule specified as a protobuf.
+   * Must serialize to at most 500 bytes.
+   *
+   * NOTE: Garbage collection executes opportunistically in the background, and
+   * so it's possible for reads to return a cell even if it matches the active
+   * GC expression for its family.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule gc_rule = 1; + */ + com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder(); + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return Whether the valueType field is set. + */ + boolean hasValueType(); + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return The valueType. + */ + com.google.bigtable.admin.v2.Type getValueType(); + + /** + * + * + *
+   * The type of data stored in each of this family's cell values, including its
+   * full encoding. If omitted, the family only serves raw untyped bytes.
+   *
+   * For now, only the `Aggregate` type is supported.
+   *
+   * `Aggregate` can only be set at family creation and is immutable afterwards.
+   *
+   *
+   * If `value_type` is `Aggregate`, written data must be compatible with:
+   * * `value_type.input_type` for `AddInput` mutations
+   * 
+ * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java new file mode 100644 index 000000000000..72e6d4f67ef5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class CommonProto extends com.google.protobuf.GeneratedFile { + private CommonProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CommonProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "%google/bigtable/admin/v2/common.proto\022" + + "\030google.bigtable.admin.v2\032\037google/protobuf/timestamp.proto\"\213\001\n" + + "\021OperationProgress\022\030\n" + + "\020progress_percent\030\001 \001(\005\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timestamp*=\n" + + "\013StorageType\022\034\n" + + "\030STORAGE_TYPE_UNSPECIFIED\020\000\022\007\n" + + "\003SSD\020\001\022\007\n" + + "\003HDD\020\002B\316\001\n" + + "\034com.google.bigtable.admin.v2B\013CommonProtoP\001Z8cloud.g" + + "oogle.com/go/bigtable/admin/apiv2/adminp" + + "b;adminpb\252\002\036Google.Cloud.Bigtable.Admin." + + "V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Go" + + "ogle::Cloud::Bigtable::Admin::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_bigtable_admin_v2_OperationProgress_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_OperationProgress_descriptor, + new java.lang.String[] { + "ProgressPercent", "StartTime", "EndTime", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java new file mode 100644 index 000000000000..9f7912105336 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java @@ -0,0 +1,1212 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the google.longrunning.Operation returned by
+ * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CopyBackupMetadata} + */ +@com.google.protobuf.Generated +public final class CopyBackupMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CopyBackupMetadata) + CopyBackupMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CopyBackupMetadata"); + } + + // Use CopyBackupMetadata.newBuilder() to construct. + private CopyBackupMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CopyBackupMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CopyBackupMetadata.class, + com.google.bigtable.admin.v2.CopyBackupMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the backup being created through the copy operation.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string name = 1 [(.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; + } + } + + /** + * + * + *
+   * The name of the backup being created through the copy operation.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string name = 1 [(.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 SOURCE_BACKUP_INFO_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.BackupInfo sourceBackupInfo_; + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return Whether the sourceBackupInfo field is set. + */ + @java.lang.Override + public boolean hasSourceBackupInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return The sourceBackupInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getSourceBackupInfo() { + return sourceBackupInfo_ == null + ? com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance() + : sourceBackupInfo_; + } + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getSourceBackupInfoOrBuilder() { + return sourceBackupInfo_ == null + ? com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance() + : sourceBackupInfo_; + } + + public static final int PROGRESS_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.OperationProgress progress_; + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + @java.lang.Override + public boolean hasProgress() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return The progress. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSourceBackupInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getProgress()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSourceBackupInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getProgress()); + } + size += getUnknownFields().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.admin.v2.CopyBackupMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CopyBackupMetadata other = + (com.google.bigtable.admin.v2.CopyBackupMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSourceBackupInfo() != other.hasSourceBackupInfo()) return false; + if (hasSourceBackupInfo()) { + if (!getSourceBackupInfo().equals(other.getSourceBackupInfo())) return false; + } + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasSourceBackupInfo()) { + hash = (37 * hash) + SOURCE_BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackupInfo().hashCode(); + } + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata 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.admin.v2.CopyBackupMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata 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.admin.v2.CopyBackupMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CopyBackupMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the google.longrunning.Operation returned by
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CopyBackupMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CopyBackupMetadata) + com.google.bigtable.admin.v2.CopyBackupMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CopyBackupMetadata.class, + com.google.bigtable.admin.v2.CopyBackupMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CopyBackupMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceBackupInfoFieldBuilder(); + internalGetProgressFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sourceBackupInfo_ = null; + if (sourceBackupInfoBuilder_ != null) { + sourceBackupInfoBuilder_.dispose(); + sourceBackupInfoBuilder_ = null; + } + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CopyBackupMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupMetadata build() { + com.google.bigtable.admin.v2.CopyBackupMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupMetadata buildPartial() { + com.google.bigtable.admin.v2.CopyBackupMetadata result = + new com.google.bigtable.admin.v2.CopyBackupMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CopyBackupMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceBackupInfo_ = + sourceBackupInfoBuilder_ == null ? sourceBackupInfo_ : sourceBackupInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.progress_ = progressBuilder_ == null ? progress_ : progressBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CopyBackupMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CopyBackupMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CopyBackupMetadata other) { + if (other == com.google.bigtable.admin.v2.CopyBackupMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSourceBackupInfo()) { + mergeSourceBackupInfo(other.getSourceBackupInfo()); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSourceBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetProgressFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the backup being created through the copy operation.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string name = 1 [(.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; + } + } + + /** + * + * + *
+     * The name of the backup being created through the copy operation.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string name = 1 [(.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; + } + } + + /** + * + * + *
+     * The name of the backup being created through the copy operation.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup being created through the copy operation.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup being created through the copy operation.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string name = 1 [(.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.BackupInfo sourceBackupInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + sourceBackupInfoBuilder_; + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return Whether the sourceBackupInfo field is set. + */ + public boolean hasSourceBackupInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return The sourceBackupInfo. + */ + public com.google.bigtable.admin.v2.BackupInfo getSourceBackupInfo() { + if (sourceBackupInfoBuilder_ == null) { + return sourceBackupInfo_ == null + ? com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance() + : sourceBackupInfo_; + } else { + return sourceBackupInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public Builder setSourceBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (sourceBackupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceBackupInfo_ = value; + } else { + sourceBackupInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public Builder setSourceBackupInfo( + com.google.bigtable.admin.v2.BackupInfo.Builder builderForValue) { + if (sourceBackupInfoBuilder_ == null) { + sourceBackupInfo_ = builderForValue.build(); + } else { + sourceBackupInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public Builder mergeSourceBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (sourceBackupInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sourceBackupInfo_ != null + && sourceBackupInfo_ != com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance()) { + getSourceBackupInfoBuilder().mergeFrom(value); + } else { + sourceBackupInfo_ = value; + } + } else { + sourceBackupInfoBuilder_.mergeFrom(value); + } + if (sourceBackupInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public Builder clearSourceBackupInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + sourceBackupInfo_ = null; + if (sourceBackupInfoBuilder_ != null) { + sourceBackupInfoBuilder_.dispose(); + sourceBackupInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public com.google.bigtable.admin.v2.BackupInfo.Builder getSourceBackupInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSourceBackupInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getSourceBackupInfoOrBuilder() { + if (sourceBackupInfoBuilder_ != null) { + return sourceBackupInfoBuilder_.getMessageOrBuilder(); + } else { + return sourceBackupInfo_ == null + ? com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance() + : sourceBackupInfo_; + } + } + + /** + * + * + *
+     * Information about the source backup that is being copied from.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + internalGetSourceBackupInfoFieldBuilder() { + if (sourceBackupInfoBuilder_ == null) { + sourceBackupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder>( + getSourceBackupInfo(), getParentForChildren(), isClean()); + sourceBackupInfo_ = null; + } + return sourceBackupInfoBuilder_; + } + + private com.google.bigtable.admin.v2.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + progressBuilder_; + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return The progress. + */ + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + } else { + progressBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public Builder setProgress( + com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && progress_ != null + && progress_ != com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) { + getProgressBuilder().mergeFrom(value); + } else { + progress_ = value; + } + } else { + progressBuilder_.mergeFrom(value); + } + if (progress_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public Builder clearProgress() { + bitField0_ = (bitField0_ & ~0x00000004); + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetProgressFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + } + + /** + * + * + *
+     * The progress of the
+     * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + internalGetProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CopyBackupMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CopyBackupMetadata) + private static final com.google.bigtable.admin.v2.CopyBackupMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CopyBackupMetadata(); + } + + public static com.google.bigtable.admin.v2.CopyBackupMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CopyBackupMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CopyBackupMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java new file mode 100644 index 000000000000..c0b21ff13178 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CopyBackupMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CopyBackupMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the backup being created through the copy operation.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the backup being created through the copy operation.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return Whether the sourceBackupInfo field is set. + */ + boolean hasSourceBackupInfo(); + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + * + * @return The sourceBackupInfo. + */ + com.google.bigtable.admin.v2.BackupInfo getSourceBackupInfo(); + + /** + * + * + *
+   * Information about the source backup that is being copied from.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo source_backup_info = 2; + */ + com.google.bigtable.admin.v2.BackupInfoOrBuilder getSourceBackupInfoOrBuilder(); + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + * + * @return The progress. + */ + com.google.bigtable.admin.v2.OperationProgress getProgress(); + + /** + * + * + *
+   * The progress of the
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 3; + */ + com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java new file mode 100644 index 000000000000..318635e8468f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java @@ -0,0 +1,1442 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CopyBackupRequest} + */ +@com.google.protobuf.Generated +public final class CopyBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CopyBackupRequest) + CopyBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CopyBackupRequest"); + } + + // Use CopyBackupRequest.newBuilder() to construct. + private CopyBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CopyBackupRequest() { + parent_ = ""; + backupId_ = ""; + sourceBackup_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CopyBackupRequest.class, + com.google.bigtable.admin.v2.CopyBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The name of the destination cluster that will contain the backup
+   * copy. The cluster must already exist. Values are of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the destination cluster that will contain the backup
+   * copy. The cluster must already exist. Values are of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + + /** + * + * + *
+   * Required. The id of the new backup. The `backup_id` along with `parent`
+   * are combined as {parent}/backups/{backup_id} to create the full backup
+   * name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The id of the new backup. The `backup_id` along with `parent`
+   * are combined as {parent}/backups/{backup_id} to create the full backup
+   * name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_BACKUP_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+   * Required. The source backup to be copied from.
+   * The source backup needs to be in READY state for it to be copied.
+   * Copying a copied backup is not allowed.
+   * Once CopyBackup is in progress, the source backup cannot be deleted or
+   * cleaned up on expiration until CopyBackup is finished.
+   * Values are of the form:
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceBackup. + */ + @java.lang.Override + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + 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(); + sourceBackup_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The source backup to be copied from.
+   * The source backup needs to be in READY state for it to be copied.
+   * Copying a copied backup is not allowed.
+   * Once CopyBackup is in progress, the source backup cannot be deleted or
+   * cleaned up on expiration until CopyBackup is finished.
+   * Values are of the form:
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceBackup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp expireTime_; + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sourceBackup_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getExpireTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, backupId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sourceBackup_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getExpireTime()); + } + size += getUnknownFields().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.admin.v2.CopyBackupRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CopyBackupRequest other = + (com.google.bigtable.admin.v2.CopyBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest 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.admin.v2.CopyBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest 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.admin.v2.CopyBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CopyBackupRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CopyBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CopyBackupRequest) + com.google.bigtable.admin.v2.CopyBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CopyBackupRequest.class, + com.google.bigtable.admin.v2.CopyBackupRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CopyBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpireTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupId_ = ""; + sourceBackup_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CopyBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CopyBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupRequest build() { + com.google.bigtable.admin.v2.CopyBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CopyBackupRequest buildPartial() { + com.google.bigtable.admin.v2.CopyBackupRequest result = + new com.google.bigtable.admin.v2.CopyBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CopyBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceBackup_ = sourceBackup_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CopyBackupRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CopyBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CopyBackupRequest other) { + if (other == com.google.bigtable.admin.v2.CopyBackupRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSourceBackup().isEmpty()) { + sourceBackup_ = other.sourceBackup_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sourceBackup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The name of the destination cluster that will contain the backup
+     * copy. The cluster must already exist. Values are of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the destination cluster that will contain the backup
+     * copy. The cluster must already exist. Values are of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the destination cluster that will contain the backup
+     * copy. The cluster must already exist. Values are of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the destination cluster that will contain the backup
+     * copy. The cluster must already exist. Values are of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the destination cluster that will contain the backup
+     * copy. The cluster must already exist. Values are of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + + /** + * + * + *
+     * Required. The id of the new backup. The `backup_id` along with `parent`
+     * are combined as {parent}/backups/{backup_id} to create the full backup
+     * name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The id of the new backup. The `backup_id` along with `parent`
+     * are combined as {parent}/backups/{backup_id} to create the full backup
+     * name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The id of the new backup. The `backup_id` along with `parent`
+     * are combined as {parent}/backups/{backup_id} to create the full backup
+     * name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the new backup. The `backup_id` along with `parent`
+     * are combined as {parent}/backups/{backup_id} to create the full backup
+     * name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the new backup. The `backup_id` along with `parent`
+     * are combined as {parent}/backups/{backup_id} to create the full backup
+     * name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sourceBackup_ = ""; + + /** + * + * + *
+     * Required. The source backup to be copied from.
+     * The source backup needs to be in READY state for it to be copied.
+     * Copying a copied backup is not allowed.
+     * Once CopyBackup is in progress, the source backup cannot be deleted or
+     * cleaned up on expiration until CopyBackup is finished.
+     * Values are of the form:
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The source backup to be copied from.
+     * The source backup needs to be in READY state for it to be copied.
+     * Copying a copied backup is not allowed.
+     * Once CopyBackup is in progress, the source backup cannot be deleted or
+     * cleaned up on expiration until CopyBackup is finished.
+     * Values are of the form:
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The source backup to be copied from.
+     * The source backup needs to be in READY state for it to be copied.
+     * Copying a copied backup is not allowed.
+     * Once CopyBackup is in progress, the source backup cannot be deleted or
+     * cleaned up on expiration until CopyBackup is finished.
+     * Values are of the form:
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The source backup to be copied from.
+     * The source backup needs to be in READY state for it to be copied.
+     * Copying a copied backup is not allowed.
+     * Once CopyBackup is in progress, the source backup cannot be deleted or
+     * cleaned up on expiration until CopyBackup is finished.
+     * Values are of the form:
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + sourceBackup_ = getDefaultInstance().getSourceBackup(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The source backup to be copied from.
+     * The source backup needs to be in READY state for it to be copied.
+     * Copying a copied backup is not allowed.
+     * Once CopyBackup is in progress, the source backup cannot be deleted or
+     * cleaned up on expiration until CopyBackup is finished.
+     * Values are of the form:
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceBackup_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000008); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + + /** + * + * + *
+     * Required. Required. The expiration time of the copied backup with
+     * microsecond granularity that must be at least 6 hours and at most 30 days
+     * from the time the request is received. Once the `expire_time` has
+     * passed, Cloud Bigtable will delete the backup and free the resources used
+     * by the backup.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CopyBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CopyBackupRequest) + private static final com.google.bigtable.admin.v2.CopyBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CopyBackupRequest(); + } + + public static com.google.bigtable.admin.v2.CopyBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CopyBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CopyBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.java new file mode 100644 index 000000000000..489d954faeeb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CopyBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CopyBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the destination cluster that will contain the backup
+   * copy. The cluster must already exist. Values are of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The name of the destination cluster that will contain the backup
+   * copy. The cluster must already exist. Values are of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The id of the new backup. The `backup_id` along with `parent`
+   * are combined as {parent}/backups/{backup_id} to create the full backup
+   * name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + + /** + * + * + *
+   * Required. The id of the new backup. The `backup_id` along with `parent`
+   * are combined as {parent}/backups/{backup_id} to create the full backup
+   * name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The source backup to be copied from.
+   * The source backup needs to be in READY state for it to be copied.
+   * Copying a copied backup is not allowed.
+   * Once CopyBackup is in progress, the source backup cannot be deleted or
+   * cleaned up on expiration until CopyBackup is finished.
+   * Values are of the form:
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceBackup. + */ + java.lang.String getSourceBackup(); + + /** + * + * + *
+   * Required. The source backup to be copied from.
+   * The source backup needs to be in READY state for it to be copied.
+   * Copying a copied backup is not allowed.
+   * Once CopyBackup is in progress, the source backup cannot be deleted or
+   * cleaned up on expiration until CopyBackup is finished.
+   * Values are of the form:
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * + * string source_backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceBackup. + */ + com.google.protobuf.ByteString getSourceBackupBytes(); + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
+   * Required. Required. The expiration time of the copied backup with
+   * microsecond granularity that must be at least 6 hours and at most 30 days
+   * from the time the request is received. Once the `expire_time` has
+   * passed, Cloud Bigtable will delete the backup and free the resources used
+   * by the backup.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java new file mode 100644 index 000000000000..afd6f443643c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java @@ -0,0 +1,1245 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.CreateAppProfile.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAppProfileRequest} + */ +@com.google.protobuf.Generated +public final class CreateAppProfileRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateAppProfileRequest) + CreateAppProfileRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateAppProfileRequest"); + } + + // Use CreateAppProfileRequest.newBuilder() to construct. + private CreateAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateAppProfileRequest() { + parent_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAppProfileRequest.class, + com.google.bigtable.admin.v2.CreateAppProfileRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new app
+   * profile. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new app
+   * profile. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * Required. The ID to be used when referring to the new app profile within
+   * its instance, e.g., just `myprofile` rather than
+   * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + /** + * + * + *
+   * Required. The ID to be used when referring to the new app profile within
+   * its instance, e.g., just `myprofile` rather than
+   * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + public static final int APP_PROFILE_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.AppProfile appProfile_; + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + @java.lang.Override + public boolean hasAppProfile() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile getAppProfile() { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 4; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * If true, ignore safety checks when creating the app profile.
+   * 
+ * + * bool ignore_warnings = 4; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getAppProfile()); + } + if (ignoreWarnings_ != false) { + output.writeBool(4, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAppProfile()); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.CreateAppProfileRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateAppProfileRequest other = + (com.google.bigtable.admin.v2.CreateAppProfileRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (hasAppProfile() != other.hasAppProfile()) return false; + if (hasAppProfile()) { + if (!getAppProfile().equals(other.getAppProfile())) return false; + } + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + if (hasAppProfile()) { + hash = (37 * hash) + APP_PROFILE_FIELD_NUMBER; + hash = (53 * hash) + getAppProfile().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest 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.admin.v2.CreateAppProfileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest 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.admin.v2.CreateAppProfileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateAppProfileRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.CreateAppProfile.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAppProfileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateAppProfileRequest) + com.google.bigtable.admin.v2.CreateAppProfileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAppProfileRequest.class, + com.google.bigtable.admin.v2.CreateAppProfileRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateAppProfileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAppProfileFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + appProfileId_ = ""; + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); + appProfileBuilder_ = null; + } + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAppProfileRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateAppProfileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAppProfileRequest build() { + com.google.bigtable.admin.v2.CreateAppProfileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAppProfileRequest buildPartial() { + com.google.bigtable.admin.v2.CreateAppProfileRequest result = + new com.google.bigtable.admin.v2.CreateAppProfileRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfile_ = appProfileBuilder_ == null ? appProfile_ : appProfileBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateAppProfileRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateAppProfileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAppProfileRequest other) { + if (other == com.google.bigtable.admin.v2.CreateAppProfileRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasAppProfile()) { + mergeAppProfile(other.getAppProfile()); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetAppProfileFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new app
+     * profile. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new app
+     * profile. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new app
+     * profile. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new app
+     * profile. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new app
+     * profile. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * Required. The ID to be used when referring to the new app profile within
+     * its instance, e.g., just `myprofile` rather than
+     * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new app profile within
+     * its instance, e.g., just `myprofile` rather than
+     * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new app profile within
+     * its instance, e.g., just `myprofile` rather than
+     * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new app profile within
+     * its instance, e.g., just `myprofile` rather than
+     * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new app profile within
+     * its instance, e.g., just `myprofile` rather than
+     * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.AppProfile appProfile_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + appProfileBuilder_; + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + public boolean hasAppProfile() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + public com.google.bigtable.admin.v2.AppProfile getAppProfile() { + if (appProfileBuilder_ == null) { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } else { + return appProfileBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { + if (appProfileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appProfile_ = value; + } else { + appProfileBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { + if (appProfileBuilder_ == null) { + appProfile_ = builderForValue.build(); + } else { + appProfileBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { + if (appProfileBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && appProfile_ != null + && appProfile_ != com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()) { + getAppProfileBuilder().mergeFrom(value); + } else { + appProfile_ = value; + } + } else { + appProfileBuilder_.mergeFrom(value); + } + if (appProfile_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAppProfile() { + bitField0_ = (bitField0_ & ~0x00000004); + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); + appProfileBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetAppProfileFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { + if (appProfileBuilder_ != null) { + return appProfileBuilder_.getMessageOrBuilder(); + } else { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + } + + /** + * + * + *
+     * Required. The app profile to be created.
+     * Fields marked `OutputOnly` will be ignored.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + internalGetAppProfileFieldBuilder() { + if (appProfileBuilder_ == null) { + appProfileBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder>( + getAppProfile(), getParentForChildren(), isClean()); + appProfile_ = null; + } + return appProfileBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * If true, ignore safety checks when creating the app profile.
+     * 
+ * + * bool ignore_warnings = 4; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * If true, ignore safety checks when creating the app profile.
+     * 
+ * + * bool ignore_warnings = 4; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, ignore safety checks when creating the app profile.
+     * 
+ * + * bool ignore_warnings = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000008); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateAppProfileRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateAppProfileRequest) + private static final com.google.bigtable.admin.v2.CreateAppProfileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateAppProfileRequest(); + } + + public static com.google.bigtable.admin.v2.CreateAppProfileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAppProfileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateAppProfileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java new file mode 100644 index 000000000000..575ca88380dd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateAppProfileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateAppProfileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new app
+   * profile. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new app
+   * profile. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new app profile within
+   * its instance, e.g., just `myprofile` rather than
+   * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new app profile within
+   * its instance, e.g., just `myprofile` rather than
+   * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + boolean hasAppProfile(); + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + com.google.bigtable.admin.v2.AppProfile getAppProfile(); + + /** + * + * + *
+   * Required. The app profile to be created.
+   * Fields marked `OutputOnly` will be ignored.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder(); + + /** + * + * + *
+   * If true, ignore safety checks when creating the app profile.
+   * 
+ * + * bool ignore_warnings = 4; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java new file mode 100644 index 000000000000..baca5f4496e1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java @@ -0,0 +1,1274 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateAuthorizedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewMetadata} + */ +@com.google.protobuf.Generated +public final class CreateAuthorizedViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + CreateAuthorizedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateAuthorizedViewMetadata"); + } + + // Use CreateAuthorizedViewMetadata.newBuilder() to construct. + private CreateAuthorizedViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateAuthorizedViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.class, + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateAuthorizedViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.CreateAuthorizedViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata other = + (com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata 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.admin.v2.CreateAuthorizedViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata 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.admin.v2.CreateAuthorizedViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateAuthorizedViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateAuthorizedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.class, + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata build() { + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata result = + new com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateAuthorizedViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + private static final com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAuthorizedViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateAuthorizedViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java new file mode 100644 index 000000000000..5d8425dac541 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateAuthorizedViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java new file mode 100644 index 000000000000..28b9f673a2af --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class CreateAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + CreateAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateAuthorizedViewRequest"); + } + + // Use CreateAuthorizedViewRequest.newBuilder() to construct. + private CreateAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateAuthorizedViewRequest() { + parent_ = ""; + authorizedViewId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. This is the name of the table the AuthorizedView belongs to.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. This is the name of the table the AuthorizedView belongs to.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewId_ = ""; + + /** + * + * + *
+   * Required. The id of the AuthorizedView to create. This AuthorizedView must
+   * not already exist. The `authorized_view_id` appended to `parent` forms the
+   * full AuthorizedView name of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+   * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizedViewId. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewId() { + java.lang.Object ref = authorizedViewId_; + 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(); + authorizedViewId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The id of the AuthorizedView to create. This AuthorizedView must
+   * not already exist. The `authorized_view_id` appended to `parent` forms the
+   * full AuthorizedView name of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+   * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizedViewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewIdBytes() { + java.lang.Object ref = authorizedViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.AuthorizedView authorizedView_; + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + @java.lang.Override + public boolean hasAuthorizedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView() { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder() { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, authorizedViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getAuthorizedView()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, authorizedViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAuthorizedView()); + } + size += getUnknownFields().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.admin.v2.CreateAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest other = + (com.google.bigtable.admin.v2.CreateAuthorizedViewRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAuthorizedViewId().equals(other.getAuthorizedViewId())) return false; + if (hasAuthorizedView() != other.hasAuthorizedView()) return false; + if (hasAuthorizedView()) { + if (!getAuthorizedView().equals(other.getAuthorizedView())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewId().hashCode(); + if (hasAuthorizedView()) { + hash = (37 * hash) + AUTHORIZED_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedView().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest 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.admin.v2.CreateAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest 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.admin.v2.CreateAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateAuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAuthorizedViewFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + authorizedViewId_ = ""; + authorizedView_ = null; + if (authorizedViewBuilder_ != null) { + authorizedViewBuilder_.dispose(); + authorizedViewBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest build() { + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest buildPartial() { + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest result = + new com.google.bigtable.admin.v2.CreateAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewId_ = authorizedViewId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.authorizedView_ = + authorizedViewBuilder_ == null ? authorizedView_ : authorizedViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAuthorizedViewRequest other) { + if (other == com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewId().isEmpty()) { + authorizedViewId_ = other.authorizedViewId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasAuthorizedView()) { + mergeAuthorizedView(other.getAuthorizedView()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + authorizedViewId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetAuthorizedViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. This is the name of the table the AuthorizedView belongs to.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. This is the name of the table the AuthorizedView belongs to.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. This is the name of the table the AuthorizedView belongs to.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This is the name of the table the AuthorizedView belongs to.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This is the name of the table the AuthorizedView belongs to.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewId_ = ""; + + /** + * + * + *
+     * Required. The id of the AuthorizedView to create. This AuthorizedView must
+     * not already exist. The `authorized_view_id` appended to `parent` forms the
+     * full AuthorizedView name of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+     * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizedViewId. + */ + public java.lang.String getAuthorizedViewId() { + java.lang.Object ref = authorizedViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The id of the AuthorizedView to create. This AuthorizedView must
+     * not already exist. The `authorized_view_id` appended to `parent` forms the
+     * full AuthorizedView name of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+     * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizedViewId. + */ + public com.google.protobuf.ByteString getAuthorizedViewIdBytes() { + java.lang.Object ref = authorizedViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The id of the AuthorizedView to create. This AuthorizedView must
+     * not already exist. The `authorized_view_id` appended to `parent` forms the
+     * full AuthorizedView name of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+     * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The authorizedViewId to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the AuthorizedView to create. This AuthorizedView must
+     * not already exist. The `authorized_view_id` appended to `parent` forms the
+     * full AuthorizedView name of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+     * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewId() { + authorizedViewId_ = getDefaultInstance().getAuthorizedViewId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the AuthorizedView to create. This AuthorizedView must
+     * not already exist. The `authorized_view_id` appended to `parent` forms the
+     * full AuthorizedView name of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+     * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for authorizedViewId to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.AuthorizedView authorizedView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + authorizedViewBuilder_; + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + public boolean hasAuthorizedView() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView() { + if (authorizedViewBuilder_ == null) { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } else { + return authorizedViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizedView(com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizedView_ = value; + } else { + authorizedViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.Builder builderForValue) { + if (authorizedViewBuilder_ == null) { + authorizedView_ = builderForValue.build(); + } else { + authorizedViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAuthorizedView(com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && authorizedView_ != null + && authorizedView_ + != com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance()) { + getAuthorizedViewBuilder().mergeFrom(value); + } else { + authorizedView_ = value; + } + } else { + authorizedViewBuilder_.mergeFrom(value); + } + if (authorizedView_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAuthorizedView() { + bitField0_ = (bitField0_ & ~0x00000004); + authorizedView_ = null; + if (authorizedViewBuilder_ != null) { + authorizedViewBuilder_.dispose(); + authorizedViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AuthorizedView.Builder getAuthorizedViewBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetAuthorizedViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder() { + if (authorizedViewBuilder_ != null) { + return authorizedViewBuilder_.getMessageOrBuilder(); + } else { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + } + + /** + * + * + *
+     * Required. The AuthorizedView to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + internalGetAuthorizedViewFieldBuilder() { + if (authorizedViewBuilder_ == null) { + authorizedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder>( + getAuthorizedView(), getParentForChildren(), isClean()); + authorizedView_ = null; + } + return authorizedViewBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + private static final com.google.bigtable.admin.v2.CreateAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateAuthorizedViewRequest(); + } + + public static com.google.bigtable.admin.v2.CreateAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..873ef940b33a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. This is the name of the table the AuthorizedView belongs to.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. This is the name of the table the AuthorizedView belongs to.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The id of the AuthorizedView to create. This AuthorizedView must
+   * not already exist. The `authorized_view_id` appended to `parent` forms the
+   * full AuthorizedView name of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+   * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizedViewId. + */ + java.lang.String getAuthorizedViewId(); + + /** + * + * + *
+   * Required. The id of the AuthorizedView to create. This AuthorizedView must
+   * not already exist. The `authorized_view_id` appended to `parent` forms the
+   * full AuthorizedView name of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
+   * 
+ * + * string authorized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizedViewId. + */ + com.google.protobuf.ByteString getAuthorizedViewIdBytes(); + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + boolean hasAuthorizedView(); + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView(); + + /** + * + * + *
+   * Required. The AuthorizedView to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java new file mode 100644 index 000000000000..bae564abc0d0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java @@ -0,0 +1,1343 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the operation returned by
+ * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateBackupMetadata} + */ +@com.google.protobuf.Generated +public final class CreateBackupMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateBackupMetadata) + CreateBackupMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateBackupMetadata"); + } + + // Use CreateBackupMetadata.newBuilder() to construct. + private CreateBackupMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateBackupMetadata() { + name_ = ""; + sourceTable_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateBackupMetadata.class, + com.google.bigtable.admin.v2.CreateBackupMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @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 SOURCE_TABLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+   * The name of the table the backup is created from.
+   * 
+ * + * string source_table = 2; + * + * @return The sourceTable. + */ + @java.lang.Override + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + 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(); + sourceTable_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the table the backup is created from.
+   * 
+ * + * string source_table = 2; + * + * @return The bytes for sourceTable. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sourceTable_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sourceTable_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEndTime()); + } + size += getUnknownFields().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.admin.v2.CreateBackupMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateBackupMetadata other = + (com.google.bigtable.admin.v2.CreateBackupMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSourceTable().equals(other.getSourceTable())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SOURCE_TABLE_FIELD_NUMBER; + hash = (53 * hash) + getSourceTable().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata 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.admin.v2.CreateBackupMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata 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.admin.v2.CreateBackupMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateBackupMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the operation returned by
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateBackupMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateBackupMetadata) + com.google.bigtable.admin.v2.CreateBackupMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateBackupMetadata.class, + com.google.bigtable.admin.v2.CreateBackupMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateBackupMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sourceTable_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateBackupMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupMetadata build() { + com.google.bigtable.admin.v2.CreateBackupMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateBackupMetadata result = + new com.google.bigtable.admin.v2.CreateBackupMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateBackupMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceTable_ = sourceTable_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateBackupMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateBackupMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateBackupMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateBackupMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSourceTable().isEmpty()) { + sourceTable_ = other.sourceTable_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sourceTable_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the backup being created.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object sourceTable_ = ""; + + /** + * + * + *
+     * The name of the table the backup is created from.
+     * 
+ * + * string source_table = 2; + * + * @return The sourceTable. + */ + public java.lang.String getSourceTable() { + java.lang.Object ref = sourceTable_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceTable_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the table the backup is created from.
+     * 
+ * + * string source_table = 2; + * + * @return The bytes for sourceTable. + */ + public com.google.protobuf.ByteString getSourceTableBytes() { + java.lang.Object ref = sourceTable_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceTable_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the table the backup is created from.
+     * 
+ * + * string source_table = 2; + * + * @param value The sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceTable_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table the backup is created from.
+     * 
+ * + * string source_table = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceTable() { + sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table the backup is created from.
+     * 
+ * + * string source_table = 2; + * + * @param value The bytes for sourceTable to set. + * @return This builder for chaining. + */ + public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceTable_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000004); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000008); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateBackupMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateBackupMetadata) + private static final com.google.bigtable.admin.v2.CreateBackupMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateBackupMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateBackupMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateBackupMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java new file mode 100644 index 000000000000..f18184b8e15f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateBackupMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateBackupMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the backup being created.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The name of the table the backup is created from.
+   * 
+ * + * string source_table = 2; + * + * @return The sourceTable. + */ + java.lang.String getSourceTable(); + + /** + * + * + *
+   * The name of the table the backup is created from.
+   * 
+ * + * string source_table = 2; + * + * @return The bytes for sourceTable. + */ + com.google.protobuf.ByteString getSourceTableBytes(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java new file mode 100644 index 000000000000..d051bfb93c31 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java @@ -0,0 +1,1145 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateBackupRequest} + */ +@com.google.protobuf.Generated +public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateBackupRequest) + CreateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateBackupRequest"); + } + + // Use CreateBackupRequest.newBuilder() to construct. + private CreateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateBackupRequest() { + parent_ = ""; + backupId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateBackupRequest.class, + com.google.bigtable.admin.v2.CreateBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. This must be one of the clusters in the instance in which this
+   * table is located. The backup will be stored in this cluster. Values are
+   * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. This must be one of the clusters in the instance in which this
+   * table is located. The backup will be stored in this cluster. Values are
+   * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + + /** + * + * + *
+   * Required. The id of the backup to be created. The `backup_id` along with
+   * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+   * the full backup name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + @java.lang.Override + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + 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(); + backupId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The id of the backup to be created. The `backup_id` along with
+   * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+   * the full backup name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.Backup backup_; + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup getBackup() { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, backupId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBackup()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, backupId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); + } + size += getUnknownFields().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.admin.v2.CreateBackupRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateBackupRequest other = + (com.google.bigtable.admin.v2.CreateBackupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBackupId().equals(other.getBackupId())) return false; + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + BACKUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getBackupId().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest 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.admin.v2.CreateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest 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.admin.v2.CreateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateBackupRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateBackupRequest) + com.google.bigtable.admin.v2.CreateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateBackupRequest.class, + com.google.bigtable.admin.v2.CreateBackupRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + backupId_ = ""; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupRequest build() { + com.google.bigtable.admin.v2.CreateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateBackupRequest buildPartial() { + com.google.bigtable.admin.v2.CreateBackupRequest result = + new com.google.bigtable.admin.v2.CreateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateBackupRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateBackupRequest other) { + if (other == com.google.bigtable.admin.v2.CreateBackupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBackupId().isEmpty()) { + backupId_ = other.backupId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + backupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. This must be one of the clusters in the instance in which this
+     * table is located. The backup will be stored in this cluster. Values are
+     * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. This must be one of the clusters in the instance in which this
+     * table is located. The backup will be stored in this cluster. Values are
+     * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. This must be one of the clusters in the instance in which this
+     * table is located. The backup will be stored in this cluster. Values are
+     * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This must be one of the clusters in the instance in which this
+     * table is located. The backup will be stored in this cluster. Values are
+     * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. This must be one of the clusters in the instance in which this
+     * table is located. The backup will be stored in this cluster. Values are
+     * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object backupId_ = ""; + + /** + * + * + *
+     * Required. The id of the backup to be created. The `backup_id` along with
+     * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+     * the full backup name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + public java.lang.String getBackupId() { + java.lang.Object ref = backupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + backupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The id of the backup to be created. The `backup_id` along with
+     * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+     * the full backup name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + public com.google.protobuf.ByteString getBackupIdBytes() { + java.lang.Object ref = backupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + backupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The id of the backup to be created. The `backup_id` along with
+     * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+     * the full backup name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the backup to be created. The `backup_id` along with
+     * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+     * the full backup name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBackupId() { + backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the backup to be created. The `backup_id` along with
+     * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+     * the full backup name, of the form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+     * This string must be between 1 and 50 characters in length and match the
+     * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+     * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for backupId to set. + * @return This builder for chaining. + */ + public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + backupId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.bigtable.admin.v2.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && backup_ != null + && backup_ != com.google.bigtable.admin.v2.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000004); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The backup to create.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateBackupRequest) + private static final com.google.bigtable.admin.v2.CreateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateBackupRequest(); + } + + public static com.google.bigtable.admin.v2.CreateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..14c62ca75235 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. This must be one of the clusters in the instance in which this
+   * table is located. The backup will be stored in this cluster. Values are
+   * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. This must be one of the clusters in the instance in which this
+   * table is located. The backup will be stored in this cluster. Values are
+   * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The id of the backup to be created. The `backup_id` along with
+   * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+   * the full backup name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The backupId. + */ + java.lang.String getBackupId(); + + /** + * + * + *
+   * Required. The id of the backup to be created. The `backup_id` along with
+   * the parent `parent` are combined as {parent}/backups/{backup_id} to create
+   * the full backup name, of the form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
+   * This string must be between 1 and 50 characters in length and match the
+   * regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
+   * 
+ * + * string backup_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for backupId. + */ + com.google.protobuf.ByteString getBackupIdBytes(); + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.bigtable.admin.v2.Backup getBackup(); + + /** + * + * + *
+   * Required. The backup to create.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java new file mode 100644 index 000000000000..3d5740ef2212 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java @@ -0,0 +1,2801 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata} + */ +@com.google.protobuf.Generated +public final class CreateClusterMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateClusterMetadata) + CreateClusterMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateClusterMetadata"); + } + + // Use CreateClusterMetadata.newBuilder() to construct. + private CreateClusterMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateClusterMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetTables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterMetadata.class, + com.google.bigtable.admin.v2.CreateClusterMetadata.Builder.class); + } + + public interface TableProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Estimate of the size of the table to be copied.
+     * 
+ * + * int64 estimated_size_bytes = 2; + * + * @return The estimatedSizeBytes. + */ + long getEstimatedSizeBytes(); + + /** + * + * + *
+     * Estimate of the number of bytes copied so far for this table.
+     * This will eventually reach 'estimated_size_bytes' unless the table copy
+     * is CANCELLED.
+     * 
+ * + * int64 estimated_copied_bytes = 3; + * + * @return The estimatedCopiedBytes. + */ + long getEstimatedCopiedBytes(); + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The state. + */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State getState(); + } + + /** + * + * + *
+   * Progress info for copying a table's data to the new cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} + */ + public static final class TableProgress extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + TableProgressOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableProgress"); + } + + // Use TableProgress.newBuilder() to construct. + private TableProgress(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TableProgress() { + state_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.class, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State} */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** STATE_UNSPECIFIED = 0; */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+       * The table has not yet begun copying to the new cluster.
+       * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+       * The table is actively being copied to the new cluster.
+       * 
+ * + * COPYING = 2; + */ + COPYING(2), + /** + * + * + *
+       * The table has been fully copied to the new cluster.
+       * 
+ * + * COMPLETED = 3; + */ + COMPLETED(3), + /** + * + * + *
+       * The table was deleted before it finished copying to the new cluster.
+       * Note that tables deleted after completion will stay marked as
+       * COMPLETED, not CANCELLED.
+       * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + + /** STATE_UNSPECIFIED = 0; */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The table has not yet begun copying to the new cluster.
+       * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + + /** + * + * + *
+       * The table is actively being copied to the new cluster.
+       * 
+ * + * COPYING = 2; + */ + public static final int COPYING_VALUE = 2; + + /** + * + * + *
+       * The table has been fully copied to the new cluster.
+       * 
+ * + * COMPLETED = 3; + */ + public static final int COMPLETED_VALUE = 3; + + /** + * + * + *
+       * The table was deleted before it finished copying to the new cluster.
+       * Note that tables deleted after completion will stay marked as
+       * COMPLETED, not CANCELLED.
+       * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return COPYING; + case 3: + return COMPLETED; + case 4: + return CANCELLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State) + } + + public static final int ESTIMATED_SIZE_BYTES_FIELD_NUMBER = 2; + private long estimatedSizeBytes_ = 0L; + + /** + * + * + *
+     * Estimate of the size of the table to be copied.
+     * 
+ * + * int64 estimated_size_bytes = 2; + * + * @return The estimatedSizeBytes. + */ + @java.lang.Override + public long getEstimatedSizeBytes() { + return estimatedSizeBytes_; + } + + public static final int ESTIMATED_COPIED_BYTES_FIELD_NUMBER = 3; + private long estimatedCopiedBytes_ = 0L; + + /** + * + * + *
+     * Estimate of the number of bytes copied so far for this table.
+     * This will eventually reach 'estimated_size_bytes' unless the table copy
+     * is CANCELLED.
+     * 
+ * + * int64 estimated_copied_bytes = 3; + * + * @return The estimatedCopiedBytes. + */ + @java.lang.Override + public long getEstimatedCopiedBytes() { + return estimatedCopiedBytes_; + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_ = 0; + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State getState() { + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State result = + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State.forNumber(state_); + return result == null + ? com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State.UNRECOGNIZED + : result; + } + + 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 (estimatedSizeBytes_ != 0L) { + output.writeInt64(2, estimatedSizeBytes_); + } + if (estimatedCopiedBytes_ != 0L) { + output.writeInt64(3, estimatedCopiedBytes_); + } + if (state_ + != com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + .STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (estimatedSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, estimatedSizeBytes_); + } + if (estimatedCopiedBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, estimatedCopiedBytes_); + } + if (state_ + != com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + .STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + size += getUnknownFields().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.admin.v2.CreateClusterMetadata.TableProgress)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress other = + (com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) obj; + + if (getEstimatedSizeBytes() != other.getEstimatedSizeBytes()) return false; + if (getEstimatedCopiedBytes() != other.getEstimatedCopiedBytes()) return false; + if (state_ != other.state_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ESTIMATED_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEstimatedSizeBytes()); + hash = (37 * hash) + ESTIMATED_COPIED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEstimatedCopiedBytes()); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress 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.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress 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.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateClusterMetadata.TableProgress 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Progress info for copying a table's data to the new cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.class, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + estimatedSizeBytes_ = 0L; + estimatedCopiedBytes_ = 0L; + state_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress build() { + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress buildPartial() { + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress result = + new com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.estimatedSizeBytes_ = estimatedSizeBytes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.estimatedCopiedBytes_ = estimatedCopiedBytes_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) { + return mergeFrom( + (com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress other) { + if (other + == com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + .getDefaultInstance()) return this; + if (other.getEstimatedSizeBytes() != 0L) { + setEstimatedSizeBytes(other.getEstimatedSizeBytes()); + } + if (other.getEstimatedCopiedBytes() != 0L) { + setEstimatedCopiedBytes(other.getEstimatedCopiedBytes()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: + { + estimatedSizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: + { + estimatedCopiedBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long estimatedSizeBytes_; + + /** + * + * + *
+       * Estimate of the size of the table to be copied.
+       * 
+ * + * int64 estimated_size_bytes = 2; + * + * @return The estimatedSizeBytes. + */ + @java.lang.Override + public long getEstimatedSizeBytes() { + return estimatedSizeBytes_; + } + + /** + * + * + *
+       * Estimate of the size of the table to be copied.
+       * 
+ * + * int64 estimated_size_bytes = 2; + * + * @param value The estimatedSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setEstimatedSizeBytes(long value) { + + estimatedSizeBytes_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Estimate of the size of the table to be copied.
+       * 
+ * + * int64 estimated_size_bytes = 2; + * + * @return This builder for chaining. + */ + public Builder clearEstimatedSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000001); + estimatedSizeBytes_ = 0L; + onChanged(); + return this; + } + + private long estimatedCopiedBytes_; + + /** + * + * + *
+       * Estimate of the number of bytes copied so far for this table.
+       * This will eventually reach 'estimated_size_bytes' unless the table copy
+       * is CANCELLED.
+       * 
+ * + * int64 estimated_copied_bytes = 3; + * + * @return The estimatedCopiedBytes. + */ + @java.lang.Override + public long getEstimatedCopiedBytes() { + return estimatedCopiedBytes_; + } + + /** + * + * + *
+       * Estimate of the number of bytes copied so far for this table.
+       * This will eventually reach 'estimated_size_bytes' unless the table copy
+       * is CANCELLED.
+       * 
+ * + * int64 estimated_copied_bytes = 3; + * + * @param value The estimatedCopiedBytes to set. + * @return This builder for chaining. + */ + public Builder setEstimatedCopiedBytes(long value) { + + estimatedCopiedBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Estimate of the number of bytes copied so far for this table.
+       * This will eventually reach 'estimated_size_bytes' unless the table copy
+       * is CANCELLED.
+       * 
+ * + * int64 estimated_copied_bytes = 3; + * + * @return This builder for chaining. + */ + public Builder clearEstimatedCopiedBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + estimatedCopiedBytes_ = 0L; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State getState() { + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State result = + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State.forNumber( + state_); + return result == null + ? com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State.UNRECOGNIZED + : result; + } + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State state = 4; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + private static final com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableProgress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateClusterMetadata.TableProgress + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateClusterRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + public static final int TABLES_FIELD_NUMBER = 4; + + private static final class TablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + tables_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + internalGetTables() { + if (tables_ == null) { + return com.google.protobuf.MapField.emptyMapField(TablesDefaultEntryHolder.defaultEntry); + } + return tables_; + } + + public int getTablesCount() { + return internalGetTables().getMap().size(); + } + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public boolean containsTables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTables().getMap().containsKey(key); + } + + /** Use {@link #getTablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTables() { + return getTablesMap(); + } + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTablesMap() { + return internalGetTables().getMap(); + } + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getTablesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + map = internalGetTables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + map = internalGetTables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetTables(), TablesDefaultEntryHolder.defaultEntry, 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + for (java.util.Map.Entry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + entry : internalGetTables().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + tables__ = + TablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, tables__); + } + size += getUnknownFields().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.admin.v2.CreateClusterMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateClusterMetadata other = + (com.google.bigtable.admin.v2.CreateClusterMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!internalGetTables().equals(other.internalGetTables())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + if (!internalGetTables().getMap().isEmpty()) { + hash = (37 * hash) + TABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetTables().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata 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.admin.v2.CreateClusterMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata 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.admin.v2.CreateClusterMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateClusterMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateClusterMetadata) + com.google.bigtable.admin.v2.CreateClusterMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetTables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableTables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterMetadata.class, + com.google.bigtable.admin.v2.CreateClusterMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateClusterMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + internalGetMutableTables().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateClusterMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata build() { + com.google.bigtable.admin.v2.CreateClusterMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateClusterMetadata result = + new com.google.bigtable.admin.v2.CreateClusterMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateClusterMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tables_ = internalGetTables().build(TablesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateClusterMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateClusterMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateClusterMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateClusterMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + internalGetMutableTables().mergeFrom(other.internalGetTables()); + bitField0_ |= 0x00000008; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + tables__ = + input.readMessage( + TablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableTables() + .ensureBuilderMap() + .put(tables__.getKey(), tables__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateClusterRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateClusterRequest, + com.google.bigtable.admin.v2.CreateClusterRequest.Builder, + com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.CreateClusterRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateClusterRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateClusterRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateClusterRequest, + com.google.bigtable.admin.v2.CreateClusterRequest.Builder, + com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateClusterRequest, + com.google.bigtable.admin.v2.CreateClusterRequest.Builder, + com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + private static final class TablesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> { + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress build( + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) { + return (com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) val; + } + return ((com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder) val) + .build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + defaultEntry() { + return TablesDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final TablesConverter tablesConverter = new TablesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder> + tables_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder> + internalGetTables() { + if (tables_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(tablesConverter); + } + return tables_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder> + internalGetMutableTables() { + if (tables_ == null) { + tables_ = new com.google.protobuf.MapFieldBuilder<>(tablesConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return tables_; + } + + public int getTablesCount() { + return internalGetTables().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public boolean containsTables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTables().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getTablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTables() { + return getTablesMap(); + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTablesMap() { + return internalGetTables().getImmutableMap(); + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getTablesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + map = internalGetMutableTables().ensureBuilderMap(); + return map.containsKey(key) ? tablesConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + map = internalGetMutableTables().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return tablesConverter.build(map.get(key)); + } + + public Builder clearTables() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableTables().clear(); + return this; + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder removeTables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTables().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getMutableTables() { + bitField0_ |= 0x00000008; + return internalGetMutableTables().ensureMessageMap(); + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder putTables( + java.lang.String key, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTables().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder putAllTables( + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableTables().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + /** + * + * + *
+     * Keys: the full `name` of each table that existed in the instance when
+     * CreateCluster was first called, i.e.
+     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+     * to the instance by a later API call will be created in the new cluster by
+     * that API call, not this one.
+     *
+     * Values: information on how much of a table's data has been copied to the
+     * newly-created cluster so far.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder + putTablesBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + builderMap = internalGetMutableTables().ensureBuilderMap(); + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) { + entry = + ((com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateClusterMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateClusterMetadata) + private static final com.google.bigtable.admin.v2.CreateClusterMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateClusterMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateClusterMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClusterMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateClusterMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java new file mode 100644 index 000000000000..4f2690fc1285 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateClusterMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateClusterMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + int getTablesCount(); + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + boolean containsTables(java.lang.String key); + + /** Use {@link #getTablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getTables(); + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + java.util.Map + getTablesMap(); + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress defaultValue); + + /** + * + * + *
+   * Keys: the full `name` of each table that existed in the instance when
+   * CreateCluster was first called, i.e.
+   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
+   * to the instance by a later API call will be created in the new cluster by
+   * that API call, not this one.
+   *
+   * Values: information on how much of a table's data has been copied to the
+   * newly-created cluster so far.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrThrow( + java.lang.String key); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java new file mode 100644 index 000000000000..0faa4debd093 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java @@ -0,0 +1,1140 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.CreateCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterRequest} + */ +@com.google.protobuf.Generated +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateClusterRequest) + CreateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateClusterRequest"); + } + + // Use CreateClusterRequest.newBuilder() to construct. + private CreateClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateClusterRequest() { + parent_ = ""; + clusterId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterRequest.class, + com.google.bigtable.admin.v2.CreateClusterRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new
+   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new
+   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + + /** + * + * + *
+   * Required. The ID to be used when referring to the new cluster within its
+   * instance, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID to be used when referring to the new cluster within its
+   * instance, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.Cluster cluster_; + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getCluster() { + return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; + } + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, clusterId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCluster()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, clusterId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); + } + size += getUnknownFields().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.admin.v2.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateClusterRequest other = + (com.google.bigtable.admin.v2.CreateClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClusterId().equals(other.getClusterId())) return false; + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest 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.admin.v2.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest 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.admin.v2.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateClusterRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.CreateCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateClusterRequest) + com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateClusterRequest.class, + com.google.bigtable.admin.v2.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + clusterId_ = ""; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterRequest build() { + com.google.bigtable.admin.v2.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterRequest buildPartial() { + com.google.bigtable.admin.v2.CreateClusterRequest result = + new com.google.bigtable.admin.v2.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateClusterRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateClusterRequest other) { + if (other == com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new
+     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new
+     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new
+     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new
+     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the new
+     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + + /** + * + * + *
+     * Required. The ID to be used when referring to the new cluster within its
+     * instance, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new cluster within its
+     * instance, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new cluster within its
+     * instance, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new cluster within its
+     * instance, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new cluster within its
+     * instance, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + clusterBuilder_; + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.bigtable.admin.v2.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.bigtable.admin.v2.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.bigtable.admin.v2.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + if (cluster_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetClusterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : cluster_; + } + } + + /** + * + * + *
+     * Required. The cluster to be created.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + internalGetClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateClusterRequest) + private static final com.google.bigtable.admin.v2.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateClusterRequest(); + } + + public static com.google.bigtable.admin.v2.CreateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..c41839ef312a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new
+   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the new
+   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new cluster within its
+   * instance, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new cluster within its
+   * instance, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.bigtable.admin.v2.Cluster getCluster(); + + /** + * + * + *
+   * Required. The cluster to be created.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java new file mode 100644 index 000000000000..d3bd2e3bb52d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java @@ -0,0 +1,1257 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceMetadata} + */ +@com.google.protobuf.Generated +public final class CreateInstanceMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateInstanceMetadata) + CreateInstanceMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateInstanceMetadata"); + } + + // Use CreateInstanceMetadata.newBuilder() to construct. + private CreateInstanceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateInstanceMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateInstanceMetadata.class, + com.google.bigtable.admin.v2.CreateInstanceMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateInstanceRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.CreateInstanceMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateInstanceMetadata other = + (com.google.bigtable.admin.v2.CreateInstanceMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata 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.admin.v2.CreateInstanceMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata 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.admin.v2.CreateInstanceMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateInstanceMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateInstanceMetadata) + com.google.bigtable.admin.v2.CreateInstanceMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateInstanceMetadata.class, + com.google.bigtable.admin.v2.CreateInstanceMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateInstanceMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateInstanceMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceMetadata build() { + com.google.bigtable.admin.v2.CreateInstanceMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateInstanceMetadata result = + new com.google.bigtable.admin.v2.CreateInstanceMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateInstanceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateInstanceMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateInstanceMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateInstanceMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateInstanceMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateInstanceRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateInstanceRequest, + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder, + com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.CreateInstanceRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateInstanceRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateInstanceRequest, + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder, + com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateInstanceRequest, + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder, + com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateInstanceMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateInstanceMetadata) + private static final com.google.bigtable.admin.v2.CreateInstanceMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateInstanceMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateInstanceMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateInstanceMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java new file mode 100644 index 000000000000..86720106792d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateInstanceMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateInstanceMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java new file mode 100644 index 000000000000..eceb4ce31246 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java @@ -0,0 +1,1635 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.CreateInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceRequest} + */ +@com.google.protobuf.Generated +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateInstanceRequest"); + } + + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetClusters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateInstanceRequest.class, + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the project in which to create the new
+   * instance. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the project in which to create the new
+   * instance. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + + /** + * + * + *
+   * Required. The ID to be used when referring to the new instance within its
+   * project, e.g., just `myinstance` rather than
+   * `projects/myproject/instances/myinstance`.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID to be used when referring to the new instance within its
+   * project, e.g., just `myinstance` rather than
+   * `projects/myproject/instances/myinstance`.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.Instance instance_; + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance getInstance() { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + + public static final int CLUSTERS_FIELD_NUMBER = 4; + + private static final class ClustersDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Cluster> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + clusters_; + + private com.google.protobuf.MapField + internalGetClusters() { + if (clusters_ == null) { + return com.google.protobuf.MapField.emptyMapField(ClustersDefaultEntryHolder.defaultEntry); + } + return clusters_; + } + + public int getClustersCount() { + return internalGetClusters().getMap().size(); + } + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsClusters(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusters().getMap().containsKey(key); + } + + /** Use {@link #getClustersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getClusters() { + return getClustersMap(); + } + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getClustersMap() { + return internalGetClusters().getMap(); + } + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Cluster getClustersOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Cluster defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusters().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getClustersOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusters().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getInstance()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetClusters(), ClustersDefaultEntryHolder.defaultEntry, 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + for (java.util.Map.Entry entry : + internalGetClusters().getMap().entrySet()) { + com.google.protobuf.MapEntry + clusters__ = + ClustersDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, clusters__); + } + size += getUnknownFields().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.admin.v2.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateInstanceRequest other = + (com.google.bigtable.admin.v2.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!internalGetClusters().equals(other.internalGetClusters())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + if (!internalGetClusters().getMap().isEmpty()) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetClusters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest 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.admin.v2.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest 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.admin.v2.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateInstanceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.CreateInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateInstanceRequest) + com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetClusters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableClusters(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateInstanceRequest.class, + com.google.bigtable.admin.v2.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + internalGetMutableClusters().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceRequest build() { + com.google.bigtable.admin.v2.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateInstanceRequest buildPartial() { + com.google.bigtable.admin.v2.CreateInstanceRequest result = + new com.google.bigtable.admin.v2.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusters_ = internalGetClusters().build(ClustersDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateInstanceRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateInstanceRequest other) { + if (other == com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + internalGetMutableClusters().mergeFrom(other.internalGetClusters()); + bitField0_ |= 0x00000008; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry + clusters__ = + input.readMessage( + ClustersDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableClusters() + .ensureBuilderMap() + .put(clusters__.getKey(), clusters__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the project in which to create the new
+     * instance. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the project in which to create the new
+     * instance. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the project in which to create the new
+     * instance. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the project in which to create the new
+     * instance. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the project in which to create the new
+     * instance. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + + /** + * + * + *
+     * Required. The ID to be used when referring to the new instance within its
+     * project, e.g., just `myinstance` rather than
+     * `projects/myproject/instances/myinstance`.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new instance within its
+     * project, e.g., just `myinstance` rather than
+     * `projects/myproject/instances/myinstance`.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new instance within its
+     * project, e.g., just `myinstance` rather than
+     * `projects/myproject/instances/myinstance`.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new instance within its
+     * project, e.g., just `myinstance` rather than
+     * `projects/myproject/instances/myinstance`.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to be used when referring to the new instance within its
+     * project, e.g., just `myinstance` rather than
+     * `projects/myproject/instances/myinstance`.
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Instance instance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + instanceBuilder_; + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.bigtable.admin.v2.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.bigtable.admin.v2.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetInstanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + } + + /** + * + * + *
+     * Required. The instance to create.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + internalGetInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private static final class ClustersConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.ClusterOrBuilder, + com.google.bigtable.admin.v2.Cluster> { + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster build( + com.google.bigtable.admin.v2.ClusterOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.Cluster) { + return (com.google.bigtable.admin.v2.Cluster) val; + } + return ((com.google.bigtable.admin.v2.Cluster.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry + defaultEntry() { + return ClustersDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final ClustersConverter clustersConverter = new ClustersConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ClusterOrBuilder, + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder> + clusters_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ClusterOrBuilder, + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder> + internalGetClusters() { + if (clusters_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(clustersConverter); + } + return clusters_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ClusterOrBuilder, + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder> + internalGetMutableClusters() { + if (clusters_ == null) { + clusters_ = new com.google.protobuf.MapFieldBuilder<>(clustersConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return clusters_; + } + + public int getClustersCount() { + return internalGetClusters().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsClusters(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusters().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getClustersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getClusters() { + return getClustersMap(); + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getClustersMap() { + return internalGetClusters().getImmutableMap(); + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Cluster getClustersOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Cluster defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableClusters().ensureBuilderMap(); + return map.containsKey(key) ? clustersConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getClustersOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableClusters().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return clustersConverter.build(map.get(key)); + } + + public Builder clearClusters() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableClusters().clear(); + return this; + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeClusters(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableClusters().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableClusters() { + bitField0_ |= 0x00000008; + return internalGetMutableClusters().ensureMessageMap(); + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putClusters(java.lang.String key, com.google.bigtable.admin.v2.Cluster value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableClusters().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllClusters( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableClusters().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + /** + * + * + *
+     * Required. The clusters to be created within the instance, mapped by desired
+     * cluster ID, e.g., just `mycluster` rather than
+     * `projects/myproject/instances/myinstance/clusters/mycluster`.
+     * Fields marked `OutputOnly` must be left blank.
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Cluster.Builder putClustersBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = + internalGetMutableClusters().ensureBuilderMap(); + com.google.bigtable.admin.v2.ClusterOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.Cluster.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.Cluster) { + entry = ((com.google.bigtable.admin.v2.Cluster) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.Cluster.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateInstanceRequest) + private static final com.google.bigtable.admin.v2.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateInstanceRequest(); + } + + public static com.google.bigtable.admin.v2.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..24b2fe6ea277 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,224 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the project in which to create the new
+   * instance. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the project in which to create the new
+   * instance. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new instance within its
+   * project, e.g., just `myinstance` rather than
+   * `projects/myproject/instances/myinstance`.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + + /** + * + * + *
+   * Required. The ID to be used when referring to the new instance within its
+   * project, e.g., just `myinstance` rather than
+   * `projects/myproject/instances/myinstance`.
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.bigtable.admin.v2.Instance getInstance(); + + /** + * + * + *
+   * Required. The instance to create.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getClustersCount(); + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsClusters(java.lang.String key); + + /** Use {@link #getClustersMap()} instead. */ + @java.lang.Deprecated + java.util.Map getClusters(); + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map getClustersMap(); + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.bigtable.admin.v2.Cluster getClustersOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Cluster defaultValue); + + /** + * + * + *
+   * Required. The clusters to be created within the instance, mapped by desired
+   * cluster ID, e.g., just `mycluster` rather than
+   * `projects/myproject/instances/myinstance/clusters/mycluster`.
+   * Fields marked `OutputOnly` must be left blank.
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.Cluster getClustersOrThrow(java.lang.String key); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadata.java new file mode 100644 index 000000000000..c969095d517a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadata.java @@ -0,0 +1,1263 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateLogicalViewMetadata} + */ +@com.google.protobuf.Generated +public final class CreateLogicalViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateLogicalViewMetadata) + CreateLogicalViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateLogicalViewMetadata"); + } + + // Use CreateLogicalViewMetadata.newBuilder() to construct. + private CreateLogicalViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateLogicalViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateLogicalViewMetadata.class, + com.google.bigtable.admin.v2.CreateLogicalViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateLogicalViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.CreateLogicalViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateLogicalViewMetadata other = + (com.google.bigtable.admin.v2.CreateLogicalViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata 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.admin.v2.CreateLogicalViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata 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.admin.v2.CreateLogicalViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateLogicalViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateLogicalViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateLogicalViewMetadata) + com.google.bigtable.admin.v2.CreateLogicalViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateLogicalViewMetadata.class, + com.google.bigtable.admin.v2.CreateLogicalViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateLogicalViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateLogicalViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewMetadata build() { + com.google.bigtable.admin.v2.CreateLogicalViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateLogicalViewMetadata result = + new com.google.bigtable.admin.v2.CreateLogicalViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateLogicalViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateLogicalViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateLogicalViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateLogicalViewMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateLogicalViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateLogicalViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateLogicalViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.CreateLogicalViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.CreateLogicalViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateLogicalViewRequest, + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateLogicalViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateLogicalViewMetadata) + private static final com.google.bigtable.admin.v2.CreateLogicalViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateLogicalViewMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLogicalViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateLogicalViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadataOrBuilder.java new file mode 100644 index 000000000000..ac35bb89f123 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateLogicalViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateLogicalViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateLogicalViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateLogicalViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequest.java new file mode 100644 index 000000000000..7c2b721dbda0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequest.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.CreateLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateLogicalViewRequest} + */ +@com.google.protobuf.Generated +public final class CreateLogicalViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateLogicalViewRequest) + CreateLogicalViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateLogicalViewRequest"); + } + + // Use CreateLogicalViewRequest.newBuilder() to construct. + private CreateLogicalViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateLogicalViewRequest() { + parent_ = ""; + logicalViewId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateLogicalViewRequest.class, + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent instance where this logical view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent instance where this logical view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOGICAL_VIEW_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object logicalViewId_ = ""; + + /** + * + * + *
+   * Required. The ID to use for the logical view, which will become the final
+   * component of the logical view's resource name.
+   * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logicalViewId. + */ + @java.lang.Override + public java.lang.String getLogicalViewId() { + java.lang.Object ref = logicalViewId_; + 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(); + logicalViewId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID to use for the logical view, which will become the final
+   * component of the logical view's resource name.
+   * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logicalViewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogicalViewIdBytes() { + java.lang.Object ref = logicalViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logicalViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOGICAL_VIEW_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.LogicalView logicalView_; + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + @java.lang.Override + public boolean hasLogicalView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView getLogicalView() { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder() { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logicalViewId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, logicalViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getLogicalView()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logicalViewId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, logicalViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLogicalView()); + } + size += getUnknownFields().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.admin.v2.CreateLogicalViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateLogicalViewRequest other = + (com.google.bigtable.admin.v2.CreateLogicalViewRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getLogicalViewId().equals(other.getLogicalViewId())) return false; + if (hasLogicalView() != other.hasLogicalView()) return false; + if (hasLogicalView()) { + if (!getLogicalView().equals(other.getLogicalView())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + LOGICAL_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getLogicalViewId().hashCode(); + if (hasLogicalView()) { + hash = (37 * hash) + LOGICAL_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getLogicalView().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest 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.admin.v2.CreateLogicalViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest 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.admin.v2.CreateLogicalViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateLogicalViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.CreateLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateLogicalViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateLogicalViewRequest) + com.google.bigtable.admin.v2.CreateLogicalViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateLogicalViewRequest.class, + com.google.bigtable.admin.v2.CreateLogicalViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateLogicalViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLogicalViewFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + logicalViewId_ = ""; + logicalView_ = null; + if (logicalViewBuilder_ != null) { + logicalViewBuilder_.dispose(); + logicalViewBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateLogicalViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewRequest build() { + com.google.bigtable.admin.v2.CreateLogicalViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateLogicalViewRequest buildPartial() { + com.google.bigtable.admin.v2.CreateLogicalViewRequest result = + new com.google.bigtable.admin.v2.CreateLogicalViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateLogicalViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.logicalViewId_ = logicalViewId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.logicalView_ = + logicalViewBuilder_ == null ? logicalView_ : logicalViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateLogicalViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateLogicalViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateLogicalViewRequest other) { + if (other == com.google.bigtable.admin.v2.CreateLogicalViewRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLogicalViewId().isEmpty()) { + logicalViewId_ = other.logicalViewId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasLogicalView()) { + mergeLogicalView(other.getLogicalView()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + logicalViewId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetLogicalViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent instance where this logical view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent instance where this logical view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent instance where this logical view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent instance where this logical view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent instance where this logical view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object logicalViewId_ = ""; + + /** + * + * + *
+     * Required. The ID to use for the logical view, which will become the final
+     * component of the logical view's resource name.
+     * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logicalViewId. + */ + public java.lang.String getLogicalViewId() { + java.lang.Object ref = logicalViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logicalViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the logical view, which will become the final
+     * component of the logical view's resource name.
+     * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logicalViewId. + */ + public com.google.protobuf.ByteString getLogicalViewIdBytes() { + java.lang.Object ref = logicalViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logicalViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the logical view, which will become the final
+     * component of the logical view's resource name.
+     * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The logicalViewId to set. + * @return This builder for chaining. + */ + public Builder setLogicalViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logicalViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the logical view, which will become the final
+     * component of the logical view's resource name.
+     * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLogicalViewId() { + logicalViewId_ = getDefaultInstance().getLogicalViewId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the logical view, which will become the final
+     * component of the logical view's resource name.
+     * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for logicalViewId to set. + * @return This builder for chaining. + */ + public Builder setLogicalViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logicalViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.LogicalView logicalView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + logicalViewBuilder_; + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + public boolean hasLogicalView() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + public com.google.bigtable.admin.v2.LogicalView getLogicalView() { + if (logicalViewBuilder_ == null) { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } else { + return logicalViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLogicalView(com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + logicalView_ = value; + } else { + logicalViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLogicalView( + com.google.bigtable.admin.v2.LogicalView.Builder builderForValue) { + if (logicalViewBuilder_ == null) { + logicalView_ = builderForValue.build(); + } else { + logicalViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeLogicalView(com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && logicalView_ != null + && logicalView_ != com.google.bigtable.admin.v2.LogicalView.getDefaultInstance()) { + getLogicalViewBuilder().mergeFrom(value); + } else { + logicalView_ = value; + } + } else { + logicalViewBuilder_.mergeFrom(value); + } + if (logicalView_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLogicalView() { + bitField0_ = (bitField0_ & ~0x00000004); + logicalView_ = null; + if (logicalViewBuilder_ != null) { + logicalViewBuilder_.dispose(); + logicalViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.LogicalView.Builder getLogicalViewBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetLogicalViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder() { + if (logicalViewBuilder_ != null) { + return logicalViewBuilder_.getMessageOrBuilder(); + } else { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + } + + /** + * + * + *
+     * Required. The logical view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + internalGetLogicalViewFieldBuilder() { + if (logicalViewBuilder_ == null) { + logicalViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder>( + getLogicalView(), getParentForChildren(), isClean()); + logicalView_ = null; + } + return logicalViewBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateLogicalViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateLogicalViewRequest) + private static final com.google.bigtable.admin.v2.CreateLogicalViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateLogicalViewRequest(); + } + + public static com.google.bigtable.admin.v2.CreateLogicalViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLogicalViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateLogicalViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequestOrBuilder.java new file mode 100644 index 000000000000..0598ae65530d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateLogicalViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateLogicalViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent instance where this logical view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent instance where this logical view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the logical view, which will become the final
+   * component of the logical view's resource name.
+   * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logicalViewId. + */ + java.lang.String getLogicalViewId(); + + /** + * + * + *
+   * Required. The ID to use for the logical view, which will become the final
+   * component of the logical view's resource name.
+   * 
+ * + * string logical_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logicalViewId. + */ + com.google.protobuf.ByteString getLogicalViewIdBytes(); + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + boolean hasLogicalView(); + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + com.google.bigtable.admin.v2.LogicalView getLogicalView(); + + /** + * + * + *
+   * Required. The logical view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadata.java new file mode 100644 index 000000000000..bc3c2755a2e7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadata.java @@ -0,0 +1,1265 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateMaterializedViewMetadata} + */ +@com.google.protobuf.Generated +public final class CreateMaterializedViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateMaterializedViewMetadata) + CreateMaterializedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateMaterializedViewMetadata"); + } + + // Use CreateMaterializedViewMetadata.newBuilder() to construct. + private CreateMaterializedViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateMaterializedViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.class, + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateMaterializedViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.CreateMaterializedViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata other = + (com.google.bigtable.admin.v2.CreateMaterializedViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata 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.admin.v2.CreateMaterializedViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata 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.admin.v2.CreateMaterializedViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateMaterializedViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateMaterializedViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateMaterializedViewMetadata) + com.google.bigtable.admin.v2.CreateMaterializedViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.class, + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewMetadata build() { + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateMaterializedViewMetadata result = + new com.google.bigtable.admin.v2.CreateMaterializedViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateMaterializedViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateMaterializedViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateMaterializedViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateMaterializedViewMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateMaterializedViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateMaterializedViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateMaterializedViewRequest + .getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateMaterializedViewRequest, + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateMaterializedViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateMaterializedViewMetadata) + private static final com.google.bigtable.admin.v2.CreateMaterializedViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateMaterializedViewMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateMaterializedViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateMaterializedViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadataOrBuilder.java new file mode 100644 index 000000000000..a3eb4ef1f603 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateMaterializedViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateMaterializedViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateMaterializedViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateMaterializedViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequest.java new file mode 100644 index 000000000000..a2edab382b70 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequest.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.CreateMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class CreateMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateMaterializedViewRequest) + CreateMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateMaterializedViewRequest"); + } + + // Use CreateMaterializedViewRequest.newBuilder() to construct. + private CreateMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateMaterializedViewRequest() { + parent_ = ""; + materializedViewId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.class, + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent instance where this materialized view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent instance where this materialized view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATERIALIZED_VIEW_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object materializedViewId_ = ""; + + /** + * + * + *
+   * Required. The ID to use for the materialized view, which will become the
+   * final component of the materialized view's resource name.
+   * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The materializedViewId. + */ + @java.lang.Override + public java.lang.String getMaterializedViewId() { + java.lang.Object ref = materializedViewId_; + 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(); + materializedViewId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID to use for the materialized view, which will become the
+   * final component of the materialized view's resource name.
+   * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for materializedViewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterializedViewIdBytes() { + java.lang.Object ref = materializedViewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATERIALIZED_VIEW_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.MaterializedView materializedView_; + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + @java.lang.Override + public boolean hasMaterializedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView() { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder() { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, materializedViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getMaterializedView()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, materializedViewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMaterializedView()); + } + size += getUnknownFields().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.admin.v2.CreateMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateMaterializedViewRequest other = + (com.google.bigtable.admin.v2.CreateMaterializedViewRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getMaterializedViewId().equals(other.getMaterializedViewId())) return false; + if (hasMaterializedView() != other.hasMaterializedView()) return false; + if (hasMaterializedView()) { + if (!getMaterializedView().equals(other.getMaterializedView())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + MATERIALIZED_VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewId().hashCode(); + if (hasMaterializedView()) { + hash = (37 * hash) + MATERIALIZED_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedView().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest 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.admin.v2.CreateMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest 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.admin.v2.CreateMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateMaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.CreateMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateMaterializedViewRequest) + com.google.bigtable.admin.v2.CreateMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.class, + com.google.bigtable.admin.v2.CreateMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateMaterializedViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMaterializedViewFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + materializedViewId_ = ""; + materializedView_ = null; + if (materializedViewBuilder_ != null) { + materializedViewBuilder_.dispose(); + materializedViewBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest build() { + com.google.bigtable.admin.v2.CreateMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateMaterializedViewRequest buildPartial() { + com.google.bigtable.admin.v2.CreateMaterializedViewRequest result = + new com.google.bigtable.admin.v2.CreateMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.materializedViewId_ = materializedViewId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.materializedView_ = + materializedViewBuilder_ == null ? materializedView_ : materializedViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateMaterializedViewRequest other) { + if (other == com.google.bigtable.admin.v2.CreateMaterializedViewRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMaterializedViewId().isEmpty()) { + materializedViewId_ = other.materializedViewId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasMaterializedView()) { + mergeMaterializedView(other.getMaterializedView()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + materializedViewId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetMaterializedViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent instance where this materialized view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent instance where this materialized view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent instance where this materialized view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent instance where this materialized view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent instance where this materialized view will be created.
+     * Format: `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object materializedViewId_ = ""; + + /** + * + * + *
+     * Required. The ID to use for the materialized view, which will become the
+     * final component of the materialized view's resource name.
+     * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The materializedViewId. + */ + public java.lang.String getMaterializedViewId() { + java.lang.Object ref = materializedViewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + materializedViewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the materialized view, which will become the
+     * final component of the materialized view's resource name.
+     * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for materializedViewId. + */ + public com.google.protobuf.ByteString getMaterializedViewIdBytes() { + java.lang.Object ref = materializedViewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the materialized view, which will become the
+     * final component of the materialized view's resource name.
+     * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The materializedViewId to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + materializedViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the materialized view, which will become the
+     * final component of the materialized view's resource name.
+     * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMaterializedViewId() { + materializedViewId_ = getDefaultInstance().getMaterializedViewId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the materialized view, which will become the
+     * final component of the materialized view's resource name.
+     * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for materializedViewId to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + materializedViewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.MaterializedView materializedView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + materializedViewBuilder_; + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + public boolean hasMaterializedView() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView() { + if (materializedViewBuilder_ == null) { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } else { + return materializedViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaterializedView(com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + materializedView_ = value; + } else { + materializedViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.Builder builderForValue) { + if (materializedViewBuilder_ == null) { + materializedView_ = builderForValue.build(); + } else { + materializedViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMaterializedView(com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && materializedView_ != null + && materializedView_ + != com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance()) { + getMaterializedViewBuilder().mergeFrom(value); + } else { + materializedView_ = value; + } + } else { + materializedViewBuilder_.mergeFrom(value); + } + if (materializedView_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMaterializedView() { + bitField0_ = (bitField0_ & ~0x00000004); + materializedView_ = null; + if (materializedViewBuilder_ != null) { + materializedViewBuilder_.dispose(); + materializedViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.MaterializedView.Builder getMaterializedViewBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMaterializedViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder() { + if (materializedViewBuilder_ != null) { + return materializedViewBuilder_.getMessageOrBuilder(); + } else { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + } + + /** + * + * + *
+     * Required. The materialized view to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + internalGetMaterializedViewFieldBuilder() { + if (materializedViewBuilder_ == null) { + materializedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder>( + getMaterializedView(), getParentForChildren(), isClean()); + materializedView_ = null; + } + return materializedViewBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateMaterializedViewRequest) + private static final com.google.bigtable.admin.v2.CreateMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateMaterializedViewRequest(); + } + + public static com.google.bigtable.admin.v2.CreateMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..5de546a88e63 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent instance where this materialized view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent instance where this materialized view will be created.
+   * Format: `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the materialized view, which will become the
+   * final component of the materialized view's resource name.
+   * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The materializedViewId. + */ + java.lang.String getMaterializedViewId(); + + /** + * + * + *
+   * Required. The ID to use for the materialized view, which will become the
+   * final component of the materialized view's resource name.
+   * 
+ * + * string materialized_view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for materializedViewId. + */ + com.google.protobuf.ByteString getMaterializedViewIdBytes(); + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + boolean hasMaterializedView(); + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + com.google.bigtable.admin.v2.MaterializedView getMaterializedView(); + + /** + * + * + *
+   * Required. The materialized view to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadata.java new file mode 100644 index 000000000000..761e5dbc728c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadata.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by
+ * [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateSchemaBundleMetadata} + */ +@com.google.protobuf.Generated +public final class CreateSchemaBundleMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateSchemaBundleMetadata) + CreateSchemaBundleMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSchemaBundleMetadata"); + } + + // Use CreateSchemaBundleMetadata.newBuilder() to construct. + private CreateSchemaBundleMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSchemaBundleMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.class, + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @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 START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.CreateSchemaBundleMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata other = + (com.google.bigtable.admin.v2.CreateSchemaBundleMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata 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.admin.v2.CreateSchemaBundleMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata 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.admin.v2.CreateSchemaBundleMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateSchemaBundleMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by
+   * [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateSchemaBundleMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateSchemaBundleMetadata) + com.google.bigtable.admin.v2.CreateSchemaBundleMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.class, + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleMetadata build() { + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateSchemaBundleMetadata result = + new com.google.bigtable.admin.v2.CreateSchemaBundleMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateSchemaBundleMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateSchemaBundleMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateSchemaBundleMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateSchemaBundleMetadata other) { + if (other == com.google.bigtable.admin.v2.CreateSchemaBundleMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateSchemaBundleMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateSchemaBundleMetadata) + private static final com.google.bigtable.admin.v2.CreateSchemaBundleMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateSchemaBundleMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSchemaBundleMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateSchemaBundleMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadataOrBuilder.java new file mode 100644 index 000000000000..1e4212e34ac3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadataOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateSchemaBundleMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateSchemaBundleMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequest.java new file mode 100644 index 000000000000..7e6ec60c6910 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequest.java @@ -0,0 +1,1141 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateSchemaBundleRequest} + */ +@com.google.protobuf.Generated +public final class CreateSchemaBundleRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateSchemaBundleRequest) + CreateSchemaBundleRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSchemaBundleRequest"); + } + + // Use CreateSchemaBundleRequest.newBuilder() to construct. + private CreateSchemaBundleRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSchemaBundleRequest() { + parent_ = ""; + schemaBundleId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.class, + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource where this schema bundle will be created.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource where this schema bundle will be created.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+   * Required. The unique ID to use for the schema bundle, which will become the
+   * final component of the schema bundle's resource name.
+   * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaBundleId. + */ + @java.lang.Override + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + 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(); + schemaBundleId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique ID to use for the schema bundle, which will become the
+   * final component of the schema bundle's resource name.
+   * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaBundleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_BUNDLE_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.SchemaBundle schemaBundle_; + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + @java.lang.Override + public boolean hasSchemaBundle() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle() { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder() { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, schemaBundleId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSchemaBundle()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, schemaBundleId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSchemaBundle()); + } + size += getUnknownFields().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.admin.v2.CreateSchemaBundleRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateSchemaBundleRequest other = + (com.google.bigtable.admin.v2.CreateSchemaBundleRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false; + if (hasSchemaBundle() != other.hasSchemaBundle()) return false; + if (hasSchemaBundle()) { + if (!getSchemaBundle().equals(other.getSchemaBundle())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SCHEMA_BUNDLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundleId().hashCode(); + if (hasSchemaBundle()) { + hash = (37 * hash) + SCHEMA_BUNDLE_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundle().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest 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.admin.v2.CreateSchemaBundleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest 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.admin.v2.CreateSchemaBundleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateSchemaBundleRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateSchemaBundleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateSchemaBundleRequest) + com.google.bigtable.admin.v2.CreateSchemaBundleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.class, + com.google.bigtable.admin.v2.CreateSchemaBundleRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateSchemaBundleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSchemaBundleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + schemaBundleId_ = ""; + schemaBundle_ = null; + if (schemaBundleBuilder_ != null) { + schemaBundleBuilder_.dispose(); + schemaBundleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateSchemaBundleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleRequest build() { + com.google.bigtable.admin.v2.CreateSchemaBundleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateSchemaBundleRequest buildPartial() { + com.google.bigtable.admin.v2.CreateSchemaBundleRequest result = + new com.google.bigtable.admin.v2.CreateSchemaBundleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateSchemaBundleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.schemaBundleId_ = schemaBundleId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.schemaBundle_ = + schemaBundleBuilder_ == null ? schemaBundle_ : schemaBundleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateSchemaBundleRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateSchemaBundleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateSchemaBundleRequest other) { + if (other == com.google.bigtable.admin.v2.CreateSchemaBundleRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSchemaBundleId().isEmpty()) { + schemaBundleId_ = other.schemaBundleId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasSchemaBundle()) { + mergeSchemaBundle(other.getSchemaBundle()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + schemaBundleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetSchemaBundleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource where this schema bundle will be created.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource where this schema bundle will be created.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource where this schema bundle will be created.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource where this schema bundle will be created.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource where this schema bundle will be created.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+     * Required. The unique ID to use for the schema bundle, which will become the
+     * final component of the schema bundle's resource name.
+     * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaBundleId. + */ + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaBundleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique ID to use for the schema bundle, which will become the
+     * final component of the schema bundle's resource name.
+     * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaBundleId. + */ + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique ID to use for the schema bundle, which will become the
+     * final component of the schema bundle's resource name.
+     * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundleId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID to use for the schema bundle, which will become the
+     * final component of the schema bundle's resource name.
+     * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSchemaBundleId() { + schemaBundleId_ = getDefaultInstance().getSchemaBundleId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique ID to use for the schema bundle, which will become the
+     * final component of the schema bundle's resource name.
+     * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaBundleId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.SchemaBundle schemaBundle_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + schemaBundleBuilder_; + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + public boolean hasSchemaBundle() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle() { + if (schemaBundleBuilder_ == null) { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } else { + return schemaBundleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchemaBundle(com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundle_ = value; + } else { + schemaBundleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.Builder builderForValue) { + if (schemaBundleBuilder_ == null) { + schemaBundle_ = builderForValue.build(); + } else { + schemaBundleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSchemaBundle(com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundleBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && schemaBundle_ != null + && schemaBundle_ != com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance()) { + getSchemaBundleBuilder().mergeFrom(value); + } else { + schemaBundle_ = value; + } + } else { + schemaBundleBuilder_.mergeFrom(value); + } + if (schemaBundle_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSchemaBundle() { + bitField0_ = (bitField0_ & ~0x00000004); + schemaBundle_ = null; + if (schemaBundleBuilder_ != null) { + schemaBundleBuilder_.dispose(); + schemaBundleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.SchemaBundle.Builder getSchemaBundleBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetSchemaBundleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder() { + if (schemaBundleBuilder_ != null) { + return schemaBundleBuilder_.getMessageOrBuilder(); + } else { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + } + + /** + * + * + *
+     * Required. The schema bundle to create.
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + internalGetSchemaBundleFieldBuilder() { + if (schemaBundleBuilder_ == null) { + schemaBundleBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder>( + getSchemaBundle(), getParentForChildren(), isClean()); + schemaBundle_ = null; + } + return schemaBundleBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateSchemaBundleRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateSchemaBundleRequest) + private static final com.google.bigtable.admin.v2.CreateSchemaBundleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateSchemaBundleRequest(); + } + + public static com.google.bigtable.admin.v2.CreateSchemaBundleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSchemaBundleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateSchemaBundleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequestOrBuilder.java new file mode 100644 index 000000000000..e8d1d6efe850 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateSchemaBundleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateSchemaBundleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this schema bundle will be created.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource where this schema bundle will be created.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The unique ID to use for the schema bundle, which will become the
+   * final component of the schema bundle's resource name.
+   * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaBundleId. + */ + java.lang.String getSchemaBundleId(); + + /** + * + * + *
+   * Required. The unique ID to use for the schema bundle, which will become the
+   * final component of the schema bundle's resource name.
+   * 
+ * + * string schema_bundle_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaBundleId. + */ + com.google.protobuf.ByteString getSchemaBundleIdBytes(); + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + boolean hasSchemaBundle(); + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle(); + + /** + * + * + *
+   * Required. The schema bundle to create.
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java new file mode 100644 index 000000000000..34d2b9d5c503 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java @@ -0,0 +1,1289 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by CreateTableFromSnapshot.
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} + */ +@com.google.protobuf.Generated +public final class CreateTableFromSnapshotMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + CreateTableFromSnapshotMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateTableFromSnapshotMetadata"); + } + + // Use CreateTableFromSnapshotMetadata.newBuilder() to construct. + private CreateTableFromSnapshotMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateTableFromSnapshotMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.class, + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.CreateTableFromSnapshotMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata other = + (com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata 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.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata 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.admin.v2.CreateTableFromSnapshotMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateTableFromSnapshotMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by CreateTableFromSnapshot.
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.class, + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata build() { + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata buildPartial() { + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata result = + new com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata other) { + if (other + == com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest + .getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this CreateTableFromSnapshot
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + private static final com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTableFromSnapshotMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateTableFromSnapshotMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java new file mode 100644 index 000000000000..e8cbf1448f18 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateTableFromSnapshotMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this CreateTableFromSnapshot
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1; + */ + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder + getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java new file mode 100644 index 000000000000..9dd2cb8598a0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java @@ -0,0 +1,1050 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotRequest} + */ +@com.google.protobuf.Generated +public final class CreateTableFromSnapshotRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + CreateTableFromSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateTableFromSnapshotRequest"); + } + + // Use CreateTableFromSnapshotRequest.newBuilder() to construct. + private CreateTableFromSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateTableFromSnapshotRequest() { + parent_ = ""; + tableId_ = ""; + sourceSnapshot_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.class, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableId_ = ""; + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + @java.lang.Override + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + 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(); + tableId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_SNAPSHOT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceSnapshot_ = ""; + + /** + * + * + *
+   * Required. The unique name of the snapshot from which to restore the table.
+   * The snapshot and the table must be in the same instance. Values are of the
+   * form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceSnapshot. + */ + @java.lang.Override + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = sourceSnapshot_; + 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(); + sourceSnapshot_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the snapshot from which to restore the table.
+   * The snapshot and the table must be in the same instance. Values are of the
+   * form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceSnapshot. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = sourceSnapshot_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceSnapshot_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceSnapshot_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sourceSnapshot_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceSnapshot_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sourceSnapshot_); + } + size += getUnknownFields().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.admin.v2.CreateTableFromSnapshotRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest other = + (com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getTableId().equals(other.getTableId())) return false; + if (!getSourceSnapshot().equals(other.getSourceSnapshot())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTableId().hashCode(); + hash = (37 * hash) + SOURCE_SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSourceSnapshot().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest 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.admin.v2.CreateTableFromSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest 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.admin.v2.CreateTableFromSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateTableFromSnapshotRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.class, + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + tableId_ = ""; + sourceSnapshot_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest build() { + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest buildPartial() { + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest result = + new com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableId_ = tableId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceSnapshot_ = sourceSnapshot_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest other) { + if (other == com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSourceSnapshot().isEmpty()) { + sourceSnapshot_ = other.sourceSnapshot_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + sourceSnapshot_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableId_ = ""; + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableId to set. + * @return This builder for chaining. + */ + public Builder setTableId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableId to set. + * @return This builder for chaining. + */ + public Builder setTableIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object sourceSnapshot_ = ""; + + /** + * + * + *
+     * Required. The unique name of the snapshot from which to restore the table.
+     * The snapshot and the table must be in the same instance. Values are of the
+     * form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceSnapshot. + */ + public java.lang.String getSourceSnapshot() { + java.lang.Object ref = sourceSnapshot_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceSnapshot_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the snapshot from which to restore the table.
+     * The snapshot and the table must be in the same instance. Values are of the
+     * form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceSnapshot. + */ + public com.google.protobuf.ByteString getSourceSnapshotBytes() { + java.lang.Object ref = sourceSnapshot_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceSnapshot_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the snapshot from which to restore the table.
+     * The snapshot and the table must be in the same instance. Values are of the
+     * form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshot(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceSnapshot_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the snapshot from which to restore the table.
+     * The snapshot and the table must be in the same instance. Values are of the
+     * form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSourceSnapshot() { + sourceSnapshot_ = getDefaultInstance().getSourceSnapshot(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the snapshot from which to restore the table.
+     * The snapshot and the table must be in the same instance. Values are of the
+     * form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for sourceSnapshot to set. + * @return This builder for chaining. + */ + public Builder setSourceSnapshotBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceSnapshot_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + private static final com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(); + } + + public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTableFromSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateTableFromSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..eace6ad4775d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateTableFromSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + java.lang.String getTableId(); + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + com.google.protobuf.ByteString getTableIdBytes(); + + /** + * + * + *
+   * Required. The unique name of the snapshot from which to restore the table.
+   * The snapshot and the table must be in the same instance. Values are of the
+   * form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sourceSnapshot. + */ + java.lang.String getSourceSnapshot(); + + /** + * + * + *
+   * Required. The unique name of the snapshot from which to restore the table.
+   * The snapshot and the table must be in the same instance. Values are of the
+   * form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string source_snapshot = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sourceSnapshot. + */ + com.google.protobuf.ByteString getSourceSnapshotBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java new file mode 100644 index 000000000000..4b94f3f4068b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java @@ -0,0 +1,2501 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest} + */ +@com.google.protobuf.Generated +public final class CreateTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateTableRequest) + CreateTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateTableRequest"); + } + + // Use CreateTableRequest.newBuilder() to construct. + private CreateTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateTableRequest() { + parent_ = ""; + tableId_ = ""; + initialSplits_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableRequest.class, + com.google.bigtable.admin.v2.CreateTableRequest.Builder.class); + } + + public interface SplitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateTableRequest.Split) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Row key to use as an initial tablet boundary.
+     * 
+ * + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + } + + /** + * + * + *
+   * An initial split point for a newly created table.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest.Split} + */ + public static final class Split extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateTableRequest.Split) + SplitOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Split"); + } + + // Use Split.newBuilder() to construct. + private Split(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Split() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableRequest.Split.class, + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Row key to use as an initial tablet boundary.
+     * 
+ * + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + 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 (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + size += getUnknownFields().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.admin.v2.CreateTableRequest.Split)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateTableRequest.Split other = + (com.google.bigtable.admin.v2.CreateTableRequest.Split) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split 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.admin.v2.CreateTableRequest.Split parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split 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.admin.v2.CreateTableRequest.Split parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateTableRequest.Split 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * An initial split point for a newly created table.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest.Split} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateTableRequest.Split) + com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableRequest.Split.class, + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest.Split getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest.Split build() { + com.google.bigtable.admin.v2.CreateTableRequest.Split result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest.Split buildPartial() { + com.google.bigtable.admin.v2.CreateTableRequest.Split result = + new com.google.bigtable.admin.v2.CreateTableRequest.Split(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateTableRequest.Split result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateTableRequest.Split) { + return mergeFrom((com.google.bigtable.admin.v2.CreateTableRequest.Split) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest.Split other) { + if (other == com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * Row key to use as an initial tablet boundary.
+       * 
+ * + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * + * + *
+       * Row key to use as an initial tablet boundary.
+       * 
+ * + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Row key to use as an initial tablet boundary.
+       * 
+ * + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableRequest.Split) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateTableRequest.Split) + private static final com.google.bigtable.admin.v2.CreateTableRequest.Split DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateTableRequest.Split(); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest.Split getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Split parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateTableRequest.Split getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableId_ = ""; + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * Maximum 50 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + @java.lang.Override + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + 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(); + tableId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * Maximum 50 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.Table table_; + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + @java.lang.Override + public boolean hasTable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table getTable() { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + + public static final int INITIAL_SPLITS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List initialSplits_; + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + @java.lang.Override + public java.util.List + getInitialSplitsList() { + return initialSplits_; + } + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + @java.lang.Override + public java.util.List + getInitialSplitsOrBuilderList() { + return initialSplits_; + } + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + @java.lang.Override + public int getInitialSplitsCount() { + return initialSplits_.size(); + } + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(int index) { + return initialSplits_.get(index); + } + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitialSplitsOrBuilder( + int index) { + return initialSplits_.get(index); + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTable()); + } + for (int i = 0; i < initialSplits_.size(); i++) { + output.writeMessage(4, initialSplits_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTable()); + } + for (int i = 0; i < initialSplits_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, initialSplits_.get(i)); + } + size += getUnknownFields().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.admin.v2.CreateTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.CreateTableRequest other = + (com.google.bigtable.admin.v2.CreateTableRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getTableId().equals(other.getTableId())) return false; + if (hasTable() != other.hasTable()) return false; + if (hasTable()) { + if (!getTable().equals(other.getTable())) return false; + } + if (!getInitialSplitsList().equals(other.getInitialSplitsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTableId().hashCode(); + if (hasTable()) { + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + } + if (getInitialSplitsCount() > 0) { + hash = (37 * hash) + INITIAL_SPLITS_FIELD_NUMBER; + hash = (53 * hash) + getInitialSplitsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest 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.admin.v2.CreateTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest 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.admin.v2.CreateTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.CreateTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.CreateTableRequest) + com.google.bigtable.admin.v2.CreateTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.CreateTableRequest.class, + com.google.bigtable.admin.v2.CreateTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTableFieldBuilder(); + internalGetInitialSplitsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + tableId_ = ""; + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); + tableBuilder_ = null; + } + if (initialSplitsBuilder_ == null) { + initialSplits_ = java.util.Collections.emptyList(); + } else { + initialSplits_ = null; + initialSplitsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_CreateTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest build() { + com.google.bigtable.admin.v2.CreateTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.CreateTableRequest buildPartial() { + com.google.bigtable.admin.v2.CreateTableRequest result = + new com.google.bigtable.admin.v2.CreateTableRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.CreateTableRequest result) { + if (initialSplitsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + initialSplits_ = java.util.Collections.unmodifiableList(initialSplits_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.initialSplits_ = initialSplits_; + } else { + result.initialSplits_ = initialSplitsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.CreateTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableId_ = tableId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.table_ = tableBuilder_ == null ? table_ : tableBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.CreateTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.CreateTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) { + if (other == com.google.bigtable.admin.v2.CreateTableRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasTable()) { + mergeTable(other.getTable()); + } + if (initialSplitsBuilder_ == null) { + if (!other.initialSplits_.isEmpty()) { + if (initialSplits_.isEmpty()) { + initialSplits_ = other.initialSplits_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureInitialSplitsIsMutable(); + initialSplits_.addAll(other.initialSplits_); + } + onChanged(); + } + } else { + if (!other.initialSplits_.isEmpty()) { + if (initialSplitsBuilder_.isEmpty()) { + initialSplitsBuilder_.dispose(); + initialSplitsBuilder_ = null; + initialSplits_ = other.initialSplits_; + bitField0_ = (bitField0_ & ~0x00000008); + initialSplitsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInitialSplitsFieldBuilder() + : null; + } else { + initialSplitsBuilder_.addAllMessages(other.initialSplits_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetTableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.bigtable.admin.v2.CreateTableRequest.Split m = + input.readMessage( + com.google.bigtable.admin.v2.CreateTableRequest.Split.parser(), + extensionRegistry); + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + initialSplits_.add(m); + } else { + initialSplitsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance in which to create the table.
+     * Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableId_ = ""; + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * Maximum 50 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * Maximum 50 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * Maximum 50 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableId to set. + * @return This builder for chaining. + */ + public Builder setTableId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * Maximum 50 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name by which the new table should be referred to within the
+     * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+     * Maximum 50 characters.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableId to set. + * @return This builder for chaining. + */ + public Builder setTableIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Table table_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + tableBuilder_; + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + public boolean hasTable() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + public com.google.bigtable.admin.v2.Table getTable() { + if (tableBuilder_ == null) { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } else { + return tableBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTable(com.google.bigtable.admin.v2.Table value) { + if (tableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + } else { + tableBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTable(com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (tableBuilder_ == null) { + table_ = builderForValue.build(); + } else { + tableBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTable(com.google.bigtable.admin.v2.Table value) { + if (tableBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && table_ != null + && table_ != com.google.bigtable.admin.v2.Table.getDefaultInstance()) { + getTableBuilder().mergeFrom(value); + } else { + table_ = value; + } + } else { + tableBuilder_.mergeFrom(value); + } + if (table_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTable() { + bitField0_ = (bitField0_ & ~0x00000004); + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); + tableBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Table.Builder getTableBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTableFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { + if (tableBuilder_ != null) { + return tableBuilder_.getMessageOrBuilder(); + } else { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + } + + /** + * + * + *
+     * Required. The Table to create.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + internalGetTableFieldBuilder() { + if (tableBuilder_ == null) { + tableBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder>( + getTable(), getParentForChildren(), isClean()); + table_ = null; + } + return tableBuilder_; + } + + private java.util.List initialSplits_ = + java.util.Collections.emptyList(); + + private void ensureInitialSplitsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + initialSplits_ = + new java.util.ArrayList( + initialSplits_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.CreateTableRequest.Split, + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder, + com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder> + initialSplitsBuilder_; + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public java.util.List + getInitialSplitsList() { + if (initialSplitsBuilder_ == null) { + return java.util.Collections.unmodifiableList(initialSplits_); + } else { + return initialSplitsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public int getInitialSplitsCount() { + if (initialSplitsBuilder_ == null) { + return initialSplits_.size(); + } else { + return initialSplitsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(int index) { + if (initialSplitsBuilder_ == null) { + return initialSplits_.get(index); + } else { + return initialSplitsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder setInitialSplits( + int index, com.google.bigtable.admin.v2.CreateTableRequest.Split value) { + if (initialSplitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSplitsIsMutable(); + initialSplits_.set(index, value); + onChanged(); + } else { + initialSplitsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder setInitialSplits( + int index, com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder builderForValue) { + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + initialSplits_.set(index, builderForValue.build()); + onChanged(); + } else { + initialSplitsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder addInitialSplits(com.google.bigtable.admin.v2.CreateTableRequest.Split value) { + if (initialSplitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSplitsIsMutable(); + initialSplits_.add(value); + onChanged(); + } else { + initialSplitsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder addInitialSplits( + int index, com.google.bigtable.admin.v2.CreateTableRequest.Split value) { + if (initialSplitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInitialSplitsIsMutable(); + initialSplits_.add(index, value); + onChanged(); + } else { + initialSplitsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder addInitialSplits( + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder builderForValue) { + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + initialSplits_.add(builderForValue.build()); + onChanged(); + } else { + initialSplitsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder addInitialSplits( + int index, com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder builderForValue) { + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + initialSplits_.add(index, builderForValue.build()); + onChanged(); + } else { + initialSplitsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder addAllInitialSplits( + java.lang.Iterable + values) { + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, initialSplits_); + onChanged(); + } else { + initialSplitsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder clearInitialSplits() { + if (initialSplitsBuilder_ == null) { + initialSplits_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + initialSplitsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public Builder removeInitialSplits(int index) { + if (initialSplitsBuilder_ == null) { + ensureInitialSplitsIsMutable(); + initialSplits_.remove(index); + onChanged(); + } else { + initialSplitsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder getInitialSplitsBuilder( + int index) { + return internalGetInitialSplitsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitialSplitsOrBuilder( + int index) { + if (initialSplitsBuilder_ == null) { + return initialSplits_.get(index); + } else { + return initialSplitsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public java.util.List + getInitialSplitsOrBuilderList() { + if (initialSplitsBuilder_ != null) { + return initialSplitsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(initialSplits_); + } + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialSplitsBuilder() { + return internalGetInitialSplitsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()); + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialSplitsBuilder( + int index) { + return internalGetInitialSplitsFieldBuilder() + .addBuilder( + index, com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()); + } + + /** + * + * + *
+     * The optional list of row keys that will be used to initially split the
+     * table into several tablets (tablets are similar to HBase regions).
+     * Given two split keys, `s1` and `s2`, three tablets will be created,
+     * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+     *
+     * Example:
+     *
+     * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+     * `"other", "zz"]`
+     * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+     * * Key assignment:
+     * - Tablet 1 `[, apple)                => {"a"}.`
+     * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+     * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+     * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+     * - Tablet 5 `[other, )                => {"other", "zz"}.`
+     * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + public java.util.List + getInitialSplitsBuilderList() { + return internalGetInitialSplitsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.CreateTableRequest.Split, + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder, + com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder> + internalGetInitialSplitsFieldBuilder() { + if (initialSplitsBuilder_ == null) { + initialSplitsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.CreateTableRequest.Split, + com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder, + com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder>( + initialSplits_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + initialSplits_ = null; + } + return initialSplitsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateTableRequest) + private static final com.google.bigtable.admin.v2.CreateTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.CreateTableRequest(); + } + + public static com.google.bigtable.admin.v2.CreateTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.CreateTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java new file mode 100644 index 000000000000..2f7c55ecf56a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java @@ -0,0 +1,262 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface CreateTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.CreateTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance in which to create the table.
+   * Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * Maximum 50 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + java.lang.String getTableId(); + + /** + * + * + *
+   * Required. The name by which the new table should be referred to within the
+   * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
+   * Maximum 50 characters.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + com.google.protobuf.ByteString getTableIdBytes(); + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + boolean hasTable(); + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + com.google.bigtable.admin.v2.Table getTable(); + + /** + * + * + *
+   * Required. The Table to create.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder(); + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + java.util.List getInitialSplitsList(); + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(int index); + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + int getInitialSplitsCount(); + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + java.util.List + getInitialSplitsOrBuilderList(); + + /** + * + * + *
+   * The optional list of row keys that will be used to initially split the
+   * table into several tablets (tablets are similar to HBase regions).
+   * Given two split keys, `s1` and `s2`, three tablets will be created,
+   * spanning the key ranges: `[, s1), [s1, s2), [s2, )`.
+   *
+   * Example:
+   *
+   * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
+   * `"other", "zz"]`
+   * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
+   * * Key assignment:
+   * - Tablet 1 `[, apple)                => {"a"}.`
+   * - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
+   * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
+   * - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
+   * - Tablet 5 `[other, )                => {"other", "zz"}.`
+   * 
+ * + * repeated .google.bigtable.admin.v2.CreateTableRequest.Split initial_splits = 4; + */ + com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitialSplitsOrBuilder( + int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java new file mode 100644 index 000000000000..77e24428e667 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java @@ -0,0 +1,399 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Checks that all writes before the consistency token was generated in the same
+ * cluster are readable by Databoost.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DataBoostReadLocalWrites} + */ +@com.google.protobuf.Generated +public final class DataBoostReadLocalWrites extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DataBoostReadLocalWrites) + DataBoostReadLocalWritesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataBoostReadLocalWrites"); + } + + // Use DataBoostReadLocalWrites.newBuilder() to construct. + private DataBoostReadLocalWrites(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataBoostReadLocalWrites() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.class, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.DataBoostReadLocalWrites)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DataBoostReadLocalWrites other = + (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites 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.admin.v2.DataBoostReadLocalWrites parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites 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.admin.v2.DataBoostReadLocalWrites parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DataBoostReadLocalWrites 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Checks that all writes before the consistency token was generated in the same
+   * cluster are readable by Databoost.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DataBoostReadLocalWrites} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DataBoostReadLocalWrites) + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.class, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DataBoostReadLocalWrites.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DataBoostReadLocalWrites_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites build() { + com.google.bigtable.admin.v2.DataBoostReadLocalWrites result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites buildPartial() { + com.google.bigtable.admin.v2.DataBoostReadLocalWrites result = + new com.google.bigtable.admin.v2.DataBoostReadLocalWrites(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DataBoostReadLocalWrites) { + return mergeFrom((com.google.bigtable.admin.v2.DataBoostReadLocalWrites) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DataBoostReadLocalWrites other) { + if (other == com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DataBoostReadLocalWrites) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DataBoostReadLocalWrites) + private static final com.google.bigtable.admin.v2.DataBoostReadLocalWrites DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DataBoostReadLocalWrites(); + } + + public static com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataBoostReadLocalWrites parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DataBoostReadLocalWrites getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.java new file mode 100644 index 000000000000..5fca3d815dd7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DataBoostReadLocalWritesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DataBoostReadLocalWrites) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java new file mode 100644 index 000000000000..2c21eeab55d6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java @@ -0,0 +1,721 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.DeleteAppProfile.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteAppProfileRequest} + */ +@com.google.protobuf.Generated +public final class DeleteAppProfileRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteAppProfileRequest) + DeleteAppProfileRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteAppProfileRequest"); + } + + // Use DeleteAppProfileRequest.newBuilder() to construct. + private DeleteAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteAppProfileRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteAppProfileRequest.class, + com.google.bigtable.admin.v2.DeleteAppProfileRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the app profile to be deleted. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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 app profile to be deleted. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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 IGNORE_WARNINGS_FIELD_NUMBER = 2; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * Required. If true, ignore safety checks when deleting the app profile.
+   * 
+ * + * bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (ignoreWarnings_ != false) { + output.writeBool(2, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.DeleteAppProfileRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteAppProfileRequest other = + (com.google.bigtable.admin.v2.DeleteAppProfileRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest 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.admin.v2.DeleteAppProfileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest 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.admin.v2.DeleteAppProfileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteAppProfileRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.DeleteAppProfile.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteAppProfileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteAppProfileRequest) + com.google.bigtable.admin.v2.DeleteAppProfileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteAppProfileRequest.class, + com.google.bigtable.admin.v2.DeleteAppProfileRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteAppProfileRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAppProfileRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteAppProfileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAppProfileRequest build() { + com.google.bigtable.admin.v2.DeleteAppProfileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAppProfileRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteAppProfileRequest result = + new com.google.bigtable.admin.v2.DeleteAppProfileRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteAppProfileRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteAppProfileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteAppProfileRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteAppProfileRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the app profile to be deleted. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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 app profile to be deleted. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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 app profile to be deleted. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the app profile to be deleted. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the app profile to be deleted. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * Required. If true, ignore safety checks when deleting the app profile.
+     * 
+ * + * bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * Required. If true, ignore safety checks when deleting the app profile.
+     * 
+ * + * bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. If true, ignore safety checks when deleting the app profile.
+     * 
+ * + * bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000002); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteAppProfileRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteAppProfileRequest) + private static final com.google.bigtable.admin.v2.DeleteAppProfileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteAppProfileRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteAppProfileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAppProfileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteAppProfileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java new file mode 100644 index 000000000000..5a64645a06e3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteAppProfileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteAppProfileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the app profile to be deleted. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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 app profile to be deleted. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. If true, ignore safety checks when deleting the app profile.
+   * 
+ * + * bool ignore_warnings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java new file mode 100644 index 000000000000..9c9bd001cb00 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java @@ -0,0 +1,837 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class DeleteAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + DeleteAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteAuthorizedViewRequest"); + } + + // Use DeleteAuthorizedViewRequest.newBuilder() to construct. + private DeleteAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteAuthorizedViewRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the AuthorizedView to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 AuthorizedView to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The current etag of the AuthorizedView.
+   * If an etag is provided and does not match the current etag of the
+   * AuthorizedView, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The current etag of the AuthorizedView.
+   * If an etag is provided and does not match the current etag of the
+   * AuthorizedView, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + size += getUnknownFields().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.admin.v2.DeleteAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest other = + (com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest 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.admin.v2.DeleteAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest 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.admin.v2.DeleteAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteAuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest build() { + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest result = + new com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the AuthorizedView to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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 AuthorizedView to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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 AuthorizedView to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the AuthorizedView to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the AuthorizedView to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The current etag of the AuthorizedView.
+     * If an etag is provided and does not match the current etag of the
+     * AuthorizedView, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the AuthorizedView.
+     * If an etag is provided and does not match the current etag of the
+     * AuthorizedView, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the AuthorizedView.
+     * If an etag is provided and does not match the current etag of the
+     * AuthorizedView, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the AuthorizedView.
+     * If an etag is provided and does not match the current etag of the
+     * AuthorizedView, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the AuthorizedView.
+     * If an etag is provided and does not match the current etag of the
+     * AuthorizedView, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + private static final com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..ecce4aa27846 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the AuthorizedView to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 AuthorizedView to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The current etag of the AuthorizedView.
+   * If an etag is provided and does not match the current etag of the
+   * AuthorizedView, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The current etag of the AuthorizedView.
+   * If an etag is provided and does not match the current etag of the
+   * AuthorizedView, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java new file mode 100644 index 000000000000..2ff3407d76f3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteBackupRequest} + */ +@com.google.protobuf.Generated +public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteBackupRequest) + DeleteBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteBackupRequest"); + } + + // Use DeleteBackupRequest.newBuilder() to construct. + private DeleteBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteBackupRequest.class, + com.google.bigtable.admin.v2.DeleteBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * 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. Name of the backup to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.DeleteBackupRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteBackupRequest other = + (com.google.bigtable.admin.v2.DeleteBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest 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.admin.v2.DeleteBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest 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.admin.v2.DeleteBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteBackupRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteBackupRequest) + com.google.bigtable.admin.v2.DeleteBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteBackupRequest.class, + com.google.bigtable.admin.v2.DeleteBackupRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteBackupRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteBackupRequest build() { + com.google.bigtable.admin.v2.DeleteBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteBackupRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteBackupRequest result = + new com.google.bigtable.admin.v2.DeleteBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteBackupRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteBackupRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteBackupRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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. Name of the backup to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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. Name of the backup to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the backup to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteBackupRequest) + private static final com.google.bigtable.admin.v2.DeleteBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteBackupRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java new file mode 100644 index 000000000000..354f00f56dee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Name of the backup to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java new file mode 100644 index 000000000000..8496a9a7f7b3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.DeleteCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteClusterRequest} + */ +@com.google.protobuf.Generated +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteClusterRequest) + DeleteClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteClusterRequest"); + } + + // Use DeleteClusterRequest.newBuilder() to construct. + private DeleteClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteClusterRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteClusterRequest.class, + com.google.bigtable.admin.v2.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the cluster to be deleted. Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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 cluster to be deleted. Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteClusterRequest other = + (com.google.bigtable.admin.v2.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest 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.admin.v2.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest 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.admin.v2.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteClusterRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.DeleteCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteClusterRequest) + com.google.bigtable.admin.v2.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteClusterRequest.class, + com.google.bigtable.admin.v2.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteClusterRequest build() { + com.google.bigtable.admin.v2.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteClusterRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteClusterRequest result = + new com.google.bigtable.admin.v2.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteClusterRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteClusterRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the cluster to be deleted. Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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 cluster to be deleted. Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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 cluster to be deleted. Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the cluster to be deleted. Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the cluster to be deleted. Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteClusterRequest) + private static final com.google.bigtable.admin.v2.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteClusterRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..8028e5c71642 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the cluster to be deleted. Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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 cluster to be deleted. Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java new file mode 100644 index 000000000000..7b8e3640756f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.DeleteInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteInstanceRequest} + */ +@com.google.protobuf.Generated +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteInstanceRequest"); + } + + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteInstanceRequest.class, + com.google.bigtable.admin.v2.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance to be deleted.
+   * 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 be deleted.
+   * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteInstanceRequest other = + (com.google.bigtable.admin.v2.DeleteInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest 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.admin.v2.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest 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.admin.v2.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteInstanceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.DeleteInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteInstanceRequest) + com.google.bigtable.admin.v2.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteInstanceRequest.class, + com.google.bigtable.admin.v2.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteInstanceRequest build() { + com.google.bigtable.admin.v2.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteInstanceRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteInstanceRequest result = + new com.google.bigtable.admin.v2.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteInstanceRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteInstanceRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance to be deleted.
+     * 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 be deleted.
+     * 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 be deleted.
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance to be deleted.
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance to be deleted.
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteInstanceRequest) + private static final com.google.bigtable.admin.v2.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteInstanceRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..3d06b3fef602 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance to be deleted.
+   * 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 be deleted.
+   * 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(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequest.java new file mode 100644 index 000000000000..a57bf2c2c8ed --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequest.java @@ -0,0 +1,835 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.DeleteLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteLogicalViewRequest} + */ +@com.google.protobuf.Generated +public final class DeleteLogicalViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteLogicalViewRequest) + DeleteLogicalViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteLogicalViewRequest"); + } + + // Use DeleteLogicalViewRequest.newBuilder() to construct. + private DeleteLogicalViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteLogicalViewRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest.class, + com.google.bigtable.admin.v2.DeleteLogicalViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the logical view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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 logical view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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 ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The current etag of the logical view.
+   * If an etag is provided and does not match the current etag of the
+   * logical view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The current etag of the logical view.
+   * If an etag is provided and does not match the current etag of the
+   * logical view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + size += getUnknownFields().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.admin.v2.DeleteLogicalViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteLogicalViewRequest other = + (com.google.bigtable.admin.v2.DeleteLogicalViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest 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.admin.v2.DeleteLogicalViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest 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.admin.v2.DeleteLogicalViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteLogicalViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.DeleteLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteLogicalViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteLogicalViewRequest) + com.google.bigtable.admin.v2.DeleteLogicalViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteLogicalViewRequest.class, + com.google.bigtable.admin.v2.DeleteLogicalViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteLogicalViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteLogicalViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteLogicalViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteLogicalViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteLogicalViewRequest build() { + com.google.bigtable.admin.v2.DeleteLogicalViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteLogicalViewRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteLogicalViewRequest result = + new com.google.bigtable.admin.v2.DeleteLogicalViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteLogicalViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteLogicalViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteLogicalViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteLogicalViewRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteLogicalViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the logical view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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 logical view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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 logical view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the logical view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the logical view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The current etag of the logical view.
+     * If an etag is provided and does not match the current etag of the
+     * logical view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the logical view.
+     * If an etag is provided and does not match the current etag of the
+     * logical view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the logical view.
+     * If an etag is provided and does not match the current etag of the
+     * logical view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the logical view.
+     * If an etag is provided and does not match the current etag of the
+     * logical view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the logical view.
+     * If an etag is provided and does not match the current etag of the
+     * logical view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteLogicalViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteLogicalViewRequest) + private static final com.google.bigtable.admin.v2.DeleteLogicalViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteLogicalViewRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteLogicalViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteLogicalViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteLogicalViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequestOrBuilder.java new file mode 100644 index 000000000000..9b672fc9e449 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteLogicalViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteLogicalViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the logical view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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 logical view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The current etag of the logical view.
+   * If an etag is provided and does not match the current etag of the
+   * logical view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The current etag of the logical view.
+   * If an etag is provided and does not match the current etag of the
+   * logical view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequest.java new file mode 100644 index 000000000000..03c2a8ee3186 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequest.java @@ -0,0 +1,835 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.DeleteMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class DeleteMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteMaterializedViewRequest) + DeleteMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteMaterializedViewRequest"); + } + + // Use DeleteMaterializedViewRequest.newBuilder() to construct. + private DeleteMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteMaterializedViewRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.class, + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the materialized view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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 materialized view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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 ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The current etag of the materialized view.
+   * If an etag is provided and does not match the current etag of the
+   * materialized view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The current etag of the materialized view.
+   * If an etag is provided and does not match the current etag of the
+   * materialized view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + size += getUnknownFields().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.admin.v2.DeleteMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest other = + (com.google.bigtable.admin.v2.DeleteMaterializedViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest 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.admin.v2.DeleteMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest 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.admin.v2.DeleteMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteMaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.DeleteMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteMaterializedViewRequest) + com.google.bigtable.admin.v2.DeleteMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.class, + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_DeleteMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteMaterializedViewRequest build() { + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteMaterializedViewRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteMaterializedViewRequest result = + new com.google.bigtable.admin.v2.DeleteMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteMaterializedViewRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteMaterializedViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the materialized view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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 materialized view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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 materialized view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the materialized view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the materialized view to be deleted.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The current etag of the materialized view.
+     * If an etag is provided and does not match the current etag of the
+     * materialized view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the materialized view.
+     * If an etag is provided and does not match the current etag of the
+     * materialized view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The current etag of the materialized view.
+     * If an etag is provided and does not match the current etag of the
+     * materialized view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the materialized view.
+     * If an etag is provided and does not match the current etag of the
+     * materialized view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The current etag of the materialized view.
+     * If an etag is provided and does not match the current etag of the
+     * materialized view, deletion will be blocked and an ABORTED error will be
+     * returned.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteMaterializedViewRequest) + private static final com.google.bigtable.admin.v2.DeleteMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteMaterializedViewRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..eb02b9b9ad5e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the materialized view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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 materialized view to be deleted.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The current etag of the materialized view.
+   * If an etag is provided and does not match the current etag of the
+   * materialized view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The current etag of the materialized view.
+   * If an etag is provided and does not match the current etag of the
+   * materialized view, deletion will be blocked and an ABORTED error will be
+   * returned.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequest.java new file mode 100644 index 000000000000..61110600dffe --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequest.java @@ -0,0 +1,830 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteSchemaBundleRequest} + */ +@com.google.protobuf.Generated +public final class DeleteSchemaBundleRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteSchemaBundleRequest) + DeleteSchemaBundleRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteSchemaBundleRequest"); + } + + // Use DeleteSchemaBundleRequest.newBuilder() to construct. + private DeleteSchemaBundleRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteSchemaBundleRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.class, + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the schema bundle to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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 schema bundle to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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 ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The etag of the schema bundle.
+   * If this is provided, it must match the server's etag. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The etag of the schema bundle.
+   * If this is provided, it must match the server's etag. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + size += getUnknownFields().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.admin.v2.DeleteSchemaBundleRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest other = + (com.google.bigtable.admin.v2.DeleteSchemaBundleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest 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.admin.v2.DeleteSchemaBundleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest 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.admin.v2.DeleteSchemaBundleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteSchemaBundleRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteSchemaBundleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteSchemaBundleRequest) + com.google.bigtable.admin.v2.DeleteSchemaBundleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.class, + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSchemaBundleRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSchemaBundleRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSchemaBundleRequest build() { + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSchemaBundleRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteSchemaBundleRequest result = + new com.google.bigtable.admin.v2.DeleteSchemaBundleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteSchemaBundleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteSchemaBundleRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteSchemaBundleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteSchemaBundleRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteSchemaBundleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the schema bundle to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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 schema bundle to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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 schema bundle to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the schema bundle to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the schema bundle to delete.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The etag of the schema bundle.
+     * If this is provided, it must match the server's etag. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The etag of the schema bundle.
+     * If this is provided, it must match the server's etag. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The etag of the schema bundle.
+     * If this is provided, it must match the server's etag. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag of the schema bundle.
+     * If this is provided, it must match the server's etag. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag of the schema bundle.
+     * If this is provided, it must match the server's etag. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteSchemaBundleRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteSchemaBundleRequest) + private static final com.google.bigtable.admin.v2.DeleteSchemaBundleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteSchemaBundleRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteSchemaBundleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSchemaBundleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteSchemaBundleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequestOrBuilder.java new file mode 100644 index 000000000000..40248b0a4b08 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteSchemaBundleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteSchemaBundleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the schema bundle to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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 schema bundle to delete.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The etag of the schema bundle.
+   * If this is provided, it must match the server's etag. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The etag of the schema bundle.
+   * If this is provided, it must match the server's etag. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java new file mode 100644 index 000000000000..c13b17330a16 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java @@ -0,0 +1,636 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteSnapshotRequest} + */ +@com.google.protobuf.Generated +public final class DeleteSnapshotRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteSnapshotRequest) + DeleteSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteSnapshotRequest"); + } + + // Use DeleteSnapshotRequest.newBuilder() to construct. + private DeleteSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteSnapshotRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteSnapshotRequest.class, + com.google.bigtable.admin.v2.DeleteSnapshotRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the snapshot to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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 snapshot to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.DeleteSnapshotRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteSnapshotRequest other = + (com.google.bigtable.admin.v2.DeleteSnapshotRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest 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.admin.v2.DeleteSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest 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.admin.v2.DeleteSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteSnapshotRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteSnapshotRequest) + com.google.bigtable.admin.v2.DeleteSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteSnapshotRequest.class, + com.google.bigtable.admin.v2.DeleteSnapshotRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSnapshotRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSnapshotRequest build() { + com.google.bigtable.admin.v2.DeleteSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteSnapshotRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteSnapshotRequest result = + new com.google.bigtable.admin.v2.DeleteSnapshotRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteSnapshotRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteSnapshotRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteSnapshotRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the snapshot to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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 snapshot to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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 snapshot to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the snapshot to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the snapshot to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteSnapshotRequest) + private static final com.google.bigtable.admin.v2.DeleteSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteSnapshotRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..01c3a680e93c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the snapshot to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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 snapshot to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java new file mode 100644 index 000000000000..807389c9bceb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteTableRequest} + */ +@com.google.protobuf.Generated +public final class DeleteTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteTableRequest) + DeleteTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteTableRequest"); + } + + // Use DeleteTableRequest.newBuilder() to construct. + private DeleteTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteTableRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteTableRequest.class, + com.google.bigtable.admin.v2.DeleteTableRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.DeleteTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DeleteTableRequest other = + (com.google.bigtable.admin.v2.DeleteTableRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest 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.admin.v2.DeleteTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest 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.admin.v2.DeleteTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DeleteTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DeleteTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DeleteTableRequest) + com.google.bigtable.admin.v2.DeleteTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DeleteTableRequest.class, + com.google.bigtable.admin.v2.DeleteTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DeleteTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DeleteTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DeleteTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteTableRequest build() { + com.google.bigtable.admin.v2.DeleteTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DeleteTableRequest buildPartial() { + com.google.bigtable.admin.v2.DeleteTableRequest result = + new com.google.bigtable.admin.v2.DeleteTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DeleteTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DeleteTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DeleteTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteTableRequest other) { + if (other == com.google.bigtable.admin.v2.DeleteTableRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to be deleted.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DeleteTableRequest) + private static final com.google.bigtable.admin.v2.DeleteTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DeleteTableRequest(); + } + + public static com.google.bigtable.admin.v2.DeleteTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DeleteTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java new file mode 100644 index 000000000000..8e5c51af17fd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DeleteTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DeleteTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to be deleted.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java new file mode 100644 index 000000000000..9be56fcb01d5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java @@ -0,0 +1,993 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DropRowRangeRequest} + */ +@com.google.protobuf.Generated +public final class DropRowRangeRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DropRowRangeRequest) + DropRowRangeRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DropRowRangeRequest"); + } + + // Use DropRowRangeRequest.newBuilder() to construct. + private DropRowRangeRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DropRowRangeRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DropRowRangeRequest.class, + com.google.bigtable.admin.v2.DropRowRangeRequest.Builder.class); + } + + private int targetCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ROW_KEY_PREFIX(2), + DELETE_ALL_DATA_FROM_TABLE(3), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 2: + return ROW_KEY_PREFIX; + case 3: + return DELETE_ALL_DATA_FROM_TABLE; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table on which to drop a range of rows.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table on which to drop a range of rows.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 ROW_KEY_PREFIX_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Delete all rows that start with this row key prefix. Prefix cannot be
+   * zero length.
+   * 
+ * + * bytes row_key_prefix = 2; + * + * @return Whether the rowKeyPrefix field is set. + */ + @java.lang.Override + public boolean hasRowKeyPrefix() { + return targetCase_ == 2; + } + + /** + * + * + *
+   * Delete all rows that start with this row key prefix. Prefix cannot be
+   * zero length.
+   * 
+ * + * bytes row_key_prefix = 2; + * + * @return The rowKeyPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKeyPrefix() { + if (targetCase_ == 2) { + return (com.google.protobuf.ByteString) target_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int DELETE_ALL_DATA_FROM_TABLE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Delete all rows in the table. Setting this to false is a no-op.
+   * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return Whether the deleteAllDataFromTable field is set. + */ + @java.lang.Override + public boolean hasDeleteAllDataFromTable() { + return targetCase_ == 3; + } + + /** + * + * + *
+   * Delete all rows in the table. Setting this to false is a no-op.
+   * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return The deleteAllDataFromTable. + */ + @java.lang.Override + public boolean getDeleteAllDataFromTable() { + if (targetCase_ == 3) { + return (java.lang.Boolean) target_; + } + return false; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (targetCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) target_); + } + if (targetCase_ == 3) { + output.writeBool(3, (boolean) ((java.lang.Boolean) target_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (targetCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) target_); + } + if (targetCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, (boolean) ((java.lang.Boolean) target_)); + } + size += getUnknownFields().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.admin.v2.DropRowRangeRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.DropRowRangeRequest other = + (com.google.bigtable.admin.v2.DropRowRangeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 2: + if (!getRowKeyPrefix().equals(other.getRowKeyPrefix())) return false; + break; + case 3: + if (getDeleteAllDataFromTable() != other.getDeleteAllDataFromTable()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + switch (targetCase_) { + case 2: + hash = (37 * hash) + ROW_KEY_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getRowKeyPrefix().hashCode(); + break; + case 3: + hash = (37 * hash) + DELETE_ALL_DATA_FROM_TABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeleteAllDataFromTable()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest 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.admin.v2.DropRowRangeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest 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.admin.v2.DropRowRangeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.DropRowRangeRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.DropRowRangeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.DropRowRangeRequest) + com.google.bigtable.admin.v2.DropRowRangeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.DropRowRangeRequest.class, + com.google.bigtable.admin.v2.DropRowRangeRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.DropRowRangeRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DropRowRangeRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.DropRowRangeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DropRowRangeRequest build() { + com.google.bigtable.admin.v2.DropRowRangeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.DropRowRangeRequest buildPartial() { + com.google.bigtable.admin.v2.DropRowRangeRequest result = + new com.google.bigtable.admin.v2.DropRowRangeRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.DropRowRangeRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.DropRowRangeRequest result) { + result.targetCase_ = targetCase_; + result.target_ = this.target_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.DropRowRangeRequest) { + return mergeFrom((com.google.bigtable.admin.v2.DropRowRangeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.DropRowRangeRequest other) { + if (other == com.google.bigtable.admin.v2.DropRowRangeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + switch (other.getTargetCase()) { + case ROW_KEY_PREFIX: + { + setRowKeyPrefix(other.getRowKeyPrefix()); + break; + } + case DELETE_ALL_DATA_FROM_TABLE: + { + setDeleteAllDataFromTable(other.getDeleteAllDataFromTable()); + break; + } + case TARGET_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + target_ = input.readBytes(); + targetCase_ = 2; + break; + } // case 18 + case 24: + { + target_ = input.readBool(); + targetCase_ = 3; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table on which to drop a range of rows.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table on which to drop a range of rows.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table on which to drop a range of rows.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table on which to drop a range of rows.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table on which to drop a range of rows.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Delete all rows that start with this row key prefix. Prefix cannot be
+     * zero length.
+     * 
+ * + * bytes row_key_prefix = 2; + * + * @return Whether the rowKeyPrefix field is set. + */ + public boolean hasRowKeyPrefix() { + return targetCase_ == 2; + } + + /** + * + * + *
+     * Delete all rows that start with this row key prefix. Prefix cannot be
+     * zero length.
+     * 
+ * + * bytes row_key_prefix = 2; + * + * @return The rowKeyPrefix. + */ + public com.google.protobuf.ByteString getRowKeyPrefix() { + if (targetCase_ == 2) { + return (com.google.protobuf.ByteString) target_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Delete all rows that start with this row key prefix. Prefix cannot be
+     * zero length.
+     * 
+ * + * bytes row_key_prefix = 2; + * + * @param value The rowKeyPrefix to set. + * @return This builder for chaining. + */ + public Builder setRowKeyPrefix(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 2; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Delete all rows that start with this row key prefix. Prefix cannot be
+     * zero length.
+     * 
+ * + * bytes row_key_prefix = 2; + * + * @return This builder for chaining. + */ + public Builder clearRowKeyPrefix() { + if (targetCase_ == 2) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Delete all rows in the table. Setting this to false is a no-op.
+     * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return Whether the deleteAllDataFromTable field is set. + */ + public boolean hasDeleteAllDataFromTable() { + return targetCase_ == 3; + } + + /** + * + * + *
+     * Delete all rows in the table. Setting this to false is a no-op.
+     * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return The deleteAllDataFromTable. + */ + public boolean getDeleteAllDataFromTable() { + if (targetCase_ == 3) { + return (java.lang.Boolean) target_; + } + return false; + } + + /** + * + * + *
+     * Delete all rows in the table. Setting this to false is a no-op.
+     * 
+ * + * bool delete_all_data_from_table = 3; + * + * @param value The deleteAllDataFromTable to set. + * @return This builder for chaining. + */ + public Builder setDeleteAllDataFromTable(boolean value) { + + targetCase_ = 3; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Delete all rows in the table. Setting this to false is a no-op.
+     * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeleteAllDataFromTable() { + if (targetCase_ == 3) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DropRowRangeRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.DropRowRangeRequest) + private static final com.google.bigtable.admin.v2.DropRowRangeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.DropRowRangeRequest(); + } + + public static com.google.bigtable.admin.v2.DropRowRangeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DropRowRangeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.DropRowRangeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java new file mode 100644 index 000000000000..f2e320121e6f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface DropRowRangeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.DropRowRangeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table on which to drop a range of rows.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table on which to drop a range of rows.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Delete all rows that start with this row key prefix. Prefix cannot be
+   * zero length.
+   * 
+ * + * bytes row_key_prefix = 2; + * + * @return Whether the rowKeyPrefix field is set. + */ + boolean hasRowKeyPrefix(); + + /** + * + * + *
+   * Delete all rows that start with this row key prefix. Prefix cannot be
+   * zero length.
+   * 
+ * + * bytes row_key_prefix = 2; + * + * @return The rowKeyPrefix. + */ + com.google.protobuf.ByteString getRowKeyPrefix(); + + /** + * + * + *
+   * Delete all rows in the table. Setting this to false is a no-op.
+   * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return Whether the deleteAllDataFromTable field is set. + */ + boolean hasDeleteAllDataFromTable(); + + /** + * + * + *
+   * Delete all rows in the table. Setting this to false is a no-op.
+   * 
+ * + * bool delete_all_data_from_table = 3; + * + * @return The deleteAllDataFromTable. + */ + boolean getDeleteAllDataFromTable(); + + com.google.bigtable.admin.v2.DropRowRangeRequest.TargetCase getTargetCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java new file mode 100644 index 000000000000..37a7495ab768 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java @@ -0,0 +1,1310 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Encryption information for a given resource.
+ * If this resource is protected with customer managed encryption, the in-use
+ * Cloud Key Management Service (Cloud KMS) key version is specified along with
+ * its status.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo} + */ +@com.google.protobuf.Generated +public final class EncryptionInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.EncryptionInfo) + EncryptionInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EncryptionInfo"); + } + + // Use EncryptionInfo.newBuilder() to construct. + private EncryptionInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EncryptionInfo() { + encryptionType_ = 0; + kmsKeyVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.EncryptionInfo.class, + com.google.bigtable.admin.v2.EncryptionInfo.Builder.class); + } + + /** + * + * + *
+   * Possible encryption types for a resource.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.EncryptionInfo.EncryptionType} + */ + public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Encryption type was not specified, though data at rest remains encrypted.
+     * 
+ * + * ENCRYPTION_TYPE_UNSPECIFIED = 0; + */ + ENCRYPTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * fully managed by Google. No key version or status will be populated.
+     * This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + GOOGLE_DEFAULT_ENCRYPTION(1), + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * managed by the customer.
+     * The in-use version of the key and its status are populated for
+     * CMEK-protected tables.
+     * CMEK-protected backups are pinned to the key version that was in use at
+     * the time the backup was taken. This key version is populated but its
+     * status is not tracked and is reported as `UNKNOWN`.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + CUSTOMER_MANAGED_ENCRYPTION(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EncryptionType"); + } + + /** + * + * + *
+     * Encryption type was not specified, though data at rest remains encrypted.
+     * 
+ * + * ENCRYPTION_TYPE_UNSPECIFIED = 0; + */ + public static final int ENCRYPTION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * fully managed by Google. No key version or status will be populated.
+     * This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1; + + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * managed by the customer.
+     * The in-use version of the key and its status are populated for
+     * CMEK-protected tables.
+     * CMEK-protected backups are pinned to the key version that was in use at
+     * the time the backup was taken. This key version is populated but its
+     * status is not tracked and is reported as `UNKNOWN`.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + public static final int CUSTOMER_MANAGED_ENCRYPTION_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncryptionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EncryptionType forNumber(int value) { + switch (value) { + case 0: + return ENCRYPTION_TYPE_UNSPECIFIED; + case 1: + return GOOGLE_DEFAULT_ENCRYPTION; + case 2: + return CUSTOMER_MANAGED_ENCRYPTION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EncryptionType findValueByNumber(int number) { + return EncryptionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.EncryptionInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final EncryptionType[] VALUES = values(); + + public static EncryptionType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EncryptionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.EncryptionInfo.EncryptionType) + } + + private int bitField0_; + public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 3; + private int encryptionType_ = 0; + + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() { + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result = + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.forNumber(encryptionType_); + return result == null + ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED + : result; + } + + public static final int ENCRYPTION_STATUS_FIELD_NUMBER = 4; + private com.google.rpc.Status encryptionStatus_; + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + @java.lang.Override + public boolean hasEncryptionStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + @java.lang.Override + public com.google.rpc.Status getEncryptionStatus() { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } + + public static final int KMS_KEY_VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + 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(); + kmsKeyVersion_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = 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.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kmsKeyVersion_); + } + if (encryptionType_ + != com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.ENCRYPTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, encryptionType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getEncryptionStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kmsKeyVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kmsKeyVersion_); + } + if (encryptionType_ + != com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.ENCRYPTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encryptionType_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEncryptionStatus()); + } + size += getUnknownFields().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.admin.v2.EncryptionInfo)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.EncryptionInfo other = + (com.google.bigtable.admin.v2.EncryptionInfo) obj; + + if (encryptionType_ != other.encryptionType_) return false; + if (hasEncryptionStatus() != other.hasEncryptionStatus()) return false; + if (hasEncryptionStatus()) { + if (!getEncryptionStatus().equals(other.getEncryptionStatus())) return false; + } + if (!getKmsKeyVersion().equals(other.getKmsKeyVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ENCRYPTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + encryptionType_; + if (hasEncryptionStatus()) { + hash = (37 * hash) + ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionStatus().hashCode(); + } + hash = (37 * hash) + KMS_KEY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo 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.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo 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.admin.v2.EncryptionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.EncryptionInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Encryption information for a given resource.
+   * If this resource is protected with customer managed encryption, the in-use
+   * Cloud Key Management Service (Cloud KMS) key version is specified along with
+   * its status.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.EncryptionInfo) + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.EncryptionInfo.class, + com.google.bigtable.admin.v2.EncryptionInfo.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.EncryptionInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncryptionStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encryptionType_ = 0; + encryptionStatus_ = null; + if (encryptionStatusBuilder_ != null) { + encryptionStatusBuilder_.dispose(); + encryptionStatusBuilder_ = null; + } + kmsKeyVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo build() { + com.google.bigtable.admin.v2.EncryptionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo buildPartial() { + com.google.bigtable.admin.v2.EncryptionInfo result = + new com.google.bigtable.admin.v2.EncryptionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.EncryptionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encryptionType_ = encryptionType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.encryptionStatus_ = + encryptionStatusBuilder_ == null ? encryptionStatus_ : encryptionStatusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kmsKeyVersion_ = kmsKeyVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.EncryptionInfo) { + return mergeFrom((com.google.bigtable.admin.v2.EncryptionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.EncryptionInfo other) { + if (other == com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()) return this; + if (other.encryptionType_ != 0) { + setEncryptionTypeValue(other.getEncryptionTypeValue()); + } + if (other.hasEncryptionStatus()) { + mergeEncryptionStatus(other.getEncryptionStatus()); + } + if (!other.getKmsKeyVersion().isEmpty()) { + kmsKeyVersion_ = other.kmsKeyVersion_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + kmsKeyVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: + { + encryptionType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetEncryptionStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int encryptionType_ = 0; + + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionTypeValue(int value) { + encryptionType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() { + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result = + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.forNumber(encryptionType_); + return result == null + ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionType( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + encryptionType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearEncryptionType() { + bitField0_ = (bitField0_ & ~0x00000001); + encryptionType_ = 0; + onChanged(); + return this; + } + + private com.google.rpc.Status encryptionStatus_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + encryptionStatusBuilder_; + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + public boolean hasEncryptionStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + public com.google.rpc.Status getEncryptionStatus() { + if (encryptionStatusBuilder_ == null) { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } else { + return encryptionStatusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionStatus(com.google.rpc.Status value) { + if (encryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionStatus_ = value; + } else { + encryptionStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionStatus(com.google.rpc.Status.Builder builderForValue) { + if (encryptionStatusBuilder_ == null) { + encryptionStatus_ = builderForValue.build(); + } else { + encryptionStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionStatus(com.google.rpc.Status value) { + if (encryptionStatusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && encryptionStatus_ != null + && encryptionStatus_ != com.google.rpc.Status.getDefaultInstance()) { + getEncryptionStatusBuilder().mergeFrom(value); + } else { + encryptionStatus_ = value; + } + } else { + encryptionStatusBuilder_.mergeFrom(value); + } + if (encryptionStatus_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + encryptionStatus_ = null; + if (encryptionStatusBuilder_ != null) { + encryptionStatusBuilder_.dispose(); + encryptionStatusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getEncryptionStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEncryptionStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() { + if (encryptionStatusBuilder_ != null) { + return encryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } + } + + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetEncryptionStatusFieldBuilder() { + if (encryptionStatusBuilder_ == null) { + encryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + getEncryptionStatus(), getParentForChildren(), isClean()); + encryptionStatus_ = null; + } + return encryptionStatusBuilder_; + } + + private java.lang.Object kmsKeyVersion_ = ""; + + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersion() { + kmsKeyVersion_ = getDefaultInstance().getKmsKeyVersion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.EncryptionInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.EncryptionInfo) + private static final com.google.bigtable.admin.v2.EncryptionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.EncryptionInfo(); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.EncryptionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java new file mode 100644 index 000000000000..26020f6ba6b8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface EncryptionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.EncryptionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + int getEncryptionTypeValue(); + + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType(); + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + boolean hasEncryptionStatus(); + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + com.google.rpc.Status getEncryptionStatus(); + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + java.lang.String getKmsKeyVersion(); + + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + com.google.protobuf.ByteString getKmsKeyVersionBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java new file mode 100644 index 000000000000..c7f168078b34 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java @@ -0,0 +1,3482 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Rule for determining which cells to delete during garbage collection.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule} + */ +@com.google.protobuf.Generated +public final class GcRule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GcRule) + GcRuleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GcRule"); + } + + // Use GcRule.newBuilder() to construct. + private GcRule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GcRule() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.class, + com.google.bigtable.admin.v2.GcRule.Builder.class); + } + + public interface IntersectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GcRule.Intersection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + java.util.List getRulesList(); + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + com.google.bigtable.admin.v2.GcRule getRules(int index); + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + int getRulesCount(); + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + java.util.List getRulesOrBuilderList(); + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index); + } + + /** + * + * + *
+   * A GcRule which deletes cells matching all of the given rules.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule.Intersection} + */ + public static final class Intersection extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GcRule.Intersection) + IntersectionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Intersection"); + } + + // Use Intersection.newBuilder() to construct. + private Intersection(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Intersection() { + rules_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.Intersection.class, + com.google.bigtable.admin.v2.GcRule.Intersection.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rules_; + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule getRules(int index) { + return rules_.get(index); + } + + /** + * + * + *
+     * Only delete cells which would be deleted by every element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + 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 { + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i)); + } + size += getUnknownFields().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.admin.v2.GcRule.Intersection)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GcRule.Intersection other = + (com.google.bigtable.admin.v2.GcRule.Intersection) obj; + + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection 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.admin.v2.GcRule.Intersection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection 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.admin.v2.GcRule.Intersection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GcRule.Intersection 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A GcRule which deletes cells matching all of the given rules.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule.Intersection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GcRule.Intersection) + com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.Intersection.class, + com.google.bigtable.admin.v2.GcRule.Intersection.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GcRule.Intersection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Intersection getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Intersection build() { + com.google.bigtable.admin.v2.GcRule.Intersection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Intersection buildPartial() { + com.google.bigtable.admin.v2.GcRule.Intersection result = + new com.google.bigtable.admin.v2.GcRule.Intersection(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.GcRule.Intersection result) { + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Intersection result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GcRule.Intersection) { + return mergeFrom((com.google.bigtable.admin.v2.GcRule.Intersection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Intersection other) { + if (other == com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance()) + return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.GcRule m = + input.readMessage( + com.google.bigtable.admin.v2.GcRule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder setRules(int index, com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder setRules( + int index, com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(int index, com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules( + int index, com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder getRulesBuilder(int index) { + return internalGetRulesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() { + return internalGetRulesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.GcRule.getDefaultInstance()); + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) { + return internalGetRulesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.GcRule.getDefaultInstance()); + } + + /** + * + * + *
+       * Only delete cells which would be deleted by every element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List getRulesBuilderList() { + return internalGetRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + internalGetRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule.Intersection) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GcRule.Intersection) + private static final com.google.bigtable.admin.v2.GcRule.Intersection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GcRule.Intersection(); + } + + public static com.google.bigtable.admin.v2.GcRule.Intersection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Intersection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GcRule.Intersection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UnionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GcRule.Union) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + java.util.List getRulesList(); + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + com.google.bigtable.admin.v2.GcRule getRules(int index); + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + int getRulesCount(); + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + java.util.List getRulesOrBuilderList(); + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index); + } + + /** + * + * + *
+   * A GcRule which deletes cells matching any of the given rules.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule.Union} + */ + public static final class Union extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GcRule.Union) + UnionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Union"); + } + + // Use Union.newBuilder() to construct. + private Union(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Union() { + rules_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.Union.class, + com.google.bigtable.admin.v2.GcRule.Union.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rules_; + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule getRules(int index) { + return rules_.get(index); + } + + /** + * + * + *
+     * Delete cells which would be deleted by any element of `rules`.
+     * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + 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 { + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i)); + } + size += getUnknownFields().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.admin.v2.GcRule.Union)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GcRule.Union other = + (com.google.bigtable.admin.v2.GcRule.Union) obj; + + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Union 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.admin.v2.GcRule.Union parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Union 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.admin.v2.GcRule.Union parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule.Union parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GcRule.Union 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A GcRule which deletes cells matching any of the given rules.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule.Union} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GcRule.Union) + com.google.bigtable.admin.v2.GcRule.UnionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.Union.class, + com.google.bigtable.admin.v2.GcRule.Union.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GcRule.Union.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Union getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Union build() { + com.google.bigtable.admin.v2.GcRule.Union result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Union buildPartial() { + com.google.bigtable.admin.v2.GcRule.Union result = + new com.google.bigtable.admin.v2.GcRule.Union(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.admin.v2.GcRule.Union result) { + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Union result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GcRule.Union) { + return mergeFrom((com.google.bigtable.admin.v2.GcRule.Union) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Union other) { + if (other == com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance()) return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.GcRule m = + input.readMessage( + com.google.bigtable.admin.v2.GcRule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder setRules(int index, com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder setRules( + int index, com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(int index, com.google.bigtable.admin.v2.GcRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules(com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addRules( + int index, com.google.bigtable.admin.v2.GcRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder getRulesBuilder(int index) { + return internalGetRulesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() { + return internalGetRulesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.GcRule.getDefaultInstance()); + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) { + return internalGetRulesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.GcRule.getDefaultInstance()); + } + + /** + * + * + *
+       * Delete cells which would be deleted by any element of `rules`.
+       * 
+ * + * repeated .google.bigtable.admin.v2.GcRule rules = 1; + */ + public java.util.List getRulesBuilderList() { + return internalGetRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder> + internalGetRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.GcRule, + com.google.bigtable.admin.v2.GcRule.Builder, + com.google.bigtable.admin.v2.GcRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule.Union) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GcRule.Union) + private static final com.google.bigtable.admin.v2.GcRule.Union DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GcRule.Union(); + } + + public static com.google.bigtable.admin.v2.GcRule.Union getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Union parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GcRule.Union getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int ruleCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object rule_; + + public enum RuleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAX_NUM_VERSIONS(1), + MAX_AGE(2), + INTERSECTION(3), + UNION(4), + RULE_NOT_SET(0); + private final int value; + + private RuleCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RuleCase valueOf(int value) { + return forNumber(value); + } + + public static RuleCase forNumber(int value) { + switch (value) { + case 1: + return MAX_NUM_VERSIONS; + case 2: + return MAX_AGE; + case 3: + return INTERSECTION; + case 4: + return UNION; + case 0: + return RULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public static final int MAX_NUM_VERSIONS_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Delete all cells in a column except the most recent N.
+   * 
+ * + * int32 max_num_versions = 1; + * + * @return Whether the maxNumVersions field is set. + */ + @java.lang.Override + public boolean hasMaxNumVersions() { + return ruleCase_ == 1; + } + + /** + * + * + *
+   * Delete all cells in a column except the most recent N.
+   * 
+ * + * int32 max_num_versions = 1; + * + * @return The maxNumVersions. + */ + @java.lang.Override + public int getMaxNumVersions() { + if (ruleCase_ == 1) { + return (java.lang.Integer) rule_; + } + return 0; + } + + public static final int MAX_AGE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return Whether the maxAge field is set. + */ + @java.lang.Override + public boolean hasMaxAge() { + return ruleCase_ == 2; + } + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return The maxAge. + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxAge() { + if (ruleCase_ == 2) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() { + if (ruleCase_ == 2) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int INTERSECTION_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return Whether the intersection field is set. + */ + @java.lang.Override + public boolean hasIntersection() { + return ruleCase_ == 3; + } + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return The intersection. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Intersection getIntersection() { + if (ruleCase_ == 3) { + return (com.google.bigtable.admin.v2.GcRule.Intersection) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersectionOrBuilder() { + if (ruleCase_ == 3) { + return (com.google.bigtable.admin.v2.GcRule.Intersection) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + + public static final int UNION_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return Whether the union field is set. + */ + @java.lang.Override + public boolean hasUnion() { + return ruleCase_ == 4; + } + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return The union. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Union getUnion() { + if (ruleCase_ == 4) { + return (com.google.bigtable.admin.v2.GcRule.Union) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() { + if (ruleCase_ == 4) { + return (com.google.bigtable.admin.v2.GcRule.Union) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + + 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 (ruleCase_ == 1) { + output.writeInt32(1, (int) ((java.lang.Integer) rule_)); + } + if (ruleCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Duration) rule_); + } + if (ruleCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.GcRule.Intersection) rule_); + } + if (ruleCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.GcRule.Union) rule_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ruleCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 1, (int) ((java.lang.Integer) rule_)); + } + if (ruleCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Duration) rule_); + } + if (ruleCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.GcRule.Intersection) rule_); + } + if (ruleCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.GcRule.Union) rule_); + } + size += getUnknownFields().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.admin.v2.GcRule)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GcRule other = (com.google.bigtable.admin.v2.GcRule) obj; + + if (!getRuleCase().equals(other.getRuleCase())) return false; + switch (ruleCase_) { + case 1: + if (getMaxNumVersions() != other.getMaxNumVersions()) return false; + break; + case 2: + if (!getMaxAge().equals(other.getMaxAge())) return false; + break; + case 3: + if (!getIntersection().equals(other.getIntersection())) return false; + break; + case 4: + if (!getUnion().equals(other.getUnion())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (ruleCase_) { + case 1: + hash = (37 * hash) + MAX_NUM_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getMaxNumVersions(); + break; + case 2: + hash = (37 * hash) + MAX_AGE_FIELD_NUMBER; + hash = (53 * hash) + getMaxAge().hashCode(); + break; + case 3: + hash = (37 * hash) + INTERSECTION_FIELD_NUMBER; + hash = (53 * hash) + getIntersection().hashCode(); + break; + case 4: + hash = (37 * hash) + UNION_FIELD_NUMBER; + hash = (53 * hash) + getUnion().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule 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.admin.v2.GcRule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule 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.admin.v2.GcRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GcRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GcRule 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rule for determining which cells to delete during garbage collection.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GcRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GcRule) + com.google.bigtable.admin.v2.GcRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GcRule.class, + com.google.bigtable.admin.v2.GcRule.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GcRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (maxAgeBuilder_ != null) { + maxAgeBuilder_.clear(); + } + if (intersectionBuilder_ != null) { + intersectionBuilder_.clear(); + } + if (unionBuilder_ != null) { + unionBuilder_.clear(); + } + ruleCase_ = 0; + rule_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_GcRule_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GcRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule build() { + com.google.bigtable.admin.v2.GcRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule buildPartial() { + com.google.bigtable.admin.v2.GcRule result = new com.google.bigtable.admin.v2.GcRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GcRule result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.GcRule result) { + result.ruleCase_ = ruleCase_; + result.rule_ = this.rule_; + if (ruleCase_ == 2 && maxAgeBuilder_ != null) { + result.rule_ = maxAgeBuilder_.build(); + } + if (ruleCase_ == 3 && intersectionBuilder_ != null) { + result.rule_ = intersectionBuilder_.build(); + } + if (ruleCase_ == 4 && unionBuilder_ != null) { + result.rule_ = unionBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GcRule) { + return mergeFrom((com.google.bigtable.admin.v2.GcRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule other) { + if (other == com.google.bigtable.admin.v2.GcRule.getDefaultInstance()) return this; + switch (other.getRuleCase()) { + case MAX_NUM_VERSIONS: + { + setMaxNumVersions(other.getMaxNumVersions()); + break; + } + case MAX_AGE: + { + mergeMaxAge(other.getMaxAge()); + break; + } + case INTERSECTION: + { + mergeIntersection(other.getIntersection()); + break; + } + case UNION: + { + mergeUnion(other.getUnion()); + break; + } + case RULE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rule_ = input.readInt32(); + ruleCase_ = 1; + break; + } // case 8 + case 18: + { + input.readMessage(internalGetMaxAgeFieldBuilder().getBuilder(), extensionRegistry); + ruleCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetIntersectionFieldBuilder().getBuilder(), extensionRegistry); + ruleCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetUnionFieldBuilder().getBuilder(), extensionRegistry); + ruleCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int ruleCase_ = 0; + private java.lang.Object rule_; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public Builder clearRule() { + ruleCase_ = 0; + rule_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Delete all cells in a column except the most recent N.
+     * 
+ * + * int32 max_num_versions = 1; + * + * @return Whether the maxNumVersions field is set. + */ + public boolean hasMaxNumVersions() { + return ruleCase_ == 1; + } + + /** + * + * + *
+     * Delete all cells in a column except the most recent N.
+     * 
+ * + * int32 max_num_versions = 1; + * + * @return The maxNumVersions. + */ + public int getMaxNumVersions() { + if (ruleCase_ == 1) { + return (java.lang.Integer) rule_; + } + return 0; + } + + /** + * + * + *
+     * Delete all cells in a column except the most recent N.
+     * 
+ * + * int32 max_num_versions = 1; + * + * @param value The maxNumVersions to set. + * @return This builder for chaining. + */ + public Builder setMaxNumVersions(int value) { + + ruleCase_ = 1; + rule_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Delete all cells in a column except the most recent N.
+     * 
+ * + * int32 max_num_versions = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaxNumVersions() { + if (ruleCase_ == 1) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + maxAgeBuilder_; + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return Whether the maxAge field is set. + */ + @java.lang.Override + public boolean hasMaxAge() { + return ruleCase_ == 2; + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return The maxAge. + */ + @java.lang.Override + public com.google.protobuf.Duration getMaxAge() { + if (maxAgeBuilder_ == null) { + if (ruleCase_ == 2) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (ruleCase_ == 2) { + return maxAgeBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + public Builder setMaxAge(com.google.protobuf.Duration value) { + if (maxAgeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + maxAgeBuilder_.setMessage(value); + } + ruleCase_ = 2; + return this; + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + public Builder setMaxAge(com.google.protobuf.Duration.Builder builderForValue) { + if (maxAgeBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + maxAgeBuilder_.setMessage(builderForValue.build()); + } + ruleCase_ = 2; + return this; + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + public Builder mergeMaxAge(com.google.protobuf.Duration value) { + if (maxAgeBuilder_ == null) { + if (ruleCase_ == 2 && rule_ != com.google.protobuf.Duration.getDefaultInstance()) { + rule_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + if (ruleCase_ == 2) { + maxAgeBuilder_.mergeFrom(value); + } else { + maxAgeBuilder_.setMessage(value); + } + } + ruleCase_ = 2; + return this; + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + public Builder clearMaxAge() { + if (maxAgeBuilder_ == null) { + if (ruleCase_ == 2) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + } else { + if (ruleCase_ == 2) { + ruleCase_ = 0; + rule_ = null; + } + maxAgeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + public com.google.protobuf.Duration.Builder getMaxAgeBuilder() { + return internalGetMaxAgeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() { + if ((ruleCase_ == 2) && (maxAgeBuilder_ != null)) { + return maxAgeBuilder_.getMessageOrBuilder(); + } else { + if (ruleCase_ == 2) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells in a column older than the given age.
+     * Values must be at least one millisecond, and will be truncated to
+     * microsecond granularity.
+     * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetMaxAgeFieldBuilder() { + if (maxAgeBuilder_ == null) { + if (!(ruleCase_ == 2)) { + rule_ = com.google.protobuf.Duration.getDefaultInstance(); + } + maxAgeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) rule_, getParentForChildren(), isClean()); + rule_ = null; + } + ruleCase_ = 2; + onChanged(); + return maxAgeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Intersection, + com.google.bigtable.admin.v2.GcRule.Intersection.Builder, + com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder> + intersectionBuilder_; + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return Whether the intersection field is set. + */ + @java.lang.Override + public boolean hasIntersection() { + return ruleCase_ == 3; + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return The intersection. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Intersection getIntersection() { + if (intersectionBuilder_ == null) { + if (ruleCase_ == 3) { + return (com.google.bigtable.admin.v2.GcRule.Intersection) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } else { + if (ruleCase_ == 3) { + return intersectionBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + public Builder setIntersection(com.google.bigtable.admin.v2.GcRule.Intersection value) { + if (intersectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + intersectionBuilder_.setMessage(value); + } + ruleCase_ = 3; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + public Builder setIntersection( + com.google.bigtable.admin.v2.GcRule.Intersection.Builder builderForValue) { + if (intersectionBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + intersectionBuilder_.setMessage(builderForValue.build()); + } + ruleCase_ = 3; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + public Builder mergeIntersection(com.google.bigtable.admin.v2.GcRule.Intersection value) { + if (intersectionBuilder_ == null) { + if (ruleCase_ == 3 + && rule_ != com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance()) { + rule_ = + com.google.bigtable.admin.v2.GcRule.Intersection.newBuilder( + (com.google.bigtable.admin.v2.GcRule.Intersection) rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + if (ruleCase_ == 3) { + intersectionBuilder_.mergeFrom(value); + } else { + intersectionBuilder_.setMessage(value); + } + } + ruleCase_ = 3; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + public Builder clearIntersection() { + if (intersectionBuilder_ == null) { + if (ruleCase_ == 3) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + } else { + if (ruleCase_ == 3) { + ruleCase_ = 0; + rule_ = null; + } + intersectionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + public com.google.bigtable.admin.v2.GcRule.Intersection.Builder getIntersectionBuilder() { + return internalGetIntersectionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersectionOrBuilder() { + if ((ruleCase_ == 3) && (intersectionBuilder_ != null)) { + return intersectionBuilder_.getMessageOrBuilder(); + } else { + if (ruleCase_ == 3) { + return (com.google.bigtable.admin.v2.GcRule.Intersection) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells that would be deleted by every nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Intersection, + com.google.bigtable.admin.v2.GcRule.Intersection.Builder, + com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder> + internalGetIntersectionFieldBuilder() { + if (intersectionBuilder_ == null) { + if (!(ruleCase_ == 3)) { + rule_ = com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance(); + } + intersectionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Intersection, + com.google.bigtable.admin.v2.GcRule.Intersection.Builder, + com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder>( + (com.google.bigtable.admin.v2.GcRule.Intersection) rule_, + getParentForChildren(), + isClean()); + rule_ = null; + } + ruleCase_ = 3; + onChanged(); + return intersectionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Union, + com.google.bigtable.admin.v2.GcRule.Union.Builder, + com.google.bigtable.admin.v2.GcRule.UnionOrBuilder> + unionBuilder_; + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return Whether the union field is set. + */ + @java.lang.Override + public boolean hasUnion() { + return ruleCase_ == 4; + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return The union. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.Union getUnion() { + if (unionBuilder_ == null) { + if (ruleCase_ == 4) { + return (com.google.bigtable.admin.v2.GcRule.Union) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } else { + if (ruleCase_ == 4) { + return unionBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + public Builder setUnion(com.google.bigtable.admin.v2.GcRule.Union value) { + if (unionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + unionBuilder_.setMessage(value); + } + ruleCase_ = 4; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + public Builder setUnion(com.google.bigtable.admin.v2.GcRule.Union.Builder builderForValue) { + if (unionBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + unionBuilder_.setMessage(builderForValue.build()); + } + ruleCase_ = 4; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + public Builder mergeUnion(com.google.bigtable.admin.v2.GcRule.Union value) { + if (unionBuilder_ == null) { + if (ruleCase_ == 4 + && rule_ != com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance()) { + rule_ = + com.google.bigtable.admin.v2.GcRule.Union.newBuilder( + (com.google.bigtable.admin.v2.GcRule.Union) rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + if (ruleCase_ == 4) { + unionBuilder_.mergeFrom(value); + } else { + unionBuilder_.setMessage(value); + } + } + ruleCase_ = 4; + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + public Builder clearUnion() { + if (unionBuilder_ == null) { + if (ruleCase_ == 4) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + } else { + if (ruleCase_ == 4) { + ruleCase_ = 0; + rule_ = null; + } + unionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + public com.google.bigtable.admin.v2.GcRule.Union.Builder getUnionBuilder() { + return internalGetUnionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() { + if ((ruleCase_ == 4) && (unionBuilder_ != null)) { + return unionBuilder_.getMessageOrBuilder(); + } else { + if (ruleCase_ == 4) { + return (com.google.bigtable.admin.v2.GcRule.Union) rule_; + } + return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Delete cells that would be deleted by any nested rule.
+     * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Union, + com.google.bigtable.admin.v2.GcRule.Union.Builder, + com.google.bigtable.admin.v2.GcRule.UnionOrBuilder> + internalGetUnionFieldBuilder() { + if (unionBuilder_ == null) { + if (!(ruleCase_ == 4)) { + rule_ = com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance(); + } + unionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.GcRule.Union, + com.google.bigtable.admin.v2.GcRule.Union.Builder, + com.google.bigtable.admin.v2.GcRule.UnionOrBuilder>( + (com.google.bigtable.admin.v2.GcRule.Union) rule_, + getParentForChildren(), + isClean()); + rule_ = null; + } + ruleCase_ = 4; + onChanged(); + return unionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GcRule) + private static final com.google.bigtable.admin.v2.GcRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GcRule(); + } + + public static com.google.bigtable.admin.v2.GcRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GcRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java new file mode 100644 index 000000000000..8c10f8e2c1c9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GcRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GcRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Delete all cells in a column except the most recent N.
+   * 
+ * + * int32 max_num_versions = 1; + * + * @return Whether the maxNumVersions field is set. + */ + boolean hasMaxNumVersions(); + + /** + * + * + *
+   * Delete all cells in a column except the most recent N.
+   * 
+ * + * int32 max_num_versions = 1; + * + * @return The maxNumVersions. + */ + int getMaxNumVersions(); + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return Whether the maxAge field is set. + */ + boolean hasMaxAge(); + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + * + * @return The maxAge. + */ + com.google.protobuf.Duration getMaxAge(); + + /** + * + * + *
+   * Delete cells in a column older than the given age.
+   * Values must be at least one millisecond, and will be truncated to
+   * microsecond granularity.
+   * 
+ * + * .google.protobuf.Duration max_age = 2; + */ + com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder(); + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return Whether the intersection field is set. + */ + boolean hasIntersection(); + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + * + * @return The intersection. + */ + com.google.bigtable.admin.v2.GcRule.Intersection getIntersection(); + + /** + * + * + *
+   * Delete cells that would be deleted by every nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3; + */ + com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersectionOrBuilder(); + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return Whether the union field is set. + */ + boolean hasUnion(); + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + * + * @return The union. + */ + com.google.bigtable.admin.v2.GcRule.Union getUnion(); + + /** + * + * + *
+   * Delete cells that would be deleted by any nested rule.
+   * 
+ * + * .google.bigtable.admin.v2.GcRule.Union union = 4; + */ + com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder(); + + com.google.bigtable.admin.v2.GcRule.RuleCase getRuleCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java new file mode 100644 index 000000000000..8b5f016a17b9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java @@ -0,0 +1,631 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenRequest} + */ +@com.google.protobuf.Generated +public final class GenerateConsistencyTokenRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + GenerateConsistencyTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateConsistencyTokenRequest"); + } + + // Use GenerateConsistencyTokenRequest.newBuilder() to construct. + private GenerateConsistencyTokenRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateConsistencyTokenRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.class, + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the Table for which to create a consistency
+   * token. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 Table for which to create a consistency
+   * token. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GenerateConsistencyTokenRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest other = + (com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest 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.admin.v2.GenerateConsistencyTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest 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.admin.v2.GenerateConsistencyTokenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GenerateConsistencyTokenRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.class, + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest build() { + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest buildPartial() { + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest result = + new com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest other) { + if (other + == com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the Table for which to create a consistency
+     * token. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 Table for which to create a consistency
+     * token. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 Table for which to create a consistency
+     * token. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the Table for which to create a consistency
+     * token. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the Table for which to create a consistency
+     * token. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + private static final com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateConsistencyTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GenerateConsistencyTokenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java new file mode 100644 index 000000000000..769965eba03c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GenerateConsistencyTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the Table for which to create a consistency
+   * token. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 Table for which to create a consistency
+   * token. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java new file mode 100644 index 000000000000..75d75c07506c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java @@ -0,0 +1,604 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenResponse} + */ +@com.google.protobuf.Generated +public final class GenerateConsistencyTokenResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + GenerateConsistencyTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateConsistencyTokenResponse"); + } + + // Use GenerateConsistencyTokenResponse.newBuilder() to construct. + private GenerateConsistencyTokenResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateConsistencyTokenResponse() { + consistencyToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.class, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.Builder.class); + } + + public static final int CONSISTENCY_TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object consistencyToken_ = ""; + + /** + * + * + *
+   * The generated consistency token.
+   * 
+ * + * string consistency_token = 1; + * + * @return The consistencyToken. + */ + @java.lang.Override + public java.lang.String getConsistencyToken() { + java.lang.Object ref = consistencyToken_; + 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(); + consistencyToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The generated consistency token.
+   * 
+ * + * string consistency_token = 1; + * + * @return The bytes for consistencyToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConsistencyTokenBytes() { + java.lang.Object ref = consistencyToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consistencyToken_ = 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.GeneratedMessage.isStringEmpty(consistencyToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, consistencyToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consistencyToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, consistencyToken_); + } + size += getUnknownFields().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.admin.v2.GenerateConsistencyTokenResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse other = + (com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) obj; + + if (!getConsistencyToken().equals(other.getConsistencyToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONSISTENCY_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getConsistencyToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse 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.admin.v2.GenerateConsistencyTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse 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.admin.v2.GenerateConsistencyTokenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GenerateConsistencyTokenResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.class, + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consistencyToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse build() { + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse buildPartial() { + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse result = + new com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consistencyToken_ = consistencyToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) { + return mergeFrom((com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse other) { + if (other + == com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.getDefaultInstance()) + return this; + if (!other.getConsistencyToken().isEmpty()) { + consistencyToken_ = other.consistencyToken_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + consistencyToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object consistencyToken_ = ""; + + /** + * + * + *
+     * The generated consistency token.
+     * 
+ * + * string consistency_token = 1; + * + * @return The consistencyToken. + */ + public java.lang.String getConsistencyToken() { + java.lang.Object ref = consistencyToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consistencyToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The generated consistency token.
+     * 
+ * + * string consistency_token = 1; + * + * @return The bytes for consistencyToken. + */ + public com.google.protobuf.ByteString getConsistencyTokenBytes() { + java.lang.Object ref = consistencyToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + consistencyToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The generated consistency token.
+     * 
+ * + * string consistency_token = 1; + * + * @param value The consistencyToken to set. + * @return This builder for chaining. + */ + public Builder setConsistencyToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + consistencyToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The generated consistency token.
+     * 
+ * + * string consistency_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearConsistencyToken() { + consistencyToken_ = getDefaultInstance().getConsistencyToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The generated consistency token.
+     * 
+ * + * string consistency_token = 1; + * + * @param value The bytes for consistencyToken to set. + * @return This builder for chaining. + */ + public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + consistencyToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + private static final com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(); + } + + public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateConsistencyTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GenerateConsistencyTokenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java new file mode 100644 index 000000000000..356129ca04ed --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GenerateConsistencyTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated consistency token.
+   * 
+ * + * string consistency_token = 1; + * + * @return The consistencyToken. + */ + java.lang.String getConsistencyToken(); + + /** + * + * + *
+   * The generated consistency token.
+   * 
+ * + * string consistency_token = 1; + * + * @return The bytes for consistencyToken. + */ + com.google.protobuf.ByteString getConsistencyTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java new file mode 100644 index 000000000000..a01e809fc31b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.GetAppProfile.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetAppProfileRequest} + */ +@com.google.protobuf.Generated +public final class GetAppProfileRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetAppProfileRequest) + GetAppProfileRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetAppProfileRequest"); + } + + // Use GetAppProfileRequest.newBuilder() to construct. + private GetAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetAppProfileRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetAppProfileRequest.class, + com.google.bigtable.admin.v2.GetAppProfileRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested app profile. Values are of the
+   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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 requested app profile. Values are of the
+   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetAppProfileRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetAppProfileRequest other = + (com.google.bigtable.admin.v2.GetAppProfileRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest 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.admin.v2.GetAppProfileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest 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.admin.v2.GetAppProfileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetAppProfileRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.GetAppProfile.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetAppProfileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetAppProfileRequest) + com.google.bigtable.admin.v2.GetAppProfileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetAppProfileRequest.class, + com.google.bigtable.admin.v2.GetAppProfileRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetAppProfileRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAppProfileRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetAppProfileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAppProfileRequest build() { + com.google.bigtable.admin.v2.GetAppProfileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAppProfileRequest buildPartial() { + com.google.bigtable.admin.v2.GetAppProfileRequest result = + new com.google.bigtable.admin.v2.GetAppProfileRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetAppProfileRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetAppProfileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetAppProfileRequest other) { + if (other == com.google.bigtable.admin.v2.GetAppProfileRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested app profile. Values are of the
+     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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 requested app profile. Values are of the
+     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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 requested app profile. Values are of the
+     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested app profile. Values are of the
+     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested app profile. Values are of the
+     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetAppProfileRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetAppProfileRequest) + private static final com.google.bigtable.admin.v2.GetAppProfileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetAppProfileRequest(); + } + + public static com.google.bigtable.admin.v2.GetAppProfileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAppProfileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetAppProfileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java new file mode 100644 index 000000000000..6da19167c364 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetAppProfileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetAppProfileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested app profile. Values are of the
+   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * 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 requested app profile. Values are of the
+   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java new file mode 100644 index 000000000000..43a29c57e85a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java @@ -0,0 +1,811 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class GetAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetAuthorizedViewRequest) + GetAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetAuthorizedViewRequest"); + } + + // Use GetAuthorizedViewRequest.newBuilder() to construct. + private GetAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetAuthorizedViewRequest() { + name_ = ""; + view_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.GetAuthorizedViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 requested AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedView's
+   * fields. Default to BASIC.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedView's
+   * fields. Default to BASIC.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView() { + com.google.bigtable.admin.v2.AuthorizedView.ResponseView result = + com.google.bigtable.admin.v2.AuthorizedView.ResponseView.forNumber(view_); + return result == null + ? com.google.bigtable.admin.v2.AuthorizedView.ResponseView.UNRECOGNIZED + : result; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (view_ + != com.google.bigtable.admin.v2.AuthorizedView.ResponseView.RESPONSE_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, view_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (view_ + != com.google.bigtable.admin.v2.AuthorizedView.ResponseView.RESPONSE_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + size += getUnknownFields().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.admin.v2.GetAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetAuthorizedViewRequest other = + (com.google.bigtable.admin.v2.GetAuthorizedViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest 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.admin.v2.GetAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest 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.admin.v2.GetAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetAuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetAuthorizedViewRequest) + com.google.bigtable.admin.v2.GetAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.GetAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetAuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAuthorizedViewRequest build() { + com.google.bigtable.admin.v2.GetAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetAuthorizedViewRequest buildPartial() { + com.google.bigtable.admin.v2.GetAuthorizedViewRequest result = + new com.google.bigtable.admin.v2.GetAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetAuthorizedViewRequest other) { + if (other == com.google.bigtable.admin.v2.GetAuthorizedViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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 requested AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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 requested AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested AuthorizedView.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedView's
+     * fields. Default to BASIC.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedView's
+     * fields. Default to BASIC.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedView's
+     * fields. Default to BASIC.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView() { + com.google.bigtable.admin.v2.AuthorizedView.ResponseView result = + com.google.bigtable.admin.v2.AuthorizedView.ResponseView.forNumber(view_); + return result == null + ? com.google.bigtable.admin.v2.AuthorizedView.ResponseView.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedView's
+     * fields. Default to BASIC.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.bigtable.admin.v2.AuthorizedView.ResponseView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedView's
+     * fields. Default to BASIC.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetAuthorizedViewRequest) + private static final com.google.bigtable.admin.v2.GetAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetAuthorizedViewRequest(); + } + + public static com.google.bigtable.admin.v2.GetAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..2ac1f5b7711b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * 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 requested AuthorizedView.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedView's
+   * fields. Default to BASIC.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedView's
+   * fields. Default to BASIC.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java new file mode 100644 index 000000000000..df54cabb165b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java @@ -0,0 +1,625 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetBackupRequest} + */ +@com.google.protobuf.Generated +public final class GetBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetBackupRequest) + GetBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetBackupRequest"); + } + + // Use GetBackupRequest.newBuilder() to construct. + private GetBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetBackupRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetBackupRequest.class, + com.google.bigtable.admin.v2.GetBackupRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * 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. Name of the backup.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetBackupRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetBackupRequest other = + (com.google.bigtable.admin.v2.GetBackupRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest 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.admin.v2.GetBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest 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.admin.v2.GetBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetBackupRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetBackupRequest) + com.google.bigtable.admin.v2.GetBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetBackupRequest.class, + com.google.bigtable.admin.v2.GetBackupRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetBackupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetBackupRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetBackupRequest build() { + com.google.bigtable.admin.v2.GetBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetBackupRequest buildPartial() { + com.google.bigtable.admin.v2.GetBackupRequest result = + new com.google.bigtable.admin.v2.GetBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetBackupRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetBackupRequest other) { + if (other == com.google.bigtable.admin.v2.GetBackupRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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. Name of the backup.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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. Name of the backup.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the backup.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetBackupRequest) + private static final com.google.bigtable.admin.v2.GetBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetBackupRequest(); + } + + public static com.google.bigtable.admin.v2.GetBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java new file mode 100644 index 000000000000..c16dfaf4394c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Name of the backup.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java new file mode 100644 index 000000000000..e578d83b5298 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java @@ -0,0 +1,616 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.GetCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetClusterRequest} + */ +@com.google.protobuf.Generated +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetClusterRequest) + GetClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetClusterRequest"); + } + + // Use GetClusterRequest.newBuilder() to construct. + private GetClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetClusterRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetClusterRequest.class, + com.google.bigtable.admin.v2.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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 requested cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetClusterRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetClusterRequest other = + (com.google.bigtable.admin.v2.GetClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest 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.admin.v2.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest 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.admin.v2.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetClusterRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.GetCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetClusterRequest) + com.google.bigtable.admin.v2.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetClusterRequest.class, + com.google.bigtable.admin.v2.GetClusterRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetClusterRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetClusterRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetClusterRequest build() { + com.google.bigtable.admin.v2.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetClusterRequest buildPartial() { + com.google.bigtable.admin.v2.GetClusterRequest result = + new com.google.bigtable.admin.v2.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetClusterRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetClusterRequest other) { + if (other == com.google.bigtable.admin.v2.GetClusterRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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 requested cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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 requested cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested cluster. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetClusterRequest) + private static final com.google.bigtable.admin.v2.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetClusterRequest(); + } + + public static com.google.bigtable.admin.v2.GetClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..0dea1d0b35e7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * 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 requested cluster. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java new file mode 100644 index 000000000000..656370bf064c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.GetInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetInstanceRequest} + */ +@com.google.protobuf.Generated +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetInstanceRequest"); + } + + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetInstanceRequest.class, + com.google.bigtable.admin.v2.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested instance. 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 requested instance. 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetInstanceRequest other = + (com.google.bigtable.admin.v2.GetInstanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest 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.admin.v2.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest 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.admin.v2.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetInstanceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.GetInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetInstanceRequest) + com.google.bigtable.admin.v2.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetInstanceRequest.class, + com.google.bigtable.admin.v2.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetInstanceRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetInstanceRequest build() { + com.google.bigtable.admin.v2.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetInstanceRequest buildPartial() { + com.google.bigtable.admin.v2.GetInstanceRequest result = + new com.google.bigtable.admin.v2.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetInstanceRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetInstanceRequest other) { + if (other == com.google.bigtable.admin.v2.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested instance. 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 requested instance. 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 requested instance. 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested instance. 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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested instance. 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetInstanceRequest) + private static final com.google.bigtable.admin.v2.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetInstanceRequest(); + } + + public static com.google.bigtable.admin.v2.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..a5680ee546ee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested instance. 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 requested instance. 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(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequest.java new file mode 100644 index 000000000000..32cfb8b327b4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequest.java @@ -0,0 +1,617 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.GetLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetLogicalViewRequest} + */ +@com.google.protobuf.Generated +public final class GetLogicalViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetLogicalViewRequest) + GetLogicalViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetLogicalViewRequest"); + } + + // Use GetLogicalViewRequest.newBuilder() to construct. + private GetLogicalViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetLogicalViewRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetLogicalViewRequest.class, + com.google.bigtable.admin.v2.GetLogicalViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested logical view. Values are of the
+   * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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 requested logical view. Values are of the
+   * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetLogicalViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetLogicalViewRequest other = + (com.google.bigtable.admin.v2.GetLogicalViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest 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.admin.v2.GetLogicalViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest 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.admin.v2.GetLogicalViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetLogicalViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.GetLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetLogicalViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetLogicalViewRequest) + com.google.bigtable.admin.v2.GetLogicalViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetLogicalViewRequest.class, + com.google.bigtable.admin.v2.GetLogicalViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetLogicalViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetLogicalViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetLogicalViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetLogicalViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetLogicalViewRequest build() { + com.google.bigtable.admin.v2.GetLogicalViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetLogicalViewRequest buildPartial() { + com.google.bigtable.admin.v2.GetLogicalViewRequest result = + new com.google.bigtable.admin.v2.GetLogicalViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetLogicalViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetLogicalViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetLogicalViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetLogicalViewRequest other) { + if (other == com.google.bigtable.admin.v2.GetLogicalViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested logical view. Values are of the
+     * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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 requested logical view. Values are of the
+     * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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 requested logical view. Values are of the
+     * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested logical view. Values are of the
+     * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested logical view. Values are of the
+     * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetLogicalViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetLogicalViewRequest) + private static final com.google.bigtable.admin.v2.GetLogicalViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetLogicalViewRequest(); + } + + public static com.google.bigtable.admin.v2.GetLogicalViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLogicalViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetLogicalViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequestOrBuilder.java new file mode 100644 index 000000000000..e7e6b8d01262 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetLogicalViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetLogicalViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested logical view. Values are of the
+   * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * 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 requested logical view. Values are of the
+   * form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequest.java new file mode 100644 index 000000000000..d8db352ad50d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequest.java @@ -0,0 +1,625 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.GetMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class GetMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetMaterializedViewRequest) + GetMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetMaterializedViewRequest"); + } + + // Use GetMaterializedViewRequest.newBuilder() to construct. + private GetMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetMaterializedViewRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetMaterializedViewRequest.class, + com.google.bigtable.admin.v2.GetMaterializedViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested materialized view. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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 requested materialized view. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetMaterializedViewRequest other = + (com.google.bigtable.admin.v2.GetMaterializedViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest 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.admin.v2.GetMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest 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.admin.v2.GetMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetMaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.GetMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetMaterializedViewRequest) + com.google.bigtable.admin.v2.GetMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetMaterializedViewRequest.class, + com.google.bigtable.admin.v2.GetMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetMaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_GetMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetMaterializedViewRequest build() { + com.google.bigtable.admin.v2.GetMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetMaterializedViewRequest buildPartial() { + com.google.bigtable.admin.v2.GetMaterializedViewRequest result = + new com.google.bigtable.admin.v2.GetMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetMaterializedViewRequest other) { + if (other == com.google.bigtable.admin.v2.GetMaterializedViewRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested materialized view. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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 requested materialized view. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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 requested materialized view. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested materialized view. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested materialized view. Values are of
+     * the form
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetMaterializedViewRequest) + private static final com.google.bigtable.admin.v2.GetMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetMaterializedViewRequest(); + } + + public static com.google.bigtable.admin.v2.GetMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..361a3fecfd61 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested materialized view. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * 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 requested materialized view. Values are of
+   * the form
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequest.java new file mode 100644 index 000000000000..81c50f649392 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetSchemaBundleRequest} + */ +@com.google.protobuf.Generated +public final class GetSchemaBundleRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetSchemaBundleRequest) + GetSchemaBundleRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSchemaBundleRequest"); + } + + // Use GetSchemaBundleRequest.newBuilder() to construct. + private GetSchemaBundleRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSchemaBundleRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetSchemaBundleRequest.class, + com.google.bigtable.admin.v2.GetSchemaBundleRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the schema bundle to retrieve.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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 schema bundle to retrieve.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetSchemaBundleRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetSchemaBundleRequest other = + (com.google.bigtable.admin.v2.GetSchemaBundleRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest 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.admin.v2.GetSchemaBundleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest 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.admin.v2.GetSchemaBundleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetSchemaBundleRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetSchemaBundleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetSchemaBundleRequest) + com.google.bigtable.admin.v2.GetSchemaBundleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetSchemaBundleRequest.class, + com.google.bigtable.admin.v2.GetSchemaBundleRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetSchemaBundleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSchemaBundleRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSchemaBundleRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetSchemaBundleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSchemaBundleRequest build() { + com.google.bigtable.admin.v2.GetSchemaBundleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSchemaBundleRequest buildPartial() { + com.google.bigtable.admin.v2.GetSchemaBundleRequest result = + new com.google.bigtable.admin.v2.GetSchemaBundleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetSchemaBundleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetSchemaBundleRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetSchemaBundleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetSchemaBundleRequest other) { + if (other == com.google.bigtable.admin.v2.GetSchemaBundleRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the schema bundle to retrieve.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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 schema bundle to retrieve.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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 schema bundle to retrieve.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the schema bundle to retrieve.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the schema bundle to retrieve.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetSchemaBundleRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetSchemaBundleRequest) + private static final com.google.bigtable.admin.v2.GetSchemaBundleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetSchemaBundleRequest(); + } + + public static com.google.bigtable.admin.v2.GetSchemaBundleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSchemaBundleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetSchemaBundleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequestOrBuilder.java new file mode 100644 index 000000000000..f8ab3b13b405 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetSchemaBundleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetSchemaBundleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the schema bundle to retrieve.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * 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 schema bundle to retrieve.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java new file mode 100644 index 000000000000..c4cf6a9c054f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java @@ -0,0 +1,636 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetSnapshotRequest} + */ +@com.google.protobuf.Generated +public final class GetSnapshotRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetSnapshotRequest) + GetSnapshotRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSnapshotRequest"); + } + + // Use GetSnapshotRequest.newBuilder() to construct. + private GetSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSnapshotRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetSnapshotRequest.class, + com.google.bigtable.admin.v2.GetSnapshotRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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 requested snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.GetSnapshotRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetSnapshotRequest other = + (com.google.bigtable.admin.v2.GetSnapshotRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest 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.admin.v2.GetSnapshotRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest 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.admin.v2.GetSnapshotRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetSnapshotRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetSnapshotRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetSnapshotRequest) + com.google.bigtable.admin.v2.GetSnapshotRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetSnapshotRequest.class, + com.google.bigtable.admin.v2.GetSnapshotRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetSnapshotRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSnapshotRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetSnapshotRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSnapshotRequest build() { + com.google.bigtable.admin.v2.GetSnapshotRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetSnapshotRequest buildPartial() { + com.google.bigtable.admin.v2.GetSnapshotRequest result = + new com.google.bigtable.admin.v2.GetSnapshotRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetSnapshotRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetSnapshotRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetSnapshotRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetSnapshotRequest other) { + if (other == com.google.bigtable.admin.v2.GetSnapshotRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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 requested snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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 requested snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetSnapshotRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetSnapshotRequest) + private static final com.google.bigtable.admin.v2.GetSnapshotRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetSnapshotRequest(); + } + + public static com.google.bigtable.admin.v2.GetSnapshotRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSnapshotRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetSnapshotRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java new file mode 100644 index 000000000000..9959da4fe66a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetSnapshotRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetSnapshotRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * 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 requested snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java new file mode 100644 index 000000000000..7db681eff662 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java @@ -0,0 +1,787 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetTableRequest} + */ +@com.google.protobuf.Generated +public final class GetTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetTableRequest) + GetTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetTableRequest"); + } + + // Use GetTableRequest.newBuilder() to construct. + private GetTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetTableRequest() { + name_ = ""; + view_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetTableRequest.class, + com.google.bigtable.admin.v2.GetTableRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the requested table.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 requested table.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + + /** + * + * + *
+   * The view to be applied to the returned table's fields.
+   * Defaults to `SCHEMA_VIEW` if unspecified.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * The view to be applied to the returned table's fields.
+   * Defaults to `SCHEMA_VIEW` if unspecified.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.View getView() { + com.google.bigtable.admin.v2.Table.View result = + com.google.bigtable.admin.v2.Table.View.forNumber(view_); + return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + size += getUnknownFields().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.admin.v2.GetTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.GetTableRequest other = + (com.google.bigtable.admin.v2.GetTableRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetTableRequest 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.admin.v2.GetTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetTableRequest 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.admin.v2.GetTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.GetTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.GetTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.GetTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.GetTableRequest) + com.google.bigtable.admin.v2.GetTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.GetTableRequest.class, + com.google.bigtable.admin.v2.GetTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.GetTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.GetTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetTableRequest build() { + com.google.bigtable.admin.v2.GetTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.GetTableRequest buildPartial() { + com.google.bigtable.admin.v2.GetTableRequest result = + new com.google.bigtable.admin.v2.GetTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.GetTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.GetTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.GetTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.GetTableRequest other) { + if (other == com.google.bigtable.admin.v2.GetTableRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the requested table.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 requested table.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 requested table.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested table.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the requested table.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * The view to be applied to the returned table's fields.
+     * Defaults to `SCHEMA_VIEW` if unspecified.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * The view to be applied to the returned table's fields.
+     * Defaults to `SCHEMA_VIEW` if unspecified.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The view to be applied to the returned table's fields.
+     * Defaults to `SCHEMA_VIEW` if unspecified.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.View getView() { + com.google.bigtable.admin.v2.Table.View result = + com.google.bigtable.admin.v2.Table.View.forNumber(view_); + return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The view to be applied to the returned table's fields.
+     * Defaults to `SCHEMA_VIEW` if unspecified.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.bigtable.admin.v2.Table.View value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The view to be applied to the returned table's fields.
+     * Defaults to `SCHEMA_VIEW` if unspecified.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.GetTableRequest) + private static final com.google.bigtable.admin.v2.GetTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.GetTableRequest(); + } + + public static com.google.bigtable.admin.v2.GetTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.GetTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java new file mode 100644 index 000000000000..55242a907131 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface GetTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.GetTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the requested table.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 requested table.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The view to be applied to the returned table's fields.
+   * Defaults to `SCHEMA_VIEW` if unspecified.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * The view to be applied to the returned table's fields.
+   * Defaults to `SCHEMA_VIEW` if unspecified.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + com.google.bigtable.admin.v2.Table.View getView(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java new file mode 100644 index 000000000000..1275e268e752 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java @@ -0,0 +1,1873 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A tablet is a defined by a start and end key and is explained in
+ * https://cloud.google.com/bigtable/docs/overview#architecture and
+ * https://cloud.google.com/bigtable/docs/performance#optimization.
+ * A Hot tablet is a tablet that exhibits high average cpu usage during the time
+ * interval from start time to end time.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.HotTablet} + */ +@com.google.protobuf.Generated +public final class HotTablet extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.HotTablet) + HotTabletOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HotTablet"); + } + + // Use HotTablet.newBuilder() to construct. + private HotTablet(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private HotTablet() { + name_ = ""; + tableName_ = ""; + startKey_ = ""; + endKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_HotTablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.HotTablet.class, + com.google.bigtable.admin.v2.HotTablet.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the hot tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the hot tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+   * 
+ * + * string name = 1; + * + * @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 TABLE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Name of the table that contains the tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the table that contains the tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int START_KEY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object startKey_ = ""; + + /** + * + * + *
+   * Tablet Start Key (inclusive).
+   * 
+ * + * string start_key = 5; + * + * @return The startKey. + */ + @java.lang.Override + public java.lang.String getStartKey() { + java.lang.Object ref = startKey_; + 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(); + startKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Tablet Start Key (inclusive).
+   * 
+ * + * string start_key = 5; + * + * @return The bytes for startKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartKeyBytes() { + java.lang.Object ref = startKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_KEY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object endKey_ = ""; + + /** + * + * + *
+   * Tablet End Key (inclusive).
+   * 
+ * + * string end_key = 6; + * + * @return The endKey. + */ + @java.lang.Override + public java.lang.String getEndKey() { + java.lang.Object ref = endKey_; + 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(); + endKey_ = s; + return s; + } + } + + /** + * + * + *
+   * Tablet End Key (inclusive).
+   * 
+ * + * string end_key = 6; + * + * @return The bytes for endKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndKeyBytes() { + java.lang.Object ref = endKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_CPU_USAGE_PERCENT_FIELD_NUMBER = 7; + private float nodeCpuUsagePercent_ = 0F; + + /** + * + * + *
+   * Output only. The average CPU usage spent by a node on this tablet over the
+   * start_time to end_time time range. The percentage is the amount of CPU used
+   * by the node to serve the tablet, from 0% (tablet was not interacted with)
+   * to 100% (the node spent all cycles serving the hot tablet).
+   * 
+ * + * float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nodeCpuUsagePercent. + */ + @java.lang.Override + public float getNodeCpuUsagePercent() { + return nodeCpuUsagePercent_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, startKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, endKey_); + } + if (java.lang.Float.floatToRawIntBits(nodeCpuUsagePercent_) != 0) { + output.writeFloat(7, nodeCpuUsagePercent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(startKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, startKey_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(endKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, endKey_); + } + if (java.lang.Float.floatToRawIntBits(nodeCpuUsagePercent_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, nodeCpuUsagePercent_); + } + size += getUnknownFields().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.admin.v2.HotTablet)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.HotTablet other = (com.google.bigtable.admin.v2.HotTablet) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTableName().equals(other.getTableName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getStartKey().equals(other.getStartKey())) return false; + if (!getEndKey().equals(other.getEndKey())) return false; + if (java.lang.Float.floatToIntBits(getNodeCpuUsagePercent()) + != java.lang.Float.floatToIntBits(other.getNodeCpuUsagePercent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + START_KEY_FIELD_NUMBER; + hash = (53 * hash) + getStartKey().hashCode(); + hash = (37 * hash) + END_KEY_FIELD_NUMBER; + hash = (53 * hash) + getEndKey().hashCode(); + hash = (37 * hash) + NODE_CPU_USAGE_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getNodeCpuUsagePercent()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.HotTablet 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.admin.v2.HotTablet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.HotTablet 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.admin.v2.HotTablet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.HotTablet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.HotTablet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.HotTablet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.HotTablet 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A tablet is a defined by a start and end key and is explained in
+   * https://cloud.google.com/bigtable/docs/overview#architecture and
+   * https://cloud.google.com/bigtable/docs/performance#optimization.
+   * A Hot tablet is a tablet that exhibits high average cpu usage during the time
+   * interval from start time to end time.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.HotTablet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.HotTablet) + com.google.bigtable.admin.v2.HotTabletOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_HotTablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.HotTablet.class, + com.google.bigtable.admin.v2.HotTablet.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.HotTablet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + tableName_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + startKey_ = ""; + endKey_ = ""; + nodeCpuUsagePercent_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_HotTablet_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.HotTablet getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.HotTablet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.HotTablet build() { + com.google.bigtable.admin.v2.HotTablet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.HotTablet buildPartial() { + com.google.bigtable.admin.v2.HotTablet result = + new com.google.bigtable.admin.v2.HotTablet(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.HotTablet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableName_ = tableName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startKey_ = startKey_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endKey_ = endKey_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.nodeCpuUsagePercent_ = nodeCpuUsagePercent_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.HotTablet) { + return mergeFrom((com.google.bigtable.admin.v2.HotTablet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.HotTablet other) { + if (other == com.google.bigtable.admin.v2.HotTablet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getStartKey().isEmpty()) { + startKey_ = other.startKey_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getEndKey().isEmpty()) { + endKey_ = other.endKey_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (java.lang.Float.floatToRawIntBits(other.getNodeCpuUsagePercent()) != 0) { + setNodeCpuUsagePercent(other.getNodeCpuUsagePercent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + startKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + endKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 61: + { + nodeCpuUsagePercent_ = input.readFloat(); + bitField0_ |= 0x00000040; + break; + } // case 61 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the hot tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the hot tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the hot tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the hot tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the hot tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Name of the table that contains the tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the table that contains the tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the table that contains the tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the table that contains the tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the table that contains the tablet. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000004); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * Output only. The start time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000008); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * Output only. The end time of the hot tablet.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object startKey_ = ""; + + /** + * + * + *
+     * Tablet Start Key (inclusive).
+     * 
+ * + * string start_key = 5; + * + * @return The startKey. + */ + public java.lang.String getStartKey() { + java.lang.Object ref = startKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Tablet Start Key (inclusive).
+     * 
+ * + * string start_key = 5; + * + * @return The bytes for startKey. + */ + public com.google.protobuf.ByteString getStartKeyBytes() { + java.lang.Object ref = startKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + startKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Tablet Start Key (inclusive).
+     * 
+ * + * string start_key = 5; + * + * @param value The startKey to set. + * @return This builder for chaining. + */ + public Builder setStartKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + startKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Tablet Start Key (inclusive).
+     * 
+ * + * string start_key = 5; + * + * @return This builder for chaining. + */ + public Builder clearStartKey() { + startKey_ = getDefaultInstance().getStartKey(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Tablet Start Key (inclusive).
+     * 
+ * + * string start_key = 5; + * + * @param value The bytes for startKey to set. + * @return This builder for chaining. + */ + public Builder setStartKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + startKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object endKey_ = ""; + + /** + * + * + *
+     * Tablet End Key (inclusive).
+     * 
+ * + * string end_key = 6; + * + * @return The endKey. + */ + public java.lang.String getEndKey() { + java.lang.Object ref = endKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Tablet End Key (inclusive).
+     * 
+ * + * string end_key = 6; + * + * @return The bytes for endKey. + */ + public com.google.protobuf.ByteString getEndKeyBytes() { + java.lang.Object ref = endKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Tablet End Key (inclusive).
+     * 
+ * + * string end_key = 6; + * + * @param value The endKey to set. + * @return This builder for chaining. + */ + public Builder setEndKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Tablet End Key (inclusive).
+     * 
+ * + * string end_key = 6; + * + * @return This builder for chaining. + */ + public Builder clearEndKey() { + endKey_ = getDefaultInstance().getEndKey(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Tablet End Key (inclusive).
+     * 
+ * + * string end_key = 6; + * + * @param value The bytes for endKey to set. + * @return This builder for chaining. + */ + public Builder setEndKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private float nodeCpuUsagePercent_; + + /** + * + * + *
+     * Output only. The average CPU usage spent by a node on this tablet over the
+     * start_time to end_time time range. The percentage is the amount of CPU used
+     * by the node to serve the tablet, from 0% (tablet was not interacted with)
+     * to 100% (the node spent all cycles serving the hot tablet).
+     * 
+ * + * float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nodeCpuUsagePercent. + */ + @java.lang.Override + public float getNodeCpuUsagePercent() { + return nodeCpuUsagePercent_; + } + + /** + * + * + *
+     * Output only. The average CPU usage spent by a node on this tablet over the
+     * start_time to end_time time range. The percentage is the amount of CPU used
+     * by the node to serve the tablet, from 0% (tablet was not interacted with)
+     * to 100% (the node spent all cycles serving the hot tablet).
+     * 
+ * + * float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The nodeCpuUsagePercent to set. + * @return This builder for chaining. + */ + public Builder setNodeCpuUsagePercent(float value) { + + nodeCpuUsagePercent_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The average CPU usage spent by a node on this tablet over the
+     * start_time to end_time time range. The percentage is the amount of CPU used
+     * by the node to serve the tablet, from 0% (tablet was not interacted with)
+     * to 100% (the node spent all cycles serving the hot tablet).
+     * 
+ * + * float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNodeCpuUsagePercent() { + bitField0_ = (bitField0_ & ~0x00000040); + nodeCpuUsagePercent_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.HotTablet) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.HotTablet) + private static final com.google.bigtable.admin.v2.HotTablet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.HotTablet(); + } + + public static com.google.bigtable.admin.v2.HotTablet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HotTablet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.HotTablet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.java new file mode 100644 index 000000000000..077e8d2848fd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface HotTabletOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.HotTablet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the hot tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the hot tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name of the table that contains the tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Name of the table that contains the tablet. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * 
+ * + * string table_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Output only. The start time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * Output only. The end time of the hot tablet.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Tablet Start Key (inclusive).
+   * 
+ * + * string start_key = 5; + * + * @return The startKey. + */ + java.lang.String getStartKey(); + + /** + * + * + *
+   * Tablet Start Key (inclusive).
+   * 
+ * + * string start_key = 5; + * + * @return The bytes for startKey. + */ + com.google.protobuf.ByteString getStartKeyBytes(); + + /** + * + * + *
+   * Tablet End Key (inclusive).
+   * 
+ * + * string end_key = 6; + * + * @return The endKey. + */ + java.lang.String getEndKey(); + + /** + * + * + *
+   * Tablet End Key (inclusive).
+   * 
+ * + * string end_key = 6; + * + * @return The bytes for endKey. + */ + com.google.protobuf.ByteString getEndKeyBytes(); + + /** + * + * + *
+   * Output only. The average CPU usage spent by a node on this tablet over the
+   * start_time to end_time time range. The percentage is the amount of CPU used
+   * by the node to serve the tablet, from 0% (tablet was not interacted with)
+   * to 100% (the node spent all cycles serving the hot tablet).
+   * 
+ * + * float node_cpu_usage_percent = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nodeCpuUsagePercent. + */ + float getNodeCpuUsagePercent(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java new file mode 100644 index 000000000000..860b58841d29 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java @@ -0,0 +1,3336 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
+ * the resources that serve them.
+ * All tables in an instance are served from all
+ * [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Instance} + */ +@com.google.protobuf.Generated +public final class Instance extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Instance"); + } + + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + displayName_ = ""; + state_ = 0; + type_ = 0; + edition_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetLabels(); + case 12: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Instance.class, + com.google.bigtable.admin.v2.Instance.Builder.class); + } + + /** + * + * + *
+   * Possible states of an instance.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the instance could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + STATE_NOT_KNOWN(0), + /** + * + * + *
+     * The instance has been successfully created and can serve requests
+     * to its tables.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The instance is currently being created, and may be destroyed
+     * if the creation process encounters an error.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + + /** + * + * + *
+     * The state of the instance could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + public static final int STATE_NOT_KNOWN_VALUE = 0; + + /** + * + * + *
+     * The instance has been successfully created and can serve requests
+     * to its tables.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + + /** + * + * + *
+     * The instance is currently being created, and may be destroyed
+     * if the creation process encounters an error.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_NOT_KNOWN; + case 1: + return READY; + case 2: + return CREATING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Instance.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Instance.State) + } + + /** + * + * + *
+   * The type of the instance.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Instance.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The type of the instance is unspecified. If set when creating an
+     * instance, a `PRODUCTION` instance will be created. If set when updating
+     * an instance, the type will be left unchanged.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * An instance meant for production use. `serve_nodes` must be set
+     * on the cluster.
+     * 
+ * + * PRODUCTION = 1; + */ + PRODUCTION(1), + /** + * + * + *
+     * DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
+     * a higher minimum node count than DEVELOPMENT.
+     * 
+ * + * DEVELOPMENT = 2; + */ + DEVELOPMENT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + /** + * + * + *
+     * The type of the instance is unspecified. If set when creating an
+     * instance, a `PRODUCTION` instance will be created. If set when updating
+     * an instance, the type will be left unchanged.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * An instance meant for production use. `serve_nodes` must be set
+     * on the cluster.
+     * 
+ * + * PRODUCTION = 1; + */ + public static final int PRODUCTION_VALUE = 1; + + /** + * + * + *
+     * DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
+     * a higher minimum node count than DEVELOPMENT.
+     * 
+ * + * DEVELOPMENT = 2; + */ + public static final int DEVELOPMENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return PRODUCTION; + case 2: + return DEVELOPMENT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Instance.Type) + } + + /** + * + * + *
+   * Possible editions of an instance.
+   *
+   * An edition is a specific tier of Cloud Bigtable. Each edition is tailored
+   * to different customer needs. Higher tiers offer more features and better
+   * performance.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Instance.Edition} + */ + public enum Edition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The edition is unspecified. This is treated as `ENTERPRISE`.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + EDITION_UNSPECIFIED(0), + /** + * + * + *
+     * The Enterprise edition. This is the default offering that is designed to
+     * meet the needs of most enterprise workloads.
+     * 
+ * + * ENTERPRISE = 1; + */ + ENTERPRISE(1), + /** + * + * + *
+     * The Enterprise Plus edition. This is a premium tier that is designed for
+     * demanding, multi-tenant workloads requiring the highest levels of
+     * performance, scale, and global availability.
+     *
+     * The nodes in the Enterprise Plus tier come at a higher cost than the
+     * Enterprise tier. Any Enterprise Plus features must be disabled before
+     * downgrading to Enterprise.
+     * 
+ * + * ENTERPRISE_PLUS = 2; + */ + ENTERPRISE_PLUS(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Edition"); + } + + /** + * + * + *
+     * The edition is unspecified. This is treated as `ENTERPRISE`.
+     * 
+ * + * EDITION_UNSPECIFIED = 0; + */ + public static final int EDITION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The Enterprise edition. This is the default offering that is designed to
+     * meet the needs of most enterprise workloads.
+     * 
+ * + * ENTERPRISE = 1; + */ + public static final int ENTERPRISE_VALUE = 1; + + /** + * + * + *
+     * The Enterprise Plus edition. This is a premium tier that is designed for
+     * demanding, multi-tenant workloads requiring the highest levels of
+     * performance, scale, and global availability.
+     *
+     * The nodes in the Enterprise Plus tier come at a higher cost than the
+     * Enterprise tier. Any Enterprise Plus features must be disabled before
+     * downgrading to Enterprise.
+     * 
+ * + * ENTERPRISE_PLUS = 2; + */ + public static final int ENTERPRISE_PLUS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Edition valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Edition forNumber(int value) { + switch (value) { + case 0: + return EDITION_UNSPECIFIED; + case 1: + return ENTERPRISE; + case 2: + return ENTERPRISE_PLUS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Edition findValueByNumber(int number) { + return Edition.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Instance.getDescriptor().getEnumTypes().get(2); + } + + private static final Edition[] VALUES = values(); + + public static Edition valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Edition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Instance.Edition) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the instance. Values are of the form
+   * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the instance. Values are of the form
+   * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+   * 
+ * + * string name = 1; + * + * @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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * Required. The descriptive name for this instance as it appears in UIs.
+   * Can be changed at any time, but should be kept globally unique
+   * to avoid confusion.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The descriptive name for this instance as it appears in UIs.
+   * Can be changed at any time, but should be kept globally unique
+   * to avoid confusion.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The current state of the instance.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The current state of the instance.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.State getState() { + com.google.bigtable.admin.v2.Instance.State result = + com.google.bigtable.admin.v2.Instance.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Instance.State.UNRECOGNIZED : result; + } + + public static final int TYPE_FIELD_NUMBER = 4; + private int type_ = 0; + + /** + * + * + *
+   * The type of the instance. Defaults to `PRODUCTION`.
+   * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * The type of the instance. Defaults to `PRODUCTION`.
+   * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.Type getType() { + com.google.bigtable.admin.v2.Instance.Type result = + com.google.bigtable.admin.v2.Instance.Type.forNumber(type_); + return result == null ? com.google.bigtable.admin.v2.Instance.Type.UNRECOGNIZED : result; + } + + public static final int EDITION_FIELD_NUMBER = 14; + private int edition_ = 0; + + /** + * + * + *
+   * Optional. The edition of the instance. See
+   * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+   * Optional. The edition of the instance. See
+   * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.Edition getEdition() { + com.google.bigtable.admin.v2.Instance.Edition result = + com.google.bigtable.admin.v2.Instance.Edition.forNumber(edition_); + return result == null ? com.google.bigtable.admin.v2.Instance.Edition.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 8; + private boolean satisfiesPzs_ = false; + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 11; + private boolean satisfiesPzi_ = false; + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public boolean getSatisfiesPzi() { + return satisfiesPzi_; + } + + public static final int TAGS_FIELD_NUMBER = 12; + + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, displayName_); + } + if (state_ != com.google.bigtable.admin.v2.Instance.State.STATE_NOT_KNOWN.getNumber()) { + output.writeEnum(3, state_); + } + if (type_ != com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, type_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(8, satisfiesPzs_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(11, satisfiesPzi_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 12); + if (edition_ != com.google.bigtable.admin.v2.Instance.Edition.EDITION_UNSPECIFIED.getNumber()) { + output.writeEnum(14, edition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, displayName_); + } + if (state_ != com.google.bigtable.admin.v2.Instance.State.STATE_NOT_KNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (type_ != com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, type_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, satisfiesPzs_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, satisfiesPzi_); + } + for (java.util.Map.Entry entry : + internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry tags__ = + TagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, tags__); + } + if (edition_ != com.google.bigtable.admin.v2.Instance.Edition.EDITION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, edition_); + } + size += getUnknownFields().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.admin.v2.Instance)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Instance other = (com.google.bigtable.admin.v2.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (type_ != other.type_) return false; + if (edition_ != other.edition_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; + } + if (hasSatisfiesPzi() != other.hasSatisfiesPzi()) return false; + if (hasSatisfiesPzi()) { + if (getSatisfiesPzi() != other.getSatisfiesPzi()) return false; + } + if (!internalGetTags().equals(other.internalGetTags())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + EDITION_FIELD_NUMBER; + hash = (53 * hash) + edition_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); + } + if (hasSatisfiesPzi()) { + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzi()); + } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Instance 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.admin.v2.Instance parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Instance 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.admin.v2.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Instance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Instance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Instance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Instance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Instance 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
+   * the resources that serve them.
+   * All tables in an instance are served from all
+   * [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Instance) + com.google.bigtable.admin.v2.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetLabels(); + case 12: + return internalGetTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + case 12: + return internalGetMutableTags(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Instance.class, + com.google.bigtable.admin.v2.Instance.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Instance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + state_ = 0; + type_ = 0; + edition_ = 0; + internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + satisfiesPzs_ = false; + satisfiesPzi_ = false; + internalGetMutableTags().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Instance getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Instance build() { + com.google.bigtable.admin.v2.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Instance buildPartial() { + com.google.bigtable.admin.v2.Instance result = + new com.google.bigtable.admin.v2.Instance(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.edition_ = edition_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.satisfiesPzs_ = satisfiesPzs_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.satisfiesPzi_ = satisfiesPzi_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Instance) { + return mergeFrom((com.google.bigtable.admin.v2.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Instance other) { + if (other == com.google.bigtable.admin.v2.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.edition_ != 0) { + setEditionValue(other.getEditionValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasSatisfiesPzs()) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } + if (other.hasSatisfiesPzi()) { + setSatisfiesPzi(other.getSatisfiesPzi()); + } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField0_ |= 0x00000200; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 58: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + satisfiesPzs_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 88: + { + satisfiesPzi_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 98: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 98 + case 112: + { + edition_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 112 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the instance. Values are of the form
+     * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the instance. Values are of the form
+     * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the instance. Values are of the form
+     * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the instance. Values are of the form
+     * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the instance. Values are of the form
+     * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * Required. The descriptive name for this instance as it appears in UIs.
+     * Can be changed at any time, but should be kept globally unique
+     * to avoid confusion.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The descriptive name for this instance as it appears in UIs.
+     * Can be changed at any time, but should be kept globally unique
+     * to avoid confusion.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The descriptive name for this instance as it appears in UIs.
+     * Can be changed at any time, but should be kept globally unique
+     * to avoid confusion.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The descriptive name for this instance as it appears in UIs.
+     * Can be changed at any time, but should be kept globally unique
+     * to avoid confusion.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The descriptive name for this instance as it appears in UIs.
+     * Can be changed at any time, but should be kept globally unique
+     * to avoid confusion.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the instance.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The current state of the instance.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the instance.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.State getState() { + com.google.bigtable.admin.v2.Instance.State result = + com.google.bigtable.admin.v2.Instance.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Instance.State.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The current state of the instance.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.bigtable.admin.v2.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the instance.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * The type of the instance. Defaults to `PRODUCTION`.
+     * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of the instance. Defaults to `PRODUCTION`.
+     * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the instance. Defaults to `PRODUCTION`.
+     * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.Type getType() { + com.google.bigtable.admin.v2.Instance.Type result = + com.google.bigtable.admin.v2.Instance.Type.forNumber(type_); + return result == null ? com.google.bigtable.admin.v2.Instance.Type.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of the instance. Defaults to `PRODUCTION`.
+     * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.bigtable.admin.v2.Instance.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the instance. Defaults to `PRODUCTION`.
+     * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + onChanged(); + return this; + } + + private int edition_ = 0; + + /** + * + * + *
+     * Optional. The edition of the instance. See
+     * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + @java.lang.Override + public int getEditionValue() { + return edition_; + } + + /** + * + * + *
+     * Optional. The edition of the instance. See
+     * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for edition to set. + * @return This builder for chaining. + */ + public Builder setEditionValue(int value) { + edition_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition of the instance. See
+     * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance.Edition getEdition() { + com.google.bigtable.admin.v2.Instance.Edition result = + com.google.bigtable.admin.v2.Instance.Edition.forNumber(edition_); + return result == null ? com.google.bigtable.admin.v2.Instance.Edition.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. The edition of the instance. See
+     * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The edition to set. + * @return This builder for chaining. + */ + public Builder setEdition(com.google.bigtable.admin.v2.Instance.Edition value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + edition_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The edition of the instance. See
+     * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearEdition() { + bitField0_ = (bitField0_ & ~0x00000010); + edition_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + + /** + * + * + *
+     * Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. They can be used to filter resources and aggregate
+     * metrics.
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform to
+     * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     * * Keys and values must both be under 128 bytes.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. A commit timestamp representing when this Instance was
+     * created. For instances created before this field was added (August 2021),
+     * this value is `seconds: 0, nanos: 1`.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private boolean satisfiesPzs_; + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzs field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzs() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The satisfiesPzs to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzs(boolean value) { + + satisfiesPzs_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x00000080); + satisfiesPzs_ = false; + onChanged(); + return this; + } + + private boolean satisfiesPzi_; + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzi field is set. + */ + @java.lang.Override + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public boolean getSatisfiesPzi() { + return satisfiesPzi_; + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The satisfiesPzi to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzi(boolean value) { + + satisfiesPzi_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzi() { + bitField0_ = (bitField0_ & ~0x00000100); + satisfiesPzi_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + bitField0_ |= 0x00000200; + onChanged(); + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableTags().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTags().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTags() { + bitField0_ |= 0x00000200; + return internalGetMutableTags().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTags().getMutableMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllTags(java.util.Map values) { + internalGetMutableTags().getMutableMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Instance) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Instance) + private static final com.google.bigtable.admin.v2.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Instance(); + } + + public static com.google.bigtable.admin.v2.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java new file mode 100644 index 000000000000..88cf05a3ed35 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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.admin.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/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java new file mode 100644 index 000000000000..0eea4987757d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java @@ -0,0 +1,498 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the instance. Values are of the form
+   * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the instance. Values are of the form
+   * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The descriptive name for this instance as it appears in UIs.
+   * Can be changed at any time, but should be kept globally unique
+   * to avoid confusion.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * Required. The descriptive name for this instance as it appears in UIs.
+   * Can be changed at any time, but should be kept globally unique
+   * to avoid confusion.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The current state of the instance.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The current state of the instance.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.bigtable.admin.v2.Instance.State getState(); + + /** + * + * + *
+   * The type of the instance. Defaults to `PRODUCTION`.
+   * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * The type of the instance. Defaults to `PRODUCTION`.
+   * 
+ * + * .google.bigtable.admin.v2.Instance.Type type = 4; + * + * @return The type. + */ + com.google.bigtable.admin.v2.Instance.Type getType(); + + /** + * + * + *
+   * Optional. The edition of the instance. See
+   * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for edition. + */ + int getEditionValue(); + + /** + * + * + *
+   * Optional. The edition of the instance. See
+   * [Edition][google.bigtable.admin.v2.Instance.Edition] for details.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance.Edition edition = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edition. + */ + com.google.bigtable.admin.v2.Instance.Edition getEdition(); + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Labels are a flexible and lightweight mechanism for organizing cloud
+   * resources into groups that reflect a customer's organizational needs and
+   * deployment strategies. They can be used to filter resources and aggregate
+   * metrics.
+   *
+   * * Label keys must be between 1 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
+   * * Label values must be between 0 and 63 characters long and must conform to
+   * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
+   * * No more than 64 labels can be associated with a given resource.
+   * * Keys and values must both be under 128 bytes.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. A commit timestamp representing when this Instance was
+   * created. For instances created before this field was added (August 2021),
+   * this value is `seconds: 0, nanos: 1`.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzs field is set. + */ + boolean hasSatisfiesPzs(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzs = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + boolean getSatisfiesPzs(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the satisfiesPzi field is set. + */ + boolean hasSatisfiesPzi(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * optional bool satisfies_pzi = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + boolean getSatisfiesPzi(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTagsCount(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsTags(java.lang.String key); + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTags(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getTagsMap(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getTagsOrThrow(java.lang.String key); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java new file mode 100644 index 000000000000..253c359b5ed2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java @@ -0,0 +1,491 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class InstanceProto extends com.google.protobuf.GeneratedFile { + private InstanceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "InstanceProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Instance_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AutoscalingTargets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AutoscalingLimits_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_HotTablet_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_LogicalView_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_LogicalView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_MaterializedView_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_MaterializedView_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "\'google/bigtable/admin/v2/instance.prot" + + "o\022\030google.bigtable.admin.v2\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032%google/bigtable/admin/v2/common" + + ".proto\032\037google/protobuf/timestamp.proto\"\222\007\n" + + "\010Instance\022\014\n" + + "\004name\030\001 \001(\t\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\002\022<\n" + + "\005state\030\003" + + " \001(\0162(.google.bigtable.admin.v2.Instance.StateB\003\340A\003\0225\n" + + "\004type\030\004 \001(\0162\'.google.bigtable.admin.v2.Instance.Type\022@\n" + + "\007edition\030\016" + + " \001(\0162*.google.bigtable.admin.v2.Instance.EditionB\003\340A\001\022>\n" + + "\006labels\030\005 \003(\0132..google.bigtable.admin.v2.Instance.LabelsEntry\0224\n" + + "\013create_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\037\n\r" + + "satisfies_pzs\030\010 \001(\010B\003\340A\003H\000\210\001\001\022\037\n\r" + + "satisfies_pzi\030\013 \001(\010B\003\340A\003H\001\210\001\001\022E\n" + + "\004tags\030\014 \003(\0132,.google.bigtable.admin.v2.Instance.TagsEntryB" + + "\t\340A\004\340A\005\340A\001\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\032+\n" + + "\tTagsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"5\n" + + "\005State\022\023\n" + + "\017STATE_NOT_KNOWN\020\000\022\t\n" + + "\005READY\020\001\022\014\n" + + "\010CREATING\020\002\"=\n" + + "\004Type\022\024\n" + + "\020TYPE_UNSPECIFIED\020\000\022\016\n\n" + + "PRODUCTION\020\001\022\017\n" + + "\013DEVELOPMENT\020\002\"G\n" + + "\007Edition\022\027\n" + + "\023EDITION_UNSPECIFIED\020\000\022\016\n\n" + + "ENTERPRISE\020\001\022\023\n" + + "\017ENTERPRISE_PLUS\020\002:h\352Ae\n" + + "%bigtableadmin.googleapis.com/Instance\022\'projects/{project}/instances/{instance}*" + + "\tinstances2\010instanceB\020\n" + + "\016_satisfies_pzsB\020\n" + + "\016_satisfies_pzi\"_\n" + + "\022AutoscalingTargets\022\037\n" + + "\027cpu_utilization_percent\030\002 \001(\005\022(\n" + + " storage_utilization_gib_per_node\030\003 \001(\005\"O\n" + + "\021AutoscalingLimits\022\034\n" + + "\017min_serve_nodes\030\001 \001(\005B\003\340A\002\022\034\n" + + "\017max_serve_nodes\030\002 \001(\005B\003\340A\002\"\255\t\n" + + "\007Cluster\022\014\n" + + "\004name\030\001 \001(\t\022;\n" + + "\010location\030\002 \001(\tB)\340A\005\372A#\n" + + "!locations.googleapis.com/Location\022;\n" + + "\005state\030\003 \001(\0162\'.g" + + "oogle.bigtable.admin.v2.Cluster.StateB\003\340A\003\022\023\n" + + "\013serve_nodes\030\004 \001(\005\022U\n" + + "\023node_scaling_factor\030\t" + + " \001(\01623.google.bigtable.admin.v2.Cluster.NodeScalingFactorB\003\340A\005\022I\n" + + "\016cluster_config\030\007" + + " \001(\0132/.google.bigtable.admin.v2.Cluster.ClusterConfigH\000\022H\n" + + "\024default_storage_type\030\005" + + " \001(\0162%.google.bigtable.admin.v2.StorageTypeB\003\340A\005\022R\n" + + "\021encryption_config\030\006" + + " \001(\01322.google.bigtable.admin.v2.Cluster.EncryptionConfigB\003\340A\005\032\270\001\n" + + "\030ClusterAutoscalingConfig\022L\n" + + "\022autoscaling_limits\030\001 \001(\013" + + "2+.google.bigtable.admin.v2.AutoscalingLimitsB\003\340A\002\022N\n" + + "\023autoscaling_targets\030\002 \001(\0132" + + ",.google.bigtable.admin.v2.AutoscalingTargetsB\003\340A\002\032o\n\r" + + "ClusterConfig\022^\n" + + "\032cluster_autoscaling_config\030\001 \001(\0132:.google.bigtabl" + + "e.admin.v2.Cluster.ClusterAutoscalingConfig\032P\n" + + "\020EncryptionConfig\022<\n" + + "\014kms_key_name\030\001 \001(\tB&\372A#\n" + + "!cloudkms.googleapis.com/CryptoKey\"Q\n" + + "\005State\022\023\n" + + "\017STATE_NOT_KNOWN\020\000\022\t\n" + + "\005READY\020\001\022\014\n" + + "\010CREATING\020\002\022\014\n" + + "\010RESIZING\020\003\022\014\n" + + "\010DISABLED\020\004\"p\n" + + "\021NodeScalingFactor\022#\n" + + "\037NODE_SCALING_FACTOR_UNSPECIFIED\020\000\022\032\n" + + "\026NODE_SCALING_FACTOR_1X\020\001\022\032\n" + + "\026NODE_SCALING_FACTOR_2X\020\002:x\352Au\n" + + "$bigtableadmin.googleapis.com/Cluster\022:projects/{project}/instances/{ins" + + "tance}/clusters/{cluster}*\010clusters2\007clusterB\010\n" + + "\006config\"\355\n\n\n" + + "AppProfile\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004etag\030\002 \001(\t\022\023\n" + + "\013description\030\003 \001(\t\022g\n" + + "\035multi_cluster_routing_use_any\030\005 \001(\0132>." + + "google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyH\000\022[\n" + + "\026single_cluster_routing\030\006" + + " \001(\01329.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingH\000\022E\n" + + "\010priority\030\007" + + " \001(\0162-.google.bigtable.admin.v2.AppProfile.PriorityB\002\030\001H\001\022T\n" + + "\022standard_isolation\030\013" + + " \001(\01326.google.bigtable.admin.v2.AppProfile.StandardIsolationH\001\022i\n" + + "\036data_boost_isolation_read_only\030\n" + + " \001(\0132?.goog" + + "le.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyH\001\032\257\001\n" + + "\031MultiClusterRoutingUseAny\022\023\n" + + "\013cluster_ids\030\001 \003(\t\022b\n" + + "\014row_affinity\030\003 \001(\0132J.google.bigtable.admin.v2" + + ".AppProfile.MultiClusterRoutingUseAny.RowAffinityH\000\032\r\n" + + "\013RowAffinityB\n\n" + + "\010affinity\032N\n" + + "\024SingleClusterRouting\022\022\n\n" + + "cluster_id\030\001 \001(\t\022\"\n" + + "\032allow_transactional_writes\030\002 \001(\010\032T\n" + + "\021StandardIsolation\022?\n" + + "\010priority\030\001 \001(\0162-." + + "google.bigtable.admin.v2.AppProfile.Priority\032\374\001\n" + + "\032DataBoostIsolationReadOnly\022w\n" + + "\025compute_billing_owner\030\001 \001(\0162S.google.bigt" + + "able.admin.v2.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwnerH\000\210\001\001\"K\n" + + "\023ComputeBillingOwner\022%\n" + + "!COMPUTE_BILLING_OWNER_UNSPECIFIED\020\000\022\r\n" + + "\tHOST_PAYS\020\001B\030\n" + + "\026_compute_billing_owner\"^\n" + + "\010Priority\022\030\n" + + "\024PRIORITY_UNSPECIFIED\020\000\022\020\n" + + "\014PRIORITY_LOW\020\001\022\023\n" + + "\017PRIORITY_MEDIUM\020\002\022\021\n\r" + + "PRIORITY_HIGH\020\003:\211\001\352A\205\001\n" + + "\'bigtableadmin.googleapis.com/AppProfile\022Aprojects/{project}/instances/{insta" + + "nce}/appProfiles/{app_profile}*\013appProfiles2\n" + + "appProfileB\020\n" + + "\016routing_policyB\013\n" + + "\tisolation\"\241\003\n" + + "\tHotTablet\022\014\n" + + "\004name\030\001 \001(\t\022;\n\n" + + "table_name\030\002 \001(\tB\'\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\0223\n\n" + + "start_time\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\021\n" + + "\tstart_key\030\005 \001(\t\022\017\n" + + "\007end_key\030\006 \001(\t\022#\n" + + "\026node_cpu_usage_percent\030\007 \001(\002B\003\340A\003:\227\001\352A\223\001\n" + + "&bigtableadmin.googleapis.com/HotTablet\022Rprojects/{project}/instances/{instance}" + + "/clusters/{cluster}/hotTablets/{hot_tablet}*\n" + + "hotTablets2\thotTablet\"\372\001\n" + + "\013LogicalView\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\022\n" + + "\005query\030\002 \001(\tB\003\340A\002\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022 \n" + + "\023deletion_protection\030\006 \001(\010B\003\340A\001:\216\001\352A\212\001\n" + + "(bigtableadmin.googleapis.com/LogicalView\022Cprojects/{proje" + + "ct}/instances/{instance}/logicalViews/{l" + + "ogical_view}*\014logicalViews2\013logicalView\"\226\002\n" + + "\020MaterializedView\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\025\n" + + "\005query\030\002 \001(\tB\006\340A\002\340A\005\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022\033\n" + + "\023deletion_protection\030\006 \001(\010:\247\001\352A\243\001\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022Mprojects/{project}/instances/{inst" + + "ance}/materializedViews/{materialized_vi" + + "ew}*\021materializedViews2\020materializedViewB\313\002\n" + + "\034com.google.bigtable.admin.v2B\r" + + "InstanceProtoP\001Z8cloud.google.com/go/bigtable" + + "/admin/apiv2/adminpb;adminpb\252\002\036Google.Cl" + + "oud.Bigtable.Admin.V2\312\002\036Google\\Cloud\\Big" + + "table\\Admin\\V2\352\002\"Google::Cloud::Bigtable::Admin::V2\352Ax\n" + + "!cloudkms.googleapis.com/CryptoKey\022Sprojects/{project}/locations/" + + "{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.bigtable.admin.v2.CommonProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_bigtable_admin_v2_Instance_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Instance_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "State", + "Type", + "Edition", + "Labels", + "CreateTime", + "SatisfiesPzs", + "SatisfiesPzi", + "Tags", + }); + internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor = + internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor = + internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_admin_v2_AutoscalingTargets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor, + new java.lang.String[] { + "CpuUtilizationPercent", "StorageUtilizationGibPerNode", + }); + internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_admin_v2_AutoscalingLimits_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor, + new java.lang.String[] { + "MinServeNodes", "MaxServeNodes", + }); + internal_static_google_bigtable_admin_v2_Cluster_descriptor = getDescriptor().getMessageType(3); + internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Cluster_descriptor, + new java.lang.String[] { + "Name", + "Location", + "State", + "ServeNodes", + "NodeScalingFactor", + "ClusterConfig", + "DefaultStorageType", + "EncryptionConfig", + "Config", + }); + internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor = + internal_static_google_bigtable_admin_v2_Cluster_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor, + new java.lang.String[] { + "AutoscalingLimits", "AutoscalingTargets", + }); + internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor = + internal_static_google_bigtable_admin_v2_Cluster_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Cluster_ClusterConfig_descriptor, + new java.lang.String[] { + "ClusterAutoscalingConfig", + }); + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor = + internal_static_google_bigtable_admin_v2_Cluster_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + internal_static_google_bigtable_admin_v2_AppProfile_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_descriptor, + new java.lang.String[] { + "Name", + "Etag", + "Description", + "MultiClusterRoutingUseAny", + "SingleClusterRouting", + "Priority", + "StandardIsolation", + "DataBoostIsolationReadOnly", + "RoutingPolicy", + "Isolation", + }); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor, + new java.lang.String[] { + "ClusterIds", "RowAffinity", "Affinity", + }); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor + .getNestedType(0); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor, + new java.lang.String[] { + "ClusterId", "AllowTransactionalWrites", + }); + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor, + new java.lang.String[] { + "Priority", + }); + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(3); + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor, + new java.lang.String[] { + "ComputeBillingOwner", + }); + internal_static_google_bigtable_admin_v2_HotTablet_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_HotTablet_descriptor, + new java.lang.String[] { + "Name", + "TableName", + "StartTime", + "EndTime", + "StartKey", + "EndKey", + "NodeCpuUsagePercent", + }); + internal_static_google_bigtable_admin_v2_LogicalView_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_admin_v2_LogicalView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_LogicalView_descriptor, + new java.lang.String[] { + "Name", "Query", "Etag", "DeletionProtection", + }); + internal_static_google_bigtable_admin_v2_MaterializedView_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_admin_v2_MaterializedView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_MaterializedView_descriptor, + new java.lang.String[] { + "Name", "Query", "Etag", "DeletionProtection", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.bigtable.admin.v2.CommonProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java new file mode 100644 index 000000000000..277fc5fb58d9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java @@ -0,0 +1,956 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListAppProfiles.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesRequest} + */ +@com.google.protobuf.Generated +public final class ListAppProfilesRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAppProfilesRequest) + ListAppProfilesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListAppProfilesRequest"); + } + + // Use ListAppProfilesRequest.newBuilder() to construct. + private ListAppProfilesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListAppProfilesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAppProfilesRequest.class, + com.google.bigtable.admin.v2.ListAppProfilesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of app profiles
+   * is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+   * e.g., `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of app profiles
+   * is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+   * e.g., `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.admin.v2.ListAppProfilesRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListAppProfilesRequest other = + (com.google.bigtable.admin.v2.ListAppProfilesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest 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.admin.v2.ListAppProfilesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest 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.admin.v2.ListAppProfilesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListAppProfilesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListAppProfiles.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListAppProfilesRequest) + com.google.bigtable.admin.v2.ListAppProfilesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAppProfilesRequest.class, + com.google.bigtable.admin.v2.ListAppProfilesRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListAppProfilesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListAppProfilesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesRequest build() { + com.google.bigtable.admin.v2.ListAppProfilesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesRequest buildPartial() { + com.google.bigtable.admin.v2.ListAppProfilesRequest result = + new com.google.bigtable.admin.v2.ListAppProfilesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListAppProfilesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListAppProfilesRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListAppProfilesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesRequest other) { + if (other == com.google.bigtable.admin.v2.ListAppProfilesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of app profiles
+     * is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+     * e.g., `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of app profiles
+     * is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+     * e.g., `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of app profiles
+     * is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+     * e.g., `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of app profiles
+     * is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+     * e.g., `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of app profiles
+     * is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+     * e.g., `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAppProfilesRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListAppProfilesRequest) + private static final com.google.bigtable.admin.v2.ListAppProfilesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListAppProfilesRequest(); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppProfilesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListAppProfilesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java new file mode 100644 index 000000000000..ff95d7c35a93 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListAppProfilesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListAppProfilesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of app profiles
+   * is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+   * e.g., `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of app profiles
+   * is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
+   * e.g., `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java new file mode 100644 index 000000000000..f04a7e710c51 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java @@ -0,0 +1,1455 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListAppProfiles.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesResponse} + */ +@com.google.protobuf.Generated +public final class ListAppProfilesResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAppProfilesResponse) + ListAppProfilesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListAppProfilesResponse"); + } + + // Use ListAppProfilesResponse.newBuilder() to construct. + private ListAppProfilesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListAppProfilesResponse() { + appProfiles_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAppProfilesResponse.class, + com.google.bigtable.admin.v2.ListAppProfilesResponse.Builder.class); + } + + public static final int APP_PROFILES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List appProfiles_; + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + @java.lang.Override + public java.util.List getAppProfilesList() { + return appProfiles_; + } + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + @java.lang.Override + public java.util.List + getAppProfilesOrBuilderList() { + return appProfiles_; + } + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + @java.lang.Override + public int getAppProfilesCount() { + return appProfiles_.size(); + } + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index) { + return appProfiles_.get(index); + } + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(int index) { + return appProfiles_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Set if not all app profiles could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Set if not all app profiles could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILED_LOCATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + return failedLocations_; + } + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + 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 { + for (int i = 0; i < appProfiles_.size(); i++) { + output.writeMessage(1, appProfiles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < failedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, failedLocations_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < appProfiles_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, appProfiles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < failedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(failedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedLocationsList().size(); + } + size += getUnknownFields().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.admin.v2.ListAppProfilesResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListAppProfilesResponse other = + (com.google.bigtable.admin.v2.ListAppProfilesResponse) obj; + + if (!getAppProfilesList().equals(other.getAppProfilesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAppProfilesCount() > 0) { + hash = (37 * hash) + APP_PROFILES_FIELD_NUMBER; + hash = (53 * hash) + getAppProfilesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getFailedLocationsCount() > 0) { + hash = (37 * hash) + FAILED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFailedLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse 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.admin.v2.ListAppProfilesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse 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.admin.v2.ListAppProfilesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListAppProfilesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListAppProfiles.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListAppProfilesResponse) + com.google.bigtable.admin.v2.ListAppProfilesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAppProfilesResponse.class, + com.google.bigtable.admin.v2.ListAppProfilesResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListAppProfilesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (appProfilesBuilder_ == null) { + appProfiles_ = java.util.Collections.emptyList(); + } else { + appProfiles_ = null; + appProfilesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListAppProfilesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesResponse build() { + com.google.bigtable.admin.v2.ListAppProfilesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAppProfilesResponse buildPartial() { + com.google.bigtable.admin.v2.ListAppProfilesResponse result = + new com.google.bigtable.admin.v2.ListAppProfilesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListAppProfilesResponse result) { + if (appProfilesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + appProfiles_ = java.util.Collections.unmodifiableList(appProfiles_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.appProfiles_ = appProfiles_; + } else { + result.appProfiles_ = appProfilesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListAppProfilesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + failedLocations_.makeImmutable(); + result.failedLocations_ = failedLocations_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListAppProfilesResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListAppProfilesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesResponse other) { + if (other == com.google.bigtable.admin.v2.ListAppProfilesResponse.getDefaultInstance()) + return this; + if (appProfilesBuilder_ == null) { + if (!other.appProfiles_.isEmpty()) { + if (appProfiles_.isEmpty()) { + appProfiles_ = other.appProfiles_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAppProfilesIsMutable(); + appProfiles_.addAll(other.appProfiles_); + } + onChanged(); + } + } else { + if (!other.appProfiles_.isEmpty()) { + if (appProfilesBuilder_.isEmpty()) { + appProfilesBuilder_.dispose(); + appProfilesBuilder_ = null; + appProfiles_ = other.appProfiles_; + bitField0_ = (bitField0_ & ~0x00000001); + appProfilesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAppProfilesFieldBuilder() + : null; + } else { + appProfilesBuilder_.addAllMessages(other.appProfiles_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.failedLocations_.isEmpty()) { + if (failedLocations_.isEmpty()) { + failedLocations_ = other.failedLocations_; + bitField0_ |= 0x00000004; + } else { + ensureFailedLocationsIsMutable(); + failedLocations_.addAll(other.failedLocations_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.AppProfile m = + input.readMessage( + com.google.bigtable.admin.v2.AppProfile.parser(), extensionRegistry); + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + appProfiles_.add(m); + } else { + appProfilesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFailedLocationsIsMutable(); + failedLocations_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List appProfiles_ = + java.util.Collections.emptyList(); + + private void ensureAppProfilesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + appProfiles_ = + new java.util.ArrayList(appProfiles_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + appProfilesBuilder_; + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public java.util.List getAppProfilesList() { + if (appProfilesBuilder_ == null) { + return java.util.Collections.unmodifiableList(appProfiles_); + } else { + return appProfilesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public int getAppProfilesCount() { + if (appProfilesBuilder_ == null) { + return appProfiles_.size(); + } else { + return appProfilesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index) { + if (appProfilesBuilder_ == null) { + return appProfiles_.get(index); + } else { + return appProfilesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder setAppProfiles(int index, com.google.bigtable.admin.v2.AppProfile value) { + if (appProfilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppProfilesIsMutable(); + appProfiles_.set(index, value); + onChanged(); + } else { + appProfilesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder setAppProfiles( + int index, com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + appProfiles_.set(index, builderForValue.build()); + onChanged(); + } else { + appProfilesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder addAppProfiles(com.google.bigtable.admin.v2.AppProfile value) { + if (appProfilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppProfilesIsMutable(); + appProfiles_.add(value); + onChanged(); + } else { + appProfilesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder addAppProfiles(int index, com.google.bigtable.admin.v2.AppProfile value) { + if (appProfilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppProfilesIsMutable(); + appProfiles_.add(index, value); + onChanged(); + } else { + appProfilesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder addAppProfiles(com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + appProfiles_.add(builderForValue.build()); + onChanged(); + } else { + appProfilesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder addAppProfiles( + int index, com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + appProfiles_.add(index, builderForValue.build()); + onChanged(); + } else { + appProfilesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder addAllAppProfiles( + java.lang.Iterable values) { + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appProfiles_); + onChanged(); + } else { + appProfilesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder clearAppProfiles() { + if (appProfilesBuilder_ == null) { + appProfiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + appProfilesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public Builder removeAppProfiles(int index) { + if (appProfilesBuilder_ == null) { + ensureAppProfilesIsMutable(); + appProfiles_.remove(index); + onChanged(); + } else { + appProfilesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfilesBuilder(int index) { + return internalGetAppProfilesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(int index) { + if (appProfilesBuilder_ == null) { + return appProfiles_.get(index); + } else { + return appProfilesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public java.util.List + getAppProfilesOrBuilderList() { + if (appProfilesBuilder_ != null) { + return appProfilesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(appProfiles_); + } + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder() { + return internalGetAppProfilesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder(int index) { + return internalGetAppProfilesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested app profiles.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + public java.util.List + getAppProfilesBuilderList() { + return internalGetAppProfilesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + internalGetAppProfilesFieldBuilder() { + if (appProfilesBuilder_ == null) { + appProfilesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder>( + appProfiles_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + appProfiles_ = null; + } + return appProfilesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Set if not all app profiles could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Set if not all app profiles could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Set if not all app profiles could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all app profiles could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all app profiles could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureFailedLocationsIsMutable() { + if (!failedLocations_.isModifiable()) { + failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + failedLocations_.makeImmutable(); + return failedLocations_; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index to set the value at. + * @param value The failedLocations to set. + * @return This builder for chaining. + */ + public Builder setFailedLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param value The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param values The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllFailedLocations(java.lang.Iterable values) { + ensureFailedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @return This builder for chaining. + */ + public Builder clearFailedLocations() { + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + * + * @param value The bytes of the failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAppProfilesResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListAppProfilesResponse) + private static final com.google.bigtable.admin.v2.ListAppProfilesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListAppProfilesResponse(); + } + + public static com.google.bigtable.admin.v2.ListAppProfilesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppProfilesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListAppProfilesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java new file mode 100644 index 000000000000..023200c18767 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListAppProfilesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListAppProfilesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + java.util.List getAppProfilesList(); + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index); + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + int getAppProfilesCount(); + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + java.util.List + getAppProfilesOrBuilderList(); + + /** + * + * + *
+   * The list of requested app profiles.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1; + */ + com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(int index); + + /** + * + * + *
+   * Set if not all app profiles could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Set if not all app profiles could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @return A list containing the failedLocations. + */ + java.util.List getFailedLocationsList(); + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @return The count of failedLocations. + */ + int getFailedLocationsCount(); + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + java.lang.String getFailedLocations(int index); + + /** + * + * + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + com.google.protobuf.ByteString getFailedLocationsBytes(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java new file mode 100644 index 000000000000..adad9eb8779a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java @@ -0,0 +1,1129 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAuthorizedViewsRequest} + */ +@com.google.protobuf.Generated +public final class ListAuthorizedViewsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + ListAuthorizedViewsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListAuthorizedViewsRequest"); + } + + // Use ListAuthorizedViewsRequest.newBuilder() to construct. + private ListAuthorizedViewsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListAuthorizedViewsRequest() { + parent_ = ""; + pageToken_ = ""; + view_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.class, + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table for which AuthorizedViews should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the table for which AuthorizedViews should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_ = 0; + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedViews'
+   * fields. Default to NAME_ONLY.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedViews'
+   * fields. Default to NAME_ONLY.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView() { + com.google.bigtable.admin.v2.AuthorizedView.ResponseView result = + com.google.bigtable.admin.v2.AuthorizedView.ResponseView.forNumber(view_); + return result == null + ? com.google.bigtable.admin.v2.AuthorizedView.ResponseView.UNRECOGNIZED + : result; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (view_ + != com.google.bigtable.admin.v2.AuthorizedView.ResponseView.RESPONSE_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, view_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (view_ + != com.google.bigtable.admin.v2.AuthorizedView.ResponseView.RESPONSE_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, view_); + } + size += getUnknownFields().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.admin.v2.ListAuthorizedViewsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest other = + (com.google.bigtable.admin.v2.ListAuthorizedViewsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (view_ != other.view_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest 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.admin.v2.ListAuthorizedViewsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest 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.admin.v2.ListAuthorizedViewsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListAuthorizedViewsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAuthorizedViewsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + com.google.bigtable.admin.v2.ListAuthorizedViewsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.class, + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsRequest build() { + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsRequest buildPartial() { + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest result = + new com.google.bigtable.admin.v2.ListAuthorizedViewsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListAuthorizedViewsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.view_ = view_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListAuthorizedViewsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListAuthorizedViewsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListAuthorizedViewsRequest other) { + if (other == com.google.bigtable.admin.v2.ListAuthorizedViewsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table for which AuthorizedViews should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table for which AuthorizedViews should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table for which AuthorizedViews should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table for which AuthorizedViews should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table for which AuthorizedViews should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedViews'
+     * fields. Default to NAME_ONLY.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedViews'
+     * fields. Default to NAME_ONLY.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedViews'
+     * fields. Default to NAME_ONLY.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView() { + com.google.bigtable.admin.v2.AuthorizedView.ResponseView result = + com.google.bigtable.admin.v2.AuthorizedView.ResponseView.forNumber(view_); + return result == null + ? com.google.bigtable.admin.v2.AuthorizedView.ResponseView.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedViews'
+     * fields. Default to NAME_ONLY.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.bigtable.admin.v2.AuthorizedView.ResponseView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource_view to be applied to the returned AuthorizedViews'
+     * fields. Default to NAME_ONLY.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000008); + view_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + private static final com.google.bigtable.admin.v2.ListAuthorizedViewsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListAuthorizedViewsRequest(); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAuthorizedViewsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListAuthorizedViewsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java new file mode 100644 index 000000000000..fca8de12bdf4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListAuthorizedViewsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table for which AuthorizedViews should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the table for which AuthorizedViews should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedViews'
+   * fields. Default to NAME_ONLY.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * Optional. The resource_view to be applied to the returned AuthorizedViews'
+   * fields. Default to NAME_ONLY.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView.ResponseView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.bigtable.admin.v2.AuthorizedView.ResponseView getView(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java new file mode 100644 index 000000000000..8d2efc53b0df --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAuthorizedViewsResponse} + */ +@com.google.protobuf.Generated +public final class ListAuthorizedViewsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + ListAuthorizedViewsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListAuthorizedViewsResponse"); + } + + // Use ListAuthorizedViewsResponse.newBuilder() to construct. + private ListAuthorizedViewsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListAuthorizedViewsResponse() { + authorizedViews_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.class, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.Builder.class); + } + + public static final int AUTHORIZED_VIEWS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List authorizedViews_; + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + @java.lang.Override + public java.util.List getAuthorizedViewsList() { + return authorizedViews_; + } + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + @java.lang.Override + public java.util.List + getAuthorizedViewsOrBuilderList() { + return authorizedViews_; + } + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + @java.lang.Override + public int getAuthorizedViewsCount() { + return authorizedViews_.size(); + } + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedViews(int index) { + return authorizedViews_.get(index); + } + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewsOrBuilder( + int index) { + return authorizedViews_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < authorizedViews_.size(); i++) { + output.writeMessage(1, authorizedViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < authorizedViews_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, authorizedViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListAuthorizedViewsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse other = + (com.google.bigtable.admin.v2.ListAuthorizedViewsResponse) obj; + + if (!getAuthorizedViewsList().equals(other.getAuthorizedViewsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAuthorizedViewsCount() > 0) { + hash = (37 * hash) + AUTHORIZED_VIEWS_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse 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.admin.v2.ListAuthorizedViewsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse 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.admin.v2.ListAuthorizedViewsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListAuthorizedViewsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListAuthorizedViewsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + com.google.bigtable.admin.v2.ListAuthorizedViewsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.class, + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (authorizedViewsBuilder_ == null) { + authorizedViews_ = java.util.Collections.emptyList(); + } else { + authorizedViews_ = null; + authorizedViewsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListAuthorizedViewsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsResponse build() { + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListAuthorizedViewsResponse buildPartial() { + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse result = + new com.google.bigtable.admin.v2.ListAuthorizedViewsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListAuthorizedViewsResponse result) { + if (authorizedViewsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + authorizedViews_ = java.util.Collections.unmodifiableList(authorizedViews_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.authorizedViews_ = authorizedViews_; + } else { + result.authorizedViews_ = authorizedViewsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListAuthorizedViewsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListAuthorizedViewsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListAuthorizedViewsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListAuthorizedViewsResponse other) { + if (other == com.google.bigtable.admin.v2.ListAuthorizedViewsResponse.getDefaultInstance()) + return this; + if (authorizedViewsBuilder_ == null) { + if (!other.authorizedViews_.isEmpty()) { + if (authorizedViews_.isEmpty()) { + authorizedViews_ = other.authorizedViews_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.addAll(other.authorizedViews_); + } + onChanged(); + } + } else { + if (!other.authorizedViews_.isEmpty()) { + if (authorizedViewsBuilder_.isEmpty()) { + authorizedViewsBuilder_.dispose(); + authorizedViewsBuilder_ = null; + authorizedViews_ = other.authorizedViews_; + bitField0_ = (bitField0_ & ~0x00000001); + authorizedViewsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuthorizedViewsFieldBuilder() + : null; + } else { + authorizedViewsBuilder_.addAllMessages(other.authorizedViews_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.AuthorizedView m = + input.readMessage( + com.google.bigtable.admin.v2.AuthorizedView.parser(), extensionRegistry); + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.add(m); + } else { + authorizedViewsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List authorizedViews_ = + java.util.Collections.emptyList(); + + private void ensureAuthorizedViewsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + authorizedViews_ = + new java.util.ArrayList(authorizedViews_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + authorizedViewsBuilder_; + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public java.util.List getAuthorizedViewsList() { + if (authorizedViewsBuilder_ == null) { + return java.util.Collections.unmodifiableList(authorizedViews_); + } else { + return authorizedViewsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public int getAuthorizedViewsCount() { + if (authorizedViewsBuilder_ == null) { + return authorizedViews_.size(); + } else { + return authorizedViewsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedViews(int index) { + if (authorizedViewsBuilder_ == null) { + return authorizedViews_.get(index); + } else { + return authorizedViewsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder setAuthorizedViews( + int index, com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedViewsIsMutable(); + authorizedViews_.set(index, value); + onChanged(); + } else { + authorizedViewsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder setAuthorizedViews( + int index, com.google.bigtable.admin.v2.AuthorizedView.Builder builderForValue) { + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.set(index, builderForValue.build()); + onChanged(); + } else { + authorizedViewsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder addAuthorizedViews(com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedViewsIsMutable(); + authorizedViews_.add(value); + onChanged(); + } else { + authorizedViewsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder addAuthorizedViews( + int index, com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizedViewsIsMutable(); + authorizedViews_.add(index, value); + onChanged(); + } else { + authorizedViewsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder addAuthorizedViews( + com.google.bigtable.admin.v2.AuthorizedView.Builder builderForValue) { + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.add(builderForValue.build()); + onChanged(); + } else { + authorizedViewsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder addAuthorizedViews( + int index, com.google.bigtable.admin.v2.AuthorizedView.Builder builderForValue) { + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.add(index, builderForValue.build()); + onChanged(); + } else { + authorizedViewsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder addAllAuthorizedViews( + java.lang.Iterable values) { + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizedViews_); + onChanged(); + } else { + authorizedViewsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder clearAuthorizedViews() { + if (authorizedViewsBuilder_ == null) { + authorizedViews_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + authorizedViewsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public Builder removeAuthorizedViews(int index) { + if (authorizedViewsBuilder_ == null) { + ensureAuthorizedViewsIsMutable(); + authorizedViews_.remove(index); + onChanged(); + } else { + authorizedViewsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public com.google.bigtable.admin.v2.AuthorizedView.Builder getAuthorizedViewsBuilder( + int index) { + return internalGetAuthorizedViewsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewsOrBuilder( + int index) { + if (authorizedViewsBuilder_ == null) { + return authorizedViews_.get(index); + } else { + return authorizedViewsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public java.util.List + getAuthorizedViewsOrBuilderList() { + if (authorizedViewsBuilder_ != null) { + return authorizedViewsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(authorizedViews_); + } + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public com.google.bigtable.admin.v2.AuthorizedView.Builder addAuthorizedViewsBuilder() { + return internalGetAuthorizedViewsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance()); + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public com.google.bigtable.admin.v2.AuthorizedView.Builder addAuthorizedViewsBuilder( + int index) { + return internalGetAuthorizedViewsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance()); + } + + /** + * + * + *
+     * The AuthorizedViews present in the requested table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + public java.util.List + getAuthorizedViewsBuilderList() { + return internalGetAuthorizedViewsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + internalGetAuthorizedViewsFieldBuilder() { + if (authorizedViewsBuilder_ == null) { + authorizedViewsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder>( + authorizedViews_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + authorizedViews_ = null; + } + return authorizedViewsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + private static final com.google.bigtable.admin.v2.ListAuthorizedViewsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListAuthorizedViewsResponse(); + } + + public static com.google.bigtable.admin.v2.ListAuthorizedViewsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAuthorizedViewsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListAuthorizedViewsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.java new file mode 100644 index 000000000000..d97163303d37 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListAuthorizedViewsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + java.util.List getAuthorizedViewsList(); + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + com.google.bigtable.admin.v2.AuthorizedView getAuthorizedViews(int index); + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + int getAuthorizedViewsCount(); + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + java.util.List + getAuthorizedViewsOrBuilderList(); + + /** + * + * + *
+   * The AuthorizedViews present in the requested table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.AuthorizedView authorized_views = 1; + */ + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewsOrBuilder(int index); + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java new file mode 100644 index 000000000000..28adc5789ee8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java @@ -0,0 +1,1700 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListBackupsRequest} + */ +@com.google.protobuf.Generated +public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListBackupsRequest) + ListBackupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsRequest"); + } + + // Use ListBackupsRequest.newBuilder() to construct. + private ListBackupsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsRequest() { + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListBackupsRequest.class, + com.google.bigtable.admin.v2.ListBackupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The cluster to list backups from.  Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The cluster to list backups from.  Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * A filter expression that filters backups listed in the response.
+   * The expression must specify the field name, a comparison operator,
+   * and the value that you want to use for filtering. The value must be a
+   * string, a number, or a boolean. The comparison operator must be
+   * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+   * roughly synonymous with equality. Filter rules are case insensitive.
+   *
+   * The fields eligible for filtering are:
+   *
+   * * `name`
+   * * `source_table`
+   * * `state`
+   * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `size_bytes`
+   *
+   * To filter on multiple expressions, provide each separate expression within
+   * parentheses. By default, each expression is an AND expression. However,
+   * you can include AND, OR, and NOT expressions explicitly.
+   *
+   * Some examples of using filters are:
+   *
+   * * `name:"exact"` --> The backup's name is the string "exact".
+   * * `name:howl` --> The backup's name contains the string "howl".
+   * * `source_table:prod`
+   * --> The source_table's name contains the string "prod".
+   * * `state:CREATING` --> The backup is pending creation.
+   * * `state:READY` --> The backup is fully created and ready for use.
+   * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+   * --> The backup name contains the string "howl" and start_time
+   * of the backup is before 2018-03-28T14:50:00Z.
+   * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * A filter expression that filters backups listed in the response.
+   * The expression must specify the field name, a comparison operator,
+   * and the value that you want to use for filtering. The value must be a
+   * string, a number, or a boolean. The comparison operator must be
+   * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+   * roughly synonymous with equality. Filter rules are case insensitive.
+   *
+   * The fields eligible for filtering are:
+   *
+   * * `name`
+   * * `source_table`
+   * * `state`
+   * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `size_bytes`
+   *
+   * To filter on multiple expressions, provide each separate expression within
+   * parentheses. By default, each expression is an AND expression. However,
+   * you can include AND, OR, and NOT expressions explicitly.
+   *
+   * Some examples of using filters are:
+   *
+   * * `name:"exact"` --> The backup's name is the string "exact".
+   * * `name:howl` --> The backup's name contains the string "howl".
+   * * `source_table:prod`
+   * --> The source_table's name contains the string "prod".
+   * * `state:CREATING` --> The backup is pending creation.
+   * * `state:READY` --> The backup is fully created and ready for use.
+   * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+   * --> The backup name contains the string "howl" and start_time
+   * of the backup is before 2018-03-28T14:50:00Z.
+   * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * An expression for specifying the sort order of the results of the request.
+   * The string value should specify one or more fields in
+   * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+   * https://aip.dev/132#ordering.
+   *
+   * Fields supported are:
+   *
+   * * name
+   * * source_table
+   * * expire_time
+   * * start_time
+   * * end_time
+   * * size_bytes
+   * * state
+   *
+   * For example, "start_time". The default sorting order is ascending.
+   * To specify descending order for the field, a suffix " desc" should
+   * be appended to the field name. For example, "start_time desc".
+   * Redundant space characters in the syntax are insigificant.
+   *
+   * If order_by is empty, results will be sorted by `start_time` in descending
+   * order starting from the most recently created backup.
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * An expression for specifying the sort order of the results of the request.
+   * The string value should specify one or more fields in
+   * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+   * https://aip.dev/132#ordering.
+   *
+   * Fields supported are:
+   *
+   * * name
+   * * source_table
+   * * expire_time
+   * * start_time
+   * * end_time
+   * * size_bytes
+   * * state
+   *
+   * For example, "start_time". The default sorting order is ascending.
+   * To specify descending order for the field, a suffix " desc" should
+   * be appended to the field name. For example, "start_time desc".
+   * Redundant space characters in the syntax are insigificant.
+   *
+   * If order_by is empty, results will be sorted by `start_time` in descending
+   * order starting from the most recently created backup.
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + + /** + * + * + *
+   * Number of backups to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+   * from a previous
+   * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+   * from a previous
+   * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, orderBy_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, orderBy_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListBackupsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListBackupsRequest other = + (com.google.bigtable.admin.v2.ListBackupsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest 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.admin.v2.ListBackupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest 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.admin.v2.ListBackupsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListBackupsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListBackupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListBackupsRequest) + com.google.bigtable.admin.v2.ListBackupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListBackupsRequest.class, + com.google.bigtable.admin.v2.ListBackupsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListBackupsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListBackupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsRequest build() { + com.google.bigtable.admin.v2.ListBackupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsRequest buildPartial() { + com.google.bigtable.admin.v2.ListBackupsRequest result = + new com.google.bigtable.admin.v2.ListBackupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.orderBy_ = orderBy_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListBackupsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListBackupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsRequest other) { + if (other == com.google.bigtable.admin.v2.ListBackupsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The cluster to list backups from.  Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The cluster to list backups from.  Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The cluster to list backups from.  Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster to list backups from.  Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster to list backups from.  Values are of the
+     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * A filter expression that filters backups listed in the response.
+     * The expression must specify the field name, a comparison operator,
+     * and the value that you want to use for filtering. The value must be a
+     * string, a number, or a boolean. The comparison operator must be
+     * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+     * roughly synonymous with equality. Filter rules are case insensitive.
+     *
+     * The fields eligible for filtering are:
+     *
+     * * `name`
+     * * `source_table`
+     * * `state`
+     * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `size_bytes`
+     *
+     * To filter on multiple expressions, provide each separate expression within
+     * parentheses. By default, each expression is an AND expression. However,
+     * you can include AND, OR, and NOT expressions explicitly.
+     *
+     * Some examples of using filters are:
+     *
+     * * `name:"exact"` --> The backup's name is the string "exact".
+     * * `name:howl` --> The backup's name contains the string "howl".
+     * * `source_table:prod`
+     * --> The source_table's name contains the string "prod".
+     * * `state:CREATING` --> The backup is pending creation.
+     * * `state:READY` --> The backup is fully created and ready for use.
+     * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+     * --> The backup name contains the string "howl" and start_time
+     * of the backup is before 2018-03-28T14:50:00Z.
+     * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A filter expression that filters backups listed in the response.
+     * The expression must specify the field name, a comparison operator,
+     * and the value that you want to use for filtering. The value must be a
+     * string, a number, or a boolean. The comparison operator must be
+     * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+     * roughly synonymous with equality. Filter rules are case insensitive.
+     *
+     * The fields eligible for filtering are:
+     *
+     * * `name`
+     * * `source_table`
+     * * `state`
+     * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `size_bytes`
+     *
+     * To filter on multiple expressions, provide each separate expression within
+     * parentheses. By default, each expression is an AND expression. However,
+     * you can include AND, OR, and NOT expressions explicitly.
+     *
+     * Some examples of using filters are:
+     *
+     * * `name:"exact"` --> The backup's name is the string "exact".
+     * * `name:howl` --> The backup's name contains the string "howl".
+     * * `source_table:prod`
+     * --> The source_table's name contains the string "prod".
+     * * `state:CREATING` --> The backup is pending creation.
+     * * `state:READY` --> The backup is fully created and ready for use.
+     * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+     * --> The backup name contains the string "howl" and start_time
+     * of the backup is before 2018-03-28T14:50:00Z.
+     * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A filter expression that filters backups listed in the response.
+     * The expression must specify the field name, a comparison operator,
+     * and the value that you want to use for filtering. The value must be a
+     * string, a number, or a boolean. The comparison operator must be
+     * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+     * roughly synonymous with equality. Filter rules are case insensitive.
+     *
+     * The fields eligible for filtering are:
+     *
+     * * `name`
+     * * `source_table`
+     * * `state`
+     * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `size_bytes`
+     *
+     * To filter on multiple expressions, provide each separate expression within
+     * parentheses. By default, each expression is an AND expression. However,
+     * you can include AND, OR, and NOT expressions explicitly.
+     *
+     * Some examples of using filters are:
+     *
+     * * `name:"exact"` --> The backup's name is the string "exact".
+     * * `name:howl` --> The backup's name contains the string "howl".
+     * * `source_table:prod`
+     * --> The source_table's name contains the string "prod".
+     * * `state:CREATING` --> The backup is pending creation.
+     * * `state:READY` --> The backup is fully created and ready for use.
+     * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+     * --> The backup name contains the string "howl" and start_time
+     * of the backup is before 2018-03-28T14:50:00Z.
+     * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters backups listed in the response.
+     * The expression must specify the field name, a comparison operator,
+     * and the value that you want to use for filtering. The value must be a
+     * string, a number, or a boolean. The comparison operator must be
+     * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+     * roughly synonymous with equality. Filter rules are case insensitive.
+     *
+     * The fields eligible for filtering are:
+     *
+     * * `name`
+     * * `source_table`
+     * * `state`
+     * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `size_bytes`
+     *
+     * To filter on multiple expressions, provide each separate expression within
+     * parentheses. By default, each expression is an AND expression. However,
+     * you can include AND, OR, and NOT expressions explicitly.
+     *
+     * Some examples of using filters are:
+     *
+     * * `name:"exact"` --> The backup's name is the string "exact".
+     * * `name:howl` --> The backup's name contains the string "howl".
+     * * `source_table:prod`
+     * --> The source_table's name contains the string "prod".
+     * * `state:CREATING` --> The backup is pending creation.
+     * * `state:READY` --> The backup is fully created and ready for use.
+     * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+     * --> The backup name contains the string "howl" and start_time
+     * of the backup is before 2018-03-28T14:50:00Z.
+     * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A filter expression that filters backups listed in the response.
+     * The expression must specify the field name, a comparison operator,
+     * and the value that you want to use for filtering. The value must be a
+     * string, a number, or a boolean. The comparison operator must be
+     * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+     * roughly synonymous with equality. Filter rules are case insensitive.
+     *
+     * The fields eligible for filtering are:
+     *
+     * * `name`
+     * * `source_table`
+     * * `state`
+     * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+     * * `size_bytes`
+     *
+     * To filter on multiple expressions, provide each separate expression within
+     * parentheses. By default, each expression is an AND expression. However,
+     * you can include AND, OR, and NOT expressions explicitly.
+     *
+     * Some examples of using filters are:
+     *
+     * * `name:"exact"` --> The backup's name is the string "exact".
+     * * `name:howl` --> The backup's name contains the string "howl".
+     * * `source_table:prod`
+     * --> The source_table's name contains the string "prod".
+     * * `state:CREATING` --> The backup is pending creation.
+     * * `state:READY` --> The backup is fully created and ready for use.
+     * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+     * --> The backup name contains the string "howl" and start_time
+     * of the backup is before 2018-03-28T14:50:00Z.
+     * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * An expression for specifying the sort order of the results of the request.
+     * The string value should specify one or more fields in
+     * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+     * https://aip.dev/132#ordering.
+     *
+     * Fields supported are:
+     *
+     * * name
+     * * source_table
+     * * expire_time
+     * * start_time
+     * * end_time
+     * * size_bytes
+     * * state
+     *
+     * For example, "start_time". The default sorting order is ascending.
+     * To specify descending order for the field, a suffix " desc" should
+     * be appended to the field name. For example, "start_time desc".
+     * Redundant space characters in the syntax are insigificant.
+     *
+     * If order_by is empty, results will be sorted by `start_time` in descending
+     * order starting from the most recently created backup.
+     * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * An expression for specifying the sort order of the results of the request.
+     * The string value should specify one or more fields in
+     * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+     * https://aip.dev/132#ordering.
+     *
+     * Fields supported are:
+     *
+     * * name
+     * * source_table
+     * * expire_time
+     * * start_time
+     * * end_time
+     * * size_bytes
+     * * state
+     *
+     * For example, "start_time". The default sorting order is ascending.
+     * To specify descending order for the field, a suffix " desc" should
+     * be appended to the field name. For example, "start_time desc".
+     * Redundant space characters in the syntax are insigificant.
+     *
+     * If order_by is empty, results will be sorted by `start_time` in descending
+     * order starting from the most recently created backup.
+     * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * An expression for specifying the sort order of the results of the request.
+     * The string value should specify one or more fields in
+     * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+     * https://aip.dev/132#ordering.
+     *
+     * Fields supported are:
+     *
+     * * name
+     * * source_table
+     * * expire_time
+     * * start_time
+     * * end_time
+     * * size_bytes
+     * * state
+     *
+     * For example, "start_time". The default sorting order is ascending.
+     * To specify descending order for the field, a suffix " desc" should
+     * be appended to the field name. For example, "start_time desc".
+     * Redundant space characters in the syntax are insigificant.
+     *
+     * If order_by is empty, results will be sorted by `start_time` in descending
+     * order starting from the most recently created backup.
+     * 
+ * + * string order_by = 3; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * An expression for specifying the sort order of the results of the request.
+     * The string value should specify one or more fields in
+     * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+     * https://aip.dev/132#ordering.
+     *
+     * Fields supported are:
+     *
+     * * name
+     * * source_table
+     * * expire_time
+     * * start_time
+     * * end_time
+     * * size_bytes
+     * * state
+     *
+     * For example, "start_time". The default sorting order is ascending.
+     * To specify descending order for the field, a suffix " desc" should
+     * be appended to the field name. For example, "start_time desc".
+     * Redundant space characters in the syntax are insigificant.
+     *
+     * If order_by is empty, results will be sorted by `start_time` in descending
+     * order starting from the most recently created backup.
+     * 
+ * + * string order_by = 3; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * An expression for specifying the sort order of the results of the request.
+     * The string value should specify one or more fields in
+     * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+     * https://aip.dev/132#ordering.
+     *
+     * Fields supported are:
+     *
+     * * name
+     * * source_table
+     * * expire_time
+     * * start_time
+     * * end_time
+     * * size_bytes
+     * * state
+     *
+     * For example, "start_time". The default sorting order is ascending.
+     * To specify descending order for the field, a suffix " desc" should
+     * be appended to the field name. For example, "start_time desc".
+     * Redundant space characters in the syntax are insigificant.
+     *
+     * If order_by is empty, results will be sorted by `start_time` in descending
+     * order starting from the most recently created backup.
+     * 
+ * + * string order_by = 3; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of backups to be returned in the response. If 0 or
+     * less, defaults to the server's maximum allowed page size.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000008); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+     * from a previous
+     * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+     * from a previous
+     * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+     * from a previous
+     * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 5; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+     * from a previous
+     * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * If non-empty, `page_token` should contain a
+     * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+     * from a previous
+     * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+     * same `parent` and with the same `filter`.
+     * 
+ * + * string page_token = 5; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListBackupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListBackupsRequest) + private static final com.google.bigtable.admin.v2.ListBackupsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListBackupsRequest(); + } + + public static com.google.bigtable.admin.v2.ListBackupsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListBackupsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java new file mode 100644 index 000000000000..06162ac8e138 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java @@ -0,0 +1,270 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListBackupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListBackupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The cluster to list backups from.  Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The cluster to list backups from.  Values are of the
+   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list backups for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A filter expression that filters backups listed in the response.
+   * The expression must specify the field name, a comparison operator,
+   * and the value that you want to use for filtering. The value must be a
+   * string, a number, or a boolean. The comparison operator must be
+   * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+   * roughly synonymous with equality. Filter rules are case insensitive.
+   *
+   * The fields eligible for filtering are:
+   *
+   * * `name`
+   * * `source_table`
+   * * `state`
+   * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `size_bytes`
+   *
+   * To filter on multiple expressions, provide each separate expression within
+   * parentheses. By default, each expression is an AND expression. However,
+   * you can include AND, OR, and NOT expressions explicitly.
+   *
+   * Some examples of using filters are:
+   *
+   * * `name:"exact"` --> The backup's name is the string "exact".
+   * * `name:howl` --> The backup's name contains the string "howl".
+   * * `source_table:prod`
+   * --> The source_table's name contains the string "prod".
+   * * `state:CREATING` --> The backup is pending creation.
+   * * `state:READY` --> The backup is fully created and ready for use.
+   * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+   * --> The backup name contains the string "howl" and start_time
+   * of the backup is before 2018-03-28T14:50:00Z.
+   * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * A filter expression that filters backups listed in the response.
+   * The expression must specify the field name, a comparison operator,
+   * and the value that you want to use for filtering. The value must be a
+   * string, a number, or a boolean. The comparison operator must be
+   * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
+   * roughly synonymous with equality. Filter rules are case insensitive.
+   *
+   * The fields eligible for filtering are:
+   *
+   * * `name`
+   * * `source_table`
+   * * `state`
+   * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
+   * * `size_bytes`
+   *
+   * To filter on multiple expressions, provide each separate expression within
+   * parentheses. By default, each expression is an AND expression. However,
+   * you can include AND, OR, and NOT expressions explicitly.
+   *
+   * Some examples of using filters are:
+   *
+   * * `name:"exact"` --> The backup's name is the string "exact".
+   * * `name:howl` --> The backup's name contains the string "howl".
+   * * `source_table:prod`
+   * --> The source_table's name contains the string "prod".
+   * * `state:CREATING` --> The backup is pending creation.
+   * * `state:READY` --> The backup is fully created and ready for use.
+   * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
+   * --> The backup name contains the string "howl" and start_time
+   * of the backup is before 2018-03-28T14:50:00Z.
+   * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * An expression for specifying the sort order of the results of the request.
+   * The string value should specify one or more fields in
+   * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+   * https://aip.dev/132#ordering.
+   *
+   * Fields supported are:
+   *
+   * * name
+   * * source_table
+   * * expire_time
+   * * start_time
+   * * end_time
+   * * size_bytes
+   * * state
+   *
+   * For example, "start_time". The default sorting order is ascending.
+   * To specify descending order for the field, a suffix " desc" should
+   * be appended to the field name. For example, "start_time desc".
+   * Redundant space characters in the syntax are insigificant.
+   *
+   * If order_by is empty, results will be sorted by `start_time` in descending
+   * order starting from the most recently created backup.
+   * 
+ * + * string order_by = 3; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * An expression for specifying the sort order of the results of the request.
+   * The string value should specify one or more fields in
+   * [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at
+   * https://aip.dev/132#ordering.
+   *
+   * Fields supported are:
+   *
+   * * name
+   * * source_table
+   * * expire_time
+   * * start_time
+   * * end_time
+   * * size_bytes
+   * * state
+   *
+   * For example, "start_time". The default sorting order is ascending.
+   * To specify descending order for the field, a suffix " desc" should
+   * be appended to the field name. For example, "start_time desc".
+   * Redundant space characters in the syntax are insigificant.
+   *
+   * If order_by is empty, results will be sorted by `start_time` in descending
+   * order starting from the most recently created backup.
+   * 
+ * + * string order_by = 3; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Number of backups to be returned in the response. If 0 or
+   * less, defaults to the server's maximum allowed page size.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+   * from a previous
+   * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * If non-empty, `page_token` should contain a
+   * [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token]
+   * from a previous
+   * [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the
+   * same `parent` and with the same `filter`.
+   * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java new file mode 100644 index 000000000000..b1687c7f3c94 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The response for
+ * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListBackupsResponse} + */ +@com.google.protobuf.Generated +public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListBackupsResponse) + ListBackupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBackupsResponse"); + } + + // Use ListBackupsResponse.newBuilder() to construct. + private ListBackupsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBackupsResponse() { + backups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListBackupsResponse.class, + com.google.bigtable.admin.v2.ListBackupsResponse.Builder.class); + } + + public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List backups_; + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + @java.lang.Override + public java.util.List getBackupsList() { + return backups_; + } + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + @java.lang.Override + public java.util.List + getBackupsOrBuilderList() { + return backups_; + } + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + @java.lang.Override + public int getBackupsCount() { + return backups_.size(); + } + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup getBackups(int index) { + return backups_.get(index); + } + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int index) { + return backups_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+   * to fetch more of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+   * to fetch more of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < backups_.size(); i++) { + output.writeMessage(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < backups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListBackupsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListBackupsResponse other = + (com.google.bigtable.admin.v2.ListBackupsResponse) obj; + + if (!getBackupsList().equals(other.getBackupsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBackupsCount() > 0) { + hash = (37 * hash) + BACKUPS_FIELD_NUMBER; + hash = (53 * hash) + getBackupsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse 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.admin.v2.ListBackupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse 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.admin.v2.ListBackupsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListBackupsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response for
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListBackupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListBackupsResponse) + com.google.bigtable.admin.v2.ListBackupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListBackupsResponse.class, + com.google.bigtable.admin.v2.ListBackupsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListBackupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + } else { + backups_ = null; + backupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListBackupsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListBackupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsResponse build() { + com.google.bigtable.admin.v2.ListBackupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListBackupsResponse buildPartial() { + com.google.bigtable.admin.v2.ListBackupsResponse result = + new com.google.bigtable.admin.v2.ListBackupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListBackupsResponse result) { + if (backupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + backups_ = java.util.Collections.unmodifiableList(backups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.backups_ = backups_; + } else { + result.backups_ = backupsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListBackupsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListBackupsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListBackupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsResponse other) { + if (other == com.google.bigtable.admin.v2.ListBackupsResponse.getDefaultInstance()) + return this; + if (backupsBuilder_ == null) { + if (!other.backups_.isEmpty()) { + if (backups_.isEmpty()) { + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBackupsIsMutable(); + backups_.addAll(other.backups_); + } + onChanged(); + } + } else { + if (!other.backups_.isEmpty()) { + if (backupsBuilder_.isEmpty()) { + backupsBuilder_.dispose(); + backupsBuilder_ = null; + backups_ = other.backups_; + bitField0_ = (bitField0_ & ~0x00000001); + backupsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBackupsFieldBuilder() + : null; + } else { + backupsBuilder_.addAllMessages(other.backups_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Backup m = + input.readMessage( + com.google.bigtable.admin.v2.Backup.parser(), extensionRegistry); + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(m); + } else { + backupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List backups_ = + java.util.Collections.emptyList(); + + private void ensureBackupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + backups_ = new java.util.ArrayList(backups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + backupsBuilder_; + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public java.util.List getBackupsList() { + if (backupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(backups_); + } else { + return backupsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public int getBackupsCount() { + if (backupsBuilder_ == null) { + return backups_.size(); + } else { + return backupsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public com.google.bigtable.admin.v2.Backup getBackups(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder setBackups(int index, com.google.bigtable.admin.v2.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.set(index, value); + onChanged(); + } else { + backupsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder setBackups( + int index, com.google.bigtable.admin.v2.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.set(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder addBackups(com.google.bigtable.admin.v2.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(value); + onChanged(); + } else { + backupsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder addBackups(int index, com.google.bigtable.admin.v2.Backup value) { + if (backupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBackupsIsMutable(); + backups_.add(index, value); + onChanged(); + } else { + backupsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder addBackups(com.google.bigtable.admin.v2.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder addBackups( + int index, com.google.bigtable.admin.v2.Backup.Builder builderForValue) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.add(index, builderForValue.build()); + onChanged(); + } else { + backupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder addAllBackups( + java.lang.Iterable values) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, backups_); + onChanged(); + } else { + backupsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder clearBackups() { + if (backupsBuilder_ == null) { + backups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + backupsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public Builder removeBackups(int index) { + if (backupsBuilder_ == null) { + ensureBackupsIsMutable(); + backups_.remove(index); + onChanged(); + } else { + backupsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public com.google.bigtable.admin.v2.Backup.Builder getBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int index) { + if (backupsBuilder_ == null) { + return backups_.get(index); + } else { + return backupsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public java.util.List + getBackupsOrBuilderList() { + if (backupsBuilder_ != null) { + return backupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(backups_); + } + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder() { + return internalGetBackupsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder(int index) { + return internalGetBackupsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Backup.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of matching backups.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + public java.util.List getBackupsBuilderList() { + return internalGetBackupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + internalGetBackupsFieldBuilder() { + if (backupsBuilder_ == null) { + backupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder>( + backups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + backups_ = null; + } + return backupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+     * to fetch more of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+     * to fetch more of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+     * to fetch more of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+     * to fetch more of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * `next_page_token` can be sent in a subsequent
+     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+     * to fetch more of the matching backups.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListBackupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListBackupsResponse) + private static final com.google.bigtable.admin.v2.ListBackupsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListBackupsResponse(); + } + + public static com.google.bigtable.admin.v2.ListBackupsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBackupsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListBackupsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java new file mode 100644 index 000000000000..c1f8d9efc561 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListBackupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListBackupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + java.util.List getBackupsList(); + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + com.google.bigtable.admin.v2.Backup getBackups(int index); + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + int getBackupsCount(); + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + java.util.List getBackupsOrBuilderList(); + + /** + * + * + *
+   * The list of matching backups.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Backup backups = 1; + */ + com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int index); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+   * to fetch more of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * `next_page_token` can be sent in a subsequent
+   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
+   * to fetch more of the matching backups.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java new file mode 100644 index 000000000000..5a2288c17825 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java @@ -0,0 +1,827 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListClusters.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListClustersRequest} + */ +@com.google.protobuf.Generated +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListClustersRequest) + ListClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListClustersRequest"); + } + + // Use ListClustersRequest.newBuilder() to construct. + private ListClustersRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListClustersRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListClustersRequest.class, + com.google.bigtable.admin.v2.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of clusters is
+   * requested. Values are of the form
+   * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+   * Clusters for all Instances in a project, e.g.,
+   * `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of clusters is
+   * requested. Values are of the form
+   * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+   * Clusters for all Instances in a project, e.g.,
+   * `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListClustersRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListClustersRequest other = + (com.google.bigtable.admin.v2.ListClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest 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.admin.v2.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest 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.admin.v2.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListClustersRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListClusters.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListClustersRequest) + com.google.bigtable.admin.v2.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListClustersRequest.class, + com.google.bigtable.admin.v2.ListClustersRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListClustersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersRequest build() { + com.google.bigtable.admin.v2.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersRequest buildPartial() { + com.google.bigtable.admin.v2.ListClustersRequest result = + new com.google.bigtable.admin.v2.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListClustersRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersRequest other) { + if (other == com.google.bigtable.admin.v2.ListClustersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of clusters is
+     * requested. Values are of the form
+     * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+     * Clusters for all Instances in a project, e.g.,
+     * `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of clusters is
+     * requested. Values are of the form
+     * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+     * Clusters for all Instances in a project, e.g.,
+     * `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of clusters is
+     * requested. Values are of the form
+     * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+     * Clusters for all Instances in a project, e.g.,
+     * `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of clusters is
+     * requested. Values are of the form
+     * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+     * Clusters for all Instances in a project, e.g.,
+     * `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which a list of clusters is
+     * requested. Values are of the form
+     * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+     * Clusters for all Instances in a project, e.g.,
+     * `projects/myproject/instances/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListClustersRequest) + private static final com.google.bigtable.admin.v2.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListClustersRequest(); + } + + public static com.google.bigtable.admin.v2.ListClustersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..799caf000ba4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of clusters is
+   * requested. Values are of the form
+   * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+   * Clusters for all Instances in a project, e.g.,
+   * `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance for which a list of clusters is
+   * requested. Values are of the form
+   * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
+   * Clusters for all Instances in a project, e.g.,
+   * `projects/myproject/instances/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java new file mode 100644 index 000000000000..e18d2410184f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java @@ -0,0 +1,1452 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListClusters.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListClustersResponse} + */ +@com.google.protobuf.Generated +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListClustersResponse) + ListClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListClustersResponse"); + } + + // Use ListClustersResponse.newBuilder() to construct. + private ListClustersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListClustersResponse() { + clusters_ = java.util.Collections.emptyList(); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListClustersResponse.class, + com.google.bigtable.admin.v2.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getClusters(int index) { + return clusters_.get(index); + } + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int index) { + return clusters_.get(index); + } + + public static final int FAILED_LOCATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + return failedLocations_; + } + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < clusters_.size(); i++) { + output.writeMessage(1, clusters_.get(i)); + } + for (int i = 0; i < failedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, failedLocations_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < clusters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clusters_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < failedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(failedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedLocationsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListClustersResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListClustersResponse other = + (com.google.bigtable.admin.v2.ListClustersResponse) obj; + + if (!getClustersList().equals(other.getClustersList())) return false; + if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getClustersCount() > 0) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getClustersList().hashCode(); + } + if (getFailedLocationsCount() > 0) { + hash = (37 * hash) + FAILED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFailedLocationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse 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.admin.v2.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse 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.admin.v2.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListClustersResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListClusters.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListClustersResponse) + com.google.bigtable.admin.v2.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListClustersResponse.class, + com.google.bigtable.admin.v2.ListClustersResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListClustersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + } else { + clusters_ = null; + clustersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersResponse build() { + com.google.bigtable.admin.v2.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListClustersResponse buildPartial() { + com.google.bigtable.admin.v2.ListClustersResponse result = + new com.google.bigtable.admin.v2.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListClustersResponse result) { + if (clustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clusters_ = clusters_; + } else { + result.clusters_ = clustersBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + failedLocations_.makeImmutable(); + result.failedLocations_ = failedLocations_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListClustersResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersResponse other) { + if (other == com.google.bigtable.admin.v2.ListClustersResponse.getDefaultInstance()) + return this; + if (clustersBuilder_ == null) { + if (!other.clusters_.isEmpty()) { + if (clusters_.isEmpty()) { + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClustersIsMutable(); + clusters_.addAll(other.clusters_); + } + onChanged(); + } + } else { + if (!other.clusters_.isEmpty()) { + if (clustersBuilder_.isEmpty()) { + clustersBuilder_.dispose(); + clustersBuilder_ = null; + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + clustersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetClustersFieldBuilder() + : null; + } else { + clustersBuilder_.addAllMessages(other.clusters_); + } + } + } + if (!other.failedLocations_.isEmpty()) { + if (failedLocations_.isEmpty()) { + failedLocations_ = other.failedLocations_; + bitField0_ |= 0x00000002; + } else { + ensureFailedLocationsIsMutable(); + failedLocations_.addAll(other.failedLocations_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Cluster m = + input.readMessage( + com.google.bigtable.admin.v2.Cluster.parser(), extensionRegistry); + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(m); + } else { + clustersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFailedLocationsIsMutable(); + failedLocations_.add(s); + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List clusters_ = + java.util.Collections.emptyList(); + + private void ensureClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clusters_ = new java.util.ArrayList(clusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public com.google.bigtable.admin.v2.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.bigtable.admin.v2.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder addClusters(com.google.bigtable.admin.v2.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.bigtable.admin.v2.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder addClusters(com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder addAllClusters( + java.lang.Iterable values) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusters_); + onChanged(); + } else { + clustersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public com.google.bigtable.admin.v2.Cluster.Builder getClustersBuilder(int index) { + return internalGetClustersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder() { + return internalGetClustersFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder(int index) { + return internalGetClustersFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested clusters.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + public java.util.List getClustersBuilderList() { + return internalGetClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + internalGetClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureFailedLocationsIsMutable() { + if (!failedLocations_.isModifiable()) { + failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + failedLocations_.makeImmutable(); + return failedLocations_; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index to set the value at. + * @param value The failedLocations to set. + * @return This builder for chaining. + */ + public Builder setFailedLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param value The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param values The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllFailedLocations(java.lang.Iterable values) { + ensureFailedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return This builder for chaining. + */ + public Builder clearFailedLocations() { + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Cluster information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Clusters from these locations may be missing from `clusters`,
+     * or may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param value The bytes of the failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListClustersResponse) + private static final com.google.bigtable.admin.v2.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListClustersResponse(); + } + + public static com.google.bigtable.admin.v2.ListClustersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClustersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..92eeb65c4109 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + java.util.List getClustersList(); + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + com.google.bigtable.admin.v2.Cluster getClusters(int index); + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + int getClustersCount(); + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + java.util.List + getClustersOrBuilderList(); + + /** + * + * + *
+   * The list of requested clusters.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Cluster clusters = 1; + */ + com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + java.util.List getFailedLocationsList(); + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + int getFailedLocationsCount(); + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + java.lang.String getFailedLocations(int index); + + /** + * + * + *
+   * Locations from which Cluster information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Clusters from these locations may be missing from `clusters`,
+   * or may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + com.google.protobuf.ByteString getFailedLocationsBytes(int index); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java new file mode 100644 index 000000000000..bf4757cc613e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java @@ -0,0 +1,1558 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListHotTablets.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsRequest} + */ +@com.google.protobuf.Generated +public final class ListHotTabletsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListHotTabletsRequest) + ListHotTabletsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListHotTabletsRequest"); + } + + // Use ListHotTabletsRequest.newBuilder() to construct. + private ListHotTabletsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListHotTabletsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListHotTabletsRequest.class, + com.google.bigtable.admin.v2.ListHotTabletsRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The cluster name to list hot tablets.
+   * Value is in the following form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The cluster name to list hot tablets.
+   * Value is in the following form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size that is empty or zero lets the server choose the number of
+   * items to return. A page_size which is strictly positive will return at most
+   * that many items. A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls do not need a
+   * page_size field. If a page_size is set in subsequent calls, it must match
+   * the page_size given in the first request.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListHotTabletsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListHotTabletsRequest other = + (com.google.bigtable.admin.v2.ListHotTabletsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest 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.admin.v2.ListHotTabletsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest 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.admin.v2.ListHotTabletsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListHotTabletsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListHotTablets.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListHotTabletsRequest) + com.google.bigtable.admin.v2.ListHotTabletsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListHotTabletsRequest.class, + com.google.bigtable.admin.v2.ListHotTabletsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListHotTabletsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListHotTabletsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsRequest build() { + com.google.bigtable.admin.v2.ListHotTabletsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsRequest buildPartial() { + com.google.bigtable.admin.v2.ListHotTabletsRequest result = + new com.google.bigtable.admin.v2.ListHotTabletsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListHotTabletsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListHotTabletsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListHotTabletsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListHotTabletsRequest other) { + if (other == com.google.bigtable.admin.v2.ListHotTabletsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The cluster name to list hot tablets.
+     * Value is in the following form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The cluster name to list hot tablets.
+     * Value is in the following form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The cluster name to list hot tablets.
+     * Value is in the following form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster name to list hot tablets.
+     * Value is in the following form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The cluster name to list hot tablets.
+     * Value is in the following form:
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The start time to list hot tablets. The hot tablets in the response will
+     * have start times between the requested start time and end time. Start time
+     * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+     * it is unset. The start time should be less than the end time, and the
+     * maximum allowed time range between start time and end time is 48 hours.
+     * Start time and end time should have values between Now and Now - 14 days.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The end time to list hot tablets.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int pageSize_; + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size that is empty or zero lets the server choose the number of
+     * items to return. A page_size which is strictly positive will return at most
+     * that many items. A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls do not need a
+     * page_size field. If a page_size is set in subsequent calls, it must match
+     * the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size that is empty or zero lets the server choose the number of
+     * items to return. A page_size which is strictly positive will return at most
+     * that many items. A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls do not need a
+     * page_size field. If a page_size is set in subsequent calls, it must match
+     * the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size that is empty or zero lets the server choose the number of
+     * items to return. A page_size which is strictly positive will return at most
+     * that many items. A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls do not need a
+     * page_size field. If a page_size is set in subsequent calls, it must match
+     * the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000008); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 5; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 5; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListHotTabletsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListHotTabletsRequest) + private static final com.google.bigtable.admin.v2.ListHotTabletsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListHotTabletsRequest(); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHotTabletsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListHotTabletsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java new file mode 100644 index 000000000000..cb49993125c9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListHotTabletsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListHotTabletsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The cluster name to list hot tablets.
+   * Value is in the following form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The cluster name to list hot tablets.
+   * Value is in the following form:
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The start time to list hot tablets. The hot tablets in the response will
+   * have start times between the requested start time and end time. Start time
+   * defaults to Now if it is unset, and end time defaults to Now - 24 hours if
+   * it is unset. The start time should be less than the end time, and the
+   * maximum allowed time range between start time and end time is 48 hours.
+   * Start time and end time should have values between Now and Now - 14 days.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The end time to list hot tablets.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size that is empty or zero lets the server choose the number of
+   * items to return. A page_size which is strictly positive will return at most
+   * that many items. A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls do not need a
+   * page_size field. If a page_size is set in subsequent calls, it must match
+   * the page_size given in the first request.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java new file mode 100644 index 000000000000..d744c8e42a1b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java @@ -0,0 +1,1217 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListHotTablets.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsResponse} + */ +@com.google.protobuf.Generated +public final class ListHotTabletsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListHotTabletsResponse) + ListHotTabletsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListHotTabletsResponse"); + } + + // Use ListHotTabletsResponse.newBuilder() to construct. + private ListHotTabletsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListHotTabletsResponse() { + hotTablets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListHotTabletsResponse.class, + com.google.bigtable.admin.v2.ListHotTabletsResponse.Builder.class); + } + + public static final int HOT_TABLETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List hotTablets_; + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + @java.lang.Override + public java.util.List getHotTabletsList() { + return hotTablets_; + } + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + @java.lang.Override + public java.util.List + getHotTabletsOrBuilderList() { + return hotTablets_; + } + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + @java.lang.Override + public int getHotTabletsCount() { + return hotTablets_.size(); + } + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.HotTablet getHotTablets(int index) { + return hotTablets_.get(index); + } + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.HotTabletOrBuilder getHotTabletsOrBuilder(int index) { + return hotTablets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Set if not all hot tablets could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Set if not all hot tablets could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < hotTablets_.size(); i++) { + output.writeMessage(1, hotTablets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < hotTablets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, hotTablets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListHotTabletsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListHotTabletsResponse other = + (com.google.bigtable.admin.v2.ListHotTabletsResponse) obj; + + if (!getHotTabletsList().equals(other.getHotTabletsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHotTabletsCount() > 0) { + hash = (37 * hash) + HOT_TABLETS_FIELD_NUMBER; + hash = (53 * hash) + getHotTabletsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse 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.admin.v2.ListHotTabletsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse 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.admin.v2.ListHotTabletsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListHotTabletsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListHotTablets.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListHotTabletsResponse) + com.google.bigtable.admin.v2.ListHotTabletsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListHotTabletsResponse.class, + com.google.bigtable.admin.v2.ListHotTabletsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListHotTabletsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (hotTabletsBuilder_ == null) { + hotTablets_ = java.util.Collections.emptyList(); + } else { + hotTablets_ = null; + hotTabletsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListHotTabletsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsResponse build() { + com.google.bigtable.admin.v2.ListHotTabletsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListHotTabletsResponse buildPartial() { + com.google.bigtable.admin.v2.ListHotTabletsResponse result = + new com.google.bigtable.admin.v2.ListHotTabletsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListHotTabletsResponse result) { + if (hotTabletsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + hotTablets_ = java.util.Collections.unmodifiableList(hotTablets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.hotTablets_ = hotTablets_; + } else { + result.hotTablets_ = hotTabletsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListHotTabletsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListHotTabletsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListHotTabletsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListHotTabletsResponse other) { + if (other == com.google.bigtable.admin.v2.ListHotTabletsResponse.getDefaultInstance()) + return this; + if (hotTabletsBuilder_ == null) { + if (!other.hotTablets_.isEmpty()) { + if (hotTablets_.isEmpty()) { + hotTablets_ = other.hotTablets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHotTabletsIsMutable(); + hotTablets_.addAll(other.hotTablets_); + } + onChanged(); + } + } else { + if (!other.hotTablets_.isEmpty()) { + if (hotTabletsBuilder_.isEmpty()) { + hotTabletsBuilder_.dispose(); + hotTabletsBuilder_ = null; + hotTablets_ = other.hotTablets_; + bitField0_ = (bitField0_ & ~0x00000001); + hotTabletsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetHotTabletsFieldBuilder() + : null; + } else { + hotTabletsBuilder_.addAllMessages(other.hotTablets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.HotTablet m = + input.readMessage( + com.google.bigtable.admin.v2.HotTablet.parser(), extensionRegistry); + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + hotTablets_.add(m); + } else { + hotTabletsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List hotTablets_ = + java.util.Collections.emptyList(); + + private void ensureHotTabletsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + hotTablets_ = new java.util.ArrayList(hotTablets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.HotTablet, + com.google.bigtable.admin.v2.HotTablet.Builder, + com.google.bigtable.admin.v2.HotTabletOrBuilder> + hotTabletsBuilder_; + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public java.util.List getHotTabletsList() { + if (hotTabletsBuilder_ == null) { + return java.util.Collections.unmodifiableList(hotTablets_); + } else { + return hotTabletsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public int getHotTabletsCount() { + if (hotTabletsBuilder_ == null) { + return hotTablets_.size(); + } else { + return hotTabletsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public com.google.bigtable.admin.v2.HotTablet getHotTablets(int index) { + if (hotTabletsBuilder_ == null) { + return hotTablets_.get(index); + } else { + return hotTabletsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder setHotTablets(int index, com.google.bigtable.admin.v2.HotTablet value) { + if (hotTabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHotTabletsIsMutable(); + hotTablets_.set(index, value); + onChanged(); + } else { + hotTabletsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder setHotTablets( + int index, com.google.bigtable.admin.v2.HotTablet.Builder builderForValue) { + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + hotTablets_.set(index, builderForValue.build()); + onChanged(); + } else { + hotTabletsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder addHotTablets(com.google.bigtable.admin.v2.HotTablet value) { + if (hotTabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHotTabletsIsMutable(); + hotTablets_.add(value); + onChanged(); + } else { + hotTabletsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder addHotTablets(int index, com.google.bigtable.admin.v2.HotTablet value) { + if (hotTabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHotTabletsIsMutable(); + hotTablets_.add(index, value); + onChanged(); + } else { + hotTabletsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder addHotTablets(com.google.bigtable.admin.v2.HotTablet.Builder builderForValue) { + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + hotTablets_.add(builderForValue.build()); + onChanged(); + } else { + hotTabletsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder addHotTablets( + int index, com.google.bigtable.admin.v2.HotTablet.Builder builderForValue) { + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + hotTablets_.add(index, builderForValue.build()); + onChanged(); + } else { + hotTabletsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder addAllHotTablets( + java.lang.Iterable values) { + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hotTablets_); + onChanged(); + } else { + hotTabletsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder clearHotTablets() { + if (hotTabletsBuilder_ == null) { + hotTablets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + hotTabletsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public Builder removeHotTablets(int index) { + if (hotTabletsBuilder_ == null) { + ensureHotTabletsIsMutable(); + hotTablets_.remove(index); + onChanged(); + } else { + hotTabletsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public com.google.bigtable.admin.v2.HotTablet.Builder getHotTabletsBuilder(int index) { + return internalGetHotTabletsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public com.google.bigtable.admin.v2.HotTabletOrBuilder getHotTabletsOrBuilder(int index) { + if (hotTabletsBuilder_ == null) { + return hotTablets_.get(index); + } else { + return hotTabletsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public java.util.List + getHotTabletsOrBuilderList() { + if (hotTabletsBuilder_ != null) { + return hotTabletsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(hotTablets_); + } + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public com.google.bigtable.admin.v2.HotTablet.Builder addHotTabletsBuilder() { + return internalGetHotTabletsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.HotTablet.getDefaultInstance()); + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public com.google.bigtable.admin.v2.HotTablet.Builder addHotTabletsBuilder(int index) { + return internalGetHotTabletsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.HotTablet.getDefaultInstance()); + } + + /** + * + * + *
+     * List of hot tablets in the tables of the requested cluster that fall
+     * within the requested time range. Hot tablets are ordered by node cpu usage
+     * percent. If there are multiple hot tablets that correspond to the same
+     * tablet within a 15-minute interval, only the hot tablet with the highest
+     * node cpu usage will be included in the response.
+     * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + public java.util.List + getHotTabletsBuilderList() { + return internalGetHotTabletsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.HotTablet, + com.google.bigtable.admin.v2.HotTablet.Builder, + com.google.bigtable.admin.v2.HotTabletOrBuilder> + internalGetHotTabletsFieldBuilder() { + if (hotTabletsBuilder_ == null) { + hotTabletsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.HotTablet, + com.google.bigtable.admin.v2.HotTablet.Builder, + com.google.bigtable.admin.v2.HotTabletOrBuilder>( + hotTablets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + hotTablets_ = null; + } + return hotTabletsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Set if not all hot tablets could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Set if not all hot tablets could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Set if not all hot tablets could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all hot tablets could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all hot tablets could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListHotTabletsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListHotTabletsResponse) + private static final com.google.bigtable.admin.v2.ListHotTabletsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListHotTabletsResponse(); + } + + public static com.google.bigtable.admin.v2.ListHotTabletsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHotTabletsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListHotTabletsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java new file mode 100644 index 000000000000..f740e4e4ad25 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListHotTabletsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListHotTabletsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + java.util.List getHotTabletsList(); + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + com.google.bigtable.admin.v2.HotTablet getHotTablets(int index); + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + int getHotTabletsCount(); + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + java.util.List + getHotTabletsOrBuilderList(); + + /** + * + * + *
+   * List of hot tablets in the tables of the requested cluster that fall
+   * within the requested time range. Hot tablets are ordered by node cpu usage
+   * percent. If there are multiple hot tablets that correspond to the same
+   * tablet within a 15-minute interval, only the hot tablet with the highest
+   * node cpu usage will be included in the response.
+   * 
+ * + * repeated .google.bigtable.admin.v2.HotTablet hot_tablets = 1; + */ + com.google.bigtable.admin.v2.HotTabletOrBuilder getHotTabletsOrBuilder(int index); + + /** + * + * + *
+   * Set if not all hot tablets could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Set if not all hot tablets could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java new file mode 100644 index 000000000000..13657d6edd99 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java @@ -0,0 +1,806 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListInstances.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListInstancesRequest} + */ +@com.google.protobuf.Generated +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListInstancesRequest"); + } + + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListInstancesRequest.class, + com.google.bigtable.admin.v2.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the project for which a list of instances is
+   * requested. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the project for which a list of instances is
+   * requested. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListInstancesRequest other = + (com.google.bigtable.admin.v2.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest 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.admin.v2.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest 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.admin.v2.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListInstancesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListInstances.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListInstancesRequest) + com.google.bigtable.admin.v2.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListInstancesRequest.class, + com.google.bigtable.admin.v2.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesRequest build() { + com.google.bigtable.admin.v2.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesRequest buildPartial() { + com.google.bigtable.admin.v2.ListInstancesRequest result = + new com.google.bigtable.admin.v2.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListInstancesRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesRequest other) { + if (other == com.google.bigtable.admin.v2.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the project for which a list of instances is
+     * requested. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the project for which a list of instances is
+     * requested. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the project for which a list of instances is
+     * requested. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the project for which a list of instances is
+     * requested. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the project for which a list of instances is
+     * requested. Values are of the form `projects/{project}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListInstancesRequest) + private static final com.google.bigtable.admin.v2.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListInstancesRequest(); + } + + public static com.google.bigtable.admin.v2.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..4b32b5b83757 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the project for which a list of instances is
+   * requested. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the project for which a list of instances is
+   * requested. Values are of the form `projects/{project}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java new file mode 100644 index 000000000000..fdf318bf9b56 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java @@ -0,0 +1,1465 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListInstances.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListInstancesResponse} + */ +@com.google.protobuf.Generated +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListInstancesResponse"); + } + + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListInstancesResponse.class, + com.google.bigtable.admin.v2.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance getInstances(int index) { + return instances_.get(index); + } + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int FAILED_LOCATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + return failedLocations_; + } + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + for (int i = 0; i < failedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, failedLocations_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < failedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(failedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedLocationsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListInstancesResponse other = + (com.google.bigtable.admin.v2.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + if (getFailedLocationsCount() > 0) { + hash = (37 * hash) + FAILED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFailedLocationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse 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.admin.v2.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse 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.admin.v2.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListInstancesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListInstances.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListInstancesResponse) + com.google.bigtable.admin.v2.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListInstancesResponse.class, + com.google.bigtable.admin.v2.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesResponse build() { + com.google.bigtable.admin.v2.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListInstancesResponse buildPartial() { + com.google.bigtable.admin.v2.ListInstancesResponse result = + new com.google.bigtable.admin.v2.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListInstancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + failedLocations_.makeImmutable(); + result.failedLocations_ = failedLocations_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListInstancesResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesResponse other) { + if (other == com.google.bigtable.admin.v2.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.failedLocations_.isEmpty()) { + if (failedLocations_.isEmpty()) { + failedLocations_ = other.failedLocations_; + bitField0_ |= 0x00000002; + } else { + ensureFailedLocationsIsMutable(); + failedLocations_.addAll(other.failedLocations_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Instance m = + input.readMessage( + com.google.bigtable.admin.v2.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFailedLocationsIsMutable(); + failedLocations_.add(s); + break; + } // case 18 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public com.google.bigtable.admin.v2.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.bigtable.admin.v2.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.bigtable.admin.v2.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder addInstances(com.google.bigtable.admin.v2.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.bigtable.admin.v2.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder addInstances(com.google.bigtable.admin.v2.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.bigtable.admin.v2.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public com.google.bigtable.admin.v2.Instance.Builder getInstancesBuilder(int index) { + return internalGetInstancesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder() { + return internalGetInstancesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Instance.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder(int index) { + return internalGetInstancesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Instance.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested instances.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + public java.util.List getInstancesBuilderList() { + return internalGetInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + internalGetInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureFailedLocationsIsMutable() { + if (!failedLocations_.isModifiable()) { + failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + public com.google.protobuf.ProtocolStringList getFailedLocationsList() { + failedLocations_.makeImmutable(); + return failedLocations_; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index to set the value at. + * @param value The failedLocations to set. + * @return This builder for chaining. + */ + public Builder setFailedLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param value The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param values The failedLocations to add. + * @return This builder for chaining. + */ + public Builder addAllFailedLocations(java.lang.Iterable values) { + ensureFailedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @return This builder for chaining. + */ + public Builder clearFailedLocations() { + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations from which Instance information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * Instances whose Clusters are all in one of the failed locations
+     * may be missing from `instances`, and Instances with at least one
+     * Cluster in a failed location may only have partial information returned.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 2; + * + * @param value The bytes of the failedLocations to add. + * @return This builder for chaining. + */ + public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * DEPRECATED: This field is unused and ignored.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListInstancesResponse) + private static final com.google.bigtable.admin.v2.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListInstancesResponse(); + } + + public static com.google.bigtable.admin.v2.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..c8a67d0651b1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + java.util.List getInstancesList(); + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + com.google.bigtable.admin.v2.Instance getInstances(int index); + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + int getInstancesCount(); + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + + /** + * + * + *
+   * The list of requested instances.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Instance instances = 1; + */ + com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return A list containing the failedLocations. + */ + java.util.List getFailedLocationsList(); + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @return The count of failedLocations. + */ + int getFailedLocationsCount(); + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the element to return. + * @return The failedLocations at the given index. + */ + java.lang.String getFailedLocations(int index); + + /** + * + * + *
+   * Locations from which Instance information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * Instances whose Clusters are all in one of the failed locations
+   * may be missing from `instances`, and Instances with at least one
+   * Cluster in a failed location may only have partial information returned.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedLocations at the given index. + */ + com.google.protobuf.ByteString getFailedLocationsBytes(int index); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * DEPRECATED: This field is unused and ignored.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequest.java new file mode 100644 index 000000000000..c7c4459f594e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequest.java @@ -0,0 +1,942 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListLogicalViews.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListLogicalViewsRequest} + */ +@com.google.protobuf.Generated +public final class ListLogicalViewsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListLogicalViewsRequest) + ListLogicalViewsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListLogicalViewsRequest"); + } + + // Use ListLogicalViewsRequest.newBuilder() to construct. + private ListLogicalViewsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListLogicalViewsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListLogicalViewsRequest.class, + com.google.bigtable.admin.v2.ListLogicalViewsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of logical
+   * views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of logical
+   * views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of logical views to return. The service may
+   * return fewer than this value
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLogicalViews` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLogicalViews` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLogicalViews` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLogicalViews` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListLogicalViewsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListLogicalViewsRequest other = + (com.google.bigtable.admin.v2.ListLogicalViewsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest 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.admin.v2.ListLogicalViewsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest 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.admin.v2.ListLogicalViewsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListLogicalViewsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListLogicalViews.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListLogicalViewsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListLogicalViewsRequest) + com.google.bigtable.admin.v2.ListLogicalViewsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListLogicalViewsRequest.class, + com.google.bigtable.admin.v2.ListLogicalViewsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListLogicalViewsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListLogicalViewsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsRequest build() { + com.google.bigtable.admin.v2.ListLogicalViewsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsRequest buildPartial() { + com.google.bigtable.admin.v2.ListLogicalViewsRequest result = + new com.google.bigtable.admin.v2.ListLogicalViewsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListLogicalViewsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListLogicalViewsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListLogicalViewsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListLogicalViewsRequest other) { + if (other == com.google.bigtable.admin.v2.ListLogicalViewsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of logical
+     * views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of logical
+     * views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of logical
+     * views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of logical
+     * views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of logical
+     * views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of logical views to return. The service may
+     * return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of logical views to return. The service may
+     * return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of logical views to return. The service may
+     * return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLogicalViews` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLogicalViews` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLogicalViews` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLogicalViews` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLogicalViews` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLogicalViews` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLogicalViews` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLogicalViews` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListLogicalViews` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLogicalViews` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListLogicalViewsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListLogicalViewsRequest) + private static final com.google.bigtable.admin.v2.ListLogicalViewsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListLogicalViewsRequest(); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogicalViewsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListLogicalViewsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequestOrBuilder.java new file mode 100644 index 000000000000..18b5ea9e7af3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListLogicalViewsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListLogicalViewsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of logical
+   * views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of logical
+   * views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of logical views to return. The service may
+   * return fewer than this value
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLogicalViews` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLogicalViews` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListLogicalViews` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLogicalViews` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponse.java new file mode 100644 index 000000000000..245cf63f2a8b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponse.java @@ -0,0 +1,1121 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListLogicalViews.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListLogicalViewsResponse} + */ +@com.google.protobuf.Generated +public final class ListLogicalViewsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListLogicalViewsResponse) + ListLogicalViewsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListLogicalViewsResponse"); + } + + // Use ListLogicalViewsResponse.newBuilder() to construct. + private ListLogicalViewsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListLogicalViewsResponse() { + logicalViews_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListLogicalViewsResponse.class, + com.google.bigtable.admin.v2.ListLogicalViewsResponse.Builder.class); + } + + public static final int LOGICAL_VIEWS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List logicalViews_; + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + @java.lang.Override + public java.util.List getLogicalViewsList() { + return logicalViews_; + } + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + @java.lang.Override + public java.util.List + getLogicalViewsOrBuilderList() { + return logicalViews_; + } + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + @java.lang.Override + public int getLogicalViewsCount() { + return logicalViews_.size(); + } + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView getLogicalViews(int index) { + return logicalViews_.get(index); + } + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewsOrBuilder(int index) { + return logicalViews_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < logicalViews_.size(); i++) { + output.writeMessage(1, logicalViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < logicalViews_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, logicalViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListLogicalViewsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListLogicalViewsResponse other = + (com.google.bigtable.admin.v2.ListLogicalViewsResponse) obj; + + if (!getLogicalViewsList().equals(other.getLogicalViewsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLogicalViewsCount() > 0) { + hash = (37 * hash) + LOGICAL_VIEWS_FIELD_NUMBER; + hash = (53 * hash) + getLogicalViewsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse 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.admin.v2.ListLogicalViewsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse 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.admin.v2.ListLogicalViewsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListLogicalViewsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListLogicalViews.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListLogicalViewsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListLogicalViewsResponse) + com.google.bigtable.admin.v2.ListLogicalViewsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListLogicalViewsResponse.class, + com.google.bigtable.admin.v2.ListLogicalViewsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListLogicalViewsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (logicalViewsBuilder_ == null) { + logicalViews_ = java.util.Collections.emptyList(); + } else { + logicalViews_ = null; + logicalViewsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListLogicalViewsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListLogicalViewsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsResponse build() { + com.google.bigtable.admin.v2.ListLogicalViewsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListLogicalViewsResponse buildPartial() { + com.google.bigtable.admin.v2.ListLogicalViewsResponse result = + new com.google.bigtable.admin.v2.ListLogicalViewsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListLogicalViewsResponse result) { + if (logicalViewsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + logicalViews_ = java.util.Collections.unmodifiableList(logicalViews_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.logicalViews_ = logicalViews_; + } else { + result.logicalViews_ = logicalViewsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListLogicalViewsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListLogicalViewsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListLogicalViewsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListLogicalViewsResponse other) { + if (other == com.google.bigtable.admin.v2.ListLogicalViewsResponse.getDefaultInstance()) + return this; + if (logicalViewsBuilder_ == null) { + if (!other.logicalViews_.isEmpty()) { + if (logicalViews_.isEmpty()) { + logicalViews_ = other.logicalViews_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLogicalViewsIsMutable(); + logicalViews_.addAll(other.logicalViews_); + } + onChanged(); + } + } else { + if (!other.logicalViews_.isEmpty()) { + if (logicalViewsBuilder_.isEmpty()) { + logicalViewsBuilder_.dispose(); + logicalViewsBuilder_ = null; + logicalViews_ = other.logicalViews_; + bitField0_ = (bitField0_ & ~0x00000001); + logicalViewsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLogicalViewsFieldBuilder() + : null; + } else { + logicalViewsBuilder_.addAllMessages(other.logicalViews_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.LogicalView m = + input.readMessage( + com.google.bigtable.admin.v2.LogicalView.parser(), extensionRegistry); + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + logicalViews_.add(m); + } else { + logicalViewsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List logicalViews_ = + java.util.Collections.emptyList(); + + private void ensureLogicalViewsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + logicalViews_ = + new java.util.ArrayList(logicalViews_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + logicalViewsBuilder_; + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public java.util.List getLogicalViewsList() { + if (logicalViewsBuilder_ == null) { + return java.util.Collections.unmodifiableList(logicalViews_); + } else { + return logicalViewsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public int getLogicalViewsCount() { + if (logicalViewsBuilder_ == null) { + return logicalViews_.size(); + } else { + return logicalViewsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public com.google.bigtable.admin.v2.LogicalView getLogicalViews(int index) { + if (logicalViewsBuilder_ == null) { + return logicalViews_.get(index); + } else { + return logicalViewsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder setLogicalViews(int index, com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogicalViewsIsMutable(); + logicalViews_.set(index, value); + onChanged(); + } else { + logicalViewsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder setLogicalViews( + int index, com.google.bigtable.admin.v2.LogicalView.Builder builderForValue) { + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + logicalViews_.set(index, builderForValue.build()); + onChanged(); + } else { + logicalViewsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder addLogicalViews(com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogicalViewsIsMutable(); + logicalViews_.add(value); + onChanged(); + } else { + logicalViewsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder addLogicalViews(int index, com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogicalViewsIsMutable(); + logicalViews_.add(index, value); + onChanged(); + } else { + logicalViewsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder addLogicalViews( + com.google.bigtable.admin.v2.LogicalView.Builder builderForValue) { + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + logicalViews_.add(builderForValue.build()); + onChanged(); + } else { + logicalViewsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder addLogicalViews( + int index, com.google.bigtable.admin.v2.LogicalView.Builder builderForValue) { + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + logicalViews_.add(index, builderForValue.build()); + onChanged(); + } else { + logicalViewsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder addAllLogicalViews( + java.lang.Iterable values) { + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, logicalViews_); + onChanged(); + } else { + logicalViewsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder clearLogicalViews() { + if (logicalViewsBuilder_ == null) { + logicalViews_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + logicalViewsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public Builder removeLogicalViews(int index) { + if (logicalViewsBuilder_ == null) { + ensureLogicalViewsIsMutable(); + logicalViews_.remove(index); + onChanged(); + } else { + logicalViewsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public com.google.bigtable.admin.v2.LogicalView.Builder getLogicalViewsBuilder(int index) { + return internalGetLogicalViewsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewsOrBuilder(int index) { + if (logicalViewsBuilder_ == null) { + return logicalViews_.get(index); + } else { + return logicalViewsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public java.util.List + getLogicalViewsOrBuilderList() { + if (logicalViewsBuilder_ != null) { + return logicalViewsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(logicalViews_); + } + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public com.google.bigtable.admin.v2.LogicalView.Builder addLogicalViewsBuilder() { + return internalGetLogicalViewsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.LogicalView.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public com.google.bigtable.admin.v2.LogicalView.Builder addLogicalViewsBuilder(int index) { + return internalGetLogicalViewsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.LogicalView.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested logical views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + public java.util.List + getLogicalViewsBuilderList() { + return internalGetLogicalViewsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + internalGetLogicalViewsFieldBuilder() { + if (logicalViewsBuilder_ == null) { + logicalViewsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder>( + logicalViews_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + logicalViews_ = null; + } + return logicalViewsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListLogicalViewsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListLogicalViewsResponse) + private static final com.google.bigtable.admin.v2.ListLogicalViewsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListLogicalViewsResponse(); + } + + public static com.google.bigtable.admin.v2.ListLogicalViewsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogicalViewsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListLogicalViewsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponseOrBuilder.java new file mode 100644 index 000000000000..1d8b2d34fb4b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListLogicalViewsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListLogicalViewsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + java.util.List getLogicalViewsList(); + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + com.google.bigtable.admin.v2.LogicalView getLogicalViews(int index); + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + int getLogicalViewsCount(); + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + java.util.List + getLogicalViewsOrBuilderList(); + + /** + * + * + *
+   * The list of requested logical views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.LogicalView logical_views = 1; + */ + com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequest.java new file mode 100644 index 000000000000..0170c4ba137c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequest.java @@ -0,0 +1,943 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.ListMaterializedViews.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListMaterializedViewsRequest} + */ +@com.google.protobuf.Generated +public final class ListMaterializedViewsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListMaterializedViewsRequest) + ListMaterializedViewsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListMaterializedViewsRequest"); + } + + // Use ListMaterializedViewsRequest.newBuilder() to construct. + private ListMaterializedViewsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListMaterializedViewsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest.class, + com.google.bigtable.admin.v2.ListMaterializedViewsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of
+   * materialized views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of
+   * materialized views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of materialized views to return. The service
+   * may return fewer than this value
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListMaterializedViews`
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListMaterializedViews`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListMaterializedViews`
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListMaterializedViews`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListMaterializedViewsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListMaterializedViewsRequest other = + (com.google.bigtable.admin.v2.ListMaterializedViewsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest 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.admin.v2.ListMaterializedViewsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest 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.admin.v2.ListMaterializedViewsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListMaterializedViewsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.ListMaterializedViews.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListMaterializedViewsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListMaterializedViewsRequest) + com.google.bigtable.admin.v2.ListMaterializedViewsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListMaterializedViewsRequest.class, + com.google.bigtable.admin.v2.ListMaterializedViewsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListMaterializedViewsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListMaterializedViewsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsRequest build() { + com.google.bigtable.admin.v2.ListMaterializedViewsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsRequest buildPartial() { + com.google.bigtable.admin.v2.ListMaterializedViewsRequest result = + new com.google.bigtable.admin.v2.ListMaterializedViewsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListMaterializedViewsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListMaterializedViewsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListMaterializedViewsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListMaterializedViewsRequest other) { + if (other == com.google.bigtable.admin.v2.ListMaterializedViewsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of
+     * materialized views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of
+     * materialized views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of
+     * materialized views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of
+     * materialized views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the list of
+     * materialized views is requested. Values are of the form
+     * `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of materialized views to return. The service
+     * may return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of materialized views to return. The service
+     * may return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of materialized views to return. The service
+     * may return fewer than this value
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListMaterializedViews`
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListMaterializedViews`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListMaterializedViews`
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListMaterializedViews`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListMaterializedViews`
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListMaterializedViews`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListMaterializedViews`
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListMaterializedViews`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListMaterializedViews`
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListMaterializedViews`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListMaterializedViewsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListMaterializedViewsRequest) + private static final com.google.bigtable.admin.v2.ListMaterializedViewsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListMaterializedViewsRequest(); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMaterializedViewsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListMaterializedViewsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequestOrBuilder.java new file mode 100644 index 000000000000..a706c8db7bbc --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListMaterializedViewsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListMaterializedViewsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of
+   * materialized views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance for which the list of
+   * materialized views is requested. Values are of the form
+   * `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of materialized views to return. The service
+   * may return fewer than this value
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListMaterializedViews`
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListMaterializedViews`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListMaterializedViews`
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListMaterializedViews`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponse.java new file mode 100644 index 000000000000..6c36e54251c4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponse.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for BigtableInstanceAdmin.ListMaterializedViews.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListMaterializedViewsResponse} + */ +@com.google.protobuf.Generated +public final class ListMaterializedViewsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListMaterializedViewsResponse) + ListMaterializedViewsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListMaterializedViewsResponse"); + } + + // Use ListMaterializedViewsResponse.newBuilder() to construct. + private ListMaterializedViewsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListMaterializedViewsResponse() { + materializedViews_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListMaterializedViewsResponse.class, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse.Builder.class); + } + + public static final int MATERIALIZED_VIEWS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List materializedViews_; + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + @java.lang.Override + public java.util.List getMaterializedViewsList() { + return materializedViews_; + } + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + @java.lang.Override + public java.util.List + getMaterializedViewsOrBuilderList() { + return materializedViews_; + } + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + @java.lang.Override + public int getMaterializedViewsCount() { + return materializedViews_.size(); + } + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView getMaterializedViews(int index) { + return materializedViews_.get(index); + } + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewsOrBuilder( + int index) { + return materializedViews_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < materializedViews_.size(); i++) { + output.writeMessage(1, materializedViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < materializedViews_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, materializedViews_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListMaterializedViewsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListMaterializedViewsResponse other = + (com.google.bigtable.admin.v2.ListMaterializedViewsResponse) obj; + + if (!getMaterializedViewsList().equals(other.getMaterializedViewsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMaterializedViewsCount() > 0) { + hash = (37 * hash) + MATERIALIZED_VIEWS_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse 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.admin.v2.ListMaterializedViewsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse 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.admin.v2.ListMaterializedViewsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListMaterializedViewsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableInstanceAdmin.ListMaterializedViews.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListMaterializedViewsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListMaterializedViewsResponse) + com.google.bigtable.admin.v2.ListMaterializedViewsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListMaterializedViewsResponse.class, + com.google.bigtable.admin.v2.ListMaterializedViewsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListMaterializedViewsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (materializedViewsBuilder_ == null) { + materializedViews_ = java.util.Collections.emptyList(); + } else { + materializedViews_ = null; + materializedViewsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_ListMaterializedViewsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListMaterializedViewsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsResponse build() { + com.google.bigtable.admin.v2.ListMaterializedViewsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListMaterializedViewsResponse buildPartial() { + com.google.bigtable.admin.v2.ListMaterializedViewsResponse result = + new com.google.bigtable.admin.v2.ListMaterializedViewsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListMaterializedViewsResponse result) { + if (materializedViewsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + materializedViews_ = java.util.Collections.unmodifiableList(materializedViews_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.materializedViews_ = materializedViews_; + } else { + result.materializedViews_ = materializedViewsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListMaterializedViewsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListMaterializedViewsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListMaterializedViewsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListMaterializedViewsResponse other) { + if (other == com.google.bigtable.admin.v2.ListMaterializedViewsResponse.getDefaultInstance()) + return this; + if (materializedViewsBuilder_ == null) { + if (!other.materializedViews_.isEmpty()) { + if (materializedViews_.isEmpty()) { + materializedViews_ = other.materializedViews_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMaterializedViewsIsMutable(); + materializedViews_.addAll(other.materializedViews_); + } + onChanged(); + } + } else { + if (!other.materializedViews_.isEmpty()) { + if (materializedViewsBuilder_.isEmpty()) { + materializedViewsBuilder_.dispose(); + materializedViewsBuilder_ = null; + materializedViews_ = other.materializedViews_; + bitField0_ = (bitField0_ & ~0x00000001); + materializedViewsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMaterializedViewsFieldBuilder() + : null; + } else { + materializedViewsBuilder_.addAllMessages(other.materializedViews_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.MaterializedView m = + input.readMessage( + com.google.bigtable.admin.v2.MaterializedView.parser(), extensionRegistry); + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + materializedViews_.add(m); + } else { + materializedViewsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List materializedViews_ = + java.util.Collections.emptyList(); + + private void ensureMaterializedViewsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + materializedViews_ = + new java.util.ArrayList( + materializedViews_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + materializedViewsBuilder_; + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public java.util.List + getMaterializedViewsList() { + if (materializedViewsBuilder_ == null) { + return java.util.Collections.unmodifiableList(materializedViews_); + } else { + return materializedViewsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public int getMaterializedViewsCount() { + if (materializedViewsBuilder_ == null) { + return materializedViews_.size(); + } else { + return materializedViewsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public com.google.bigtable.admin.v2.MaterializedView getMaterializedViews(int index) { + if (materializedViewsBuilder_ == null) { + return materializedViews_.get(index); + } else { + return materializedViewsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder setMaterializedViews( + int index, com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterializedViewsIsMutable(); + materializedViews_.set(index, value); + onChanged(); + } else { + materializedViewsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder setMaterializedViews( + int index, com.google.bigtable.admin.v2.MaterializedView.Builder builderForValue) { + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + materializedViews_.set(index, builderForValue.build()); + onChanged(); + } else { + materializedViewsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder addMaterializedViews(com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterializedViewsIsMutable(); + materializedViews_.add(value); + onChanged(); + } else { + materializedViewsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder addMaterializedViews( + int index, com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterializedViewsIsMutable(); + materializedViews_.add(index, value); + onChanged(); + } else { + materializedViewsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder addMaterializedViews( + com.google.bigtable.admin.v2.MaterializedView.Builder builderForValue) { + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + materializedViews_.add(builderForValue.build()); + onChanged(); + } else { + materializedViewsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder addMaterializedViews( + int index, com.google.bigtable.admin.v2.MaterializedView.Builder builderForValue) { + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + materializedViews_.add(index, builderForValue.build()); + onChanged(); + } else { + materializedViewsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder addAllMaterializedViews( + java.lang.Iterable values) { + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materializedViews_); + onChanged(); + } else { + materializedViewsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder clearMaterializedViews() { + if (materializedViewsBuilder_ == null) { + materializedViews_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + materializedViewsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public Builder removeMaterializedViews(int index) { + if (materializedViewsBuilder_ == null) { + ensureMaterializedViewsIsMutable(); + materializedViews_.remove(index); + onChanged(); + } else { + materializedViewsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public com.google.bigtable.admin.v2.MaterializedView.Builder getMaterializedViewsBuilder( + int index) { + return internalGetMaterializedViewsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewsOrBuilder( + int index) { + if (materializedViewsBuilder_ == null) { + return materializedViews_.get(index); + } else { + return materializedViewsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public java.util.List + getMaterializedViewsOrBuilderList() { + if (materializedViewsBuilder_ != null) { + return materializedViewsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(materializedViews_); + } + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public com.google.bigtable.admin.v2.MaterializedView.Builder addMaterializedViewsBuilder() { + return internalGetMaterializedViewsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public com.google.bigtable.admin.v2.MaterializedView.Builder addMaterializedViewsBuilder( + int index) { + return internalGetMaterializedViewsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of requested materialized views.
+     * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + public java.util.List + getMaterializedViewsBuilderList() { + return internalGetMaterializedViewsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + internalGetMaterializedViewsFieldBuilder() { + if (materializedViewsBuilder_ == null) { + materializedViewsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder>( + materializedViews_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + materializedViews_ = null; + } + return materializedViewsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListMaterializedViewsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListMaterializedViewsResponse) + private static final com.google.bigtable.admin.v2.ListMaterializedViewsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListMaterializedViewsResponse(); + } + + public static com.google.bigtable.admin.v2.ListMaterializedViewsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMaterializedViewsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListMaterializedViewsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponseOrBuilder.java new file mode 100644 index 000000000000..34bbd2ea0c21 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListMaterializedViewsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListMaterializedViewsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + java.util.List getMaterializedViewsList(); + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + com.google.bigtable.admin.v2.MaterializedView getMaterializedViews(int index); + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + int getMaterializedViewsCount(); + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + java.util.List + getMaterializedViewsOrBuilderList(); + + /** + * + * + *
+   * The list of requested materialized views.
+   * 
+ * + * repeated .google.bigtable.admin.v2.MaterializedView materialized_views = 1; + */ + com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequest.java new file mode 100644 index 000000000000..11fa9c7fbc8f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSchemaBundlesRequest} + */ +@com.google.protobuf.Generated +public final class ListSchemaBundlesRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListSchemaBundlesRequest) + ListSchemaBundlesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSchemaBundlesRequest"); + } + + // Use ListSchemaBundlesRequest.newBuilder() to construct. + private ListSchemaBundlesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSchemaBundlesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest.class, + com.google.bigtable.admin.v2.ListSchemaBundlesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent, which owns this collection of schema bundles.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent, which owns this collection of schema bundles.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of schema bundles to return. If the value is positive,
+   * the server may return at most this value. If unspecified, the server will
+   * return the maximum allowed page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * A page token, received from a previous `ListSchemaBundles` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSchemaBundles` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A page token, received from a previous `ListSchemaBundles` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSchemaBundles` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListSchemaBundlesRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListSchemaBundlesRequest other = + (com.google.bigtable.admin.v2.ListSchemaBundlesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest 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.admin.v2.ListSchemaBundlesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest 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.admin.v2.ListSchemaBundlesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListSchemaBundlesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSchemaBundlesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListSchemaBundlesRequest) + com.google.bigtable.admin.v2.ListSchemaBundlesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSchemaBundlesRequest.class, + com.google.bigtable.admin.v2.ListSchemaBundlesRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListSchemaBundlesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListSchemaBundlesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesRequest build() { + com.google.bigtable.admin.v2.ListSchemaBundlesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesRequest buildPartial() { + com.google.bigtable.admin.v2.ListSchemaBundlesRequest result = + new com.google.bigtable.admin.v2.ListSchemaBundlesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListSchemaBundlesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListSchemaBundlesRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListSchemaBundlesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListSchemaBundlesRequest other) { + if (other == com.google.bigtable.admin.v2.ListSchemaBundlesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent, which owns this collection of schema bundles.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent, which owns this collection of schema bundles.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent, which owns this collection of schema bundles.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent, which owns this collection of schema bundles.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent, which owns this collection of schema bundles.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of schema bundles to return. If the value is positive,
+     * the server may return at most this value. If unspecified, the server will
+     * return the maximum allowed page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of schema bundles to return. If the value is positive,
+     * the server may return at most this value. If unspecified, the server will
+     * return the maximum allowed page size.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of schema bundles to return. If the value is positive,
+     * the server may return at most this value. If unspecified, the server will
+     * return the maximum allowed page size.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * A page token, received from a previous `ListSchemaBundles` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSchemaBundles` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListSchemaBundles` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSchemaBundles` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A page token, received from a previous `ListSchemaBundles` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSchemaBundles` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListSchemaBundles` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSchemaBundles` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A page token, received from a previous `ListSchemaBundles` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListSchemaBundles` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSchemaBundlesRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListSchemaBundlesRequest) + private static final com.google.bigtable.admin.v2.ListSchemaBundlesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListSchemaBundlesRequest(); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemaBundlesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListSchemaBundlesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequestOrBuilder.java new file mode 100644 index 000000000000..4352f147ebb4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListSchemaBundlesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListSchemaBundlesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of schema bundles.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent, which owns this collection of schema bundles.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of schema bundles to return. If the value is positive,
+   * the server may return at most this value. If unspecified, the server will
+   * return the maximum allowed page size.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListSchemaBundles` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSchemaBundles` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * A page token, received from a previous `ListSchemaBundles` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListSchemaBundles` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponse.java new file mode 100644 index 000000000000..c4c023fbca08 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The response for
+ * [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSchemaBundlesResponse} + */ +@com.google.protobuf.Generated +public final class ListSchemaBundlesResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListSchemaBundlesResponse) + ListSchemaBundlesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSchemaBundlesResponse"); + } + + // Use ListSchemaBundlesResponse.newBuilder() to construct. + private ListSchemaBundlesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSchemaBundlesResponse() { + schemaBundles_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSchemaBundlesResponse.class, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse.Builder.class); + } + + public static final int SCHEMA_BUNDLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List schemaBundles_; + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + @java.lang.Override + public java.util.List getSchemaBundlesList() { + return schemaBundles_; + } + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + @java.lang.Override + public java.util.List + getSchemaBundlesOrBuilderList() { + return schemaBundles_; + } + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + @java.lang.Override + public int getSchemaBundlesCount() { + return schemaBundles_.size(); + } + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundles(int index) { + return schemaBundles_.get(index); + } + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundlesOrBuilder(int index) { + return schemaBundles_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < schemaBundles_.size(); i++) { + output.writeMessage(1, schemaBundles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < schemaBundles_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, schemaBundles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListSchemaBundlesResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListSchemaBundlesResponse other = + (com.google.bigtable.admin.v2.ListSchemaBundlesResponse) obj; + + if (!getSchemaBundlesList().equals(other.getSchemaBundlesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSchemaBundlesCount() > 0) { + hash = (37 * hash) + SCHEMA_BUNDLES_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundlesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse 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.admin.v2.ListSchemaBundlesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse 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.admin.v2.ListSchemaBundlesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListSchemaBundlesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response for
+   * [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSchemaBundlesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListSchemaBundlesResponse) + com.google.bigtable.admin.v2.ListSchemaBundlesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSchemaBundlesResponse.class, + com.google.bigtable.admin.v2.ListSchemaBundlesResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListSchemaBundlesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (schemaBundlesBuilder_ == null) { + schemaBundles_ = java.util.Collections.emptyList(); + } else { + schemaBundles_ = null; + schemaBundlesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSchemaBundlesResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListSchemaBundlesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesResponse build() { + com.google.bigtable.admin.v2.ListSchemaBundlesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSchemaBundlesResponse buildPartial() { + com.google.bigtable.admin.v2.ListSchemaBundlesResponse result = + new com.google.bigtable.admin.v2.ListSchemaBundlesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListSchemaBundlesResponse result) { + if (schemaBundlesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + schemaBundles_ = java.util.Collections.unmodifiableList(schemaBundles_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.schemaBundles_ = schemaBundles_; + } else { + result.schemaBundles_ = schemaBundlesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListSchemaBundlesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListSchemaBundlesResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListSchemaBundlesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListSchemaBundlesResponse other) { + if (other == com.google.bigtable.admin.v2.ListSchemaBundlesResponse.getDefaultInstance()) + return this; + if (schemaBundlesBuilder_ == null) { + if (!other.schemaBundles_.isEmpty()) { + if (schemaBundles_.isEmpty()) { + schemaBundles_ = other.schemaBundles_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSchemaBundlesIsMutable(); + schemaBundles_.addAll(other.schemaBundles_); + } + onChanged(); + } + } else { + if (!other.schemaBundles_.isEmpty()) { + if (schemaBundlesBuilder_.isEmpty()) { + schemaBundlesBuilder_.dispose(); + schemaBundlesBuilder_ = null; + schemaBundles_ = other.schemaBundles_; + bitField0_ = (bitField0_ & ~0x00000001); + schemaBundlesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSchemaBundlesFieldBuilder() + : null; + } else { + schemaBundlesBuilder_.addAllMessages(other.schemaBundles_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.SchemaBundle m = + input.readMessage( + com.google.bigtable.admin.v2.SchemaBundle.parser(), extensionRegistry); + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + schemaBundles_.add(m); + } else { + schemaBundlesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List schemaBundles_ = + java.util.Collections.emptyList(); + + private void ensureSchemaBundlesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + schemaBundles_ = + new java.util.ArrayList(schemaBundles_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + schemaBundlesBuilder_; + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public java.util.List getSchemaBundlesList() { + if (schemaBundlesBuilder_ == null) { + return java.util.Collections.unmodifiableList(schemaBundles_); + } else { + return schemaBundlesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public int getSchemaBundlesCount() { + if (schemaBundlesBuilder_ == null) { + return schemaBundles_.size(); + } else { + return schemaBundlesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundles(int index) { + if (schemaBundlesBuilder_ == null) { + return schemaBundles_.get(index); + } else { + return schemaBundlesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder setSchemaBundles(int index, com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundlesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemaBundlesIsMutable(); + schemaBundles_.set(index, value); + onChanged(); + } else { + schemaBundlesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder setSchemaBundles( + int index, com.google.bigtable.admin.v2.SchemaBundle.Builder builderForValue) { + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + schemaBundles_.set(index, builderForValue.build()); + onChanged(); + } else { + schemaBundlesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder addSchemaBundles(com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundlesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemaBundlesIsMutable(); + schemaBundles_.add(value); + onChanged(); + } else { + schemaBundlesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder addSchemaBundles(int index, com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundlesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemaBundlesIsMutable(); + schemaBundles_.add(index, value); + onChanged(); + } else { + schemaBundlesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder addSchemaBundles( + com.google.bigtable.admin.v2.SchemaBundle.Builder builderForValue) { + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + schemaBundles_.add(builderForValue.build()); + onChanged(); + } else { + schemaBundlesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder addSchemaBundles( + int index, com.google.bigtable.admin.v2.SchemaBundle.Builder builderForValue) { + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + schemaBundles_.add(index, builderForValue.build()); + onChanged(); + } else { + schemaBundlesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder addAllSchemaBundles( + java.lang.Iterable values) { + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, schemaBundles_); + onChanged(); + } else { + schemaBundlesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder clearSchemaBundles() { + if (schemaBundlesBuilder_ == null) { + schemaBundles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + schemaBundlesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public Builder removeSchemaBundles(int index) { + if (schemaBundlesBuilder_ == null) { + ensureSchemaBundlesIsMutable(); + schemaBundles_.remove(index); + onChanged(); + } else { + schemaBundlesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public com.google.bigtable.admin.v2.SchemaBundle.Builder getSchemaBundlesBuilder(int index) { + return internalGetSchemaBundlesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundlesOrBuilder(int index) { + if (schemaBundlesBuilder_ == null) { + return schemaBundles_.get(index); + } else { + return schemaBundlesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public java.util.List + getSchemaBundlesOrBuilderList() { + if (schemaBundlesBuilder_ != null) { + return schemaBundlesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(schemaBundles_); + } + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public com.google.bigtable.admin.v2.SchemaBundle.Builder addSchemaBundlesBuilder() { + return internalGetSchemaBundlesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance()); + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public com.google.bigtable.admin.v2.SchemaBundle.Builder addSchemaBundlesBuilder(int index) { + return internalGetSchemaBundlesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance()); + } + + /** + * + * + *
+     * The schema bundles from the specified table.
+     * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + public java.util.List + getSchemaBundlesBuilderList() { + return internalGetSchemaBundlesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + internalGetSchemaBundlesFieldBuilder() { + if (schemaBundlesBuilder_ == null) { + schemaBundlesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder>( + schemaBundles_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + schemaBundles_ = null; + } + return schemaBundlesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSchemaBundlesResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListSchemaBundlesResponse) + private static final com.google.bigtable.admin.v2.ListSchemaBundlesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListSchemaBundlesResponse(); + } + + public static com.google.bigtable.admin.v2.ListSchemaBundlesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemaBundlesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListSchemaBundlesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponseOrBuilder.java new file mode 100644 index 000000000000..f7c4cd2d02e4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListSchemaBundlesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListSchemaBundlesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + java.util.List getSchemaBundlesList(); + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + com.google.bigtable.admin.v2.SchemaBundle getSchemaBundles(int index); + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + int getSchemaBundlesCount(); + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + java.util.List + getSchemaBundlesOrBuilderList(); + + /** + * + * + *
+   * The schema bundles from the specified table.
+   * 
+ * + * repeated .google.bigtable.admin.v2.SchemaBundle schema_bundles = 1; + */ + com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundlesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java new file mode 100644 index 000000000000..4616321aa3ae --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java @@ -0,0 +1,940 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsRequest} + */ +@com.google.protobuf.Generated +public final class ListSnapshotsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListSnapshotsRequest) + ListSnapshotsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSnapshotsRequest"); + } + + // Use ListSnapshotsRequest.newBuilder() to construct. + private ListSnapshotsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSnapshotsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSnapshotsRequest.class, + com.google.bigtable.admin.v2.ListSnapshotsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the cluster for which snapshots should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the cluster for which snapshots should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of snapshots to return per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + size += getUnknownFields().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.admin.v2.ListSnapshotsRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListSnapshotsRequest other = + (com.google.bigtable.admin.v2.ListSnapshotsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest 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.admin.v2.ListSnapshotsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest 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.admin.v2.ListSnapshotsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListSnapshotsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListSnapshotsRequest) + com.google.bigtable.admin.v2.ListSnapshotsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSnapshotsRequest.class, + com.google.bigtable.admin.v2.ListSnapshotsRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListSnapshotsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListSnapshotsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsRequest build() { + com.google.bigtable.admin.v2.ListSnapshotsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsRequest buildPartial() { + com.google.bigtable.admin.v2.ListSnapshotsRequest result = + new com.google.bigtable.admin.v2.ListSnapshotsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListSnapshotsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListSnapshotsRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListSnapshotsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsRequest other) { + if (other == com.google.bigtable.admin.v2.ListSnapshotsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the cluster for which snapshots should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the cluster for which snapshots should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the cluster for which snapshots should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the cluster for which snapshots should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the cluster for which snapshots should be
+     * listed. Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+     * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSnapshotsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListSnapshotsRequest) + private static final com.google.bigtable.admin.v2.ListSnapshotsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListSnapshotsRequest(); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSnapshotsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListSnapshotsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java new file mode 100644 index 000000000000..611ca5eb2742 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListSnapshotsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListSnapshotsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the cluster for which snapshots should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the cluster for which snapshots should be
+   * listed. Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
+   * e.g., `projects/{project}/instances/{instance}/clusters/-`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of snapshots to return per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java new file mode 100644 index 000000000000..4fd00db5044e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java @@ -0,0 +1,1136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsResponse} + */ +@com.google.protobuf.Generated +public final class ListSnapshotsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListSnapshotsResponse) + ListSnapshotsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSnapshotsResponse"); + } + + // Use ListSnapshotsResponse.newBuilder() to construct. + private ListSnapshotsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSnapshotsResponse() { + snapshots_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSnapshotsResponse.class, + com.google.bigtable.admin.v2.ListSnapshotsResponse.Builder.class); + } + + public static final int SNAPSHOTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List snapshots_; + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + @java.lang.Override + public java.util.List getSnapshotsList() { + return snapshots_; + } + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + @java.lang.Override + public java.util.List + getSnapshotsOrBuilderList() { + return snapshots_; + } + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + @java.lang.Override + public int getSnapshotsCount() { + return snapshots_.size(); + } + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot getSnapshots(int index) { + return snapshots_.get(index); + } + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { + return snapshots_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Set if not all snapshots could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Set if not all snapshots could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < snapshots_.size(); i++) { + output.writeMessage(1, snapshots_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < snapshots_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snapshots_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListSnapshotsResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListSnapshotsResponse other = + (com.google.bigtable.admin.v2.ListSnapshotsResponse) obj; + + if (!getSnapshotsList().equals(other.getSnapshotsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSnapshotsCount() > 0) { + hash = (37 * hash) + SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse 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.admin.v2.ListSnapshotsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse 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.admin.v2.ListSnapshotsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListSnapshotsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListSnapshotsResponse) + com.google.bigtable.admin.v2.ListSnapshotsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListSnapshotsResponse.class, + com.google.bigtable.admin.v2.ListSnapshotsResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListSnapshotsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + } else { + snapshots_ = null; + snapshotsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListSnapshotsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsResponse build() { + com.google.bigtable.admin.v2.ListSnapshotsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListSnapshotsResponse buildPartial() { + com.google.bigtable.admin.v2.ListSnapshotsResponse result = + new com.google.bigtable.admin.v2.ListSnapshotsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListSnapshotsResponse result) { + if (snapshotsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + snapshots_ = java.util.Collections.unmodifiableList(snapshots_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.snapshots_ = snapshots_; + } else { + result.snapshots_ = snapshotsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListSnapshotsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListSnapshotsResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListSnapshotsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsResponse other) { + if (other == com.google.bigtable.admin.v2.ListSnapshotsResponse.getDefaultInstance()) + return this; + if (snapshotsBuilder_ == null) { + if (!other.snapshots_.isEmpty()) { + if (snapshots_.isEmpty()) { + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSnapshotsIsMutable(); + snapshots_.addAll(other.snapshots_); + } + onChanged(); + } + } else { + if (!other.snapshots_.isEmpty()) { + if (snapshotsBuilder_.isEmpty()) { + snapshotsBuilder_.dispose(); + snapshotsBuilder_ = null; + snapshots_ = other.snapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + snapshotsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSnapshotsFieldBuilder() + : null; + } else { + snapshotsBuilder_.addAllMessages(other.snapshots_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Snapshot m = + input.readMessage( + com.google.bigtable.admin.v2.Snapshot.parser(), extensionRegistry); + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(m); + } else { + snapshotsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List snapshots_ = + java.util.Collections.emptyList(); + + private void ensureSnapshotsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + snapshots_ = new java.util.ArrayList(snapshots_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Snapshot, + com.google.bigtable.admin.v2.Snapshot.Builder, + com.google.bigtable.admin.v2.SnapshotOrBuilder> + snapshotsBuilder_; + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public java.util.List getSnapshotsList() { + if (snapshotsBuilder_ == null) { + return java.util.Collections.unmodifiableList(snapshots_); + } else { + return snapshotsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public int getSnapshotsCount() { + if (snapshotsBuilder_ == null) { + return snapshots_.size(); + } else { + return snapshotsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public com.google.bigtable.admin.v2.Snapshot getSnapshots(int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); + } else { + return snapshotsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder setSnapshots(int index, com.google.bigtable.admin.v2.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.set(index, value); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder setSnapshots( + int index, com.google.bigtable.admin.v2.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.set(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder addSnapshots(com.google.bigtable.admin.v2.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder addSnapshots(int index, com.google.bigtable.admin.v2.Snapshot value) { + if (snapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapshotsIsMutable(); + snapshots_.add(index, value); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder addSnapshots(com.google.bigtable.admin.v2.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder addSnapshots( + int index, com.google.bigtable.admin.v2.Snapshot.Builder builderForValue) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.add(index, builderForValue.build()); + onChanged(); + } else { + snapshotsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder addAllSnapshots( + java.lang.Iterable values) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, snapshots_); + onChanged(); + } else { + snapshotsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder clearSnapshots() { + if (snapshotsBuilder_ == null) { + snapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + snapshotsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public Builder removeSnapshots(int index) { + if (snapshotsBuilder_ == null) { + ensureSnapshotsIsMutable(); + snapshots_.remove(index); + onChanged(); + } else { + snapshotsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public com.google.bigtable.admin.v2.Snapshot.Builder getSnapshotsBuilder(int index) { + return internalGetSnapshotsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { + if (snapshotsBuilder_ == null) { + return snapshots_.get(index); + } else { + return snapshotsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public java.util.List + getSnapshotsOrBuilderList() { + if (snapshotsBuilder_ != null) { + return snapshotsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(snapshots_); + } + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder() { + return internalGetSnapshotsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Snapshot.getDefaultInstance()); + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder(int index) { + return internalGetSnapshotsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Snapshot.getDefaultInstance()); + } + + /** + * + * + *
+     * The snapshots present in the requested cluster.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + public java.util.List getSnapshotsBuilderList() { + return internalGetSnapshotsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Snapshot, + com.google.bigtable.admin.v2.Snapshot.Builder, + com.google.bigtable.admin.v2.SnapshotOrBuilder> + internalGetSnapshotsFieldBuilder() { + if (snapshotsBuilder_ == null) { + snapshotsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Snapshot, + com.google.bigtable.admin.v2.Snapshot.Builder, + com.google.bigtable.admin.v2.SnapshotOrBuilder>( + snapshots_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + snapshots_ = null; + } + return snapshotsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Set if not all snapshots could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Set if not all snapshots could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Set if not all snapshots could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all snapshots could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all snapshots could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSnapshotsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListSnapshotsResponse) + private static final com.google.bigtable.admin.v2.ListSnapshotsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListSnapshotsResponse(); + } + + public static com.google.bigtable.admin.v2.ListSnapshotsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSnapshotsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListSnapshotsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java new file mode 100644 index 000000000000..849c3c6408f0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListSnapshotsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListSnapshotsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + java.util.List getSnapshotsList(); + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + com.google.bigtable.admin.v2.Snapshot getSnapshots(int index); + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + int getSnapshotsCount(); + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + java.util.List + getSnapshotsOrBuilderList(); + + /** + * + * + *
+   * The snapshots present in the requested cluster.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1; + */ + com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int index); + + /** + * + * + *
+   * Set if not all snapshots could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Set if not all snapshots could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java new file mode 100644 index 000000000000..e567a8c1ae0f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java @@ -0,0 +1,1098 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListTablesRequest} + */ +@com.google.protobuf.Generated +public final class ListTablesRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListTablesRequest) + ListTablesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListTablesRequest"); + } + + // Use ListTablesRequest.newBuilder() to construct. + private ListTablesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListTablesRequest() { + parent_ = ""; + view_ = 0; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListTablesRequest.class, + com.google.bigtable.admin.v2.ListTablesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which tables should be
+   * listed. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which tables should be
+   * listed. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_ = 0; + + /** + * + * + *
+   * The view to be applied to the returned tables' fields.
+   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+   * The view to be applied to the returned tables' fields.
+   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.View getView() { + com.google.bigtable.admin.v2.Table.View result = + com.google.bigtable.admin.v2.Table.View.forNumber(view_); + return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + size += getUnknownFields().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.admin.v2.ListTablesRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListTablesRequest other = + (com.google.bigtable.admin.v2.ListTablesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (view_ != other.view_) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest 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.admin.v2.ListTablesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest 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.admin.v2.ListTablesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListTablesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListTablesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListTablesRequest) + com.google.bigtable.admin.v2.ListTablesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListTablesRequest.class, + com.google.bigtable.admin.v2.ListTablesRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListTablesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + view_ = 0; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesRequest build() { + com.google.bigtable.admin.v2.ListTablesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesRequest buildPartial() { + com.google.bigtable.admin.v2.ListTablesRequest result = + new com.google.bigtable.admin.v2.ListTablesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListTablesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = view_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListTablesRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ListTablesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesRequest other) { + if (other == com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which tables should be
+     * listed. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which tables should be
+     * listed. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which tables should be
+     * listed. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which tables should be
+     * listed. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which tables should be
+     * listed. Values are of the form `projects/{project}/instances/{instance}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int view_ = 0; + + /** + * + * + *
+     * The view to be applied to the returned tables' fields.
+     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + + /** + * + * + *
+     * The view to be applied to the returned tables' fields.
+     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The view to be applied to the returned tables' fields.
+     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.View getView() { + com.google.bigtable.admin.v2.Table.View result = + com.google.bigtable.admin.v2.Table.View.forNumber(view_); + return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The view to be applied to the returned tables' fields.
+     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.bigtable.admin.v2.Table.View value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + view_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The view to be applied to the returned tables' fields.
+     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+     * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum number of results per page.
+     *
+     * A page_size of zero lets the server choose the number of items to return.
+     * A page_size which is strictly positive will return at most that many items.
+     * A negative page_size will cause an error.
+     *
+     * Following the first request, subsequent paginated calls are not required
+     * to pass a page_size. If a page_size is set in subsequent calls, it must
+     * match the page_size given in the first request.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The value of `next_page_token` returned by a previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListTablesRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListTablesRequest) + private static final com.google.bigtable.admin.v2.ListTablesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListTablesRequest(); + } + + public static com.google.bigtable.admin.v2.ListTablesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTablesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListTablesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java new file mode 100644 index 000000000000..7809366346a7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListTablesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListTablesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which tables should be
+   * listed. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The unique name of the instance for which tables should be
+   * listed. Values are of the form `projects/{project}/instances/{instance}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The view to be applied to the returned tables' fields.
+   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + + /** + * + * + *
+   * The view to be applied to the returned tables' fields.
+   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
+   * 
+ * + * .google.bigtable.admin.v2.Table.View view = 2; + * + * @return The view. + */ + com.google.bigtable.admin.v2.Table.View getView(); + + /** + * + * + *
+   * Maximum number of results per page.
+   *
+   * A page_size of zero lets the server choose the number of items to return.
+   * A page_size which is strictly positive will return at most that many items.
+   * A negative page_size will cause an error.
+   *
+   * Following the first request, subsequent paginated calls are not required
+   * to pass a page_size. If a page_size is set in subsequent calls, it must
+   * match the page_size given in the first request.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The value of `next_page_token` returned by a previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java new file mode 100644 index 000000000000..281d07bc3916 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Response message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListTablesResponse} + */ +@com.google.protobuf.Generated +public final class ListTablesResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListTablesResponse) + ListTablesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListTablesResponse"); + } + + // Use ListTablesResponse.newBuilder() to construct. + private ListTablesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListTablesResponse() { + tables_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListTablesResponse.class, + com.google.bigtable.admin.v2.ListTablesResponse.Builder.class); + } + + public static final int TABLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List tables_; + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + @java.lang.Override + public java.util.List getTablesList() { + return tables_; + } + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + @java.lang.Override + public java.util.List + getTablesOrBuilderList() { + return tables_; + } + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + @java.lang.Override + public int getTablesCount() { + return tables_.size(); + } + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table getTables(int index) { + return tables_.get(index); + } + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index) { + return tables_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < tables_.size(); i++) { + output.writeMessage(1, tables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tables_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.admin.v2.ListTablesResponse)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ListTablesResponse other = + (com.google.bigtable.admin.v2.ListTablesResponse) obj; + + if (!getTablesList().equals(other.getTablesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTablesCount() > 0) { + hash = (37 * hash) + TABLES_FIELD_NUMBER; + hash = (53 * hash) + getTablesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse 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.admin.v2.ListTablesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse 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.admin.v2.ListTablesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ListTablesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ListTablesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ListTablesResponse) + com.google.bigtable.admin.v2.ListTablesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ListTablesResponse.class, + com.google.bigtable.admin.v2.ListTablesResponse.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ListTablesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (tablesBuilder_ == null) { + tables_ = java.util.Collections.emptyList(); + } else { + tables_ = null; + tablesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ListTablesResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesResponse getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ListTablesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesResponse build() { + com.google.bigtable.admin.v2.ListTablesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ListTablesResponse buildPartial() { + com.google.bigtable.admin.v2.ListTablesResponse result = + new com.google.bigtable.admin.v2.ListTablesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ListTablesResponse result) { + if (tablesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tables_ = java.util.Collections.unmodifiableList(tables_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tables_ = tables_; + } else { + result.tables_ = tablesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ListTablesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ListTablesResponse) { + return mergeFrom((com.google.bigtable.admin.v2.ListTablesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesResponse other) { + if (other == com.google.bigtable.admin.v2.ListTablesResponse.getDefaultInstance()) + return this; + if (tablesBuilder_ == null) { + if (!other.tables_.isEmpty()) { + if (tables_.isEmpty()) { + tables_ = other.tables_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTablesIsMutable(); + tables_.addAll(other.tables_); + } + onChanged(); + } + } else { + if (!other.tables_.isEmpty()) { + if (tablesBuilder_.isEmpty()) { + tablesBuilder_.dispose(); + tablesBuilder_ = null; + tables_ = other.tables_; + bitField0_ = (bitField0_ & ~0x00000001); + tablesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTablesFieldBuilder() + : null; + } else { + tablesBuilder_.addAllMessages(other.tables_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Table m = + input.readMessage( + com.google.bigtable.admin.v2.Table.parser(), extensionRegistry); + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + tables_.add(m); + } else { + tablesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List tables_ = + java.util.Collections.emptyList(); + + private void ensureTablesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tables_ = new java.util.ArrayList(tables_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + tablesBuilder_; + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public java.util.List getTablesList() { + if (tablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(tables_); + } else { + return tablesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public int getTablesCount() { + if (tablesBuilder_ == null) { + return tables_.size(); + } else { + return tablesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public com.google.bigtable.admin.v2.Table getTables(int index) { + if (tablesBuilder_ == null) { + return tables_.get(index); + } else { + return tablesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder setTables(int index, com.google.bigtable.admin.v2.Table value) { + if (tablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.set(index, value); + onChanged(); + } else { + tablesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder setTables( + int index, com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + tables_.set(index, builderForValue.build()); + onChanged(); + } else { + tablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder addTables(com.google.bigtable.admin.v2.Table value) { + if (tablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.add(value); + onChanged(); + } else { + tablesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder addTables(int index, com.google.bigtable.admin.v2.Table value) { + if (tablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTablesIsMutable(); + tables_.add(index, value); + onChanged(); + } else { + tablesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder addTables(com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + tables_.add(builderForValue.build()); + onChanged(); + } else { + tablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder addTables( + int index, com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + tables_.add(index, builderForValue.build()); + onChanged(); + } else { + tablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder addAllTables( + java.lang.Iterable values) { + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tables_); + onChanged(); + } else { + tablesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder clearTables() { + if (tablesBuilder_ == null) { + tables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tablesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public Builder removeTables(int index) { + if (tablesBuilder_ == null) { + ensureTablesIsMutable(); + tables_.remove(index); + onChanged(); + } else { + tablesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public com.google.bigtable.admin.v2.Table.Builder getTablesBuilder(int index) { + return internalGetTablesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index) { + if (tablesBuilder_ == null) { + return tables_.get(index); + } else { + return tablesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public java.util.List + getTablesOrBuilderList() { + if (tablesBuilder_ != null) { + return tablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tables_); + } + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder() { + return internalGetTablesFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Table.getDefaultInstance()); + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder(int index) { + return internalGetTablesFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Table.getDefaultInstance()); + } + + /** + * + * + *
+     * The tables present in the requested instance.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + public java.util.List getTablesBuilderList() { + return internalGetTablesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + internalGetTablesFieldBuilder() { + if (tablesBuilder_ == null) { + tablesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder>( + tables_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tables_ = null; + } + return tablesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Set if not all tables could be returned in a single response.
+     * Pass this value to `page_token` in another request to get the next
+     * page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListTablesResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ListTablesResponse) + private static final com.google.bigtable.admin.v2.ListTablesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ListTablesResponse(); + } + + public static com.google.bigtable.admin.v2.ListTablesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTablesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ListTablesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java new file mode 100644 index 000000000000..8e309c305b20 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ListTablesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ListTablesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + java.util.List getTablesList(); + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + com.google.bigtable.admin.v2.Table getTables(int index); + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + int getTablesCount(); + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + java.util.List getTablesOrBuilderList(); + + /** + * + * + *
+   * The tables present in the requested instance.
+   * 
+ * + * repeated .google.bigtable.admin.v2.Table tables = 1; + */ + com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index); + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * Set if not all tables could be returned in a single response.
+   * Pass this value to `page_token` in another request to get the next
+   * page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java new file mode 100644 index 000000000000..cb19f479462e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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.admin.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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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 (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalView.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalView.java new file mode 100644 index 000000000000..dc1f53193f81 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalView.java @@ -0,0 +1,1104 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A SQL logical view object that can be referenced in SQL queries.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.LogicalView} + */ +@com.google.protobuf.Generated +public final class LogicalView extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.LogicalView) + LogicalViewOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogicalView"); + } + + // Use LogicalView.newBuilder() to construct. + private LogicalView(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LogicalView() { + name_ = ""; + query_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_LogicalView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_LogicalView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.LogicalView.class, + com.google.bigtable.admin.v2.LogicalView.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The unique name of the logical view.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+   * Identifier. The unique name of the logical view.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 QUERY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
+   * Required. The logical view's select query.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The logical view's select query.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The etag for this logical view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The etag for this logical view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELETION_PROTECTION_FIELD_NUMBER = 6; + private boolean deletionProtection_ = false; + + /** + * + * + *
+   * Optional. Set to true to make the LogicalView protected against deletion.
+   * 
+ * + * bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (deletionProtection_ != false) { + output.writeBool(6, deletionProtection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (deletionProtection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, deletionProtection_); + } + size += getUnknownFields().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.admin.v2.LogicalView)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.LogicalView other = (com.google.bigtable.admin.v2.LogicalView) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getDeletionProtection() != other.getDeletionProtection()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DELETION_PROTECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtection()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.LogicalView 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.admin.v2.LogicalView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.LogicalView 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.admin.v2.LogicalView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.LogicalView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.LogicalView parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.LogicalView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.LogicalView 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A SQL logical view object that can be referenced in SQL queries.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.LogicalView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.LogicalView) + com.google.bigtable.admin.v2.LogicalViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_LogicalView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_LogicalView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.LogicalView.class, + com.google.bigtable.admin.v2.LogicalView.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.LogicalView.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + query_ = ""; + etag_ = ""; + deletionProtection_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_LogicalView_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.LogicalView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView build() { + com.google.bigtable.admin.v2.LogicalView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView buildPartial() { + com.google.bigtable.admin.v2.LogicalView result = + new com.google.bigtable.admin.v2.LogicalView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.LogicalView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deletionProtection_ = deletionProtection_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.LogicalView) { + return mergeFrom((com.google.bigtable.admin.v2.LogicalView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.LogicalView other) { + if (other == com.google.bigtable.admin.v2.LogicalView.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDeletionProtection() != false) { + setDeletionProtection(other.getDeletionProtection()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 48: + { + deletionProtection_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The unique name of the logical view.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name of the logical view.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name of the logical view.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name of the logical view.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name of the logical view.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + + /** + * + * + *
+     * Required. The logical view's select query.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The logical view's select query.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The logical view's select query.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view's select query.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view's select query.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The etag for this logical view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this logical view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this logical view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this logical view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this logical view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean deletionProtection_; + + /** + * + * + *
+     * Optional. Set to true to make the LogicalView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + /** + * + * + *
+     * Optional. Set to true to make the LogicalView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The deletionProtection to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtection(boolean value) { + + deletionProtection_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set to true to make the LogicalView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtection() { + bitField0_ = (bitField0_ & ~0x00000008); + deletionProtection_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.LogicalView) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.LogicalView) + private static final com.google.bigtable.admin.v2.LogicalView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.LogicalView(); + } + + public static com.google.bigtable.admin.v2.LogicalView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogicalView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.LogicalView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewName.java new file mode 100644 index 000000000000..6f77ebe81576 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2026 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.admin.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 LogicalViewName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_LOGICAL_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/logicalViews/{logical_view}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String logicalView; + + @Deprecated + protected LogicalViewName() { + project = null; + instance = null; + logicalView = null; + } + + private LogicalViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + logicalView = Preconditions.checkNotNull(builder.getLogicalView()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getLogicalView() { + return logicalView; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogicalViewName of(String project, String instance, String logicalView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setLogicalView(logicalView) + .build(); + } + + public static String format(String project, String instance, String logicalView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setLogicalView(logicalView) + .build() + .toString(); + } + + public static LogicalViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_LOGICAL_VIEW.validatedMatch( + formattedString, "LogicalViewName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("logical_view")); + } + + 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 (LogicalViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_LOGICAL_VIEW.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); + } + if (logicalView != null) { + fieldMapBuilder.put("logical_view", logicalView); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_LOGICAL_VIEW.instantiate( + "project", project, "instance", instance, "logical_view", logicalView); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogicalViewName that = ((LogicalViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.logicalView, that.logicalView); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(logicalView); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/logicalViews/{logical_view}. */ + public static class Builder { + private String project; + private String instance; + private String logicalView; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getLogicalView() { + return logicalView; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setLogicalView(String logicalView) { + this.logicalView = logicalView; + return this; + } + + private Builder(LogicalViewName logicalViewName) { + this.project = logicalViewName.project; + this.instance = logicalViewName.instance; + this.logicalView = logicalViewName.logicalView; + } + + public LogicalViewName build() { + return new LogicalViewName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewOrBuilder.java new file mode 100644 index 000000000000..1ace53b9bc6e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface LogicalViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.LogicalView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The unique name of the logical view.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The unique name of the logical view.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The logical view's select query.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
+   * Required. The logical view's select query.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Optional. The etag for this logical view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The etag for this logical view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. Set to true to make the LogicalView protected against deletion.
+   * 
+ * + * bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The deletionProtection. + */ + boolean getDeletionProtection(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedView.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedView.java new file mode 100644 index 000000000000..87610aa1fb25 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedView.java @@ -0,0 +1,1119 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A materialized view object that can be referenced in SQL queries.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.MaterializedView} + */ +@com.google.protobuf.Generated +public final class MaterializedView extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.MaterializedView) + MaterializedViewOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaterializedView"); + } + + // Use MaterializedView.newBuilder() to construct. + private MaterializedView(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaterializedView() { + name_ = ""; + query_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_MaterializedView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_MaterializedView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.MaterializedView.class, + com.google.bigtable.admin.v2.MaterializedView.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The unique name of the materialized view.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+   * Identifier. The unique name of the materialized view.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 QUERY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
+   * Required. Immutable. The materialized view's select query.
+   * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The materialized view's select query.
+   * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The etag for this materialized view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The etag for this materialized view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELETION_PROTECTION_FIELD_NUMBER = 6; + private boolean deletionProtection_ = false; + + /** + * + * + *
+   * Set to true to make the MaterializedView protected against deletion.
+   * 
+ * + * bool deletion_protection = 6; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (deletionProtection_ != false) { + output.writeBool(6, deletionProtection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (deletionProtection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, deletionProtection_); + } + size += getUnknownFields().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.admin.v2.MaterializedView)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.MaterializedView other = + (com.google.bigtable.admin.v2.MaterializedView) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getDeletionProtection() != other.getDeletionProtection()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DELETION_PROTECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtection()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.MaterializedView 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.admin.v2.MaterializedView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.MaterializedView 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.admin.v2.MaterializedView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.MaterializedView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.MaterializedView 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A materialized view object that can be referenced in SQL queries.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.MaterializedView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.MaterializedView) + com.google.bigtable.admin.v2.MaterializedViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_MaterializedView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_MaterializedView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.MaterializedView.class, + com.google.bigtable.admin.v2.MaterializedView.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.MaterializedView.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + query_ = ""; + etag_ = ""; + deletionProtection_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_MaterializedView_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView build() { + com.google.bigtable.admin.v2.MaterializedView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView buildPartial() { + com.google.bigtable.admin.v2.MaterializedView result = + new com.google.bigtable.admin.v2.MaterializedView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.MaterializedView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deletionProtection_ = deletionProtection_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.MaterializedView) { + return mergeFrom((com.google.bigtable.admin.v2.MaterializedView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.MaterializedView other) { + if (other == com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDeletionProtection() != false) { + setDeletionProtection(other.getDeletionProtection()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 48: + { + deletionProtection_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The unique name of the materialized view.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name of the materialized view.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name of the materialized view.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name of the materialized view.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name of the materialized view.
+     * Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + + /** + * + * + *
+     * Required. Immutable. The materialized view's select query.
+     * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The materialized view's select query.
+     * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The materialized view's select query.
+     * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The materialized view's select query.
+     * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The materialized view's select query.
+     * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The etag for this materialized view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this materialized view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this materialized view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this materialized view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this materialized view.
+     * This may be sent on update requests to ensure that the client has an
+     * up-to-date value before proceeding. The server returns an ABORTED error on
+     * a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean deletionProtection_; + + /** + * + * + *
+     * Set to true to make the MaterializedView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + /** + * + * + *
+     * Set to true to make the MaterializedView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6; + * + * @param value The deletionProtection to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtection(boolean value) { + + deletionProtection_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true to make the MaterializedView protected against deletion.
+     * 
+ * + * bool deletion_protection = 6; + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtection() { + bitField0_ = (bitField0_ & ~0x00000008); + deletionProtection_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.MaterializedView) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.MaterializedView) + private static final com.google.bigtable.admin.v2.MaterializedView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.MaterializedView(); + } + + public static com.google.bigtable.admin.v2.MaterializedView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaterializedView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.MaterializedView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewName.java new file mode 100644 index 000000000000..1cc350e40abf --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2026 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.admin.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 MaterializedViewName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_MATERIALIZED_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/materializedViews/{materialized_view}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String materializedView; + + @Deprecated + protected MaterializedViewName() { + project = null; + instance = null; + materializedView = null; + } + + private MaterializedViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + materializedView = Preconditions.checkNotNull(builder.getMaterializedView()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getMaterializedView() { + return materializedView; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static MaterializedViewName of(String project, String instance, String materializedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setMaterializedView(materializedView) + .build(); + } + + public static String format(String project, String instance, String materializedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setMaterializedView(materializedView) + .build() + .toString(); + } + + public static MaterializedViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_MATERIALIZED_VIEW.validatedMatch( + formattedString, "MaterializedViewName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("materialized_view")); + } + + 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 (MaterializedViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_MATERIALIZED_VIEW.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); + } + if (materializedView != null) { + fieldMapBuilder.put("materialized_view", materializedView); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_MATERIALIZED_VIEW.instantiate( + "project", project, "instance", instance, "materialized_view", materializedView); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + MaterializedViewName that = ((MaterializedViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.materializedView, that.materializedView); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(materializedView); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/materializedViews/{materialized_view}. */ + public static class Builder { + private String project; + private String instance; + private String materializedView; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getMaterializedView() { + return materializedView; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setMaterializedView(String materializedView) { + this.materializedView = materializedView; + return this; + } + + private Builder(MaterializedViewName materializedViewName) { + this.project = materializedViewName.project; + this.instance = materializedViewName.instance; + this.materializedView = materializedViewName.materializedView; + } + + public MaterializedViewName build() { + return new MaterializedViewName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewOrBuilder.java new file mode 100644 index 000000000000..e96881ebd23f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface MaterializedViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.MaterializedView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The unique name of the materialized view.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The unique name of the materialized view.
+   * Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. The materialized view's select query.
+   * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
+   * Required. Immutable. The materialized view's select query.
+   * 
+ * + * + * string query = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Optional. The etag for this materialized view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The etag for this materialized view.
+   * This may be sent on update requests to ensure that the client has an
+   * up-to-date value before proceeding. The server returns an ABORTED error on
+   * a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Set to true to make the MaterializedView protected against deletion.
+   * 
+ * + * bool deletion_protection = 6; + * + * @return The deletionProtection. + */ + boolean getDeletionProtection(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java new file mode 100644 index 000000000000..5ea20e672c3d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java @@ -0,0 +1,3361 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest} + */ +@com.google.protobuf.Generated +public final class ModifyColumnFamiliesRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + ModifyColumnFamiliesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ModifyColumnFamiliesRequest"); + } + + // Use ModifyColumnFamiliesRequest.newBuilder() to construct. + private ModifyColumnFamiliesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ModifyColumnFamiliesRequest() { + name_ = ""; + modifications_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.class, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Builder.class); + } + + public interface ModificationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the column family to be modified.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + + /** + * + * + *
+     * The ID of the column family to be modified.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return Whether the create field is set. + */ + boolean hasCreate(); + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return The create. + */ + com.google.bigtable.admin.v2.ColumnFamily getCreate(); + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder(); + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return Whether the update field is set. + */ + boolean hasUpdate(); + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return The update. + */ + com.google.bigtable.admin.v2.ColumnFamily getUpdate(); + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder(); + + /** + * + * + *
+     * Drop (delete) the column family with the given ID, or fail if no such
+     * family exists.
+     * 
+ * + * bool drop = 4; + * + * @return Whether the drop field is set. + */ + boolean hasDrop(); + + /** + * + * + *
+     * Drop (delete) the column family with the given ID, or fail if no such
+     * family exists.
+     * 
+ * + * bool drop = 4; + * + * @return The drop. + */ + boolean getDrop(); + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.ModCase getModCase(); + } + + /** + * + * + *
+   * A create, update, or delete of a particular column family.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} + */ + public static final class Modification extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + ModificationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Modification"); + } + + // Use Modification.newBuilder() to construct. + private Modification(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Modification() { + id_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.class, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder.class); + } + + private int bitField0_; + private int modCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object mod_; + + public enum ModCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CREATE(2), + UPDATE(3), + DROP(4), + MOD_NOT_SET(0); + private final int value; + + private ModCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModCase valueOf(int value) { + return forNumber(value); + } + + public static ModCase forNumber(int value) { + switch (value) { + case 2: + return CREATE; + case 3: + return UPDATE; + case 4: + return DROP; + case 0: + return MOD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModCase getModCase() { + return ModCase.forNumber(modCase_); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + + /** + * + * + *
+     * The ID of the column family to be modified.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + + /** + * + * + *
+     * The ID of the column family to be modified.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_FIELD_NUMBER = 2; + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return Whether the create field is set. + */ + @java.lang.Override + public boolean hasCreate() { + return modCase_ == 2; + } + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return The create. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getCreate() { + if (modCase_ == 2) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + + /** + * + * + *
+     * Create a new column family with the specified schema, or fail if
+     * one already exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { + if (modCase_ == 2) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + + public static final int UPDATE_FIELD_NUMBER = 3; + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return Whether the update field is set. + */ + @java.lang.Override + public boolean hasUpdate() { + return modCase_ == 3; + } + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return The update. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getUpdate() { + if (modCase_ == 3) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + + /** + * + * + *
+     * Update an existing column family to the specified schema, or fail
+     * if no column family exists with the given ID.
+     * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { + if (modCase_ == 3) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + + public static final int DROP_FIELD_NUMBER = 4; + + /** + * + * + *
+     * Drop (delete) the column family with the given ID, or fail if no such
+     * family exists.
+     * 
+ * + * bool drop = 4; + * + * @return Whether the drop field is set. + */ + @java.lang.Override + public boolean hasDrop() { + return modCase_ == 4; + } + + /** + * + * + *
+     * Drop (delete) the column family with the given ID, or fail if no such
+     * family exists.
+     * 
+ * + * bool drop = 4; + * + * @return The drop. + */ + @java.lang.Override + public boolean getDrop() { + if (modCase_ == 4) { + return (java.lang.Boolean) mod_; + } + return false; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 6; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+     * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+     * mod should be updated, ignored for other modification types. If unset or
+     * empty, we treat it as updating `gc_rule` to be backward compatible.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); + } + if (modCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.admin.v2.ColumnFamily) mod_); + } + if (modCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.ColumnFamily) mod_); + } + if (modCase_ == 4) { + output.writeBool(4, (boolean) ((java.lang.Boolean) mod_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); + } + if (modCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.ColumnFamily) mod_); + } + if (modCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.ColumnFamily) mod_); + } + if (modCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, (boolean) ((java.lang.Boolean) mod_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.ModifyColumnFamiliesRequest.Modification)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification other = + (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) obj; + + if (!getId().equals(other.getId())) return false; + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getModCase().equals(other.getModCase())) return false; + switch (modCase_) { + case 2: + if (!getCreate().equals(other.getCreate())) return false; + break; + case 3: + if (!getUpdate().equals(other.getUpdate())) return false; + break; + case 4: + if (getDrop() != other.getDrop()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + switch (modCase_) { + case 2: + hash = (37 * hash) + CREATE_FIELD_NUMBER; + hash = (53 * hash) + getCreate().hashCode(); + break; + case 3: + hash = (37 * hash) + UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getUpdate().hashCode(); + break; + case 4: + hash = (37 * hash) + DROP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDrop()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification 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.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification 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.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ModifyColumnFamiliesRequest.Modification 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A create, update, or delete of a particular column family.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.class, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + .class); + } + + // Construct using + // com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + if (createBuilder_ != null) { + createBuilder_.clear(); + } + if (updateBuilder_ != null) { + updateBuilder_.clear(); + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + modCase_ = 0; + mod_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification build() { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification buildPartial() { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result = + new com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateMask_ = + updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result) { + result.modCase_ = modCase_; + result.mod_ = this.mod_; + if (modCase_ == 2 && createBuilder_ != null) { + result.mod_ = createBuilder_.build(); + } + if (modCase_ == 3 && updateBuilder_ != null) { + result.mod_ = updateBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) { + return mergeFrom( + (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification other) { + if (other + == com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + switch (other.getModCase()) { + case CREATE: + { + mergeCreate(other.getCreate()); + break; + } + case UPDATE: + { + mergeUpdate(other.getUpdate()); + break; + } + case DROP: + { + setDrop(other.getDrop()); + break; + } + case MOD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetCreateFieldBuilder().getBuilder(), extensionRegistry); + modCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetUpdateFieldBuilder().getBuilder(), extensionRegistry); + modCase_ = 3; + break; + } // case 26 + case 32: + { + mod_ = input.readBool(); + modCase_ = 4; + break; + } // case 32 + case 50: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int modCase_ = 0; + private java.lang.Object mod_; + + public ModCase getModCase() { + return ModCase.forNumber(modCase_); + } + + public Builder clearMod() { + modCase_ = 0; + mod_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + + /** + * + * + *
+       * The ID of the column family to be modified.
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The ID of the column family to be modified.
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The ID of the column family to be modified.
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the column family to be modified.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the column family to be modified.
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> + createBuilder_; + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return Whether the create field is set. + */ + @java.lang.Override + public boolean hasCreate() { + return modCase_ == 2; + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + * + * @return The create. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getCreate() { + if (createBuilder_ == null) { + if (modCase_ == 2) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } else { + if (modCase_ == 2) { + return createBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + public Builder setCreate(com.google.bigtable.admin.v2.ColumnFamily value) { + if (createBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mod_ = value; + onChanged(); + } else { + createBuilder_.setMessage(value); + } + modCase_ = 2; + return this; + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + public Builder setCreate(com.google.bigtable.admin.v2.ColumnFamily.Builder builderForValue) { + if (createBuilder_ == null) { + mod_ = builderForValue.build(); + onChanged(); + } else { + createBuilder_.setMessage(builderForValue.build()); + } + modCase_ = 2; + return this; + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + public Builder mergeCreate(com.google.bigtable.admin.v2.ColumnFamily value) { + if (createBuilder_ == null) { + if (modCase_ == 2 + && mod_ != com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()) { + mod_ = + com.google.bigtable.admin.v2.ColumnFamily.newBuilder( + (com.google.bigtable.admin.v2.ColumnFamily) mod_) + .mergeFrom(value) + .buildPartial(); + } else { + mod_ = value; + } + onChanged(); + } else { + if (modCase_ == 2) { + createBuilder_.mergeFrom(value); + } else { + createBuilder_.setMessage(value); + } + } + modCase_ = 2; + return this; + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + public Builder clearCreate() { + if (createBuilder_ == null) { + if (modCase_ == 2) { + modCase_ = 0; + mod_ = null; + onChanged(); + } + } else { + if (modCase_ == 2) { + modCase_ = 0; + mod_ = null; + } + createBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + public com.google.bigtable.admin.v2.ColumnFamily.Builder getCreateBuilder() { + return internalGetCreateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { + if ((modCase_ == 2) && (createBuilder_ != null)) { + return createBuilder_.getMessageOrBuilder(); + } else { + if (modCase_ == 2) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Create a new column family with the specified schema, or fail if
+       * one already exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily create = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> + internalGetCreateFieldBuilder() { + if (createBuilder_ == null) { + if (!(modCase_ == 2)) { + mod_ = com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + createBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder>( + (com.google.bigtable.admin.v2.ColumnFamily) mod_, + getParentForChildren(), + isClean()); + mod_ = null; + } + modCase_ = 2; + onChanged(); + return createBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> + updateBuilder_; + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return Whether the update field is set. + */ + @java.lang.Override + public boolean hasUpdate() { + return modCase_ == 3; + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + * + * @return The update. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getUpdate() { + if (updateBuilder_ == null) { + if (modCase_ == 3) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } else { + if (modCase_ == 3) { + return updateBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + public Builder setUpdate(com.google.bigtable.admin.v2.ColumnFamily value) { + if (updateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mod_ = value; + onChanged(); + } else { + updateBuilder_.setMessage(value); + } + modCase_ = 3; + return this; + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + public Builder setUpdate(com.google.bigtable.admin.v2.ColumnFamily.Builder builderForValue) { + if (updateBuilder_ == null) { + mod_ = builderForValue.build(); + onChanged(); + } else { + updateBuilder_.setMessage(builderForValue.build()); + } + modCase_ = 3; + return this; + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + public Builder mergeUpdate(com.google.bigtable.admin.v2.ColumnFamily value) { + if (updateBuilder_ == null) { + if (modCase_ == 3 + && mod_ != com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()) { + mod_ = + com.google.bigtable.admin.v2.ColumnFamily.newBuilder( + (com.google.bigtable.admin.v2.ColumnFamily) mod_) + .mergeFrom(value) + .buildPartial(); + } else { + mod_ = value; + } + onChanged(); + } else { + if (modCase_ == 3) { + updateBuilder_.mergeFrom(value); + } else { + updateBuilder_.setMessage(value); + } + } + modCase_ = 3; + return this; + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + public Builder clearUpdate() { + if (updateBuilder_ == null) { + if (modCase_ == 3) { + modCase_ = 0; + mod_ = null; + onChanged(); + } + } else { + if (modCase_ == 3) { + modCase_ = 0; + mod_ = null; + } + updateBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + public com.google.bigtable.admin.v2.ColumnFamily.Builder getUpdateBuilder() { + return internalGetUpdateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { + if ((modCase_ == 3) && (updateBuilder_ != null)) { + return updateBuilder_.getMessageOrBuilder(); + } else { + if (modCase_ == 3) { + return (com.google.bigtable.admin.v2.ColumnFamily) mod_; + } + return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Update an existing column family to the specified schema, or fail
+       * if no column family exists with the given ID.
+       * 
+ * + * .google.bigtable.admin.v2.ColumnFamily update = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> + internalGetUpdateFieldBuilder() { + if (updateBuilder_ == null) { + if (!(modCase_ == 3)) { + mod_ = com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); + } + updateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder>( + (com.google.bigtable.admin.v2.ColumnFamily) mod_, + getParentForChildren(), + isClean()); + mod_ = null; + } + modCase_ = 3; + onChanged(); + return updateBuilder_; + } + + /** + * + * + *
+       * Drop (delete) the column family with the given ID, or fail if no such
+       * family exists.
+       * 
+ * + * bool drop = 4; + * + * @return Whether the drop field is set. + */ + public boolean hasDrop() { + return modCase_ == 4; + } + + /** + * + * + *
+       * Drop (delete) the column family with the given ID, or fail if no such
+       * family exists.
+       * 
+ * + * bool drop = 4; + * + * @return The drop. + */ + public boolean getDrop() { + if (modCase_ == 4) { + return (java.lang.Boolean) mod_; + } + return false; + } + + /** + * + * + *
+       * Drop (delete) the column family with the given ID, or fail if no such
+       * family exists.
+       * 
+ * + * bool drop = 4; + * + * @param value The drop to set. + * @return This builder for chaining. + */ + public Builder setDrop(boolean value) { + + modCase_ = 4; + mod_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Drop (delete) the column family with the given ID, or fail if no such
+       * family exists.
+       * 
+ * + * bool drop = 4; + * + * @return This builder for chaining. + */ + public Builder clearDrop() { + if (modCase_ == 4) { + modCase_ = 0; + mod_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000010); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
+       * mod should be updated, ignored for other modification types. If unset or
+       * empty, we treat it as updating `gc_rule` to be backward compatible.
+       * 
+ * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) + private static final com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification(); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Modification parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ModifyColumnFamiliesRequest.Modification + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table whose families should be modified.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table whose families should be modified.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 MODIFICATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + modifications_; + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getModificationsList() { + return modifications_; + } + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder> + getModificationsOrBuilderList() { + return modifications_; + } + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getModificationsCount() { + return modifications_.size(); + } + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification getModifications( + int index) { + return modifications_.get(index); + } + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder + getModificationsOrBuilder(int index) { + return modifications_.get(index); + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * Optional. If true, ignore safety checks when modifying the column families.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < modifications_.size(); i++) { + output.writeMessage(2, modifications_.get(i)); + } + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < modifications_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, modifications_.get(i)); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.ModifyColumnFamiliesRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest other = + (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getModificationsList().equals(other.getModificationsList())) return false; + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getModificationsCount() > 0) { + hash = (37 * hash) + MODIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + getModificationsList().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest 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.admin.v2.ModifyColumnFamiliesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest 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.admin.v2.ModifyColumnFamiliesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ModifyColumnFamiliesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.class, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (modificationsBuilder_ == null) { + modifications_ = java.util.Collections.emptyList(); + } else { + modifications_ = null; + modificationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest build() { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest buildPartial() { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest result = + new com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest result) { + if (modificationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + modifications_ = java.util.Collections.unmodifiableList(modifications_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.modifications_ = modifications_; + } else { + result.modifications_ = modificationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) { + return mergeFrom((com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest other) { + if (other == com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (modificationsBuilder_ == null) { + if (!other.modifications_.isEmpty()) { + if (modifications_.isEmpty()) { + modifications_ = other.modifications_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureModificationsIsMutable(); + modifications_.addAll(other.modifications_); + } + onChanged(); + } + } else { + if (!other.modifications_.isEmpty()) { + if (modificationsBuilder_.isEmpty()) { + modificationsBuilder_.dispose(); + modificationsBuilder_ = null; + modifications_ = other.modifications_; + bitField0_ = (bitField0_ & ~0x00000002); + modificationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetModificationsFieldBuilder() + : null; + } else { + modificationsBuilder_.addAllMessages(other.modifications_); + } + } + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification m = + input.readMessage( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + .parser(), + extensionRegistry); + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + modifications_.add(m); + } else { + modificationsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table whose families should be modified.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table whose families should be modified.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table whose families should be modified.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table whose families should be modified.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table whose families should be modified.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + modifications_ = java.util.Collections.emptyList(); + + private void ensureModificationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + modifications_ = + new java.util.ArrayList< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification>( + modifications_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder> + modificationsBuilder_; + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getModificationsList() { + if (modificationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(modifications_); + } else { + return modificationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getModificationsCount() { + if (modificationsBuilder_ == null) { + return modifications_.size(); + } else { + return modificationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification getModifications( + int index) { + if (modificationsBuilder_ == null) { + return modifications_.get(index); + } else { + return modificationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModifications( + int index, com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification value) { + if (modificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModificationsIsMutable(); + modifications_.set(index, value); + onChanged(); + } else { + modificationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModifications( + int index, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + builderForValue) { + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + modifications_.set(index, builderForValue.build()); + onChanged(); + } else { + modificationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification value) { + if (modificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModificationsIsMutable(); + modifications_.add(value); + onChanged(); + } else { + modificationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModifications( + int index, com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification value) { + if (modificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModificationsIsMutable(); + modifications_.add(index, value); + onChanged(); + } else { + modificationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModifications( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + builderForValue) { + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + modifications_.add(builderForValue.build()); + onChanged(); + } else { + modificationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addModifications( + int index, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + builderForValue) { + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + modifications_.add(index, builderForValue.build()); + onChanged(); + } else { + modificationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllModifications( + java.lang.Iterable< + ? extends com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification> + values) { + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modifications_); + onChanged(); + } else { + modificationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearModifications() { + if (modificationsBuilder_ == null) { + modifications_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + modificationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeModifications(int index) { + if (modificationsBuilder_ == null) { + ensureModificationsIsMutable(); + modifications_.remove(index); + onChanged(); + } else { + modificationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + getModificationsBuilder(int index) { + return internalGetModificationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder + getModificationsOrBuilder(int index) { + if (modificationsBuilder_ == null) { + return modifications_.get(index); + } else { + return modificationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder> + getModificationsOrBuilderList() { + if (modificationsBuilder_ != null) { + return modificationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(modifications_); + } + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + addModificationsBuilder() { + return internalGetModificationsFieldBuilder() + .addBuilder( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + .getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder + addModificationsBuilder(int index) { + return internalGetModificationsFieldBuilder() + .addBuilder( + index, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification + .getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Modifications to be atomically applied to the specified table's
+     * families. Entries are applied in order, meaning that earlier modifications
+     * can be masked by later ones (in the case of repeated updates to the same
+     * family, for example).
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder> + getModificationsBuilderList() { + return internalGetModificationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder> + internalGetModificationsFieldBuilder() { + if (modificationsBuilder_ == null) { + modificationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder, + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder>( + modifications_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + modifications_ = null; + } + return modificationsBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * Optional. If true, ignore safety checks when modifying the column families.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * Optional. If true, ignore safety checks when modifying the column families.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If true, ignore safety checks when modifying the column families.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + private static final com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(); + } + + public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModifyColumnFamiliesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ModifyColumnFamiliesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java new file mode 100644 index 000000000000..c096a2992a1a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ModifyColumnFamiliesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ModifyColumnFamiliesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table whose families should be modified.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table whose families should be modified.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getModificationsList(); + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification getModifications(int index); + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getModificationsCount(); + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder> + getModificationsOrBuilderList(); + + /** + * + * + *
+   * Required. Modifications to be atomically applied to the specified table's
+   * families. Entries are applied in order, meaning that earlier modifications
+   * can be masked by later ones (in the case of repeated updates to the same
+   * family, for example).
+   * 
+ * + * + * repeated .google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification modifications = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.ModificationOrBuilder + getModificationsOrBuilder(int index); + + /** + * + * + *
+   * Optional. If true, ignore safety checks when modifying the column families.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java new file mode 100644 index 000000000000..36b3af1b9cdd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java @@ -0,0 +1,1076 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Encapsulates progress related information for a Cloud Bigtable long
+ * running operation.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.OperationProgress} + */ +@com.google.protobuf.Generated +public final class OperationProgress extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.OperationProgress) + OperationProgressOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationProgress"); + } + + // Use OperationProgress.newBuilder() to construct. + private OperationProgress(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationProgress() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.CommonProto + .internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.CommonProto + .internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.OperationProgress.class, + com.google.bigtable.admin.v2.OperationProgress.Builder.class); + } + + private int bitField0_; + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; + private int progressPercent_ = 0; + + /** + * + * + *
+   * Percent completion of the operation.
+   * Values are between 0 and 100 inclusive.
+   * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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 (progressPercent_ != 0) { + output.writeInt32(1, progressPercent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.OperationProgress)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.OperationProgress other = + (com.google.bigtable.admin.v2.OperationProgress) obj; + + if (getProgressPercent() != other.getProgressPercent()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OperationProgress 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.admin.v2.OperationProgress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OperationProgress 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.admin.v2.OperationProgress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OperationProgress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.OperationProgress 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Encapsulates progress related information for a Cloud Bigtable long
+   * running operation.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.OperationProgress} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.OperationProgress) + com.google.bigtable.admin.v2.OperationProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.CommonProto + .internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.CommonProto + .internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.OperationProgress.class, + com.google.bigtable.admin.v2.OperationProgress.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.OperationProgress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + progressPercent_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.CommonProto + .internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress build() { + com.google.bigtable.admin.v2.OperationProgress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress buildPartial() { + com.google.bigtable.admin.v2.OperationProgress result = + new com.google.bigtable.admin.v2.OperationProgress(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.OperationProgress result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.progressPercent_ = progressPercent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.OperationProgress) { + return mergeFrom((com.google.bigtable.admin.v2.OperationProgress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.OperationProgress other) { + if (other == com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) return this; + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + progressPercent_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int progressPercent_; + + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Percent completion of the operation.
+     * Values are between 0 and 100 inclusive.
+     * 
+ * + * int32 progress_percent = 1; + * + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + bitField0_ = (bitField0_ & ~0x00000001); + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * Time the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation failed or was completed
+     * successfully.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.OperationProgress) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.OperationProgress) + private static final com.google.bigtable.admin.v2.OperationProgress DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.OperationProgress(); + } + + public static com.google.bigtable.admin.v2.OperationProgress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationProgress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.OperationProgress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java new file mode 100644 index 000000000000..1ce9fdfd95d7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface OperationProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.OperationProgress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Percent completion of the operation.
+   * Values are between 0 and 100 inclusive.
+   * 
+ * + * int32 progress_percent = 1; + * + * @return The progressPercent. + */ + int getProgressPercent(); + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Time the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation failed or was completed
+   * successfully.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java new file mode 100644 index 000000000000..2212e8aaa6be --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java @@ -0,0 +1,896 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the long-running operation used to track the progress
+ * of optimizations performed on a newly restored table. This long-running
+ * operation is automatically created by the system after the successful
+ * completion of a table restore, and cannot be cancelled.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata} + */ +@com.google.protobuf.Generated +public final class OptimizeRestoredTableMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + OptimizeRestoredTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OptimizeRestoredTableMetadata"); + } + + // Use OptimizeRestoredTableMetadata.newBuilder() to construct. + private OptimizeRestoredTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OptimizeRestoredTableMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.class, + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the restored table being optimized.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * Name of the restored table being optimized.
+   * 
+ * + * string name = 1; + * + * @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 PROGRESS_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.OperationProgress progress_; + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + @java.lang.Override + public boolean hasProgress() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return The progress. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getProgress()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgress()); + } + size += getUnknownFields().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.admin.v2.OptimizeRestoredTableMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata other = + (com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.admin.v2.OptimizeRestoredTableMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.admin.v2.OptimizeRestoredTableMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.OptimizeRestoredTableMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the long-running operation used to track the progress
+   * of optimizations performed on a newly restored table. This long-running
+   * operation is automatically created by the system after the successful
+   * completion of a table restore, and cannot be cancelled.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.class, + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetProgressFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata build() { + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata buildPartial() { + com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result = + new com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.progress_ = progressBuilder_ == null ? progress_ : progressBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata other) { + if (other == com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetProgressFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the restored table being optimized.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * Name of the restored table being optimized.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * Name of the restored table being optimized.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the restored table being optimized.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the restored table being optimized.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + progressBuilder_; + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return The progress. + */ + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + } else { + progressBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public Builder setProgress( + com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && progress_ != null + && progress_ != com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) { + getProgressBuilder().mergeFrom(value); + } else { + progress_ = value; + } + } else { + progressBuilder_.mergeFrom(value); + } + if (progress_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public Builder clearProgress() { + bitField0_ = (bitField0_ & ~0x00000002); + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetProgressFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + } + + /** + * + * + *
+     * The progress of the post-restore optimizations.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + internalGetProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + private static final com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(); + } + + public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizeRestoredTableMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.OptimizeRestoredTableMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java new file mode 100644 index 000000000000..bddb1ee77dd6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface OptimizeRestoredTableMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the restored table being optimized.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the restored table being optimized.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + * + * @return The progress. + */ + com.google.bigtable.admin.v2.OperationProgress getProgress(); + + /** + * + * + *
+   * The progress of the post-restore optimizations.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 2; + */ + com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java new file mode 100644 index 000000000000..928b10c2c109 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java @@ -0,0 +1,1262 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by PartialUpdateCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateClusterMetadata} + */ +@com.google.protobuf.Generated +public final class PartialUpdateClusterMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.PartialUpdateClusterMetadata) + PartialUpdateClusterMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialUpdateClusterMetadata"); + } + + // Use PartialUpdateClusterMetadata.newBuilder() to construct. + private PartialUpdateClusterMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PartialUpdateClusterMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.class, + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 3; + private com.google.bigtable.admin.v2.PartialUpdateClusterRequest originalRequest_; + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance() + : originalRequest_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getFinishTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getOriginalRequest()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFinishTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOriginalRequest()); + } + size += getUnknownFields().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.admin.v2.PartialUpdateClusterMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata other = + (com.google.bigtable.admin.v2.PartialUpdateClusterMetadata) obj; + + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata 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.admin.v2.PartialUpdateClusterMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata 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.admin.v2.PartialUpdateClusterMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.PartialUpdateClusterMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by PartialUpdateCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateClusterMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.PartialUpdateClusterMetadata) + com.google.bigtable.admin.v2.PartialUpdateClusterMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.class, + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + internalGetOriginalRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterMetadata build() { + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterMetadata buildPartial() { + com.google.bigtable.admin.v2.PartialUpdateClusterMetadata result = + new com.google.bigtable.admin.v2.PartialUpdateClusterMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.PartialUpdateClusterMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.PartialUpdateClusterMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.PartialUpdateClusterMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateClusterMetadata other) { + if (other == com.google.bigtable.admin.v2.PartialUpdateClusterMetadata.getDefaultInstance()) + return this; + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000001); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000002); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + private com.google.bigtable.admin.v2.PartialUpdateClusterRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000004); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + public com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The original request for PartialUpdateCluster.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateClusterRequest, + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.PartialUpdateClusterMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.PartialUpdateClusterMetadata) + private static final com.google.bigtable.admin.v2.PartialUpdateClusterMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.PartialUpdateClusterMetadata(); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartialUpdateClusterMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.PartialUpdateClusterMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java new file mode 100644 index 000000000000..0d650f5e165b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface PartialUpdateClusterMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.PartialUpdateClusterMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.PartialUpdateClusterRequest getOriginalRequest(); + + /** + * + * + *
+   * The original request for PartialUpdateCluster.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; + */ + com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder getOriginalRequestOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java new file mode 100644 index 000000000000..61096bc7f0e8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.PartialUpdateCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateClusterRequest} + */ +@com.google.protobuf.Generated +public final class PartialUpdateClusterRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.PartialUpdateClusterRequest) + PartialUpdateClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialUpdateClusterRequest"); + } + + // Use PartialUpdateClusterRequest.newBuilder() to construct. + private PartialUpdateClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PartialUpdateClusterRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.class, + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder.class); + } + + private int bitField0_; + public static final int CLUSTER_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Cluster cluster_; + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getCluster() { + return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; + } + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCluster()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCluster()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.PartialUpdateClusterRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.PartialUpdateClusterRequest other = + (com.google.bigtable.admin.v2.PartialUpdateClusterRequest) obj; + + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster().equals(other.getCluster())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest 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.admin.v2.PartialUpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest 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.admin.v2.PartialUpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.PartialUpdateClusterRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.PartialUpdateCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.PartialUpdateClusterRequest) + com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.class, + com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.PartialUpdateClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest build() { + com.google.bigtable.admin.v2.PartialUpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateClusterRequest buildPartial() { + com.google.bigtable.admin.v2.PartialUpdateClusterRequest result = + new com.google.bigtable.admin.v2.PartialUpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.PartialUpdateClusterRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.PartialUpdateClusterRequest) { + return mergeFrom((com.google.bigtable.admin.v2.PartialUpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateClusterRequest other) { + if (other == com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance()) + return this; + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + clusterBuilder_; + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.bigtable.admin.v2.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.bigtable.admin.v2.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.bigtable.admin.v2.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && cluster_ != null + && cluster_ != com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + if (cluster_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000001); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetClusterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : cluster_; + } + } + + /** + * + * + *
+     * Required. The Cluster which contains the partial updates to be applied,
+     * subject to the update_mask.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + internalGetClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. The subset of Cluster fields which should be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.PartialUpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.PartialUpdateClusterRequest) + private static final com.google.bigtable.admin.v2.PartialUpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.PartialUpdateClusterRequest(); + } + + public static com.google.bigtable.admin.v2.PartialUpdateClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartialUpdateClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.PartialUpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..e4fcb7e063df --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface PartialUpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.PartialUpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.bigtable.admin.v2.Cluster getCluster(); + + /** + * + * + *
+   * Required. The Cluster which contains the partial updates to be applied,
+   * subject to the update_mask.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. The subset of Cluster fields which should be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java new file mode 100644 index 000000000000..23753169b2b9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java @@ -0,0 +1,1024 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.PartialUpdateInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateInstanceRequest} + */ +@com.google.protobuf.Generated +public final class PartialUpdateInstanceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.PartialUpdateInstanceRequest) + PartialUpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialUpdateInstanceRequest"); + } + + // Use PartialUpdateInstanceRequest.newBuilder() to construct. + private PartialUpdateInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PartialUpdateInstanceRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.class, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int INSTANCE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Instance instance_; + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Instance getInstance() { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInstance()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInstance()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.PartialUpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest other = + (com.google.bigtable.admin.v2.PartialUpdateInstanceRequest) obj; + + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest 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.admin.v2.PartialUpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest 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.admin.v2.PartialUpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.PartialUpdateInstanceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.PartialUpdateInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.PartialUpdateInstanceRequest) + com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.class, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInstanceFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest build() { + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest buildPartial() { + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest result = + new com.google.bigtable.admin.v2.PartialUpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.PartialUpdateInstanceRequest) { + return mergeFrom((com.google.bigtable.admin.v2.PartialUpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest other) { + if (other == com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Instance instance_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + instanceBuilder_; + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.bigtable.admin.v2.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && instance_ != null + && instance_ != com.google.bigtable.admin.v2.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000001); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetInstanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; + } + } + + /** + * + * + *
+     * Required. The Instance which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder> + internalGetInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Instance, + com.google.bigtable.admin.v2.Instance.Builder, + com.google.bigtable.admin.v2.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. The subset of Instance fields which should be replaced.
+     * Must be explicitly set.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.PartialUpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.PartialUpdateInstanceRequest) + private static final com.google.bigtable.admin.v2.PartialUpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.PartialUpdateInstanceRequest(); + } + + public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartialUpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.PartialUpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..52250b188aa0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface PartialUpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.PartialUpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.bigtable.admin.v2.Instance getInstance(); + + /** + * + * + *
+   * Required. The Instance which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. The subset of Instance fields which should be replaced.
+   * Must be explicitly set.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java new file mode 100644 index 000000000000..b90dd1f26a92 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 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.admin.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 ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + 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 (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + this.project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchema.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchema.java new file mode 100644 index 000000000000..bdd6976f5653 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchema.java @@ -0,0 +1,561 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Represents a protobuf schema.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ProtoSchema} + */ +@com.google.protobuf.Generated +public final class ProtoSchema extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ProtoSchema) + ProtoSchemaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProtoSchema"); + } + + // Use ProtoSchema.newBuilder() to construct. + private ProtoSchema(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ProtoSchema() { + protoDescriptors_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ProtoSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ProtoSchema.class, + com.google.bigtable.admin.v2.ProtoSchema.Builder.class); + } + + public static final int PROTO_DESCRIPTORS_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString protoDescriptors_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. Contains a protobuf-serialized
+   * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
+   * which could include multiple proto files.
+   * To generate it, [install](https://grpc.io/docs/protoc-installation/) and
+   * run `protoc` with
+   * `--include_imports` and `--descriptor_set_out`. For example, to generate
+   * for moon/shot/app.proto, run
+   * ```
+   * $protoc  --proto_path=/app_path --proto_path=/lib_path \
+   * --include_imports \
+   * --descriptor_set_out=descriptors.pb \
+   * moon/shot/app.proto
+   * ```
+   * For more details, see protobuffer [self
+   * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
+   * 
+ * + * bytes proto_descriptors = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The protoDescriptors. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProtoDescriptors() { + return protoDescriptors_; + } + + 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 (!protoDescriptors_.isEmpty()) { + output.writeBytes(2, protoDescriptors_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!protoDescriptors_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, protoDescriptors_); + } + size += getUnknownFields().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.admin.v2.ProtoSchema)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.ProtoSchema other = (com.google.bigtable.admin.v2.ProtoSchema) obj; + + if (!getProtoDescriptors().equals(other.getProtoDescriptors())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROTO_DESCRIPTORS_FIELD_NUMBER; + hash = (53 * hash) + getProtoDescriptors().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ProtoSchema 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.admin.v2.ProtoSchema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ProtoSchema 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.admin.v2.ProtoSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.ProtoSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.ProtoSchema 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents a protobuf schema.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.ProtoSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.ProtoSchema) + com.google.bigtable.admin.v2.ProtoSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ProtoSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.ProtoSchema.class, + com.google.bigtable.admin.v2.ProtoSchema.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.ProtoSchema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + protoDescriptors_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchema getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchema build() { + com.google.bigtable.admin.v2.ProtoSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchema buildPartial() { + com.google.bigtable.admin.v2.ProtoSchema result = + new com.google.bigtable.admin.v2.ProtoSchema(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.ProtoSchema result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.protoDescriptors_ = protoDescriptors_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.ProtoSchema) { + return mergeFrom((com.google.bigtable.admin.v2.ProtoSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.ProtoSchema other) { + if (other == com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance()) return this; + if (!other.getProtoDescriptors().isEmpty()) { + setProtoDescriptors(other.getProtoDescriptors()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + protoDescriptors_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString protoDescriptors_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. Contains a protobuf-serialized
+     * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
+     * which could include multiple proto files.
+     * To generate it, [install](https://grpc.io/docs/protoc-installation/) and
+     * run `protoc` with
+     * `--include_imports` and `--descriptor_set_out`. For example, to generate
+     * for moon/shot/app.proto, run
+     * ```
+     * $protoc  --proto_path=/app_path --proto_path=/lib_path \
+     * --include_imports \
+     * --descriptor_set_out=descriptors.pb \
+     * moon/shot/app.proto
+     * ```
+     * For more details, see protobuffer [self
+     * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
+     * 
+ * + * bytes proto_descriptors = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The protoDescriptors. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProtoDescriptors() { + return protoDescriptors_; + } + + /** + * + * + *
+     * Required. Contains a protobuf-serialized
+     * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
+     * which could include multiple proto files.
+     * To generate it, [install](https://grpc.io/docs/protoc-installation/) and
+     * run `protoc` with
+     * `--include_imports` and `--descriptor_set_out`. For example, to generate
+     * for moon/shot/app.proto, run
+     * ```
+     * $protoc  --proto_path=/app_path --proto_path=/lib_path \
+     * --include_imports \
+     * --descriptor_set_out=descriptors.pb \
+     * moon/shot/app.proto
+     * ```
+     * For more details, see protobuffer [self
+     * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
+     * 
+ * + * bytes proto_descriptors = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The protoDescriptors to set. + * @return This builder for chaining. + */ + public Builder setProtoDescriptors(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + protoDescriptors_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Contains a protobuf-serialized
+     * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
+     * which could include multiple proto files.
+     * To generate it, [install](https://grpc.io/docs/protoc-installation/) and
+     * run `protoc` with
+     * `--include_imports` and `--descriptor_set_out`. For example, to generate
+     * for moon/shot/app.proto, run
+     * ```
+     * $protoc  --proto_path=/app_path --proto_path=/lib_path \
+     * --include_imports \
+     * --descriptor_set_out=descriptors.pb \
+     * moon/shot/app.proto
+     * ```
+     * For more details, see protobuffer [self
+     * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
+     * 
+ * + * bytes proto_descriptors = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProtoDescriptors() { + bitField0_ = (bitField0_ & ~0x00000001); + protoDescriptors_ = getDefaultInstance().getProtoDescriptors(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ProtoSchema) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.ProtoSchema) + private static final com.google.bigtable.admin.v2.ProtoSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.ProtoSchema(); + } + + public static com.google.bigtable.admin.v2.ProtoSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProtoSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.ProtoSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchemaOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchemaOrBuilder.java new file mode 100644 index 000000000000..4fed01de1312 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchemaOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface ProtoSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.ProtoSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Contains a protobuf-serialized
+   * [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),
+   * which could include multiple proto files.
+   * To generate it, [install](https://grpc.io/docs/protoc-installation/) and
+   * run `protoc` with
+   * `--include_imports` and `--descriptor_set_out`. For example, to generate
+   * for moon/shot/app.proto, run
+   * ```
+   * $protoc  --proto_path=/app_path --proto_path=/lib_path \
+   * --include_imports \
+   * --descriptor_set_out=descriptors.pb \
+   * moon/shot/app.proto
+   * ```
+   * For more details, see protobuffer [self
+   * description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
+   * 
+ * + * bytes proto_descriptors = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The protoDescriptors. + */ + com.google.protobuf.ByteString getProtoDescriptors(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java new file mode 100644 index 000000000000..d47d28bedcc4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java @@ -0,0 +1,964 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Information about a table restore.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreInfo} + */ +@com.google.protobuf.Generated +public final class RestoreInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.RestoreInfo) + RestoreInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreInfo"); + } + + // Use RestoreInfo.newBuilder() to construct. + private RestoreInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestoreInfo() { + sourceType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreInfo.class, + com.google.bigtable.admin.v2.RestoreInfo.Builder.class); + } + + private int sourceInfoCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object sourceInfo_; + + public enum SourceInfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_INFO(2), + SOURCEINFO_NOT_SET(0); + private final int value; + + private SourceInfoCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceInfoCase valueOf(int value) { + return forNumber(value); + } + + public static SourceInfoCase forNumber(int value) { + switch (value) { + case 2: + return BACKUP_INFO; + case 0: + return SOURCEINFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public static final int SOURCE_TYPE_FIELD_NUMBER = 1; + private int sourceType_ = 0; + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { + com.google.bigtable.admin.v2.RestoreSourceType result = + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); + return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; + } + + public static final int BACKUP_INFO_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + @java.lang.Override + public boolean hasBackupInfo() { + return sourceInfoCase_ == 2; + } + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { + if (sourceInfoCase_ == 2) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if (sourceInfoCase_ == 2) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + + 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 (sourceType_ + != com.google.bigtable.admin.v2.RestoreSourceType.RESTORE_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, sourceType_); + } + if (sourceInfoCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceType_ + != com.google.bigtable.admin.v2.RestoreSourceType.RESTORE_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sourceType_); + } + if (sourceInfoCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); + } + size += getUnknownFields().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.admin.v2.RestoreInfo)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.RestoreInfo other = (com.google.bigtable.admin.v2.RestoreInfo) obj; + + if (sourceType_ != other.sourceType_) return false; + if (!getSourceInfoCase().equals(other.getSourceInfoCase())) return false; + switch (sourceInfoCase_) { + case 2: + if (!getBackupInfo().equals(other.getBackupInfo())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + switch (sourceInfoCase_) { + case 2: + hash = (37 * hash) + BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getBackupInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreInfo 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.admin.v2.RestoreInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreInfo 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.admin.v2.RestoreInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.RestoreInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information about a table restore.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.RestoreInfo) + com.google.bigtable.admin.v2.RestoreInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreInfo.class, + com.google.bigtable.admin.v2.RestoreInfo.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.RestoreInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sourceType_ = 0; + if (backupInfoBuilder_ != null) { + backupInfoBuilder_.clear(); + } + sourceInfoCase_ = 0; + sourceInfo_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfo getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfo build() { + com.google.bigtable.admin.v2.RestoreInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfo buildPartial() { + com.google.bigtable.admin.v2.RestoreInfo result = + new com.google.bigtable.admin.v2.RestoreInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.RestoreInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sourceType_ = sourceType_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreInfo result) { + result.sourceInfoCase_ = sourceInfoCase_; + result.sourceInfo_ = this.sourceInfo_; + if (sourceInfoCase_ == 2 && backupInfoBuilder_ != null) { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.RestoreInfo) { + return mergeFrom((com.google.bigtable.admin.v2.RestoreInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreInfo other) { + if (other == com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance()) return this; + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + switch (other.getSourceInfoCase()) { + case BACKUP_INFO: + { + mergeBackupInfo(other.getBackupInfo()); + break; + } + case SOURCEINFO_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + sourceType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + sourceInfoCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public Builder clearSourceInfo() { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int sourceType_ = 0; + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { + com.google.bigtable.admin.v2.RestoreSourceType result = + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); + return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000001); + sourceType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + backupInfoBuilder_; + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + @java.lang.Override + public boolean hasBackupInfo() { + return sourceInfoCase_ == 2; + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } else { + if (sourceInfoCase_ == 2) { + return backupInfoBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInfo_ = value; + onChanged(); + } else { + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 2; + return this; + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo.Builder builderForValue) { + if (backupInfoBuilder_ == null) { + sourceInfo_ = builderForValue.build(); + onChanged(); + } else { + backupInfoBuilder_.setMessage(builderForValue.build()); + } + sourceInfoCase_ = 2; + return this; + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + public Builder mergeBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2 + && sourceInfo_ != com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance()) { + sourceInfo_ = + com.google.bigtable.admin.v2.BackupInfo.newBuilder( + (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceInfo_ = value; + } + onChanged(); + } else { + if (sourceInfoCase_ == 2) { + backupInfoBuilder_.mergeFrom(value); + } else { + backupInfoBuilder_.setMessage(value); + } + } + sourceInfoCase_ = 2; + return this; + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + public Builder clearBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 2) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + } + } else { + if (sourceInfoCase_ == 2) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + } + backupInfoBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + public com.google.bigtable.admin.v2.BackupInfo.Builder getBackupInfoBuilder() { + return internalGetBackupInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if ((sourceInfoCase_ == 2) && (backupInfoBuilder_ != null)) { + return backupInfoBuilder_.getMessageOrBuilder(); + } else { + if (sourceInfoCase_ == 2) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Information about the backup used to restore the table. The backup
+     * may no longer exist.
+     * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + internalGetBackupInfoFieldBuilder() { + if (backupInfoBuilder_ == null) { + if (!(sourceInfoCase_ == 2)) { + sourceInfo_ = com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + backupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder>( + (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_, + getParentForChildren(), + isClean()); + sourceInfo_ = null; + } + sourceInfoCase_ = 2; + onChanged(); + return backupInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.RestoreInfo) + private static final com.google.bigtable.admin.v2.RestoreInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.RestoreInfo(); + } + + public static com.google.bigtable.admin.v2.RestoreInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.RestoreInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java new file mode 100644 index 000000000000..dd83ac54b2ed --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface RestoreInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.RestoreInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 1; + * + * @return The sourceType. + */ + com.google.bigtable.admin.v2.RestoreSourceType getSourceType(); + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return Whether the backupInfo field is set. + */ + boolean hasBackupInfo(); + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + * + * @return The backupInfo. + */ + com.google.bigtable.admin.v2.BackupInfo getBackupInfo(); + + /** + * + * + *
+   * Information about the backup used to restore the table. The backup
+   * may no longer exist.
+   * 
+ * + * .google.bigtable.admin.v2.BackupInfo backup_info = 2; + */ + com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder(); + + com.google.bigtable.admin.v2.RestoreInfo.SourceInfoCase getSourceInfoCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java new file mode 100644 index 000000000000..3ce2642b54ef --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java @@ -0,0 +1,170 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Indicates the type of the restore source.
+ * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.RestoreSourceType} + */ +@com.google.protobuf.Generated +public enum RestoreSourceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No restore associated.
+   * 
+ * + * RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + */ + RESTORE_SOURCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * A backup was used as the source of the restore.
+   * 
+ * + * BACKUP = 1; + */ + BACKUP(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreSourceType"); + } + + /** + * + * + *
+   * No restore associated.
+   * 
+ * + * RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + */ + public static final int RESTORE_SOURCE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * A backup was used as the source of the restore.
+   * 
+ * + * BACKUP = 1; + */ + public static final int BACKUP_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RestoreSourceType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RestoreSourceType forNumber(int value) { + switch (value) { + case 0: + return RESTORE_SOURCE_TYPE_UNSPECIFIED; + case 1: + return BACKUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RestoreSourceType findValueByNumber(int number) { + return RestoreSourceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto.getDescriptor().getEnumTypes().get(0); + } + + private static final RestoreSourceType[] VALUES = values(); + + public static RestoreSourceType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RestoreSourceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.RestoreSourceType) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java new file mode 100644 index 000000000000..fd48902b00aa --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java @@ -0,0 +1,1621 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the long-running operation returned by
+ * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreTableMetadata} + */ +@com.google.protobuf.Generated +public final class RestoreTableMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.RestoreTableMetadata) + RestoreTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreTableMetadata"); + } + + // Use RestoreTableMetadata.newBuilder() to construct. + private RestoreTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestoreTableMetadata() { + name_ = ""; + sourceType_ = 0; + optimizeTableOperationName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreTableMetadata.class, + com.google.bigtable.admin.v2.RestoreTableMetadata.Builder.class); + } + + private int bitField0_; + private int sourceInfoCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object sourceInfo_; + + public enum SourceInfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP_INFO(3), + SOURCEINFO_NOT_SET(0); + private final int value; + + private SourceInfoCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceInfoCase valueOf(int value) { + return forNumber(value); + } + + public static SourceInfoCase forNumber(int value) { + switch (value) { + case 3: + return BACKUP_INFO; + case 0: + return SOURCEINFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Name of the table being created and restored to.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * Name of the table being created and restored to.
+   * 
+ * + * string name = 1; + * + * @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 SOURCE_TYPE_FIELD_NUMBER = 2; + private int sourceType_ = 0; + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { + com.google.bigtable.admin.v2.RestoreSourceType result = + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); + return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; + } + + public static final int BACKUP_INFO_FIELD_NUMBER = 3; + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + @java.lang.Override + public boolean hasBackupInfo() { + return sourceInfoCase_ == 3; + } + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { + if (sourceInfoCase_ == 3) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if (sourceInfoCase_ == 3) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + + public static final int OPTIMIZE_TABLE_OPERATION_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object optimizeTableOperationName_ = ""; + + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored table. The metadata type of the long-running operation is
+   * [OptimizeRestoreTableMetadata][]. The response type is
+   * [Empty][google.protobuf.Empty]. This long-running operation may be
+   * automatically created by the system if applicable after the
+   * RestoreTable long-running operation completes successfully. This operation
+   * may not be created if the table is already optimized or the restore was
+   * not successful.
+   * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The optimizeTableOperationName. + */ + @java.lang.Override + public java.lang.String getOptimizeTableOperationName() { + java.lang.Object ref = optimizeTableOperationName_; + 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(); + optimizeTableOperationName_ = s; + return s; + } + } + + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored table. The metadata type of the long-running operation is
+   * [OptimizeRestoreTableMetadata][]. The response type is
+   * [Empty][google.protobuf.Empty]. This long-running operation may be
+   * automatically created by the system if applicable after the
+   * RestoreTable long-running operation completes successfully. This operation
+   * may not be created if the table is already optimized or the restore was
+   * not successful.
+   * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The bytes for optimizeTableOperationName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { + java.lang.Object ref = optimizeTableOperationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizeTableOperationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROGRESS_FIELD_NUMBER = 5; + private com.google.bigtable.admin.v2.OperationProgress progress_; + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return Whether the progress field is set. + */ + @java.lang.Override + public boolean hasProgress() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return The progress. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (sourceType_ + != com.google.bigtable.admin.v2.RestoreSourceType.RESTORE_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, sourceType_); + } + if (sourceInfoCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(optimizeTableOperationName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, optimizeTableOperationName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getProgress()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (sourceType_ + != com.google.bigtable.admin.v2.RestoreSourceType.RESTORE_SOURCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, sourceType_); + } + if (sourceInfoCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(optimizeTableOperationName_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(4, optimizeTableOperationName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getProgress()); + } + size += getUnknownFields().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.admin.v2.RestoreTableMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.RestoreTableMetadata other = + (com.google.bigtable.admin.v2.RestoreTableMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (sourceType_ != other.sourceType_) return false; + if (!getOptimizeTableOperationName().equals(other.getOptimizeTableOperationName())) + return false; + if (hasProgress() != other.hasProgress()) return false; + if (hasProgress()) { + if (!getProgress().equals(other.getProgress())) return false; + } + if (!getSourceInfoCase().equals(other.getSourceInfoCase())) return false; + switch (sourceInfoCase_) { + case 3: + if (!getBackupInfo().equals(other.getBackupInfo())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + hash = (37 * hash) + OPTIMIZE_TABLE_OPERATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOptimizeTableOperationName().hashCode(); + if (hasProgress()) { + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress().hashCode(); + } + switch (sourceInfoCase_) { + case 3: + hash = (37 * hash) + BACKUP_INFO_FIELD_NUMBER; + hash = (53 * hash) + getBackupInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata 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.admin.v2.RestoreTableMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata 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.admin.v2.RestoreTableMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.RestoreTableMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the long-running operation returned by
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreTableMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.RestoreTableMetadata) + com.google.bigtable.admin.v2.RestoreTableMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreTableMetadata.class, + com.google.bigtable.admin.v2.RestoreTableMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.RestoreTableMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetProgressFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sourceType_ = 0; + if (backupInfoBuilder_ != null) { + backupInfoBuilder_.clear(); + } + optimizeTableOperationName_ = ""; + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + sourceInfoCase_ = 0; + sourceInfo_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.RestoreTableMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableMetadata build() { + com.google.bigtable.admin.v2.RestoreTableMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableMetadata buildPartial() { + com.google.bigtable.admin.v2.RestoreTableMetadata result = + new com.google.bigtable.admin.v2.RestoreTableMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.RestoreTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceType_ = sourceType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.optimizeTableOperationName_ = optimizeTableOperationName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.progress_ = progressBuilder_ == null ? progress_ : progressBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreTableMetadata result) { + result.sourceInfoCase_ = sourceInfoCase_; + result.sourceInfo_ = this.sourceInfo_; + if (sourceInfoCase_ == 3 && backupInfoBuilder_ != null) { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.RestoreTableMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.RestoreTableMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableMetadata other) { + if (other == com.google.bigtable.admin.v2.RestoreTableMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.sourceType_ != 0) { + setSourceTypeValue(other.getSourceTypeValue()); + } + if (!other.getOptimizeTableOperationName().isEmpty()) { + optimizeTableOperationName_ = other.optimizeTableOperationName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasProgress()) { + mergeProgress(other.getProgress()); + } + switch (other.getSourceInfoCase()) { + case BACKUP_INFO: + { + mergeBackupInfo(other.getBackupInfo()); + break; + } + case SOURCEINFO_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + sourceType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + sourceInfoCase_ = 3; + break; + } // case 26 + case 34: + { + optimizeTableOperationName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetProgressFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceInfoCase_ = 0; + private java.lang.Object sourceInfo_; + + public SourceInfoCase getSourceInfoCase() { + return SourceInfoCase.forNumber(sourceInfoCase_); + } + + public Builder clearSourceInfo() { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Name of the table being created and restored to.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * Name of the table being created and restored to.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * Name of the table being created and restored to.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the table being created and restored to.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the table being created and restored to.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int sourceType_ = 0; + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + @java.lang.Override + public int getSourceTypeValue() { + return sourceType_; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @param value The enum numeric value on the wire for sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceTypeValue(int value) { + sourceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { + com.google.bigtable.admin.v2.RestoreSourceType result = + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); + return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @param value The sourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + sourceType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the restore source.
+     * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000002); + sourceType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + backupInfoBuilder_; + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + @java.lang.Override + public boolean hasBackupInfo() { + return sourceInfoCase_ == 3; + } + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } else { + if (sourceInfoCase_ == 3) { + return backupInfoBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceInfo_ = value; + onChanged(); + } else { + backupInfoBuilder_.setMessage(value); + } + sourceInfoCase_ = 3; + return this; + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo.Builder builderForValue) { + if (backupInfoBuilder_ == null) { + sourceInfo_ = builderForValue.build(); + onChanged(); + } else { + backupInfoBuilder_.setMessage(builderForValue.build()); + } + sourceInfoCase_ = 3; + return this; + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + public Builder mergeBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3 + && sourceInfo_ != com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance()) { + sourceInfo_ = + com.google.bigtable.admin.v2.BackupInfo.newBuilder( + (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceInfo_ = value; + } + onChanged(); + } else { + if (sourceInfoCase_ == 3) { + backupInfoBuilder_.mergeFrom(value); + } else { + backupInfoBuilder_.setMessage(value); + } + } + sourceInfoCase_ = 3; + return this; + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + public Builder clearBackupInfo() { + if (backupInfoBuilder_ == null) { + if (sourceInfoCase_ == 3) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + onChanged(); + } + } else { + if (sourceInfoCase_ == 3) { + sourceInfoCase_ = 0; + sourceInfo_ = null; + } + backupInfoBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + public com.google.bigtable.admin.v2.BackupInfo.Builder getBackupInfoBuilder() { + return internalGetBackupInfoFieldBuilder().getBuilder(); + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() { + if ((sourceInfoCase_ == 3) && (backupInfoBuilder_ != null)) { + return backupInfoBuilder_.getMessageOrBuilder(); + } else { + if (sourceInfoCase_ == 3) { + return (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_; + } + return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + } + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + internalGetBackupInfoFieldBuilder() { + if (backupInfoBuilder_ == null) { + if (!(sourceInfoCase_ == 3)) { + sourceInfo_ = com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); + } + backupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder>( + (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_, + getParentForChildren(), + isClean()); + sourceInfo_ = null; + } + sourceInfoCase_ = 3; + onChanged(); + return backupInfoBuilder_; + } + + private java.lang.Object optimizeTableOperationName_ = ""; + + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored table. The metadata type of the long-running operation is
+     * [OptimizeRestoreTableMetadata][]. The response type is
+     * [Empty][google.protobuf.Empty]. This long-running operation may be
+     * automatically created by the system if applicable after the
+     * RestoreTable long-running operation completes successfully. This operation
+     * may not be created if the table is already optimized or the restore was
+     * not successful.
+     * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The optimizeTableOperationName. + */ + public java.lang.String getOptimizeTableOperationName() { + java.lang.Object ref = optimizeTableOperationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + optimizeTableOperationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored table. The metadata type of the long-running operation is
+     * [OptimizeRestoreTableMetadata][]. The response type is
+     * [Empty][google.protobuf.Empty]. This long-running operation may be
+     * automatically created by the system if applicable after the
+     * RestoreTable long-running operation completes successfully. This operation
+     * may not be created if the table is already optimized or the restore was
+     * not successful.
+     * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The bytes for optimizeTableOperationName. + */ + public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { + java.lang.Object ref = optimizeTableOperationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizeTableOperationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored table. The metadata type of the long-running operation is
+     * [OptimizeRestoreTableMetadata][]. The response type is
+     * [Empty][google.protobuf.Empty]. This long-running operation may be
+     * automatically created by the system if applicable after the
+     * RestoreTable long-running operation completes successfully. This operation
+     * may not be created if the table is already optimized or the restore was
+     * not successful.
+     * 
+ * + * string optimize_table_operation_name = 4; + * + * @param value The optimizeTableOperationName to set. + * @return This builder for chaining. + */ + public Builder setOptimizeTableOperationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored table. The metadata type of the long-running operation is
+     * [OptimizeRestoreTableMetadata][]. The response type is
+     * [Empty][google.protobuf.Empty]. This long-running operation may be
+     * automatically created by the system if applicable after the
+     * RestoreTable long-running operation completes successfully. This operation
+     * may not be created if the table is already optimized or the restore was
+     * not successful.
+     * 
+ * + * string optimize_table_operation_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearOptimizeTableOperationName() { + optimizeTableOperationName_ = getDefaultInstance().getOptimizeTableOperationName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * If exists, the name of the long-running operation that will be used to
+     * track the post-restore optimization process to optimize the performance of
+     * the restored table. The metadata type of the long-running operation is
+     * [OptimizeRestoreTableMetadata][]. The response type is
+     * [Empty][google.protobuf.Empty]. This long-running operation may be
+     * automatically created by the system if applicable after the
+     * RestoreTable long-running operation completes successfully. This operation
+     * may not be created if the table is already optimized or the restore was
+     * not successful.
+     * 
+ * + * string optimize_table_operation_name = 4; + * + * @param value The bytes for optimizeTableOperationName to set. + * @return This builder for chaining. + */ + public Builder setOptimizeTableOperationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.OperationProgress progress_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + progressBuilder_; + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return Whether the progress field is set. + */ + public boolean hasProgress() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return The progress. + */ + public com.google.bigtable.admin.v2.OperationProgress getProgress() { + if (progressBuilder_ == null) { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } else { + return progressBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progress_ = value; + } else { + progressBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public Builder setProgress( + com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) { + if (progressBuilder_ == null) { + progress_ = builderForValue.build(); + } else { + progressBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) { + if (progressBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && progress_ != null + && progress_ != com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) { + getProgressBuilder().mergeFrom(value); + } else { + progress_ = value; + } + } else { + progressBuilder_.mergeFrom(value); + } + if (progress_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public Builder clearProgress() { + bitField0_ = (bitField0_ & ~0x00000010); + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); + progressBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetProgressFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { + if (progressBuilder_ != null) { + return progressBuilder_.getMessageOrBuilder(); + } else { + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; + } + } + + /** + * + * + *
+     * The progress of the
+     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + internalGetProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder>( + getProgress(), getParentForChildren(), isClean()); + progress_ = null; + } + return progressBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreTableMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.RestoreTableMetadata) + private static final com.google.bigtable.admin.v2.RestoreTableMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.RestoreTableMetadata(); + } + + public static com.google.bigtable.admin.v2.RestoreTableMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreTableMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.RestoreTableMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java new file mode 100644 index 000000000000..1dde37589ceb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface RestoreTableMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.RestoreTableMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the table being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Name of the table being created and restored to.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The enum numeric value on the wire for sourceType. + */ + int getSourceTypeValue(); + + /** + * + * + *
+   * The type of the restore source.
+   * 
+ * + * .google.bigtable.admin.v2.RestoreSourceType source_type = 2; + * + * @return The sourceType. + */ + com.google.bigtable.admin.v2.RestoreSourceType getSourceType(); + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return Whether the backupInfo field is set. + */ + boolean hasBackupInfo(); + + /** + * .google.bigtable.admin.v2.BackupInfo backup_info = 3; + * + * @return The backupInfo. + */ + com.google.bigtable.admin.v2.BackupInfo getBackupInfo(); + + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ + com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder(); + + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored table. The metadata type of the long-running operation is
+   * [OptimizeRestoreTableMetadata][]. The response type is
+   * [Empty][google.protobuf.Empty]. This long-running operation may be
+   * automatically created by the system if applicable after the
+   * RestoreTable long-running operation completes successfully. This operation
+   * may not be created if the table is already optimized or the restore was
+   * not successful.
+   * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The optimizeTableOperationName. + */ + java.lang.String getOptimizeTableOperationName(); + + /** + * + * + *
+   * If exists, the name of the long-running operation that will be used to
+   * track the post-restore optimization process to optimize the performance of
+   * the restored table. The metadata type of the long-running operation is
+   * [OptimizeRestoreTableMetadata][]. The response type is
+   * [Empty][google.protobuf.Empty]. This long-running operation may be
+   * automatically created by the system if applicable after the
+   * RestoreTable long-running operation completes successfully. This operation
+   * may not be created if the table is already optimized or the restore was
+   * not successful.
+   * 
+ * + * string optimize_table_operation_name = 4; + * + * @return The bytes for optimizeTableOperationName. + */ + com.google.protobuf.ByteString getOptimizeTableOperationNameBytes(); + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return Whether the progress field is set. + */ + boolean hasProgress(); + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + * + * @return The progress. + */ + com.google.bigtable.admin.v2.OperationProgress getProgress(); + + /** + * + * + *
+   * The progress of the
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.OperationProgress progress = 5; + */ + com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder(); + + com.google.bigtable.admin.v2.RestoreTableMetadata.SourceInfoCase getSourceInfoCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java new file mode 100644 index 000000000000..dc3b557a5734 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java @@ -0,0 +1,1161 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreTableRequest} + */ +@com.google.protobuf.Generated +public final class RestoreTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.RestoreTableRequest) + RestoreTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreTableRequest"); + } + + // Use RestoreTableRequest.newBuilder() to construct. + private RestoreTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestoreTableRequest() { + parent_ = ""; + tableId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreTableRequest.class, + com.google.bigtable.admin.v2.RestoreTableRequest.Builder.class); + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BACKUP(3), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 3: + return BACKUP; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The name of the instance in which to create the restored
+   * table. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the instance in which to create the restored
+   * table. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableId_ = ""; + + /** + * + * + *
+   * Required. The id of the table to create and restore to. This
+   * table must not already exist. The `table_id` appended to
+   * `parent` forms the full table name of the form
+   * `projects/<project>/instances/<instance>/tables/<table_id>`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + @java.lang.Override + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + 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(); + tableId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The id of the table to create and restore to. This
+   * table must not already exist. The `table_id` appended to
+   * `parent` forms the full table name of the form
+   * `projects/<project>/instances/<instance>/tables/<table_id>`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BACKUP_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return sourceCase_ == 3; + } + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + public java.lang.String getBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + 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(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); + } + if (sourceCase_ == 3) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, source_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); + } + if (sourceCase_ == 3) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, source_); + } + size += getUnknownFields().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.admin.v2.RestoreTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.RestoreTableRequest other = + (com.google.bigtable.admin.v2.RestoreTableRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getTableId().equals(other.getTableId())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 3: + if (!getBackup().equals(other.getBackup())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + TABLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTableId().hashCode(); + switch (sourceCase_) { + case 3: + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest 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.admin.v2.RestoreTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest 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.admin.v2.RestoreTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.RestoreTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.RestoreTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.RestoreTableRequest) + com.google.bigtable.admin.v2.RestoreTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.RestoreTableRequest.class, + com.google.bigtable.admin.v2.RestoreTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + tableId_ = ""; + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.RestoreTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableRequest build() { + com.google.bigtable.admin.v2.RestoreTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreTableRequest buildPartial() { + com.google.bigtable.admin.v2.RestoreTableRequest result = + new com.google.bigtable.admin.v2.RestoreTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.RestoreTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableId_ = tableId_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreTableRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.RestoreTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.RestoreTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableRequest other) { + if (other == com.google.bigtable.admin.v2.RestoreTableRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getSourceCase()) { + case BACKUP: + { + sourceCase_ = 3; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 3; + source_ = s; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The name of the instance in which to create the restored
+     * table. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance in which to create the restored
+     * table. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the instance in which to create the restored
+     * table. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance in which to create the restored
+     * table. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the instance in which to create the restored
+     * table. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableId_ = ""; + + /** + * + * + *
+     * Required. The id of the table to create and restore to. This
+     * table must not already exist. The `table_id` appended to
+     * `parent` forms the full table name of the form
+     * `projects/<project>/instances/<instance>/tables/<table_id>`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + public java.lang.String getTableId() { + java.lang.Object ref = tableId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The id of the table to create and restore to. This
+     * table must not already exist. The `table_id` appended to
+     * `parent` forms the full table name of the form
+     * `projects/<project>/instances/<instance>/tables/<table_id>`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + public com.google.protobuf.ByteString getTableIdBytes() { + java.lang.Object ref = tableId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The id of the table to create and restore to. This
+     * table must not already exist. The `table_id` appended to
+     * `parent` forms the full table name of the form
+     * `projects/<project>/instances/<instance>/tables/<table_id>`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableId to set. + * @return This builder for chaining. + */ + public Builder setTableId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the table to create and restore to. This
+     * table must not already exist. The `table_id` appended to
+     * `parent` forms the full table name of the form
+     * `projects/<project>/instances/<instance>/tables/<table_id>`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The id of the table to create and restore to. This
+     * table must not already exist. The `table_id` appended to
+     * `parent` forms the full table name of the form
+     * `projects/<project>/instances/<instance>/tables/<table_id>`.
+     * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableId to set. + * @return This builder for chaining. + */ + public Builder setTableIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return sourceCase_ == 3; + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + @java.lang.Override + public java.lang.String getBackup() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 3) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBackupBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 3) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 3) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The backup to set. + * @return This builder for chaining. + */ + public Builder setBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBackup() { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Name of the backup from which to restore.  Values are of the form
+     * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+     * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for backup to set. + * @return This builder for chaining. + */ + public Builder setBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 3; + source_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.RestoreTableRequest) + private static final com.google.bigtable.admin.v2.RestoreTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.RestoreTableRequest(); + } + + public static com.google.bigtable.admin.v2.RestoreTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestoreTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.RestoreTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java new file mode 100644 index 000000000000..d078b0fef46a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface RestoreTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.RestoreTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the instance in which to create the restored
+   * table. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The name of the instance in which to create the restored
+   * table. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The id of the table to create and restore to. This
+   * table must not already exist. The `table_id` appended to
+   * `parent` forms the full table name of the form
+   * `projects/<project>/instances/<instance>/tables/<table_id>`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableId. + */ + java.lang.String getTableId(); + + /** + * + * + *
+   * Required. The id of the table to create and restore to. This
+   * table must not already exist. The `table_id` appended to
+   * `parent` forms the full table name of the form
+   * `projects/<project>/instances/<instance>/tables/<table_id>`.
+   * 
+ * + * string table_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableId. + */ + com.google.protobuf.ByteString getTableIdBytes(); + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The backup. + */ + java.lang.String getBackup(); + + /** + * + * + *
+   * Name of the backup from which to restore.  Values are of the form
+   * `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
+   * 
+ * + * string backup = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for backup. + */ + com.google.protobuf.ByteString getBackupBytes(); + + com.google.bigtable.admin.v2.RestoreTableRequest.SourceCase getSourceCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundle.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundle.java new file mode 100644 index 000000000000..ae18eb985fe2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundle.java @@ -0,0 +1,1208 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A named collection of related schemas.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SchemaBundle} + */ +@com.google.protobuf.Generated +public final class SchemaBundle extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.SchemaBundle) + SchemaBundleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SchemaBundle"); + } + + // Use SchemaBundle.newBuilder() to construct. + private SchemaBundle(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SchemaBundle() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_SchemaBundle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SchemaBundle.class, + com.google.bigtable.admin.v2.SchemaBundle.Builder.class); + } + + private int typeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object type_; + + public enum TypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROTO_SCHEMA(2), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 2: + return PROTO_SCHEMA; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+   * Identifier. The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 PROTO_SCHEMA_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return Whether the protoSchema field is set. + */ + @java.lang.Override + public boolean hasProtoSchema() { + return typeCase_ == 2; + } + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return The protoSchema. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchema getProtoSchema() { + if (typeCase_ == 2) { + return (com.google.bigtable.admin.v2.ProtoSchema) type_; + } + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder() { + if (typeCase_ == 2) { + return (com.google.bigtable.admin.v2.ProtoSchema) type_; + } + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Optional. The etag for this schema bundle.
+   * This may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The etag for this schema bundle.
+   * This may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (typeCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.admin.v2.ProtoSchema) type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (typeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.ProtoSchema) type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + size += getUnknownFields().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.admin.v2.SchemaBundle)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.SchemaBundle other = + (com.google.bigtable.admin.v2.SchemaBundle) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 2: + if (!getProtoSchema().equals(other.getProtoSchema())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + switch (typeCase_) { + case 2: + hash = (37 * hash) + PROTO_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getProtoSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SchemaBundle 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.admin.v2.SchemaBundle parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SchemaBundle 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.admin.v2.SchemaBundle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SchemaBundle parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.SchemaBundle 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A named collection of related schemas.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SchemaBundle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.SchemaBundle) + com.google.bigtable.admin.v2.SchemaBundleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_SchemaBundle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SchemaBundle.class, + com.google.bigtable.admin.v2.SchemaBundle.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.SchemaBundle.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (protoSchemaBuilder_ != null) { + protoSchemaBuilder_.clear(); + } + etag_ = ""; + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle build() { + com.google.bigtable.admin.v2.SchemaBundle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle buildPartial() { + com.google.bigtable.admin.v2.SchemaBundle result = + new com.google.bigtable.admin.v2.SchemaBundle(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.SchemaBundle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.SchemaBundle result) { + result.typeCase_ = typeCase_; + result.type_ = this.type_; + if (typeCase_ == 2 && protoSchemaBuilder_ != null) { + result.type_ = protoSchemaBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.SchemaBundle) { + return mergeFrom((com.google.bigtable.admin.v2.SchemaBundle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.SchemaBundle other) { + if (other == com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getTypeCase()) { + case PROTO_SCHEMA: + { + mergeProtoSchema(other.getProtoSchema()); + break; + } + case TYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetProtoSchemaFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 2; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
+     * Identifier. The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ProtoSchema, + com.google.bigtable.admin.v2.ProtoSchema.Builder, + com.google.bigtable.admin.v2.ProtoSchemaOrBuilder> + protoSchemaBuilder_; + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return Whether the protoSchema field is set. + */ + @java.lang.Override + public boolean hasProtoSchema() { + return typeCase_ == 2; + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return The protoSchema. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchema getProtoSchema() { + if (protoSchemaBuilder_ == null) { + if (typeCase_ == 2) { + return (com.google.bigtable.admin.v2.ProtoSchema) type_; + } + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } else { + if (typeCase_ == 2) { + return protoSchemaBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + public Builder setProtoSchema(com.google.bigtable.admin.v2.ProtoSchema value) { + if (protoSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + protoSchemaBuilder_.setMessage(value); + } + typeCase_ = 2; + return this; + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + public Builder setProtoSchema( + com.google.bigtable.admin.v2.ProtoSchema.Builder builderForValue) { + if (protoSchemaBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + protoSchemaBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 2; + return this; + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + public Builder mergeProtoSchema(com.google.bigtable.admin.v2.ProtoSchema value) { + if (protoSchemaBuilder_ == null) { + if (typeCase_ == 2 + && type_ != com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance()) { + type_ = + com.google.bigtable.admin.v2.ProtoSchema.newBuilder( + (com.google.bigtable.admin.v2.ProtoSchema) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 2) { + protoSchemaBuilder_.mergeFrom(value); + } else { + protoSchemaBuilder_.setMessage(value); + } + } + typeCase_ = 2; + return this; + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + public Builder clearProtoSchema() { + if (protoSchemaBuilder_ == null) { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + } + protoSchemaBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + public com.google.bigtable.admin.v2.ProtoSchema.Builder getProtoSchemaBuilder() { + return internalGetProtoSchemaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder() { + if ((typeCase_ == 2) && (protoSchemaBuilder_ != null)) { + return protoSchemaBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 2) { + return (com.google.bigtable.admin.v2.ProtoSchema) type_; + } + return com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Schema for Protobufs.
+     * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ProtoSchema, + com.google.bigtable.admin.v2.ProtoSchema.Builder, + com.google.bigtable.admin.v2.ProtoSchemaOrBuilder> + internalGetProtoSchemaFieldBuilder() { + if (protoSchemaBuilder_ == null) { + if (!(typeCase_ == 2)) { + type_ = com.google.bigtable.admin.v2.ProtoSchema.getDefaultInstance(); + } + protoSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ProtoSchema, + com.google.bigtable.admin.v2.ProtoSchema.Builder, + com.google.bigtable.admin.v2.ProtoSchemaOrBuilder>( + (com.google.bigtable.admin.v2.ProtoSchema) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 2; + onChanged(); + return protoSchemaBuilder_; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Optional. The etag for this schema bundle.
+     * This may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this schema bundle.
+     * This may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The etag for this schema bundle.
+     * This may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this schema bundle.
+     * This may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The etag for this schema bundle.
+     * This may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding. The server
+     * returns an ABORTED error on a mismatched etag.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.SchemaBundle) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.SchemaBundle) + private static final com.google.bigtable.admin.v2.SchemaBundle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.SchemaBundle(); + } + + public static com.google.bigtable.admin.v2.SchemaBundle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SchemaBundle parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.SchemaBundle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleName.java new file mode 100644 index 000000000000..01ffe0e433be --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleName.java @@ -0,0 +1,261 @@ +/* + * Copyright 2026 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.admin.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 SchemaBundleName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_TABLE_SCHEMA_BUNDLE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String table; + private final String schemaBundle; + + @Deprecated + protected SchemaBundleName() { + project = null; + instance = null; + table = null; + schemaBundle = null; + } + + private SchemaBundleName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + table = Preconditions.checkNotNull(builder.getTable()); + schemaBundle = Preconditions.checkNotNull(builder.getSchemaBundle()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getSchemaBundle() { + return schemaBundle; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SchemaBundleName of( + String project, String instance, String table, String schemaBundle) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setSchemaBundle(schemaBundle) + .build(); + } + + public static String format(String project, String instance, String table, String schemaBundle) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setSchemaBundle(schemaBundle) + .build() + .toString(); + } + + public static SchemaBundleName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_TABLE_SCHEMA_BUNDLE.validatedMatch( + formattedString, "SchemaBundleName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("table"), + matchMap.get("schema_bundle")); + } + + 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 (SchemaBundleName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_TABLE_SCHEMA_BUNDLE.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); + } + if (table != null) { + fieldMapBuilder.put("table", table); + } + if (schemaBundle != null) { + fieldMapBuilder.put("schema_bundle", schemaBundle); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_TABLE_SCHEMA_BUNDLE.instantiate( + "project", project, "instance", instance, "table", table, "schema_bundle", schemaBundle); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SchemaBundleName that = ((SchemaBundleName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.table, that.table) + && Objects.equals(this.schemaBundle, that.schemaBundle); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(table); + h *= 1000003; + h ^= Objects.hashCode(schemaBundle); + return h; + } + + /** + * Builder for + * projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}. + */ + public static class Builder { + private String project; + private String instance; + private String table; + private String schemaBundle; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getSchemaBundle() { + return schemaBundle; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setTable(String table) { + this.table = table; + return this; + } + + public Builder setSchemaBundle(String schemaBundle) { + this.schemaBundle = schemaBundle; + return this; + } + + private Builder(SchemaBundleName schemaBundleName) { + this.project = schemaBundleName.project; + this.instance = schemaBundleName.instance; + this.table = schemaBundleName.table; + this.schemaBundle = schemaBundleName.schemaBundle; + } + + public SchemaBundleName build() { + return new SchemaBundleName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleOrBuilder.java new file mode 100644 index 000000000000..5b433ff34439 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface SchemaBundleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.SchemaBundle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return Whether the protoSchema field is set. + */ + boolean hasProtoSchema(); + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + * + * @return The protoSchema. + */ + com.google.bigtable.admin.v2.ProtoSchema getProtoSchema(); + + /** + * + * + *
+   * Schema for Protobufs.
+   * 
+ * + * .google.bigtable.admin.v2.ProtoSchema proto_schema = 2; + */ + com.google.bigtable.admin.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder(); + + /** + * + * + *
+   * Optional. The etag for this schema bundle.
+   * This may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Optional. The etag for this schema bundle.
+   * This may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding. The server
+   * returns an ABORTED error on a mismatched etag.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + com.google.bigtable.admin.v2.SchemaBundle.TypeCase getTypeCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java new file mode 100644 index 000000000000..1366ac6e3a13 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java @@ -0,0 +1,2175 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A snapshot of a table at a particular time. A snapshot can be used as a
+ * checkpoint for data restoration or a data source for a new table.
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Snapshot} + */ +@com.google.protobuf.Generated +public final class Snapshot extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Snapshot) + SnapshotOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Snapshot"); + } + + // Use Snapshot.newBuilder() to construct. + private Snapshot(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Snapshot() { + name_ = ""; + state_ = 0; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Snapshot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Snapshot.class, + com.google.bigtable.admin.v2.Snapshot.Builder.class); + } + + /** + * + * + *
+   * Possible states of a snapshot.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Snapshot.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state of the snapshot could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + STATE_NOT_KNOWN(0), + /** + * + * + *
+     * The snapshot has been successfully created and can serve all requests.
+     * 
+ * + * READY = 1; + */ + READY(1), + /** + * + * + *
+     * The snapshot is currently being created, and may be destroyed if the
+     * creation process encounters an error. A snapshot may not be restored to a
+     * table while it is being created.
+     * 
+ * + * CREATING = 2; + */ + CREATING(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + + /** + * + * + *
+     * The state of the snapshot could not be determined.
+     * 
+ * + * STATE_NOT_KNOWN = 0; + */ + public static final int STATE_NOT_KNOWN_VALUE = 0; + + /** + * + * + *
+     * The snapshot has been successfully created and can serve all requests.
+     * 
+ * + * READY = 1; + */ + public static final int READY_VALUE = 1; + + /** + * + * + *
+     * The snapshot is currently being created, and may be destroyed if the
+     * creation process encounters an error. A snapshot may not be restored to a
+     * table while it is being created.
+     * 
+ * + * CREATING = 2; + */ + public static final int CREATING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_NOT_KNOWN; + case 1: + return READY; + case 2: + return CREATING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Snapshot.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Snapshot.State) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * string name = 1; + * + * @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 SOURCE_TABLE_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.Table sourceTable_; + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceTable field is set. + */ + @java.lang.Override + public boolean hasSourceTable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceTable. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table getSourceTable() { + return sourceTable_ == null + ? com.google.bigtable.admin.v2.Table.getDefaultInstance() + : sourceTable_; + } + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { + return sourceTable_ == null + ? com.google.bigtable.admin.v2.Table.getDefaultInstance() + : sourceTable_; + } + + public static final int DATA_SIZE_BYTES_FIELD_NUMBER = 3; + private long dataSizeBytes_ = 0L; + + /** + * + * + *
+   * Output only. The size of the data in the source table at the time the
+   * snapshot was taken. In some cases, this value may be computed
+   * asynchronously via a background process and a placeholder of 0 will be used
+   * in the meantime.
+   * 
+ * + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSizeBytes. + */ + @java.lang.Override + public long getDataSizeBytes() { + return dataSizeBytes_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int DELETE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp deleteTime_; + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The current state of the snapshot.
+   * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The current state of the snapshot.
+   * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot.State getState() { + com.google.bigtable.admin.v2.Snapshot.State result = + com.google.bigtable.admin.v2.Snapshot.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Snapshot.State.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 7; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSourceTable()); + } + if (dataSizeBytes_ != 0L) { + output.writeInt64(3, dataSizeBytes_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getDeleteTime()); + } + if (state_ != com.google.bigtable.admin.v2.Snapshot.State.STATE_NOT_KNOWN.getNumber()) { + output.writeEnum(6, state_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSourceTable()); + } + if (dataSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, dataSizeBytes_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDeleteTime()); + } + if (state_ != com.google.bigtable.admin.v2.Snapshot.State.STATE_NOT_KNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, description_); + } + size += getUnknownFields().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.admin.v2.Snapshot)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Snapshot other = (com.google.bigtable.admin.v2.Snapshot) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSourceTable() != other.hasSourceTable()) return false; + if (hasSourceTable()) { + if (!getSourceTable().equals(other.getSourceTable())) return false; + } + if (getDataSizeBytes() != other.getDataSizeBytes()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (state_ != other.state_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasSourceTable()) { + hash = (37 * hash) + SOURCE_TABLE_FIELD_NUMBER; + hash = (53 * hash) + getSourceTable().hashCode(); + } + hash = (37 * hash) + DATA_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDataSizeBytes()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Snapshot 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.admin.v2.Snapshot parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Snapshot 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.admin.v2.Snapshot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Snapshot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Snapshot parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Snapshot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Snapshot 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A snapshot of a table at a particular time. A snapshot can be used as a
+   * checkpoint for data restoration or a data source for a new table.
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Snapshot} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Snapshot) + com.google.bigtable.admin.v2.SnapshotOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Snapshot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Snapshot.class, + com.google.bigtable.admin.v2.Snapshot.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Snapshot.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSourceTableFieldBuilder(); + internalGetCreateTimeFieldBuilder(); + internalGetDeleteTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sourceTable_ = null; + if (sourceTableBuilder_ != null) { + sourceTableBuilder_.dispose(); + sourceTableBuilder_ = null; + } + dataSizeBytes_ = 0L; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + state_ = 0; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Snapshot_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Snapshot.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot build() { + com.google.bigtable.admin.v2.Snapshot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot buildPartial() { + com.google.bigtable.admin.v2.Snapshot result = + new com.google.bigtable.admin.v2.Snapshot(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Snapshot result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceTable_ = + sourceTableBuilder_ == null ? sourceTable_ : sourceTableBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dataSizeBytes_ = dataSizeBytes_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.description_ = description_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Snapshot) { + return mergeFrom((com.google.bigtable.admin.v2.Snapshot) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Snapshot other) { + if (other == com.google.bigtable.admin.v2.Snapshot.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSourceTable()) { + mergeSourceTable(other.getSourceTable()); + } + if (other.getDataSizeBytes() != 0L) { + setDataSizeBytes(other.getDataSizeBytes()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetSourceTableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + dataSizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the snapshot.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Table sourceTable_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + sourceTableBuilder_; + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceTable field is set. + */ + public boolean hasSourceTable() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceTable. + */ + public com.google.bigtable.admin.v2.Table getSourceTable() { + if (sourceTableBuilder_ == null) { + return sourceTable_ == null + ? com.google.bigtable.admin.v2.Table.getDefaultInstance() + : sourceTable_; + } else { + return sourceTableBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceTable(com.google.bigtable.admin.v2.Table value) { + if (sourceTableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceTable_ = value; + } else { + sourceTableBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceTable(com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (sourceTableBuilder_ == null) { + sourceTable_ = builderForValue.build(); + } else { + sourceTableBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSourceTable(com.google.bigtable.admin.v2.Table value) { + if (sourceTableBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sourceTable_ != null + && sourceTable_ != com.google.bigtable.admin.v2.Table.getDefaultInstance()) { + getSourceTableBuilder().mergeFrom(value); + } else { + sourceTable_ = value; + } + } else { + sourceTableBuilder_.mergeFrom(value); + } + if (sourceTable_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSourceTable() { + bitField0_ = (bitField0_ & ~0x00000002); + sourceTable_ = null; + if (sourceTableBuilder_ != null) { + sourceTableBuilder_.dispose(); + sourceTableBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.Table.Builder getSourceTableBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSourceTableFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { + if (sourceTableBuilder_ != null) { + return sourceTableBuilder_.getMessageOrBuilder(); + } else { + return sourceTable_ == null + ? com.google.bigtable.admin.v2.Table.getDefaultInstance() + : sourceTable_; + } + } + + /** + * + * + *
+     * Output only. The source table at the time the snapshot was taken.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + internalGetSourceTableFieldBuilder() { + if (sourceTableBuilder_ == null) { + sourceTableBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder>( + getSourceTable(), getParentForChildren(), isClean()); + sourceTable_ = null; + } + return sourceTableBuilder_; + } + + private long dataSizeBytes_; + + /** + * + * + *
+     * Output only. The size of the data in the source table at the time the
+     * snapshot was taken. In some cases, this value may be computed
+     * asynchronously via a background process and a placeholder of 0 will be used
+     * in the meantime.
+     * 
+ * + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSizeBytes. + */ + @java.lang.Override + public long getDataSizeBytes() { + return dataSizeBytes_; + } + + /** + * + * + *
+     * Output only. The size of the data in the source table at the time the
+     * snapshot was taken. In some cases, this value may be computed
+     * asynchronously via a background process and a placeholder of 0 will be used
+     * in the meantime.
+     * 
+ * + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dataSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setDataSizeBytes(long value) { + + dataSizeBytes_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The size of the data in the source table at the time the
+     * snapshot was taken. In some cases, this value may be computed
+     * asynchronously via a background process and a placeholder of 0 will be used
+     * in the meantime.
+     * 
+ * + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDataSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + dataSizeBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the snapshot is created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + } else { + deleteTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); + } else { + deleteTime_ = value; + } + } else { + deleteTimeBuilder_.mergeFrom(value); + } + if (deleteTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public Builder clearDeleteTime() { + bitField0_ = (bitField0_ & ~0x00000010); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); + deleteTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetDeleteTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + + /** + * + * + *
+     * The time when the snapshot will be deleted. The maximum amount of time a
+     * snapshot can stay active is 365 days. If 'ttl' is not specified,
+     * the default maximum of 365 days will be used.
+     * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The current state of the snapshot.
+     * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The current state of the snapshot.
+     * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the snapshot.
+     * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Snapshot.State getState() { + com.google.bigtable.admin.v2.Snapshot.State result = + com.google.bigtable.admin.v2.Snapshot.State.forNumber(state_); + return result == null ? com.google.bigtable.admin.v2.Snapshot.State.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The current state of the snapshot.
+     * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.bigtable.admin.v2.Snapshot.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The current state of the snapshot.
+     * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000020); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 7; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 7; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 7; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 7; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Snapshot) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Snapshot) + private static final com.google.bigtable.admin.v2.Snapshot DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Snapshot(); + } + + public static com.google.bigtable.admin.v2.Snapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Snapshot parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Snapshot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java new file mode 100644 index 000000000000..9e0af534fefb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java @@ -0,0 +1,259 @@ +/* + * Copyright 2026 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.admin.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 SnapshotName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_CLUSTER_SNAPSHOT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String cluster; + private final String snapshot; + + @Deprecated + protected SnapshotName() { + project = null; + instance = null; + cluster = null; + snapshot = null; + } + + private SnapshotName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + cluster = Preconditions.checkNotNull(builder.getCluster()); + snapshot = Preconditions.checkNotNull(builder.getSnapshot()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public String getSnapshot() { + return snapshot; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SnapshotName of(String project, String instance, String cluster, String snapshot) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setCluster(cluster) + .setSnapshot(snapshot) + .build(); + } + + public static String format(String project, String instance, String cluster, String snapshot) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setCluster(cluster) + .setSnapshot(snapshot) + .build() + .toString(); + } + + public static SnapshotName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_CLUSTER_SNAPSHOT.validatedMatch( + formattedString, "SnapshotName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("cluster"), + matchMap.get("snapshot")); + } + + 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 (SnapshotName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_CLUSTER_SNAPSHOT.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); + } + if (cluster != null) { + fieldMapBuilder.put("cluster", cluster); + } + if (snapshot != null) { + fieldMapBuilder.put("snapshot", snapshot); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_CLUSTER_SNAPSHOT.instantiate( + "project", project, "instance", instance, "cluster", cluster, "snapshot", snapshot); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SnapshotName that = ((SnapshotName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.cluster, that.cluster) + && Objects.equals(this.snapshot, that.snapshot); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(cluster); + h *= 1000003; + h ^= Objects.hashCode(snapshot); + return h; + } + + /** + * Builder for projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}. + */ + public static class Builder { + private String project; + private String instance; + private String cluster; + private String snapshot; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getCluster() { + return cluster; + } + + public String getSnapshot() { + return snapshot; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setCluster(String cluster) { + this.cluster = cluster; + return this; + } + + public Builder setSnapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + private Builder(SnapshotName snapshotName) { + this.project = snapshotName.project; + this.instance = snapshotName.instance; + this.cluster = snapshotName.cluster; + this.snapshot = snapshotName.snapshot; + } + + public SnapshotName build() { + return new SnapshotName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java new file mode 100644 index 000000000000..c3a350713493 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java @@ -0,0 +1,256 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface SnapshotOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Snapshot) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the snapshot.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceTable field is set. + */ + boolean hasSourceTable(); + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceTable. + */ + com.google.bigtable.admin.v2.Table getSourceTable(); + + /** + * + * + *
+   * Output only. The source table at the time the snapshot was taken.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder(); + + /** + * + * + *
+   * Output only. The size of the data in the source table at the time the
+   * snapshot was taken. In some cases, this value may be computed
+   * asynchronously via a background process and a placeholder of 0 will be used
+   * in the meantime.
+   * 
+ * + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSizeBytes. + */ + long getDataSizeBytes(); + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The time when the snapshot is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + + /** + * + * + *
+   * The time when the snapshot will be deleted. The maximum amount of time a
+   * snapshot can stay active is 365 days. If 'ttl' is not specified,
+   * the default maximum of 365 days will be used.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of the snapshot.
+   * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The current state of the snapshot.
+   * 
+ * + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.bigtable.admin.v2.Snapshot.State getState(); + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 7; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java new file mode 100644 index 000000000000..f7840fb2a3fb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java @@ -0,0 +1,1267 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by SnapshotTable.
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableMetadata} + */ +@com.google.protobuf.Generated +public final class SnapshotTableMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.SnapshotTableMetadata) + SnapshotTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SnapshotTableMetadata"); + } + + // Use SnapshotTableMetadata.newBuilder() to construct. + private SnapshotTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SnapshotTableMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SnapshotTableMetadata.class, + com.google.bigtable.admin.v2.SnapshotTableMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.SnapshotTableRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.SnapshotTableMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.SnapshotTableMetadata other = + (com.google.bigtable.admin.v2.SnapshotTableMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata 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.admin.v2.SnapshotTableMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata 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.admin.v2.SnapshotTableMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.SnapshotTableMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by SnapshotTable.
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.SnapshotTableMetadata) + com.google.bigtable.admin.v2.SnapshotTableMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SnapshotTableMetadata.class, + com.google.bigtable.admin.v2.SnapshotTableMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.SnapshotTableMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.SnapshotTableMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableMetadata build() { + com.google.bigtable.admin.v2.SnapshotTableMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableMetadata buildPartial() { + com.google.bigtable.admin.v2.SnapshotTableMetadata result = + new com.google.bigtable.admin.v2.SnapshotTableMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.SnapshotTableMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.SnapshotTableMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.SnapshotTableMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.SnapshotTableMetadata other) { + if (other == com.google.bigtable.admin.v2.SnapshotTableMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.SnapshotTableRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SnapshotTableRequest, + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder, + com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.SnapshotTableRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.SnapshotTableRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this SnapshotTable operation.
+     * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SnapshotTableRequest, + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder, + com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SnapshotTableRequest, + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder, + com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.SnapshotTableMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.SnapshotTableMetadata) + private static final com.google.bigtable.admin.v2.SnapshotTableMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.SnapshotTableMetadata(); + } + + public static com.google.bigtable.admin.v2.SnapshotTableMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapshotTableMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.SnapshotTableMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java new file mode 100644 index 000000000000..bb0f48032286 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface SnapshotTableMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.SnapshotTableMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this SnapshotTable operation.
+   * 
+ * + * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1; + */ + com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java new file mode 100644 index 000000000000..23b344691377 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java @@ -0,0 +1,1570 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
+ *
+ * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+ * feature is not currently available to most Cloud Bigtable customers. This
+ * feature might be changed in backward-incompatible ways and is not recommended
+ * for production use. It is not subject to any SLA or deprecation policy.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableRequest} + */ +@com.google.protobuf.Generated +public final class SnapshotTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.SnapshotTableRequest) + SnapshotTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SnapshotTableRequest"); + } + + // Use SnapshotTableRequest.newBuilder() to construct. + private SnapshotTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SnapshotTableRequest() { + name_ = ""; + cluster_ = ""; + snapshotId_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SnapshotTableRequest.class, + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table to have the snapshot taken.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to have the snapshot taken.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 CLUSTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object cluster_ = ""; + + /** + * + * + *
+   * Required. The name of the cluster where the snapshot will be created in.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The cluster. + */ + @java.lang.Override + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + 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(); + cluster_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the cluster where the snapshot will be created in.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cluster. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object snapshotId_ = ""; + + /** + * + * + *
+   * Required. The ID by which the new snapshot should be referred to within the
+   * parent cluster, e.g., `mysnapshot` of the form:
+   * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+   * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + @java.lang.Override + public java.lang.String getSnapshotId() { + java.lang.Object ref = snapshotId_; + 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(); + snapshotId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID by which the new snapshot should be referred to within the
+   * parent cluster, e.g., `mysnapshot` of the form:
+   * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+   * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSnapshotIdBytes() { + java.lang.Object ref = snapshotId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TTL_FIELD_NUMBER = 4; + private com.google.protobuf.Duration ttl_; + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; + } + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cluster_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, cluster_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, snapshotId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getTtl()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cluster_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, cluster_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, snapshotId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTtl()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, description_); + } + size += getUnknownFields().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.admin.v2.SnapshotTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.SnapshotTableRequest other = + (com.google.bigtable.admin.v2.SnapshotTableRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getCluster().equals(other.getCluster())) return false; + if (!getSnapshotId().equals(other.getSnapshotId())) return false; + if (hasTtl() != other.hasTtl()) return false; + if (hasTtl()) { + if (!getTtl().equals(other.getTtl())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + hash = (37 * hash) + SNAPSHOT_ID_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotId().hashCode(); + if (hasTtl()) { + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest 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.admin.v2.SnapshotTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest 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.admin.v2.SnapshotTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.SnapshotTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
+   *
+   * Note: This is a private alpha release of Cloud Bigtable snapshots. This
+   * feature is not currently available to most Cloud Bigtable customers. This
+   * feature might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.SnapshotTableRequest) + com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.SnapshotTableRequest.class, + com.google.bigtable.admin.v2.SnapshotTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.SnapshotTableRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTtlFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + cluster_ = ""; + snapshotId_ = ""; + ttl_ = null; + if (ttlBuilder_ != null) { + ttlBuilder_.dispose(); + ttlBuilder_ = null; + } + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableRequest build() { + com.google.bigtable.admin.v2.SnapshotTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.SnapshotTableRequest buildPartial() { + com.google.bigtable.admin.v2.SnapshotTableRequest result = + new com.google.bigtable.admin.v2.SnapshotTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.SnapshotTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cluster_ = cluster_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.snapshotId_ = snapshotId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ttl_ = ttlBuilder_ == null ? ttl_ : ttlBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.SnapshotTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.SnapshotTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.SnapshotTableRequest other) { + if (other == com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCluster().isEmpty()) { + cluster_ = other.cluster_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSnapshotId().isEmpty()) { + snapshotId_ = other.snapshotId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasTtl()) { + mergeTtl(other.getTtl()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + cluster_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + snapshotId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetTtlFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table to have the snapshot taken.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to have the snapshot taken.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to have the snapshot taken.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to have the snapshot taken.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to have the snapshot taken.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object cluster_ = ""; + + /** + * + * + *
+     * Required. The name of the cluster where the snapshot will be created in.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The cluster. + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the cluster where the snapshot will be created in.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cluster. + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the cluster where the snapshot will be created in.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The cluster to set. + * @return This builder for chaining. + */ + public Builder setCluster(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the cluster where the snapshot will be created in.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearCluster() { + cluster_ = getDefaultInstance().getCluster(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the cluster where the snapshot will be created in.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+     * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for cluster to set. + * @return This builder for chaining. + */ + public Builder setClusterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cluster_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object snapshotId_ = ""; + + /** + * + * + *
+     * Required. The ID by which the new snapshot should be referred to within the
+     * parent cluster, e.g., `mysnapshot` of the form:
+     * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+     * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + public java.lang.String getSnapshotId() { + java.lang.Object ref = snapshotId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snapshotId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID by which the new snapshot should be referred to within the
+     * parent cluster, e.g., `mysnapshot` of the form:
+     * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+     * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + public com.google.protobuf.ByteString getSnapshotIdBytes() { + java.lang.Object ref = snapshotId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + snapshotId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID by which the new snapshot should be referred to within the
+     * parent cluster, e.g., `mysnapshot` of the form:
+     * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+     * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The snapshotId to set. + * @return This builder for chaining. + */ + public Builder setSnapshotId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + snapshotId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID by which the new snapshot should be referred to within the
+     * parent cluster, e.g., `mysnapshot` of the form:
+     * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+     * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSnapshotId() { + snapshotId_ = getDefaultInstance().getSnapshotId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID by which the new snapshot should be referred to within the
+     * parent cluster, e.g., `mysnapshot` of the form:
+     * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+     * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for snapshotId to set. + * @return This builder for chaining. + */ + public Builder setSnapshotIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + snapshotId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Duration ttl_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + public boolean hasTtl() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; + } else { + return ttlBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ttl_ = value; + } else { + ttlBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + ttl_ = builderForValue.build(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && ttl_ != null + && ttl_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTtlBuilder().mergeFrom(value); + } else { + ttl_ = value; + } + } else { + ttlBuilder_.mergeFrom(value); + } + if (ttl_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public Builder clearTtl() { + bitField0_ = (bitField0_ & ~0x00000008); + ttl_ = null; + if (ttlBuilder_ != null) { + ttlBuilder_.dispose(); + ttlBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetTtlFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (ttlBuilder_ != null) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; + } + } + + /** + * + * + *
+     * The amount of time that the new snapshot can stay active after it is
+     * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+     * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+     * specified, the default value of 24 hours will be used.
+     * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetTtlFieldBuilder() { + if (ttlBuilder_ == null) { + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>(getTtl(), getParentForChildren(), isClean()); + ttl_ = null; + } + return ttlBuilder_; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 5; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 5; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Description of the snapshot.
+     * 
+ * + * string description = 5; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.SnapshotTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.SnapshotTableRequest) + private static final com.google.bigtable.admin.v2.SnapshotTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.SnapshotTableRequest(); + } + + public static com.google.bigtable.admin.v2.SnapshotTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapshotTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.SnapshotTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java new file mode 100644 index 000000000000..2934d11ce9ab --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java @@ -0,0 +1,200 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface SnapshotTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.SnapshotTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table to have the snapshot taken.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to have the snapshot taken.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The name of the cluster where the snapshot will be created in.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The cluster. + */ + java.lang.String getCluster(); + + /** + * + * + *
+   * Required. The name of the cluster where the snapshot will be created in.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
+   * 
+ * + * + * string cluster = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for cluster. + */ + com.google.protobuf.ByteString getClusterBytes(); + + /** + * + * + *
+   * Required. The ID by which the new snapshot should be referred to within the
+   * parent cluster, e.g., `mysnapshot` of the form:
+   * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+   * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The snapshotId. + */ + java.lang.String getSnapshotId(); + + /** + * + * + *
+   * Required. The ID by which the new snapshot should be referred to within the
+   * parent cluster, e.g., `mysnapshot` of the form:
+   * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
+   * 
+ * + * string snapshot_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for snapshotId. + */ + com.google.protobuf.ByteString getSnapshotIdBytes(); + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + + /** + * + * + *
+   * The amount of time that the new snapshot can stay active after it is
+   * created. Once 'ttl' expires, the snapshot will get deleted. The maximum
+   * amount of time a snapshot can stay active is 7 days. If 'ttl' is not
+   * specified, the default value of 24 hours will be used.
+   * 
+ * + * .google.protobuf.Duration ttl = 4; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Description of the snapshot.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java new file mode 100644 index 000000000000..34d19e9d615c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java @@ -0,0 +1,399 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Checks that all writes before the consistency token was generated are
+ * replicated in every cluster and readable.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.StandardReadRemoteWrites} + */ +@com.google.protobuf.Generated +public final class StandardReadRemoteWrites extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.StandardReadRemoteWrites) + StandardReadRemoteWritesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StandardReadRemoteWrites"); + } + + // Use StandardReadRemoteWrites.newBuilder() to construct. + private StandardReadRemoteWrites(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StandardReadRemoteWrites() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.StandardReadRemoteWrites.class, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.StandardReadRemoteWrites)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.StandardReadRemoteWrites other = + (com.google.bigtable.admin.v2.StandardReadRemoteWrites) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites 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.admin.v2.StandardReadRemoteWrites parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites 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.admin.v2.StandardReadRemoteWrites parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.StandardReadRemoteWrites 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Checks that all writes before the consistency token was generated are
+   * replicated in every cluster and readable.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.StandardReadRemoteWrites} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.StandardReadRemoteWrites) + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.StandardReadRemoteWrites.class, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.StandardReadRemoteWrites.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_StandardReadRemoteWrites_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWrites getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWrites build() { + com.google.bigtable.admin.v2.StandardReadRemoteWrites result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWrites buildPartial() { + com.google.bigtable.admin.v2.StandardReadRemoteWrites result = + new com.google.bigtable.admin.v2.StandardReadRemoteWrites(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.StandardReadRemoteWrites) { + return mergeFrom((com.google.bigtable.admin.v2.StandardReadRemoteWrites) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.StandardReadRemoteWrites other) { + if (other == com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.StandardReadRemoteWrites) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.StandardReadRemoteWrites) + private static final com.google.bigtable.admin.v2.StandardReadRemoteWrites DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.StandardReadRemoteWrites(); + } + + public static com.google.bigtable.admin.v2.StandardReadRemoteWrites getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StandardReadRemoteWrites parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.StandardReadRemoteWrites getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.java new file mode 100644 index 000000000000..13ab9e7191ec --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface StandardReadRemoteWritesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.StandardReadRemoteWrites) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java new file mode 100644 index 000000000000..91de4a987d0f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Storage media types for persisting Bigtable data.
+ * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.StorageType} + */ +@com.google.protobuf.Generated +public enum StorageType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The user did not specify a storage type.
+   * 
+ * + * STORAGE_TYPE_UNSPECIFIED = 0; + */ + STORAGE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Flash (SSD) storage should be used.
+   * 
+ * + * SSD = 1; + */ + SSD(1), + /** + * + * + *
+   * Magnetic drive (HDD) storage should be used.
+   * 
+ * + * HDD = 2; + */ + HDD(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StorageType"); + } + + /** + * + * + *
+   * The user did not specify a storage type.
+   * 
+ * + * STORAGE_TYPE_UNSPECIFIED = 0; + */ + public static final int STORAGE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Flash (SSD) storage should be used.
+   * 
+ * + * SSD = 1; + */ + public static final int SSD_VALUE = 1; + + /** + * + * + *
+   * Magnetic drive (HDD) storage should be used.
+   * 
+ * + * HDD = 2; + */ + public static final int HDD_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StorageType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static StorageType forNumber(int value) { + switch (value) { + case 0: + return STORAGE_TYPE_UNSPECIFIED; + case 1: + return SSD; + case 2: + return HDD; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StorageType findValueByNumber(int number) { + return StorageType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final StorageType[] VALUES = values(); + + public static StorageType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StorageType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.StorageType) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java new file mode 100644 index 000000000000..aeb100898230 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java @@ -0,0 +1,7785 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * A collection of user data indexed by row, column, and timestamp.
+ * Each table is served using the resources of its parent cluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table} + */ +@com.google.protobuf.Generated +public final class Table extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Table) + TableOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Table"); + } + + // Use Table.newBuilder() to construct. + private Table(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Table() { + name_ = ""; + granularity_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetClusterStates(); + case 3: + return internalGetColumnFamilies(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.class, + com.google.bigtable.admin.v2.Table.Builder.class); + } + + /** + * + * + *
+   * Possible timestamp granularities to use when keeping multiple versions
+   * of data in a table.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Table.TimestampGranularity} + */ + public enum TimestampGranularity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The user did not specify a granularity. Should not be returned.
+     * When specified during table creation, MILLIS will be used.
+     * 
+ * + * TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + */ + TIMESTAMP_GRANULARITY_UNSPECIFIED(0), + /** + * + * + *
+     * The table keeps data versioned at a granularity of 1ms.
+     * 
+ * + * MILLIS = 1; + */ + MILLIS(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TimestampGranularity"); + } + + /** + * + * + *
+     * The user did not specify a granularity. Should not be returned.
+     * When specified during table creation, MILLIS will be used.
+     * 
+ * + * TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + */ + public static final int TIMESTAMP_GRANULARITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The table keeps data versioned at a granularity of 1ms.
+     * 
+ * + * MILLIS = 1; + */ + public static final int MILLIS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TimestampGranularity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TimestampGranularity forNumber(int value) { + switch (value) { + case 0: + return TIMESTAMP_GRANULARITY_UNSPECIFIED; + case 1: + return MILLIS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TimestampGranularity findValueByNumber(int number) { + return TimestampGranularity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Table.getDescriptor().getEnumTypes().get(0); + } + + private static final TimestampGranularity[] VALUES = values(); + + public static TimestampGranularity valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TimestampGranularity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Table.TimestampGranularity) + } + + /** + * + * + *
+   * Defines a view over a table's fields.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Table.View} + */ + public enum View implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Uses the default view for each method as documented in its request.
+     * 
+ * + * VIEW_UNSPECIFIED = 0; + */ + VIEW_UNSPECIFIED(0), + /** + * + * + *
+     * Only populates `name`.
+     * 
+ * + * NAME_ONLY = 1; + */ + NAME_ONLY(1), + /** + * + * + *
+     * Only populates `name` and fields related to the table's schema.
+     * 
+ * + * SCHEMA_VIEW = 2; + */ + SCHEMA_VIEW(2), + /** + * + * + *
+     * Only populates `name` and fields related to the table's replication
+     * state.
+     * 
+ * + * REPLICATION_VIEW = 3; + */ + REPLICATION_VIEW(3), + /** + * + * + *
+     * Only populates `name` and fields related to the table's encryption state.
+     * 
+ * + * ENCRYPTION_VIEW = 5; + */ + ENCRYPTION_VIEW(5), + /** + * + * + *
+     * Populates all fields.
+     * 
+ * + * FULL = 4; + */ + FULL(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "View"); + } + + /** + * + * + *
+     * Uses the default view for each method as documented in its request.
+     * 
+ * + * VIEW_UNSPECIFIED = 0; + */ + public static final int VIEW_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Only populates `name`.
+     * 
+ * + * NAME_ONLY = 1; + */ + public static final int NAME_ONLY_VALUE = 1; + + /** + * + * + *
+     * Only populates `name` and fields related to the table's schema.
+     * 
+ * + * SCHEMA_VIEW = 2; + */ + public static final int SCHEMA_VIEW_VALUE = 2; + + /** + * + * + *
+     * Only populates `name` and fields related to the table's replication
+     * state.
+     * 
+ * + * REPLICATION_VIEW = 3; + */ + public static final int REPLICATION_VIEW_VALUE = 3; + + /** + * + * + *
+     * Only populates `name` and fields related to the table's encryption state.
+     * 
+ * + * ENCRYPTION_VIEW = 5; + */ + public static final int ENCRYPTION_VIEW_VALUE = 5; + + /** + * + * + *
+     * Populates all fields.
+     * 
+ * + * FULL = 4; + */ + public static final int FULL_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static View valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static View forNumber(int value) { + switch (value) { + case 0: + return VIEW_UNSPECIFIED; + case 1: + return NAME_ONLY; + case 2: + return SCHEMA_VIEW; + case 3: + return REPLICATION_VIEW; + case 5: + return ENCRYPTION_VIEW; + case 4: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public View findValueByNumber(int number) { + return View.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Table.getDescriptor().getEnumTypes().get(1); + } + + private static final View[] VALUES = values(); + + public static View valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private View(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Table.View) + } + + public interface ClusterStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Table.ClusterState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The state of replication for the table in this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for replicationState. + */ + int getReplicationStateValue(); + + /** + * + * + *
+     * Output only. The state of replication for the table in this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The replicationState. + */ + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getReplicationState(); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEncryptionInfoList(); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEncryptionInfoCount(); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEncryptionInfoOrBuilderList(); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(int index); + } + + /** + * + * + *
+   * The state of a table's data in a particular cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table.ClusterState} + */ + public static final class ClusterState extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Table.ClusterState) + ClusterStateOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClusterState"); + } + + // Use ClusterState.newBuilder() to construct. + private ClusterState(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClusterState() { + replicationState_ = 0; + encryptionInfo_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.ClusterState.class, + com.google.bigtable.admin.v2.Table.ClusterState.Builder.class); + } + + /** + * + * + *
+     * Table replication states.
+     * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.Table.ClusterState.ReplicationState} + */ + public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The replication state of the table is unknown in this cluster.
+       * 
+ * + * STATE_NOT_KNOWN = 0; + */ + STATE_NOT_KNOWN(0), + /** + * + * + *
+       * The cluster was recently created, and the table must finish copying
+       * over pre-existing data from other clusters before it can begin
+       * receiving live replication updates and serving Data API requests.
+       * 
+ * + * INITIALIZING = 1; + */ + INITIALIZING(1), + /** + * + * + *
+       * The table is temporarily unable to serve Data API requests from this
+       * cluster due to planned internal maintenance.
+       * 
+ * + * PLANNED_MAINTENANCE = 2; + */ + PLANNED_MAINTENANCE(2), + /** + * + * + *
+       * The table is temporarily unable to serve Data API requests from this
+       * cluster due to unplanned or emergency maintenance.
+       * 
+ * + * UNPLANNED_MAINTENANCE = 3; + */ + UNPLANNED_MAINTENANCE(3), + /** + * + * + *
+       * The table can serve Data API requests from this cluster. Depending on
+       * replication delay, reads may not immediately reflect the state of the
+       * table in other clusters.
+       * 
+ * + * READY = 4; + */ + READY(4), + /** + * + * + *
+       * The table is fully created and ready for use after a restore, and is
+       * being optimized for performance. When optimizations are complete, the
+       * table will transition to `READY` state.
+       * 
+ * + * READY_OPTIMIZING = 5; + */ + READY_OPTIMIZING(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicationState"); + } + + /** + * + * + *
+       * The replication state of the table is unknown in this cluster.
+       * 
+ * + * STATE_NOT_KNOWN = 0; + */ + public static final int STATE_NOT_KNOWN_VALUE = 0; + + /** + * + * + *
+       * The cluster was recently created, and the table must finish copying
+       * over pre-existing data from other clusters before it can begin
+       * receiving live replication updates and serving Data API requests.
+       * 
+ * + * INITIALIZING = 1; + */ + public static final int INITIALIZING_VALUE = 1; + + /** + * + * + *
+       * The table is temporarily unable to serve Data API requests from this
+       * cluster due to planned internal maintenance.
+       * 
+ * + * PLANNED_MAINTENANCE = 2; + */ + public static final int PLANNED_MAINTENANCE_VALUE = 2; + + /** + * + * + *
+       * The table is temporarily unable to serve Data API requests from this
+       * cluster due to unplanned or emergency maintenance.
+       * 
+ * + * UNPLANNED_MAINTENANCE = 3; + */ + public static final int UNPLANNED_MAINTENANCE_VALUE = 3; + + /** + * + * + *
+       * The table can serve Data API requests from this cluster. Depending on
+       * replication delay, reads may not immediately reflect the state of the
+       * table in other clusters.
+       * 
+ * + * READY = 4; + */ + public static final int READY_VALUE = 4; + + /** + * + * + *
+       * The table is fully created and ready for use after a restore, and is
+       * being optimized for performance. When optimizations are complete, the
+       * table will transition to `READY` state.
+       * 
+ * + * READY_OPTIMIZING = 5; + */ + public static final int READY_OPTIMIZING_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReplicationState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReplicationState forNumber(int value) { + switch (value) { + case 0: + return STATE_NOT_KNOWN; + case 1: + return INITIALIZING; + case 2: + return PLANNED_MAINTENANCE; + case 3: + return UNPLANNED_MAINTENANCE; + case 4: + return READY; + case 5: + return READY_OPTIMIZING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReplicationState findValueByNumber(int number) { + return ReplicationState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Table.ClusterState.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ReplicationState[] VALUES = values(); + + public static ReplicationState valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReplicationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Table.ClusterState.ReplicationState) + } + + public static final int REPLICATION_STATE_FIELD_NUMBER = 1; + private int replicationState_ = 0; + + /** + * + * + *
+     * Output only. The state of replication for the table in this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for replicationState. + */ + @java.lang.Override + public int getReplicationStateValue() { + return replicationState_; + } + + /** + * + * + *
+     * Output only. The state of replication for the table in this cluster.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The replicationState. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getReplicationState() { + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState result = + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.forNumber( + replicationState_); + return result == null + ? com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNRECOGNIZED + : result; + } + + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List encryptionInfo_; + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getEncryptionInfoList() { + return encryptionInfo_; + } + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getEncryptionInfoOrBuilderList() { + return encryptionInfo_; + } + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getEncryptionInfoCount() { + return encryptionInfo_.size(); + } + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) { + return encryptionInfo_.get(index); + } + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder( + int index) { + return encryptionInfo_.get(index); + } + + 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 (replicationState_ + != com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.STATE_NOT_KNOWN + .getNumber()) { + output.writeEnum(1, replicationState_); + } + for (int i = 0; i < encryptionInfo_.size(); i++) { + output.writeMessage(2, encryptionInfo_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (replicationState_ + != com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.STATE_NOT_KNOWN + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, replicationState_); + } + for (int i = 0; i < encryptionInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, encryptionInfo_.get(i)); + } + size += getUnknownFields().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.admin.v2.Table.ClusterState)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Table.ClusterState other = + (com.google.bigtable.admin.v2.Table.ClusterState) obj; + + if (replicationState_ != other.replicationState_) return false; + if (!getEncryptionInfoList().equals(other.getEncryptionInfoList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REPLICATION_STATE_FIELD_NUMBER; + hash = (53 * hash) + replicationState_; + if (getEncryptionInfoCount() > 0) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfoList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState 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.admin.v2.Table.ClusterState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState 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.admin.v2.Table.ClusterState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Table.ClusterState 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * The state of a table's data in a particular cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table.ClusterState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Table.ClusterState) + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.ClusterState.class, + com.google.bigtable.admin.v2.Table.ClusterState.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Table.ClusterState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + replicationState_ = 0; + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = java.util.Collections.emptyList(); + } else { + encryptionInfo_ = null; + encryptionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Table.ClusterState.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState build() { + com.google.bigtable.admin.v2.Table.ClusterState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState buildPartial() { + com.google.bigtable.admin.v2.Table.ClusterState result = + new com.google.bigtable.admin.v2.Table.ClusterState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.admin.v2.Table.ClusterState result) { + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + encryptionInfo_ = java.util.Collections.unmodifiableList(encryptionInfo_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.encryptionInfo_ = encryptionInfo_; + } else { + result.encryptionInfo_ = encryptionInfoBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.Table.ClusterState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.replicationState_ = replicationState_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Table.ClusterState) { + return mergeFrom((com.google.bigtable.admin.v2.Table.ClusterState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Table.ClusterState other) { + if (other == com.google.bigtable.admin.v2.Table.ClusterState.getDefaultInstance()) + return this; + if (other.replicationState_ != 0) { + setReplicationStateValue(other.getReplicationStateValue()); + } + if (encryptionInfoBuilder_ == null) { + if (!other.encryptionInfo_.isEmpty()) { + if (encryptionInfo_.isEmpty()) { + encryptionInfo_ = other.encryptionInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.addAll(other.encryptionInfo_); + } + onChanged(); + } + } else { + if (!other.encryptionInfo_.isEmpty()) { + if (encryptionInfoBuilder_.isEmpty()) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + encryptionInfo_ = other.encryptionInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + encryptionInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEncryptionInfoFieldBuilder() + : null; + } else { + encryptionInfoBuilder_.addAllMessages(other.encryptionInfo_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + replicationState_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.bigtable.admin.v2.EncryptionInfo m = + input.readMessage( + com.google.bigtable.admin.v2.EncryptionInfo.parser(), extensionRegistry); + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(m); + } else { + encryptionInfoBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int replicationState_ = 0; + + /** + * + * + *
+       * Output only. The state of replication for the table in this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for replicationState. + */ + @java.lang.Override + public int getReplicationStateValue() { + return replicationState_; + } + + /** + * + * + *
+       * Output only. The state of replication for the table in this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for replicationState to set. + * @return This builder for chaining. + */ + public Builder setReplicationStateValue(int value) { + replicationState_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The state of replication for the table in this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The replicationState. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState + getReplicationState() { + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState result = + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.forNumber( + replicationState_); + return result == null + ? com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Output only. The state of replication for the table in this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The replicationState to set. + * @return This builder for chaining. + */ + public Builder setReplicationState( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + replicationState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The state of replication for the table in this cluster.
+       * 
+ * + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearReplicationState() { + bitField0_ = (bitField0_ & ~0x00000001); + replicationState_ = 0; + onChanged(); + return this; + } + + private java.util.List encryptionInfo_ = + java.util.Collections.emptyList(); + + private void ensureEncryptionInfoIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + encryptionInfo_ = + new java.util.ArrayList(encryptionInfo_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEncryptionInfoList() { + if (encryptionInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(encryptionInfo_); + } else { + return encryptionInfoBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEncryptionInfoCount() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.size(); + } else { + return encryptionInfoBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.get(index); + } else { + return encryptionInfoBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.set(index, value); + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(value); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(index, value); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEncryptionInfo( + java.lang.Iterable values) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, encryptionInfo_); + onChanged(); + } else { + encryptionInfoBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + encryptionInfoBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEncryptionInfo(int index) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.remove(index); + onChanged(); + } else { + encryptionInfoBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder( + int index) { + return internalGetEncryptionInfoFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder( + int index) { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.get(index); + } else { + return encryptionInfoBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEncryptionInfoOrBuilderList() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(encryptionInfo_); + } + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder() { + return internalGetEncryptionInfoFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder( + int index) { + return internalGetEncryptionInfoFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); + } + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEncryptionInfoBuilderList() { + return internalGetEncryptionInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + internalGetEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( + encryptionInfo_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Table.ClusterState) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Table.ClusterState) + private static final com.google.bigtable.admin.v2.Table.ClusterState DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Table.ClusterState(); + } + + public static com.google.bigtable.admin.v2.Table.ClusterState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Table.ClusterState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return Whether the frequency field is set. + */ + boolean hasFrequency(); + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return The frequency. + */ + com.google.protobuf.Duration getFrequency(); + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder(); + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the locations. + */ + java.util.List getLocationsList(); + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of locations. + */ + int getLocationsCount(); + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The locations at the given index. + */ + java.lang.String getLocations(int index); + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the locations at the given index. + */ + com.google.protobuf.ByteString getLocationsBytes(int index); + } + + /** + * + * + *
+   * Defines an automated backup policy for a table
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table.AutomatedBackupPolicy} + */ + public static final class AutomatedBackupPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + AutomatedBackupPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AutomatedBackupPolicy"); + } + + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AutomatedBackupPolicy() { + locations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.class, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder.class); + } + + private int bitField0_; + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the retentionPeriod field is set. + */ + @java.lang.Override + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The retentionPeriod. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetentionPeriod() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + /** + * + * + *
+     * Required. How long the automated backups should be retained. Values must
+     * be at least 3 days and at most 90 days.
+     * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + + public static final int FREQUENCY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration frequency_; + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return Whether the frequency field is set. + */ + @java.lang.Override + public boolean hasFrequency() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return The frequency. + */ + @java.lang.Override + public com.google.protobuf.Duration getFrequency() { + return frequency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : frequency_; + } + + /** + * + * + *
+     * How frequently automated backups should occur. The only supported value
+     * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+     * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder() { + return frequency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : frequency_; + } + + public static final int LOCATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList locations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the locations. + */ + public com.google.protobuf.ProtocolStringList getLocationsList() { + return locations_; + } + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of locations. + */ + public int getLocationsCount() { + return locations_.size(); + } + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The locations at the given index. + */ + public java.lang.String getLocations(int index) { + return locations_.get(index); + } + + /** + * + * + *
+     * Optional. A list of Cloud Bigtable zones where automated backups are
+     * allowed to be created. If empty, automated backups will be created in all
+     * zones of the instance. Locations are in the format
+     * `projects/{project}/locations/{zone}`.
+     * This field can only set for tables in Enterprise Plus instances.
+     * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the locations at the given index. + */ + public com.google.protobuf.ByteString getLocationsBytes(int index) { + return locations_.getByteString(index); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRetentionPeriod()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getFrequency()); + } + for (int i = 0; i < locations_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, locations_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetentionPeriod()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFrequency()); + } + { + int dataSize = 0; + for (int i = 0; i < locations_.size(); i++) { + dataSize += computeStringSizeNoTag(locations_.getRaw(i)); + } + size += dataSize; + size += 1 * getLocationsList().size(); + } + size += getUnknownFields().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.admin.v2.Table.AutomatedBackupPolicy)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy other = + (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) obj; + + if (hasRetentionPeriod() != other.hasRetentionPeriod()) return false; + if (hasRetentionPeriod()) { + if (!getRetentionPeriod().equals(other.getRetentionPeriod())) return false; + } + if (hasFrequency() != other.hasFrequency()) return false; + if (hasFrequency()) { + if (!getFrequency().equals(other.getFrequency())) return false; + } + if (!getLocationsList().equals(other.getLocationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRetentionPeriod()) { + hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPeriod().hashCode(); + } + if (hasFrequency()) { + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + getFrequency().hashCode(); + } + if (getLocationsCount() > 0) { + hash = (37 * hash) + LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy 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.admin.v2.Table.AutomatedBackupPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy 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.admin.v2.Table.AutomatedBackupPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Table.AutomatedBackupPolicy 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Defines an automated backup policy for a table
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table.AutomatedBackupPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.class, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetentionPeriodFieldBuilder(); + internalGetFrequencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + frequency_ = null; + if (frequencyBuilder_ != null) { + frequencyBuilder_.dispose(); + frequencyBuilder_ = null; + } + locations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy build() { + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy buildPartial() { + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy result = + new com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retentionPeriod_ = + retentionPeriodBuilder_ == null ? retentionPeriod_ : retentionPeriodBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.frequency_ = frequencyBuilder_ == null ? frequency_ : frequencyBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + locations_.makeImmutable(); + result.locations_ = locations_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) { + return mergeFrom((com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy other) { + if (other == com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance()) + return this; + if (other.hasRetentionPeriod()) { + mergeRetentionPeriod(other.getRetentionPeriod()); + } + if (other.hasFrequency()) { + mergeFrequency(other.getFrequency()); + } + if (!other.locations_.isEmpty()) { + if (locations_.isEmpty()) { + locations_ = other.locations_; + bitField0_ |= 0x00000004; + } else { + ensureLocationsIsMutable(); + locations_.addAll(other.locations_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetFrequencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLocationsIsMutable(); + locations_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the retentionPeriod field is set. + */ + public boolean hasRetentionPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The retentionPeriod. + */ + public com.google.protobuf.Duration getRetentionPeriod() { + if (retentionPeriodBuilder_ == null) { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } else { + return retentionPeriodBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPeriod_ = value; + } else { + retentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (retentionPeriodBuilder_ == null) { + retentionPeriod_ = builderForValue.build(); + } else { + retentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRetentionPeriod(com.google.protobuf.Duration value) { + if (retentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retentionPeriod_ != null + && retentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetentionPeriodBuilder().mergeFrom(value); + } else { + retentionPeriod_ = value; + } + } else { + retentionPeriodBuilder_.mergeFrom(value); + } + if (retentionPeriod_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + retentionPeriod_ = null; + if (retentionPeriodBuilder_ != null) { + retentionPeriodBuilder_.dispose(); + retentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRetentionPeriodFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder() { + if (retentionPeriodBuilder_ != null) { + return retentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return retentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : retentionPeriod_; + } + } + + /** + * + * + *
+       * Required. How long the automated backups should be retained. Values must
+       * be at least 3 days and at most 90 days.
+       * 
+ * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + private com.google.protobuf.Duration frequency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + frequencyBuilder_; + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return Whether the frequency field is set. + */ + public boolean hasFrequency() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + * + * @return The frequency. + */ + public com.google.protobuf.Duration getFrequency() { + if (frequencyBuilder_ == null) { + return frequency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frequency_; + } else { + return frequencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public Builder setFrequency(com.google.protobuf.Duration value) { + if (frequencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + frequency_ = value; + } else { + frequencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public Builder setFrequency(com.google.protobuf.Duration.Builder builderForValue) { + if (frequencyBuilder_ == null) { + frequency_ = builderForValue.build(); + } else { + frequencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public Builder mergeFrequency(com.google.protobuf.Duration value) { + if (frequencyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && frequency_ != null + && frequency_ != com.google.protobuf.Duration.getDefaultInstance()) { + getFrequencyBuilder().mergeFrom(value); + } else { + frequency_ = value; + } + } else { + frequencyBuilder_.mergeFrom(value); + } + if (frequency_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000002); + frequency_ = null; + if (frequencyBuilder_ != null) { + frequencyBuilder_.dispose(); + frequencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public com.google.protobuf.Duration.Builder getFrequencyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFrequencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + public com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder() { + if (frequencyBuilder_ != null) { + return frequencyBuilder_.getMessageOrBuilder(); + } else { + return frequency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frequency_; + } + } + + /** + * + * + *
+       * How frequently automated backups should occur. The only supported value
+       * at this time is 24 hours. An undefined frequency is treated as 24 hours.
+       * 
+ * + * .google.protobuf.Duration frequency = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetFrequencyFieldBuilder() { + if (frequencyBuilder_ == null) { + frequencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getFrequency(), getParentForChildren(), isClean()); + frequency_ = null; + } + return frequencyBuilder_; + } + + private com.google.protobuf.LazyStringArrayList locations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureLocationsIsMutable() { + if (!locations_.isModifiable()) { + locations_ = new com.google.protobuf.LazyStringArrayList(locations_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the locations. + */ + public com.google.protobuf.ProtocolStringList getLocationsList() { + locations_.makeImmutable(); + return locations_; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of locations. + */ + public int getLocationsCount() { + return locations_.size(); + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The locations at the given index. + */ + public java.lang.String getLocations(int index) { + return locations_.get(index); + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the locations at the given index. + */ + public com.google.protobuf.ByteString getLocationsBytes(int index) { + return locations_.getByteString(index); + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The locations to set. + * @return This builder for chaining. + */ + public Builder setLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The locations to add. + * @return This builder for chaining. + */ + public Builder addLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationsIsMutable(); + locations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param values The locations to add. + * @return This builder for chaining. + */ + public Builder addAllLocations(java.lang.Iterable values) { + ensureLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, locations_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLocations() { + locations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. A list of Cloud Bigtable zones where automated backups are
+       * allowed to be created. If empty, automated backups will be created in all
+       * zones of the instance. Locations are in the format
+       * `projects/{project}/locations/{zone}`.
+       * This field can only set for tables in Enterprise Plus instances.
+       * 
+ * + * + * repeated string locations = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the locations to add. + * @return This builder for chaining. + */ + public Builder addLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLocationsIsMutable(); + locations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + private static final com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomatedBackupPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Table.AutomatedBackupPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int automatedBackupConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object automatedBackupConfig_; + + public enum AutomatedBackupConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTOMATED_BACKUP_POLICY(13), + AUTOMATEDBACKUPCONFIG_NOT_SET(0); + private final int value; + + private AutomatedBackupConfigCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AutomatedBackupConfigCase valueOf(int value) { + return forNumber(value); + } + + public static AutomatedBackupConfigCase forNumber(int value) { + switch (value) { + case 13: + return AUTOMATED_BACKUP_POLICY; + case 0: + return AUTOMATEDBACKUPCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AutomatedBackupConfigCase getAutomatedBackupConfigCase() { + return AutomatedBackupConfigCase.forNumber(automatedBackupConfigCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+   * 
+ * + * string name = 1; + * + * @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 CLUSTER_STATES_FIELD_NUMBER = 2; + + private static final class ClusterStatesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.Table.ClusterState.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + clusterStates_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + internalGetClusterStates() { + if (clusterStates_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ClusterStatesDefaultEntryHolder.defaultEntry); + } + return clusterStates_; + } + + public int getClusterStatesCount() { + return internalGetClusterStates().getMap().size(); + } + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public boolean containsClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusterStates().getMap().containsKey(key); + } + + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getClusterStates() { + return getClusterStatesMap(); + } + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.Map + getClusterStatesMap() { + return internalGetClusterStates().getMap(); + } + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusterStates().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusterStates().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COLUMN_FAMILIES_FIELD_NUMBER = 3; + + private static final class ColumnFamiliesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + columnFamilies_; + + private com.google.protobuf.MapField + internalGetColumnFamilies() { + if (columnFamilies_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ColumnFamiliesDefaultEntryHolder.defaultEntry); + } + return columnFamilies_; + } + + public int getColumnFamiliesCount() { + return internalGetColumnFamilies().getMap().size(); + } + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public boolean containsColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetColumnFamilies().getMap().containsKey(key); + } + + /** Use {@link #getColumnFamiliesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getColumnFamilies() { + return getColumnFamiliesMap(); + } + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public java.util.Map + getColumnFamiliesMap() { + return internalGetColumnFamilies().getMap(); + } + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetColumnFamilies().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetColumnFamilies().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int GRANULARITY_FIELD_NUMBER = 4; + private int granularity_ = 0; + + /** + * + * + *
+   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+   * in this table. Timestamps not matching the granularity will be rejected. If
+   * unspecified at creation time, the value will be set to `MILLIS`. Views:
+   * `SCHEMA_VIEW`, `FULL`.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for granularity. + */ + @java.lang.Override + public int getGranularityValue() { + return granularity_; + } + + /** + * + * + *
+   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+   * in this table. Timestamps not matching the granularity will be rejected. If
+   * unspecified at creation time, the value will be set to `MILLIS`. Views:
+   * `SCHEMA_VIEW`, `FULL`.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The granularity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { + com.google.bigtable.admin.v2.Table.TimestampGranularity result = + com.google.bigtable.admin.v2.Table.TimestampGranularity.forNumber(granularity_); + return result == null + ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED + : result; + } + + public static final int RESTORE_INFO_FIELD_NUMBER = 6; + private com.google.bigtable.admin.v2.RestoreInfo restoreInfo_; + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + @java.lang.Override + public boolean hasRestoreInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo() { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + + public static final int CHANGE_STREAM_CONFIG_FIELD_NUMBER = 8; + private com.google.bigtable.admin.v2.ChangeStreamConfig changeStreamConfig_; + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return Whether the changeStreamConfig field is set. + */ + @java.lang.Override + public boolean hasChangeStreamConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return The changeStreamConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfig getChangeStreamConfig() { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder getChangeStreamConfigOrBuilder() { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + + public static final int DELETION_PROTECTION_FIELD_NUMBER = 9; + private boolean deletionProtection_ = false; + + /** + * + * + *
+   * Set to true to make the table protected against data loss. i.e. deleting
+   * the following resources through Admin APIs are prohibited:
+   *
+   * * The table.
+   * * The column families in the table.
+   * * The instance containing the table.
+   *
+   * Note one can still delete the data stored in the table through Data APIs.
+   * 
+ * + * bool deletion_protection = 9; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + public static final int AUTOMATED_BACKUP_POLICY_FIELD_NUMBER = 13; + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupConfigCase_ == 13; + } + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + + public static final int TIERED_STORAGE_CONFIG_FIELD_NUMBER = 14; + private com.google.bigtable.admin.v2.TieredStorageConfig tieredStorageConfig_; + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return Whether the tieredStorageConfig field is set. + */ + @java.lang.Override + public boolean hasTieredStorageConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return The tieredStorageConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageConfig getTieredStorageConfig() { + return tieredStorageConfig_ == null + ? com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance() + : tieredStorageConfig_; + } + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder + getTieredStorageConfigOrBuilder() { + return tieredStorageConfig_ == null + ? com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance() + : tieredStorageConfig_; + } + + public static final int ROW_KEY_SCHEMA_FIELD_NUMBER = 15; + private com.google.bigtable.admin.v2.Type.Struct rowKeySchema_; + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return Whether the rowKeySchema field is set. + */ + @java.lang.Override + public boolean hasRowKeySchema() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return The rowKeySchema. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct getRowKeySchema() { + return rowKeySchema_ == null + ? com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance() + : rowKeySchema_; + } + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.StructOrBuilder getRowKeySchemaOrBuilder() { + return rowKeySchema_ == null + ? com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance() + : rowKeySchema_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetClusterStates(), ClusterStatesDefaultEntryHolder.defaultEntry, 2); + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetColumnFamilies(), ColumnFamiliesDefaultEntryHolder.defaultEntry, 3); + if (granularity_ + != com.google.bigtable.admin.v2.Table.TimestampGranularity.TIMESTAMP_GRANULARITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, granularity_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getRestoreInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getChangeStreamConfig()); + } + if (deletionProtection_ != false) { + output.writeBool(9, deletionProtection_); + } + if (automatedBackupConfigCase_ == 13) { + output.writeMessage( + 13, (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(14, getTieredStorageConfig()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(15, getRowKeySchema()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (java.util.Map.Entry + entry : internalGetClusterStates().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + clusterStates__ = + ClusterStatesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, clusterStates__); + } + for (java.util.Map.Entry entry : + internalGetColumnFamilies().getMap().entrySet()) { + com.google.protobuf.MapEntry + columnFamilies__ = + ColumnFamiliesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, columnFamilies__); + } + if (granularity_ + != com.google.bigtable.admin.v2.Table.TimestampGranularity.TIMESTAMP_GRANULARITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, granularity_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRestoreInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getChangeStreamConfig()); + } + if (deletionProtection_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, deletionProtection_); + } + if (automatedBackupConfigCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, + (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(14, getTieredStorageConfig()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getRowKeySchema()); + } + size += getUnknownFields().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.admin.v2.Table)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Table other = (com.google.bigtable.admin.v2.Table) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetClusterStates().equals(other.internalGetClusterStates())) return false; + if (!internalGetColumnFamilies().equals(other.internalGetColumnFamilies())) return false; + if (granularity_ != other.granularity_) return false; + if (hasRestoreInfo() != other.hasRestoreInfo()) return false; + if (hasRestoreInfo()) { + if (!getRestoreInfo().equals(other.getRestoreInfo())) return false; + } + if (hasChangeStreamConfig() != other.hasChangeStreamConfig()) return false; + if (hasChangeStreamConfig()) { + if (!getChangeStreamConfig().equals(other.getChangeStreamConfig())) return false; + } + if (getDeletionProtection() != other.getDeletionProtection()) return false; + if (hasTieredStorageConfig() != other.hasTieredStorageConfig()) return false; + if (hasTieredStorageConfig()) { + if (!getTieredStorageConfig().equals(other.getTieredStorageConfig())) return false; + } + if (hasRowKeySchema() != other.hasRowKeySchema()) return false; + if (hasRowKeySchema()) { + if (!getRowKeySchema().equals(other.getRowKeySchema())) return false; + } + if (!getAutomatedBackupConfigCase().equals(other.getAutomatedBackupConfigCase())) return false; + switch (automatedBackupConfigCase_) { + case 13: + if (!getAutomatedBackupPolicy().equals(other.getAutomatedBackupPolicy())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (!internalGetClusterStates().getMap().isEmpty()) { + hash = (37 * hash) + CLUSTER_STATES_FIELD_NUMBER; + hash = (53 * hash) + internalGetClusterStates().hashCode(); + } + if (!internalGetColumnFamilies().getMap().isEmpty()) { + hash = (37 * hash) + COLUMN_FAMILIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetColumnFamilies().hashCode(); + } + hash = (37 * hash) + GRANULARITY_FIELD_NUMBER; + hash = (53 * hash) + granularity_; + if (hasRestoreInfo()) { + hash = (37 * hash) + RESTORE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRestoreInfo().hashCode(); + } + if (hasChangeStreamConfig()) { + hash = (37 * hash) + CHANGE_STREAM_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getChangeStreamConfig().hashCode(); + } + hash = (37 * hash) + DELETION_PROTECTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtection()); + if (hasTieredStorageConfig()) { + hash = (37 * hash) + TIERED_STORAGE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getTieredStorageConfig().hashCode(); + } + if (hasRowKeySchema()) { + hash = (37 * hash) + ROW_KEY_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getRowKeySchema().hashCode(); + } + switch (automatedBackupConfigCase_) { + case 13: + hash = (37 * hash) + AUTOMATED_BACKUP_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAutomatedBackupPolicy().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Table parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table 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.admin.v2.Table parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table 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.admin.v2.Table parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Table parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Table parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Table parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Table 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A collection of user data indexed by row, column, and timestamp.
+   * Each table is served using the resources of its parent cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Table} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Table) + com.google.bigtable.admin.v2.TableOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetClusterStates(); + case 3: + return internalGetColumnFamilies(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableClusterStates(); + case 3: + return internalGetMutableColumnFamilies(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Table.class, + com.google.bigtable.admin.v2.Table.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Table.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRestoreInfoFieldBuilder(); + internalGetChangeStreamConfigFieldBuilder(); + internalGetTieredStorageConfigFieldBuilder(); + internalGetRowKeySchemaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableClusterStates().clear(); + internalGetMutableColumnFamilies().clear(); + granularity_ = 0; + restoreInfo_ = null; + if (restoreInfoBuilder_ != null) { + restoreInfoBuilder_.dispose(); + restoreInfoBuilder_ = null; + } + changeStreamConfig_ = null; + if (changeStreamConfigBuilder_ != null) { + changeStreamConfigBuilder_.dispose(); + changeStreamConfigBuilder_ = null; + } + deletionProtection_ = false; + if (automatedBackupPolicyBuilder_ != null) { + automatedBackupPolicyBuilder_.clear(); + } + tieredStorageConfig_ = null; + if (tieredStorageConfigBuilder_ != null) { + tieredStorageConfigBuilder_.dispose(); + tieredStorageConfigBuilder_ = null; + } + rowKeySchema_ = null; + if (rowKeySchemaBuilder_ != null) { + rowKeySchemaBuilder_.dispose(); + rowKeySchemaBuilder_ = null; + } + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Table.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table build() { + com.google.bigtable.admin.v2.Table result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table buildPartial() { + com.google.bigtable.admin.v2.Table result = new com.google.bigtable.admin.v2.Table(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Table result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterStates_ = + internalGetClusterStates().build(ClusterStatesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.columnFamilies_ = + internalGetColumnFamilies().build(ColumnFamiliesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.granularity_ = granularity_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.restoreInfo_ = + restoreInfoBuilder_ == null ? restoreInfo_ : restoreInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.changeStreamConfig_ = + changeStreamConfigBuilder_ == null + ? changeStreamConfig_ + : changeStreamConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.deletionProtection_ = deletionProtection_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tieredStorageConfig_ = + tieredStorageConfigBuilder_ == null + ? tieredStorageConfig_ + : tieredStorageConfigBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.rowKeySchema_ = + rowKeySchemaBuilder_ == null ? rowKeySchema_ : rowKeySchemaBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Table result) { + result.automatedBackupConfigCase_ = automatedBackupConfigCase_; + result.automatedBackupConfig_ = this.automatedBackupConfig_; + if (automatedBackupConfigCase_ == 13 && automatedBackupPolicyBuilder_ != null) { + result.automatedBackupConfig_ = automatedBackupPolicyBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Table) { + return mergeFrom((com.google.bigtable.admin.v2.Table) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Table other) { + if (other == com.google.bigtable.admin.v2.Table.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableClusterStates().mergeFrom(other.internalGetClusterStates()); + bitField0_ |= 0x00000002; + internalGetMutableColumnFamilies().mergeFrom(other.internalGetColumnFamilies()); + bitField0_ |= 0x00000004; + if (other.granularity_ != 0) { + setGranularityValue(other.getGranularityValue()); + } + if (other.hasRestoreInfo()) { + mergeRestoreInfo(other.getRestoreInfo()); + } + if (other.hasChangeStreamConfig()) { + mergeChangeStreamConfig(other.getChangeStreamConfig()); + } + if (other.getDeletionProtection() != false) { + setDeletionProtection(other.getDeletionProtection()); + } + if (other.hasTieredStorageConfig()) { + mergeTieredStorageConfig(other.getTieredStorageConfig()); + } + if (other.hasRowKeySchema()) { + mergeRowKeySchema(other.getRowKeySchema()); + } + switch (other.getAutomatedBackupConfigCase()) { + case AUTOMATED_BACKUP_POLICY: + { + mergeAutomatedBackupPolicy(other.getAutomatedBackupPolicy()); + break; + } + case AUTOMATEDBACKUPCONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + clusterStates__ = + input.readMessage( + ClusterStatesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableClusterStates() + .ensureBuilderMap() + .put(clusterStates__.getKey(), clusterStates__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + columnFamilies__ = + input.readMessage( + ColumnFamiliesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableColumnFamilies() + .ensureBuilderMap() + .put(columnFamilies__.getKey(), columnFamilies__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + granularity_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + input.readMessage( + internalGetRestoreInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 66: + { + input.readMessage( + internalGetChangeStreamConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 72: + { + deletionProtection_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 106: + { + input.readMessage( + internalGetAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); + automatedBackupConfigCase_ = 13; + break; + } // case 106 + case 114: + { + input.readMessage( + internalGetTieredStorageConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 114 + case 122: + { + input.readMessage( + internalGetRowKeySchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int automatedBackupConfigCase_ = 0; + private java.lang.Object automatedBackupConfig_; + + public AutomatedBackupConfigCase getAutomatedBackupConfigCase() { + return AutomatedBackupConfigCase.forNumber(automatedBackupConfigCase_); + } + + public Builder clearAutomatedBackupConfig() { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class ClusterStatesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState> { + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState build( + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.Table.ClusterState) { + return (com.google.bigtable.admin.v2.Table.ClusterState) val; + } + return ((com.google.bigtable.admin.v2.Table.ClusterState.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + defaultEntry() { + return ClusterStatesDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final ClusterStatesConverter clusterStatesConverter = + new ClusterStatesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState, + com.google.bigtable.admin.v2.Table.ClusterState.Builder> + clusterStates_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState, + com.google.bigtable.admin.v2.Table.ClusterState.Builder> + internalGetClusterStates() { + if (clusterStates_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(clusterStatesConverter); + } + return clusterStates_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState, + com.google.bigtable.admin.v2.Table.ClusterState.Builder> + internalGetMutableClusterStates() { + if (clusterStates_ == null) { + clusterStates_ = new com.google.protobuf.MapFieldBuilder<>(clusterStatesConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return clusterStates_; + } + + public int getClusterStatesCount() { + return internalGetClusterStates().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public boolean containsClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusterStates().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getClusterStates() { + return getClusterStatesMap(); + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.Map + getClusterStatesMap() { + return internalGetClusterStates().getImmutableMap(); + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableClusterStates().ensureBuilderMap(); + return map.containsKey(key) ? clusterStatesConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableClusterStates().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return clusterStatesConverter.build(map.get(key)); + } + + public Builder clearClusterStates() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableClusterStates().clear(); + return this; + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableClusterStates().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableClusterStates() { + bitField0_ |= 0x00000002; + return internalGetMutableClusterStates().ensureMessageMap(); + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putClusterStates( + java.lang.String key, com.google.bigtable.admin.v2.Table.ClusterState value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableClusterStates().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putAllClusterStates( + java.util.Map values) { + for (java.util.Map.Entry + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableClusterStates().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
+     * Output only. Map from cluster ID to per-cluster table state.
+     * If it could not be determined whether or not the table has data in a
+     * particular cluster (for example, if its zone is unavailable), then
+     * there will be an entry for the cluster with UNKNOWN `replication_status`.
+     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+     * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.Table.ClusterState.Builder putClusterStatesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableClusterStates().ensureBuilderMap(); + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.Table.ClusterState.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.Table.ClusterState) { + entry = ((com.google.bigtable.admin.v2.Table.ClusterState) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.Table.ClusterState.Builder) entry; + } + + private static final class ColumnFamiliesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily> { + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily build( + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.ColumnFamily) { + return (com.google.bigtable.admin.v2.ColumnFamily) val; + } + return ((com.google.bigtable.admin.v2.ColumnFamily.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + defaultEntry() { + return ColumnFamiliesDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final ColumnFamiliesConverter columnFamiliesConverter = + new ColumnFamiliesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder> + columnFamilies_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder> + internalGetColumnFamilies() { + if (columnFamilies_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(columnFamiliesConverter); + } + return columnFamilies_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder> + internalGetMutableColumnFamilies() { + if (columnFamilies_ == null) { + columnFamilies_ = new com.google.protobuf.MapFieldBuilder<>(columnFamiliesConverter); + } + bitField0_ |= 0x00000004; + onChanged(); + return columnFamilies_; + } + + public int getColumnFamiliesCount() { + return internalGetColumnFamilies().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public boolean containsColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetColumnFamilies().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getColumnFamiliesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getColumnFamilies() { + return getColumnFamiliesMap(); + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public java.util.Map + getColumnFamiliesMap() { + return internalGetColumnFamilies().getImmutableMap(); + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableColumnFamilies().ensureBuilderMap(); + return map.containsKey(key) ? columnFamiliesConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableColumnFamilies().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return columnFamiliesConverter.build(map.get(key)); + } + + public Builder clearColumnFamilies() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableColumnFamilies().clear(); + return this; + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder removeColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableColumnFamilies().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableColumnFamilies() { + bitField0_ |= 0x00000004; + return internalGetMutableColumnFamilies().ensureMessageMap(); + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder putColumnFamilies( + java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableColumnFamilies().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder putAllColumnFamilies( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableColumnFamilies().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * The column families configured for this table, mapped by column family ID.
+     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+     * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public com.google.bigtable.admin.v2.ColumnFamily.Builder putColumnFamiliesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableColumnFamilies().ensureBuilderMap(); + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.ColumnFamily.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.ColumnFamily) { + entry = ((com.google.bigtable.admin.v2.ColumnFamily) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.ColumnFamily.Builder) entry; + } + + private int granularity_ = 0; + + /** + * + * + *
+     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+     * in this table. Timestamps not matching the granularity will be rejected. If
+     * unspecified at creation time, the value will be set to `MILLIS`. Views:
+     * `SCHEMA_VIEW`, `FULL`.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for granularity. + */ + @java.lang.Override + public int getGranularityValue() { + return granularity_; + } + + /** + * + * + *
+     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+     * in this table. Timestamps not matching the granularity will be rejected. If
+     * unspecified at creation time, the value will be set to `MILLIS`. Views:
+     * `SCHEMA_VIEW`, `FULL`.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for granularity to set. + * @return This builder for chaining. + */ + public Builder setGranularityValue(int value) { + granularity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+     * in this table. Timestamps not matching the granularity will be rejected. If
+     * unspecified at creation time, the value will be set to `MILLIS`. Views:
+     * `SCHEMA_VIEW`, `FULL`.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The granularity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { + com.google.bigtable.admin.v2.Table.TimestampGranularity result = + com.google.bigtable.admin.v2.Table.TimestampGranularity.forNumber(granularity_); + return result == null + ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+     * in this table. Timestamps not matching the granularity will be rejected. If
+     * unspecified at creation time, the value will be set to `MILLIS`. Views:
+     * `SCHEMA_VIEW`, `FULL`.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The granularity to set. + * @return This builder for chaining. + */ + public Builder setGranularity(com.google.bigtable.admin.v2.Table.TimestampGranularity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + granularity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+     * in this table. Timestamps not matching the granularity will be rejected. If
+     * unspecified at creation time, the value will be set to `MILLIS`. Views:
+     * `SCHEMA_VIEW`, `FULL`.
+     * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearGranularity() { + bitField0_ = (bitField0_ & ~0x00000008); + granularity_ = 0; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.RestoreInfo restoreInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.RestoreInfo, + com.google.bigtable.admin.v2.RestoreInfo.Builder, + com.google.bigtable.admin.v2.RestoreInfoOrBuilder> + restoreInfoBuilder_; + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + public boolean hasRestoreInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + public com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo() { + if (restoreInfoBuilder_ == null) { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } else { + return restoreInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreInfo_ = value; + } else { + restoreInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRestoreInfo( + com.google.bigtable.admin.v2.RestoreInfo.Builder builderForValue) { + if (restoreInfoBuilder_ == null) { + restoreInfo_ = builderForValue.build(); + } else { + restoreInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && restoreInfo_ != null + && restoreInfo_ != com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance()) { + getRestoreInfoBuilder().mergeFrom(value); + } else { + restoreInfo_ = value; + } + } else { + restoreInfoBuilder_.mergeFrom(value); + } + if (restoreInfo_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRestoreInfo() { + bitField0_ = (bitField0_ & ~0x00000010); + restoreInfo_ = null; + if (restoreInfoBuilder_ != null) { + restoreInfoBuilder_.dispose(); + restoreInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.RestoreInfo.Builder getRestoreInfoBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetRestoreInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { + if (restoreInfoBuilder_ != null) { + return restoreInfoBuilder_.getMessageOrBuilder(); + } else { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + } + + /** + * + * + *
+     * Output only. If this table was restored from another data source (e.g. a
+     * backup), this field will be populated with information about the restore.
+     * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.RestoreInfo, + com.google.bigtable.admin.v2.RestoreInfo.Builder, + com.google.bigtable.admin.v2.RestoreInfoOrBuilder> + internalGetRestoreInfoFieldBuilder() { + if (restoreInfoBuilder_ == null) { + restoreInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.RestoreInfo, + com.google.bigtable.admin.v2.RestoreInfo.Builder, + com.google.bigtable.admin.v2.RestoreInfoOrBuilder>( + getRestoreInfo(), getParentForChildren(), isClean()); + restoreInfo_ = null; + } + return restoreInfoBuilder_; + } + + private com.google.bigtable.admin.v2.ChangeStreamConfig changeStreamConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder> + changeStreamConfigBuilder_; + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return Whether the changeStreamConfig field is set. + */ + public boolean hasChangeStreamConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return The changeStreamConfig. + */ + public com.google.bigtable.admin.v2.ChangeStreamConfig getChangeStreamConfig() { + if (changeStreamConfigBuilder_ == null) { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } else { + return changeStreamConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public Builder setChangeStreamConfig(com.google.bigtable.admin.v2.ChangeStreamConfig value) { + if (changeStreamConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + changeStreamConfig_ = value; + } else { + changeStreamConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public Builder setChangeStreamConfig( + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder builderForValue) { + if (changeStreamConfigBuilder_ == null) { + changeStreamConfig_ = builderForValue.build(); + } else { + changeStreamConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public Builder mergeChangeStreamConfig(com.google.bigtable.admin.v2.ChangeStreamConfig value) { + if (changeStreamConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && changeStreamConfig_ != null + && changeStreamConfig_ + != com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance()) { + getChangeStreamConfigBuilder().mergeFrom(value); + } else { + changeStreamConfig_ = value; + } + } else { + changeStreamConfigBuilder_.mergeFrom(value); + } + if (changeStreamConfig_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public Builder clearChangeStreamConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + changeStreamConfig_ = null; + if (changeStreamConfigBuilder_ != null) { + changeStreamConfigBuilder_.dispose(); + changeStreamConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public com.google.bigtable.admin.v2.ChangeStreamConfig.Builder getChangeStreamConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetChangeStreamConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder + getChangeStreamConfigOrBuilder() { + if (changeStreamConfigBuilder_ != null) { + return changeStreamConfigBuilder_.getMessageOrBuilder(); + } else { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + } + + /** + * + * + *
+     * If specified, enable the change stream on this table.
+     * Otherwise, the change stream is disabled and the change stream is not
+     * retained.
+     * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder> + internalGetChangeStreamConfigFieldBuilder() { + if (changeStreamConfigBuilder_ == null) { + changeStreamConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder>( + getChangeStreamConfig(), getParentForChildren(), isClean()); + changeStreamConfig_ = null; + } + return changeStreamConfigBuilder_; + } + + private boolean deletionProtection_; + + /** + * + * + *
+     * Set to true to make the table protected against data loss. i.e. deleting
+     * the following resources through Admin APIs are prohibited:
+     *
+     * * The table.
+     * * The column families in the table.
+     * * The instance containing the table.
+     *
+     * Note one can still delete the data stored in the table through Data APIs.
+     * 
+ * + * bool deletion_protection = 9; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + /** + * + * + *
+     * Set to true to make the table protected against data loss. i.e. deleting
+     * the following resources through Admin APIs are prohibited:
+     *
+     * * The table.
+     * * The column families in the table.
+     * * The instance containing the table.
+     *
+     * Note one can still delete the data stored in the table through Data APIs.
+     * 
+ * + * bool deletion_protection = 9; + * + * @param value The deletionProtection to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtection(boolean value) { + + deletionProtection_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Set to true to make the table protected against data loss. i.e. deleting
+     * the following resources through Admin APIs are prohibited:
+     *
+     * * The table.
+     * * The column families in the table.
+     * * The instance containing the table.
+     *
+     * Note one can still delete the data stored in the table through Data APIs.
+     * 
+ * + * bool deletion_protection = 9; + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtection() { + bitField0_ = (bitField0_ & ~0x00000040); + deletionProtection_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder> + automatedBackupPolicyBuilder_; + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupConfigCase_ == 13; + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } else { + if (automatedBackupConfigCase_ == 13) { + return automatedBackupPolicyBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + public Builder setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + automatedBackupConfig_ = value; + onChanged(); + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } + automatedBackupConfigCase_ = 13; + return this; + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + public Builder setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupConfig_ = builderForValue.build(); + onChanged(); + } else { + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); + } + automatedBackupConfigCase_ = 13; + return this; + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + public Builder mergeAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { + if (automatedBackupConfigCase_ == 13 + && automatedBackupConfig_ + != com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance()) { + automatedBackupConfig_ = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder( + (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + automatedBackupConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + automatedBackupConfig_ = value; + } + onChanged(); + } else { + if (automatedBackupConfigCase_ == 13) { + automatedBackupPolicyBuilder_.mergeFrom(value); + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } + } + automatedBackupConfigCase_ = 13; + return this; + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + public Builder clearAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + if (automatedBackupConfigCase_ == 13) { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + onChanged(); + } + } else { + if (automatedBackupConfigCase_ == 13) { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + } + automatedBackupPolicyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + return internalGetAutomatedBackupPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if ((automatedBackupConfigCase_ == 13) && (automatedBackupPolicyBuilder_ != null)) { + return automatedBackupPolicyBuilder_.getMessageOrBuilder(); + } else { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If specified, automated backups are enabled for this table.
+     * Otherwise, automated backups are disabled.
+     * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder> + internalGetAutomatedBackupPolicyFieldBuilder() { + if (automatedBackupPolicyBuilder_ == null) { + if (!(automatedBackupConfigCase_ == 13)) { + automatedBackupConfig_ = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + automatedBackupPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder>( + (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_, + getParentForChildren(), + isClean()); + automatedBackupConfig_ = null; + } + automatedBackupConfigCase_ = 13; + onChanged(); + return automatedBackupPolicyBuilder_; + } + + private com.google.bigtable.admin.v2.TieredStorageConfig tieredStorageConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageConfig, + com.google.bigtable.admin.v2.TieredStorageConfig.Builder, + com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder> + tieredStorageConfigBuilder_; + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return Whether the tieredStorageConfig field is set. + */ + public boolean hasTieredStorageConfig() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return The tieredStorageConfig. + */ + public com.google.bigtable.admin.v2.TieredStorageConfig getTieredStorageConfig() { + if (tieredStorageConfigBuilder_ == null) { + return tieredStorageConfig_ == null + ? com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance() + : tieredStorageConfig_; + } else { + return tieredStorageConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public Builder setTieredStorageConfig(com.google.bigtable.admin.v2.TieredStorageConfig value) { + if (tieredStorageConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tieredStorageConfig_ = value; + } else { + tieredStorageConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public Builder setTieredStorageConfig( + com.google.bigtable.admin.v2.TieredStorageConfig.Builder builderForValue) { + if (tieredStorageConfigBuilder_ == null) { + tieredStorageConfig_ = builderForValue.build(); + } else { + tieredStorageConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public Builder mergeTieredStorageConfig( + com.google.bigtable.admin.v2.TieredStorageConfig value) { + if (tieredStorageConfigBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && tieredStorageConfig_ != null + && tieredStorageConfig_ + != com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance()) { + getTieredStorageConfigBuilder().mergeFrom(value); + } else { + tieredStorageConfig_ = value; + } + } else { + tieredStorageConfigBuilder_.mergeFrom(value); + } + if (tieredStorageConfig_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public Builder clearTieredStorageConfig() { + bitField0_ = (bitField0_ & ~0x00000100); + tieredStorageConfig_ = null; + if (tieredStorageConfigBuilder_ != null) { + tieredStorageConfigBuilder_.dispose(); + tieredStorageConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public com.google.bigtable.admin.v2.TieredStorageConfig.Builder + getTieredStorageConfigBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTieredStorageConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + public com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder + getTieredStorageConfigOrBuilder() { + if (tieredStorageConfigBuilder_ != null) { + return tieredStorageConfigBuilder_.getMessageOrBuilder(); + } else { + return tieredStorageConfig_ == null + ? com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance() + : tieredStorageConfig_; + } + } + + /** + * + * + *
+     * Rules to specify what data is stored in each storage tier.
+     * Different tiers store data differently, providing different trade-offs
+     * between cost and performance. Different parts of a table can be stored
+     * separately on different tiers.
+     * If a config is specified, tiered storage is enabled for this table.
+     * Otherwise, tiered storage is disabled.
+     * Only SSD instances can configure tiered storage.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageConfig, + com.google.bigtable.admin.v2.TieredStorageConfig.Builder, + com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder> + internalGetTieredStorageConfigFieldBuilder() { + if (tieredStorageConfigBuilder_ == null) { + tieredStorageConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageConfig, + com.google.bigtable.admin.v2.TieredStorageConfig.Builder, + com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder>( + getTieredStorageConfig(), getParentForChildren(), isClean()); + tieredStorageConfig_ = null; + } + return tieredStorageConfigBuilder_; + } + + private com.google.bigtable.admin.v2.Type.Struct rowKeySchema_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder> + rowKeySchemaBuilder_; + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return Whether the rowKeySchema field is set. + */ + public boolean hasRowKeySchema() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return The rowKeySchema. + */ + public com.google.bigtable.admin.v2.Type.Struct getRowKeySchema() { + if (rowKeySchemaBuilder_ == null) { + return rowKeySchema_ == null + ? com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance() + : rowKeySchema_; + } else { + return rowKeySchemaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public Builder setRowKeySchema(com.google.bigtable.admin.v2.Type.Struct value) { + if (rowKeySchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rowKeySchema_ = value; + } else { + rowKeySchemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public Builder setRowKeySchema( + com.google.bigtable.admin.v2.Type.Struct.Builder builderForValue) { + if (rowKeySchemaBuilder_ == null) { + rowKeySchema_ = builderForValue.build(); + } else { + rowKeySchemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public Builder mergeRowKeySchema(com.google.bigtable.admin.v2.Type.Struct value) { + if (rowKeySchemaBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && rowKeySchema_ != null + && rowKeySchema_ != com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance()) { + getRowKeySchemaBuilder().mergeFrom(value); + } else { + rowKeySchema_ = value; + } + } else { + rowKeySchemaBuilder_.mergeFrom(value); + } + if (rowKeySchema_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public Builder clearRowKeySchema() { + bitField0_ = (bitField0_ & ~0x00000200); + rowKeySchema_ = null; + if (rowKeySchemaBuilder_ != null) { + rowKeySchemaBuilder_.dispose(); + rowKeySchemaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public com.google.bigtable.admin.v2.Type.Struct.Builder getRowKeySchemaBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetRowKeySchemaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + public com.google.bigtable.admin.v2.Type.StructOrBuilder getRowKeySchemaOrBuilder() { + if (rowKeySchemaBuilder_ != null) { + return rowKeySchemaBuilder_.getMessageOrBuilder(); + } else { + return rowKeySchema_ == null + ? com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance() + : rowKeySchema_; + } + } + + /** + * + * + *
+     * The row key schema for this table. The schema is used to decode the raw row
+     * key bytes into a structured format. The order of field declarations in this
+     * schema is important, as it reflects how the raw row key bytes are
+     * structured. Currently, this only affects how the key is read via a
+     * GoogleSQL query from the ExecuteQuery API.
+     *
+     * For a SQL query, the _key column is still read as raw bytes. But queries
+     * can reference the key fields by name, which will be decoded from _key using
+     * provided type and encoding. Queries that reference key fields will fail if
+     * they encounter an invalid row key.
+     *
+     * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+     * following schema:
+     * {
+     * fields {
+     * field_name: "id"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "date"
+     * type { string { encoding: utf8_bytes {} } }
+     * }
+     * fields {
+     * field_name: "product_code"
+     * type { int64 { encoding: big_endian_bytes {} } }
+     * }
+     * encoding { delimited_bytes { delimiter: "#" } }
+     * }
+     *
+     * The decoded key parts would be:
+     * id = "some_id", date = "2024-04-30", product_code = 1245427
+     * The query "SELECT _key, product_code FROM table" will return two columns:
+     * /------------------------------------------------------\
+     * |              _key                     | product_code |
+     * | --------------------------------------|--------------|
+     * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+     * \------------------------------------------------------/
+     *
+     * The schema has the following invariants:
+     * (1) The decoded field values are order-preserved. For read, the field
+     * values will be decoded in sorted mode from the raw bytes.
+     * (2) Every field in the schema must specify a non-empty name.
+     * (3) Every field must specify a type with an associated encoding. The type
+     * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+     * allowed.
+     * (4) The field names must not collide with existing column family
+     * names and reserved keywords "_key" and "_timestamp".
+     *
+     * The following update operations are allowed for row_key_schema:
+     * - Update from an empty schema to a new schema.
+     * - Remove the existing schema. This operation requires setting the
+     * `ignore_warnings` flag to `true`, since it might be a backward
+     * incompatible change. Without the flag, the update request will fail with
+     * an INVALID_ARGUMENT error.
+     * Any other row key schema update operation (e.g. update existing schema
+     * columns names or types) is currently unsupported.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder> + internalGetRowKeySchemaFieldBuilder() { + if (rowKeySchemaBuilder_ == null) { + rowKeySchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder>( + getRowKeySchema(), getParentForChildren(), isClean()); + rowKeySchema_ = null; + } + return rowKeySchemaBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Table) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Table) + private static final com.google.bigtable.admin.v2.Table DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Table(); + } + + public static com.google.bigtable.admin.v2.Table getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
PARSER = + new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Table parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Table getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java new file mode 100644 index 000000000000..84b258e78d87 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2026 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.admin.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 TableName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_TABLE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/tables/{table}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String table; + + @Deprecated + protected TableName() { + project = null; + instance = null; + table = null; + } + + private TableName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + table = Preconditions.checkNotNull(builder.getTable()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TableName of(String project, String instance, String table) { + return newBuilder().setProject(project).setInstance(instance).setTable(table).build(); + } + + public static String format(String project, String instance, String table) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .build() + .toString(); + } + + public static TableName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_TABLE.validatedMatch( + formattedString, "TableName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("table")); + } + + 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 (TableName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_TABLE.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); + } + if (table != null) { + fieldMapBuilder.put("table", table); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_TABLE.instantiate( + "project", project, "instance", instance, "table", table); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + TableName that = ((TableName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.table, that.table); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(table); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/tables/{table}. */ + public static class Builder { + private String project; + private String instance; + private String table; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setTable(String table) { + this.table = table; + return this; + } + + private Builder(TableName tableName) { + this.project = tableName.project; + this.instance = tableName.instance; + this.table = tableName.table; + } + + public TableName build() { + return new TableName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java new file mode 100644 index 000000000000..f82f216bfa16 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java @@ -0,0 +1,669 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface TableOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Table) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getClusterStatesCount(); + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + boolean containsClusterStates(java.lang.String key); + + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getClusterStates(); + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.Map + getClusterStatesMap(); + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue); + + /** + * + * + *
+   * Output only. Map from cluster ID to per-cluster table state.
+   * If it could not be determined whether or not the table has data in a
+   * particular cluster (for example, if its zone is unavailable), then
+   * there will be an entry for the cluster with UNKNOWN `replication_status`.
+   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
+   * 
+ * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + int getColumnFamiliesCount(); + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + boolean containsColumnFamilies(java.lang.String key); + + /** Use {@link #getColumnFamiliesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getColumnFamilies(); + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + java.util.Map getColumnFamiliesMap(); + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily defaultValue); + + /** + * + * + *
+   * The column families configured for this table, mapped by column family ID.
+   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
+   * 
+ * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+   * in this table. Timestamps not matching the granularity will be rejected. If
+   * unspecified at creation time, the value will be set to `MILLIS`. Views:
+   * `SCHEMA_VIEW`, `FULL`.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for granularity. + */ + int getGranularityValue(); + + /** + * + * + *
+   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
+   * in this table. Timestamps not matching the granularity will be rejected. If
+   * unspecified at creation time, the value will be set to `MILLIS`. Views:
+   * `SCHEMA_VIEW`, `FULL`.
+   * 
+ * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The granularity. + */ + com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity(); + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + boolean hasRestoreInfo(); + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo(); + + /** + * + * + *
+   * Output only. If this table was restored from another data source (e.g. a
+   * backup), this field will be populated with information about the restore.
+   * 
+ * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder(); + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return Whether the changeStreamConfig field is set. + */ + boolean hasChangeStreamConfig(); + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return The changeStreamConfig. + */ + com.google.bigtable.admin.v2.ChangeStreamConfig getChangeStreamConfig(); + + /** + * + * + *
+   * If specified, enable the change stream on this table.
+   * Otherwise, the change stream is disabled and the change stream is not
+   * retained.
+   * 
+ * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder getChangeStreamConfigOrBuilder(); + + /** + * + * + *
+   * Set to true to make the table protected against data loss. i.e. deleting
+   * the following resources through Admin APIs are prohibited:
+   *
+   * * The table.
+   * * The column families in the table.
+   * * The instance containing the table.
+   *
+   * Note one can still delete the data stored in the table through Data APIs.
+   * 
+ * + * bool deletion_protection = 9; + * + * @return The deletionProtection. + */ + boolean getDeletionProtection(); + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return Whether the automatedBackupPolicy field is set. + */ + boolean hasAutomatedBackupPolicy(); + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return The automatedBackupPolicy. + */ + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getAutomatedBackupPolicy(); + + /** + * + * + *
+   * If specified, automated backups are enabled for this table.
+   * Otherwise, automated backups are disabled.
+   * 
+ * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder(); + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return Whether the tieredStorageConfig field is set. + */ + boolean hasTieredStorageConfig(); + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return The tieredStorageConfig. + */ + com.google.bigtable.admin.v2.TieredStorageConfig getTieredStorageConfig(); + + /** + * + * + *
+   * Rules to specify what data is stored in each storage tier.
+   * Different tiers store data differently, providing different trade-offs
+   * between cost and performance. Different parts of a table can be stored
+   * separately on different tiers.
+   * If a config is specified, tiered storage is enabled for this table.
+   * Otherwise, tiered storage is disabled.
+   * Only SSD instances can configure tiered storage.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + */ + com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder getTieredStorageConfigOrBuilder(); + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return Whether the rowKeySchema field is set. + */ + boolean hasRowKeySchema(); + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + * + * @return The rowKeySchema. + */ + com.google.bigtable.admin.v2.Type.Struct getRowKeySchema(); + + /** + * + * + *
+   * The row key schema for this table. The schema is used to decode the raw row
+   * key bytes into a structured format. The order of field declarations in this
+   * schema is important, as it reflects how the raw row key bytes are
+   * structured. Currently, this only affects how the key is read via a
+   * GoogleSQL query from the ExecuteQuery API.
+   *
+   * For a SQL query, the _key column is still read as raw bytes. But queries
+   * can reference the key fields by name, which will be decoded from _key using
+   * provided type and encoding. Queries that reference key fields will fail if
+   * they encounter an invalid row key.
+   *
+   * For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
+   * following schema:
+   * {
+   * fields {
+   * field_name: "id"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "date"
+   * type { string { encoding: utf8_bytes {} } }
+   * }
+   * fields {
+   * field_name: "product_code"
+   * type { int64 { encoding: big_endian_bytes {} } }
+   * }
+   * encoding { delimited_bytes { delimiter: "#" } }
+   * }
+   *
+   * The decoded key parts would be:
+   * id = "some_id", date = "2024-04-30", product_code = 1245427
+   * The query "SELECT _key, product_code FROM table" will return two columns:
+   * /------------------------------------------------------\
+   * |              _key                     | product_code |
+   * | --------------------------------------|--------------|
+   * | "some_id#2024-04-30#\x00\x13\x00\xf3" |   1245427    |
+   * \------------------------------------------------------/
+   *
+   * The schema has the following invariants:
+   * (1) The decoded field values are order-preserved. For read, the field
+   * values will be decoded in sorted mode from the raw bytes.
+   * (2) Every field in the schema must specify a non-empty name.
+   * (3) Every field must specify a type with an associated encoding. The type
+   * is limited to scalar types only: Array, Map, Aggregate, and Struct are not
+   * allowed.
+   * (4) The field names must not collide with existing column family
+   * names and reserved keywords "_key" and "_timestamp".
+   *
+   * The following update operations are allowed for row_key_schema:
+   * - Update from an empty schema to a new schema.
+   * - Remove the existing schema. This operation requires setting the
+   * `ignore_warnings` flag to `true`, since it might be a backward
+   * incompatible change. Without the flag, the update request will fail with
+   * an INVALID_ARGUMENT error.
+   * Any other row key schema update operation (e.g. update existing schema
+   * columns names or types) is currently unsupported.
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; + */ + com.google.bigtable.admin.v2.Type.StructOrBuilder getRowKeySchemaOrBuilder(); + + com.google.bigtable.admin.v2.Table.AutomatedBackupConfigCase getAutomatedBackupConfigCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java new file mode 100644 index 000000000000..d25349332eca --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java @@ -0,0 +1,580 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class TableProto extends com.google.protobuf.GeneratedFile { + private TableProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Table_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AuthorizedView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GcRule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Snapshot_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Backup_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_BackupInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_TieredStorageConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_TieredStorageRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ProtoSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_SchemaBundle_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "$google/bigtable/admin/v2/table.proto\022\030" + + "google.bigtable.admin.v2\032\037google/api/fie" + + "ld_behavior.proto\032\031google/api/resource.p" + + "roto\032$google/bigtable/admin/v2/types.pro" + + "to\032\036google/protobuf/duration.proto\032\037goog" + + "le/protobuf/timestamp.proto\032\027google/rpc/status.proto\"\233\001\n" + + "\013RestoreInfo\022@\n" + + "\013source_type\030\001 \001(\0162+.google.bigtable.admin.v2.RestoreSourceType\022;\n" + + "\013backup_info\030\002 \001(\0132$.google.bigtable.admin.v2.BackupInfoH\000B\r\n" + + "\013source_info\"I\n" + + "\022ChangeStreamConfig\0223\n" + + "\020retention_period\030\001 \001(\0132\031.google.protobuf.Duration\"\234\r\n" + + "\005Table\022\014\n" + + "\004name\030\001 \001(\t\022O\n" + + "\016cluster_states\030\002" + + " \003(\01322.google.bigtable.admin.v2.Table.ClusterStatesEntryB\003\340A\003\022L\n" + + "\017column_families\030\003" + + " \003(\01323.google.bigtable.admin.v2.Table.ColumnFamiliesEntry\022N\n" + + "\013granularity\030\004" + + " \001(\01624.google.bigtable.admin.v2.Table.TimestampGranularityB\003\340A\005\022@\n" + + "\014restore_info\030\006" + + " \001(\0132%.google.bigtable.admin.v2.RestoreInfoB\003\340A\003\022J\n" + + "\024change_stream_config\030\010" + + " \001(\0132,.google.bigtable.admin.v2.ChangeStreamConfig\022\033\n" + + "\023deletion_protection\030\t \001(\010\022X\n" + + "\027automated_backup_policy\030\r" + + " \001(\01325.google.bigtable.admin.v2.Table.AutomatedBackupPolicyH\000\022L\n" + + "\025tiered_storage_config\030\016 \001(\013" + + "2-.google.bigtable.admin.v2.TieredStorageConfig\022=\n" + + "\016row_key_schema\030\017" + + " \001(\0132%.google.bigtable.admin.v2.Type.Struct\032\306\002\n" + + "\014ClusterState\022]\n" + + "\021replication_state\030\001 \001(\0162=.goo" + + "gle.bigtable.admin.v2.Table.ClusterState.ReplicationStateB\003\340A\003\022F\n" + + "\017encryption_info\030\002" + + " \003(\0132(.google.bigtable.admin.v2.EncryptionInfoB\003\340A\003\"\216\001\n" + + "\020ReplicationState\022\023\n" + + "\017STATE_NOT_KNOWN\020\000\022\020\n" + + "\014INITIALIZING\020\001\022\027\n" + + "\023PLANNED_MAINTENANCE\020\002\022\031\n" + + "\025UNPLANNED_MAINTENANCE\020\003\022\t\n" + + "\005READY\020\004\022\024\n" + + "\020READY_OPTIMIZING\020\005\032\275\001\n" + + "\025AutomatedBackupPolicy\0228\n" + + "\020retention_period\030\001" + + " \001(\0132\031.google.protobuf.DurationB\003\340A\002\022,\n" + + "\tfrequency\030\002 \001(\0132\031.google.protobuf.Duration\022<\n" + + "\tlocations\030\003 \003(\tB)\340A\001\372A#\n" + + "!locations.googleapis.com/Location\032b\n" + + "\022ClusterStatesEntry\022\013\n" + + "\003key\030\001 \001(\t\022;\n" + + "\005value\030\002 \001(" + + "\0132,.google.bigtable.admin.v2.Table.ClusterState:\0028\001\032]\n" + + "\023ColumnFamiliesEntry\022\013\n" + + "\003key\030\001 \001(\t\0225\n" + + "\005value\030\002 \001(\0132&.google.bigtable.admin.v2.ColumnFamily:\0028\001\"I\n" + + "\024TimestampGranularity\022%\n" + + "!TIMESTAMP_GRANULARITY_UNSPECIFIED\020\000\022\n\n" + + "\006MILLIS\020\001\"q\n" + + "\004View\022\024\n" + + "\020VIEW_UNSPECIFIED\020\000\022\r\n" + + "\tNAME_ONLY\020\001\022\017\n" + + "\013SCHEMA_VIEW\020\002\022\024\n" + + "\020REPLICATION_VIEW\020\003\022\023\n" + + "\017ENCRYPTION_VIEW\020\005\022\010\n" + + "\004FULL\020\004:_\352A\\\n" + + "\"bigtableadmin.goo" + + "gleapis.com/Table\0226projects/{project}/instances/{instance}/tables/{table}B\031\n" + + "\027automated_backup_config\"\343\005\n" + + "\016AuthorizedView\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022J\n" + + "\013subset_view\030\002 \001(\0132" + + "3.google.bigtable.admin.v2.AuthorizedView.SubsetViewH\000\022\014\n" + + "\004etag\030\003 \001(\t\022\033\n" + + "\023deletion_protection\030\004 \001(\010\032?\n\r" + + "FamilySubsets\022\022\n\n" + + "qualifiers\030\001 \003(\014\022\032\n" + + "\022qualifier_prefixes\030\002 \003(\014\032\360\001\n\n" + + "SubsetView\022\024\n" + + "\014row_prefixes\030\001 \003(\014\022^\n" + + "\016family_subsets\030\002 \003(\0132F.google.bigtabl" + + "e.admin.v2.AuthorizedView.SubsetView.FamilySubsetsEntry\032l\n" + + "\022FamilySubsetsEntry\022\013\n" + + "\003key\030\001 \001(\t\022E\n" + + "\005value\030\002 \001(\01326.google.bigta" + + "ble.admin.v2.AuthorizedView.FamilySubsets:\0028\001\"Q\n" + + "\014ResponseView\022\035\n" + + "\031RESPONSE_VIEW_UNSPECIFIED\020\000\022\r\n" + + "\tNAME_ONLY\020\001\022\t\n" + + "\005BASIC\020\002\022\010\n" + + "\004FULL\020\003:\254\001\352A\250\001\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022Xprojects/{project}" + + "/instances/{instance}/tables/{table}/aut" + + "horizedViews/{authorized_view}*\017authorizedViews2\016authorizedViewB\021\n" + + "\017authorized_view\"u\n" + + "\014ColumnFamily\0221\n" + + "\007gc_rule\030\001 \001(\0132 .google.bigtable.admin.v2.GcRule\0222\n\n" + + "value_type\030\003 \001(\0132\036.google.bigtable.admin.v2.Type\"\325\002\n" + + "\006GcRule\022\032\n" + + "\020max_num_versions\030\001 \001(\005H\000\022,\n" + + "\007max_age\030\002 \001(\0132\031.google.protobuf.DurationH\000\022E\n" + + "\014intersection\030\003" + + " \001(\0132-.google.bigtable.admin.v2.GcRule.IntersectionH\000\0227\n" + + "\005union\030\004 \001(\0132&.google.bigtable.admin.v2.GcRule.UnionH\000\032?\n" + + "\014Intersection\022/\n" + + "\005rules\030\001 \003(\0132 .google.bigtable.admin.v2.GcRule\0328\n" + + "\005Union\022/\n" + + "\005rules\030\001 \003(\0132 .google.bigtable.admin.v2.GcRuleB\006\n" + + "\004rule\"\331\002\n" + + "\016EncryptionInfo\022U\n" + + "\017encryption_type\030\003 \001(\01627.google.b" + + "igtable.admin.v2.EncryptionInfo.EncryptionTypeB\003\340A\003\0222\n" + + "\021encryption_status\030\004 \001(\0132\022.google.rpc.StatusB\003\340A\003\022I\n" + + "\017kms_key_version\030\002 \001(\tB0\340A\003\372A*\n" + + "(cloudkms.googleapis.com/CryptoKeyVersion\"q\n" + + "\016EncryptionType\022\037\n" + + "\033ENCRYPTION_TYPE_UNSPECIFIED\020\000\022\035\n" + + "\031GOOGLE_DEFAULT_ENCRYPTION\020\001\022\037\n" + + "\033CUSTOMER_MANAGED_ENCRYPTION\020\002\"\340\003\n" + + "\010Snapshot\022\014\n" + + "\004name\030\001 \001(\t\022:\n" + + "\014source_table\030\002" + + " \001(\0132\037.google.bigtable.admin.v2.TableB\003\340A\003\022\034\n" + + "\017data_size_bytes\030\003 \001(\003B\003\340A\003\0224\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022/\n" + + "\013delete_time\030\005 \001(\0132\032.google.protobuf.Timestamp\022<\n" + + "\005state\030\006" + + " \001(\0162(.google.bigtable.admin.v2.Snapshot.StateB\003\340A\003\022\023\n" + + "\013description\030\007 \001(\t\"5\n" + + "\005State\022\023\n" + + "\017STATE_NOT_KNOWN\020\000\022\t\n" + + "\005READY\020\001\022\014\n" + + "\010CREATING\020\002:{\352Ax\n" + + "%bigtableadmin.googleapis.com/Snapshot\022Oprojects/{project}/inst" + + "ances/{instance}/clusters/{cluster}/snapshots/{snapshot}\"\371\005\n" + + "\006Backup\022\014\n" + + "\004name\030\001 \001(\t\022\034\n" + + "\014source_table\030\002 \001(\tB\006\340A\005\340A\002\022\032\n\r" + + "source_backup\030\n" + + " \001(\tB\003\340A\003\0224\n" + + "\013expire_time\030\003" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\002\0223\n\n" + + "start_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\005" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\027\n\n" + + "size_bytes\030\006 \001(\003B\003\340A\003\022:\n" + + "\005state\030\007" + + " \001(\0162&.google.bigtable.admin.v2.Backup.StateB\003\340A\003\022F\n" + + "\017encryption_info\030\t" + + " \001(\0132(.google.bigtable.admin.v2.EncryptionInfoB\003\340A\003\022@\n" + + "\013backup_type\030\013 \001(\0162+.google.bigtable.admin.v2.Backup.BackupType\0228\n" + + "\024hot_to_standard_time\030\014 \001(\0132\032.google.protobuf.Timestamp\"7\n" + + "\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\014\n" + + "\010CREATING\020\001\022\t\n" + + "\005READY\020\002\"@\n\n" + + "BackupType\022\033\n" + + "\027BACKUP_TYPE_UNSPECIFIED\020\000\022\014\n" + + "\010STANDARD\020\001\022\007\n" + + "\003HOT\020\002:u\352Ar\n" + + "#bigtableadmin.googleapis.com/Backup\022Kprojects/{proje" + + "ct}/instances/{instance}/clusters/{cluster}/backups/{backup}\"\300\001\n\n" + + "BackupInfo\022\023\n" + + "\006backup\030\001 \001(\tB\003\340A\003\0223\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\031\n" + + "\014source_table\030\004 \001(\tB\003\340A\003\022\032\n\r" + + "source_backup\030\n" + + " \001(\tB\003\340A\003\"]\n" + + "\023TieredStorageConfig\022F\n" + + "\021infrequent_access\030\001" + + " \001(\0132+.google.bigtable.admin.v2.TieredStorageRule\"W\n" + + "\021TieredStorageRule\022:\n" + + "\025include_if_older_than\030\001 \001(\0132\031.google.protobuf.DurationH\000B\006\n" + + "\004rule\"-\n" + + "\013ProtoSchema\022\036\n" + + "\021proto_descriptors\030\002 \001(\014B\003\340A\002\"\240\002\n" + + "\014SchemaBundle\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022=\n" + + "\014proto_schema\030\002" + + " \001(\0132%.google.bigtable.admin.v2.ProtoSchemaH\000\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001:\242\001\352A\236\001\n" + + ")bigtableadmin.googleapis.com/SchemaBundle\022Tprojects/{project}/insta" + + "nces/{instance}/tables/{table}/schemaBundles/{schema_bundle}*\r" + + "schemaBundles2\014schemaBundleB\006\n" + + "\004type*D\n" + + "\021RestoreSourceType\022#\n" + + "\037RESTORE_SOURCE_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006BACKUP\020\001B\367\002\n" + + "\034com.google.bigtable.admin.v2B\n" + + "TableProtoP\001Z8cloud.google.com/go/bigt" + + "able/admin/apiv2/adminpb;adminpb\252\002\036Googl" + + "e.Cloud.Bigtable.Admin.V2\312\002\036Google\\Cloud" + + "\\Bigtable\\Admin\\V2\352\002\"Google::Cloud::Bigtable::Admin::V2\352A\246\001\n" + + "(cloudkms.googleapis.com/CryptoKeyVersion\022zprojects/{project" + + "}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVers" + + "ions/{crypto_key_version}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.bigtable.admin.v2.TypesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor, + new java.lang.String[] { + "SourceType", "BackupInfo", "SourceInfo", + }); + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor, + new java.lang.String[] { + "RetentionPeriod", + }); + internal_static_google_bigtable_admin_v2_Table_descriptor = getDescriptor().getMessageType(2); + internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_descriptor, + new java.lang.String[] { + "Name", + "ClusterStates", + "ColumnFamilies", + "Granularity", + "RestoreInfo", + "ChangeStreamConfig", + "DeletionProtection", + "AutomatedBackupPolicy", + "TieredStorageConfig", + "RowKeySchema", + "AutomatedBackupConfig", + }); + internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor = + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor, + new java.lang.String[] { + "ReplicationState", "EncryptionInfo", + }); + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor = + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor, + new java.lang.String[] { + "RetentionPeriod", "Frequency", "Locations", + }); + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor = + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor = + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(3); + internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_bigtable_admin_v2_AuthorizedView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor, + new java.lang.String[] { + "Name", "SubsetView", "Etag", "DeletionProtection", "AuthorizedView", + }); + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor = + internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_descriptor, + new java.lang.String[] { + "Qualifiers", "QualifierPrefixes", + }); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor = + internal_static_google_bigtable_admin_v2_AuthorizedView_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor, + new java.lang.String[] { + "RowPrefixes", "FamilySubsets", + }); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_descriptor = + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_descriptor.getNestedType( + 0); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor, + new java.lang.String[] { + "GcRule", "ValueType", + }); + internal_static_google_bigtable_admin_v2_GcRule_descriptor = getDescriptor().getMessageType(5); + internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GcRule_descriptor, + new java.lang.String[] { + "MaxNumVersions", "MaxAge", "Intersection", "Union", "Rule", + }); + internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor = + internal_static_google_bigtable_admin_v2_GcRule_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GcRule_Intersection_descriptor, + new java.lang.String[] { + "Rules", + }); + internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor = + internal_static_google_bigtable_admin_v2_GcRule_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor, + new java.lang.String[] { + "Rules", + }); + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor, + new java.lang.String[] { + "EncryptionType", "EncryptionStatus", "KmsKeyVersion", + }); + internal_static_google_bigtable_admin_v2_Snapshot_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Snapshot_descriptor, + new java.lang.String[] { + "Name", + "SourceTable", + "DataSizeBytes", + "CreateTime", + "DeleteTime", + "State", + "Description", + }); + internal_static_google_bigtable_admin_v2_Backup_descriptor = getDescriptor().getMessageType(8); + internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Backup_descriptor, + new java.lang.String[] { + "Name", + "SourceTable", + "SourceBackup", + "ExpireTime", + "StartTime", + "EndTime", + "SizeBytes", + "State", + "EncryptionInfo", + "BackupType", + "HotToStandardTime", + }); + internal_static_google_bigtable_admin_v2_BackupInfo_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_BackupInfo_descriptor, + new java.lang.String[] { + "Backup", "StartTime", "EndTime", "SourceTable", "SourceBackup", + }); + internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_bigtable_admin_v2_TieredStorageConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor, + new java.lang.String[] { + "InfrequentAccess", + }); + internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_bigtable_admin_v2_TieredStorageRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor, + new java.lang.String[] { + "IncludeIfOlderThan", "Rule", + }); + internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_bigtable_admin_v2_ProtoSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ProtoSchema_descriptor, + new java.lang.String[] { + "ProtoDescriptors", + }); + internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_bigtable_admin_v2_SchemaBundle_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_SchemaBundle_descriptor, + new java.lang.String[] { + "Name", "ProtoSchema", "Etag", "Type", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.bigtable.admin.v2.TypesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfig.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfig.java new file mode 100644 index 000000000000..e54e3440fbda --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfig.java @@ -0,0 +1,721 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Config for tiered storage.
+ * A valid config must have a valid TieredStorageRule. Otherwise the whole
+ * TieredStorageConfig must be unset.
+ * By default all data is stored in the SSD tier (only SSD instances can
+ * configure tiered storage).
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.TieredStorageConfig} + */ +@com.google.protobuf.Generated +public final class TieredStorageConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.TieredStorageConfig) + TieredStorageConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TieredStorageConfig"); + } + + // Use TieredStorageConfig.newBuilder() to construct. + private TieredStorageConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TieredStorageConfig() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.TieredStorageConfig.class, + com.google.bigtable.admin.v2.TieredStorageConfig.Builder.class); + } + + private int bitField0_; + public static final int INFREQUENT_ACCESS_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.TieredStorageRule infrequentAccess_; + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return Whether the infrequentAccess field is set. + */ + @java.lang.Override + public boolean hasInfrequentAccess() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return The infrequentAccess. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageRule getInfrequentAccess() { + return infrequentAccess_ == null + ? com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance() + : infrequentAccess_; + } + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder getInfrequentAccessOrBuilder() { + return infrequentAccess_ == null + ? com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance() + : infrequentAccess_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInfrequentAccess()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInfrequentAccess()); + } + size += getUnknownFields().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.admin.v2.TieredStorageConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.TieredStorageConfig other = + (com.google.bigtable.admin.v2.TieredStorageConfig) obj; + + if (hasInfrequentAccess() != other.hasInfrequentAccess()) return false; + if (hasInfrequentAccess()) { + if (!getInfrequentAccess().equals(other.getInfrequentAccess())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInfrequentAccess()) { + hash = (37 * hash) + INFREQUENT_ACCESS_FIELD_NUMBER; + hash = (53 * hash) + getInfrequentAccess().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig 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.admin.v2.TieredStorageConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig 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.admin.v2.TieredStorageConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.TieredStorageConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Config for tiered storage.
+   * A valid config must have a valid TieredStorageRule. Otherwise the whole
+   * TieredStorageConfig must be unset.
+   * By default all data is stored in the SSD tier (only SSD instances can
+   * configure tiered storage).
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.TieredStorageConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.TieredStorageConfig) + com.google.bigtable.admin.v2.TieredStorageConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.TieredStorageConfig.class, + com.google.bigtable.admin.v2.TieredStorageConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.TieredStorageConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInfrequentAccessFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + infrequentAccess_ = null; + if (infrequentAccessBuilder_ != null) { + infrequentAccessBuilder_.dispose(); + infrequentAccessBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageConfig getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageConfig build() { + com.google.bigtable.admin.v2.TieredStorageConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageConfig buildPartial() { + com.google.bigtable.admin.v2.TieredStorageConfig result = + new com.google.bigtable.admin.v2.TieredStorageConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.TieredStorageConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.infrequentAccess_ = + infrequentAccessBuilder_ == null ? infrequentAccess_ : infrequentAccessBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.TieredStorageConfig) { + return mergeFrom((com.google.bigtable.admin.v2.TieredStorageConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.TieredStorageConfig other) { + if (other == com.google.bigtable.admin.v2.TieredStorageConfig.getDefaultInstance()) + return this; + if (other.hasInfrequentAccess()) { + mergeInfrequentAccess(other.getInfrequentAccess()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetInfrequentAccessFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.TieredStorageRule infrequentAccess_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageRule, + com.google.bigtable.admin.v2.TieredStorageRule.Builder, + com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder> + infrequentAccessBuilder_; + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return Whether the infrequentAccess field is set. + */ + public boolean hasInfrequentAccess() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return The infrequentAccess. + */ + public com.google.bigtable.admin.v2.TieredStorageRule getInfrequentAccess() { + if (infrequentAccessBuilder_ == null) { + return infrequentAccess_ == null + ? com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance() + : infrequentAccess_; + } else { + return infrequentAccessBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public Builder setInfrequentAccess(com.google.bigtable.admin.v2.TieredStorageRule value) { + if (infrequentAccessBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + infrequentAccess_ = value; + } else { + infrequentAccessBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public Builder setInfrequentAccess( + com.google.bigtable.admin.v2.TieredStorageRule.Builder builderForValue) { + if (infrequentAccessBuilder_ == null) { + infrequentAccess_ = builderForValue.build(); + } else { + infrequentAccessBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public Builder mergeInfrequentAccess(com.google.bigtable.admin.v2.TieredStorageRule value) { + if (infrequentAccessBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && infrequentAccess_ != null + && infrequentAccess_ + != com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance()) { + getInfrequentAccessBuilder().mergeFrom(value); + } else { + infrequentAccess_ = value; + } + } else { + infrequentAccessBuilder_.mergeFrom(value); + } + if (infrequentAccess_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public Builder clearInfrequentAccess() { + bitField0_ = (bitField0_ & ~0x00000001); + infrequentAccess_ = null; + if (infrequentAccessBuilder_ != null) { + infrequentAccessBuilder_.dispose(); + infrequentAccessBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public com.google.bigtable.admin.v2.TieredStorageRule.Builder getInfrequentAccessBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetInfrequentAccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + public com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder getInfrequentAccessOrBuilder() { + if (infrequentAccessBuilder_ != null) { + return infrequentAccessBuilder_.getMessageOrBuilder(); + } else { + return infrequentAccess_ == null + ? com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance() + : infrequentAccess_; + } + } + + /** + * + * + *
+     * Rule to specify what data is stored in the infrequent access(IA) tier.
+     * The IA tier allows storing more data per node with reduced performance.
+     * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageRule, + com.google.bigtable.admin.v2.TieredStorageRule.Builder, + com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder> + internalGetInfrequentAccessFieldBuilder() { + if (infrequentAccessBuilder_ == null) { + infrequentAccessBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.TieredStorageRule, + com.google.bigtable.admin.v2.TieredStorageRule.Builder, + com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder>( + getInfrequentAccess(), getParentForChildren(), isClean()); + infrequentAccess_ = null; + } + return infrequentAccessBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.TieredStorageConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.TieredStorageConfig) + private static final com.google.bigtable.admin.v2.TieredStorageConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.TieredStorageConfig(); + } + + public static com.google.bigtable.admin.v2.TieredStorageConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TieredStorageConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.TieredStorageConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfigOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfigOrBuilder.java new file mode 100644 index 000000000000..380f53080d3d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfigOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface TieredStorageConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.TieredStorageConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return Whether the infrequentAccess field is set. + */ + boolean hasInfrequentAccess(); + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + * + * @return The infrequentAccess. + */ + com.google.bigtable.admin.v2.TieredStorageRule getInfrequentAccess(); + + /** + * + * + *
+   * Rule to specify what data is stored in the infrequent access(IA) tier.
+   * The IA tier allows storing more data per node with reduced performance.
+   * 
+ * + * .google.bigtable.admin.v2.TieredStorageRule infrequent_access = 1; + */ + com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder getInfrequentAccessOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRule.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRule.java new file mode 100644 index 000000000000..2a78390f88f8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRule.java @@ -0,0 +1,801 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Rule to specify what data is stored in a storage tier.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.TieredStorageRule} + */ +@com.google.protobuf.Generated +public final class TieredStorageRule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.TieredStorageRule) + TieredStorageRuleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TieredStorageRule"); + } + + // Use TieredStorageRule.newBuilder() to construct. + private TieredStorageRule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TieredStorageRule() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.TieredStorageRule.class, + com.google.bigtable.admin.v2.TieredStorageRule.Builder.class); + } + + private int ruleCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object rule_; + + public enum RuleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INCLUDE_IF_OLDER_THAN(1), + RULE_NOT_SET(0); + private final int value; + + private RuleCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RuleCase valueOf(int value) { + return forNumber(value); + } + + public static RuleCase forNumber(int value) { + switch (value) { + case 1: + return INCLUDE_IF_OLDER_THAN; + case 0: + return RULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public static final int INCLUDE_IF_OLDER_THAN_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return Whether the includeIfOlderThan field is set. + */ + @java.lang.Override + public boolean hasIncludeIfOlderThan() { + return ruleCase_ == 1; + } + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return The includeIfOlderThan. + */ + @java.lang.Override + public com.google.protobuf.Duration getIncludeIfOlderThan() { + if (ruleCase_ == 1) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getIncludeIfOlderThanOrBuilder() { + if (ruleCase_ == 1) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + 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 (ruleCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Duration) rule_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ruleCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Duration) rule_); + } + size += getUnknownFields().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.admin.v2.TieredStorageRule)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.TieredStorageRule other = + (com.google.bigtable.admin.v2.TieredStorageRule) obj; + + if (!getRuleCase().equals(other.getRuleCase())) return false; + switch (ruleCase_) { + case 1: + if (!getIncludeIfOlderThan().equals(other.getIncludeIfOlderThan())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (ruleCase_) { + case 1: + hash = (37 * hash) + INCLUDE_IF_OLDER_THAN_FIELD_NUMBER; + hash = (53 * hash) + getIncludeIfOlderThan().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule 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.admin.v2.TieredStorageRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule 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.admin.v2.TieredStorageRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.TieredStorageRule 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rule to specify what data is stored in a storage tier.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.TieredStorageRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.TieredStorageRule) + com.google.bigtable.admin.v2.TieredStorageRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.TieredStorageRule.class, + com.google.bigtable.admin.v2.TieredStorageRule.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.TieredStorageRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (includeIfOlderThanBuilder_ != null) { + includeIfOlderThanBuilder_.clear(); + } + ruleCase_ = 0; + rule_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_TieredStorageRule_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageRule getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageRule build() { + com.google.bigtable.admin.v2.TieredStorageRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.TieredStorageRule buildPartial() { + com.google.bigtable.admin.v2.TieredStorageRule result = + new com.google.bigtable.admin.v2.TieredStorageRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.TieredStorageRule result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.TieredStorageRule result) { + result.ruleCase_ = ruleCase_; + result.rule_ = this.rule_; + if (ruleCase_ == 1 && includeIfOlderThanBuilder_ != null) { + result.rule_ = includeIfOlderThanBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.TieredStorageRule) { + return mergeFrom((com.google.bigtable.admin.v2.TieredStorageRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.TieredStorageRule other) { + if (other == com.google.bigtable.admin.v2.TieredStorageRule.getDefaultInstance()) return this; + switch (other.getRuleCase()) { + case INCLUDE_IF_OLDER_THAN: + { + mergeIncludeIfOlderThan(other.getIncludeIfOlderThan()); + break; + } + case RULE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetIncludeIfOlderThanFieldBuilder().getBuilder(), extensionRegistry); + ruleCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int ruleCase_ = 0; + private java.lang.Object rule_; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public Builder clearRule() { + ruleCase_ = 0; + rule_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + includeIfOlderThanBuilder_; + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return Whether the includeIfOlderThan field is set. + */ + @java.lang.Override + public boolean hasIncludeIfOlderThan() { + return ruleCase_ == 1; + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return The includeIfOlderThan. + */ + @java.lang.Override + public com.google.protobuf.Duration getIncludeIfOlderThan() { + if (includeIfOlderThanBuilder_ == null) { + if (ruleCase_ == 1) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (ruleCase_ == 1) { + return includeIfOlderThanBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + public Builder setIncludeIfOlderThan(com.google.protobuf.Duration value) { + if (includeIfOlderThanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rule_ = value; + onChanged(); + } else { + includeIfOlderThanBuilder_.setMessage(value); + } + ruleCase_ = 1; + return this; + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + public Builder setIncludeIfOlderThan(com.google.protobuf.Duration.Builder builderForValue) { + if (includeIfOlderThanBuilder_ == null) { + rule_ = builderForValue.build(); + onChanged(); + } else { + includeIfOlderThanBuilder_.setMessage(builderForValue.build()); + } + ruleCase_ = 1; + return this; + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + public Builder mergeIncludeIfOlderThan(com.google.protobuf.Duration value) { + if (includeIfOlderThanBuilder_ == null) { + if (ruleCase_ == 1 && rule_ != com.google.protobuf.Duration.getDefaultInstance()) { + rule_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) rule_) + .mergeFrom(value) + .buildPartial(); + } else { + rule_ = value; + } + onChanged(); + } else { + if (ruleCase_ == 1) { + includeIfOlderThanBuilder_.mergeFrom(value); + } else { + includeIfOlderThanBuilder_.setMessage(value); + } + } + ruleCase_ = 1; + return this; + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + public Builder clearIncludeIfOlderThan() { + if (includeIfOlderThanBuilder_ == null) { + if (ruleCase_ == 1) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + } else { + if (ruleCase_ == 1) { + ruleCase_ = 0; + rule_ = null; + } + includeIfOlderThanBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + public com.google.protobuf.Duration.Builder getIncludeIfOlderThanBuilder() { + return internalGetIncludeIfOlderThanFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getIncludeIfOlderThanOrBuilder() { + if ((ruleCase_ == 1) && (includeIfOlderThanBuilder_ != null)) { + return includeIfOlderThanBuilder_.getMessageOrBuilder(); + } else { + if (ruleCase_ == 1) { + return (com.google.protobuf.Duration) rule_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Include cells older than the given age.
+     * For the infrequent access tier, this value must be at least 30 days.
+     * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetIncludeIfOlderThanFieldBuilder() { + if (includeIfOlderThanBuilder_ == null) { + if (!(ruleCase_ == 1)) { + rule_ = com.google.protobuf.Duration.getDefaultInstance(); + } + includeIfOlderThanBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) rule_, getParentForChildren(), isClean()); + rule_ = null; + } + ruleCase_ = 1; + onChanged(); + return includeIfOlderThanBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.TieredStorageRule) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.TieredStorageRule) + private static final com.google.bigtable.admin.v2.TieredStorageRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.TieredStorageRule(); + } + + public static com.google.bigtable.admin.v2.TieredStorageRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TieredStorageRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.TieredStorageRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRuleOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRuleOrBuilder.java new file mode 100644 index 000000000000..642ec6aac26c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRuleOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface TieredStorageRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.TieredStorageRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return Whether the includeIfOlderThan field is set. + */ + boolean hasIncludeIfOlderThan(); + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + * + * @return The includeIfOlderThan. + */ + com.google.protobuf.Duration getIncludeIfOlderThan(); + + /** + * + * + *
+   * Include cells older than the given age.
+   * For the infrequent access tier, this value must be at least 30 days.
+   * 
+ * + * .google.protobuf.Duration include_if_older_than = 1; + */ + com.google.protobuf.DurationOrBuilder getIncludeIfOlderThanOrBuilder(); + + com.google.bigtable.admin.v2.TieredStorageRule.RuleCase getRuleCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java new file mode 100644 index 000000000000..e54b272a4375 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java @@ -0,0 +1,28792 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * `Type` represents the type of data that is written to, read from, or stored
+ * in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
+ * familiarity and consistency across products and features.
+ *
+ * For compatibility with Bigtable's existing untyped APIs, each `Type` includes
+ * an `Encoding` which describes how to convert to or from the underlying data.
+ *
+ * Each encoding can operate in one of two modes:
+ *
+ * - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
+ * if and only if `X <= Y`. This is useful anywhere sort order is important,
+ * for example when encoding keys.
+ * - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
+ * `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
+ * example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}"
+ * are valid encodings of the same JSON value.
+ *
+ * The API clearly documents which mode is used wherever an encoding can be
+ * configured. Each encoding also documents which values are supported in which
+ * modes. For example, when encoding INT64 as a numeric STRING, negative numbers
+ * cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
+ * `STRING("-00001") > STRING("00001")`.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type} + */ +@com.google.protobuf.Generated +public final class Type extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type) + TypeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + // Use Type.newBuilder() to construct. + private Type(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Type() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.class, + com.google.bigtable.admin.v2.Type.Builder.class); + } + + public interface BytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Bytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.admin.v2.Type.Bytes.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Bytes
+   * Values of type `Bytes` are stored in `Value.bytes_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes} + */ + public static final class Bytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes) + BytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Bytes"); + } + + // Use Bytes.newBuilder() to construct. + private Bytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Bytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.class, + com.google.bigtable.admin.v2.Type.Bytes.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Bytes.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + boolean hasRaw(); + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw getRaw(); + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder(); + + com.google.bigtable.admin.v2.Type.Bytes.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.class, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder.class); + } + + public interface RawOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Leaves the value as-is.
+       *
+       * Sorted mode: all values are supported.
+       *
+       * Distinct mode: all values are supported.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Raw extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + RawOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Raw"); + } + + // Use Raw.newBuilder() to construct. + private Raw(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Raw() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.class, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Bytes.Encoding.Raw)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw other = + (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw 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.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw 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.admin.v2.Type.Bytes.Encoding.Raw parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Bytes.Encoding.Raw 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Leaves the value as-is.
+         *
+         * Sorted mode: all values are supported.
+         *
+         * Distinct mode: all values are supported.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.class, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw build() { + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw buildPartial() { + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw result = + new com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw other) { + if (other == com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + private static final com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw(); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Raw parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Bytes.Encoding.Raw getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAW(1), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return RAW; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int RAW_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + @java.lang.Override + public boolean hasRaw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw getRaw() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_); + } + size += getUnknownFields().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.admin.v2.Type.Bytes.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Bytes.Encoding other = + (com.google.bigtable.admin.v2.Type.Bytes.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getRaw().equals(other.getRaw())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + RAW_FIELD_NUMBER; + hash = (53 * hash) + getRaw().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding 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.admin.v2.Type.Bytes.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding 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.admin.v2.Type.Bytes.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Bytes.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Bytes.Encoding) + com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.class, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Bytes.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rawBuilder_ != null) { + rawBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding build() { + com.google.bigtable.admin.v2.Type.Bytes.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding buildPartial() { + com.google.bigtable.admin.v2.Type.Bytes.Encoding result = + new com.google.bigtable.admin.v2.Type.Bytes.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Bytes.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type.Bytes.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && rawBuilder_ != null) { + result.encoding_ = rawBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Bytes.Encoding) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Bytes.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Bytes.Encoding other) { + if (other == com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case RAW: + { + mergeRaw(other.getRaw()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetRawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder> + rawBuilder_; + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + @java.lang.Override + public boolean hasRaw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw getRaw() { + if (rawBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return rawBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder setRaw(com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw value) { + if (rawBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + rawBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder setRaw( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder builderForValue) { + if (rawBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + rawBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder mergeRaw(com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw value) { + if (rawBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.newBuilder( + (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + rawBuilder_.mergeFrom(value); + } else { + rawBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder clearRaw() { + if (rawBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + rawBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder getRawBuilder() { + return internalGetRawFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder() { + if ((encodingCase_ == 1) && (rawBuilder_ != null)) { + return rawBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder> + internalGetRawFieldBuilder() { + if (rawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + rawBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.RawOrBuilder>( + (com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return rawBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Bytes.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Bytes.Encoding) + private static final com.google.bigtable.admin.v2.Type.Bytes.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Bytes.Encoding(); + } + + public static com.google.bigtable.admin.v2.Type.Bytes.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Bytes.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type.Bytes.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.admin.v2.Type.Bytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Bytes other = (com.google.bigtable.admin.v2.Type.Bytes) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes 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.admin.v2.Type.Bytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes 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.admin.v2.Type.Bytes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Bytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Bytes
+     * Values of type `Bytes` are stored in `Value.bytes_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Bytes) + com.google.bigtable.admin.v2.Type.BytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bytes.class, + com.google.bigtable.admin.v2.Type.Bytes.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Bytes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes build() { + com.google.bigtable.admin.v2.Type.Bytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes buildPartial() { + com.google.bigtable.admin.v2.Type.Bytes result = + new com.google.bigtable.admin.v2.Type.Bytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Bytes result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Bytes) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Bytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Bytes other) { + if (other == com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type.Bytes.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.admin.v2.Type.Bytes.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.admin.v2.Type.Bytes.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.admin.v2.Type.Bytes.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ + != com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes.Encoding, + com.google.bigtable.admin.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Bytes.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Bytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Bytes) + private static final com.google.bigtable.admin.v2.Type.Bytes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Bytes(); + } + + public static com.google.bigtable.admin.v2.Type.Bytes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Bytes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StringOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.String) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.admin.v2.Type.String.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * String
+   * Values of type `String` are stored in `Value.string_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String} + */ + public static final class String extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String) + StringOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "String"); + } + + // Use String.newBuilder() to construct. + private String(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private String() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.class, + com.google.bigtable.admin.v2.Type.String.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.String.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Deprecated + boolean hasUtf8Raw(); + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return The utf8Raw. + */ + @java.lang.Deprecated + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw getUtf8Raw(); + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder getUtf8RawOrBuilder(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + boolean hasUtf8Bytes(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder getUtf8BytesOrBuilder(); + + com.google.bigtable.admin.v2.Type.String.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Builder.class); + } + + @java.lang.Deprecated + public interface Utf8RawOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Deprecated: prefer the equivalent `Utf8Bytes`.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} + */ + @java.lang.Deprecated + public static final class Utf8Raw extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + Utf8RawOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Utf8Raw"); + } + + // Use Utf8Raw.newBuilder() to construct. + private Utf8Raw(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Utf8Raw() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.String.Encoding.Utf8Raw)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw other = + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw 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.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw 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.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.String.Encoding.Utf8Raw 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Deprecated: prefer the equivalent `Utf8Bytes`.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw build() { + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw buildPartial() { + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw result = + new com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) { + return mergeFrom((com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw other) { + if (other + == com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + private static final com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw(); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Utf8Raw parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.String.Encoding.Utf8Raw + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Utf8BytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * UTF-8 encoding.
+       *
+       * Sorted mode:
+       * - All values are supported.
+       * - Code point order is preserved.
+       *
+       * Distinct mode: all values are supported.
+       *
+       * Compatible with:
+       *
+       * - BigQuery `TEXT` encoding
+       * - HBase `Bytes.toBytes`
+       * - Java `String#getBytes(StandardCharsets.UTF_8)`
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} + */ + public static final class Utf8Bytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + Utf8BytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Utf8Bytes"); + } + + // Use Utf8Bytes.newBuilder() to construct. + private Utf8Bytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Utf8Bytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.String.Encoding.Utf8Bytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes other = + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes 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.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes 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.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.String.Encoding.Utf8Bytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * UTF-8 encoding.
+         *
+         * Sorted mode:
+         * - All values are supported.
+         * - Code point order is preserved.
+         *
+         * Distinct mode: all values are supported.
+         *
+         * Compatible with:
+         *
+         * - BigQuery `TEXT` encoding
+         * - HBase `Bytes.toBytes`
+         * - Java `String#getBytes(StandardCharsets.UTF_8)`
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes build() { + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes buildPartial() { + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes result = + new com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) { + return mergeFrom((com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes other) { + if (other + == com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + private static final com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes(); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Utf8Bytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.String.Encoding.Utf8Bytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + @java.lang.Deprecated + UTF8_RAW(1), + UTF8_BYTES(2), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return UTF8_RAW; + case 2: + return UTF8_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int UTF8_RAW_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasUtf8Raw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return The utf8Raw. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw getUtf8Raw() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder + getUtf8RawOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + public static final int UTF8_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + @java.lang.Override + public boolean hasUtf8Bytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder + getUtf8BytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_); + } + size += getUnknownFields().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.admin.v2.Type.String.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.String.Encoding other = + (com.google.bigtable.admin.v2.Type.String.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getUtf8Raw().equals(other.getUtf8Raw())) return false; + break; + case 2: + if (!getUtf8Bytes().equals(other.getUtf8Bytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + UTF8_RAW_FIELD_NUMBER; + hash = (53 * hash) + getUtf8Raw().hashCode(); + break; + case 2: + hash = (37 * hash) + UTF8_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getUtf8Bytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding 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.admin.v2.Type.String.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding 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.admin.v2.Type.String.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.String.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.String.Encoding) + com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.Encoding.class, + com.google.bigtable.admin.v2.Type.String.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.String.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (utf8RawBuilder_ != null) { + utf8RawBuilder_.clear(); + } + if (utf8BytesBuilder_ != null) { + utf8BytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding build() { + com.google.bigtable.admin.v2.Type.String.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding buildPartial() { + com.google.bigtable.admin.v2.Type.String.Encoding result = + new com.google.bigtable.admin.v2.Type.String.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.String.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type.String.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && utf8RawBuilder_ != null) { + result.encoding_ = utf8RawBuilder_.build(); + } + if (encodingCase_ == 2 && utf8BytesBuilder_ != null) { + result.encoding_ = utf8BytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.String.Encoding) { + return mergeFrom((com.google.bigtable.admin.v2.Type.String.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.String.Encoding other) { + if (other == com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case UTF8_RAW: + { + mergeUtf8Raw(other.getUtf8Raw()); + break; + } + case UTF8_BYTES: + { + mergeUtf8Bytes(other.getUtf8Bytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetUtf8RawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUtf8BytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder> + utf8RawBuilder_; + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasUtf8Raw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.admin.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/admin/v2/types.proto;l=102 + * @return The utf8Raw. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw getUtf8Raw() { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return utf8RawBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setUtf8Raw(com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw value) { + if (utf8RawBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + utf8RawBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setUtf8Raw( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder builderForValue) { + if (utf8RawBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + utf8RawBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeUtf8Raw( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw value) { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.newBuilder( + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + utf8RawBuilder_.mergeFrom(value); + } else { + utf8RawBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearUtf8Raw() { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + utf8RawBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder + getUtf8RawBuilder() { + return internalGetUtf8RawFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder + getUtf8RawOrBuilder() { + if ((encodingCase_ == 1) && (utf8RawBuilder_ != null)) { + return utf8RawBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder> + internalGetUtf8RawFieldBuilder() { + if (utf8RawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + utf8RawBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8RawOrBuilder>( + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return utf8RawBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder> + utf8BytesBuilder_; + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + @java.lang.Override + public boolean hasUtf8Bytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes() { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return utf8BytesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder setUtf8Bytes( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes value) { + if (utf8BytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + utf8BytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder setUtf8Bytes( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder builderForValue) { + if (utf8BytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + utf8BytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder mergeUtf8Bytes( + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes value) { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.newBuilder( + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + utf8BytesBuilder_.mergeFrom(value); + } else { + utf8BytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder clearUtf8Bytes() { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + utf8BytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder + getUtf8BytesBuilder() { + return internalGetUtf8BytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder + getUtf8BytesOrBuilder() { + if ((encodingCase_ == 2) && (utf8BytesBuilder_ != null)) { + return utf8BytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder> + internalGetUtf8BytesFieldBuilder() { + if (utf8BytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + utf8BytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8BytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return utf8BytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.String.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.String.Encoding) + private static final com.google.bigtable.admin.v2.Type.String.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.String.Encoding(); + } + + public static com.google.bigtable.admin.v2.Type.String.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.String.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type.String.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.admin.v2.Type.String)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.String other = + (com.google.bigtable.admin.v2.Type.String) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String 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.admin.v2.Type.String parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String 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.admin.v2.Type.String parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.String parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.String 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * String
+     * Values of type `String` are stored in `Value.string_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.String} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.String) + com.google.bigtable.admin.v2.Type.StringOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.String.class, + com.google.bigtable.admin.v2.Type.String.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.String.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_String_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String build() { + com.google.bigtable.admin.v2.Type.String result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String buildPartial() { + com.google.bigtable.admin.v2.Type.String result = + new com.google.bigtable.admin.v2.Type.String(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.String result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.String) { + return mergeFrom((com.google.bigtable.admin.v2.Type.String) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.String other) { + if (other == com.google.bigtable.admin.v2.Type.String.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type.String.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding, + com.google.bigtable.admin.v2.Type.String.Encoding.Builder, + com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.admin.v2.Type.String.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.admin.v2.Type.String.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.admin.v2.Type.String.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.admin.v2.Type.String.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ + != com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.String.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding, + com.google.bigtable.admin.v2.Type.String.Encoding.Builder, + com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String.Encoding, + com.google.bigtable.admin.v2.Type.String.Encoding.Builder, + com.google.bigtable.admin.v2.Type.String.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.String) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.String) + private static final com.google.bigtable.admin.v2.Type.String DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.String(); + } + + public static com.google.bigtable.admin.v2.Type.String getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public String parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.String getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Int64OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Int64) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Int64
+   * Values of type `Int64` are stored in `Value.int_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64} + */ + public static final class Int64 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64) + Int64OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Int64"); + } + + // Use Int64.newBuilder() to construct. + private Int64(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Int64() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.class, + com.google.bigtable.admin.v2.Type.Int64.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Int64.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return Whether the bigEndianBytes field is set. + */ + boolean hasBigEndianBytes(); + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return The bigEndianBytes. + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes(); + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + boolean hasOrderedCodeBytes(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes getOrderedCodeBytes(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder(); + + com.google.bigtable.admin.v2.Type.Int64.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder.class); + } + + public interface BigEndianBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return Whether the bytesType field is set. + */ + @java.lang.Deprecated + boolean hasBytesType(); + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return The bytesType. + */ + @java.lang.Deprecated + com.google.bigtable.admin.v2.Type.Bytes getBytesType(); + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + } + + /** + * + * + *
+       * Encodes the value as an 8-byte big-endian two's complement value.
+       *
+       * Sorted mode: non-negative values are supported.
+       *
+       * Distinct mode: all values are supported.
+       *
+       * Compatible with:
+       *
+       * - BigQuery `BINARY` encoding
+       * - HBase `Bytes.toBytes`
+       * - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} + */ + public static final class BigEndianBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + BigEndianBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BigEndianBytes"); + } + + // Use BigEndianBytes.newBuilder() to construct. + private BigEndianBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BigEndianBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder.class); + } + + private int bitField0_; + public static final int BYTES_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type.Bytes bytesType_; + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return Whether the bytesType field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return The bytesType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.Bytes getBytesType() { + return bytesType_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + return bytesType_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBytesType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBytesType()); + } + size += getUnknownFields().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.admin.v2.Type.Int64.Encoding.BigEndianBytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes other = + (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) obj; + + if (hasBytesType() != other.hasBytesType()) return false; + if (hasBytesType()) { + if (!getBytesType().equals(other.getBytesType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBytesType()) { + hash = (37 * hash) + BYTES_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes 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.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes 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.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Int64.Encoding.BigEndianBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Encodes the value as an 8-byte big-endian two's complement value.
+         *
+         * Sorted mode: non-negative values are supported.
+         *
+         * Distinct mode: all values are supported.
+         *
+         * Compatible with:
+         *
+         * - BigQuery `BINARY` encoding
+         * - HBase `Bytes.toBytes`
+         * - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBytesTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bytesType_ = null; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.dispose(); + bytesTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes build() { + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes buildPartial() { + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes result = + new com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bytesType_ = + bytesTypeBuilder_ == null ? bytesType_ : bytesTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) { + return mergeFrom( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes other) { + if (other + == com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance()) return this; + if (other.hasBytesType()) { + mergeBytesType(other.getBytesType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type.Bytes bytesType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + bytesTypeBuilder_; + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return Whether the bytesType field is set. + */ + @java.lang.Deprecated + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/admin/v2/types.proto;l=131 + * @return The bytesType. + */ + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.Bytes getBytesType() { + if (bytesTypeBuilder_ == null) { + return bytesType_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } else { + return bytesTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setBytesType(com.google.bigtable.admin.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bytesType_ = value; + } else { + bytesTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setBytesType( + com.google.bigtable.admin.v2.Type.Bytes.Builder builderForValue) { + if (bytesTypeBuilder_ == null) { + bytesType_ = builderForValue.build(); + } else { + bytesTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeBytesType(com.google.bigtable.admin.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && bytesType_ != null + && bytesType_ != com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance()) { + getBytesTypeBuilder().mergeFrom(value); + } else { + bytesType_ = value; + } + } else { + bytesTypeBuilder_.mergeFrom(value); + } + if (bytesType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearBytesType() { + bitField0_ = (bitField0_ & ~0x00000001); + bytesType_ = null; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.dispose(); + bytesTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.Bytes.Builder getBytesTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBytesTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if (bytesTypeBuilder_ != null) { + return bytesTypeBuilder_.getMessageOrBuilder(); + } else { + return bytesType_ == null + ? com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + internalGetBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder>( + getBytesType(), getParentForChildren(), isClean()); + bytesType_ = null; + } + return bytesTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + private static final com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes(); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigEndianBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Int64.Encoding.BigEndianBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OrderedCodeBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Encodes the value in a variable length binary format of up to 10 bytes.
+       * Values that are closer to zero use fewer bytes.
+       *
+       * Sorted mode: all values are supported.
+       *
+       * Distinct mode: all values are supported.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} + */ + public static final class OrderedCodeBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + OrderedCodeBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OrderedCodeBytes"); + } + + // Use OrderedCodeBytes.newBuilder() to construct. + private OrderedCodeBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OrderedCodeBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Int64.Encoding.OrderedCodeBytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes other = + (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes 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.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes 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.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Int64.Encoding.OrderedCodeBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Encodes the value in a variable length binary format of up to 10 bytes.
+         * Values that are closer to zero use fewer bytes.
+         *
+         * Sorted mode: all values are supported.
+         *
+         * Distinct mode: all values are supported.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder + .class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes build() { + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes buildPartial() { + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes result = + new com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) { + return mergeFrom( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes other) { + if (other + == com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + private static final com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes(); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrderedCodeBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIG_ENDIAN_BYTES(1), + ORDERED_CODE_BYTES(2), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return BIG_ENDIAN_BYTES; + case 2: + return ORDERED_CODE_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int BIG_ENDIAN_BYTES_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return Whether the bigEndianBytes field is set. + */ + @java.lang.Override + public boolean hasBigEndianBytes() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return The bigEndianBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + + public static final int ORDERED_CODE_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + getOrderedCodeBytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_); + } + size += getUnknownFields().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.admin.v2.Type.Int64.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Int64.Encoding other = + (com.google.bigtable.admin.v2.Type.Int64.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getBigEndianBytes().equals(other.getBigEndianBytes())) return false; + break; + case 2: + if (!getOrderedCodeBytes().equals(other.getOrderedCodeBytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + BIG_ENDIAN_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getBigEndianBytes().hashCode(); + break; + case 2: + hash = (37 * hash) + ORDERED_CODE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getOrderedCodeBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding 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.admin.v2.Type.Int64.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding 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.admin.v2.Type.Int64.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Int64.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Int64.Encoding) + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.Encoding.class, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Int64.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bigEndianBytesBuilder_ != null) { + bigEndianBytesBuilder_.clear(); + } + if (orderedCodeBytesBuilder_ != null) { + orderedCodeBytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding build() { + com.google.bigtable.admin.v2.Type.Int64.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding buildPartial() { + com.google.bigtable.admin.v2.Type.Int64.Encoding result = + new com.google.bigtable.admin.v2.Type.Int64.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Int64.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type.Int64.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && bigEndianBytesBuilder_ != null) { + result.encoding_ = bigEndianBytesBuilder_.build(); + } + if (encodingCase_ == 2 && orderedCodeBytesBuilder_ != null) { + result.encoding_ = orderedCodeBytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Int64.Encoding) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Int64.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Int64.Encoding other) { + if (other == com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case BIG_ENDIAN_BYTES: + { + mergeBigEndianBytes(other.getBigEndianBytes()); + break; + } + case ORDERED_CODE_BYTES: + { + mergeOrderedCodeBytes(other.getOrderedCodeBytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBigEndianBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetOrderedCodeBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder> + bigEndianBytesBuilder_; + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return Whether the bigEndianBytes field is set. + */ + @java.lang.Override + public boolean hasBigEndianBytes() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * + * @return The bigEndianBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes() { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return bigEndianBytesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + public Builder setBigEndianBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes value) { + if (bigEndianBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + bigEndianBytesBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + public Builder setBigEndianBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder + builderForValue) { + if (bigEndianBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + bigEndianBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + public Builder mergeBigEndianBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes value) { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.newBuilder( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + bigEndianBytesBuilder_.mergeFrom(value); + } else { + bigEndianBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + public Builder clearBigEndianBytes() { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + bigEndianBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder + getBigEndianBytesBuilder() { + return internalGetBigEndianBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder() { + if ((encodingCase_ == 1) && (bigEndianBytesBuilder_ != null)) { + return bigEndianBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder> + internalGetBigEndianBytesFieldBuilder() { + if (bigEndianBytesBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } + bigEndianBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return bigEndianBytesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder> + orderedCodeBytesBuilder_; + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + getOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return orderedCodeBytesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder + builderForValue) { + if (orderedCodeBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder mergeOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.newBuilder( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) + encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + orderedCodeBytesBuilder_.mergeFrom(value); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder clearOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + orderedCodeBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder + getOrderedCodeBytesBuilder() { + return internalGetOrderedCodeBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if ((encodingCase_ == 2) && (orderedCodeBytesBuilder_ != null)) { + return orderedCodeBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder> + internalGetOrderedCodeBytesFieldBuilder() { + if (orderedCodeBytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + orderedCodeBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return orderedCodeBytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Int64.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Int64.Encoding) + private static final com.google.bigtable.admin.v2.Type.Int64.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Int64.Encoding(); + } + + public static com.google.bigtable.admin.v2.Type.Int64.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Int64.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type.Int64.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.admin.v2.Type.Int64)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Int64 other = (com.google.bigtable.admin.v2.Type.Int64) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64 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.admin.v2.Type.Int64 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64 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.admin.v2.Type.Int64 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Int64 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Int64 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Int64
+     * Values of type `Int64` are stored in `Value.int_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Int64) + com.google.bigtable.admin.v2.Type.Int64OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Int64.class, + com.google.bigtable.admin.v2.Type.Int64.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Int64.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Int64_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64 getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64 build() { + com.google.bigtable.admin.v2.Type.Int64 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64 buildPartial() { + com.google.bigtable.admin.v2.Type.Int64 result = + new com.google.bigtable.admin.v2.Type.Int64(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Int64 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Int64) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Int64) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Int64 other) { + if (other == com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type.Int64.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.admin.v2.Type.Int64.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.admin.v2.Type.Int64.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.admin.v2.Type.Int64.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ + != com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Int64) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Int64) + private static final com.google.bigtable.admin.v2.Type.Int64 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Int64(); + } + + public static com.google.bigtable.admin.v2.Type.Int64 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Int64 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoolOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Bool) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * bool
+   * Values of type `Bool` are stored in `Value.bool_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bool} + */ + public static final class Bool extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bool) + BoolOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Bool"); + } + + // Use Bool.newBuilder() to construct. + private Bool(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Bool() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bool.class, + com.google.bigtable.admin.v2.Type.Bool.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Bool)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Bool other = (com.google.bigtable.admin.v2.Type.Bool) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bool 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.admin.v2.Type.Bool parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bool 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.admin.v2.Type.Bool parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Bool parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Bool 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * bool
+     * Values of type `Bool` are stored in `Value.bool_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bool} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Bool) + com.google.bigtable.admin.v2.Type.BoolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Bool.class, + com.google.bigtable.admin.v2.Type.Bool.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Bool.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Bool_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bool getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bool build() { + com.google.bigtable.admin.v2.Type.Bool result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bool buildPartial() { + com.google.bigtable.admin.v2.Type.Bool result = + new com.google.bigtable.admin.v2.Type.Bool(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Bool) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Bool) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Bool other) { + if (other == com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Bool) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Bool) + private static final com.google.bigtable.admin.v2.Type.Bool DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Bool(); + } + + public static com.google.bigtable.admin.v2.Type.Bool getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bool parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Bool getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Float32OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Float32) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Float32
+   * Values of type `Float32` are stored in `Value.float_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Float32} + */ + public static final class Float32 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Float32) + Float32OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Float32"); + } + + // Use Float32.newBuilder() to construct. + private Float32(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Float32() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float32_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float32_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Float32.class, + com.google.bigtable.admin.v2.Type.Float32.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Float32)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Float32 other = + (com.google.bigtable.admin.v2.Type.Float32) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float32 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.admin.v2.Type.Float32 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float32 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.admin.v2.Type.Float32 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float32 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Float32 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Float32
+     * Values of type `Float32` are stored in `Value.float_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Float32} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Float32) + com.google.bigtable.admin.v2.Type.Float32OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float32_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float32_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Float32.class, + com.google.bigtable.admin.v2.Type.Float32.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Float32.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float32_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32 getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32 build() { + com.google.bigtable.admin.v2.Type.Float32 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32 buildPartial() { + com.google.bigtable.admin.v2.Type.Float32 result = + new com.google.bigtable.admin.v2.Type.Float32(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Float32) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Float32) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Float32 other) { + if (other == com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Float32) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Float32) + private static final com.google.bigtable.admin.v2.Type.Float32 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Float32(); + } + + public static com.google.bigtable.admin.v2.Type.Float32 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Float32 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Float32 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Float64OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Float64) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Float64
+   * Values of type `Float64` are stored in `Value.float_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Float64} + */ + public static final class Float64 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Float64) + Float64OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Float64"); + } + + // Use Float64.newBuilder() to construct. + private Float64(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Float64() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Float64.class, + com.google.bigtable.admin.v2.Type.Float64.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Float64)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Float64 other = + (com.google.bigtable.admin.v2.Type.Float64) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float64 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.admin.v2.Type.Float64 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float64 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.admin.v2.Type.Float64 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Float64 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Float64 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Float64
+     * Values of type `Float64` are stored in `Value.float_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Float64} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Float64) + com.google.bigtable.admin.v2.Type.Float64OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Float64.class, + com.google.bigtable.admin.v2.Type.Float64.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Float64.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Float64_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64 getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64 build() { + com.google.bigtable.admin.v2.Type.Float64 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64 buildPartial() { + com.google.bigtable.admin.v2.Type.Float64 result = + new com.google.bigtable.admin.v2.Type.Float64(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Float64) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Float64) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Float64 other) { + if (other == com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Float64) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Float64) + private static final com.google.bigtable.admin.v2.Type.Float64 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Float64(); + } + + public static com.google.bigtable.admin.v2.Type.Float64 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Float64 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Float64 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimestampOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Timestamp) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.admin.v2.Type.Timestamp.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Timestamp
+   * Values of type `Timestamp` are stored in `Value.timestamp_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Timestamp} + */ + public static final class Timestamp extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Timestamp) + TimestampOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Timestamp"); + } + + // Use Timestamp.newBuilder() to construct. + private Timestamp(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Timestamp() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Timestamp.class, + com.google.bigtable.admin.v2.Type.Timestamp.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Timestamp.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + boolean hasUnixMicrosInt64(); + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + com.google.bigtable.admin.v2.Type.Int64.Encoding getUnixMicrosInt64(); + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder getUnixMicrosInt64OrBuilder(); + + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Timestamp.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Timestamp.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.class, + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder.class); + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UNIX_MICROS_INT64(1), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return UNIX_MICROS_INT64; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int UNIX_MICROS_INT64_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + @java.lang.Override + public boolean hasUnixMicrosInt64() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding getUnixMicrosInt64() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder + getUnixMicrosInt64OrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_); + } + size += getUnknownFields().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.admin.v2.Type.Timestamp.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Timestamp.Encoding other = + (com.google.bigtable.admin.v2.Type.Timestamp.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getUnixMicrosInt64().equals(other.getUnixMicrosInt64())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + UNIX_MICROS_INT64_FIELD_NUMBER; + hash = (53 * hash) + getUnixMicrosInt64().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding 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.admin.v2.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding 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.admin.v2.Type.Timestamp.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Timestamp.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Timestamp.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Timestamp.Encoding) + com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.class, + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Timestamp.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (unixMicrosInt64Builder_ != null) { + unixMicrosInt64Builder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding build() { + com.google.bigtable.admin.v2.Type.Timestamp.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding buildPartial() { + com.google.bigtable.admin.v2.Type.Timestamp.Encoding result = + new com.google.bigtable.admin.v2.Type.Timestamp.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Timestamp.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.bigtable.admin.v2.Type.Timestamp.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && unixMicrosInt64Builder_ != null) { + result.encoding_ = unixMicrosInt64Builder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Timestamp.Encoding) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Timestamp.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Timestamp.Encoding other) { + if (other == com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case UNIX_MICROS_INT64: + { + mergeUnixMicrosInt64(other.getUnixMicrosInt64()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetUnixMicrosInt64FieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder> + unixMicrosInt64Builder_; + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + @java.lang.Override + public boolean hasUnixMicrosInt64() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.Encoding getUnixMicrosInt64() { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return unixMicrosInt64Builder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder setUnixMicrosInt64(com.google.bigtable.admin.v2.Type.Int64.Encoding value) { + if (unixMicrosInt64Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + unixMicrosInt64Builder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder setUnixMicrosInt64( + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder builderForValue) { + if (unixMicrosInt64Builder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + unixMicrosInt64Builder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder mergeUnixMicrosInt64( + com.google.bigtable.admin.v2.Type.Int64.Encoding value) { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.newBuilder( + (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + unixMicrosInt64Builder_.mergeFrom(value); + } else { + unixMicrosInt64Builder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder clearUnixMicrosInt64() { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + unixMicrosInt64Builder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder + getUnixMicrosInt64Builder() { + return internalGetUnixMicrosInt64FieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder + getUnixMicrosInt64OrBuilder() { + if ((encodingCase_ == 1) && (unixMicrosInt64Builder_ != null)) { + return unixMicrosInt64Builder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.admin.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder> + internalGetUnixMicrosInt64FieldBuilder() { + if (unixMicrosInt64Builder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.admin.v2.Type.Int64.Encoding.getDefaultInstance(); + } + unixMicrosInt64Builder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64.Encoding, + com.google.bigtable.admin.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Int64.EncodingOrBuilder>( + (com.google.bigtable.admin.v2.Type.Int64.Encoding) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return unixMicrosInt64Builder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Timestamp.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Timestamp.Encoding) + private static final com.google.bigtable.admin.v2.Type.Timestamp.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Timestamp.Encoding(); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Timestamp.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type.Timestamp.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.admin.v2.Type.Timestamp)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Timestamp other = + (com.google.bigtable.admin.v2.Type.Timestamp) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp 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.admin.v2.Type.Timestamp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp 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.admin.v2.Type.Timestamp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Timestamp 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Timestamp
+     * Values of type `Timestamp` are stored in `Value.timestamp_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Timestamp} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Timestamp) + com.google.bigtable.admin.v2.Type.TimestampOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Timestamp.class, + com.google.bigtable.admin.v2.Type.Timestamp.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Timestamp.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp build() { + com.google.bigtable.admin.v2.Type.Timestamp result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp buildPartial() { + com.google.bigtable.admin.v2.Type.Timestamp result = + new com.google.bigtable.admin.v2.Type.Timestamp(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Timestamp result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Timestamp) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Timestamp) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Timestamp other) { + if (other == com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type.Timestamp.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp.Encoding, + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.admin.v2.Type.Timestamp.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.admin.v2.Type.Timestamp.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ + != com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + public com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp.Encoding, + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp.Encoding, + com.google.bigtable.admin.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Timestamp.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Timestamp) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Timestamp) + private static final com.google.bigtable.admin.v2.Type.Timestamp DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Timestamp(); + } + + public static com.google.bigtable.admin.v2.Type.Timestamp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Timestamp parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Timestamp getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Date) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Date
+   * Values of type `Date` are stored in `Value.date_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Date} + */ + public static final class Date extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Date) + DateOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Date"); + } + + // Use Date.newBuilder() to construct. + private Date(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Date() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Date_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Date_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Date.class, + com.google.bigtable.admin.v2.Type.Date.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Date)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Date other = (com.google.bigtable.admin.v2.Type.Date) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Date 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.admin.v2.Type.Date parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Date 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.admin.v2.Type.Date parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Date parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Date parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Date parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Date 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Date
+     * Values of type `Date` are stored in `Value.date_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Date} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Date) + com.google.bigtable.admin.v2.Type.DateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Date_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Date_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Date.class, + com.google.bigtable.admin.v2.Type.Date.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Date.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Date_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Date getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Date build() { + com.google.bigtable.admin.v2.Type.Date result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Date buildPartial() { + com.google.bigtable.admin.v2.Type.Date result = + new com.google.bigtable.admin.v2.Type.Date(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Date) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Date) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Date other) { + if (other == com.google.bigtable.admin.v2.Type.Date.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Date) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Date) + private static final com.google.bigtable.admin.v2.Type.Date DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Date(); + } + + public static com.google.bigtable.admin.v2.Type.Date getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Date parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Date getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StructOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + java.util.List getFieldsList(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + com.google.bigtable.admin.v2.Type.Struct.Field getFields(int index); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + int getFieldsCount(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + java.util.List + getFieldsOrBuilderList(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * A structured data value, consisting of fields which map to dynamically
+   * typed values.
+   * Values of type `Struct` are stored in `Value.array_value` where entries are
+   * in the same order and number as `field_types`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct} + */ + public static final class Struct extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct) + StructOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Struct"); + } + + // Use Struct.newBuilder() to construct. + private Struct(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Struct() { + fields_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.class, + com.google.bigtable.admin.v2.Type.Struct.Builder.class); + } + + public interface FieldOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct.Field) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + java.lang.String getFieldName(); + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + com.google.protobuf.ByteString getFieldNameBytes(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return The type. + */ + com.google.bigtable.admin.v2.Type getType(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getTypeOrBuilder(); + } + + /** + * + * + *
+     * A struct field and its type.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Field} + */ + public static final class Field extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Field"); + } + + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Field() { + fieldName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Field.class, + com.google.bigtable.admin.v2.Type.Struct.Field.Builder.class); + } + + private int bitField0_; + public static final int FIELD_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldName_ = ""; + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + @java.lang.Override + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + 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(); + fieldName_ = s; + return s; + } + } + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.Type type_; + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getType() { + return type_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : type_; + } + + 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.GeneratedMessage.isStringEmpty(fieldName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fieldName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fieldName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + size += getUnknownFields().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.admin.v2.Type.Struct.Field)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct.Field other = + (com.google.bigtable.admin.v2.Type.Struct.Field) obj; + + if (!getFieldName().equals(other.getFieldName())) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FIELD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFieldName().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field 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.admin.v2.Type.Struct.Field parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field 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.admin.v2.Type.Struct.Field parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct.Field 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A struct field and its type.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Field} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct.Field) + com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Field.class, + com.google.bigtable.admin.v2.Type.Struct.Field.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Struct.Field.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldName_ = ""; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Field getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.Field.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Field build() { + com.google.bigtable.admin.v2.Type.Struct.Field result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Field buildPartial() { + com.google.bigtable.admin.v2.Type.Struct.Field result = + new com.google.bigtable.admin.v2.Type.Struct.Field(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Struct.Field result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldName_ = fieldName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Struct.Field) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Struct.Field) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Struct.Field other) { + if (other == com.google.bigtable.admin.v2.Type.Struct.Field.getDefaultInstance()) + return this; + if (!other.getFieldName().isEmpty()) { + fieldName_ = other.fieldName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasType()) { + mergeType(other.getType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + fieldName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object fieldName_ = ""; + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @param value The fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFieldName() { + fieldName_ = getDefaultInstance().getFieldName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @param value The bytes for fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.admin.v2.Type type_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + * + * @return The type. + */ + public com.google.bigtable.admin.v2.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.admin.v2.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public Builder mergeType(com.google.bigtable.admin.v2.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && type_ != null + && type_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public com.google.bigtable.admin.v2.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.admin.v2.Type type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct.Field) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct.Field) + private static final com.google.bigtable.admin.v2.Type.Struct.Field DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Struct.Field(); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Field getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Field parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct.Field getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + boolean hasSingleton(); + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton getSingleton(); + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder getSingletonOrBuilder(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return Whether the delimitedBytes field is set. + */ + boolean hasDelimitedBytes(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return The delimitedBytes. + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes getDelimitedBytes(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + boolean hasOrderedCodeBytes(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes getOrderedCodeBytes(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder(); + + com.google.bigtable.admin.v2.Type.Struct.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder.class); + } + + public interface SingletonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Uses the encoding of `fields[0].type` as-is.
+       * Only valid if `fields.size == 1`.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} + */ + public static final class Singleton extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + SingletonOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Singleton"); + } + + // Use Singleton.newBuilder() to construct. + private Singleton(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Singleton() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Struct.Encoding.Singleton)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton other = + (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton 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.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton 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.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct.Encoding.Singleton 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Uses the encoding of `fields[0].type` as-is.
+         * Only valid if `fields.size == 1`.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.Singleton} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton build() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton buildPartial() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton result = + new com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton other) { + if (other + == com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) + private static final com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton(); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Singleton parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct.Encoding.Singleton + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DelimitedBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Byte sequence used to delimit concatenated fields. The delimiter must
+         * contain at least 1 character and at most 50 characters.
+         * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + com.google.protobuf.ByteString getDelimiter(); + } + + /** + * + * + *
+       * Fields are encoded independently and concatenated with a configurable
+       * `delimiter` in between.
+       *
+       * A struct with no fields defined is encoded as a single `delimiter`.
+       *
+       * Sorted mode:
+       *
+       * - Fields are encoded in sorted mode.
+       * - Encoded field values must not contain any bytes <= `delimiter[0]`
+       * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+       * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+       *
+       * Distinct mode:
+       *
+       * - Fields are encoded in distinct mode.
+       * - Encoded field values must not contain `delimiter[0]`.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} + */ + public static final class DelimitedBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + DelimitedBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DelimitedBytes"); + } + + // Use DelimitedBytes.newBuilder() to construct. + private DelimitedBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DelimitedBytes() { + delimiter_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder.class); + } + + public static final int DELIMITER_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString delimiter_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+         * Byte sequence used to delimit concatenated fields. The delimiter must
+         * contain at least 1 character and at most 50 characters.
+         * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiter() { + return delimiter_; + } + + 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 (!delimiter_.isEmpty()) { + output.writeBytes(1, delimiter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!delimiter_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, delimiter_); + } + size += getUnknownFields().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.admin.v2.Type.Struct.Encoding.DelimitedBytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes other = + (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) obj; + + if (!getDelimiter().equals(other.getDelimiter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DELIMITER_FIELD_NUMBER; + hash = (53 * hash) + getDelimiter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes 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.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes 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.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct.Encoding.DelimitedBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Fields are encoded independently and concatenated with a configurable
+         * `delimiter` in between.
+         *
+         * A struct with no fields defined is encoded as a single `delimiter`.
+         *
+         * Sorted mode:
+         *
+         * - Fields are encoded in sorted mode.
+         * - Encoded field values must not contain any bytes <= `delimiter[0]`
+         * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+         * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+         *
+         * Distinct mode:
+         *
+         * - Fields are encoded in distinct mode.
+         * - Encoded field values must not contain `delimiter[0]`.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + delimiter_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes build() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes buildPartial() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes result = + new com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.delimiter_ = delimiter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) { + return mergeFrom( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes other) { + if (other + == com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance()) return this; + if (!other.getDelimiter().isEmpty()) { + setDelimiter(other.getDelimiter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + delimiter_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString delimiter_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiter() { + return delimiter_; + } + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @param value The delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiter(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + delimiter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @return This builder for chaining. + */ + public Builder clearDelimiter() { + bitField0_ = (bitField0_ & ~0x00000001); + delimiter_ = getDefaultInstance().getDelimiter(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + private static final com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes(); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DelimitedBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct.Encoding.DelimitedBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OrderedCodeBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Fields are encoded independently and concatenated with the fixed byte
+       * pair {0x00, 0x01} in between.
+       *
+       * Any null (0x00) byte in an encoded field is replaced by the fixed byte
+       * pair {0x00, 0xFF}.
+       *
+       * Fields that encode to the empty string "" have special handling:
+       *
+       * - If *every* field encodes to "", or if the STRUCT has no fields
+       * defined, then the STRUCT is encoded as the fixed byte pair
+       * {0x00, 0x00}.
+       * - Otherwise, the STRUCT only encodes until the last non-empty field,
+       * omitting any trailing empty fields. Any empty fields that aren't
+       * omitted are replaced with the fixed byte pair {0x00, 0x00}.
+       *
+       * Examples:
+       *
+       * - STRUCT()             -> "\00\00"
+       * - STRUCT("")           -> "\00\00"
+       * - STRUCT("", "")       -> "\00\00"
+       * - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
+       * - STRUCT("A", "")      -> "A"
+       * - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
+       * - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
+       *
+       *
+       * Since null bytes are always escaped, this encoding can cause size
+       * blowup for encodings like `Int64.BigEndianBytes` that are likely to
+       * produce many such bytes.
+       *
+       * Sorted mode:
+       *
+       * - Fields are encoded in sorted mode.
+       * - All values supported by the field encodings are allowed
+       * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+       * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+       *
+       * Distinct mode:
+       *
+       * - Fields are encoded in distinct mode.
+       * - All values supported by the field encodings are allowed.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} + */ + public static final class OrderedCodeBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + OrderedCodeBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OrderedCodeBytes"); + } + + // Use OrderedCodeBytes.newBuilder() to construct. + private OrderedCodeBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OrderedCodeBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Struct.Encoding.OrderedCodeBytes)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes other = + (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes 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.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes 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.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct.Encoding.OrderedCodeBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Fields are encoded independently and concatenated with the fixed byte
+         * pair {0x00, 0x01} in between.
+         *
+         * Any null (0x00) byte in an encoded field is replaced by the fixed byte
+         * pair {0x00, 0xFF}.
+         *
+         * Fields that encode to the empty string "" have special handling:
+         *
+         * - If *every* field encodes to "", or if the STRUCT has no fields
+         * defined, then the STRUCT is encoded as the fixed byte pair
+         * {0x00, 0x00}.
+         * - Otherwise, the STRUCT only encodes until the last non-empty field,
+         * omitting any trailing empty fields. Any empty fields that aren't
+         * omitted are replaced with the fixed byte pair {0x00, 0x00}.
+         *
+         * Examples:
+         *
+         * - STRUCT()             -> "\00\00"
+         * - STRUCT("")           -> "\00\00"
+         * - STRUCT("", "")       -> "\00\00"
+         * - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
+         * - STRUCT("A", "")      -> "A"
+         * - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
+         * - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
+         *
+         *
+         * Since null bytes are always escaped, this encoding can cause size
+         * blowup for encodings like `Int64.BigEndianBytes` that are likely to
+         * produce many such bytes.
+         *
+         * Sorted mode:
+         *
+         * - Fields are encoded in sorted mode.
+         * - All values supported by the field encodings are allowed
+         * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+         * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+         *
+         * Distinct mode:
+         *
+         * - Fields are encoded in distinct mode.
+         * - All values supported by the field encodings are allowed.
+         * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder + .class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes build() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes buildPartial() { + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes result = + new com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) { + return mergeFrom( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes other) { + if (other + == com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + private static final com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes(); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrderedCodeBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SINGLETON(1), + DELIMITED_BYTES(2), + ORDERED_CODE_BYTES(3), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return SINGLETON; + case 2: + return DELIMITED_BYTES; + case 3: + return ORDERED_CODE_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int SINGLETON_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + @java.lang.Override + public boolean hasSingleton() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton getSingleton() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder + getSingletonOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + public static final int DELIMITED_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return Whether the delimitedBytes field is set. + */ + @java.lang.Override + public boolean hasDelimitedBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return The delimitedBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes getDelimitedBytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + + public static final int ORDERED_CODE_BYTES_FIELD_NUMBER = 3; + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 3; + } + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + getOrderedCodeBytes() { + if (encodingCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if (encodingCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_); + } + if (encodingCase_ == 3) { + output.writeMessage( + 3, (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_); + } + if (encodingCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_); + } + size += getUnknownFields().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.admin.v2.Type.Struct.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct.Encoding other = + (com.google.bigtable.admin.v2.Type.Struct.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getSingleton().equals(other.getSingleton())) return false; + break; + case 2: + if (!getDelimitedBytes().equals(other.getDelimitedBytes())) return false; + break; + case 3: + if (!getOrderedCodeBytes().equals(other.getOrderedCodeBytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + SINGLETON_FIELD_NUMBER; + hash = (53 * hash) + getSingleton().hashCode(); + break; + case 2: + hash = (37 * hash) + DELIMITED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getDelimitedBytes().hashCode(); + break; + case 3: + hash = (37 * hash) + ORDERED_CODE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getOrderedCodeBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding 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.admin.v2.Type.Struct.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding 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.admin.v2.Type.Struct.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct.Encoding) + com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.Encoding.class, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Struct.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (singletonBuilder_ != null) { + singletonBuilder_.clear(); + } + if (delimitedBytesBuilder_ != null) { + delimitedBytesBuilder_.clear(); + } + if (orderedCodeBytesBuilder_ != null) { + orderedCodeBytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding build() { + com.google.bigtable.admin.v2.Type.Struct.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding buildPartial() { + com.google.bigtable.admin.v2.Type.Struct.Encoding result = + new com.google.bigtable.admin.v2.Type.Struct.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Struct.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type.Struct.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && singletonBuilder_ != null) { + result.encoding_ = singletonBuilder_.build(); + } + if (encodingCase_ == 2 && delimitedBytesBuilder_ != null) { + result.encoding_ = delimitedBytesBuilder_.build(); + } + if (encodingCase_ == 3 && orderedCodeBytesBuilder_ != null) { + result.encoding_ = orderedCodeBytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Struct.Encoding) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Struct.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Struct.Encoding other) { + if (other == com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case SINGLETON: + { + mergeSingleton(other.getSingleton()); + break; + } + case DELIMITED_BYTES: + { + mergeDelimitedBytes(other.getDelimitedBytes()); + break; + } + case ORDERED_CODE_BYTES: + { + mergeOrderedCodeBytes(other.getOrderedCodeBytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetSingletonFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetDelimitedBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetOrderedCodeBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder> + singletonBuilder_; + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + @java.lang.Override + public boolean hasSingleton() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton getSingleton() { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return singletonBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder setSingleton( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton value) { + if (singletonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + singletonBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder setSingleton( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder builderForValue) { + if (singletonBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + singletonBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder mergeSingleton( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton value) { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.newBuilder( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + singletonBuilder_.mergeFrom(value); + } else { + singletonBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder clearSingleton() { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + singletonBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder + getSingletonBuilder() { + return internalGetSingletonFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder + getSingletonOrBuilder() { + if ((encodingCase_ == 1) && (singletonBuilder_ != null)) { + return singletonBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder> + internalGetSingletonFieldBuilder() { + if (singletonBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + singletonBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.SingletonOrBuilder>( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.Singleton) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return singletonBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder> + delimitedBytesBuilder_; + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return Whether the delimitedBytes field is set. + */ + @java.lang.Override + public boolean hasDelimitedBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * + * @return The delimitedBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + getDelimitedBytes() { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return delimitedBytesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + public Builder setDelimitedBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes value) { + if (delimitedBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + delimitedBytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + public Builder setDelimitedBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder + builderForValue) { + if (delimitedBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + delimitedBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + public Builder mergeDelimitedBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes value) { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.newBuilder( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) + encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + delimitedBytesBuilder_.mergeFrom(value); + } else { + delimitedBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + public Builder clearDelimitedBytes() { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + delimitedBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder + getDelimitedBytesBuilder() { + return internalGetDelimitedBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder() { + if ((encodingCase_ == 2) && (delimitedBytesBuilder_ != null)) { + return delimitedBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder> + internalGetDelimitedBytesFieldBuilder() { + if (delimitedBytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance(); + } + delimitedBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.DelimitedBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return delimitedBytesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder> + orderedCodeBytesBuilder_; + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 3; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + getOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } else { + if (encodingCase_ == 3) { + return orderedCodeBytesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder + builderForValue) { + if (orderedCodeBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder mergeOrderedCodeBytes( + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3 + && encoding_ + != com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.newBuilder( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) + encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 3) { + orderedCodeBytesBuilder_.mergeFrom(value); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder clearOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 3) { + encodingCase_ = 0; + encoding_ = null; + } + orderedCodeBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder + getOrderedCodeBytesBuilder() { + return internalGetOrderedCodeBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if ((encodingCase_ == 3) && (orderedCodeBytesBuilder_ != null)) { + return orderedCodeBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * + * .google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder> + internalGetOrderedCodeBytesFieldBuilder() { + if (orderedCodeBytesBuilder_ == null) { + if (!(encodingCase_ == 3)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + orderedCodeBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 3; + onChanged(); + return orderedCodeBytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct.Encoding) + private static final com.google.bigtable.admin.v2.Type.Struct.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Struct.Encoding(); + } + + public static com.google.bigtable.admin.v2.Type.Struct.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int FIELDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List fields_; + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public java.util.List getFieldsList() { + return fields_; + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public int getFieldsCount() { + return fields_.size(); + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Field getFields(int index) { + return fields_.get(index); + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index) { + return fields_.get(index); + } + + public static final int ENCODING_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.Type.Struct.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + + 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 { + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(1, fields_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fields_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEncoding()); + } + size += getUnknownFields().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.admin.v2.Type.Struct)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Struct other = + (com.google.bigtable.admin.v2.Type.Struct) obj; + + if (!getFieldsList().equals(other.getFieldsList())) return false; + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct 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.admin.v2.Type.Struct parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct 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.admin.v2.Type.Struct parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Struct parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Struct 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A structured data value, consisting of fields which map to dynamically
+     * typed values.
+     * Values of type `Struct` are stored in `Value.array_value` where entries are
+     * in the same order and number as `field_types`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Struct} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Struct) + com.google.bigtable.admin.v2.Type.StructOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Struct.class, + com.google.bigtable.admin.v2.Type.Struct.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Struct.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFieldsFieldBuilder(); + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + } else { + fields_ = null; + fieldsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Struct_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct build() { + com.google.bigtable.admin.v2.Type.Struct result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct buildPartial() { + com.google.bigtable.admin.v2.Type.Struct result = + new com.google.bigtable.admin.v2.Type.Struct(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.admin.v2.Type.Struct result) { + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Struct result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Struct) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Struct) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Struct other) { + if (other == com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance()) return this; + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.admin.v2.Type.Struct.Field m = + input.readMessage( + com.google.bigtable.admin.v2.Type.Struct.Field.parser(), + extensionRegistry); + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(m); + } else { + fieldsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List fields_ = + java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fields_ = + new java.util.ArrayList(fields_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Field, + com.google.bigtable.admin.v2.Type.Struct.Field.Builder, + com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.Field getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder setFields(int index, com.google.bigtable.admin.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder setFields( + int index, com.google.bigtable.admin.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields(com.google.bigtable.admin.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields(int index, com.google.bigtable.admin.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields( + com.google.bigtable.admin.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields( + int index, com.google.bigtable.admin.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder addAllFields( + java.lang.Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.Field.Builder getFieldsBuilder(int index) { + return internalGetFieldsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.Field.Builder addFieldsBuilder() { + return internalGetFieldsFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.Type.Struct.Field.getDefaultInstance()); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.admin.v2.Type.Struct.Field.Builder addFieldsBuilder(int index) { + return internalGetFieldsFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.Type.Struct.Field.getDefaultInstance()); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.admin.v2.Type.Struct.Field fields = 1; + */ + public java.util.List + getFieldsBuilderList() { + return internalGetFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Field, + com.google.bigtable.admin.v2.Type.Struct.Field.Builder, + com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder> + internalGetFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Field, + com.google.bigtable.admin.v2.Type.Struct.Field.Builder, + com.google.bigtable.admin.v2.Type.Struct.FieldOrBuilder>( + fields_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private com.google.bigtable.admin.v2.Type.Struct.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + public com.google.bigtable.admin.v2.Type.Struct.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder setEncoding(com.google.bigtable.admin.v2.Type.Struct.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder setEncoding( + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder mergeEncoding(com.google.bigtable.admin.v2.Type.Struct.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && encoding_ != null + && encoding_ + != com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000002); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + public com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.admin.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Struct.Encoding encoding = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct.Encoding, + com.google.bigtable.admin.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.admin.v2.Type.Struct.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Struct) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Struct) + private static final com.google.bigtable.admin.v2.Type.Struct DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Struct(); + } + + public static com.google.bigtable.admin.v2.Type.Struct getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Struct parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Struct getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ProtoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Proto) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + java.lang.String getSchemaBundleId(); + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + com.google.protobuf.ByteString getSchemaBundleIdBytes(); + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + java.lang.String getMessageName(); + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + com.google.protobuf.ByteString getMessageNameBytes(); + } + + /** + * + * + *
+   * A protobuf message type.
+   * Values of type `Proto` are stored in `Value.bytes_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Proto} + */ + public static final class Proto extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Proto) + ProtoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Proto"); + } + + // Use Proto.newBuilder() to construct. + private Proto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Proto() { + schemaBundleId_ = ""; + messageName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Proto.class, + com.google.bigtable.admin.v2.Type.Proto.Builder.class); + } + + public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + @java.lang.Override + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + 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(); + schemaBundleId_ = s; + return s; + } + } + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object messageName_ = ""; + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + @java.lang.Override + public java.lang.String getMessageName() { + java.lang.Object ref = messageName_; + 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(); + messageName_ = s; + return s; + } + } + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageNameBytes() { + java.lang.Object ref = messageName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + messageName_ = 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.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, messageName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, messageName_); + } + size += getUnknownFields().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.admin.v2.Type.Proto)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Proto other = (com.google.bigtable.admin.v2.Type.Proto) obj; + + if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false; + if (!getMessageName().equals(other.getMessageName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SCHEMA_BUNDLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundleId().hashCode(); + hash = (37 * hash) + MESSAGE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMessageName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Proto 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.admin.v2.Type.Proto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Proto 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.admin.v2.Type.Proto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Proto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Proto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A protobuf message type.
+     * Values of type `Proto` are stored in `Value.bytes_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Proto} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Proto) + com.google.bigtable.admin.v2.Type.ProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Proto.class, + com.google.bigtable.admin.v2.Type.Proto.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Proto.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaBundleId_ = ""; + messageName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Proto getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Proto build() { + com.google.bigtable.admin.v2.Type.Proto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Proto buildPartial() { + com.google.bigtable.admin.v2.Type.Proto result = + new com.google.bigtable.admin.v2.Type.Proto(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Proto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaBundleId_ = schemaBundleId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.messageName_ = messageName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Proto) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Proto) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Proto other) { + if (other == com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance()) return this; + if (!other.getSchemaBundleId().isEmpty()) { + schemaBundleId_ = other.schemaBundleId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMessageName().isEmpty()) { + messageName_ = other.messageName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + schemaBundleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + messageName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaBundleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchemaBundleId() { + schemaBundleId_ = getDefaultInstance().getSchemaBundleId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The bytes for schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object messageName_ = ""; + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + public java.lang.String getMessageName() { + java.lang.Object ref = messageName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + messageName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + public com.google.protobuf.ByteString getMessageNameBytes() { + java.lang.Object ref = messageName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + messageName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @param value The messageName to set. + * @return This builder for chaining. + */ + public Builder setMessageName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + messageName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessageName() { + messageName_ = getDefaultInstance().getMessageName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @param value The bytes for messageName to set. + * @return This builder for chaining. + */ + public Builder setMessageNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + messageName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Proto) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Proto) + private static final com.google.bigtable.admin.v2.Type.Proto DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Proto(); + } + + public static com.google.bigtable.admin.v2.Type.Proto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Proto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EnumOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Enum) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + java.lang.String getSchemaBundleId(); + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + com.google.protobuf.ByteString getSchemaBundleIdBytes(); + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + java.lang.String getEnumName(); + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + com.google.protobuf.ByteString getEnumNameBytes(); + } + + /** + * + * + *
+   * A protobuf enum type.
+   * Values of type `Enum` are stored in `Value.int_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Enum} + */ + public static final class Enum extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Enum) + EnumOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Enum"); + } + + // Use Enum.newBuilder() to construct. + private Enum(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Enum() { + schemaBundleId_ = ""; + enumName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Enum.class, + com.google.bigtable.admin.v2.Type.Enum.Builder.class); + } + + public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + @java.lang.Override + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + 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(); + schemaBundleId_ = s; + return s; + } + } + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENUM_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object enumName_ = ""; + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + @java.lang.Override + public java.lang.String getEnumName() { + java.lang.Object ref = enumName_; + 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(); + enumName_ = s; + return s; + } + } + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnumNameBytes() { + java.lang.Object ref = enumName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enumName_ = 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.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enumName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, enumName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enumName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, enumName_); + } + size += getUnknownFields().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.admin.v2.Type.Enum)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Enum other = (com.google.bigtable.admin.v2.Type.Enum) obj; + + if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false; + if (!getEnumName().equals(other.getEnumName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SCHEMA_BUNDLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundleId().hashCode(); + hash = (37 * hash) + ENUM_NAME_FIELD_NUMBER; + hash = (53 * hash) + getEnumName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Enum 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.admin.v2.Type.Enum parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Enum 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.admin.v2.Type.Enum parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Enum parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Enum 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A protobuf enum type.
+     * Values of type `Enum` are stored in `Value.int_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Enum} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Enum) + com.google.bigtable.admin.v2.Type.EnumOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Enum.class, + com.google.bigtable.admin.v2.Type.Enum.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Enum.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaBundleId_ = ""; + enumName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Enum getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Enum build() { + com.google.bigtable.admin.v2.Type.Enum result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Enum buildPartial() { + com.google.bigtable.admin.v2.Type.Enum result = + new com.google.bigtable.admin.v2.Type.Enum(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Enum result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaBundleId_ = schemaBundleId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enumName_ = enumName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Enum) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Enum) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Enum other) { + if (other == com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance()) return this; + if (!other.getSchemaBundleId().isEmpty()) { + schemaBundleId_ = other.schemaBundleId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEnumName().isEmpty()) { + enumName_ = other.enumName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + schemaBundleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + enumName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaBundleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchemaBundleId() { + schemaBundleId_ = getDefaultInstance().getSchemaBundleId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The bytes for schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object enumName_ = ""; + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + public java.lang.String getEnumName() { + java.lang.Object ref = enumName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enumName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + public com.google.protobuf.ByteString getEnumNameBytes() { + java.lang.Object ref = enumName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enumName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @param value The enumName to set. + * @return This builder for chaining. + */ + public Builder setEnumName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + enumName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnumName() { + enumName_ = getDefaultInstance().getEnumName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @param value The bytes for enumName to set. + * @return This builder for chaining. + */ + public Builder setEnumNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + enumName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Enum) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Enum) + private static final com.google.bigtable.admin.v2.Type.Enum DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Enum(); + } + + public static com.google.bigtable.admin.v2.Type.Enum getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Enum parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Enum getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Array) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + boolean hasElementType(); + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return The elementType. + */ + com.google.bigtable.admin.v2.Type getElementType(); + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder(); + } + + /** + * + * + *
+   * An ordered list of elements of a given type.
+   * Values of type `Array` are stored in `Value.array_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Array} + */ + public static final class Array extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Array) + ArrayOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Array"); + } + + // Use Array.newBuilder() to construct. + private Array(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Array() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Array.class, + com.google.bigtable.admin.v2.Type.Array.Builder.class); + } + + private int bitField0_; + public static final int ELEMENT_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type elementType_; + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + @java.lang.Override + public boolean hasElementType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return The elementType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getElementType() { + return elementType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : elementType_; + } + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder() { + return elementType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : elementType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getElementType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getElementType()); + } + size += getUnknownFields().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.admin.v2.Type.Array)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Array other = (com.google.bigtable.admin.v2.Type.Array) obj; + + if (hasElementType() != other.hasElementType()) return false; + if (hasElementType()) { + if (!getElementType().equals(other.getElementType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasElementType()) { + hash = (37 * hash) + ELEMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getElementType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Array 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.admin.v2.Type.Array parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Array 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.admin.v2.Type.Array parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Array parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Array parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Array parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Array 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * An ordered list of elements of a given type.
+     * Values of type `Array` are stored in `Value.array_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Array} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Array) + com.google.bigtable.admin.v2.Type.ArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Array.class, + com.google.bigtable.admin.v2.Type.Array.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Array.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetElementTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + elementType_ = null; + if (elementTypeBuilder_ != null) { + elementTypeBuilder_.dispose(); + elementTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Array_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Array getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Array build() { + com.google.bigtable.admin.v2.Type.Array result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Array buildPartial() { + com.google.bigtable.admin.v2.Type.Array result = + new com.google.bigtable.admin.v2.Type.Array(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Array result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.elementType_ = + elementTypeBuilder_ == null ? elementType_ : elementTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Array) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Array) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Array other) { + if (other == com.google.bigtable.admin.v2.Type.Array.getDefaultInstance()) return this; + if (other.hasElementType()) { + mergeElementType(other.getElementType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetElementTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type elementType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + elementTypeBuilder_; + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + public boolean hasElementType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + * + * @return The elementType. + */ + public com.google.bigtable.admin.v2.Type getElementType() { + if (elementTypeBuilder_ == null) { + return elementType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : elementType_; + } else { + return elementTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public Builder setElementType(com.google.bigtable.admin.v2.Type value) { + if (elementTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + } else { + elementTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public Builder setElementType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (elementTypeBuilder_ == null) { + elementType_ = builderForValue.build(); + } else { + elementTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public Builder mergeElementType(com.google.bigtable.admin.v2.Type value) { + if (elementTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && elementType_ != null + && elementType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getElementTypeBuilder().mergeFrom(value); + } else { + elementType_ = value; + } + } else { + elementTypeBuilder_.mergeFrom(value); + } + if (elementType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public Builder clearElementType() { + bitField0_ = (bitField0_ & ~0x00000001); + elementType_ = null; + if (elementTypeBuilder_ != null) { + elementTypeBuilder_.dispose(); + elementTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public com.google.bigtable.admin.v2.Type.Builder getElementTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetElementTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder() { + if (elementTypeBuilder_ != null) { + return elementTypeBuilder_.getMessageOrBuilder(); + } else { + return elementType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : elementType_; + } + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.admin.v2.Type element_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetElementTypeFieldBuilder() { + if (elementTypeBuilder_ == null) { + elementTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getElementType(), getParentForChildren(), isClean()); + elementType_ = null; + } + return elementTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Array) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Array) + private static final com.google.bigtable.admin.v2.Type.Array DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Array(); + } + + public static com.google.bigtable.admin.v2.Type.Array getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Array parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Array getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MapOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Map) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + boolean hasKeyType(); + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return The keyType. + */ + com.google.bigtable.admin.v2.Type getKeyType(); + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + boolean hasValueType(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return The valueType. + */ + com.google.bigtable.admin.v2.Type getValueType(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder(); + } + + /** + * + * + *
+   * A mapping of keys to values of a given type.
+   * Values of type `Map` are stored in a `Value.array_value` where each entry
+   * is another `Value.array_value` with two elements (the key and the value,
+   * in that order).
+   * Normally encoded Map values won't have repeated keys, however, clients are
+   * expected to handle the case in which they do. If the same key appears
+   * multiple times, the _last_ value takes precedence.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Map} + */ + public static final class Map extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Map) + MapOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Map"); + } + + // Use Map.newBuilder() to construct. + private Map(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Map() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Map_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Map.class, + com.google.bigtable.admin.v2.Type.Map.Builder.class); + } + + private int bitField0_; + public static final int KEY_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type keyType_; + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + @java.lang.Override + public boolean hasKeyType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return The keyType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getKeyType() { + return keyType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : keyType_; + } + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder() { + return keyType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : keyType_; + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.Type valueType_; + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + @java.lang.Override + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getValueType() { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getKeyType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getValueType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKeyType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValueType()); + } + size += getUnknownFields().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.admin.v2.Type.Map)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Map other = (com.google.bigtable.admin.v2.Type.Map) obj; + + if (hasKeyType() != other.hasKeyType()) return false; + if (hasKeyType()) { + if (!getKeyType().equals(other.getKeyType())) return false; + } + if (hasValueType() != other.hasValueType()) return false; + if (hasValueType()) { + if (!getValueType().equals(other.getValueType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKeyType()) { + hash = (37 * hash) + KEY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getKeyType().hashCode(); + } + if (hasValueType()) { + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Map 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.admin.v2.Type.Map parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Map 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.admin.v2.Type.Map parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Map parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Map parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Map parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Map 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A mapping of keys to values of a given type.
+     * Values of type `Map` are stored in a `Value.array_value` where each entry
+     * is another `Value.array_value` with two elements (the key and the value,
+     * in that order).
+     * Normally encoded Map values won't have repeated keys, however, clients are
+     * expected to handle the case in which they do. If the same key appears
+     * multiple times, the _last_ value takes precedence.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Map} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Map) + com.google.bigtable.admin.v2.Type.MapOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Map_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Map.class, + com.google.bigtable.admin.v2.Type.Map.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Map.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeyTypeFieldBuilder(); + internalGetValueTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + keyType_ = null; + if (keyTypeBuilder_ != null) { + keyTypeBuilder_.dispose(); + keyTypeBuilder_ = null; + } + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Map_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Map getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Map build() { + com.google.bigtable.admin.v2.Type.Map result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Map buildPartial() { + com.google.bigtable.admin.v2.Type.Map result = + new com.google.bigtable.admin.v2.Type.Map(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Map result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.keyType_ = keyTypeBuilder_ == null ? keyType_ : keyTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueType_ = valueTypeBuilder_ == null ? valueType_ : valueTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Map) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Map) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Map other) { + if (other == com.google.bigtable.admin.v2.Type.Map.getDefaultInstance()) return this; + if (other.hasKeyType()) { + mergeKeyType(other.getKeyType()); + } + if (other.hasValueType()) { + mergeValueType(other.getValueType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetKeyTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetValueTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type keyType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + keyTypeBuilder_; + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + public boolean hasKeyType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + * + * @return The keyType. + */ + public com.google.bigtable.admin.v2.Type getKeyType() { + if (keyTypeBuilder_ == null) { + return keyType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : keyType_; + } else { + return keyTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public Builder setKeyType(com.google.bigtable.admin.v2.Type value) { + if (keyTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keyType_ = value; + } else { + keyTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public Builder setKeyType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (keyTypeBuilder_ == null) { + keyType_ = builderForValue.build(); + } else { + keyTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public Builder mergeKeyType(com.google.bigtable.admin.v2.Type value) { + if (keyTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && keyType_ != null + && keyType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getKeyTypeBuilder().mergeFrom(value); + } else { + keyType_ = value; + } + } else { + keyTypeBuilder_.mergeFrom(value); + } + if (keyType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public Builder clearKeyType() { + bitField0_ = (bitField0_ & ~0x00000001); + keyType_ = null; + if (keyTypeBuilder_ != null) { + keyTypeBuilder_.dispose(); + keyTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public com.google.bigtable.admin.v2.Type.Builder getKeyTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetKeyTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder() { + if (keyTypeBuilder_ != null) { + return keyTypeBuilder_.getMessageOrBuilder(); + } else { + return keyType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : keyType_; + } + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.admin.v2.Type key_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetKeyTypeFieldBuilder() { + if (keyTypeBuilder_ == null) { + keyTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getKeyType(), getParentForChildren(), isClean()); + keyType_ = null; + } + return keyTypeBuilder_; + } + + private com.google.bigtable.admin.v2.Type valueType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + valueTypeBuilder_; + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + * + * @return The valueType. + */ + public com.google.bigtable.admin.v2.Type getValueType() { + if (valueTypeBuilder_ == null) { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } else { + return valueTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + } else { + valueTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (valueTypeBuilder_ == null) { + valueType_ = builderForValue.build(); + } else { + valueTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public Builder mergeValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && valueType_ != null + && valueType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getValueTypeBuilder().mergeFrom(value); + } else { + valueType_ = value; + } + } else { + valueTypeBuilder_.mergeFrom(value); + } + if (valueType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000002); + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public com.google.bigtable.admin.v2.Type.Builder getValueTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetValueTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() { + if (valueTypeBuilder_ != null) { + return valueTypeBuilder_.getMessageOrBuilder(); + } else { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.admin.v2.Type value_type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getValueType(), getParentForChildren(), isClean()); + valueType_ = null; + } + return valueTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Map) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Map) + private static final com.google.bigtable.admin.v2.Type.Map DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Map(); + } + + public static com.google.bigtable.admin.v2.Type.Map getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Map parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Map getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AggregateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Aggregate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + boolean hasInputType(); + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return The inputType. + */ + com.google.bigtable.admin.v2.Type getInputType(); + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + com.google.bigtable.admin.v2.TypeOrBuilder getInputTypeOrBuilder(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + boolean hasStateType(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + com.google.bigtable.admin.v2.Type getStateType(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.TypeOrBuilder getStateTypeOrBuilder(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + boolean hasSum(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + com.google.bigtable.admin.v2.Type.Aggregate.Sum getSum(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + boolean hasHllppUniqueCount(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getHllppUniqueCount(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + boolean hasMax(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + com.google.bigtable.admin.v2.Type.Aggregate.Max getMax(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + boolean hasMin(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + com.google.bigtable.admin.v2.Type.Aggregate.Min getMin(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder(); + + com.google.bigtable.admin.v2.Type.Aggregate.AggregatorCase getAggregatorCase(); + } + + /** + * + * + *
+   * A value that combines incremental updates into a summarized value.
+   *
+   * Data is never directly written or read using type `Aggregate`. Writes will
+   * provide either the `input_type` or `state_type`, and reads will always
+   * return the `state_type` .
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate} + */ + public static final class Aggregate extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate) + AggregateOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Aggregate"); + } + + // Use Aggregate.newBuilder() to construct. + private Aggregate(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Aggregate() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.class, + com.google.bigtable.admin.v2.Type.Aggregate.Builder.class); + } + + public interface SumOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Aggregate.Sum) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the sum of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Sum} + */ + public static final class Sum extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Sum) + SumOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Sum"); + } + + // Use Sum.newBuilder() to construct. + private Sum(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Sum() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Sum.class, + com.google.bigtable.admin.v2.Type.Aggregate.Sum.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Aggregate.Sum)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Aggregate.Sum other = + (com.google.bigtable.admin.v2.Type.Aggregate.Sum) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum 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.admin.v2.Type.Aggregate.Sum parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum 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.admin.v2.Type.Aggregate.Sum parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Aggregate.Sum 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the sum of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Sum} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Aggregate.Sum) + com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Sum.class, + com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Aggregate.Sum.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Sum getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Sum build() { + com.google.bigtable.admin.v2.Type.Aggregate.Sum result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Sum buildPartial() { + com.google.bigtable.admin.v2.Type.Aggregate.Sum result = + new com.google.bigtable.admin.v2.Type.Aggregate.Sum(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Aggregate.Sum) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Aggregate.Sum) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Aggregate.Sum other) { + if (other == com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Aggregate.Sum) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Aggregate.Sum) + private static final com.google.bigtable.admin.v2.Type.Aggregate.Sum DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Aggregate.Sum(); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Sum getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sum parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Aggregate.Sum getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MaxOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Aggregate.Max) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the max of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Max} + */ + public static final class Max extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Max) + MaxOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Max"); + } + + // Use Max.newBuilder() to construct. + private Max(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Max() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Max.class, + com.google.bigtable.admin.v2.Type.Aggregate.Max.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Aggregate.Max)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Aggregate.Max other = + (com.google.bigtable.admin.v2.Type.Aggregate.Max) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max 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.admin.v2.Type.Aggregate.Max parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max 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.admin.v2.Type.Aggregate.Max parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Aggregate.Max 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the max of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Max} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Aggregate.Max) + com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Max.class, + com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Aggregate.Max.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Max getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Max build() { + com.google.bigtable.admin.v2.Type.Aggregate.Max result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Max buildPartial() { + com.google.bigtable.admin.v2.Type.Aggregate.Max result = + new com.google.bigtable.admin.v2.Type.Aggregate.Max(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Aggregate.Max) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Aggregate.Max) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Aggregate.Max other) { + if (other == com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Aggregate.Max) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Aggregate.Max) + private static final com.google.bigtable.admin.v2.Type.Aggregate.Max DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Aggregate.Max(); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Max getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Max parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Aggregate.Max getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MinOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Aggregate.Min) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the min of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Min} + */ + public static final class Min extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Min) + MinOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Min"); + } + + // Use Min.newBuilder() to construct. + private Min(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Min() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Min.class, + com.google.bigtable.admin.v2.Type.Aggregate.Min.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Aggregate.Min)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Aggregate.Min other = + (com.google.bigtable.admin.v2.Type.Aggregate.Min) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min 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.admin.v2.Type.Aggregate.Min parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min 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.admin.v2.Type.Aggregate.Min parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Aggregate.Min 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the min of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.Min} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Aggregate.Min) + com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.Min.class, + com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Aggregate.Min.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Min getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Min build() { + com.google.bigtable.admin.v2.Type.Aggregate.Min result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Min buildPartial() { + com.google.bigtable.admin.v2.Type.Aggregate.Min result = + new com.google.bigtable.admin.v2.Type.Aggregate.Min(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Aggregate.Min) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Aggregate.Min) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Aggregate.Min other) { + if (other == com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Aggregate.Min) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Aggregate.Min) + private static final com.google.bigtable.admin.v2.Type.Aggregate.Min DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Aggregate.Min(); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.Min getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Min parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Aggregate.Min getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HyperLogLogPlusPlusUniqueCountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes an approximate unique count over the input values. When using
+     * raw data as input, be careful to use a consistent encoding. Otherwise
+     * the same value encoded differently could count more than once, or two
+     * distinct values could count as identical.
+     * Input: Any, or omit for Raw
+     * State: TBD
+     * Special state conversions: `Int64` (the unique count estimate)
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} + */ + public static final class HyperLogLogPlusPlusUniqueCount + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + HyperLogLogPlusPlusUniqueCountOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HyperLogLogPlusPlusUniqueCount"); + } + + // Use HyperLogLogPlusPlusUniqueCount.newBuilder() to construct. + private HyperLogLogPlusPlusUniqueCount( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private HyperLogLogPlusPlusUniqueCount() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.class, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount other = + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + 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.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + 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.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes an approximate unique count over the input values. When using
+       * raw data as input, be careful to use a consistent encoding. Otherwise
+       * the same value encoded differently could count more than once, or two
+       * distinct values could count as identical.
+       * Input: Any, or omit for Raw
+       * State: TBD
+       * Special state conversions: `Int64` (the unique count estimate)
+       * 
+ * + * Protobuf type {@code + * google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.class, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + .class); + } + + // Construct using + // com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount build() { + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + buildPartial() { + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount result = + new com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) { + return mergeFrom( + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount other) { + if (other + == com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + private static final com.google.bigtable.admin.v2.Type.Aggregate + .HyperLogLogPlusPlusUniqueCount + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HyperLogLogPlusPlusUniqueCount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int aggregatorCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object aggregator_; + + public enum AggregatorCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SUM(4), + HLLPP_UNIQUE_COUNT(5), + MAX(6), + MIN(7), + AGGREGATOR_NOT_SET(0); + private final int value; + + private AggregatorCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AggregatorCase valueOf(int value) { + return forNumber(value); + } + + public static AggregatorCase forNumber(int value) { + switch (value) { + case 4: + return SUM; + case 5: + return HLLPP_UNIQUE_COUNT; + case 6: + return MAX; + case 7: + return MIN; + case 0: + return AGGREGATOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AggregatorCase getAggregatorCase() { + return AggregatorCase.forNumber(aggregatorCase_); + } + + public static final int INPUT_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Type inputType_; + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + @java.lang.Override + public boolean hasInputType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return The inputType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getInputType() { + return inputType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : inputType_; + } + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`, which must
+     * specify a full encoding.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getInputTypeOrBuilder() { + return inputType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : inputType_; + } + + public static final int STATE_TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.admin.v2.Type stateType_; + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + @java.lang.Override + public boolean hasStateType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type getStateType() { + return stateType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : stateType_; + } + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen, and will always specify a full encoding.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TypeOrBuilder getStateTypeOrBuilder() { + return stateType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : stateType_; + } + + public static final int SUM_FIELD_NUMBER = 4; + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + @java.lang.Override + public boolean hasSum() { + return aggregatorCase_ == 4; + } + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Sum getSum() { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder() { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + public static final int HLLPP_UNIQUE_COUNT_FIELD_NUMBER = 5; + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + @java.lang.Override + public boolean hasHllppUniqueCount() { + return aggregatorCase_ == 5; + } + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getHllppUniqueCount() { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder() { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + public static final int MAX_FIELD_NUMBER = 6; + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return aggregatorCase_ == 6; + } + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Max getMax() { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder() { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + public static final int MIN_FIELD_NUMBER = 7; + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + @java.lang.Override + public boolean hasMin() { + return aggregatorCase_ == 7; + } + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Min getMin() { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder() { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInputType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStateType()); + } + if (aggregatorCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_); + } + if (aggregatorCase_ == 5) { + output.writeMessage( + 5, + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_); + } + if (aggregatorCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_); + } + if (aggregatorCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStateType()); + } + if (aggregatorCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_); + } + if (aggregatorCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_); + } + if (aggregatorCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_); + } + if (aggregatorCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_); + } + size += getUnknownFields().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.admin.v2.Type.Aggregate)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Aggregate other = + (com.google.bigtable.admin.v2.Type.Aggregate) obj; + + if (hasInputType() != other.hasInputType()) return false; + if (hasInputType()) { + if (!getInputType().equals(other.getInputType())) return false; + } + if (hasStateType() != other.hasStateType()) return false; + if (hasStateType()) { + if (!getStateType().equals(other.getStateType())) return false; + } + if (!getAggregatorCase().equals(other.getAggregatorCase())) return false; + switch (aggregatorCase_) { + case 4: + if (!getSum().equals(other.getSum())) return false; + break; + case 5: + if (!getHllppUniqueCount().equals(other.getHllppUniqueCount())) return false; + break; + case 6: + if (!getMax().equals(other.getMax())) return false; + break; + case 7: + if (!getMin().equals(other.getMin())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputType()) { + hash = (37 * hash) + INPUT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInputType().hashCode(); + } + if (hasStateType()) { + hash = (37 * hash) + STATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStateType().hashCode(); + } + switch (aggregatorCase_) { + case 4: + hash = (37 * hash) + SUM_FIELD_NUMBER; + hash = (53 * hash) + getSum().hashCode(); + break; + case 5: + hash = (37 * hash) + HLLPP_UNIQUE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getHllppUniqueCount().hashCode(); + break; + case 6: + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + getMax().hashCode(); + break; + case 7: + hash = (37 * hash) + MIN_FIELD_NUMBER; + hash = (53 * hash) + getMin().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate 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.admin.v2.Type.Aggregate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate 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.admin.v2.Type.Aggregate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type.Aggregate 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A value that combines incremental updates into a summarized value.
+     *
+     * Data is never directly written or read using type `Aggregate`. Writes will
+     * provide either the `input_type` or `state_type`, and reads will always
+     * return the `state_type` .
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type.Aggregate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Aggregate) + com.google.bigtable.admin.v2.Type.AggregateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.Aggregate.class, + com.google.bigtable.admin.v2.Type.Aggregate.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.Aggregate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInputTypeFieldBuilder(); + internalGetStateTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputType_ = null; + if (inputTypeBuilder_ != null) { + inputTypeBuilder_.dispose(); + inputTypeBuilder_ = null; + } + stateType_ = null; + if (stateTypeBuilder_ != null) { + stateTypeBuilder_.dispose(); + stateTypeBuilder_ = null; + } + if (sumBuilder_ != null) { + sumBuilder_.clear(); + } + if (hllppUniqueCountBuilder_ != null) { + hllppUniqueCountBuilder_.clear(); + } + if (maxBuilder_ != null) { + maxBuilder_.clear(); + } + if (minBuilder_ != null) { + minBuilder_.clear(); + } + aggregatorCase_ = 0; + aggregator_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate build() { + com.google.bigtable.admin.v2.Type.Aggregate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate buildPartial() { + com.google.bigtable.admin.v2.Type.Aggregate result = + new com.google.bigtable.admin.v2.Type.Aggregate(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type.Aggregate result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputType_ = inputTypeBuilder_ == null ? inputType_ : inputTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateType_ = stateTypeBuilder_ == null ? stateType_ : stateTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type.Aggregate result) { + result.aggregatorCase_ = aggregatorCase_; + result.aggregator_ = this.aggregator_; + if (aggregatorCase_ == 4 && sumBuilder_ != null) { + result.aggregator_ = sumBuilder_.build(); + } + if (aggregatorCase_ == 5 && hllppUniqueCountBuilder_ != null) { + result.aggregator_ = hllppUniqueCountBuilder_.build(); + } + if (aggregatorCase_ == 6 && maxBuilder_ != null) { + result.aggregator_ = maxBuilder_.build(); + } + if (aggregatorCase_ == 7 && minBuilder_ != null) { + result.aggregator_ = minBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type.Aggregate) { + return mergeFrom((com.google.bigtable.admin.v2.Type.Aggregate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Aggregate other) { + if (other == com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance()) return this; + if (other.hasInputType()) { + mergeInputType(other.getInputType()); + } + if (other.hasStateType()) { + mergeStateType(other.getStateType()); + } + switch (other.getAggregatorCase()) { + case SUM: + { + mergeSum(other.getSum()); + break; + } + case HLLPP_UNIQUE_COUNT: + { + mergeHllppUniqueCount(other.getHllppUniqueCount()); + break; + } + case MAX: + { + mergeMax(other.getMax()); + break; + } + case MIN: + { + mergeMin(other.getMin()); + break; + } + case AGGREGATOR_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetInputTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStateTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(internalGetSumFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetHllppUniqueCountFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetMaxFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetMinFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int aggregatorCase_ = 0; + private java.lang.Object aggregator_; + + public AggregatorCase getAggregatorCase() { + return AggregatorCase.forNumber(aggregatorCase_); + } + + public Builder clearAggregator() { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Type inputType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + inputTypeBuilder_; + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + public boolean hasInputType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + * + * @return The inputType. + */ + public com.google.bigtable.admin.v2.Type getInputType() { + if (inputTypeBuilder_ == null) { + return inputType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : inputType_; + } else { + return inputTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public Builder setInputType(com.google.bigtable.admin.v2.Type value) { + if (inputTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputType_ = value; + } else { + inputTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public Builder setInputType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (inputTypeBuilder_ == null) { + inputType_ = builderForValue.build(); + } else { + inputTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public Builder mergeInputType(com.google.bigtable.admin.v2.Type value) { + if (inputTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && inputType_ != null + && inputType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getInputTypeBuilder().mergeFrom(value); + } else { + inputType_ = value; + } + } else { + inputTypeBuilder_.mergeFrom(value); + } + if (inputType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public Builder clearInputType() { + bitField0_ = (bitField0_ & ~0x00000001); + inputType_ = null; + if (inputTypeBuilder_ != null) { + inputTypeBuilder_.dispose(); + inputTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public com.google.bigtable.admin.v2.Type.Builder getInputTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetInputTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getInputTypeOrBuilder() { + if (inputTypeBuilder_ != null) { + return inputTypeBuilder_.getMessageOrBuilder(); + } else { + return inputType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : inputType_; + } + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`, which must
+       * specify a full encoding.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.admin.v2.Type input_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetInputTypeFieldBuilder() { + if (inputTypeBuilder_ == null) { + inputTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getInputType(), getParentForChildren(), isClean()); + inputType_ = null; + } + return inputTypeBuilder_; + } + + private com.google.bigtable.admin.v2.Type stateType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + stateTypeBuilder_; + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + public boolean hasStateType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + public com.google.bigtable.admin.v2.Type getStateType() { + if (stateTypeBuilder_ == null) { + return stateType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : stateType_; + } else { + return stateTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateType(com.google.bigtable.admin.v2.Type value) { + if (stateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateType_ = value; + } else { + stateTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (stateTypeBuilder_ == null) { + stateType_ = builderForValue.build(); + } else { + stateTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateType(com.google.bigtable.admin.v2.Type value) { + if (stateTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stateType_ != null + && stateType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getStateTypeBuilder().mergeFrom(value); + } else { + stateType_ = value; + } + } else { + stateTypeBuilder_.mergeFrom(value); + } + if (stateType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateType() { + bitField0_ = (bitField0_ & ~0x00000002); + stateType_ = null; + if (stateTypeBuilder_ != null) { + stateTypeBuilder_.dispose(); + stateTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.Type.Builder getStateTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.TypeOrBuilder getStateTypeOrBuilder() { + if (stateTypeBuilder_ != null) { + return stateTypeBuilder_.getMessageOrBuilder(); + } else { + return stateType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : stateType_; + } + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen, and will always specify a full encoding.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + internalGetStateTypeFieldBuilder() { + if (stateTypeBuilder_ == null) { + stateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder>( + getStateType(), getParentForChildren(), isClean()); + stateType_ = null; + } + return stateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Sum, + com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder> + sumBuilder_; + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + @java.lang.Override + public boolean hasSum() { + return aggregatorCase_ == 4; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Sum getSum() { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } else { + if (aggregatorCase_ == 4) { + return sumBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder setSum(com.google.bigtable.admin.v2.Type.Aggregate.Sum value) { + if (sumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + sumBuilder_.setMessage(value); + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder setSum( + com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder builderForValue) { + if (sumBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + sumBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder mergeSum(com.google.bigtable.admin.v2.Type.Aggregate.Sum value) { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4 + && aggregator_ + != com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.Sum.newBuilder( + (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 4) { + sumBuilder_.mergeFrom(value); + } else { + sumBuilder_.setMessage(value); + } + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder clearSum() { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 4) { + aggregatorCase_ = 0; + aggregator_ = null; + } + sumBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + public com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder getSumBuilder() { + return internalGetSumFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder() { + if ((aggregatorCase_ == 4) && (sumBuilder_ != null)) { + return sumBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Sum sum = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Sum, + com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder> + internalGetSumFieldBuilder() { + if (sumBuilder_ == null) { + if (!(aggregatorCase_ == 4)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + sumBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Sum, + com.google.bigtable.admin.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.SumOrBuilder>( + (com.google.bigtable.admin.v2.Type.Aggregate.Sum) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 4; + onChanged(); + return sumBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder> + hllppUniqueCountBuilder_; + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + @java.lang.Override + public boolean hasHllppUniqueCount() { + return aggregatorCase_ == 5; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getHllppUniqueCount() { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } else { + if (aggregatorCase_ == 5) { + return hllppUniqueCountBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder setHllppUniqueCount( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount value) { + if (hllppUniqueCountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + hllppUniqueCountBuilder_.setMessage(value); + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder setHllppUniqueCount( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + builderForValue) { + if (hllppUniqueCountBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + hllppUniqueCountBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder mergeHllppUniqueCount( + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount value) { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5 + && aggregator_ + != com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance()) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .newBuilder( + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 5) { + hllppUniqueCountBuilder_.mergeFrom(value); + } else { + hllppUniqueCountBuilder_.setMessage(value); + } + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder clearHllppUniqueCount() { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 5) { + aggregatorCase_ = 0; + aggregator_ = null; + } + hllppUniqueCountBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + getHllppUniqueCountBuilder() { + return internalGetHllppUniqueCountFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder() { + if ((aggregatorCase_ == 5) && (hllppUniqueCountBuilder_ != null)) { + return hllppUniqueCountBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder> + internalGetHllppUniqueCountFieldBuilder() { + if (hllppUniqueCountBuilder_ == null) { + if (!(aggregatorCase_ == 5)) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + hllppUniqueCountBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .Builder, + com.google.bigtable.admin.v2.Type.Aggregate + .HyperLogLogPlusPlusUniqueCountOrBuilder>( + (com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 5; + onChanged(); + return hllppUniqueCountBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Max, + com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder> + maxBuilder_; + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return aggregatorCase_ == 6; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Max getMax() { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } else { + if (aggregatorCase_ == 6) { + return maxBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + public Builder setMax(com.google.bigtable.admin.v2.Type.Aggregate.Max value) { + if (maxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + maxBuilder_.setMessage(value); + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + public Builder setMax( + com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder builderForValue) { + if (maxBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + maxBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + public Builder mergeMax(com.google.bigtable.admin.v2.Type.Aggregate.Max value) { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6 + && aggregator_ + != com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.Max.newBuilder( + (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 6) { + maxBuilder_.mergeFrom(value); + } else { + maxBuilder_.setMessage(value); + } + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + public Builder clearMax() { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 6) { + aggregatorCase_ = 0; + aggregator_ = null; + } + maxBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + public com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder getMaxBuilder() { + return internalGetMaxFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder() { + if ((aggregatorCase_ == 6) && (maxBuilder_ != null)) { + return maxBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Max max = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Max, + com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder> + internalGetMaxFieldBuilder() { + if (maxBuilder_ == null) { + if (!(aggregatorCase_ == 6)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + maxBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Max, + com.google.bigtable.admin.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MaxOrBuilder>( + (com.google.bigtable.admin.v2.Type.Aggregate.Max) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 6; + onChanged(); + return maxBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Min, + com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder> + minBuilder_; + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + @java.lang.Override + public boolean hasMin() { + return aggregatorCase_ == 7; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.Min getMin() { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } else { + if (aggregatorCase_ == 7) { + return minBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + public Builder setMin(com.google.bigtable.admin.v2.Type.Aggregate.Min value) { + if (minBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + minBuilder_.setMessage(value); + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + public Builder setMin( + com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder builderForValue) { + if (minBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + minBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + public Builder mergeMin(com.google.bigtable.admin.v2.Type.Aggregate.Min value) { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7 + && aggregator_ + != com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.Min.newBuilder( + (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 7) { + minBuilder_.mergeFrom(value); + } else { + minBuilder_.setMessage(value); + } + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + public Builder clearMin() { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 7) { + aggregatorCase_ = 0; + aggregator_ = null; + } + minBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + public com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder getMinBuilder() { + return internalGetMinFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder() { + if ((aggregatorCase_ == 7) && (minBuilder_ != null)) { + return minBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate.Min min = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Min, + com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder> + internalGetMinFieldBuilder() { + if (minBuilder_ == null) { + if (!(aggregatorCase_ == 7)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + minBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate.Min, + com.google.bigtable.admin.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.admin.v2.Type.Aggregate.MinOrBuilder>( + (com.google.bigtable.admin.v2.Type.Aggregate.Min) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 7; + onChanged(); + return minBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Aggregate) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Aggregate) + private static final com.google.bigtable.admin.v2.Type.Aggregate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Aggregate(); + } + + public static com.google.bigtable.admin.v2.Type.Aggregate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Aggregate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type.Aggregate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int kindCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BYTES_TYPE(1), + STRING_TYPE(2), + INT64_TYPE(5), + FLOAT32_TYPE(12), + FLOAT64_TYPE(9), + BOOL_TYPE(8), + TIMESTAMP_TYPE(10), + DATE_TYPE(11), + AGGREGATE_TYPE(6), + STRUCT_TYPE(7), + ARRAY_TYPE(3), + MAP_TYPE(4), + PROTO_TYPE(13), + ENUM_TYPE(14), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: + return BYTES_TYPE; + case 2: + return STRING_TYPE; + case 5: + return INT64_TYPE; + case 12: + return FLOAT32_TYPE; + case 9: + return FLOAT64_TYPE; + case 8: + return BOOL_TYPE; + case 10: + return TIMESTAMP_TYPE; + case 11: + return DATE_TYPE; + case 6: + return AGGREGATE_TYPE; + case 7: + return STRUCT_TYPE; + case 3: + return ARRAY_TYPE; + case 4: + return MAP_TYPE; + case 13: + return PROTO_TYPE; + case 14: + return ENUM_TYPE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int BYTES_TYPE_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return kindCase_ == 1; + } + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes getBytesType() { + if (kindCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes) kind_; + } + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if (kindCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes) kind_; + } + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + + public static final int STRING_TYPE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return kindCase_ == 2; + } + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String getStringType() { + if (kindCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String) kind_; + } + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.StringOrBuilder getStringTypeOrBuilder() { + if (kindCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String) kind_; + } + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + + public static final int INT64_TYPE_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + @java.lang.Override + public boolean hasInt64Type() { + return kindCase_ == 5; + } + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64 getInt64Type() { + if (kindCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Int64) kind_; + } + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64OrBuilder getInt64TypeOrBuilder() { + if (kindCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Int64) kind_; + } + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + + public static final int FLOAT32_TYPE_FIELD_NUMBER = 12; + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + @java.lang.Override + public boolean hasFloat32Type() { + return kindCase_ == 12; + } + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32 getFloat32Type() { + if (kindCase_ == 12) { + return (com.google.bigtable.admin.v2.Type.Float32) kind_; + } + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder() { + if (kindCase_ == 12) { + return (com.google.bigtable.admin.v2.Type.Float32) kind_; + } + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + + public static final int FLOAT64_TYPE_FIELD_NUMBER = 9; + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + @java.lang.Override + public boolean hasFloat64Type() { + return kindCase_ == 9; + } + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64 getFloat64Type() { + if (kindCase_ == 9) { + return (com.google.bigtable.admin.v2.Type.Float64) kind_; + } + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder() { + if (kindCase_ == 9) { + return (com.google.bigtable.admin.v2.Type.Float64) kind_; + } + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + + public static final int BOOL_TYPE_FIELD_NUMBER = 8; + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + @java.lang.Override + public boolean hasBoolType() { + return kindCase_ == 8; + } + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bool getBoolType() { + if (kindCase_ == 8) { + return (com.google.bigtable.admin.v2.Type.Bool) kind_; + } + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.BoolOrBuilder getBoolTypeOrBuilder() { + if (kindCase_ == 8) { + return (com.google.bigtable.admin.v2.Type.Bool) kind_; + } + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + + public static final int TIMESTAMP_TYPE_FIELD_NUMBER = 10; + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + @java.lang.Override + public boolean hasTimestampType() { + return kindCase_ == 10; + } + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp getTimestampType() { + if (kindCase_ == 10) { + return (com.google.bigtable.admin.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder() { + if (kindCase_ == 10) { + return (com.google.bigtable.admin.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + + public static final int DATE_TYPE_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + @java.lang.Override + public boolean hasDateType() { + return kindCase_ == 11; + } + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Date getDateType() { + if (kindCase_ == 11) { + return (com.google.bigtable.admin.v2.Type.Date) kind_; + } + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.DateOrBuilder getDateTypeOrBuilder() { + if (kindCase_ == 11) { + return (com.google.bigtable.admin.v2.Type.Date) kind_; + } + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + + public static final int AGGREGATE_TYPE_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + @java.lang.Override + public boolean hasAggregateType() { + return kindCase_ == 6; + } + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate getAggregateType() { + if (kindCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder() { + if (kindCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + + public static final int STRUCT_TYPE_FIELD_NUMBER = 7; + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + @java.lang.Override + public boolean hasStructType() { + return kindCase_ == 7; + } + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct getStructType() { + if (kindCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Struct) kind_; + } + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.StructOrBuilder getStructTypeOrBuilder() { + if (kindCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Struct) kind_; + } + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + + public static final int ARRAY_TYPE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + @java.lang.Override + public boolean hasArrayType() { + return kindCase_ == 3; + } + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Array getArrayType() { + if (kindCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Array) kind_; + } + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder() { + if (kindCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Array) kind_; + } + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + + public static final int MAP_TYPE_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + @java.lang.Override + public boolean hasMapType() { + return kindCase_ == 4; + } + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Map getMapType() { + if (kindCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Map) kind_; + } + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.MapOrBuilder getMapTypeOrBuilder() { + if (kindCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Map) kind_; + } + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + + public static final int PROTO_TYPE_FIELD_NUMBER = 13; + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + @java.lang.Override + public boolean hasProtoType() { + return kindCase_ == 13; + } + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Proto getProtoType() { + if (kindCase_ == 13) { + return (com.google.bigtable.admin.v2.Type.Proto) kind_; + } + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder() { + if (kindCase_ == 13) { + return (com.google.bigtable.admin.v2.Type.Proto) kind_; + } + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + + public static final int ENUM_TYPE_FIELD_NUMBER = 14; + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + @java.lang.Override + public boolean hasEnumType() { + return kindCase_ == 14; + } + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Enum getEnumType() { + if (kindCase_ == 14) { + return (com.google.bigtable.admin.v2.Type.Enum) kind_; + } + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.EnumOrBuilder getEnumTypeOrBuilder() { + if (kindCase_ == 14) { + return (com.google.bigtable.admin.v2.Type.Enum) kind_; + } + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.admin.v2.Type.Bytes) kind_); + } + if (kindCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.admin.v2.Type.String) kind_); + } + if (kindCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.Type.Array) kind_); + } + if (kindCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.Type.Map) kind_); + } + if (kindCase_ == 5) { + output.writeMessage(5, (com.google.bigtable.admin.v2.Type.Int64) kind_); + } + if (kindCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.admin.v2.Type.Aggregate) kind_); + } + if (kindCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.admin.v2.Type.Struct) kind_); + } + if (kindCase_ == 8) { + output.writeMessage(8, (com.google.bigtable.admin.v2.Type.Bool) kind_); + } + if (kindCase_ == 9) { + output.writeMessage(9, (com.google.bigtable.admin.v2.Type.Float64) kind_); + } + if (kindCase_ == 10) { + output.writeMessage(10, (com.google.bigtable.admin.v2.Type.Timestamp) kind_); + } + if (kindCase_ == 11) { + output.writeMessage(11, (com.google.bigtable.admin.v2.Type.Date) kind_); + } + if (kindCase_ == 12) { + output.writeMessage(12, (com.google.bigtable.admin.v2.Type.Float32) kind_); + } + if (kindCase_ == 13) { + output.writeMessage(13, (com.google.bigtable.admin.v2.Type.Proto) kind_); + } + if (kindCase_ == 14) { + output.writeMessage(14, (com.google.bigtable.admin.v2.Type.Enum) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.admin.v2.Type.Bytes) kind_); + } + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.admin.v2.Type.String) kind_); + } + if (kindCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.Type.Array) kind_); + } + if (kindCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.Type.Map) kind_); + } + if (kindCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.admin.v2.Type.Int64) kind_); + } + if (kindCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.admin.v2.Type.Aggregate) kind_); + } + if (kindCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.admin.v2.Type.Struct) kind_); + } + if (kindCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.bigtable.admin.v2.Type.Bool) kind_); + } + if (kindCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.bigtable.admin.v2.Type.Float64) kind_); + } + if (kindCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.bigtable.admin.v2.Type.Timestamp) kind_); + } + if (kindCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.bigtable.admin.v2.Type.Date) kind_); + } + if (kindCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.bigtable.admin.v2.Type.Float32) kind_); + } + if (kindCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.bigtable.admin.v2.Type.Proto) kind_); + } + if (kindCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, (com.google.bigtable.admin.v2.Type.Enum) kind_); + } + size += getUnknownFields().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.admin.v2.Type)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type other = (com.google.bigtable.admin.v2.Type) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getBytesType().equals(other.getBytesType())) return false; + break; + case 2: + if (!getStringType().equals(other.getStringType())) return false; + break; + case 5: + if (!getInt64Type().equals(other.getInt64Type())) return false; + break; + case 12: + if (!getFloat32Type().equals(other.getFloat32Type())) return false; + break; + case 9: + if (!getFloat64Type().equals(other.getFloat64Type())) return false; + break; + case 8: + if (!getBoolType().equals(other.getBoolType())) return false; + break; + case 10: + if (!getTimestampType().equals(other.getTimestampType())) return false; + break; + case 11: + if (!getDateType().equals(other.getDateType())) return false; + break; + case 6: + if (!getAggregateType().equals(other.getAggregateType())) return false; + break; + case 7: + if (!getStructType().equals(other.getStructType())) return false; + break; + case 3: + if (!getArrayType().equals(other.getArrayType())) return false; + break; + case 4: + if (!getMapType().equals(other.getMapType())) return false; + break; + case 13: + if (!getProtoType().equals(other.getProtoType())) return false; + break; + case 14: + if (!getEnumType().equals(other.getEnumType())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + BYTES_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + break; + case 2: + hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringType().hashCode(); + break; + case 5: + hash = (37 * hash) + INT64_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInt64Type().hashCode(); + break; + case 12: + hash = (37 * hash) + FLOAT32_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFloat32Type().hashCode(); + break; + case 9: + hash = (37 * hash) + FLOAT64_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFloat64Type().hashCode(); + break; + case 8: + hash = (37 * hash) + BOOL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBoolType().hashCode(); + break; + case 10: + hash = (37 * hash) + TIMESTAMP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampType().hashCode(); + break; + case 11: + hash = (37 * hash) + DATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDateType().hashCode(); + break; + case 6: + hash = (37 * hash) + AGGREGATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAggregateType().hashCode(); + break; + case 7: + hash = (37 * hash) + STRUCT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStructType().hashCode(); + break; + case 3: + hash = (37 * hash) + ARRAY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getArrayType().hashCode(); + break; + case 4: + hash = (37 * hash) + MAP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMapType().hashCode(); + break; + case 13: + hash = (37 * hash) + PROTO_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getProtoType().hashCode(); + break; + case 14: + hash = (37 * hash) + ENUM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEnumType().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Type parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type 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.admin.v2.Type parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type 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.admin.v2.Type parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Type parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Type parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Type parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.Type 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * `Type` represents the type of data that is written to, read from, or stored
+   * in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
+   * familiarity and consistency across products and features.
+   *
+   * For compatibility with Bigtable's existing untyped APIs, each `Type` includes
+   * an `Encoding` which describes how to convert to or from the underlying data.
+   *
+   * Each encoding can operate in one of two modes:
+   *
+   * - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
+   * if and only if `X <= Y`. This is useful anywhere sort order is important,
+   * for example when encoding keys.
+   * - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
+   * `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
+   * example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}"
+   * are valid encodings of the same JSON value.
+   *
+   * The API clearly documents which mode is used wherever an encoding can be
+   * configured. Each encoding also documents which values are supported in which
+   * modes. For example, when encoding INT64 as a numeric STRING, negative numbers
+   * cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
+   * `STRING("-00001") > STRING("00001")`.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Type} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type) + com.google.bigtable.admin.v2.TypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Type.class, + com.google.bigtable.admin.v2.Type.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Type.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.clear(); + } + if (stringTypeBuilder_ != null) { + stringTypeBuilder_.clear(); + } + if (int64TypeBuilder_ != null) { + int64TypeBuilder_.clear(); + } + if (float32TypeBuilder_ != null) { + float32TypeBuilder_.clear(); + } + if (float64TypeBuilder_ != null) { + float64TypeBuilder_.clear(); + } + if (boolTypeBuilder_ != null) { + boolTypeBuilder_.clear(); + } + if (timestampTypeBuilder_ != null) { + timestampTypeBuilder_.clear(); + } + if (dateTypeBuilder_ != null) { + dateTypeBuilder_.clear(); + } + if (aggregateTypeBuilder_ != null) { + aggregateTypeBuilder_.clear(); + } + if (structTypeBuilder_ != null) { + structTypeBuilder_.clear(); + } + if (arrayTypeBuilder_ != null) { + arrayTypeBuilder_.clear(); + } + if (mapTypeBuilder_ != null) { + mapTypeBuilder_.clear(); + } + if (protoTypeBuilder_ != null) { + protoTypeBuilder_.clear(); + } + if (enumTypeBuilder_ != null) { + enumTypeBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TypesProto + .internal_static_google_bigtable_admin_v2_Type_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Type.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type build() { + com.google.bigtable.admin.v2.Type result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Type buildPartial() { + com.google.bigtable.admin.v2.Type result = new com.google.bigtable.admin.v2.Type(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Type result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Type result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && bytesTypeBuilder_ != null) { + result.kind_ = bytesTypeBuilder_.build(); + } + if (kindCase_ == 2 && stringTypeBuilder_ != null) { + result.kind_ = stringTypeBuilder_.build(); + } + if (kindCase_ == 5 && int64TypeBuilder_ != null) { + result.kind_ = int64TypeBuilder_.build(); + } + if (kindCase_ == 12 && float32TypeBuilder_ != null) { + result.kind_ = float32TypeBuilder_.build(); + } + if (kindCase_ == 9 && float64TypeBuilder_ != null) { + result.kind_ = float64TypeBuilder_.build(); + } + if (kindCase_ == 8 && boolTypeBuilder_ != null) { + result.kind_ = boolTypeBuilder_.build(); + } + if (kindCase_ == 10 && timestampTypeBuilder_ != null) { + result.kind_ = timestampTypeBuilder_.build(); + } + if (kindCase_ == 11 && dateTypeBuilder_ != null) { + result.kind_ = dateTypeBuilder_.build(); + } + if (kindCase_ == 6 && aggregateTypeBuilder_ != null) { + result.kind_ = aggregateTypeBuilder_.build(); + } + if (kindCase_ == 7 && structTypeBuilder_ != null) { + result.kind_ = structTypeBuilder_.build(); + } + if (kindCase_ == 3 && arrayTypeBuilder_ != null) { + result.kind_ = arrayTypeBuilder_.build(); + } + if (kindCase_ == 4 && mapTypeBuilder_ != null) { + result.kind_ = mapTypeBuilder_.build(); + } + if (kindCase_ == 13 && protoTypeBuilder_ != null) { + result.kind_ = protoTypeBuilder_.build(); + } + if (kindCase_ == 14 && enumTypeBuilder_ != null) { + result.kind_ = enumTypeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Type) { + return mergeFrom((com.google.bigtable.admin.v2.Type) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Type other) { + if (other == com.google.bigtable.admin.v2.Type.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case BYTES_TYPE: + { + mergeBytesType(other.getBytesType()); + break; + } + case STRING_TYPE: + { + mergeStringType(other.getStringType()); + break; + } + case INT64_TYPE: + { + mergeInt64Type(other.getInt64Type()); + break; + } + case FLOAT32_TYPE: + { + mergeFloat32Type(other.getFloat32Type()); + break; + } + case FLOAT64_TYPE: + { + mergeFloat64Type(other.getFloat64Type()); + break; + } + case BOOL_TYPE: + { + mergeBoolType(other.getBoolType()); + break; + } + case TIMESTAMP_TYPE: + { + mergeTimestampType(other.getTimestampType()); + break; + } + case DATE_TYPE: + { + mergeDateType(other.getDateType()); + break; + } + case AGGREGATE_TYPE: + { + mergeAggregateType(other.getAggregateType()); + break; + } + case STRUCT_TYPE: + { + mergeStructType(other.getStructType()); + break; + } + case ARRAY_TYPE: + { + mergeArrayType(other.getArrayType()); + break; + } + case MAP_TYPE: + { + mergeMapType(other.getMapType()); + break; + } + case PROTO_TYPE: + { + mergeProtoType(other.getProtoType()); + break; + } + case ENUM_TYPE: + { + mergeEnumType(other.getEnumType()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStringTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetArrayTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetMapTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetInt64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetAggregateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetStructTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetBoolTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetFloat64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetTimestampTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetDateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 11; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetFloat32TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetProtoTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 13; + break; + } // case 106 + case 114: + { + input.readMessage( + internalGetEnumTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 14; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + bytesTypeBuilder_; + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return kindCase_ == 1; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bytes getBytesType() { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes) kind_; + } + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return bytesTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + public Builder setBytesType(com.google.bigtable.admin.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + bytesTypeBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + public Builder setBytesType(com.google.bigtable.admin.v2.Type.Bytes.Builder builderForValue) { + if (bytesTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + bytesTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + public Builder mergeBytesType(com.google.bigtable.admin.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1 + && kind_ != com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Bytes.newBuilder( + (com.google.bigtable.admin.v2.Type.Bytes) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + bytesTypeBuilder_.mergeFrom(value); + } else { + bytesTypeBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + public Builder clearBytesType() { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + bytesTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + public com.google.bigtable.admin.v2.Type.Bytes.Builder getBytesTypeBuilder() { + return internalGetBytesTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if ((kindCase_ == 1) && (bytesTypeBuilder_ != null)) { + return bytesTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (com.google.bigtable.admin.v2.Type.Bytes) kind_; + } + return com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + internalGetBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder>( + (com.google.bigtable.admin.v2.Type.Bytes) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return bytesTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String, + com.google.bigtable.admin.v2.Type.String.Builder, + com.google.bigtable.admin.v2.Type.StringOrBuilder> + stringTypeBuilder_; + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return kindCase_ == 2; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.String getStringType() { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String) kind_; + } + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } else { + if (kindCase_ == 2) { + return stringTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + public Builder setStringType(com.google.bigtable.admin.v2.Type.String value) { + if (stringTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + stringTypeBuilder_.setMessage(value); + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + public Builder setStringType(com.google.bigtable.admin.v2.Type.String.Builder builderForValue) { + if (stringTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + stringTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + public Builder mergeStringType(com.google.bigtable.admin.v2.Type.String value) { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2 + && kind_ != com.google.bigtable.admin.v2.Type.String.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.String.newBuilder( + (com.google.bigtable.admin.v2.Type.String) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 2) { + stringTypeBuilder_.mergeFrom(value); + } else { + stringTypeBuilder_.setMessage(value); + } + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + public Builder clearStringType() { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + } + stringTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + public com.google.bigtable.admin.v2.Type.String.Builder getStringTypeBuilder() { + return internalGetStringTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.StringOrBuilder getStringTypeOrBuilder() { + if ((kindCase_ == 2) && (stringTypeBuilder_ != null)) { + return stringTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 2) { + return (com.google.bigtable.admin.v2.Type.String) kind_; + } + return com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String, + com.google.bigtable.admin.v2.Type.String.Builder, + com.google.bigtable.admin.v2.Type.StringOrBuilder> + internalGetStringTypeFieldBuilder() { + if (stringTypeBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + stringTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.String, + com.google.bigtable.admin.v2.Type.String.Builder, + com.google.bigtable.admin.v2.Type.StringOrBuilder>( + (com.google.bigtable.admin.v2.Type.String) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 2; + onChanged(); + return stringTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64, + com.google.bigtable.admin.v2.Type.Int64.Builder, + com.google.bigtable.admin.v2.Type.Int64OrBuilder> + int64TypeBuilder_; + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + @java.lang.Override + public boolean hasInt64Type() { + return kindCase_ == 5; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64 getInt64Type() { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Int64) kind_; + } + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } else { + if (kindCase_ == 5) { + return int64TypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + public Builder setInt64Type(com.google.bigtable.admin.v2.Type.Int64 value) { + if (int64TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + int64TypeBuilder_.setMessage(value); + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + public Builder setInt64Type(com.google.bigtable.admin.v2.Type.Int64.Builder builderForValue) { + if (int64TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + int64TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + public Builder mergeInt64Type(com.google.bigtable.admin.v2.Type.Int64 value) { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5 + && kind_ != com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Int64.newBuilder( + (com.google.bigtable.admin.v2.Type.Int64) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 5) { + int64TypeBuilder_.mergeFrom(value); + } else { + int64TypeBuilder_.setMessage(value); + } + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + public Builder clearInt64Type() { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + } + int64TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + public com.google.bigtable.admin.v2.Type.Int64.Builder getInt64TypeBuilder() { + return internalGetInt64TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Int64OrBuilder getInt64TypeOrBuilder() { + if ((kindCase_ == 5) && (int64TypeBuilder_ != null)) { + return int64TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 5) { + return (com.google.bigtable.admin.v2.Type.Int64) kind_; + } + return com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64, + com.google.bigtable.admin.v2.Type.Int64.Builder, + com.google.bigtable.admin.v2.Type.Int64OrBuilder> + internalGetInt64TypeFieldBuilder() { + if (int64TypeBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + int64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Int64, + com.google.bigtable.admin.v2.Type.Int64.Builder, + com.google.bigtable.admin.v2.Type.Int64OrBuilder>( + (com.google.bigtable.admin.v2.Type.Int64) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 5; + onChanged(); + return int64TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float32, + com.google.bigtable.admin.v2.Type.Float32.Builder, + com.google.bigtable.admin.v2.Type.Float32OrBuilder> + float32TypeBuilder_; + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + @java.lang.Override + public boolean hasFloat32Type() { + return kindCase_ == 12; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32 getFloat32Type() { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12) { + return (com.google.bigtable.admin.v2.Type.Float32) kind_; + } + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } else { + if (kindCase_ == 12) { + return float32TypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + public Builder setFloat32Type(com.google.bigtable.admin.v2.Type.Float32 value) { + if (float32TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + float32TypeBuilder_.setMessage(value); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + public Builder setFloat32Type( + com.google.bigtable.admin.v2.Type.Float32.Builder builderForValue) { + if (float32TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + float32TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + public Builder mergeFloat32Type(com.google.bigtable.admin.v2.Type.Float32 value) { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12 + && kind_ != com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Float32.newBuilder( + (com.google.bigtable.admin.v2.Type.Float32) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 12) { + float32TypeBuilder_.mergeFrom(value); + } else { + float32TypeBuilder_.setMessage(value); + } + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + public Builder clearFloat32Type() { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + } + float32TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + public com.google.bigtable.admin.v2.Type.Float32.Builder getFloat32TypeBuilder() { + return internalGetFloat32TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder() { + if ((kindCase_ == 12) && (float32TypeBuilder_ != null)) { + return float32TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 12) { + return (com.google.bigtable.admin.v2.Type.Float32) kind_; + } + return com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float32, + com.google.bigtable.admin.v2.Type.Float32.Builder, + com.google.bigtable.admin.v2.Type.Float32OrBuilder> + internalGetFloat32TypeFieldBuilder() { + if (float32TypeBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + float32TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float32, + com.google.bigtable.admin.v2.Type.Float32.Builder, + com.google.bigtable.admin.v2.Type.Float32OrBuilder>( + (com.google.bigtable.admin.v2.Type.Float32) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 12; + onChanged(); + return float32TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float64, + com.google.bigtable.admin.v2.Type.Float64.Builder, + com.google.bigtable.admin.v2.Type.Float64OrBuilder> + float64TypeBuilder_; + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + @java.lang.Override + public boolean hasFloat64Type() { + return kindCase_ == 9; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64 getFloat64Type() { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9) { + return (com.google.bigtable.admin.v2.Type.Float64) kind_; + } + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } else { + if (kindCase_ == 9) { + return float64TypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + public Builder setFloat64Type(com.google.bigtable.admin.v2.Type.Float64 value) { + if (float64TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + float64TypeBuilder_.setMessage(value); + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + public Builder setFloat64Type( + com.google.bigtable.admin.v2.Type.Float64.Builder builderForValue) { + if (float64TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + float64TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + public Builder mergeFloat64Type(com.google.bigtable.admin.v2.Type.Float64 value) { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9 + && kind_ != com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Float64.newBuilder( + (com.google.bigtable.admin.v2.Type.Float64) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 9) { + float64TypeBuilder_.mergeFrom(value); + } else { + float64TypeBuilder_.setMessage(value); + } + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + public Builder clearFloat64Type() { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + } + float64TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + public com.google.bigtable.admin.v2.Type.Float64.Builder getFloat64TypeBuilder() { + return internalGetFloat64TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder() { + if ((kindCase_ == 9) && (float64TypeBuilder_ != null)) { + return float64TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 9) { + return (com.google.bigtable.admin.v2.Type.Float64) kind_; + } + return com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float64, + com.google.bigtable.admin.v2.Type.Float64.Builder, + com.google.bigtable.admin.v2.Type.Float64OrBuilder> + internalGetFloat64TypeFieldBuilder() { + if (float64TypeBuilder_ == null) { + if (!(kindCase_ == 9)) { + kind_ = com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + float64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Float64, + com.google.bigtable.admin.v2.Type.Float64.Builder, + com.google.bigtable.admin.v2.Type.Float64OrBuilder>( + (com.google.bigtable.admin.v2.Type.Float64) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 9; + onChanged(); + return float64TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bool, + com.google.bigtable.admin.v2.Type.Bool.Builder, + com.google.bigtable.admin.v2.Type.BoolOrBuilder> + boolTypeBuilder_; + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + @java.lang.Override + public boolean hasBoolType() { + return kindCase_ == 8; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Bool getBoolType() { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8) { + return (com.google.bigtable.admin.v2.Type.Bool) kind_; + } + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } else { + if (kindCase_ == 8) { + return boolTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + public Builder setBoolType(com.google.bigtable.admin.v2.Type.Bool value) { + if (boolTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + boolTypeBuilder_.setMessage(value); + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + public Builder setBoolType(com.google.bigtable.admin.v2.Type.Bool.Builder builderForValue) { + if (boolTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + boolTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + public Builder mergeBoolType(com.google.bigtable.admin.v2.Type.Bool value) { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8 + && kind_ != com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Bool.newBuilder( + (com.google.bigtable.admin.v2.Type.Bool) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 8) { + boolTypeBuilder_.mergeFrom(value); + } else { + boolTypeBuilder_.setMessage(value); + } + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + public Builder clearBoolType() { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + } + boolTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + public com.google.bigtable.admin.v2.Type.Bool.Builder getBoolTypeBuilder() { + return internalGetBoolTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.BoolOrBuilder getBoolTypeOrBuilder() { + if ((kindCase_ == 8) && (boolTypeBuilder_ != null)) { + return boolTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 8) { + return (com.google.bigtable.admin.v2.Type.Bool) kind_; + } + return com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bool, + com.google.bigtable.admin.v2.Type.Bool.Builder, + com.google.bigtable.admin.v2.Type.BoolOrBuilder> + internalGetBoolTypeFieldBuilder() { + if (boolTypeBuilder_ == null) { + if (!(kindCase_ == 8)) { + kind_ = com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + boolTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Bool, + com.google.bigtable.admin.v2.Type.Bool.Builder, + com.google.bigtable.admin.v2.Type.BoolOrBuilder>( + (com.google.bigtable.admin.v2.Type.Bool) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 8; + onChanged(); + return boolTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp, + com.google.bigtable.admin.v2.Type.Timestamp.Builder, + com.google.bigtable.admin.v2.Type.TimestampOrBuilder> + timestampTypeBuilder_; + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + @java.lang.Override + public boolean hasTimestampType() { + return kindCase_ == 10; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Timestamp getTimestampType() { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10) { + return (com.google.bigtable.admin.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } else { + if (kindCase_ == 10) { + return timestampTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder setTimestampType(com.google.bigtable.admin.v2.Type.Timestamp value) { + if (timestampTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + timestampTypeBuilder_.setMessage(value); + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder setTimestampType( + com.google.bigtable.admin.v2.Type.Timestamp.Builder builderForValue) { + if (timestampTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + timestampTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder mergeTimestampType(com.google.bigtable.admin.v2.Type.Timestamp value) { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10 + && kind_ != com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Timestamp.newBuilder( + (com.google.bigtable.admin.v2.Type.Timestamp) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 10) { + timestampTypeBuilder_.mergeFrom(value); + } else { + timestampTypeBuilder_.setMessage(value); + } + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder clearTimestampType() { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + } + timestampTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + public com.google.bigtable.admin.v2.Type.Timestamp.Builder getTimestampTypeBuilder() { + return internalGetTimestampTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder() { + if ((kindCase_ == 10) && (timestampTypeBuilder_ != null)) { + return timestampTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 10) { + return (com.google.bigtable.admin.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp, + com.google.bigtable.admin.v2.Type.Timestamp.Builder, + com.google.bigtable.admin.v2.Type.TimestampOrBuilder> + internalGetTimestampTypeFieldBuilder() { + if (timestampTypeBuilder_ == null) { + if (!(kindCase_ == 10)) { + kind_ = com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + timestampTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Timestamp, + com.google.bigtable.admin.v2.Type.Timestamp.Builder, + com.google.bigtable.admin.v2.Type.TimestampOrBuilder>( + (com.google.bigtable.admin.v2.Type.Timestamp) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 10; + onChanged(); + return timestampTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Date, + com.google.bigtable.admin.v2.Type.Date.Builder, + com.google.bigtable.admin.v2.Type.DateOrBuilder> + dateTypeBuilder_; + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + @java.lang.Override + public boolean hasDateType() { + return kindCase_ == 11; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Date getDateType() { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11) { + return (com.google.bigtable.admin.v2.Type.Date) kind_; + } + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } else { + if (kindCase_ == 11) { + return dateTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + public Builder setDateType(com.google.bigtable.admin.v2.Type.Date value) { + if (dateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + dateTypeBuilder_.setMessage(value); + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + public Builder setDateType(com.google.bigtable.admin.v2.Type.Date.Builder builderForValue) { + if (dateTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + dateTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + public Builder mergeDateType(com.google.bigtable.admin.v2.Type.Date value) { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11 + && kind_ != com.google.bigtable.admin.v2.Type.Date.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Date.newBuilder( + (com.google.bigtable.admin.v2.Type.Date) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 11) { + dateTypeBuilder_.mergeFrom(value); + } else { + dateTypeBuilder_.setMessage(value); + } + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + public Builder clearDateType() { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + } + dateTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + public com.google.bigtable.admin.v2.Type.Date.Builder getDateTypeBuilder() { + return internalGetDateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.DateOrBuilder getDateTypeOrBuilder() { + if ((kindCase_ == 11) && (dateTypeBuilder_ != null)) { + return dateTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 11) { + return (com.google.bigtable.admin.v2.Type.Date) kind_; + } + return com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Date, + com.google.bigtable.admin.v2.Type.Date.Builder, + com.google.bigtable.admin.v2.Type.DateOrBuilder> + internalGetDateTypeFieldBuilder() { + if (dateTypeBuilder_ == null) { + if (!(kindCase_ == 11)) { + kind_ = com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + dateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Date, + com.google.bigtable.admin.v2.Type.Date.Builder, + com.google.bigtable.admin.v2.Type.DateOrBuilder>( + (com.google.bigtable.admin.v2.Type.Date) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 11; + onChanged(); + return dateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate, + com.google.bigtable.admin.v2.Type.Aggregate.Builder, + com.google.bigtable.admin.v2.Type.AggregateOrBuilder> + aggregateTypeBuilder_; + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + @java.lang.Override + public boolean hasAggregateType() { + return kindCase_ == 6; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Aggregate getAggregateType() { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } else { + if (kindCase_ == 6) { + return aggregateTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder setAggregateType(com.google.bigtable.admin.v2.Type.Aggregate value) { + if (aggregateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + aggregateTypeBuilder_.setMessage(value); + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder setAggregateType( + com.google.bigtable.admin.v2.Type.Aggregate.Builder builderForValue) { + if (aggregateTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + aggregateTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder mergeAggregateType(com.google.bigtable.admin.v2.Type.Aggregate value) { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6 + && kind_ != com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Aggregate.newBuilder( + (com.google.bigtable.admin.v2.Type.Aggregate) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 6) { + aggregateTypeBuilder_.mergeFrom(value); + } else { + aggregateTypeBuilder_.setMessage(value); + } + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder clearAggregateType() { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + } + aggregateTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + public com.google.bigtable.admin.v2.Type.Aggregate.Builder getAggregateTypeBuilder() { + return internalGetAggregateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder() { + if ((kindCase_ == 6) && (aggregateTypeBuilder_ != null)) { + return aggregateTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 6) { + return (com.google.bigtable.admin.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate, + com.google.bigtable.admin.v2.Type.Aggregate.Builder, + com.google.bigtable.admin.v2.Type.AggregateOrBuilder> + internalGetAggregateTypeFieldBuilder() { + if (aggregateTypeBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + aggregateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Aggregate, + com.google.bigtable.admin.v2.Type.Aggregate.Builder, + com.google.bigtable.admin.v2.Type.AggregateOrBuilder>( + (com.google.bigtable.admin.v2.Type.Aggregate) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 6; + onChanged(); + return aggregateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder> + structTypeBuilder_; + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + @java.lang.Override + public boolean hasStructType() { + return kindCase_ == 7; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Struct getStructType() { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Struct) kind_; + } + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } else { + if (kindCase_ == 7) { + return structTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + public Builder setStructType(com.google.bigtable.admin.v2.Type.Struct value) { + if (structTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + structTypeBuilder_.setMessage(value); + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + public Builder setStructType(com.google.bigtable.admin.v2.Type.Struct.Builder builderForValue) { + if (structTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + structTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + public Builder mergeStructType(com.google.bigtable.admin.v2.Type.Struct value) { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7 + && kind_ != com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Struct.newBuilder( + (com.google.bigtable.admin.v2.Type.Struct) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 7) { + structTypeBuilder_.mergeFrom(value); + } else { + structTypeBuilder_.setMessage(value); + } + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + public Builder clearStructType() { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + } + structTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + public com.google.bigtable.admin.v2.Type.Struct.Builder getStructTypeBuilder() { + return internalGetStructTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.StructOrBuilder getStructTypeOrBuilder() { + if ((kindCase_ == 7) && (structTypeBuilder_ != null)) { + return structTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 7) { + return (com.google.bigtable.admin.v2.Type.Struct) kind_; + } + return com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder> + internalGetStructTypeFieldBuilder() { + if (structTypeBuilder_ == null) { + if (!(kindCase_ == 7)) { + kind_ = com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + structTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder>( + (com.google.bigtable.admin.v2.Type.Struct) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 7; + onChanged(); + return structTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Array, + com.google.bigtable.admin.v2.Type.Array.Builder, + com.google.bigtable.admin.v2.Type.ArrayOrBuilder> + arrayTypeBuilder_; + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + @java.lang.Override + public boolean hasArrayType() { + return kindCase_ == 3; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Array getArrayType() { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Array) kind_; + } + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } else { + if (kindCase_ == 3) { + return arrayTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + public Builder setArrayType(com.google.bigtable.admin.v2.Type.Array value) { + if (arrayTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + arrayTypeBuilder_.setMessage(value); + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + public Builder setArrayType(com.google.bigtable.admin.v2.Type.Array.Builder builderForValue) { + if (arrayTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + arrayTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + public Builder mergeArrayType(com.google.bigtable.admin.v2.Type.Array value) { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3 + && kind_ != com.google.bigtable.admin.v2.Type.Array.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Array.newBuilder( + (com.google.bigtable.admin.v2.Type.Array) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 3) { + arrayTypeBuilder_.mergeFrom(value); + } else { + arrayTypeBuilder_.setMessage(value); + } + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + public Builder clearArrayType() { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + } + arrayTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + public com.google.bigtable.admin.v2.Type.Array.Builder getArrayTypeBuilder() { + return internalGetArrayTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder() { + if ((kindCase_ == 3) && (arrayTypeBuilder_ != null)) { + return arrayTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 3) { + return (com.google.bigtable.admin.v2.Type.Array) kind_; + } + return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Array, + com.google.bigtable.admin.v2.Type.Array.Builder, + com.google.bigtable.admin.v2.Type.ArrayOrBuilder> + internalGetArrayTypeFieldBuilder() { + if (arrayTypeBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + arrayTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Array, + com.google.bigtable.admin.v2.Type.Array.Builder, + com.google.bigtable.admin.v2.Type.ArrayOrBuilder>( + (com.google.bigtable.admin.v2.Type.Array) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 3; + onChanged(); + return arrayTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Map, + com.google.bigtable.admin.v2.Type.Map.Builder, + com.google.bigtable.admin.v2.Type.MapOrBuilder> + mapTypeBuilder_; + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + @java.lang.Override + public boolean hasMapType() { + return kindCase_ == 4; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Map getMapType() { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Map) kind_; + } + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return mapTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + public Builder setMapType(com.google.bigtable.admin.v2.Type.Map value) { + if (mapTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + mapTypeBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + public Builder setMapType(com.google.bigtable.admin.v2.Type.Map.Builder builderForValue) { + if (mapTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + mapTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + public Builder mergeMapType(com.google.bigtable.admin.v2.Type.Map value) { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4 && kind_ != com.google.bigtable.admin.v2.Type.Map.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Map.newBuilder( + (com.google.bigtable.admin.v2.Type.Map) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + mapTypeBuilder_.mergeFrom(value); + } else { + mapTypeBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + public Builder clearMapType() { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + mapTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + public com.google.bigtable.admin.v2.Type.Map.Builder getMapTypeBuilder() { + return internalGetMapTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.MapOrBuilder getMapTypeOrBuilder() { + if ((kindCase_ == 4) && (mapTypeBuilder_ != null)) { + return mapTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (com.google.bigtable.admin.v2.Type.Map) kind_; + } + return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Map, + com.google.bigtable.admin.v2.Type.Map.Builder, + com.google.bigtable.admin.v2.Type.MapOrBuilder> + internalGetMapTypeFieldBuilder() { + if (mapTypeBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + mapTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Map, + com.google.bigtable.admin.v2.Type.Map.Builder, + com.google.bigtable.admin.v2.Type.MapOrBuilder>( + (com.google.bigtable.admin.v2.Type.Map) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + return mapTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Proto, + com.google.bigtable.admin.v2.Type.Proto.Builder, + com.google.bigtable.admin.v2.Type.ProtoOrBuilder> + protoTypeBuilder_; + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + @java.lang.Override + public boolean hasProtoType() { + return kindCase_ == 13; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Proto getProtoType() { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13) { + return (com.google.bigtable.admin.v2.Type.Proto) kind_; + } + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } else { + if (kindCase_ == 13) { + return protoTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + public Builder setProtoType(com.google.bigtable.admin.v2.Type.Proto value) { + if (protoTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + protoTypeBuilder_.setMessage(value); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + public Builder setProtoType(com.google.bigtable.admin.v2.Type.Proto.Builder builderForValue) { + if (protoTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + protoTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + public Builder mergeProtoType(com.google.bigtable.admin.v2.Type.Proto value) { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13 + && kind_ != com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Proto.newBuilder( + (com.google.bigtable.admin.v2.Type.Proto) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 13) { + protoTypeBuilder_.mergeFrom(value); + } else { + protoTypeBuilder_.setMessage(value); + } + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + public Builder clearProtoType() { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + } + protoTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + public com.google.bigtable.admin.v2.Type.Proto.Builder getProtoTypeBuilder() { + return internalGetProtoTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder() { + if ((kindCase_ == 13) && (protoTypeBuilder_ != null)) { + return protoTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 13) { + return (com.google.bigtable.admin.v2.Type.Proto) kind_; + } + return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Proto, + com.google.bigtable.admin.v2.Type.Proto.Builder, + com.google.bigtable.admin.v2.Type.ProtoOrBuilder> + internalGetProtoTypeFieldBuilder() { + if (protoTypeBuilder_ == null) { + if (!(kindCase_ == 13)) { + kind_ = com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance(); + } + protoTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Proto, + com.google.bigtable.admin.v2.Type.Proto.Builder, + com.google.bigtable.admin.v2.Type.ProtoOrBuilder>( + (com.google.bigtable.admin.v2.Type.Proto) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 13; + onChanged(); + return protoTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Enum, + com.google.bigtable.admin.v2.Type.Enum.Builder, + com.google.bigtable.admin.v2.Type.EnumOrBuilder> + enumTypeBuilder_; + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + @java.lang.Override + public boolean hasEnumType() { + return kindCase_ == 14; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.Enum getEnumType() { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14) { + return (com.google.bigtable.admin.v2.Type.Enum) kind_; + } + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } else { + if (kindCase_ == 14) { + return enumTypeBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + public Builder setEnumType(com.google.bigtable.admin.v2.Type.Enum value) { + if (enumTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + enumTypeBuilder_.setMessage(value); + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + public Builder setEnumType(com.google.bigtable.admin.v2.Type.Enum.Builder builderForValue) { + if (enumTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + enumTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + public Builder mergeEnumType(com.google.bigtable.admin.v2.Type.Enum value) { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14 + && kind_ != com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance()) { + kind_ = + com.google.bigtable.admin.v2.Type.Enum.newBuilder( + (com.google.bigtable.admin.v2.Type.Enum) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 14) { + enumTypeBuilder_.mergeFrom(value); + } else { + enumTypeBuilder_.setMessage(value); + } + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + public Builder clearEnumType() { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 14) { + kindCase_ = 0; + kind_ = null; + } + enumTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + public com.google.bigtable.admin.v2.Type.Enum.Builder getEnumTypeBuilder() { + return internalGetEnumTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Type.EnumOrBuilder getEnumTypeOrBuilder() { + if ((kindCase_ == 14) && (enumTypeBuilder_ != null)) { + return enumTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 14) { + return (com.google.bigtable.admin.v2.Type.Enum) kind_; + } + return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Enum, + com.google.bigtable.admin.v2.Type.Enum.Builder, + com.google.bigtable.admin.v2.Type.EnumOrBuilder> + internalGetEnumTypeFieldBuilder() { + if (enumTypeBuilder_ == null) { + if (!(kindCase_ == 14)) { + kind_ = com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance(); + } + enumTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Type.Enum, + com.google.bigtable.admin.v2.Type.Enum.Builder, + com.google.bigtable.admin.v2.Type.EnumOrBuilder>( + (com.google.bigtable.admin.v2.Type.Enum) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 14; + onChanged(); + return enumTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type) + private static final com.google.bigtable.admin.v2.Type DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type(); + } + + public static com.google.bigtable.admin.v2.Type getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Type parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.Type getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.java new file mode 100644 index 000000000000..7e7bf4902ba9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.java @@ -0,0 +1,548 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface TypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + boolean hasBytesType(); + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + com.google.bigtable.admin.v2.Type.Bytes getBytesType(); + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + boolean hasStringType(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + com.google.bigtable.admin.v2.Type.String getStringType(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.admin.v2.Type.String string_type = 2; + */ + com.google.bigtable.admin.v2.Type.StringOrBuilder getStringTypeOrBuilder(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + boolean hasInt64Type(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + com.google.bigtable.admin.v2.Type.Int64 getInt64Type(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Int64 int64_type = 5; + */ + com.google.bigtable.admin.v2.Type.Int64OrBuilder getInt64TypeOrBuilder(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + boolean hasFloat32Type(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + com.google.bigtable.admin.v2.Type.Float32 getFloat32Type(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float32 float32_type = 12; + */ + com.google.bigtable.admin.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + boolean hasFloat64Type(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + com.google.bigtable.admin.v2.Type.Float64 getFloat64Type(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.admin.v2.Type.Float64 float64_type = 9; + */ + com.google.bigtable.admin.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + boolean hasBoolType(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + com.google.bigtable.admin.v2.Type.Bool getBoolType(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.admin.v2.Type.Bool bool_type = 8; + */ + com.google.bigtable.admin.v2.Type.BoolOrBuilder getBoolTypeOrBuilder(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + boolean hasTimestampType(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + com.google.bigtable.admin.v2.Type.Timestamp getTimestampType(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.admin.v2.Type.Timestamp timestamp_type = 10; + */ + com.google.bigtable.admin.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + boolean hasDateType(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + com.google.bigtable.admin.v2.Type.Date getDateType(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.admin.v2.Type.Date date_type = 11; + */ + com.google.bigtable.admin.v2.Type.DateOrBuilder getDateTypeOrBuilder(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + boolean hasAggregateType(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + com.google.bigtable.admin.v2.Type.Aggregate getAggregateType(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.admin.v2.Type.Aggregate aggregate_type = 6; + */ + com.google.bigtable.admin.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + boolean hasStructType(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + com.google.bigtable.admin.v2.Type.Struct getStructType(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.admin.v2.Type.Struct struct_type = 7; + */ + com.google.bigtable.admin.v2.Type.StructOrBuilder getStructTypeOrBuilder(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + boolean hasArrayType(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + com.google.bigtable.admin.v2.Type.Array getArrayType(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.admin.v2.Type.Array array_type = 3; + */ + com.google.bigtable.admin.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + boolean hasMapType(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + com.google.bigtable.admin.v2.Type.Map getMapType(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.admin.v2.Type.Map map_type = 4; + */ + com.google.bigtable.admin.v2.Type.MapOrBuilder getMapTypeOrBuilder(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + boolean hasProtoType(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + com.google.bigtable.admin.v2.Type.Proto getProtoType(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.admin.v2.Type.Proto proto_type = 13; + */ + com.google.bigtable.admin.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + boolean hasEnumType(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + com.google.bigtable.admin.v2.Type.Enum getEnumType(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.admin.v2.Type.Enum enum_type = 14; + */ + com.google.bigtable.admin.v2.Type.EnumOrBuilder getEnumTypeOrBuilder(); + + com.google.bigtable.admin.v2.Type.KindCase getKindCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.java new file mode 100644 index 000000000000..cb4756344da8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.java @@ -0,0 +1,540 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public final class TypesProto extends com.google.protobuf.GeneratedFile { + private TypesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TypesProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Bytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_String_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_String_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_String_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Int64_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Int64_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Bool_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Bool_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Float32_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Float32_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Float64_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Float64_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Date_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Date_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_Field_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Proto_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Enum_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Array_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Map_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Aggregate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n$google/bigtable/admin/v2/types.proto\022\030" + + "google.bigtable.admin.v2\032\037google/api/fie" + + "ld_behavior.proto\"\307\031\n\004Type\022:\n\nbytes_type" + + "\030\001 \001(\0132$.google.bigtable.admin.v2.Type.B" + + "ytesH\000\022<\n\013string_type\030\002 \001(\0132%.google.big" + + "table.admin.v2.Type.StringH\000\022:\n\nint64_ty" + + "pe\030\005 \001(\0132$.google.bigtable.admin.v2.Type" + + ".Int64H\000\022>\n\014float32_type\030\014 \001(\0132&.google." + + "bigtable.admin.v2.Type.Float32H\000\022>\n\014floa" + + "t64_type\030\t \001(\0132&.google.bigtable.admin.v" + + "2.Type.Float64H\000\0228\n\tbool_type\030\010 \001(\0132#.go" + + "ogle.bigtable.admin.v2.Type.BoolH\000\022B\n\016ti" + + "mestamp_type\030\n \001(\0132(.google.bigtable.adm" + + "in.v2.Type.TimestampH\000\0228\n\tdate_type\030\013 \001(" + + "\0132#.google.bigtable.admin.v2.Type.DateH\000" + + "\022B\n\016aggregate_type\030\006 \001(\0132(.google.bigtab" + + "le.admin.v2.Type.AggregateH\000\022<\n\013struct_t" + + "ype\030\007 \001(\0132%.google.bigtable.admin.v2.Typ" + + "e.StructH\000\022:\n\narray_type\030\003 \001(\0132$.google." + + "bigtable.admin.v2.Type.ArrayH\000\0226\n\010map_ty" + + "pe\030\004 \001(\0132\".google.bigtable.admin.v2.Type" + + ".MapH\000\022:\n\nproto_type\030\r \001(\0132$.google.bigt" + + "able.admin.v2.Type.ProtoH\000\0228\n\tenum_type\030" + + "\016 \001(\0132#.google.bigtable.admin.v2.Type.En" + + "umH\000\032\251\001\n\005Bytes\022?\n\010encoding\030\001 \001(\0132-.googl" + + "e.bigtable.admin.v2.Type.Bytes.Encoding\032" + + "_\n\010Encoding\022@\n\003raw\030\001 \001(\01321.google.bigtab" + + "le.admin.v2.Type.Bytes.Encoding.RawH\000\032\005\n" + + "\003RawB\n\n\010encoding\032\237\002\n\006String\022@\n\010encoding\030" + + "\001 \001(\0132..google.bigtable.admin.v2.Type.St" + + "ring.Encoding\032\322\001\n\010Encoding\022N\n\010utf8_raw\030\001" + + " \001(\01326.google.bigtable.admin.v2.Type.Str" + + "ing.Encoding.Utf8RawB\002\030\001H\000\022N\n\nutf8_bytes" + + "\030\002 \001(\01328.google.bigtable.admin.v2.Type.S" + + "tring.Encoding.Utf8BytesH\000\032\r\n\007Utf8Raw:\002\030" + + "\001\032\013\n\tUtf8BytesB\n\n\010encoding\032\375\002\n\005Int64\022?\n\010" + + "encoding\030\001 \001(\0132-.google.bigtable.admin.v" + + "2.Type.Int64.Encoding\032\262\002\n\010Encoding\022X\n\020bi" + + "g_endian_bytes\030\001 \001(\0132<.google.bigtable.a" + + "dmin.v2.Type.Int64.Encoding.BigEndianByt" + + "esH\000\022\\\n\022ordered_code_bytes\030\002 \001(\0132>.googl" + + "e.bigtable.admin.v2.Type.Int64.Encoding." + + "OrderedCodeBytesH\000\032N\n\016BigEndianBytes\022<\n\n" + + "bytes_type\030\001 \001(\0132$.google.bigtable.admin" + + ".v2.Type.BytesB\002\030\001\032\022\n\020OrderedCodeBytesB\n" + + "\n\010encoding\032\006\n\004Bool\032\t\n\007Float32\032\t\n\007Float64" + + "\032\264\001\n\tTimestamp\022C\n\010encoding\030\001 \001(\01321.googl" + + "e.bigtable.admin.v2.Type.Timestamp.Encod" + + "ing\032b\n\010Encoding\022J\n\021unix_micros_int64\030\001 \001" + + "(\0132-.google.bigtable.admin.v2.Type.Int64" + + ".EncodingH\000B\n\n\010encoding\032\006\n\004Date\032\271\004\n\006Stru" + + "ct\022;\n\006fields\030\001 \003(\0132+.google.bigtable.adm" + + "in.v2.Type.Struct.Field\022@\n\010encoding\030\002 \001(" + + "\0132..google.bigtable.admin.v2.Type.Struct" + + ".Encoding\032I\n\005Field\022\022\n\nfield_name\030\001 \001(\t\022," + + "\n\004type\030\002 \001(\0132\036.google.bigtable.admin.v2." + + "Type\032\344\002\n\010Encoding\022M\n\tsingleton\030\001 \001(\01328.g" + + "oogle.bigtable.admin.v2.Type.Struct.Enco" + + "ding.SingletonH\000\022X\n\017delimited_bytes\030\002 \001(" + + "\0132=.google.bigtable.admin.v2.Type.Struct" + + ".Encoding.DelimitedBytesH\000\022]\n\022ordered_co" + + "de_bytes\030\003 \001(\0132?.google.bigtable.admin.v" + + "2.Type.Struct.Encoding.OrderedCodeBytesH" + + "\000\032\013\n\tSingleton\032#\n\016DelimitedBytes\022\021\n\tdeli" + + "miter\030\001 \001(\014\032\022\n\020OrderedCodeBytesB\n\n\010encod" + + "ing\0327\n\005Proto\022\030\n\020schema_bundle_id\030\001 \001(\t\022\024" + + "\n\014message_name\030\002 \001(\t\0323\n\004Enum\022\030\n\020schema_b" + + "undle_id\030\001 \001(\t\022\021\n\tenum_name\030\002 \001(\t\032=\n\005Arr" + + "ay\0224\n\014element_type\030\001 \001(\0132\036.google.bigtab" + + "le.admin.v2.Type\032k\n\003Map\0220\n\010key_type\030\001 \001(" + + "\0132\036.google.bigtable.admin.v2.Type\0222\n\nval" + + "ue_type\030\002 \001(\0132\036.google.bigtable.admin.v2" + + ".Type\032\333\003\n\tAggregate\0222\n\ninput_type\030\001 \001(\0132" + + "\036.google.bigtable.admin.v2.Type\0227\n\nstate" + + "_type\030\002 \001(\0132\036.google.bigtable.admin.v2.T" + + "ypeB\003\340A\003\022;\n\003sum\030\004 \001(\0132,.google.bigtable." + + "admin.v2.Type.Aggregate.SumH\000\022e\n\022hllpp_u" + + "nique_count\030\005 \001(\0132G.google.bigtable.admi" + + "n.v2.Type.Aggregate.HyperLogLogPlusPlusU" + + "niqueCountH\000\022;\n\003max\030\006 \001(\0132,.google.bigta" + + "ble.admin.v2.Type.Aggregate.MaxH\000\022;\n\003min" + + "\030\007 \001(\0132,.google.bigtable.admin.v2.Type.A" + + "ggregate.MinH\000\032\005\n\003Sum\032\005\n\003Max\032\005\n\003Min\032 \n\036H" + + "yperLogLogPlusPlusUniqueCountB\014\n\naggrega" + + "torB\006\n\004kindB\315\001\n\034com.google.bigtable.admi" + + "n.v2B\nTypesProtoP\001Z8cloud.google.com/go/" + + "bigtable/admin/apiv2/adminpb;adminpb\252\002\036G" + + "oogle.Cloud.Bigtable.Admin.V2\312\002\036Google\\C" + + "loud\\Bigtable\\Admin\\V2\352\002\"Google::Cloud::" + + "Bigtable::Admin::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_bigtable_admin_v2_Type_descriptor = getDescriptor().getMessageType(0); + internal_static_google_bigtable_admin_v2_Type_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_descriptor, + new java.lang.String[] { + "BytesType", + "StringType", + "Int64Type", + "Float32Type", + "Float64Type", + "BoolType", + "TimestampType", + "DateType", + "AggregateType", + "StructType", + "ArrayType", + "MapType", + "ProtoType", + "EnumType", + "Kind", + }); + internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor = + internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor, + new java.lang.String[] { + "Raw", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor = + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_String_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_String_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_String_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor = + internal_static_google_bigtable_admin_v2_Type_String_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor, + new java.lang.String[] { + "Utf8Raw", "Utf8Bytes", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor = + internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_String_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Int64_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_Type_Int64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor = + internal_static_google_bigtable_admin_v2_Type_Int64_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor, + new java.lang.String[] { + "BigEndianBytes", "OrderedCodeBytes", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor, + new java.lang.String[] { + "BytesType", + }); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Bool_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(3); + internal_static_google_bigtable_admin_v2_Type_Bool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Bool_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Float32_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(4); + internal_static_google_bigtable_admin_v2_Type_Float32_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Float32_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Float64_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(5); + internal_static_google_bigtable_admin_v2_Type_Float64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Float64_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(6); + internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor = + internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Timestamp_Encoding_descriptor, + new java.lang.String[] { + "UnixMicrosInt64", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Date_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(7); + internal_static_google_bigtable_admin_v2_Type_Date_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Date_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(8); + internal_static_google_bigtable_admin_v2_Type_Struct_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor, + new java.lang.String[] { + "Fields", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Struct_Field_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor, + new java.lang.String[] { + "FieldName", "Type", + }); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor, + new java.lang.String[] { + "Singleton", "DelimitedBytes", "OrderedCodeBytes", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_Singleton_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_DelimitedBytes_descriptor, + new java.lang.String[] { + "Delimiter", + }); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Proto_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(9); + internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Proto_descriptor, + new java.lang.String[] { + "SchemaBundleId", "MessageName", + }); + internal_static_google_bigtable_admin_v2_Type_Enum_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(10); + internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Enum_descriptor, + new java.lang.String[] { + "SchemaBundleId", "EnumName", + }); + internal_static_google_bigtable_admin_v2_Type_Array_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(11); + internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Array_descriptor, + new java.lang.String[] { + "ElementType", + }); + internal_static_google_bigtable_admin_v2_Type_Map_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(12); + internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Map_descriptor, + new java.lang.String[] { + "KeyType", "ValueType", + }); + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedType(13); + internal_static_google_bigtable_admin_v2_Type_Aggregate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor, + new java.lang.String[] { + "InputType", "StateType", "Sum", "HllppUniqueCount", "Max", "Min", "Aggregator", + }); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor = + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor.getNestedType(0); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor = + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor.getNestedType(1); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor = + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor.getNestedType(2); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor = + internal_static_google_bigtable_admin_v2_Type_Aggregate_descriptor.getNestedType(3); + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor, + new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java new file mode 100644 index 000000000000..16897c8633dd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the operation returned by
+ * [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UndeleteTableMetadata} + */ +@com.google.protobuf.Generated +public final class UndeleteTableMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UndeleteTableMetadata) + UndeleteTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UndeleteTableMetadata"); + } + + // Use UndeleteTableMetadata.newBuilder() to construct. + private UndeleteTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UndeleteTableMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UndeleteTableMetadata.class, + com.google.bigtable.admin.v2.UndeleteTableMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the table being restored.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The name of the table being restored.
+   * 
+ * + * string name = 1; + * + * @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 START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.UndeleteTableMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UndeleteTableMetadata other = + (com.google.bigtable.admin.v2.UndeleteTableMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata 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.admin.v2.UndeleteTableMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata 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.admin.v2.UndeleteTableMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UndeleteTableMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the operation returned by
+   * [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UndeleteTableMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UndeleteTableMetadata) + com.google.bigtable.admin.v2.UndeleteTableMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UndeleteTableMetadata.class, + com.google.bigtable.admin.v2.UndeleteTableMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UndeleteTableMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UndeleteTableMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableMetadata build() { + com.google.bigtable.admin.v2.UndeleteTableMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableMetadata buildPartial() { + com.google.bigtable.admin.v2.UndeleteTableMetadata result = + new com.google.bigtable.admin.v2.UndeleteTableMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UndeleteTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UndeleteTableMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UndeleteTableMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UndeleteTableMetadata other) { + if (other == com.google.bigtable.admin.v2.UndeleteTableMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the table being restored.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the table being restored.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the table being restored.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table being restored.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table being restored.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was cancelled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UndeleteTableMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UndeleteTableMetadata) + private static final com.google.bigtable.admin.v2.UndeleteTableMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UndeleteTableMetadata(); + } + + public static com.google.bigtable.admin.v2.UndeleteTableMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteTableMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UndeleteTableMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java new file mode 100644 index 000000000000..45364c362ae8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UndeleteTableMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UndeleteTableMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the table being restored.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the table being restored.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was cancelled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java new file mode 100644 index 000000000000..77244fd81590 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for
+ * [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UndeleteTableRequest} + */ +@com.google.protobuf.Generated +public final class UndeleteTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UndeleteTableRequest) + UndeleteTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UndeleteTableRequest"); + } + + // Use UndeleteTableRequest.newBuilder() to construct. + private UndeleteTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UndeleteTableRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UndeleteTableRequest.class, + com.google.bigtable.admin.v2.UndeleteTableRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table to be restored.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to be restored.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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; + } + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().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.admin.v2.UndeleteTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UndeleteTableRequest other = + (com.google.bigtable.admin.v2.UndeleteTableRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest 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.admin.v2.UndeleteTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest 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.admin.v2.UndeleteTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UndeleteTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UndeleteTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UndeleteTableRequest) + com.google.bigtable.admin.v2.UndeleteTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UndeleteTableRequest.class, + com.google.bigtable.admin.v2.UndeleteTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UndeleteTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UndeleteTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UndeleteTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableRequest build() { + com.google.bigtable.admin.v2.UndeleteTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UndeleteTableRequest buildPartial() { + com.google.bigtable.admin.v2.UndeleteTableRequest result = + new com.google.bigtable.admin.v2.UndeleteTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UndeleteTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UndeleteTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UndeleteTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UndeleteTableRequest other) { + if (other == com.google.bigtable.admin.v2.UndeleteTableRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table to be restored.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to be restored.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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 table to be restored.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to be restored.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table to be restored.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UndeleteTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UndeleteTableRequest) + private static final com.google.bigtable.admin.v2.UndeleteTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UndeleteTableRequest(); + } + + public static com.google.bigtable.admin.v2.UndeleteTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UndeleteTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java new file mode 100644 index 000000000000..851e6d771d4a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UndeleteTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UndeleteTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table to be restored.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * 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 table to be restored.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java new file mode 100644 index 000000000000..f439b09ac5ab --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java @@ -0,0 +1,397 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by UpdateAppProfile.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateAppProfileMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAppProfileMetadata) + UpdateAppProfileMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAppProfileMetadata"); + } + + // Use UpdateAppProfileMetadata.newBuilder() to construct. + private UpdateAppProfileMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateAppProfileMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAppProfileMetadata.class, + com.google.bigtable.admin.v2.UpdateAppProfileMetadata.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.admin.v2.UpdateAppProfileMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateAppProfileMetadata other = + (com.google.bigtable.admin.v2.UpdateAppProfileMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata 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.admin.v2.UpdateAppProfileMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata 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.admin.v2.UpdateAppProfileMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateAppProfileMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by UpdateAppProfile.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateAppProfileMetadata) + com.google.bigtable.admin.v2.UpdateAppProfileMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAppProfileMetadata.class, + com.google.bigtable.admin.v2.UpdateAppProfileMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateAppProfileMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateAppProfileMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileMetadata build() { + com.google.bigtable.admin.v2.UpdateAppProfileMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateAppProfileMetadata result = + new com.google.bigtable.admin.v2.UpdateAppProfileMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateAppProfileMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateAppProfileMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAppProfileMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateAppProfileMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAppProfileMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateAppProfileMetadata) + private static final com.google.bigtable.admin.v2.UpdateAppProfileMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateAppProfileMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAppProfileMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateAppProfileMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java new file mode 100644 index 000000000000..08d2ad5a7199 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateAppProfileMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateAppProfileMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java new file mode 100644 index 000000000000..1eea319039ee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.UpdateAppProfile.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileRequest} + */ +@com.google.protobuf.Generated +public final class UpdateAppProfileRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAppProfileRequest) + UpdateAppProfileRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAppProfileRequest"); + } + + // Use UpdateAppProfileRequest.newBuilder() to construct. + private UpdateAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateAppProfileRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.class, + com.google.bigtable.admin.v2.UpdateAppProfileRequest.Builder.class); + } + + private int bitField0_; + public static final int APP_PROFILE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.AppProfile appProfile_; + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + @java.lang.Override + public boolean hasAppProfile() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile getAppProfile() { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * If true, ignore safety checks when updating the app profile.
+   * 
+ * + * bool ignore_warnings = 3; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAppProfile()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAppProfile()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.UpdateAppProfileRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateAppProfileRequest other = + (com.google.bigtable.admin.v2.UpdateAppProfileRequest) obj; + + if (hasAppProfile() != other.hasAppProfile()) return false; + if (hasAppProfile()) { + if (!getAppProfile().equals(other.getAppProfile())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAppProfile()) { + hash = (37 * hash) + APP_PROFILE_FIELD_NUMBER; + hash = (53 * hash) + getAppProfile().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest 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.admin.v2.UpdateAppProfileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest 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.admin.v2.UpdateAppProfileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateAppProfileRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.UpdateAppProfile.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateAppProfileRequest) + com.google.bigtable.admin.v2.UpdateAppProfileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAppProfileRequest.class, + com.google.bigtable.admin.v2.UpdateAppProfileRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateAppProfileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAppProfileFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); + appProfileBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateAppProfileRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileRequest build() { + com.google.bigtable.admin.v2.UpdateAppProfileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAppProfileRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateAppProfileRequest result = + new com.google.bigtable.admin.v2.UpdateAppProfileRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateAppProfileRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.appProfile_ = appProfileBuilder_ == null ? appProfile_ : appProfileBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateAppProfileRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateAppProfileRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAppProfileRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateAppProfileRequest.getDefaultInstance()) + return this; + if (other.hasAppProfile()) { + mergeAppProfile(other.getAppProfile()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetAppProfileFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.AppProfile appProfile_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + appProfileBuilder_; + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + public boolean hasAppProfile() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + public com.google.bigtable.admin.v2.AppProfile getAppProfile() { + if (appProfileBuilder_ == null) { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } else { + return appProfileBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { + if (appProfileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appProfile_ = value; + } else { + appProfileBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { + if (appProfileBuilder_ == null) { + appProfile_ = builderForValue.build(); + } else { + appProfileBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { + if (appProfileBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && appProfile_ != null + && appProfile_ != com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()) { + getAppProfileBuilder().mergeFrom(value); + } else { + appProfile_ = value; + } + } else { + appProfileBuilder_.mergeFrom(value); + } + if (appProfile_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAppProfile() { + bitField0_ = (bitField0_ & ~0x00000001); + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); + appProfileBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAppProfileFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { + if (appProfileBuilder_ != null) { + return appProfileBuilder_.getMessageOrBuilder(); + } else { + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; + } + } + + /** + * + * + *
+     * Required. The app profile which will (partially) replace the current value.
+     * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder> + internalGetAppProfileFieldBuilder() { + if (appProfileBuilder_ == null) { + appProfileBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AppProfile, + com.google.bigtable.admin.v2.AppProfile.Builder, + com.google.bigtable.admin.v2.AppProfileOrBuilder>( + getAppProfile(), getParentForChildren(), isClean()); + appProfile_ = null; + } + return appProfileBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. The subset of app profile fields which should be replaced.
+     * If unset, all fields will be replaced.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * If true, ignore safety checks when updating the app profile.
+     * 
+ * + * bool ignore_warnings = 3; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * If true, ignore safety checks when updating the app profile.
+     * 
+ * + * bool ignore_warnings = 3; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, ignore safety checks when updating the app profile.
+     * 
+ * + * bool ignore_warnings = 3; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAppProfileRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateAppProfileRequest) + private static final com.google.bigtable.admin.v2.UpdateAppProfileRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateAppProfileRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateAppProfileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAppProfileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateAppProfileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java new file mode 100644 index 000000000000..9f0908e24785 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateAppProfileRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateAppProfileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appProfile field is set. + */ + boolean hasAppProfile(); + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appProfile. + */ + com.google.bigtable.admin.v2.AppProfile getAppProfile(); + + /** + * + * + *
+   * Required. The app profile which will (partially) replace the current value.
+   * 
+ * + * + * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder(); + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. The subset of app profile fields which should be replaced.
+   * If unset, all fields will be replaced.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If true, ignore safety checks when updating the app profile.
+   * 
+ * + * bool ignore_warnings = 3; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java new file mode 100644 index 000000000000..b4df5538ea08 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java @@ -0,0 +1,1276 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata for the google.longrunning.Operation returned by
+ * [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateAuthorizedViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + UpdateAuthorizedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAuthorizedViewMetadata"); + } + + // Use UpdateAuthorizedViewMetadata.newBuilder() to construct. + private UpdateAuthorizedViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateAuthorizedViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.class, + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.UpdateAuthorizedViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata other = + (com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata 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.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata 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.admin.v2.UpdateAuthorizedViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateAuthorizedViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata for the google.longrunning.Operation returned by
+   * [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAuthorizedViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.class, + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata build() { + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata result = + new com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateAuthorizedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + private static final com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAuthorizedViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateAuthorizedViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.java new file mode 100644 index 000000000000..bf2557d7a9b3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateAuthorizedViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateAuthorizedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateAuthorizedViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java new file mode 100644 index 000000000000..ad0831fc6d4c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java @@ -0,0 +1,1226 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class UpdateAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + UpdateAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAuthorizedViewRequest"); + } + + // Use UpdateAuthorizedViewRequest.newBuilder() to construct. + private UpdateAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateAuthorizedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder.class); + } + + private int bitField0_; + public static final int AUTHORIZED_VIEW_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.AuthorizedView authorizedView_; + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + @java.lang.Override + public boolean hasAuthorizedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView() { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder() { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * Optional. If true, ignore the safety checks when updating the
+   * AuthorizedView.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAuthorizedView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAuthorizedView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.UpdateAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest other = + (com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) obj; + + if (hasAuthorizedView() != other.hasAuthorizedView()) return false; + if (hasAuthorizedView()) { + if (!getAuthorizedView().equals(other.getAuthorizedView())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAuthorizedView()) { + hash = (37 * hash) + AUTHORIZED_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedView().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest 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.admin.v2.UpdateAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest 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.admin.v2.UpdateAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateAuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.class, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAuthorizedViewFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizedView_ = null; + if (authorizedViewBuilder_ != null) { + authorizedViewBuilder_.dispose(); + authorizedViewBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest build() { + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest result = + new com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizedView_ = + authorizedViewBuilder_ == null ? authorizedView_ : authorizedViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.getDefaultInstance()) + return this; + if (other.hasAuthorizedView()) { + mergeAuthorizedView(other.getAuthorizedView()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetAuthorizedViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.AuthorizedView authorizedView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + authorizedViewBuilder_; + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + public boolean hasAuthorizedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + public com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView() { + if (authorizedViewBuilder_ == null) { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } else { + return authorizedViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizedView(com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizedView_ = value; + } else { + authorizedViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizedView( + com.google.bigtable.admin.v2.AuthorizedView.Builder builderForValue) { + if (authorizedViewBuilder_ == null) { + authorizedView_ = builderForValue.build(); + } else { + authorizedViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAuthorizedView(com.google.bigtable.admin.v2.AuthorizedView value) { + if (authorizedViewBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && authorizedView_ != null + && authorizedView_ + != com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance()) { + getAuthorizedViewBuilder().mergeFrom(value); + } else { + authorizedView_ = value; + } + } else { + authorizedViewBuilder_.mergeFrom(value); + } + if (authorizedView_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAuthorizedView() { + bitField0_ = (bitField0_ & ~0x00000001); + authorizedView_ = null; + if (authorizedViewBuilder_ != null) { + authorizedViewBuilder_.dispose(); + authorizedViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AuthorizedView.Builder getAuthorizedViewBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetAuthorizedViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder() { + if (authorizedViewBuilder_ != null) { + return authorizedViewBuilder_.getMessageOrBuilder(); + } else { + return authorizedView_ == null + ? com.google.bigtable.admin.v2.AuthorizedView.getDefaultInstance() + : authorizedView_; + } + } + + /** + * + * + *
+     * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+     * used to identify the AuthorizedView. AuthorizedView name must in this
+     * format:
+     * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + internalGetAuthorizedViewFieldBuilder() { + if (authorizedViewBuilder_ == null) { + authorizedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder>( + getAuthorizedView(), getParentForChildren(), isClean()); + authorizedView_ = null; + } + return authorizedViewBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * A mask specifying which fields in the AuthorizedView resource should be
+     * updated. This mask is relative to the AuthorizedView resource, not to the
+     * request message. A field will be overwritten if it is in the mask. If
+     * empty, all fields set in the request will be overwritten. A special value
+     * `*` means to overwrite all fields (including fields not set in the
+     * request).
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * Optional. If true, ignore the safety checks when updating the
+     * AuthorizedView.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * Optional. If true, ignore the safety checks when updating the
+     * AuthorizedView.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If true, ignore the safety checks when updating the
+     * AuthorizedView.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + private static final com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..20e32a1a9d91 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizedView field is set. + */ + boolean hasAuthorizedView(); + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizedView. + */ + com.google.bigtable.admin.v2.AuthorizedView getAuthorizedView(); + + /** + * + * + *
+   * Required. The AuthorizedView to update. The `name` in `authorized_view` is
+   * used to identify the AuthorizedView. AuthorizedView name must in this
+   * format:
+   * `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.AuthorizedView authorized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder getAuthorizedViewOrBuilder(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * A mask specifying which fields in the AuthorizedView resource should be
+   * updated. This mask is relative to the AuthorizedView resource, not to the
+   * request message. A field will be overwritten if it is in the mask. If
+   * empty, all fields set in the request will be overwritten. A special value
+   * `*` means to overwrite all fields (including fields not set in the
+   * request).
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Optional. If true, ignore the safety checks when updating the
+   * AuthorizedView.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java new file mode 100644 index 000000000000..c5eeeffd25cd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java @@ -0,0 +1,1088 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateBackupRequest} + */ +@com.google.protobuf.Generated +public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateBackupRequest) + UpdateBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateBackupRequest"); + } + + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateBackupRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateBackupRequest.class, + com.google.bigtable.admin.v2.UpdateBackupRequest.Builder.class); + } + + private int bitField0_; + public static final int BACKUP_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Backup backup_; + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + @java.lang.Override + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup getBackup() { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackup()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.UpdateBackupRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateBackupRequest other = + (com.google.bigtable.admin.v2.UpdateBackupRequest) obj; + + if (hasBackup() != other.hasBackup()) return false; + if (hasBackup()) { + if (!getBackup().equals(other.getBackup())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackup()) { + hash = (37 * hash) + BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getBackup().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest 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.admin.v2.UpdateBackupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest 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.admin.v2.UpdateBackupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateBackupRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateBackupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateBackupRequest) + com.google.bigtable.admin.v2.UpdateBackupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateBackupRequest.class, + com.google.bigtable.admin.v2.UpdateBackupRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateBackupRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateBackupRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateBackupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateBackupRequest build() { + com.google.bigtable.admin.v2.UpdateBackupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateBackupRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateBackupRequest result = + new com.google.bigtable.admin.v2.UpdateBackupRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateBackupRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateBackupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateBackupRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateBackupRequest.getDefaultInstance()) + return this; + if (other.hasBackup()) { + mergeBackup(other.getBackup()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Backup backup_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + backupBuilder_; + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + public boolean hasBackup() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + public com.google.bigtable.admin.v2.Backup getBackup() { + if (backupBuilder_ == null) { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } else { + return backupBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { + if (backupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backup_ = value; + } else { + backupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForValue) { + if (backupBuilder_ == null) { + backup_ = builderForValue.build(); + } else { + backupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { + if (backupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backup_ != null + && backup_ != com.google.bigtable.admin.v2.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); + } else { + backup_ = value; + } + } else { + backupBuilder_.mergeFrom(value); + } + if (backup_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBackup() { + bitField0_ = (bitField0_ & ~0x00000001); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); + backupBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackupFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { + if (backupBuilder_ != null) { + return backupBuilder_.getMessageOrBuilder(); + } else { + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; + } + } + + /** + * + * + *
+     * Required. The backup to update. `backup.name`, and the fields to be updated
+     * as specified by `update_mask` are required. Other fields are ignored.
+     * Update is only supported for the following fields:
+     *
+     * * `backup.expire_time`.
+     * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder> + internalGetBackupFieldBuilder() { + if (backupBuilder_ == null) { + backupBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Backup, + com.google.bigtable.admin.v2.Backup.Builder, + com.google.bigtable.admin.v2.BackupOrBuilder>( + getBackup(), getParentForChildren(), isClean()); + backup_ = null; + } + return backupBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. A mask specifying which fields (e.g. `expire_time`) in the
+     * Backup resource should be updated. This mask is relative to the Backup
+     * resource, not to the request message. The field mask must always be
+     * specified; this prevents any future fields from being erased accidentally
+     * by clients that do not know about them.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateBackupRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateBackupRequest) + private static final com.google.bigtable.admin.v2.UpdateBackupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateBackupRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateBackupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBackupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateBackupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java new file mode 100644 index 000000000000..ee8c3d4eb651 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateBackupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateBackupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the backup field is set. + */ + boolean hasBackup(); + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The backup. + */ + com.google.bigtable.admin.v2.Backup getBackup(); + + /** + * + * + *
+   * Required. The backup to update. `backup.name`, and the fields to be updated
+   * as specified by `update_mask` are required. Other fields are ignored.
+   * Update is only supported for the following fields:
+   *
+   * * `backup.expire_time`.
+   * 
+ * + * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder(); + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. A mask specifying which fields (e.g. `expire_time`) in the
+   * Backup resource should be updated. This mask is relative to the Backup
+   * resource, not to the request message. The field mask must always be
+   * specified; this prevents any future fields from being erased accidentally
+   * by clients that do not know about them.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java new file mode 100644 index 000000000000..7ceddedbd95b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java @@ -0,0 +1,1255 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by UpdateCluster.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateClusterMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateClusterMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateClusterMetadata) + UpdateClusterMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateClusterMetadata"); + } + + // Use UpdateClusterMetadata.newBuilder() to construct. + private UpdateClusterMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateClusterMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateClusterMetadata.class, + com.google.bigtable.admin.v2.UpdateClusterMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Cluster originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.UpdateClusterMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateClusterMetadata other = + (com.google.bigtable.admin.v2.UpdateClusterMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata 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.admin.v2.UpdateClusterMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata 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.admin.v2.UpdateClusterMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateClusterMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by UpdateCluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateClusterMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateClusterMetadata) + com.google.bigtable.admin.v2.UpdateClusterMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateClusterMetadata.class, + com.google.bigtable.admin.v2.UpdateClusterMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateClusterMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateClusterMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateClusterMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateClusterMetadata build() { + com.google.bigtable.admin.v2.UpdateClusterMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateClusterMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateClusterMetadata result = + new com.google.bigtable.admin.v2.UpdateClusterMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateClusterMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateClusterMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateClusterMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateClusterMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateClusterMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Cluster originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.Cluster getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.Cluster value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.Cluster value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ != com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public com.google.bigtable.admin.v2.Cluster.Builder getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateCluster operation.
+     * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Cluster, + com.google.bigtable.admin.v2.Cluster.Builder, + com.google.bigtable.admin.v2.ClusterOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateClusterMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateClusterMetadata) + private static final com.google.bigtable.admin.v2.UpdateClusterMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateClusterMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateClusterMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateClusterMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateClusterMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java new file mode 100644 index 000000000000..c78882a254b6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateClusterMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateClusterMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.Cluster getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateCluster operation.
+   * 
+ * + * .google.bigtable.admin.v2.Cluster original_request = 1; + */ + com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java new file mode 100644 index 000000000000..f20fd29125a1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java @@ -0,0 +1,1261 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by UpdateInstance.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateInstanceMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateInstanceMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateInstanceMetadata) + UpdateInstanceMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateInstanceMetadata"); + } + + // Use UpdateInstanceMetadata.newBuilder() to construct. + private UpdateInstanceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateInstanceMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateInstanceMetadata.class, + com.google.bigtable.admin.v2.UpdateInstanceMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.PartialUpdateInstanceRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int FINISH_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp finishTime_; + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + @java.lang.Override + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFinishTime() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFinishTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); + } + size += getUnknownFields().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.admin.v2.UpdateInstanceMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateInstanceMetadata other = + (com.google.bigtable.admin.v2.UpdateInstanceMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasFinishTime() != other.hasFinishTime()) return false; + if (hasFinishTime()) { + if (!getFinishTime().equals(other.getFinishTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasFinishTime()) { + hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFinishTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata 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.admin.v2.UpdateInstanceMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata 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.admin.v2.UpdateInstanceMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateInstanceMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by UpdateInstance.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateInstanceMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateInstanceMetadata) + com.google.bigtable.admin.v2.UpdateInstanceMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateInstanceMetadata.class, + com.google.bigtable.admin.v2.UpdateInstanceMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateInstanceMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateInstanceMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateInstanceMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateInstanceMetadata build() { + com.google.bigtable.admin.v2.UpdateInstanceMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateInstanceMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateInstanceMetadata result = + new com.google.bigtable.admin.v2.UpdateInstanceMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateInstanceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateInstanceMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateInstanceMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateInstanceMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateInstanceMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasFinishTime()) { + mergeFinishTime(other.getFinishTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.PartialUpdateInstanceRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateInstance operation.
+     * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder, + com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + + /** + * + * + *
+     * The time at which the original request was received.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.protobuf.Timestamp finishTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + finishTimeBuilder_; + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + public boolean hasFinishTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + public com.google.protobuf.Timestamp getFinishTime() { + if (finishTimeBuilder_ == null) { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } else { + return finishTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finishTime_ = value; + } else { + finishTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (finishTimeBuilder_ == null) { + finishTime_ = builderForValue.build(); + } else { + finishTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { + if (finishTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); + } else { + finishTime_ = value; + } + } else { + finishTimeBuilder_.mergeFrom(value); + } + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public Builder clearFinishTime() { + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); + finishTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFinishTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { + if (finishTimeBuilder_ != null) { + return finishTimeBuilder_.getMessageOrBuilder(); + } else { + return finishTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : finishTime_; + } + } + + /** + * + * + *
+     * The time at which the operation failed or was completed successfully.
+     * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + return finishTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateInstanceMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateInstanceMetadata) + private static final com.google.bigtable.admin.v2.UpdateInstanceMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateInstanceMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateInstanceMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateInstanceMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java new file mode 100644 index 000000000000..bad74afac7f0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateInstanceMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateInstanceMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateInstance operation.
+   * 
+ * + * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; + */ + com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + + /** + * + * + *
+   * The time at which the original request was received.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return Whether the finishTime field is set. + */ + boolean hasFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + * + * @return The finishTime. + */ + com.google.protobuf.Timestamp getFinishTime(); + + /** + * + * + *
+   * The time at which the operation failed or was completed successfully.
+   * 
+ * + * .google.protobuf.Timestamp finish_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadata.java new file mode 100644 index 000000000000..39177747558d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadata.java @@ -0,0 +1,1263 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by UpdateLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateLogicalViewMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateLogicalViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateLogicalViewMetadata) + UpdateLogicalViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateLogicalViewMetadata"); + } + + // Use UpdateLogicalViewMetadata.newBuilder() to construct. + private UpdateLogicalViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateLogicalViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.class, + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.UpdateLogicalViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.UpdateLogicalViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata other = + (com.google.bigtable.admin.v2.UpdateLogicalViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata 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.admin.v2.UpdateLogicalViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata 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.admin.v2.UpdateLogicalViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateLogicalViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by UpdateLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateLogicalViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateLogicalViewMetadata) + com.google.bigtable.admin.v2.UpdateLogicalViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.class, + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewMetadata build() { + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateLogicalViewMetadata result = + new com.google.bigtable.admin.v2.UpdateLogicalViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateLogicalViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateLogicalViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateLogicalViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateLogicalViewMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateLogicalViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.UpdateLogicalViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public Builder setOriginalRequest(com.google.bigtable.admin.v2.UpdateLogicalViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateLogicalView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateLogicalViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateLogicalViewMetadata) + private static final com.google.bigtable.admin.v2.UpdateLogicalViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateLogicalViewMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateLogicalViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateLogicalViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadataOrBuilder.java new file mode 100644 index 000000000000..fa959e16ccea --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateLogicalViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateLogicalViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.UpdateLogicalViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateLogicalView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateLogicalViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequest.java new file mode 100644 index 000000000000..1c5587f23122 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequest.java @@ -0,0 +1,1062 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.UpdateLogicalView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateLogicalViewRequest} + */ +@com.google.protobuf.Generated +public final class UpdateLogicalViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateLogicalViewRequest) + UpdateLogicalViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateLogicalViewRequest"); + } + + // Use UpdateLogicalViewRequest.newBuilder() to construct. + private UpdateLogicalViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateLogicalViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.class, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder.class); + } + + private int bitField0_; + public static final int LOGICAL_VIEW_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.LogicalView logicalView_; + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + @java.lang.Override + public boolean hasLogicalView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalView getLogicalView() { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder() { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getLogicalView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLogicalView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.UpdateLogicalViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateLogicalViewRequest other = + (com.google.bigtable.admin.v2.UpdateLogicalViewRequest) obj; + + if (hasLogicalView() != other.hasLogicalView()) return false; + if (hasLogicalView()) { + if (!getLogicalView().equals(other.getLogicalView())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLogicalView()) { + hash = (37 * hash) + LOGICAL_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getLogicalView().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest 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.admin.v2.UpdateLogicalViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest 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.admin.v2.UpdateLogicalViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateLogicalViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.UpdateLogicalView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateLogicalViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateLogicalViewRequest) + com.google.bigtable.admin.v2.UpdateLogicalViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.class, + com.google.bigtable.admin.v2.UpdateLogicalViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateLogicalViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLogicalViewFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logicalView_ = null; + if (logicalViewBuilder_ != null) { + logicalViewBuilder_.dispose(); + logicalViewBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateLogicalViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest build() { + com.google.bigtable.admin.v2.UpdateLogicalViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateLogicalViewRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateLogicalViewRequest result = + new com.google.bigtable.admin.v2.UpdateLogicalViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateLogicalViewRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logicalView_ = + logicalViewBuilder_ == null ? logicalView_ : logicalViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateLogicalViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateLogicalViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateLogicalViewRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateLogicalViewRequest.getDefaultInstance()) + return this; + if (other.hasLogicalView()) { + mergeLogicalView(other.getLogicalView()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetLogicalViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.LogicalView logicalView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + logicalViewBuilder_; + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + public boolean hasLogicalView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + public com.google.bigtable.admin.v2.LogicalView getLogicalView() { + if (logicalViewBuilder_ == null) { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } else { + return logicalViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLogicalView(com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + logicalView_ = value; + } else { + logicalViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLogicalView( + com.google.bigtable.admin.v2.LogicalView.Builder builderForValue) { + if (logicalViewBuilder_ == null) { + logicalView_ = builderForValue.build(); + } else { + logicalViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeLogicalView(com.google.bigtable.admin.v2.LogicalView value) { + if (logicalViewBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && logicalView_ != null + && logicalView_ != com.google.bigtable.admin.v2.LogicalView.getDefaultInstance()) { + getLogicalViewBuilder().mergeFrom(value); + } else { + logicalView_ = value; + } + } else { + logicalViewBuilder_.mergeFrom(value); + } + if (logicalView_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLogicalView() { + bitField0_ = (bitField0_ & ~0x00000001); + logicalView_ = null; + if (logicalViewBuilder_ != null) { + logicalViewBuilder_.dispose(); + logicalViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.LogicalView.Builder getLogicalViewBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetLogicalViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder() { + if (logicalViewBuilder_ != null) { + return logicalViewBuilder_.getMessageOrBuilder(); + } else { + return logicalView_ == null + ? com.google.bigtable.admin.v2.LogicalView.getDefaultInstance() + : logicalView_; + } + } + + /** + * + * + *
+     * Required. The logical view to update.
+     *
+     * The logical view's `name` field is used to identify the view to update.
+     * Format:
+     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder> + internalGetLogicalViewFieldBuilder() { + if (logicalViewBuilder_ == null) { + logicalViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.LogicalView, + com.google.bigtable.admin.v2.LogicalView.Builder, + com.google.bigtable.admin.v2.LogicalViewOrBuilder>( + getLogicalView(), getParentForChildren(), isClean()); + logicalView_ = null; + } + return logicalViewBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateLogicalViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateLogicalViewRequest) + private static final com.google.bigtable.admin.v2.UpdateLogicalViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateLogicalViewRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateLogicalViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateLogicalViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateLogicalViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequestOrBuilder.java new file mode 100644 index 000000000000..32369b623d3d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateLogicalViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateLogicalViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the logicalView field is set. + */ + boolean hasLogicalView(); + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The logicalView. + */ + com.google.bigtable.admin.v2.LogicalView getLogicalView(); + + /** + * + * + *
+   * Required. The logical view to update.
+   *
+   * The logical view's `name` field is used to identify the view to update.
+   * Format:
+   * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.LogicalView logical_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.LogicalViewOrBuilder getLogicalViewOrBuilder(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadata.java new file mode 100644 index 000000000000..ed4e1c575625 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadata.java @@ -0,0 +1,1265 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by UpdateMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateMaterializedViewMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateMaterializedViewMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + UpdateMaterializedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateMaterializedViewMetadata"); + } + + // Use UpdateMaterializedViewMetadata.newBuilder() to construct. + private UpdateMaterializedViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateMaterializedViewMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.class, + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.Builder.class); + } + + private int bitField0_; + public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.UpdateMaterializedViewRequest originalRequest_; + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + @java.lang.Override + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest getOriginalRequest() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.UpdateMaterializedViewMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata other = + (com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata) obj; + + if (hasOriginalRequest() != other.hasOriginalRequest()) return false; + if (hasOriginalRequest()) { + if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOriginalRequest()) { + hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOriginalRequest().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata 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.admin.v2.UpdateMaterializedViewMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata 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.admin.v2.UpdateMaterializedViewMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateMaterializedViewMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by UpdateMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateMaterializedViewMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.class, + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata build() { + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata result = + new com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata.getDefaultInstance()) + return this; + if (other.hasOriginalRequest()) { + mergeOriginalRequest(other.getOriginalRequest()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.UpdateMaterializedViewRequest originalRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder> + originalRequestBuilder_; + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + public boolean hasOriginalRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest getOriginalRequest() { + if (originalRequestBuilder_ == null) { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } else { + return originalRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + originalRequest_ = value; + } else { + originalRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public Builder setOriginalRequest( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder builderForValue) { + if (originalRequestBuilder_ == null) { + originalRequest_ = builderForValue.build(); + } else { + originalRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public Builder mergeOriginalRequest( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest value) { + if (originalRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.UpdateMaterializedViewRequest + .getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); + } else { + originalRequest_ = value; + } + } else { + originalRequestBuilder_.mergeFrom(value); + } + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public Builder clearOriginalRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); + originalRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder + getOriginalRequestOrBuilder() { + if (originalRequestBuilder_ != null) { + return originalRequestBuilder_.getMessageOrBuilder(); + } else { + return originalRequest_ == null + ? com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance() + : originalRequest_; + } + } + + /** + * + * + *
+     * The request that prompted the initiation of this UpdateMaterializedView
+     * operation.
+     * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder> + internalGetOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder>( + getOriginalRequest(), getParentForChildren(), isClean()); + originalRequest_ = null; + } + return originalRequestBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + private static final com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateMaterializedViewMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateMaterializedViewMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadataOrBuilder.java new file mode 100644 index 000000000000..efa2fcbd5100 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadataOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateMaterializedViewMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateMaterializedViewMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return Whether the originalRequest field is set. + */ + boolean hasOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + * + * @return The originalRequest. + */ + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest getOriginalRequest(); + + /** + * + * + *
+   * The request that prompted the initiation of this UpdateMaterializedView
+   * operation.
+   * 
+ * + * .google.bigtable.admin.v2.UpdateMaterializedViewRequest original_request = 1; + */ + com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder getOriginalRequestOrBuilder(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequest.java new file mode 100644 index 000000000000..4b779d8fc5d5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequest.java @@ -0,0 +1,1063 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Request message for BigtableInstanceAdmin.UpdateMaterializedView.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class UpdateMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateMaterializedViewRequest) + UpdateMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateMaterializedViewRequest"); + } + + // Use UpdateMaterializedViewRequest.newBuilder() to construct. + private UpdateMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateMaterializedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.class, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder.class); + } + + private int bitField0_; + public static final int MATERIALIZED_VIEW_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.MaterializedView materializedView_; + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + @java.lang.Override + public boolean hasMaterializedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView() { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder() { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMaterializedView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMaterializedView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().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.admin.v2.UpdateMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest other = + (com.google.bigtable.admin.v2.UpdateMaterializedViewRequest) obj; + + if (hasMaterializedView() != other.hasMaterializedView()) return false; + if (hasMaterializedView()) { + if (!getMaterializedView().equals(other.getMaterializedView())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMaterializedView()) { + hash = (37 * hash) + MATERIALIZED_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedView().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest 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.admin.v2.UpdateMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest 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.admin.v2.UpdateMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateMaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableInstanceAdmin.UpdateMaterializedView.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateMaterializedViewRequest) + com.google.bigtable.admin.v2.UpdateMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.class, + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMaterializedViewFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + materializedView_ = null; + if (materializedViewBuilder_ != null) { + materializedViewBuilder_.dispose(); + materializedViewBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_UpdateMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest build() { + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateMaterializedViewRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateMaterializedViewRequest result = + new com.google.bigtable.admin.v2.UpdateMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.materializedView_ = + materializedViewBuilder_ == null ? materializedView_ : materializedViewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateMaterializedViewRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateMaterializedViewRequest.getDefaultInstance()) + return this; + if (other.hasMaterializedView()) { + mergeMaterializedView(other.getMaterializedView()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetMaterializedViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.MaterializedView materializedView_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + materializedViewBuilder_; + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + public boolean hasMaterializedView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + public com.google.bigtable.admin.v2.MaterializedView getMaterializedView() { + if (materializedViewBuilder_ == null) { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } else { + return materializedViewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaterializedView(com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + materializedView_ = value; + } else { + materializedViewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMaterializedView( + com.google.bigtable.admin.v2.MaterializedView.Builder builderForValue) { + if (materializedViewBuilder_ == null) { + materializedView_ = builderForValue.build(); + } else { + materializedViewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMaterializedView(com.google.bigtable.admin.v2.MaterializedView value) { + if (materializedViewBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && materializedView_ != null + && materializedView_ + != com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance()) { + getMaterializedViewBuilder().mergeFrom(value); + } else { + materializedView_ = value; + } + } else { + materializedViewBuilder_.mergeFrom(value); + } + if (materializedView_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMaterializedView() { + bitField0_ = (bitField0_ & ~0x00000001); + materializedView_ = null; + if (materializedViewBuilder_ != null) { + materializedViewBuilder_.dispose(); + materializedViewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.MaterializedView.Builder getMaterializedViewBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMaterializedViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder() { + if (materializedViewBuilder_ != null) { + return materializedViewBuilder_.getMessageOrBuilder(); + } else { + return materializedView_ == null + ? com.google.bigtable.admin.v2.MaterializedView.getDefaultInstance() + : materializedView_; + } + } + + /** + * + * + *
+     * Required. The materialized view to update.
+     *
+     * The materialized view's `name` field is used to identify the view to
+     * update. Format:
+     * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+     * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder> + internalGetMaterializedViewFieldBuilder() { + if (materializedViewBuilder_ == null) { + materializedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.MaterializedView, + com.google.bigtable.admin.v2.MaterializedView.Builder, + com.google.bigtable.admin.v2.MaterializedViewOrBuilder>( + getMaterializedView(), getParentForChildren(), isClean()); + materializedView_ = null; + } + return materializedViewBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateMaterializedViewRequest) + private static final com.google.bigtable.admin.v2.UpdateMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateMaterializedViewRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..624d0b715560 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the materializedView field is set. + */ + boolean hasMaterializedView(); + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The materializedView. + */ + com.google.bigtable.admin.v2.MaterializedView getMaterializedView(); + + /** + * + * + *
+   * Required. The materialized view to update.
+   *
+   * The materialized view's `name` field is used to identify the view to
+   * update. Format:
+   * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+   * 
+ * + * + * .google.bigtable.admin.v2.MaterializedView materialized_view = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.MaterializedViewOrBuilder getMaterializedViewOrBuilder(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadata.java new file mode 100644 index 000000000000..38250e4c02cf --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadata.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The metadata for the Operation returned by
+ * [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateSchemaBundleMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateSchemaBundleMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + UpdateSchemaBundleMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateSchemaBundleMetadata"); + } + + // Use UpdateSchemaBundleMetadata.newBuilder() to construct. + private UpdateSchemaBundleMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateSchemaBundleMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.class, + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @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 START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.UpdateSchemaBundleMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata other = + (com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata 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.admin.v2.UpdateSchemaBundleMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata 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.admin.v2.UpdateSchemaBundleMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateSchemaBundleMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The metadata for the Operation returned by
+   * [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateSchemaBundleMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.class, + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata build() { + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata result = + new com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique name identifying this schema bundle.
+     * Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + private static final com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSchemaBundleMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateSchemaBundleMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadataOrBuilder.java new file mode 100644 index 000000000000..bf784463621d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadataOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateSchemaBundleMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateSchemaBundleMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique name identifying this schema bundle.
+   * Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequest.java new file mode 100644 index 000000000000..20bb973b6adb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequest.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateSchemaBundleRequest} + */ +@com.google.protobuf.Generated +public final class UpdateSchemaBundleRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateSchemaBundleRequest) + UpdateSchemaBundleRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateSchemaBundleRequest"); + } + + // Use UpdateSchemaBundleRequest.newBuilder() to construct. + private UpdateSchemaBundleRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateSchemaBundleRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.class, + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.Builder.class); + } + + private int bitField0_; + public static final int SCHEMA_BUNDLE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.SchemaBundle schemaBundle_; + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + @java.lang.Override + public boolean hasSchemaBundle() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle() { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder() { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * Optional. If set, ignore the safety checks when updating the Schema Bundle.
+   * The safety checks are:
+   * - The new Schema Bundle is backwards compatible with the existing Schema
+   * Bundle.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSchemaBundle()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSchemaBundle()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.UpdateSchemaBundleRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest other = + (com.google.bigtable.admin.v2.UpdateSchemaBundleRequest) obj; + + if (hasSchemaBundle() != other.hasSchemaBundle()) return false; + if (hasSchemaBundle()) { + if (!getSchemaBundle().equals(other.getSchemaBundle())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSchemaBundle()) { + hash = (37 * hash) + SCHEMA_BUNDLE_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundle().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest 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.admin.v2.UpdateSchemaBundleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest 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.admin.v2.UpdateSchemaBundleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateSchemaBundleRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateSchemaBundleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateSchemaBundleRequest) + com.google.bigtable.admin.v2.UpdateSchemaBundleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.class, + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSchemaBundleFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaBundle_ = null; + if (schemaBundleBuilder_ != null) { + schemaBundleBuilder_.dispose(); + schemaBundleBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateSchemaBundleRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleRequest build() { + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateSchemaBundleRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateSchemaBundleRequest result = + new com.google.bigtable.admin.v2.UpdateSchemaBundleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateSchemaBundleRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaBundle_ = + schemaBundleBuilder_ == null ? schemaBundle_ : schemaBundleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateSchemaBundleRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateSchemaBundleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateSchemaBundleRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateSchemaBundleRequest.getDefaultInstance()) + return this; + if (other.hasSchemaBundle()) { + mergeSchemaBundle(other.getSchemaBundle()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetSchemaBundleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.SchemaBundle schemaBundle_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + schemaBundleBuilder_; + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + public boolean hasSchemaBundle() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + public com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle() { + if (schemaBundleBuilder_ == null) { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } else { + return schemaBundleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchemaBundle(com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundle_ = value; + } else { + schemaBundleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchemaBundle( + com.google.bigtable.admin.v2.SchemaBundle.Builder builderForValue) { + if (schemaBundleBuilder_ == null) { + schemaBundle_ = builderForValue.build(); + } else { + schemaBundleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSchemaBundle(com.google.bigtable.admin.v2.SchemaBundle value) { + if (schemaBundleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && schemaBundle_ != null + && schemaBundle_ != com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance()) { + getSchemaBundleBuilder().mergeFrom(value); + } else { + schemaBundle_ = value; + } + } else { + schemaBundleBuilder_.mergeFrom(value); + } + if (schemaBundle_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSchemaBundle() { + bitField0_ = (bitField0_ & ~0x00000001); + schemaBundle_ = null; + if (schemaBundleBuilder_ != null) { + schemaBundleBuilder_.dispose(); + schemaBundleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.SchemaBundle.Builder getSchemaBundleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSchemaBundleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder() { + if (schemaBundleBuilder_ != null) { + return schemaBundleBuilder_.getMessageOrBuilder(); + } else { + return schemaBundle_ == null + ? com.google.bigtable.admin.v2.SchemaBundle.getDefaultInstance() + : schemaBundle_; + } + } + + /** + * + * + *
+     * Required. The schema bundle to update.
+     *
+     * The schema bundle's `name` field is used to identify the schema bundle to
+     * update. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+     * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder> + internalGetSchemaBundleFieldBuilder() { + if (schemaBundleBuilder_ == null) { + schemaBundleBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.SchemaBundle, + com.google.bigtable.admin.v2.SchemaBundle.Builder, + com.google.bigtable.admin.v2.SchemaBundleOrBuilder>( + getSchemaBundle(), getParentForChildren(), isClean()); + schemaBundle_ = null; + } + return schemaBundleBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. The list of fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * Optional. If set, ignore the safety checks when updating the Schema Bundle.
+     * The safety checks are:
+     * - The new Schema Bundle is backwards compatible with the existing Schema
+     * Bundle.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * Optional. If set, ignore the safety checks when updating the Schema Bundle.
+     * The safety checks are:
+     * - The new Schema Bundle is backwards compatible with the existing Schema
+     * Bundle.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, ignore the safety checks when updating the Schema Bundle.
+     * The safety checks are:
+     * - The new Schema Bundle is backwards compatible with the existing Schema
+     * Bundle.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateSchemaBundleRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateSchemaBundleRequest) + private static final com.google.bigtable.admin.v2.UpdateSchemaBundleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateSchemaBundleRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateSchemaBundleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSchemaBundleRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateSchemaBundleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequestOrBuilder.java new file mode 100644 index 000000000000..80e8ed22dfd8 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequestOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateSchemaBundleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateSchemaBundleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schemaBundle field is set. + */ + boolean hasSchemaBundle(); + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schemaBundle. + */ + com.google.bigtable.admin.v2.SchemaBundle getSchemaBundle(); + + /** + * + * + *
+   * Required. The schema bundle to update.
+   *
+   * The schema bundle's `name` field is used to identify the schema bundle to
+   * update. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
+   * 
+ * + * + * .google.bigtable.admin.v2.SchemaBundle schema_bundle = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.SchemaBundleOrBuilder getSchemaBundleOrBuilder(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. The list of fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Optional. If set, ignore the safety checks when updating the Schema Bundle.
+   * The safety checks are:
+   * - The new Schema Bundle is backwards compatible with the existing Schema
+   * Bundle.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java new file mode 100644 index 000000000000..17a344f2b85e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Metadata type for the operation returned by
+ * [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateTableMetadata} + */ +@com.google.protobuf.Generated +public final class UpdateTableMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateTableMetadata) + UpdateTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateTableMetadata"); + } + + // Use UpdateTableMetadata.newBuilder() to construct. + private UpdateTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateTableMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateTableMetadata.class, + com.google.bigtable.admin.v2.UpdateTableMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the table being updated.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The name of the table being updated.
+   * 
+ * + * string name = 1; + * + * @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 START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + size += getUnknownFields().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.admin.v2.UpdateTableMetadata)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateTableMetadata other = + (com.google.bigtable.admin.v2.UpdateTableMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata 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.admin.v2.UpdateTableMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata 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.admin.v2.UpdateTableMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateTableMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata type for the operation returned by
+   * [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateTableMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateTableMetadata) + com.google.bigtable.admin.v2.UpdateTableMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateTableMetadata.class, + com.google.bigtable.admin.v2.UpdateTableMetadata.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateTableMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableMetadata getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateTableMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableMetadata build() { + com.google.bigtable.admin.v2.UpdateTableMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableMetadata buildPartial() { + com.google.bigtable.admin.v2.UpdateTableMetadata result = + new com.google.bigtable.admin.v2.UpdateTableMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateTableMetadata) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateTableMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateTableMetadata other) { + if (other == com.google.bigtable.admin.v2.UpdateTableMetadata.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the table being updated.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the table being updated.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the table being updated.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table being updated.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the table being updated.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The time at which this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If set, the time at which this operation finished or was canceled.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateTableMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateTableMetadata) + private static final com.google.bigtable.admin.v2.UpdateTableMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateTableMetadata(); + } + + public static com.google.bigtable.admin.v2.UpdateTableMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTableMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateTableMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java new file mode 100644 index 000000000000..4c18c689af59 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateTableMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateTableMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the table being updated.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the table being updated.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The time at which this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If set, the time at which this operation finished or was canceled.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java new file mode 100644 index 000000000000..64d1b7229064 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java @@ -0,0 +1,1245 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * The request for
+ * [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateTableRequest} + */ +@com.google.protobuf.Generated +public final class UpdateTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateTableRequest) + UpdateTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateTableRequest"); + } + + // Use UpdateTableRequest.newBuilder() to construct. + private UpdateTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateTableRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateTableRequest.class, + com.google.bigtable.admin.v2.UpdateTableRequest.Builder.class); + } + + private int bitField0_; + public static final int TABLE_FIELD_NUMBER = 1; + private com.google.bigtable.admin.v2.Table table_; + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + @java.lang.Override + public boolean hasTable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table getTable() { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; + private boolean ignoreWarnings_ = false; + + /** + * + * + *
+   * Optional. If true, ignore safety checks when updating the table.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTable()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTable()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().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.admin.v2.UpdateTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.UpdateTableRequest other = + (com.google.bigtable.admin.v2.UpdateTableRequest) obj; + + if (hasTable() != other.hasTable()) return false; + if (hasTable()) { + if (!getTable().equals(other.getTable())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTable()) { + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest 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.admin.v2.UpdateTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest 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.admin.v2.UpdateTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.admin.v2.UpdateTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request for
+   * [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.UpdateTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.UpdateTableRequest) + com.google.bigtable.admin.v2.UpdateTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.UpdateTableRequest.class, + com.google.bigtable.admin.v2.UpdateTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.UpdateTableRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTableFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); + tableBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + ignoreWarnings_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.BigtableTableAdminProto + .internal_static_google_bigtable_admin_v2_UpdateTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableRequest getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.UpdateTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableRequest build() { + com.google.bigtable.admin.v2.UpdateTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.UpdateTableRequest buildPartial() { + com.google.bigtable.admin.v2.UpdateTableRequest result = + new com.google.bigtable.admin.v2.UpdateTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.UpdateTableRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.table_ = tableBuilder_ == null ? table_ : tableBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.UpdateTableRequest) { + return mergeFrom((com.google.bigtable.admin.v2.UpdateTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateTableRequest other) { + if (other == com.google.bigtable.admin.v2.UpdateTableRequest.getDefaultInstance()) + return this; + if (other.hasTable()) { + mergeTable(other.getTable()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetTableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + ignoreWarnings_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.admin.v2.Table table_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + tableBuilder_; + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + public boolean hasTable() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + public com.google.bigtable.admin.v2.Table getTable() { + if (tableBuilder_ == null) { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } else { + return tableBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTable(com.google.bigtable.admin.v2.Table value) { + if (tableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + } else { + tableBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTable(com.google.bigtable.admin.v2.Table.Builder builderForValue) { + if (tableBuilder_ == null) { + table_ = builderForValue.build(); + } else { + tableBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTable(com.google.bigtable.admin.v2.Table value) { + if (tableBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && table_ != null + && table_ != com.google.bigtable.admin.v2.Table.getDefaultInstance()) { + getTableBuilder().mergeFrom(value); + } else { + table_ = value; + } + } else { + tableBuilder_.mergeFrom(value); + } + if (table_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTable() { + bitField0_ = (bitField0_ & ~0x00000001); + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); + tableBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.Table.Builder getTableBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetTableFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { + if (tableBuilder_ != null) { + return tableBuilder_.getMessageOrBuilder(); + } else { + return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; + } + } + + /** + * + * + *
+     * Required. The table to update.
+     * The table's `name` field is used to identify the table to update.
+     * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + internalGetTableFieldBuilder() { + if (tableBuilder_ == null) { + tableBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder>( + getTable(), getParentForChildren(), isClean()); + table_ = null; + } + return tableBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. The list of fields to update.
+     * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+     * field should be updated. This mask is relative to the `table` field, not to
+     * the request message. The wildcard (*) path is currently not supported.
+     * Currently UpdateTable is only supported for the following fields:
+     *
+     * * `change_stream_config`
+     * * `change_stream_config.retention_period`
+     * * `deletion_protection`
+     * * `row_key_schema`
+     *
+     * If `column_families` is set in `update_mask`, it will return an
+     * UNIMPLEMENTED error.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean ignoreWarnings_; + + /** + * + * + *
+     * Optional. If true, ignore safety checks when updating the table.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + @java.lang.Override + public boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + + /** + * + * + *
+     * Optional. If true, ignore safety checks when updating the table.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If true, ignore safety checks when updating the table.
+     * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.UpdateTableRequest) + private static final com.google.bigtable.admin.v2.UpdateTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.UpdateTableRequest(); + } + + public static com.google.bigtable.admin.v2.UpdateTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.admin.v2.UpdateTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java new file mode 100644 index 000000000000..c5faaf7d2b18 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.admin.v2; + +@com.google.protobuf.Generated +public interface UpdateTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.UpdateTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the table field is set. + */ + boolean hasTable(); + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The table. + */ + com.google.bigtable.admin.v2.Table getTable(); + + /** + * + * + *
+   * Required. The table to update.
+   * The table's `name` field is used to identify the table to update.
+   * 
+ * + * .google.bigtable.admin.v2.Table table = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. The list of fields to update.
+   * A mask specifying which fields (e.g. `change_stream_config`) in the `table`
+   * field should be updated. This mask is relative to the `table` field, not to
+   * the request message. The wildcard (*) path is currently not supported.
+   * Currently UpdateTable is only supported for the following fields:
+   *
+   * * `change_stream_config`
+   * * `change_stream_config.retention_period`
+   * * `deletion_protection`
+   * * `row_key_schema`
+   *
+   * If `column_families` is set in `update_mask`, it will return an
+   * UNIMPLEMENTED error.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Optional. If true, ignore safety checks when updating the table.
+   * 
+ * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The ignoreWarnings. + */ + boolean getIgnoreWarnings(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto new file mode 100644 index 000000000000..a800f990da0b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto @@ -0,0 +1,1137 @@ +// Copyright 2025 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/instance.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableInstanceAdminProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Service for creating, configuring, and deleting Cloud Bigtable Instances and +// Clusters. Provides access to the Instance and Cluster schemas only, not the +// tables' metadata or data stored in those tables. +service BigtableInstanceAdmin { + option (google.api.default_host) = "bigtableadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.admin," + "https://www.googleapis.com/auth/bigtable.admin.cluster," + "https://www.googleapis.com/auth/bigtable.admin.instance," + "https://www.googleapis.com/auth/cloud-bigtable.admin," + "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Create an instance within a project. + // + // Note that exactly one of Cluster.serve_nodes and + // Cluster.cluster_config.cluster_autoscaling_config can be set. If + // serve_nodes is set to non-zero, then the cluster is manually scaled. If + // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + // enabled. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/instances" + body: "*" + }; + option (google.api.method_signature) = + "parent,instance_id,instance,clusters"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "CreateInstanceMetadata" + }; + } + + // Gets information about an instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about instances in a project. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an instance within a project. This method updates only the display + // name and type for an Instance. To update other Instance properties, such as + // labels, use PartialUpdateInstance. + rpc UpdateInstance(Instance) returns (Instance) { + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*}" + body: "*" + }; + } + + // Partially updates an instance within a project. This method can modify all + // fields of an Instance and is the preferred way to update an Instance. + rpc PartialUpdateInstance(PartialUpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{instance.name=projects/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "UpdateInstanceMetadata" + }; + } + + // Delete an instance from a project. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a cluster within an instance. + // + // Note that exactly one of Cluster.serve_nodes and + // Cluster.cluster_config.cluster_autoscaling_config can be set. If + // serve_nodes is set to non-zero, then the cluster is manually scaled. If + // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is + // enabled. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster_id,cluster"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "CreateClusterMetadata" + }; + } + + // Gets information about a cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about clusters in an instance. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a cluster within an instance. + // + // Note that UpdateCluster does not support updating + // cluster_config.cluster_autoscaling_config. In order to update it, you + // must use PartialUpdateCluster. + rpc UpdateCluster(Cluster) returns (google.longrunning.Operation) { + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*/clusters/*}" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "UpdateClusterMetadata" + }; + } + + // Partially updates a cluster within a project. This method is the preferred + // way to update a Cluster. + // + // To enable and update autoscaling, set + // cluster_config.cluster_autoscaling_config. When autoscaling is enabled, + // serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it + // are ignored. Note that an update cannot simultaneously set serve_nodes to + // non-zero and cluster_config.cluster_autoscaling_config to non-empty, and + // also specify both in the update_mask. + // + // To disable autoscaling, clear cluster_config.cluster_autoscaling_config, + // and explicitly set a serve_node count via the update_mask. + rpc PartialUpdateCluster(PartialUpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{cluster.name=projects/*/instances/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "PartialUpdateClusterMetadata" + }; + } + + // Deletes a cluster from an instance. + rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an app profile within an instance. + rpc CreateAppProfile(CreateAppProfileRequest) returns (AppProfile) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/appProfiles" + body: "app_profile" + }; + option (google.api.method_signature) = "parent,app_profile_id,app_profile"; + } + + // Gets information about an app profile. + rpc GetAppProfile(GetAppProfileRequest) returns (AppProfile) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about app profiles in an instance. + rpc ListAppProfiles(ListAppProfilesRequest) + returns (ListAppProfilesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/appProfiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an app profile within an instance. + rpc UpdateAppProfile(UpdateAppProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" + body: "app_profile" + }; + option (google.api.method_signature) = "app_profile,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AppProfile" + metadata_type: "UpdateAppProfileMetadata" + }; + } + + // Deletes an app profile from an instance. + rpc DeleteAppProfile(DeleteAppProfileRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,ignore_warnings"; + } + + // Gets the access control policy for an instance resource. Returns an empty + // policy if an instance exists but does not have a policy set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on an instance resource. Replaces any + // existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that the caller has on the specified instance resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Lists hot tablets in a cluster, within the time range provided. Hot + // tablets are ordered based on CPU usage. + rpc ListHotTablets(ListHotTabletsRequest) returns (ListHotTabletsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a logical view within an instance. + rpc CreateLogicalView(CreateLogicalViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/logicalViews" + body: "logical_view" + }; + option (google.api.method_signature) = + "parent,logical_view,logical_view_id"; + option (google.longrunning.operation_info) = { + response_type: "LogicalView" + metadata_type: "CreateLogicalViewMetadata" + }; + } + + // Gets information about a logical view. + rpc GetLogicalView(GetLogicalViewRequest) returns (LogicalView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/logicalViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about logical views in an instance. + rpc ListLogicalViews(ListLogicalViewsRequest) + returns (ListLogicalViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/logicalViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a logical view within an instance. + rpc UpdateLogicalView(UpdateLogicalViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{logical_view.name=projects/*/instances/*/logicalViews/*}" + body: "logical_view" + }; + option (google.api.method_signature) = "logical_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "LogicalView" + metadata_type: "UpdateLogicalViewMetadata" + }; + } + + // Deletes a logical view from an instance. + rpc DeleteLogicalView(DeleteLogicalViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/logicalViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a materialized view within an instance. + rpc CreateMaterializedView(CreateMaterializedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/materializedViews" + body: "materialized_view" + }; + option (google.api.method_signature) = + "parent,materialized_view,materialized_view_id"; + option (google.longrunning.operation_info) = { + response_type: "MaterializedView" + metadata_type: "CreateMaterializedViewMetadata" + }; + } + + // Gets information about a materialized view. + rpc GetMaterializedView(GetMaterializedViewRequest) + returns (MaterializedView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/materializedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about materialized views in an instance. + rpc ListMaterializedViews(ListMaterializedViewsRequest) + returns (ListMaterializedViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/materializedViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a materialized view within an instance. + rpc UpdateMaterializedView(UpdateMaterializedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{materialized_view.name=projects/*/instances/*/materializedViews/*}" + body: "materialized_view" + }; + option (google.api.method_signature) = "materialized_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MaterializedView" + metadata_type: "UpdateMaterializedViewMetadata" + }; + } + + // Deletes a materialized view from an instance. + rpc DeleteMaterializedView(DeleteMaterializedViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/materializedViews/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for BigtableInstanceAdmin.CreateInstance. +message CreateInstanceRequest { + // Required. The unique name of the project in which to create the new + // instance. Values are of the form `projects/{project}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ID to be used when referring to the new instance within its + // project, e.g., just `myinstance` rather than + // `projects/myproject/instances/myinstance`. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. + // Fields marked `OutputOnly` must be left blank. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The clusters to be created within the instance, mapped by desired + // cluster ID, e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + // Fields marked `OutputOnly` must be left blank. + map clusters = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.GetInstance. +message GetInstanceRequest { + // Required. The unique name of the requested instance. Values are of the form + // `projects/{project}/instances/{instance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListInstances. +message ListInstancesRequest { + // Required. The unique name of the project for which a list of instances is + // requested. Values are of the form `projects/{project}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // DEPRECATED: This field is unused and ignored. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListInstances. +message ListInstancesResponse { + // The list of requested instances. + repeated Instance instances = 1; + + // Locations from which Instance information could not be retrieved, + // due to an outage or some other transient condition. + // Instances whose Clusters are all in one of the failed locations + // may be missing from `instances`, and Instances with at least one + // Cluster in a failed location may only have partial information returned. + // Values are of the form `projects//locations/` + repeated string failed_locations = 2; + + // DEPRECATED: This field is unused and ignored. + string next_page_token = 3; +} + +// Request message for BigtableInstanceAdmin.PartialUpdateInstance. +message PartialUpdateInstanceRequest { + // Required. The Instance which will (partially) replace the current value. + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of Instance fields which should be replaced. + // Must be explicitly set. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.DeleteInstance. +message DeleteInstanceRequest { + // Required. The unique name of the instance to be deleted. + // Values are of the form `projects/{project}/instances/{instance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; +} + +// Request message for BigtableInstanceAdmin.CreateCluster. +message CreateClusterRequest { + // Required. The unique name of the instance in which to create the new + // cluster. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to be used when referring to the new cluster within its + // instance, e.g., just `mycluster` rather than + // `projects/myproject/instances/myinstance/clusters/mycluster`. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster to be created. + // Fields marked `OutputOnly` must be left blank. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.GetCluster. +message GetClusterRequest { + // Required. The unique name of the requested cluster. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListClusters. +message ListClustersRequest { + // Required. The unique name of the instance for which a list of clusters is + // requested. Values are of the form + // `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list + // Clusters for all Instances in a project, e.g., + // `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // DEPRECATED: This field is unused and ignored. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListClusters. +message ListClustersResponse { + // The list of requested clusters. + repeated Cluster clusters = 1; + + // Locations from which Cluster information could not be retrieved, + // due to an outage or some other transient condition. + // Clusters from these locations may be missing from `clusters`, + // or may only have partial information returned. + // Values are of the form `projects//locations/` + repeated string failed_locations = 2; + + // DEPRECATED: This field is unused and ignored. + string next_page_token = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteCluster. +message DeleteClusterRequest { + // Required. The unique name of the cluster to be deleted. Values are of the + // form `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; +} + +// The metadata for the Operation returned by CreateInstance. +message CreateInstanceMetadata { + // The request that prompted the initiation of this CreateInstance operation. + CreateInstanceRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by UpdateInstance. +message UpdateInstanceMetadata { + // The request that prompted the initiation of this UpdateInstance operation. + PartialUpdateInstanceRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by CreateCluster. +message CreateClusterMetadata { + // Progress info for copying a table's data to the new cluster. + message TableProgress { + enum State { + STATE_UNSPECIFIED = 0; + + // The table has not yet begun copying to the new cluster. + PENDING = 1; + + // The table is actively being copied to the new cluster. + COPYING = 2; + + // The table has been fully copied to the new cluster. + COMPLETED = 3; + + // The table was deleted before it finished copying to the new cluster. + // Note that tables deleted after completion will stay marked as + // COMPLETED, not CANCELLED. + CANCELLED = 4; + } + + // Estimate of the size of the table to be copied. + int64 estimated_size_bytes = 2; + + // Estimate of the number of bytes copied so far for this table. + // This will eventually reach 'estimated_size_bytes' unless the table copy + // is CANCELLED. + int64 estimated_copied_bytes = 3; + + State state = 4; + } + + // The request that prompted the initiation of this CreateCluster operation. + CreateClusterRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; + + // Keys: the full `name` of each table that existed in the instance when + // CreateCluster was first called, i.e. + // `projects//instances//tables/
`. Any table added + // to the instance by a later API call will be created in the new cluster by + // that API call, not this one. + // + // Values: information on how much of a table's data has been copied to the + // newly-created cluster so far. + map tables = 4; +} + +// The metadata for the Operation returned by UpdateCluster. +message UpdateClusterMetadata { + // The request that prompted the initiation of this UpdateCluster operation. + Cluster original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by PartialUpdateCluster. +message PartialUpdateClusterMetadata { + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 1; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 2; + + // The original request for PartialUpdateCluster. + PartialUpdateClusterRequest original_request = 3; +} + +// Request message for BigtableInstanceAdmin.PartialUpdateCluster. +message PartialUpdateClusterRequest { + // Required. The Cluster which contains the partial updates to be applied, + // subject to the update_mask. + Cluster cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of Cluster fields which should be replaced. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for BigtableInstanceAdmin.CreateAppProfile. +message CreateAppProfileRequest { + // Required. The unique name of the instance in which to create the new app + // profile. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to be used when referring to the new app profile within + // its instance, e.g., just `myprofile` rather than + // `projects/myproject/instances/myinstance/appProfiles/myprofile`. + string app_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The app profile to be created. + // Fields marked `OutputOnly` will be ignored. + AppProfile app_profile = 3 [(google.api.field_behavior) = REQUIRED]; + + // If true, ignore safety checks when creating the app profile. + bool ignore_warnings = 4; +} + +// Request message for BigtableInstanceAdmin.GetAppProfile. +message GetAppProfileRequest { + // Required. The unique name of the requested app profile. Values are of the + // form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AppProfile" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListAppProfiles. +message ListAppProfilesRequest { + // Required. The unique name of the instance for which a list of app profiles + // is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + // Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + // e.g., `projects/myproject/instances/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 3; + + // The value of `next_page_token` returned by a previous call. + string page_token = 2; +} + +// Response message for BigtableInstanceAdmin.ListAppProfiles. +message ListAppProfilesResponse { + // The list of requested app profiles. + repeated AppProfile app_profiles = 1; + + // Set if not all app profiles could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; + + // Locations from which AppProfile information could not be retrieved, + // due to an outage or some other transient condition. + // AppProfiles from these locations may be missing from `app_profiles`. + // Values are of the form `projects//locations/` + repeated string failed_locations = 3; +} + +// Request message for BigtableInstanceAdmin.UpdateAppProfile. +message UpdateAppProfileRequest { + // Required. The app profile which will (partially) replace the current value. + AppProfile app_profile = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The subset of app profile fields which should be replaced. + // If unset, all fields will be replaced. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If true, ignore safety checks when updating the app profile. + bool ignore_warnings = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteAppProfile. +message DeleteAppProfileRequest { + // Required. The unique name of the app profile to be deleted. Values are of + // the form + // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AppProfile" + } + ]; + + // Required. If true, ignore safety checks when deleting the app profile. + bool ignore_warnings = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by UpdateAppProfile. +message UpdateAppProfileMetadata {} + +// Request message for BigtableInstanceAdmin.ListHotTablets. +message ListHotTabletsRequest { + // Required. The cluster name to list hot tablets. + // Value is in the following form: + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // The start time to list hot tablets. The hot tablets in the response will + // have start times between the requested start time and end time. Start time + // defaults to Now if it is unset, and end time defaults to Now - 24 hours if + // it is unset. The start time should be less than the end time, and the + // maximum allowed time range between start time and end time is 48 hours. + // Start time and end time should have values between Now and Now - 14 days. + google.protobuf.Timestamp start_time = 2; + + // The end time to list hot tablets. + google.protobuf.Timestamp end_time = 3; + + // Maximum number of results per page. + // + // A page_size that is empty or zero lets the server choose the number of + // items to return. A page_size which is strictly positive will return at most + // that many items. A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls do not need a + // page_size field. If a page_size is set in subsequent calls, it must match + // the page_size given in the first request. + int32 page_size = 4; + + // The value of `next_page_token` returned by a previous call. + string page_token = 5; +} + +// Response message for BigtableInstanceAdmin.ListHotTablets. +message ListHotTabletsResponse { + // List of hot tablets in the tables of the requested cluster that fall + // within the requested time range. Hot tablets are ordered by node cpu usage + // percent. If there are multiple hot tablets that correspond to the same + // tablet within a 15-minute interval, only the hot tablet with the highest + // node cpu usage will be included in the response. + repeated HotTablet hot_tablets = 1; + + // Set if not all hot tablets could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.CreateLogicalView. +message CreateLogicalViewRequest { + // Required. The parent instance where this logical view will be created. + // Format: `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the logical view, which will become the final + // component of the logical view's resource name. + string logical_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical view to create. + LogicalView logical_view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateLogicalView. +message CreateLogicalViewMetadata { + // The request that prompted the initiation of this CreateLogicalView + // operation. + CreateLogicalViewRequest original_request = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.GetLogicalView. +message GetLogicalViewRequest { + // Required. The unique name of the requested logical view. Values are of the + // form `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListLogicalViews. +message ListLogicalViewsRequest { + // Required. The unique name of the instance for which the list of logical + // views is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; + + // Optional. The maximum number of logical views to return. The service may + // return fewer than this value + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListLogicalViews` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListLogicalViews` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BigtableInstanceAdmin.ListLogicalViews. +message ListLogicalViewsResponse { + // The list of requested logical views. + repeated LogicalView logical_views = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.UpdateLogicalView. +message UpdateLogicalViewRequest { + // Required. The logical view to update. + // + // The logical view's `name` field is used to identify the view to update. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + LogicalView logical_view = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by UpdateLogicalView. +message UpdateLogicalViewMetadata { + // The request that prompted the initiation of this UpdateLogicalView + // operation. + UpdateLogicalViewRequest original_request = 1; + + // The time at which this operation was started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteLogicalView. +message DeleteLogicalViewRequest { + // Required. The unique name of the logical view to be deleted. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/LogicalView" + } + ]; + + // Optional. The current etag of the logical view. + // If an etag is provided and does not match the current etag of the + // logical view, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BigtableInstanceAdmin.CreateMaterializedView. +message CreateMaterializedViewRequest { + // Required. The parent instance where this materialized view will be created. + // Format: `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the materialized view, which will become the + // final component of the materialized view's resource name. + string materialized_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The materialized view to create. + MaterializedView materialized_view = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateMaterializedView. +message CreateMaterializedViewMetadata { + // The request that prompted the initiation of this CreateMaterializedView + // operation. + CreateMaterializedViewRequest original_request = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.GetMaterializedView. +message GetMaterializedViewRequest { + // Required. The unique name of the requested materialized view. Values are of + // the form + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; +} + +// Request message for BigtableInstanceAdmin.ListMaterializedViews. +message ListMaterializedViewsRequest { + // Required. The unique name of the instance for which the list of + // materialized views is requested. Values are of the form + // `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // Optional. The maximum number of materialized views to return. The service + // may return fewer than this value + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListMaterializedViews` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMaterializedViews` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BigtableInstanceAdmin.ListMaterializedViews. +message ListMaterializedViewsResponse { + // The list of requested materialized views. + repeated MaterializedView materialized_views = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for BigtableInstanceAdmin.UpdateMaterializedView. +message UpdateMaterializedViewRequest { + // Required. The materialized view to update. + // + // The materialized view's `name` field is used to identify the view to + // update. Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + MaterializedView materialized_view = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by UpdateMaterializedView. +message UpdateMaterializedViewMetadata { + // The request that prompted the initiation of this UpdateMaterializedView + // operation. + UpdateMaterializedViewRequest original_request = 1; + + // The time at which this operation was started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for BigtableInstanceAdmin.DeleteMaterializedView. +message DeleteMaterializedViewRequest { + // Required. The unique name of the materialized view to be deleted. + // Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // Optional. The current etag of the materialized view. + // If an etag is provided and does not match the current etag of the + // materialized view, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto new file mode 100644 index 000000000000..6267fa90973b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto @@ -0,0 +1,1660 @@ +// Copyright 2025 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/common.proto"; +import "google/bigtable/admin/v2/table.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableTableAdminProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Service for creating, configuring, and deleting Cloud Bigtable tables. +// +// +// Provides access to the table schemas only, not the data stored within +// the tables. +service BigtableTableAdmin { + option (google.api.default_host) = "bigtableadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.admin," + "https://www.googleapis.com/auth/bigtable.admin.table," + "https://www.googleapis.com/auth/cloud-bigtable.admin," + "https://www.googleapis.com/auth/cloud-bigtable.admin.table," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Creates a new table in the specified instance. + // The table can be created with a full set of initial column families, + // specified in the request. + rpc CreateTable(CreateTableRequest) returns (Table) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables" + body: "*" + }; + option (google.api.method_signature) = "parent,table_id,table"; + } + + // Creates a new table from the specified snapshot. The target table must + // not exist. The snapshot and the table must be in the same instance. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" + body: "*" + }; + option (google.api.method_signature) = "parent,table_id,source_snapshot"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "CreateTableFromSnapshotMetadata" + }; + } + + // Lists all tables served from a specified instance. + rpc ListTables(ListTablesRequest) returns (ListTablesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/tables" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets metadata information about the specified table. + rpc GetTable(GetTableRequest) returns (Table) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a specified table. + rpc UpdateTable(UpdateTableRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{table.name=projects/*/instances/*/tables/*}" + body: "table" + }; + option (google.api.method_signature) = "table,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "UpdateTableMetadata" + }; + } + + // Permanently deletes a specified table and all of its data. + rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Restores a specified table which was accidentally deleted. + rpc UndeleteTable(UndeleteTableRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "UndeleteTableMetadata" + }; + } + + // Creates a new AuthorizedView in a table. + rpc CreateAuthorizedView(CreateAuthorizedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + body: "authorized_view" + }; + option (google.api.method_signature) = + "parent,authorized_view,authorized_view_id"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizedView" + metadata_type: "CreateAuthorizedViewMetadata" + }; + } + + // Lists all AuthorizedViews from a specific table. + rpc ListAuthorizedViews(ListAuthorizedViewsRequest) + returns (ListAuthorizedViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets information from a specified AuthorizedView. + rpc GetAuthorizedView(GetAuthorizedViewRequest) returns (AuthorizedView) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an AuthorizedView in a table. + rpc UpdateAuthorizedView(UpdateAuthorizedViewRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}" + body: "authorized_view" + }; + option (google.api.method_signature) = "authorized_view,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizedView" + metadata_type: "UpdateAuthorizedViewMetadata" + }; + } + + // Permanently deletes a specified AuthorizedView. + rpc DeleteAuthorizedView(DeleteAuthorizedViewRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Performs a series of column family modifications on the specified table. + // Either all or none of the modifications will occur before this method + // returns, but data requests received prior to that point may see a table + // where only some modifications have taken effect. + rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies" + body: "*" + }; + option (google.api.method_signature) = "name,modifications"; + } + + // Permanently drop/delete a row range from a specified table. The request can + // specify whether to delete all rows in a table, or only those that match a + // particular prefix. + rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange" + body: "*" + }; + } + + // Generates a consistency token for a Table, which can be used in + // CheckConsistency to check whether mutations to the table that finished + // before this call started have been replicated. The tokens will be available + // for 90 days. + rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) + returns (GenerateConsistencyTokenResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Checks replication consistency based on a consistency token, that is, if + // replication has caught up based on the conditions specified in the token + // and the check request. + rpc CheckConsistency(CheckConsistencyRequest) + returns (CheckConsistencyResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" + body: "*" + }; + option (google.api.method_signature) = "name,consistency_token"; + } + + // Creates a new snapshot in the specified cluster from the specified + // source table. The cluster and the table must be in the same instance. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc SnapshotTable(SnapshotTableRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot" + body: "*" + }; + option (google.api.method_signature) = + "name,cluster,snapshot_id,description"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "SnapshotTableMetadata" + }; + } + + // Gets metadata information about the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all snapshots associated with the specified cluster. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" + }; + option (google.api.method_signature) = "parent"; + } + + // Permanently deletes the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts creating a new Cloud Bigtable Backup. The returned backup + // [long-running operation][google.longrunning.Operation] can be used to + // track creation of the backup. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The + // [response][google.longrunning.Operation.response] field type is + // [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the + // returned operation will stop the creation and delete the backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup_id,backup"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "CreateBackupMetadata" + }; + } + + // Gets metadata on a pending or completed Cloud Bigtable Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a pending or completed Cloud Bigtable Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { + option (google.api.http) = { + patch: "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + } + + // Deletes a pending or completed Cloud Bigtable backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Cloud Bigtable backups. Returns both completed and pending + // backups. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a new table by restoring from a completed backup. The + // returned table [long-running operation][google.longrunning.Operation] can + // be used to track the progress of the operation, and to cancel it. The + // [metadata][google.longrunning.Operation.metadata] field type is + // [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata]. The + // [response][google.longrunning.Operation.response] type is + // [Table][google.bigtable.admin.v2.Table], if successful. + rpc RestoreTable(RestoreTableRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Table" + metadata_type: "RestoreTableMetadata" + }; + } + + // Copy a Cloud Bigtable backup to a new backup in the destination cluster + // located in the destination instance and project. + rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy" + body: "*" + }; + option (google.api.method_signature) = + "parent,backup_id,source_backup,expire_time"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "CopyBackupMetadata" + }; + } + + // Gets the access control policy for a Bigtable resource. + // Returns an empty policy if the resource exists but does not have a policy + // set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:getIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on a Bigtable resource. + // Replaces any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:setIamPolicy" + body: "*" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that the caller has on the specified Bigtable + // resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/authorizedViews/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v2/{resource=projects/*/instances/*/tables/*/schemaBundles/*}:testIamPermissions" + body: "*" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Creates a new schema bundle in the specified table. + rpc CreateSchemaBundle(CreateSchemaBundleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + body: "schema_bundle" + }; + option (google.api.method_signature) = + "parent,schema_bundle_id,schema_bundle"; + option (google.longrunning.operation_info) = { + response_type: "SchemaBundle" + metadata_type: "CreateSchemaBundleMetadata" + }; + } + + // Updates a schema bundle in the specified table. + rpc UpdateSchemaBundle(UpdateSchemaBundleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{schema_bundle.name=projects/*/instances/*/tables/*/schemaBundles/*}" + body: "schema_bundle" + }; + option (google.api.method_signature) = "schema_bundle,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SchemaBundle" + metadata_type: "UpdateSchemaBundleMetadata" + }; + } + + // Gets metadata information about the specified schema bundle. + rpc GetSchemaBundle(GetSchemaBundleRequest) returns (SchemaBundle) { + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all schema bundles associated with the specified table. + rpc ListSchemaBundles(ListSchemaBundlesRequest) + returns (ListSchemaBundlesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/tables/*}/schemaBundles" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a schema bundle in the specified table. + rpc DeleteSchemaBundle(DeleteSchemaBundleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*/schemaBundles/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request for +// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. +message RestoreTableRequest { + // Required. The name of the instance in which to create the restored + // table. Values are of the form `projects//instances/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The id of the table to create and restore to. This + // table must not already exist. The `table_id` appended to + // `parent` forms the full table name of the form + // `projects//instances//tables/`. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source from which to restore. + oneof source { + // Name of the backup from which to restore. Values are of the form + // `projects//instances//clusters//backups/`. + string backup = 3 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + }]; + } +} + +// Metadata type for the long-running operation returned by +// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. +message RestoreTableMetadata { + // Name of the table being created and restored to. + string name = 1; + + // The type of the restore source. + RestoreSourceType source_type = 2; + + // Information about the source used to restore the table, as specified by + // `source` in + // [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest]. + oneof source_info { + BackupInfo backup_info = 3; + } + + // If exists, the name of the long-running operation that will be used to + // track the post-restore optimization process to optimize the performance of + // the restored table. The metadata type of the long-running operation is + // [OptimizeRestoreTableMetadata][]. The response type is + // [Empty][google.protobuf.Empty]. This long-running operation may be + // automatically created by the system if applicable after the + // RestoreTable long-running operation completes successfully. This operation + // may not be created if the table is already optimized or the restore was + // not successful. + string optimize_table_operation_name = 4; + + // The progress of the + // [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + // operation. + OperationProgress progress = 5; +} + +// Metadata type for the long-running operation used to track the progress +// of optimizations performed on a newly restored table. This long-running +// operation is automatically created by the system after the successful +// completion of a table restore, and cannot be cancelled. +message OptimizeRestoredTableMetadata { + // Name of the restored table being optimized. + string name = 1; + + // The progress of the post-restore optimizations. + OperationProgress progress = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] +message CreateTableRequest { + // An initial split point for a newly created table. + message Split { + // Row key to use as an initial tablet boundary. + bytes key = 1; + } + + // Required. The unique name of the instance in which to create the table. + // Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The name by which the new table should be referred to within the + // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + // Maximum 50 characters. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Table to create. + Table table = 3 [(google.api.field_behavior) = REQUIRED]; + + // The optional list of row keys that will be used to initially split the + // table into several tablets (tablets are similar to HBase regions). + // Given two split keys, `s1` and `s2`, three tablets will be created, + // spanning the key ranges: `[, s1), [s1, s2), [s2, )`. + // + // Example: + // + // * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` + // `"other", "zz"]` + // * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` + // * Key assignment: + // - Tablet 1 `[, apple) => {"a"}.` + // - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` + // - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` + // - Tablet 4 `[customer_2, other) => {"customer_2"}.` + // - Tablet 5 `[other, ) => {"other", "zz"}.` + repeated Split initial_splits = 4; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message CreateTableFromSnapshotRequest { + // Required. The unique name of the instance in which to create the table. + // Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Required. The name by which the new table should be referred to within the + // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + string table_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique name of the snapshot from which to restore the table. + // The snapshot and the table must be in the same instance. Values are of the + // form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string source_snapshot = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] +message DropRowRangeRequest { + // Required. The unique name of the table on which to drop a range of rows. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Delete all rows or by prefix. + oneof target { + // Delete all rows that start with this row key prefix. Prefix cannot be + // zero length. + bytes row_key_prefix = 2; + + // Delete all rows in the table. Setting this to false is a no-op. + bool delete_all_data_from_table = 3; + } +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +message ListTablesRequest { + // Required. The unique name of the instance for which tables should be + // listed. Values are of the form `projects/{project}/instances/{instance}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // The view to be applied to the returned tables' fields. + // NAME_ONLY view (default) and REPLICATION_VIEW are supported. + Table.View view = 2; + + // Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 4; + + // The value of `next_page_token` returned by a previous call. + string page_token = 3; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] +message ListTablesResponse { + // The tables present in the requested instance. + repeated Table tables = 1; + + // Set if not all tables could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] +message GetTableRequest { + // Required. The unique name of the requested table. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // The view to be applied to the returned table's fields. + // Defaults to `SCHEMA_VIEW` if unspecified. + Table.View view = 2; +} + +// The request for +// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. +message UpdateTableRequest { + // Required. The table to update. + // The table's `name` field is used to identify the table to update. + Table table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // A mask specifying which fields (e.g. `change_stream_config`) in the `table` + // field should be updated. This mask is relative to the `table` field, not to + // the request message. The wildcard (*) path is currently not supported. + // Currently UpdateTable is only supported for the following fields: + // + // * `change_stream_config` + // * `change_stream_config.retention_period` + // * `deletion_protection` + // * `row_key_schema` + // + // If `column_families` is set in `update_mask`, it will return an + // UNIMPLEMENTED error. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, ignore safety checks when updating the table. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata type for the operation returned by +// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. +message UpdateTableMetadata { + // The name of the table being updated. + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] +message DeleteTableRequest { + // Required. The unique name of the table to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] +message UndeleteTableRequest { + // Required. The unique name of the table to be restored. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Metadata type for the operation returned by +// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]. +message UndeleteTableMetadata { + // The name of the table being restored. + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was cancelled. + google.protobuf.Timestamp end_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] +message ModifyColumnFamiliesRequest { + // A create, update, or delete of a particular column family. + message Modification { + // The ID of the column family to be modified. + string id = 1; + + // Column family modifications. + oneof mod { + // Create a new column family with the specified schema, or fail if + // one already exists with the given ID. + ColumnFamily create = 2; + + // Update an existing column family to the specified schema, or fail + // if no column family exists with the given ID. + ColumnFamily update = 3; + + // Drop (delete) the column family with the given ID, or fail if no such + // family exists. + bool drop = 4; + } + + // Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update` + // mod should be updated, ignored for other modification types. If unset or + // empty, we treat it as updating `gc_rule` to be backward compatible. + google.protobuf.FieldMask update_mask = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The unique name of the table whose families should be modified. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. Modifications to be atomically applied to the specified table's + // families. Entries are applied in order, meaning that earlier modifications + // can be masked by later ones (in the case of repeated updates to the same + // family, for example). + repeated Modification modifications = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, ignore safety checks when modifying the column families. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] +message GenerateConsistencyTokenRequest { + // Required. The unique name of the Table for which to create a consistency + // token. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] +message GenerateConsistencyTokenResponse { + // The generated consistency token. + string consistency_token = 1; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] +message CheckConsistencyRequest { + // Required. The unique name of the Table for which to check replication + // consistency. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The token created using GenerateConsistencyToken for the Table. + string consistency_token = 2 [(google.api.field_behavior) = REQUIRED]; + + // Which type of read needs to consistently observe which type of write? + // Default: `standard_read_remote_writes` + oneof mode { + // Checks that reads using an app profile with `StandardIsolation` can + // see all writes committed before the token was created, even if the + // read and write target different clusters. + StandardReadRemoteWrites standard_read_remote_writes = 3; + + // Checks that reads using an app profile with `DataBoostIsolationReadOnly` + // can see all writes committed before the token was created, but only if + // the read and write target the same cluster. + DataBoostReadLocalWrites data_boost_read_local_writes = 4; + } +} + +// Checks that all writes before the consistency token was generated are +// replicated in every cluster and readable. +message StandardReadRemoteWrites {} + +// Checks that all writes before the consistency token was generated in the same +// cluster are readable by Databoost. +message DataBoostReadLocalWrites {} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] +message CheckConsistencyResponse { + // True only if the token is consistent. A token is consistent if replication + // has caught up with the restrictions specified in the request. + bool consistent = 1; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message SnapshotTableRequest { + // Required. The unique name of the table to have the snapshot taken. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The name of the cluster where the snapshot will be created in. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string cluster = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The ID by which the new snapshot should be referred to within the + // parent cluster, e.g., `mysnapshot` of the form: + // `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. + string snapshot_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // The amount of time that the new snapshot can stay active after it is + // created. Once 'ttl' expires, the snapshot will get deleted. The maximum + // amount of time a snapshot can stay active is 7 days. If 'ttl' is not + // specified, the default value of 24 hours will be used. + google.protobuf.Duration ttl = 4; + + // Description of the snapshot. + string description = 5; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message GetSnapshotRequest { + // Required. The unique name of the requested snapshot. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message ListSnapshotsRequest { + // Required. The unique name of the cluster for which snapshots should be + // listed. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + // Use `{cluster} = '-'` to list snapshots for all clusters in an instance, + // e.g., `projects/{project}/instances/{instance}/clusters/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // The maximum number of snapshots to return per page. + // CURRENTLY UNIMPLEMENTED AND IGNORED. + int32 page_size = 2; + + // The value of `next_page_token` returned by a previous call. + string page_token = 3; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message ListSnapshotsResponse { + // The snapshots present in the requested cluster. + repeated Snapshot snapshots = 1; + + // Set if not all snapshots could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message DeleteSnapshotRequest { + // Required. The unique name of the snapshot to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Snapshot" + } + ]; +} + +// The metadata for the Operation returned by SnapshotTable. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message SnapshotTableMetadata { + // The request that prompted the initiation of this SnapshotTable operation. + SnapshotTableRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The metadata for the Operation returned by CreateTableFromSnapshot. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message CreateTableFromSnapshotMetadata { + // The request that prompted the initiation of this CreateTableFromSnapshot + // operation. + CreateTableFromSnapshotRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// The request for +// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. +message CreateBackupRequest { + // Required. This must be one of the clusters in the instance in which this + // table is located. The backup will be stored in this cluster. Values are + // of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The id of the backup to be created. The `backup_id` along with + // the parent `parent` are combined as {parent}/backups/{backup_id} to create + // the full backup name, of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + // This string must be between 1 and 50 characters in length and match the + // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The backup to create. + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the operation returned by +// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. +message CreateBackupMetadata { + // The name of the backup being created. + string name = 1; + + // The name of the table the backup is created from. + string source_table = 2; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 3; + + // If set, the time at which this operation finished or was cancelled. + google.protobuf.Timestamp end_time = 4; +} + +// The request for +// [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. +message UpdateBackupRequest { + // Required. The backup to update. `backup.name`, and the fields to be updated + // as specified by `update_mask` are required. Other fields are ignored. + // Update is only supported for the following fields: + // + // * `backup.expire_time`. + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A mask specifying which fields (e.g. `expire_time`) in the + // Backup resource should be updated. This mask is relative to the Backup + // resource, not to the request message. The field mask must always be + // specified; this prevents any future fields from being erased accidentally + // by clients that do not know about them. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; +} + +// The request for +// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; +} + +// The request for +// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The cluster to list backups from. Values are of the + // form `projects/{project}/instances/{instance}/clusters/{cluster}`. + // Use `{cluster} = '-'` to list backups for all clusters in an instance, + // e.g., `projects/{project}/instances/{instance}/clusters/-`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // A filter expression that filters backups listed in the response. + // The expression must specify the field name, a comparison operator, + // and the value that you want to use for filtering. The value must be a + // string, a number, or a boolean. The comparison operator must be + // <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is + // roughly synonymous with equality. Filter rules are case insensitive. + // + // The fields eligible for filtering are: + // + // * `name` + // * `source_table` + // * `state` + // * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + // * `size_bytes` + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. By default, each expression is an AND expression. However, + // you can include AND, OR, and NOT expressions explicitly. + // + // Some examples of using filters are: + // + // * `name:"exact"` --> The backup's name is the string "exact". + // * `name:howl` --> The backup's name contains the string "howl". + // * `source_table:prod` + // --> The source_table's name contains the string "prod". + // * `state:CREATING` --> The backup is pending creation. + // * `state:READY` --> The backup is fully created and ready for use. + // * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` + // --> The backup name contains the string "howl" and start_time + // of the backup is before 2018-03-28T14:50:00Z. + // * `size_bytes > 10000000000` --> The backup's size is greater than 10GB + string filter = 2; + + // An expression for specifying the sort order of the results of the request. + // The string value should specify one or more fields in + // [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at + // https://aip.dev/132#ordering. + // + // Fields supported are: + // + // * name + // * source_table + // * expire_time + // * start_time + // * end_time + // * size_bytes + // * state + // + // For example, "start_time". The default sorting order is ascending. + // To specify descending order for the field, a suffix " desc" should + // be appended to the field name. For example, "start_time desc". + // Redundant space characters in the syntax are insigificant. + // + // If order_by is empty, results will be sorted by `start_time` in descending + // order starting from the most recently created backup. + string order_by = 3; + + // Number of backups to be returned in the response. If 0 or + // less, defaults to the server's maximum allowed page size. + int32 page_size = 4; + + // If non-empty, `page_token` should contain a + // [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] + // from a previous + // [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the + // same `parent` and with the same `filter`. + string page_token = 5; +} + +// The response for +// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. +message ListBackupsResponse { + // The list of matching backups. + repeated Backup backups = 1; + + // `next_page_token` can be sent in a subsequent + // [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call + // to fetch more of the matching backups. + string next_page_token = 2; +} + +// The request for +// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. +message CopyBackupRequest { + // Required. The name of the destination cluster that will contain the backup + // copy. The cluster must already exist. Values are of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Cluster" + } + ]; + + // Required. The id of the new backup. The `backup_id` along with `parent` + // are combined as {parent}/backups/{backup_id} to create the full backup + // name, of the form: + // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. + // This string must be between 1 and 50 characters in length and match the + // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source backup to be copied from. + // The source backup needs to be in READY state for it to be copied. + // Copying a copied backup is not allowed. + // Once CopyBackup is in progress, the source backup cannot be deleted or + // cleaned up on expiration until CopyBackup is finished. + // Values are of the form: + // `projects//instances//clusters//backups/`. + string source_backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + } + ]; + + // Required. Required. The expiration time of the copied backup with + // microsecond granularity that must be at least 6 hours and at most 30 days + // from the time the request is received. Once the `expire_time` has + // passed, Cloud Bigtable will delete the backup and free the resources used + // by the backup. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata type for the google.longrunning.Operation returned by +// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. +message CopyBackupMetadata { + // The name of the backup being created through the copy operation. + // Values are of the form + // `projects//instances//clusters//backups/`. + string name = 1 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Backup" + }]; + + // Information about the source backup that is being copied from. + BackupInfo source_backup_info = 2; + + // The progress of the + // [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] + // operation. + OperationProgress progress = 3; +} + +// The request for +// [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] +message CreateAuthorizedViewRequest { + // Required. This is the name of the table the AuthorizedView belongs to. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Required. The id of the AuthorizedView to create. This AuthorizedView must + // not already exist. The `authorized_view_id` appended to `parent` forms the + // full AuthorizedView name of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`. + string authorized_view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The AuthorizedView to create. + AuthorizedView authorized_view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by CreateAuthorizedView. +message CreateAuthorizedViewMetadata { + // The request that prompted the initiation of this CreateAuthorizedView + // operation. + CreateAuthorizedViewRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] +message ListAuthorizedViewsRequest { + // Required. The unique name of the table for which AuthorizedViews should be + // listed. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. Maximum number of results per page. + // + // A page_size of zero lets the server choose the number of items to return. + // A page_size which is strictly positive will return at most that many items. + // A negative page_size will cause an error. + // + // Following the first request, subsequent paginated calls are not required + // to pass a page_size. If a page_size is set in subsequent calls, it must + // match the page_size given in the first request. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of `next_page_token` returned by a previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource_view to be applied to the returned AuthorizedViews' + // fields. Default to NAME_ONLY. + AuthorizedView.ResponseView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] +message ListAuthorizedViewsResponse { + // The AuthorizedViews present in the requested table. + repeated AuthorizedView authorized_views = 1; + + // Set if not all tables could be returned in a single response. + // Pass this value to `page_token` in another request to get the next + // page of results. + string next_page_token = 2; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] +message GetAuthorizedViewRequest { + // Required. The unique name of the requested AuthorizedView. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The resource_view to be applied to the returned AuthorizedView's + // fields. Default to BASIC. + AuthorizedView.ResponseView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. +message UpdateAuthorizedViewRequest { + // Required. The AuthorizedView to update. The `name` in `authorized_view` is + // used to identify the AuthorizedView. AuthorizedView name must in this + // format: + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + AuthorizedView authorized_view = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + // A mask specifying which fields in the AuthorizedView resource should be + // updated. This mask is relative to the AuthorizedView resource, not to the + // request message. A field will be overwritten if it is in the mask. If + // empty, all fields set in the request will be overwritten. A special value + // `*` means to overwrite all fields (including fields not set in the + // request). + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, ignore the safety checks when updating the + // AuthorizedView. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata for the google.longrunning.Operation returned by +// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. +message UpdateAuthorizedViewMetadata { + // The request that prompted the initiation of this UpdateAuthorizedView + // operation. + UpdateAuthorizedViewRequest original_request = 1; + + // The time at which the original request was received. + google.protobuf.Timestamp request_time = 2; + + // The time at which the operation failed or was completed successfully. + google.protobuf.Timestamp finish_time = 3; +} + +// Request message for +// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] +message DeleteAuthorizedViewRequest { + // Required. The unique name of the AuthorizedView to be deleted. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The current etag of the AuthorizedView. + // If an etag is provided and does not match the current etag of the + // AuthorizedView, deletion will be blocked and an ABORTED error will be + // returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for +// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. +message CreateSchemaBundleRequest { + // Required. The parent resource where this schema bundle will be created. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Required. The unique ID to use for the schema bundle, which will become the + // final component of the schema bundle's resource name. + string schema_bundle_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema bundle to create. + SchemaBundle schema_bundle = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metadata for the Operation returned by +// [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. +message CreateSchemaBundleMetadata { + // The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// The request for +// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. +message UpdateSchemaBundleRequest { + // Required. The schema bundle to update. + // + // The schema bundle's `name` field is used to identify the schema bundle to + // update. Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + SchemaBundle schema_bundle = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, ignore the safety checks when updating the Schema Bundle. + // The safety checks are: + // - The new Schema Bundle is backwards compatible with the existing Schema + // Bundle. + bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The metadata for the Operation returned by +// [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. +message UpdateSchemaBundleMetadata { + // The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1; + + // The time at which this operation started. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation finished or was canceled. + google.protobuf.Timestamp end_time = 3; +} + +// The request for +// [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]. +message GetSchemaBundleRequest { + // Required. The unique name of the schema bundle to retrieve. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; +} + +// The request for +// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. +message ListSchemaBundlesRequest { + // Required. The parent, which owns this collection of schema bundles. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; + + // The maximum number of schema bundles to return. If the value is positive, + // the server may return at most this value. If unspecified, the server will + // return the maximum allowed page size. + int32 page_size = 2; + + // A page token, received from a previous `ListSchemaBundles` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSchemaBundles` must + // match the call that provided the page token. + string page_token = 3; +} + +// The response for +// [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. +message ListSchemaBundlesResponse { + // The schema bundles from the specified table. + repeated SchemaBundle schema_bundles = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request for +// [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]. +message DeleteSchemaBundleRequest { + // Required. The unique name of the schema bundle to delete. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + } + ]; + + // Optional. The etag of the schema bundle. + // If this is provided, it must match the server's etag. The server + // returns an ABORTED error on a mismatched etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto new file mode 100644 index 000000000000..0503e3f3c4d2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto @@ -0,0 +1,54 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// Storage media types for persisting Bigtable data. +enum StorageType { + // The user did not specify a storage type. + STORAGE_TYPE_UNSPECIFIED = 0; + + // Flash (SSD) storage should be used. + SSD = 1; + + // Magnetic drive (HDD) storage should be used. + HDD = 2; +} + +// Encapsulates progress related information for a Cloud Bigtable long +// running operation. +message OperationProgress { + // Percent completion of the operation. + // Values are between 0 and 100 inclusive. + int32 progress_percent = 1; + + // Time the request was received. + google.protobuf.Timestamp start_time = 2; + + // If set, the time at which this operation failed or was completed + // successfully. + google.protobuf.Timestamp end_time = 3; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto new file mode 100644 index 000000000000..d0a1c028e12e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto @@ -0,0 +1,560 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/common.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "InstanceProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and +// the resources that serve them. +// All tables in an instance are served from all +// [Clusters][google.bigtable.admin.v2.Cluster] in the instance. +message Instance { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Possible states of an instance. + enum State { + // The state of the instance could not be determined. + STATE_NOT_KNOWN = 0; + + // The instance has been successfully created and can serve requests + // to its tables. + READY = 1; + + // The instance is currently being created, and may be destroyed + // if the creation process encounters an error. + CREATING = 2; + } + + // The type of the instance. + enum Type { + // The type of the instance is unspecified. If set when creating an + // instance, a `PRODUCTION` instance will be created. If set when updating + // an instance, the type will be left unchanged. + TYPE_UNSPECIFIED = 0; + + // An instance meant for production use. `serve_nodes` must be set + // on the cluster. + PRODUCTION = 1; + + // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces + // a higher minimum node count than DEVELOPMENT. + DEVELOPMENT = 2; + } + + // Possible editions of an instance. + // + // An edition is a specific tier of Cloud Bigtable. Each edition is tailored + // to different customer needs. Higher tiers offer more features and better + // performance. + enum Edition { + // The edition is unspecified. This is treated as `ENTERPRISE`. + EDITION_UNSPECIFIED = 0; + + // The Enterprise edition. This is the default offering that is designed to + // meet the needs of most enterprise workloads. + ENTERPRISE = 1; + + // The Enterprise Plus edition. This is a premium tier that is designed for + // demanding, multi-tenant workloads requiring the highest levels of + // performance, scale, and global availability. + // + // The nodes in the Enterprise Plus tier come at a higher cost than the + // Enterprise tier. Any Enterprise Plus features must be disabled before + // downgrading to Enterprise. + ENTERPRISE_PLUS = 2; + } + + // The unique name of the instance. Values are of the form + // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. + string name = 1; + + // Required. The descriptive name for this instance as it appears in UIs. + // Can be changed at any time, but should be kept globally unique + // to avoid confusion. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The current state of the instance. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The type of the instance. Defaults to `PRODUCTION`. + Type type = 4; + + // Optional. The edition of the instance. See + // [Edition][google.bigtable.admin.v2.Instance.Edition] for details. + Edition edition = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Labels are a flexible and lightweight mechanism for organizing cloud + // resources into groups that reflect a customer's organizational needs and + // deployment strategies. They can be used to filter resources and aggregate + // metrics. + // + // * Label keys must be between 1 and 63 characters long and must conform to + // the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. + // * Label values must be between 0 and 63 characters long and must conform to + // the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. + // * No more than 64 labels can be associated with a given resource. + // * Keys and values must both be under 128 bytes. + map labels = 5; + + // Output only. A commit timestamp representing when this Instance was + // created. For instances created before this field was added (August 2021), + // this value is `seconds: 0, nanos: 1`. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + optional bool satisfies_pzi = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // - "123/environment": "production", + // - "123/costCenter": "marketing" + // + // Tags and Labels (above) are both used to bind metadata to resources, with + // different use-cases. See + // https://cloud.google.com/resource-manager/docs/tags/tags-overview for an + // in-depth overview on the difference between tags and labels. + map tags = 12 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The Autoscaling targets for a Cluster. These determine the recommended nodes. +message AutoscalingTargets { + // The cpu utilization that the Autoscaler should be trying to achieve. + // This number is on a scale from 0 (no utilization) to + // 100 (total utilization), and is limited between 10 and 80, otherwise it + // will return INVALID_ARGUMENT error. + int32 cpu_utilization_percent = 2; + + // The storage utilization that the Autoscaler should be trying to achieve. + // This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD + // cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster, + // otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, + // it will be treated as if it were set to the default value: 2560 for SSD, + // 8192 for HDD. + int32 storage_utilization_gib_per_node = 3; +} + +// Limits for the number of nodes a Cluster can autoscale up/down to. +message AutoscalingLimits { + // Required. Minimum number of nodes to scale down to. + int32 min_serve_nodes = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum number of nodes to scale up to. + int32 max_serve_nodes = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A resizable group of nodes in a particular cloud location, capable +// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent +// [Instance][google.bigtable.admin.v2.Instance]. +message Cluster { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Cluster" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" + }; + + // Possible states of a cluster. + enum State { + // The state of the cluster could not be determined. + STATE_NOT_KNOWN = 0; + + // The cluster has been successfully created and is ready to serve requests. + READY = 1; + + // The cluster is currently being created, and may be destroyed + // if the creation process encounters an error. + // A cluster may not be able to serve requests while being created. + CREATING = 2; + + // The cluster is currently being resized, and may revert to its previous + // node count if the process encounters an error. + // A cluster is still capable of serving requests while being resized, + // but may exhibit performance as if its number of allocated nodes is + // between the starting and requested states. + RESIZING = 3; + + // The cluster has no backing nodes. The data (tables) still + // exist, but no operations can be performed on the cluster. + DISABLED = 4; + } + + // Possible node scaling factors of the clusters. Node scaling delivers better + // latency and more throughput by removing node boundaries. + enum NodeScalingFactor { + // No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X. + NODE_SCALING_FACTOR_UNSPECIFIED = 0; + + // The cluster is running with a scaling factor of 1. + NODE_SCALING_FACTOR_1X = 1; + + // The cluster is running with a scaling factor of 2. + // All node count values must be in increments of 2 with this scaling factor + // enabled, otherwise an INVALID_ARGUMENT error will be returned. + NODE_SCALING_FACTOR_2X = 2; + } + + // Autoscaling config for a cluster. + message ClusterAutoscalingConfig { + // Required. Autoscaling limits for this cluster. + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Autoscaling targets for this cluster. + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for a cluster. + message ClusterConfig { + // Autoscaling configuration for this cluster. + ClusterAutoscalingConfig cluster_autoscaling_config = 1; + } + + // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected + // cluster. + message EncryptionConfig { + // Describes the Cloud KMS encryption key that will be used to protect the + // destination Bigtable cluster. The requirements for this key are: + // 1) The Cloud Bigtable service account associated with the project that + // contains this cluster must be granted the + // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + // 2) Only regional keys can be used and the region of the CMEK key must + // match the region of the cluster. + // Values are of the form + // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + } + + // The unique name of the cluster. Values are of the form + // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. + string name = 1; + + // Immutable. The location where this cluster's nodes and storage reside. For + // best performance, clients should be located as close as possible to this + // cluster. Currently only zones are supported, so values should be of the + // form `projects/{project}/locations/{zone}`. + string location = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Output only. The current state of the cluster. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of nodes in the cluster. If no value is set, + // Cloud Bigtable automatically allocates nodes based on your data footprint + // and optimized for 50% storage utilization. + int32 serve_nodes = 4; + + // Immutable. The node scaling factor of this cluster. + NodeScalingFactor node_scaling_factor = 9 + [(google.api.field_behavior) = IMMUTABLE]; + + oneof config { + // Configuration for this cluster. + ClusterConfig cluster_config = 7; + } + + // Immutable. The type of storage used by this cluster to serve its + // parent instance's tables, unless explicitly overridden. + StorageType default_storage_type = 5 + [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The encryption configuration for CMEK-protected clusters. + EncryptionConfig encryption_config = 6 + [(google.api.field_behavior) = IMMUTABLE]; +} + +// A configuration object describing how Cloud Bigtable should treat traffic +// from a particular end user application. +message AppProfile { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/AppProfile" + pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}" + plural: "appProfiles" + singular: "appProfile" + }; + + // Read/write requests are routed to the nearest cluster in the instance, and + // will fail over to the nearest cluster that is available in the event of + // transient errors or delays. Clusters in a region are considered + // equidistant. Choosing this option sacrifices read-your-writes consistency + // to improve availability. + message MultiClusterRoutingUseAny { + // If enabled, Bigtable will route the request based on the row key of the + // request, rather than randomly. Instead, each row key will be assigned + // to a cluster, and will stick to that cluster. If clusters are added or + // removed, then this may affect which row keys stick to which clusters. + // To avoid this, users can use a cluster group to specify which clusters + // are to be used. In this case, new clusters that are not a part of the + // cluster group will not be routed to, and routing will be unaffected by + // the new cluster. Moreover, clusters specified in the cluster group cannot + // be deleted unless removed from the cluster group. + message RowAffinity {} + + // The set of clusters to route to. The order is ignored; clusters will be + // tried in order of distance. If left empty, all clusters are eligible. + repeated string cluster_ids = 1; + + // Possible algorithms for routing affinity. If enabled, Bigtable will + // route between equidistant clusters in a deterministic order rather than + // choosing randomly. + // + // This mechanism gives read-your-writes consistency for *most* requests + // under *most* circumstances, without sacrificing availability. Consistency + // is *not* guaranteed, as requests might still fail over between clusters + // in the event of errors or latency. + oneof affinity { + // Row affinity sticky routing based on the row key of the request. + // Requests that span multiple rows are routed non-deterministically. + RowAffinity row_affinity = 3; + } + } + + // Unconditionally routes all read/write requests to a specific cluster. + // This option preserves read-your-writes consistency but does not improve + // availability. + message SingleClusterRouting { + // The cluster to which read/write requests should be routed. + string cluster_id = 1; + + // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are + // allowed by this app profile. It is unsafe to send these requests to + // the same table/row/column in multiple clusters. + bool allow_transactional_writes = 2; + } + + // Possible priorities for an app profile. Note that higher priority writes + // can sometimes queue behind lower priority writes to the same tablet, as + // writes must be strictly sequenced in the durability log. + enum Priority { + // Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation. + PRIORITY_UNSPECIFIED = 0; + + PRIORITY_LOW = 1; + + PRIORITY_MEDIUM = 2; + + PRIORITY_HIGH = 3; + } + + // Standard options for isolating this app profile's traffic from other use + // cases. + message StandardIsolation { + // The priority of requests sent using this app profile. + Priority priority = 1; + } + + // Data Boost is a serverless compute capability that lets you run + // high-throughput read jobs and queries on your Bigtable data, without + // impacting the performance of the clusters that handle your application + // traffic. Data Boost supports read-only use cases with single-cluster + // routing. + message DataBoostIsolationReadOnly { + // Compute Billing Owner specifies how usage should be accounted when using + // Data Boost. Compute Billing Owner also configures which Cloud Project is + // charged for relevant quota. + enum ComputeBillingOwner { + // Unspecified value. + COMPUTE_BILLING_OWNER_UNSPECIFIED = 0; + + // The host Cloud Project containing the targeted Bigtable Instance / + // Table pays for compute. + HOST_PAYS = 1; + } + + // The Compute Billing Owner for this Data Boost App Profile. + optional ComputeBillingOwner compute_billing_owner = 1; + } + + // The unique name of the app profile. Values are of the form + // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + string name = 1; + + // Strongly validated etag for optimistic concurrency control. Preserve the + // value returned from `GetAppProfile` when calling `UpdateAppProfile` to + // fail the request if there has been a modification in the mean time. The + // `update_mask` of the request need not include `etag` for this protection + // to apply. + // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and + // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more + // details. + string etag = 2; + + // Long form description of the use case for this AppProfile. + string description = 3; + + // The routing policy for all read/write requests that use this app profile. + // A value must be explicitly set. + oneof routing_policy { + // Use a multi-cluster routing policy. + MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + + // Use a single-cluster routing policy. + SingleClusterRouting single_cluster_routing = 6; + } + + // Options for isolating this app profile's traffic from other use cases. + oneof isolation { + // This field has been deprecated in favor of `standard_isolation.priority`. + // If you set this field, `standard_isolation.priority` will be set instead. + // + // The priority of requests sent using this app profile. + Priority priority = 7 [deprecated = true]; + + // The standard options used for isolating this app profile's traffic from + // other use cases. + StandardIsolation standard_isolation = 11; + + // Specifies that this app profile is intended for read-only usage via the + // Data Boost feature. + DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; + } +} + +// A tablet is a defined by a start and end key and is explained in +// https://cloud.google.com/bigtable/docs/overview#architecture and +// https://cloud.google.com/bigtable/docs/performance#optimization. +// A Hot tablet is a tablet that exhibits high average cpu usage during the time +// interval from start time to end time. +message HotTablet { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/HotTablet" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}" + plural: "hotTablets" + singular: "hotTablet" + }; + + // The unique name of the hot tablet. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. + string name = 1; + + // Name of the table that contains the tablet. Values are of the form + // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + string table_name = 2 [(google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + }]; + + // Output only. The start time of the hot tablet. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the hot tablet. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Tablet Start Key (inclusive). + string start_key = 5; + + // Tablet End Key (inclusive). + string end_key = 6; + + // Output only. The average CPU usage spent by a node on this tablet over the + // start_time to end_time time range. The percentage is the amount of CPU used + // by the node to serve the tablet, from 0% (tablet was not interacted with) + // to 100% (the node spent all cycles serving the hot tablet). + float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A SQL logical view object that can be referenced in SQL queries. +message LogicalView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/LogicalView" + pattern: "projects/{project}/instances/{instance}/logicalViews/{logical_view}" + plural: "logicalViews" + singular: "logicalView" + }; + + // Identifier. The unique name of the logical view. + // Format: + // `projects/{project}/instances/{instance}/logicalViews/{logical_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The logical view's select query. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for this logical view. + // This may be sent on update requests to ensure that the client has an + // up-to-date value before proceeding. The server returns an ABORTED error on + // a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set to true to make the LogicalView protected against deletion. + bool deletion_protection = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A materialized view object that can be referenced in SQL queries. +message MaterializedView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + pattern: "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" + plural: "materializedViews" + singular: "materializedView" + }; + + // Identifier. The unique name of the materialized view. + // Format: + // `projects/{project}/instances/{instance}/materializedViews/{materialized_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The materialized view's select query. + string query = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The etag for this materialized view. + // This may be sent on update requests to ensure that the client has an + // up-to-date value before proceeding. The server returns an ABORTED error on + // a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Set to true to make the MaterializedView protected against deletion. + bool deletion_protection = 6; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto new file mode 100644 index 000000000000..6da7f8b48709 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto @@ -0,0 +1,728 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/admin/v2/types.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "TableProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Information about a table restore. +message RestoreInfo { + // The type of the restore source. + RestoreSourceType source_type = 1; + + // Information about the source used to restore the table. + oneof source_info { + // Information about the backup used to restore the table. The backup + // may no longer exist. + BackupInfo backup_info = 2; + } +} + +// Change stream configuration. +message ChangeStreamConfig { + // How long the change stream should be retained. Change stream data older + // than the retention period will not be returned when reading the change + // stream from the table. + // Values must be at least 1 day and at most 7 days, and will be truncated to + // microsecond granularity. + google.protobuf.Duration retention_period = 1; +} + +// A collection of user data indexed by row, column, and timestamp. +// Each table is served using the resources of its parent cluster. +message Table { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Table" + pattern: "projects/{project}/instances/{instance}/tables/{table}" + }; + + // The state of a table's data in a particular cluster. + message ClusterState { + // Table replication states. + enum ReplicationState { + // The replication state of the table is unknown in this cluster. + STATE_NOT_KNOWN = 0; + + // The cluster was recently created, and the table must finish copying + // over pre-existing data from other clusters before it can begin + // receiving live replication updates and serving Data API requests. + INITIALIZING = 1; + + // The table is temporarily unable to serve Data API requests from this + // cluster due to planned internal maintenance. + PLANNED_MAINTENANCE = 2; + + // The table is temporarily unable to serve Data API requests from this + // cluster due to unplanned or emergency maintenance. + UNPLANNED_MAINTENANCE = 3; + + // The table can serve Data API requests from this cluster. Depending on + // replication delay, reads may not immediately reflect the state of the + // table in other clusters. + READY = 4; + + // The table is fully created and ready for use after a restore, and is + // being optimized for performance. When optimizations are complete, the + // table will transition to `READY` state. + READY_OPTIMIZING = 5; + } + + // Output only. The state of replication for the table in this cluster. + ReplicationState replication_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the table in this cluster. + // If the encryption key protecting this resource is customer managed, then + // its version can be rotated in Cloud Key Management Service (Cloud KMS). + // The primary version of the key and its status will be reflected here when + // changes propagate from Cloud KMS. + repeated EncryptionInfo encryption_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Possible timestamp granularities to use when keeping multiple versions + // of data in a table. + enum TimestampGranularity { + // The user did not specify a granularity. Should not be returned. + // When specified during table creation, MILLIS will be used. + TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; + + // The table keeps data versioned at a granularity of 1ms. + MILLIS = 1; + } + + // Defines a view over a table's fields. + enum View { + // Uses the default view for each method as documented in its request. + VIEW_UNSPECIFIED = 0; + + // Only populates `name`. + NAME_ONLY = 1; + + // Only populates `name` and fields related to the table's schema. + SCHEMA_VIEW = 2; + + // Only populates `name` and fields related to the table's replication + // state. + REPLICATION_VIEW = 3; + + // Only populates `name` and fields related to the table's encryption state. + ENCRYPTION_VIEW = 5; + + // Populates all fields. + FULL = 4; + } + + // Defines an automated backup policy for a table + message AutomatedBackupPolicy { + // Required. How long the automated backups should be retained. Values must + // be at least 3 days and at most 90 days. + google.protobuf.Duration retention_period = 1 + [(google.api.field_behavior) = REQUIRED]; + + // How frequently automated backups should occur. The only supported value + // at this time is 24 hours. An undefined frequency is treated as 24 hours. + google.protobuf.Duration frequency = 2; + + // Optional. A list of Cloud Bigtable zones where automated backups are + // allowed to be created. If empty, automated backups will be created in all + // zones of the instance. Locations are in the format + // `projects/{project}/locations/{zone}`. + // This field can only set for tables in Enterprise Plus instances. + repeated string locations = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + } + + // The unique name of the table. Values are of the form + // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` + string name = 1; + + // Output only. Map from cluster ID to per-cluster table state. + // If it could not be determined whether or not the table has data in a + // particular cluster (for example, if its zone is unavailable), then + // there will be an entry for the cluster with UNKNOWN `replication_status`. + // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` + map cluster_states = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The column families configured for this table, mapped by column family ID. + // Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` + map column_families = 3; + + // Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored + // in this table. Timestamps not matching the granularity will be rejected. If + // unspecified at creation time, the value will be set to `MILLIS`. Views: + // `SCHEMA_VIEW`, `FULL`. + TimestampGranularity granularity = 4 + [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. If this table was restored from another data source (e.g. a + // backup), this field will be populated with information about the restore. + RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If specified, enable the change stream on this table. + // Otherwise, the change stream is disabled and the change stream is not + // retained. + ChangeStreamConfig change_stream_config = 8; + + // Set to true to make the table protected against data loss. i.e. deleting + // the following resources through Admin APIs are prohibited: + // + // * The table. + // * The column families in the table. + // * The instance containing the table. + // + // Note one can still delete the data stored in the table through Data APIs. + bool deletion_protection = 9; + + oneof automated_backup_config { + // If specified, automated backups are enabled for this table. + // Otherwise, automated backups are disabled. + AutomatedBackupPolicy automated_backup_policy = 13; + } + + // Rules to specify what data is stored in each storage tier. + // Different tiers store data differently, providing different trade-offs + // between cost and performance. Different parts of a table can be stored + // separately on different tiers. + // If a config is specified, tiered storage is enabled for this table. + // Otherwise, tiered storage is disabled. + // Only SSD instances can configure tiered storage. + TieredStorageConfig tiered_storage_config = 14; + + // The row key schema for this table. The schema is used to decode the raw row + // key bytes into a structured format. The order of field declarations in this + // schema is important, as it reflects how the raw row key bytes are + // structured. Currently, this only affects how the key is read via a + // GoogleSQL query from the ExecuteQuery API. + // + // For a SQL query, the _key column is still read as raw bytes. But queries + // can reference the key fields by name, which will be decoded from _key using + // provided type and encoding. Queries that reference key fields will fail if + // they encounter an invalid row key. + // + // For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the + // following schema: + // { + // fields { + // field_name: "id" + // type { string { encoding: utf8_bytes {} } } + // } + // fields { + // field_name: "date" + // type { string { encoding: utf8_bytes {} } } + // } + // fields { + // field_name: "product_code" + // type { int64 { encoding: big_endian_bytes {} } } + // } + // encoding { delimited_bytes { delimiter: "#" } } + // } + // + // The decoded key parts would be: + // id = "some_id", date = "2024-04-30", product_code = 1245427 + // The query "SELECT _key, product_code FROM table" will return two columns: + // /------------------------------------------------------\ + // | _key | product_code | + // | --------------------------------------|--------------| + // | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 | + // \------------------------------------------------------/ + // + // The schema has the following invariants: + // (1) The decoded field values are order-preserved. For read, the field + // values will be decoded in sorted mode from the raw bytes. + // (2) Every field in the schema must specify a non-empty name. + // (3) Every field must specify a type with an associated encoding. The type + // is limited to scalar types only: Array, Map, Aggregate, and Struct are not + // allowed. + // (4) The field names must not collide with existing column family + // names and reserved keywords "_key" and "_timestamp". + // + // The following update operations are allowed for row_key_schema: + // - Update from an empty schema to a new schema. + // - Remove the existing schema. This operation requires setting the + // `ignore_warnings` flag to `true`, since it might be a backward + // incompatible change. Without the flag, the update request will fail with + // an INVALID_ARGUMENT error. + // Any other row key schema update operation (e.g. update existing schema + // columns names or types) is currently unsupported. + Type.Struct row_key_schema = 15; +} + +// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users +// can configure access to each Authorized View independently from the table and +// use the existing Data APIs to access the subset of data. +message AuthorizedView { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}" + plural: "authorizedViews" + singular: "authorizedView" + }; + + // Subsets of a column family that are included in this AuthorizedView. + message FamilySubsets { + // Individual exact column qualifiers to be included in the AuthorizedView. + repeated bytes qualifiers = 1; + + // Prefixes for qualifiers to be included in the AuthorizedView. Every + // qualifier starting with one of these prefixes is included in the + // AuthorizedView. To provide access to all qualifiers, include the empty + // string as a prefix + // (""). + repeated bytes qualifier_prefixes = 2; + } + + // Defines a simple AuthorizedView that is a subset of the underlying Table. + message SubsetView { + // Row prefixes to be included in the AuthorizedView. + // To provide access to all rows, include the empty string as a prefix (""). + repeated bytes row_prefixes = 1; + + // Map from column family name to the columns in this family to be included + // in the AuthorizedView. + map family_subsets = 2; + } + + // Defines a subset of an AuthorizedView's fields. + enum ResponseView { + // Uses the default view for each method as documented in the request. + RESPONSE_VIEW_UNSPECIFIED = 0; + + // Only populates `name`. + NAME_ONLY = 1; + + // Only populates the AuthorizedView's basic metadata. This includes: + // name, deletion_protection, etag. + BASIC = 2; + + // Populates every fields. + FULL = 3; + } + + // Identifier. The name of this AuthorizedView. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The type of this AuthorizedView. + oneof authorized_view { + // An AuthorizedView permitting access to an explicit subset of a Table. + SubsetView subset_view = 2; + } + + // The etag for this AuthorizedView. + // If this is provided on update, it must match the server's etag. The server + // returns ABORTED error on a mismatched etag. + string etag = 3; + + // Set to true to make the AuthorizedView protected against deletion. + // The parent Table and containing Instance cannot be deleted if an + // AuthorizedView has this bit set. + bool deletion_protection = 4; +} + +// A set of columns within a table which share a common configuration. +message ColumnFamily { + // Garbage collection rule specified as a protobuf. + // Must serialize to at most 500 bytes. + // + // NOTE: Garbage collection executes opportunistically in the background, and + // so it's possible for reads to return a cell even if it matches the active + // GC expression for its family. + GcRule gc_rule = 1; + + // The type of data stored in each of this family's cell values, including its + // full encoding. If omitted, the family only serves raw untyped bytes. + // + // For now, only the `Aggregate` type is supported. + // + // `Aggregate` can only be set at family creation and is immutable afterwards. + // + // + // If `value_type` is `Aggregate`, written data must be compatible with: + // * `value_type.input_type` for `AddInput` mutations + Type value_type = 3; +} + +// Rule for determining which cells to delete during garbage collection. +message GcRule { + // A GcRule which deletes cells matching all of the given rules. + message Intersection { + // Only delete cells which would be deleted by every element of `rules`. + repeated GcRule rules = 1; + } + + // A GcRule which deletes cells matching any of the given rules. + message Union { + // Delete cells which would be deleted by any element of `rules`. + repeated GcRule rules = 1; + } + + // Garbage collection rules. + oneof rule { + // Delete all cells in a column except the most recent N. + int32 max_num_versions = 1; + + // Delete cells in a column older than the given age. + // Values must be at least one millisecond, and will be truncated to + // microsecond granularity. + google.protobuf.Duration max_age = 2; + + // Delete cells that would be deleted by every nested rule. + Intersection intersection = 3; + + // Delete cells that would be deleted by any nested rule. + Union union = 4; + } +} + +// Encryption information for a given resource. +// If this resource is protected with customer managed encryption, the in-use +// Cloud Key Management Service (Cloud KMS) key version is specified along with +// its status. +message EncryptionInfo { + // Possible encryption types for a resource. + enum EncryptionType { + // Encryption type was not specified, though data at rest remains encrypted. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // The data backing this resource is encrypted at rest with a key that is + // fully managed by Google. No key version or status will be populated. + // This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data backing this resource is encrypted at rest with a key that is + // managed by the customer. + // The in-use version of the key and its status are populated for + // CMEK-protected tables. + // CMEK-protected backups are pinned to the key version that was in use at + // the time the backup was taken. This key version is populated but its + // status is not tracked and is reported as `UNKNOWN`. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. The type of encryption used to protect this resource. + EncryptionType encryption_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of encrypt/decrypt calls on underlying data for + // this resource. Regardless of status, the existing data is always encrypted + // at rest. + google.rpc.Status encryption_status = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of the Cloud KMS key specified in the parent + // cluster that is in use for the data underlying this table. + string kms_key_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// A snapshot of a table at a particular time. A snapshot can be used as a +// checkpoint for data restoration or a data source for a new table. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. +message Snapshot { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Snapshot" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" + }; + + // Possible states of a snapshot. + enum State { + // The state of the snapshot could not be determined. + STATE_NOT_KNOWN = 0; + + // The snapshot has been successfully created and can serve all requests. + READY = 1; + + // The snapshot is currently being created, and may be destroyed if the + // creation process encounters an error. A snapshot may not be restored to a + // table while it is being created. + CREATING = 2; + } + + // The unique name of the snapshot. + // Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + string name = 1; + + // Output only. The source table at the time the snapshot was taken. + Table source_table = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the data in the source table at the time the + // snapshot was taken. In some cases, this value may be computed + // asynchronously via a background process and a placeholder of 0 will be used + // in the meantime. + int64 data_size_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the snapshot is created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time when the snapshot will be deleted. The maximum amount of time a + // snapshot can stay active is 365 days. If 'ttl' is not specified, + // the default maximum of 365 days will be used. + google.protobuf.Timestamp delete_time = 5; + + // Output only. The current state of the snapshot. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the snapshot. + string description = 7; +} + +// A backup of a Cloud Bigtable table. +message Backup { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/Backup" + pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" + }; + + // Indicates the current state of the backup. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1; + + // The backup is complete and ready for use. + READY = 2; + } + + // The type of the backup. + enum BackupType { + // Not specified. + BACKUP_TYPE_UNSPECIFIED = 0; + + // The default type for Cloud Bigtable managed backups. Supported for + // backups created in both HDD and SSD instances. Requires optimization when + // restored to a table in an SSD instance. + STANDARD = 1; + + // A backup type with faster restore to SSD performance. Only supported for + // backups created in SSD instances. A new SSD table restored from a hot + // backup reaches production performance more quickly than a standard + // backup. + HOT = 2; + } + + // A globally unique identifier for the backup which cannot be + // changed. Values are of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}/ + // backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` + // The final segment of the name must be between 1 and 50 characters + // in length. + // + // The backup is stored in the cluster identified by the prefix of the backup + // name of the form + // `projects/{project}/instances/{instance}/clusters/{cluster}`. + string name = 1; + + // Required. Immutable. Name of the table from which this backup was created. + // This needs to be in the same instance as the backup. Values are of the form + // `projects/{project}/instances/{instance}/tables/{source_table}`. + string source_table = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Name of the backup from which this backup was copied. If a + // backup is not created by copying a backup, this field will be empty. Values + // are of the form: + // projects//instances//clusters//backups/ + string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The expiration time of the backup. + // When creating a backup or updating its `expire_time`, the value must be + // greater than the backup creation time by: + // - At least 6 hours + // - At most 90 days + // + // Once the `expire_time` has passed, Cloud Bigtable will delete the backup. + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Output only. `start_time` is the time that the backup was started + // (i.e. approximately the time the + // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] + // request is received). The row data in this backup will be no older than + // this timestamp. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `end_time` is the time that the backup was finished. The row + // data in the backup will be no newer than this timestamp. + google.protobuf.Timestamp end_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the backup in bytes. + int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Indicates the backup type of the backup. + BackupType backup_type = 11; + + // The time at which the hot backup will be converted to a standard backup. + // Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the + // hot backup to a standard backup. This value must be greater than the backup + // creation time by: + // - At least 24 hours + // + // This field only applies for hot backups. When creating or updating a + // standard backup, attempting to set this field will fail the request. + google.protobuf.Timestamp hot_to_standard_time = 12; +} + +// Information about a backup. +message BackupInfo { + // Output only. Name of the backup. + string backup = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the backup was started. Row data in the backup + // will be no older than this timestamp. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This time that the backup was finished. Row data in the + // backup will be no newer than this timestamp. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the table the backup was created from. + string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the backup from which this backup was copied. If a + // backup is not created by copying a backup, this field will be empty. Values + // are of the form: + // projects//instances//clusters//backups/ + string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} + +// Config for tiered storage. +// A valid config must have a valid TieredStorageRule. Otherwise the whole +// TieredStorageConfig must be unset. +// By default all data is stored in the SSD tier (only SSD instances can +// configure tiered storage). +message TieredStorageConfig { + // Rule to specify what data is stored in the infrequent access(IA) tier. + // The IA tier allows storing more data per node with reduced performance. + TieredStorageRule infrequent_access = 1; +} + +// Rule to specify what data is stored in a storage tier. +message TieredStorageRule { + // Rules to specify what data is stored in this tier. + oneof rule { + // Include cells older than the given age. + // For the infrequent access tier, this value must be at least 30 days. + google.protobuf.Duration include_if_older_than = 1; + } +} + +// Represents a protobuf schema. +message ProtoSchema { + // Required. Contains a protobuf-serialized + // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto), + // which could include multiple proto files. + // To generate it, [install](https://grpc.io/docs/protoc-installation/) and + // run `protoc` with + // `--include_imports` and `--descriptor_set_out`. For example, to generate + // for moon/shot/app.proto, run + // ``` + // $protoc --proto_path=/app_path --proto_path=/lib_path \ + // --include_imports \ + // --descriptor_set_out=descriptors.pb \ + // moon/shot/app.proto + // ``` + // For more details, see protobuffer [self + // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + bytes proto_descriptors = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A named collection of related schemas. +message SchemaBundle { + option (google.api.resource) = { + type: "bigtableadmin.googleapis.com/SchemaBundle" + pattern: "projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}" + plural: "schemaBundles" + singular: "schemaBundle" + }; + + // Identifier. The unique name identifying this schema bundle. + // Values are of the form + // `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The type of this schema bundle. The oneof case cannot change after + // creation. + oneof type { + // Schema for Protobufs. + ProtoSchema proto_schema = 2; + } + + // Optional. The etag for this schema bundle. + // This may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. The server + // returns an ABORTED error on a mismatched etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto new file mode 100644 index 000000000000..adafda693b9b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto @@ -0,0 +1,445 @@ +// Copyright 2025 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. + +syntax = "proto3"; + +package google.bigtable.admin.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; +option go_package = "cloud.google.com/go/bigtable/admin/apiv2/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.bigtable.admin.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; +option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; + +// `Type` represents the type of data that is written to, read from, or stored +// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain +// familiarity and consistency across products and features. +// +// For compatibility with Bigtable's existing untyped APIs, each `Type` includes +// an `Encoding` which describes how to convert to or from the underlying data. +// +// Each encoding can operate in one of two modes: +// +// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)` +// if and only if `X <= Y`. This is useful anywhere sort order is important, +// for example when encoding keys. +// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then +// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For +// example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}" +// are valid encodings of the same JSON value. +// +// The API clearly documents which mode is used wherever an encoding can be +// configured. Each encoding also documents which values are supported in which +// modes. For example, when encoding INT64 as a numeric STRING, negative numbers +// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but +// `STRING("-00001") > STRING("00001")`. +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to or from lower level types. + message Encoding { + // Leaves the value as-is. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message Raw {} + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // String + // Values of type `String` are stored in `Value.string_value`. + message String { + // Rules used to convert to or from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding. + // + // Sorted mode: + // - All values are supported. + // - Code point order is preserved. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `TEXT` encoding + // - HBase `Bytes.toBytes` + // - Java `String#getBytes(StandardCharsets.UTF_8)` + message Utf8Bytes {} + + // Which encoding to use. + oneof encoding { + // Deprecated: if set, converts to an empty `utf8_bytes`. + Utf8Raw utf8_raw = 1 [deprecated = true]; + + // Use `Utf8Bytes` encoding. + Utf8Bytes utf8_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Int64 + // Values of type `Int64` are stored in `Value.int_value`. + message Int64 { + // Rules used to convert to or from lower level types. + message Encoding { + // Encodes the value as an 8-byte big-endian two's complement value. + // + // Sorted mode: non-negative values are supported. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1 [deprecated = true]; + } + + // Encodes the value in a variable length binary format of up to 10 bytes. + // Values that are closer to zero use fewer bytes. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + + // Use `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // bool + // Values of type `Bool` are stored in `Value.bool_value`. + message Bool {} + + // Float32 + // Values of type `Float32` are stored in `Value.float_value`. + message Float32 {} + + // Float64 + // Values of type `Float64` are stored in `Value.float_value`. + message Float64 {} + + // Timestamp + // Values of type `Timestamp` are stored in `Value.timestamp_value`. + message Timestamp { + // Rules used to convert to or from lower level types. + message Encoding { + // Which encoding to use. + oneof encoding { + // Encodes the number of microseconds since the Unix epoch using the + // given `Int64` encoding. Values must be microsecond-aligned. + // + // Compatible with: + // + // - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS` + Int64.Encoding unix_micros_int64 = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Date + // Values of type `Date` are stored in `Value.date_value`. + message Date {} + + // A structured data value, consisting of fields which map to dynamically + // typed values. + // Values of type `Struct` are stored in `Value.array_value` where entries are + // in the same order and number as `field_types`. + message Struct { + // A struct field and its type. + message Field { + // The field name (optional). Fields without a `field_name` are considered + // anonymous and cannot be referenced by name. + string field_name = 1; + + // The type of values in this field. + Type type = 2; + } + + // Rules used to convert to or from lower level types. + message Encoding { + // Uses the encoding of `fields[0].type` as-is. + // Only valid if `fields.size == 1`. + message Singleton {} + + // Fields are encoded independently and concatenated with a configurable + // `delimiter` in between. + // + // A struct with no fields defined is encoded as a single `delimiter`. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - Encoded field values must not contain any bytes <= `delimiter[0]` + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - Encoded field values must not contain `delimiter[0]`. + message DelimitedBytes { + // Byte sequence used to delimit concatenated fields. The delimiter must + // contain at least 1 character and at most 50 characters. + bytes delimiter = 1; + } + + // Fields are encoded independently and concatenated with the fixed byte + // pair {0x00, 0x01} in between. + // + // Any null (0x00) byte in an encoded field is replaced by the fixed byte + // pair {0x00, 0xFF}. + // + // Fields that encode to the empty string "" have special handling: + // + // - If *every* field encodes to "", or if the STRUCT has no fields + // defined, then the STRUCT is encoded as the fixed byte pair + // {0x00, 0x00}. + // - Otherwise, the STRUCT only encodes until the last non-empty field, + // omitting any trailing empty fields. Any empty fields that aren't + // omitted are replaced with the fixed byte pair {0x00, 0x00}. + // + // Examples: + // + // - STRUCT() -> "\00\00" + // - STRUCT("") -> "\00\00" + // - STRUCT("", "") -> "\00\00" + // - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "") -> "A" + // - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C" + // + // + // Since null bytes are always escaped, this encoding can cause size + // blowup for encodings like `Int64.BigEndianBytes` that are likely to + // produce many such bytes. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - All values supported by the field encodings are allowed + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - All values supported by the field encodings are allowed. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `Singleton` encoding. + Singleton singleton = 1; + + // Use `DelimitedBytes` encoding. + DelimitedBytes delimited_bytes = 2; + + // User `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 3; + } + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 2; + } + + // A protobuf message type. + // Values of type `Proto` are stored in `Value.bytes_value`. + message Proto { + // The ID of the schema bundle that this proto is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf message, including package. In + // the format of "foo.bar.Message". + string message_name = 2; + } + + // A protobuf enum type. + // Values of type `Enum` are stored in `Value.int_value`. + message Enum { + // The ID of the schema bundle that this enum is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf enum message, including package. + // In the format of "foo.bar.EnumMessage". + string enum_name = 2; + } + + // An ordered list of elements of a given type. + // Values of type `Array` are stored in `Value.array_value`. + message Array { + // The type of the elements in the array. This must not be `Array`. + Type element_type = 1; + } + + // A mapping of keys to values of a given type. + // Values of type `Map` are stored in a `Value.array_value` where each entry + // is another `Value.array_value` with two elements (the key and the value, + // in that order). + // Normally encoded Map values won't have repeated keys, however, clients are + // expected to handle the case in which they do. If the same key appears + // multiple times, the _last_ value takes precedence. + message Map { + // The type of a map key. + // Only `Bytes`, `String`, and `Int64` are allowed as key types. + Type key_type = 1; + + // The type of the values in a map. + Type value_type = 2; + } + + // A value that combines incremental updates into a summarized value. + // + // Data is never directly written or read using type `Aggregate`. Writes will + // provide either the `input_type` or `state_type`, and reads will always + // return the `state_type` . + message Aggregate { + // Computes the sum of the input values. + // Allowed input: `Int64` + // State: same as input + message Sum {} + + // Computes the max of the input values. + // Allowed input: `Int64` + // State: same as input + message Max {} + + // Computes the min of the input values. + // Allowed input: `Int64` + // State: same as input + message Min {} + + // Computes an approximate unique count over the input values. When using + // raw data as input, be careful to use a consistent encoding. Otherwise + // the same value encoded differently could count more than once, or two + // distinct values could count as identical. + // Input: Any, or omit for Raw + // State: TBD + // Special state conversions: `Int64` (the unique count estimate) + message HyperLogLogPlusPlusUniqueCount {} + + // Type of the inputs that are accumulated by this `Aggregate`, which must + // specify a full encoding. + // Use `AddInput` mutations to accumulate new inputs. + Type input_type = 1; + + // Output only. Type that holds the internal accumulator state for the + // `Aggregate`. This is a function of the `input_type` and `aggregator` + // chosen, and will always specify a full encoding. + Type state_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which aggregator function to use. The configured types must match. + oneof aggregator { + // Sum aggregator. + Sum sum = 4; + + // HyperLogLogPlusPlusUniqueCount aggregator. + HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + + // Max aggregator. + Max max = 6; + + // Min aggregator. + Min min = 7; + } + } + + // The kind of type that this represents. + oneof kind { + // Bytes + Bytes bytes_type = 1; + + // String + String string_type = 2; + + // Int64 + Int64 int64_type = 5; + + // Float32 + Float32 float32_type = 12; + + // Float64 + Float64 float64_type = 9; + + // Bool + Bool bool_type = 8; + + // Timestamp + Timestamp timestamp_type = 10; + + // Date + Date date_type = 11; + + // Aggregate + Aggregate aggregate_type = 6; + + // Struct + Struct struct_type = 7; + + // Array + Array array_type = 3; + + // Map + Map map_type = 4; + + // Proto + Proto proto_type = 13; + + // Enum + Enum enum_type = 14; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml b/java-bigtable/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..24ba9badcd8d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml @@ -0,0 +1,130 @@ + + + + + 7012 + com/google/bigtable/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/bigtable/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/bigtable/v2/*OrBuilder + boolean has*(*) + + + + + + 7002 + com/google/bigtable/v2/RequestStats* + ** + + + 8001 + com/google/bigtable/v2/AllReadStats* + + + 8001 + com/google/bigtable/v2/ReadEfficiencyStats* + + + 8001 + com/google/bigtable/v2/ReadIteratorStats* + + + 8001 + com/google/bigtable/v2/RequestStats$StatsCase + + + 6001 + com/google/bigtable/v2/ReadRowsRequest$RequestStatsView + REQUEST_STATS_EFFICIENCY + + + 6011 + com/google/bigtable/v2/ReadRowsRequest$RequestStatsView + REQUEST_STATS_EFFICIENCY_VALUE + + + 6011 + com/google/bigtable/v2/RequestStats + ALL_READ_STATS_FIELD_NUMBER + + + 6011 + com/google/bigtable/v2/RequestStats + READ_EFFICIENCY_STATS_FIELD_NUMBER + + + 6003 + com/google/bigtable/v2/ReadRowsRequest$RequestStatsView + REQUEST_STATS_FULL_VALUE + + + + + 7006 + com/google/bigtable/v2/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/bigtable/v2/** + * addRepeatedField(*) + ** + + + 7006 + com/google/bigtable/v2/** + * clear() + ** + + + 7006 + com/google/bigtable/v2/** + * clearField(*) + ** + + + 7006 + com/google/bigtable/v2/** + * clearOneof(*) + ** + + + 7006 + com/google/bigtable/v2/** + * clone() + ** + + + 7006 + com/google/bigtable/v2/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/bigtable/v2/** + * setField(*) + ** + + + 7006 + com/google/bigtable/v2/** + * setRepeatedField(*) + ** + + + 7006 + com/google/bigtable/v2/** + * setUnknownFields(*) + ** + + \ No newline at end of file diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/pom.xml b/java-bigtable/proto-google-cloud-bigtable-v2/pom.xml new file mode 100644 index 000000000000..5b2d64f4de7e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigtable-v2 + 2.77.2-SNAPSHOT + proto-google-cloud-bigtable-v2 + PROTO library for proto-google-cloud-bigtable-v2 + + com.google.cloud + google-cloud-bigtable-parent + 2.77.2-SNAPSHOT + + + + + + com.google.cloud + google-cloud-bigtable-deps-bom + 2.77.2-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-bigtable-bom + 2.77.2-SNAPSHOT + pom + import + + + + + + + com.google.api + api-common + compile + + + com.google.guava + guava + + + com.google.protobuf + protobuf-java + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java new file mode 100644 index 000000000000..313ec8d580a4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java @@ -0,0 +1,911 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * `ArrayValue` is an ordered list of `Value`.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ArrayValue} + */ +@com.google.protobuf.Generated +public final class ArrayValue extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ArrayValue) + ArrayValueOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ArrayValue"); + } + + // Use ArrayValue.newBuilder() to construct. + private ArrayValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ArrayValue() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ArrayValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ArrayValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ArrayValue.class, + com.google.bigtable.v2.ArrayValue.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List values_; + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + @java.lang.Override + public java.util.List getValuesOrBuilderList() { + return values_; + } + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Value getValues(int index) { + return values_.get(index); + } + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + 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 { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().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.ArrayValue)) { + return super.equals(obj); + } + com.google.bigtable.v2.ArrayValue other = (com.google.bigtable.v2.ArrayValue) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ArrayValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ArrayValue 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.ArrayValue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ArrayValue 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.ArrayValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ArrayValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ArrayValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ArrayValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ArrayValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ArrayValue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ArrayValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ArrayValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ArrayValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * `ArrayValue` is an ordered list of `Value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ArrayValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ArrayValue) + com.google.bigtable.v2.ArrayValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ArrayValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ArrayValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ArrayValue.class, + com.google.bigtable.v2.ArrayValue.Builder.class); + } + + // Construct using com.google.bigtable.v2.ArrayValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ArrayValue_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ArrayValue getDefaultInstanceForType() { + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ArrayValue build() { + com.google.bigtable.v2.ArrayValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ArrayValue buildPartial() { + com.google.bigtable.v2.ArrayValue result = new com.google.bigtable.v2.ArrayValue(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.ArrayValue result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.ArrayValue result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ArrayValue) { + return mergeFrom((com.google.bigtable.v2.ArrayValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ArrayValue other) { + if (other == com.google.bigtable.v2.ArrayValue.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.Value m = + input.readMessage(com.google.bigtable.v2.Value.parser(), extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public com.google.bigtable.v2.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder setValues(int index, com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder setValues(int index, com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder addValues(com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder addValues(int index, com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder addValues(com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder addValues(int index, com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder addAllValues(java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public com.google.bigtable.v2.Value.Builder getValuesBuilder(int index) { + return internalGetValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public com.google.bigtable.v2.Value.Builder addValuesBuilder() { + return internalGetValuesFieldBuilder() + .addBuilder(com.google.bigtable.v2.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public com.google.bigtable.v2.Value.Builder addValuesBuilder(int index) { + return internalGetValuesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * The ordered elements in the array.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + public java.util.List getValuesBuilderList() { + return internalGetValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ArrayValue) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ArrayValue) + private static final com.google.bigtable.v2.ArrayValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ArrayValue(); + } + + public static com.google.bigtable.v2.ArrayValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArrayValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ArrayValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java new file mode 100644 index 000000000000..1d0a4b98de98 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ArrayValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ArrayValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + java.util.List getValuesList(); + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + com.google.bigtable.v2.Value getValues(int index); + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + int getValuesCount(); + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + java.util.List getValuesOrBuilderList(); + + /** + * + * + *
+   * The ordered elements in the array.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 1; + */ + com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java new file mode 100644 index 000000000000..99ece5465fdd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2026 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 AuthorizedViewName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String table; + private final String authorizedView; + + @Deprecated + protected AuthorizedViewName() { + project = null; + instance = null; + table = null; + authorizedView = null; + } + + private AuthorizedViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + table = Preconditions.checkNotNull(builder.getTable()); + authorizedView = Preconditions.checkNotNull(builder.getAuthorizedView()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getAuthorizedView() { + return authorizedView; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AuthorizedViewName of( + String project, String instance, String table, String authorizedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setAuthorizedView(authorizedView) + .build(); + } + + public static String format( + String project, String instance, String table, String authorizedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .setAuthorizedView(authorizedView) + .build() + .toString(); + } + + public static AuthorizedViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.validatedMatch( + formattedString, "AuthorizedViewName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("instance"), + matchMap.get("table"), + matchMap.get("authorized_view")); + } + + 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 (AuthorizedViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.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); + } + if (table != null) { + fieldMapBuilder.put("table", table); + } + if (authorizedView != null) { + fieldMapBuilder.put("authorized_view", authorizedView); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_TABLE_AUTHORIZED_VIEW.instantiate( + "project", + project, + "instance", + instance, + "table", + table, + "authorized_view", + authorizedView); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AuthorizedViewName that = ((AuthorizedViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.table, that.table) + && Objects.equals(this.authorizedView, that.authorizedView); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(table); + h *= 1000003; + h ^= Objects.hashCode(authorizedView); + return h; + } + + /** + * Builder for + * projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}. + */ + public static class Builder { + private String project; + private String instance; + private String table; + private String authorizedView; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public String getAuthorizedView() { + return authorizedView; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setTable(String table) { + this.table = table; + return this; + } + + public Builder setAuthorizedView(String authorizedView) { + this.authorizedView = authorizedView; + return this; + } + + private Builder(AuthorizedViewName authorizedViewName) { + this.project = authorizedViewName.project; + this.instance = authorizedViewName.instance; + this.table = authorizedViewName.table; + this.authorizedView = authorizedViewName.authorizedView; + } + + public AuthorizedViewName build() { + return new AuthorizedViewName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java new file mode 100644 index 000000000000..587e10e50ea9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A request wrapper for operations on an authorized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class AuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.AuthorizedViewRequest) + AuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizedViewRequest"); + } + + // Use AuthorizedViewRequest.newBuilder() to construct. + private AuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuthorizedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewRequest.class, + com.google.bigtable.v2.AuthorizedViewRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + size += getUnknownFields().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.AuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.AuthorizedViewRequest other = + (com.google.bigtable.v2.AuthorizedViewRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest 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.AuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest 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.AuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.AuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request wrapper for operations on an authorized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.AuthorizedViewRequest) + com.google.bigtable.v2.AuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewRequest.class, + com.google.bigtable.v2.AuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.AuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.AuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest build() { + com.google.bigtable.v2.AuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest buildPartial() { + com.google.bigtable.v2.AuthorizedViewRequest result = + new com.google.bigtable.v2.AuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.AuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.AuthorizedViewRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.AuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.v2.AuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.AuthorizedViewRequest other) { + if (other == com.google.bigtable.v2.AuthorizedViewRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowRequest.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowRequest.newBuilder( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowRequest.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.AuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.AuthorizedViewRequest) + private static final com.google.bigtable.v2.AuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.AuthorizedViewRequest(); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..ab0b9e4e23b6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface AuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.AuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowRequest getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.AuthorizedViewRequest.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java new file mode 100644 index 000000000000..e7bfbdc73e11 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A response wrapper for operations on an authorized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewResponse} + */ +@com.google.protobuf.Generated +public final class AuthorizedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.AuthorizedViewResponse) + AuthorizedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizedViewResponse"); + } + + // Use AuthorizedViewResponse.newBuilder() to construct. + private AuthorizedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuthorizedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewResponse.class, + com.google.bigtable.v2.AuthorizedViewResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + size += getUnknownFields().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.AuthorizedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.AuthorizedViewResponse other = + (com.google.bigtable.v2.AuthorizedViewResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse 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.AuthorizedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse 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.AuthorizedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.AuthorizedViewResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A response wrapper for operations on an authorized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.AuthorizedViewResponse) + com.google.bigtable.v2.AuthorizedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewResponse.class, + com.google.bigtable.v2.AuthorizedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.AuthorizedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.AuthorizedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse build() { + com.google.bigtable.v2.AuthorizedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse buildPartial() { + com.google.bigtable.v2.AuthorizedViewResponse result = + new com.google.bigtable.v2.AuthorizedViewResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.AuthorizedViewResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.AuthorizedViewResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.AuthorizedViewResponse) { + return mergeFrom((com.google.bigtable.v2.AuthorizedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.AuthorizedViewResponse other) { + if (other == com.google.bigtable.v2.AuthorizedViewResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowResponse.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowResponse.newBuilder( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowResponse.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.AuthorizedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.AuthorizedViewResponse) + private static final com.google.bigtable.v2.AuthorizedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.AuthorizedViewResponse(); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AuthorizedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java new file mode 100644 index 000000000000..4c56458ed6d4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface AuthorizedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.AuthorizedViewResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowResponse getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.AuthorizedViewResponse.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java new file mode 100644 index 000000000000..e951f9ad6caa --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java @@ -0,0 +1,802 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Information about the connected backends from a session client's
+ * perspective. This information may be used to make choices about session
+ * re-establishment en-masse for sessions with the same backend identifiers.
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.BackendIdentifier} + */ +@com.google.protobuf.Generated +public final class BackendIdentifier extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.BackendIdentifier) + BackendIdentifierOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackendIdentifier"); + } + + // Use BackendIdentifier.newBuilder() to construct. + private BackendIdentifier(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackendIdentifier() { + applicationFrontendZone_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.BackendIdentifier.class, + com.google.bigtable.v2.BackendIdentifier.Builder.class); + } + + public static final int GOOGLE_FRONTEND_ID_FIELD_NUMBER = 1; + private long googleFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + public static final int APPLICATION_FRONTEND_ID_FIELD_NUMBER = 2; + private long applicationFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + public static final int APPLICATION_FRONTEND_ZONE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + @java.lang.Override + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + 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(); + applicationFrontendZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = 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 (googleFrontendId_ != 0L) { + output.writeInt64(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + output.writeInt64(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, applicationFrontendZone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (googleFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, applicationFrontendZone_); + } + size += getUnknownFields().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.BackendIdentifier)) { + return super.equals(obj); + } + com.google.bigtable.v2.BackendIdentifier other = (com.google.bigtable.v2.BackendIdentifier) obj; + + if (getGoogleFrontendId() != other.getGoogleFrontendId()) return false; + if (getApplicationFrontendId() != other.getApplicationFrontendId()) return false; + if (!getApplicationFrontendZone().equals(other.getApplicationFrontendZone())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GOOGLE_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGoogleFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getApplicationFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendZone().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier 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.BackendIdentifier parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier 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.BackendIdentifier parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.BackendIdentifier 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information about the connected backends from a session client's
+   * perspective. This information may be used to make choices about session
+   * re-establishment en-masse for sessions with the same backend identifiers.
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.BackendIdentifier} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.BackendIdentifier) + com.google.bigtable.v2.BackendIdentifierOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.BackendIdentifier.class, + com.google.bigtable.v2.BackendIdentifier.Builder.class); + } + + // Construct using com.google.bigtable.v2.BackendIdentifier.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + googleFrontendId_ = 0L; + applicationFrontendId_ = 0L; + applicationFrontendZone_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier getDefaultInstanceForType() { + return com.google.bigtable.v2.BackendIdentifier.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier build() { + com.google.bigtable.v2.BackendIdentifier result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier buildPartial() { + com.google.bigtable.v2.BackendIdentifier result = + new com.google.bigtable.v2.BackendIdentifier(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.BackendIdentifier result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.googleFrontendId_ = googleFrontendId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.applicationFrontendId_ = applicationFrontendId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.applicationFrontendZone_ = applicationFrontendZone_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.BackendIdentifier) { + return mergeFrom((com.google.bigtable.v2.BackendIdentifier) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.BackendIdentifier other) { + if (other == com.google.bigtable.v2.BackendIdentifier.getDefaultInstance()) return this; + if (other.getGoogleFrontendId() != 0L) { + setGoogleFrontendId(other.getGoogleFrontendId()); + } + if (other.getApplicationFrontendId() != 0L) { + setApplicationFrontendId(other.getApplicationFrontendId()); + } + if (!other.getApplicationFrontendZone().isEmpty()) { + applicationFrontendZone_ = other.applicationFrontendZone_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + googleFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + applicationFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + applicationFrontendZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long googleFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @param value The googleFrontendId to set. + * @return This builder for chaining. + */ + public Builder setGoogleFrontendId(long value) { + + googleFrontendId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearGoogleFrontendId() { + bitField0_ = (bitField0_ & ~0x00000001); + googleFrontendId_ = 0L; + onChanged(); + return this; + } + + private long applicationFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @param value The applicationFrontendId to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendId(long value) { + + applicationFrontendId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendId() { + bitField0_ = (bitField0_ & ~0x00000002); + applicationFrontendId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @param value The applicationFrontendZone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendZone() { + applicationFrontendZone_ = getDefaultInstance().getApplicationFrontendZone(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @param value The bytes for applicationFrontendZone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.BackendIdentifier) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.BackendIdentifier) + private static final com.google.bigtable.v2.BackendIdentifier DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.BackendIdentifier(); + } + + public static com.google.bigtable.v2.BackendIdentifier getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackendIdentifier parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BackendIdentifier getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java new file mode 100644 index 000000000000..e9662179256c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface BackendIdentifierOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.BackendIdentifier) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + long getGoogleFrontendId(); + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + long getApplicationFrontendId(); + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + java.lang.String getApplicationFrontendZone(); + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + com.google.protobuf.ByteString getApplicationFrontendZoneBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java new file mode 100644 index 000000000000..da1b7d619751 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java @@ -0,0 +1,877 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class BigtableProto extends com.google.protobuf.GeneratedFile { + private BigtableProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BigtableProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadRowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RateLimitInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RateLimitInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ExecuteQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_PrepareQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_PrepareQueryResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "!google/bigtable/v2/bigtable.proto\022\022goo" + + "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\030google/api/routing.proto\032\035go" + + "ogle/bigtable/v2/data.proto\032&google/bigtable/v2/request_stats.proto\032 google/bigt" + + "able/v2/session.proto\032\036google/bigtable/v" + + "2/types.proto\032\036google/protobuf/duration." + + "proto\032\037google/protobuf/timestamp.proto\032\036" + + "google/protobuf/wrappers.proto\032\027google/rpc/status.proto\"\314\004\n" + + "\017ReadRowsRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\t \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022U\n" + + "\026materialized_view_name\030\013 \001(\tB5\340A\001\372A/\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022\026\n" + + "\016app_profile_id\030\005 \001(\t\022(\n" + + "\004rows\030\002 \001(\0132\032.google.bigtable.v2.RowSet\022-\n" + + "\006filter\030\003 \001(\0132\035.google.bigtable.v2.RowFilter\022\022\n\n" + + "rows_limit\030\004 \001(\003\022P\n" + + "\022request_stats_view\030\006 \001(\01624.google." + + "bigtable.v2.ReadRowsRequest.RequestStatsView\022\020\n" + + "\010reversed\030\007 \001(\010\"f\n" + + "\020RequestStatsView\022\"\n" + + "\036REQUEST_STATS_VIEW_UNSPECIFIED\020\000\022\026\n" + + "\022REQUEST_STATS_NONE\020\001\022\026\n" + + "\022REQUEST_STATS_FULL\020\002\"\261\003\n" + + "\020ReadRowsResponse\022>\n" + + "\006chunks\030\001 \003(\0132..google.bigtable.v2.ReadRowsResponse.CellChunk\022\034\n" + + "\024last_scanned_row_key\030\002 \001(\014\0227\n\r" + + "request_stats\030\003 \001(\0132 .google.bigtable.v2.RequestStats\032\205\002\n" + + "\tCellChunk\022\017\n" + + "\007row_key\030\001 \001(\014\0221\n" + + "\013family_name\030\002 \001(\0132\034.google.protobuf.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\n" + + "value_size\030\007 \001(\005\022\023\n" + + "\treset_row\030\010 \001(\010H\000\022\024\n\n" + + "commit_row\030\t \001(\010H\000B\014\n\n" + + "row_status\"\230\002\n" + + "\024SampleRowKeysRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\004 \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022U\n" + + "\026materialized_view_name\030\005 \001(\tB5\340A\001\372A/\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022\026\n" + + "\016app_profile_id\030\002 \001(\t\">\n" + + "\025SampleRowKeysResponse\022\017\n" + + "\007row_key\030\001 \001(\014\022\024\n" + + "\014offset_bytes\030\002 \001(\003\"\277\002\n" + + "\020MutateRowRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\006 \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\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\0224\n" + + "\013idempotency\030\010 \001(\0132\037.google.bigtable.v2.Idempotency\"\023\n" + + "\021MutateRowResponse\"\210\003\n" + + "\021MutateRowsRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\005 \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022\026\n" + + "\016app_profile_id\030\003 \001(\t\022A\n" + + "\007entries\030\002" + + " \003(\0132+.google.bigtable.v2.MutateRowsRequest.EntryB\003\340A\002\032\204\001\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\0224\n" + + "\013idempotency\030\003 \001(\0132\037.google.bigtable.v2.Idempotency\"\344\001\n" + + "\022MutateRowsResponse\022=\n" + + "\007entries\030\001 \003(\0132,.google.bigtable.v2.MutateRowsResponse.Entry\022?\n" + + "\017rate_limit_info\030\003 \001(\0132!" + + ".google.bigtable.v2.RateLimitInfoH\000\210\001\001\032:\n" + + "\005Entry\022\r\n" + + "\005index\030\001 \001(\003\022\"\n" + + "\006status\030\002 \001(\0132\022.google.rpc.StatusB\022\n" + + "\020_rate_limit_info\"J\n\r" + + "RateLimitInfo\022)\n" + + "\006period\030\001 \001(\0132\031.google.protobuf.Duration\022\016\n" + + "\006factor\030\002 \001(\001\"\201\003\n" + + "\030CheckAndMutateRowRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\t \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\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" + + "\017false_mutations\030\005 \003(\0132\034.google.bigtable.v2.Mutation\"6\n" + + "\031CheckAndMutateRowResponse\022\031\n" + + "\021predicate_matched\030\001 \001(\010\"i\n" + + "\022PingAndWarmRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\026\n" + + "\016app_profile_id\030\002 \001(\t\"\025\n" + + "\023PingAndWarmResponse\"\231\002\n" + + "\031ReadModifyWriteRowRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022Q\n" + + "\024authorized_view_name\030\006 \001(\tB3\340A\001\372A-\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\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\'.google.bigtable.v2.ReadModifyWriteRuleB\003\340A\002\"B\n" + + "\032ReadModifyWriteRowResponse\022$\n" + + "\003row\030\001 \001(\0132\027.google.bigtable.v2.Row\"\206\001\n" + + ",GenerateInitialChangeStreamPartitionsRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022\026\n" + + "\016app_profile_id\030\002 \001(\t\"g\n" + + "-GenerateInitialChangeStreamPartitionsResponse\0226\n" + + "\tpartition\030\001 \001(\0132#.google.bigtable.v2.StreamPartition\"\233\003\n" + + "\027ReadChangeStreamRequest\022>\n\n" + + "table_name\030\001 \001(\tB*\340A\002\372A$\n" + + "\"bigtableadmin.googleapis.com/Table\022\026\n" + + "\016app_profile_id\030\002 \001(\t\0226\n" + + "\tpartition\030\003 \001(\0132#.google.bigtable.v2.StreamPartition\0220\n\n" + + "start_time\030\004 \001(\0132\032.google.protobuf.TimestampH\000\022K\n" + + "\023continuation_tokens\030\006" + + " \001(\0132,.google.bigtable.v2.StreamContinuationTokensH\000\022,\n" + + "\010end_time\030\005 \001(\0132\032.google.protobuf.Timestamp\0225\n" + + "\022heartbeat_duration\030\007 \001(\0132\031.google.protobuf.DurationB\014\n\n" + + "start_from\"\251\n\n" + + "\030ReadChangeStreamResponse\022N\n" + + "\013data_change\030\001 \001(\01327.google.bigt" + + "able.v2.ReadChangeStreamResponse.DataChangeH\000\022K\n" + + "\theartbeat\030\002 \001(\01326.google.bigtab" + + "le.v2.ReadChangeStreamResponse.HeartbeatH\000\022P\n" + + "\014close_stream\030\003 \001(\01328.google.bigtab" + + "le.v2.ReadChangeStreamResponse.CloseStreamH\000\032\364\001\n\r" + + "MutationChunk\022X\n\n" + + "chunk_info\030\001 \001" + + "(\0132D.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo\022.\n" + + "\010mutation\030\002 \001(\0132\034.google.bigtable.v2.Mutation\032Y\n" + + "\tChunkInfo\022\032\n" + + "\022chunked_value_size\030\001 \001(\005\022\034\n" + + "\024chunked_value_offset\030\002 \001(\005\022\022\n\n" + + "last_chunk\030\003 \001(\010\032\306\003\n\n" + + "DataChange\022J\n" + + "\004type\030\001 \001(\016" + + "2<.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type\022\031\n" + + "\021source_cluster_id\030\002 \001(\t\022\017\n" + + "\007row_key\030\003 \001(\014\0224\n" + + "\020commit_timestamp\030\004 \001(\0132\032.google.protobuf.Timestamp\022\022\n\n" + + "tiebreaker\030\005 \001(\005\022J\n" + + "\006chunks\030\006 \003(\0132:.g" + + "oogle.bigtable.v2.ReadChangeStreamResponse.MutationChunk\022\014\n" + + "\004done\030\010 \001(\010\022\r\n" + + "\005token\030\t \001(\t\022;\n" + + "\027estimated_low_watermark\030\n" + + " \001(\0132\032.google.protobuf.Timestamp\"P\n" + + "\004Type\022\024\n" + + "\020TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004USER\020\001\022\026\n" + + "\022GARBAGE_COLLECTION\020\002\022\020\n" + + "\014CONTINUATION\020\003\032\221\001\n" + + "\tHeartbeat\022G\n" + + "\022continuation_token\030\001" + + " \001(\0132+.google.bigtable.v2.StreamContinuationToken\022;\n" + + "\027estimated_low_watermark\030\002" + + " \001(\0132\032.google.protobuf.Timestamp\032\270\001\n" + + "\013CloseStream\022\"\n" + + "\006status\030\001 \001(\0132\022.google.rpc.Status\022H\n" + + "\023continuation_tokens\030\002" + + " \003(\0132+.google.bigtable.v2.StreamContinuationToken\022;\n" + + "\016new_partitions\030\003 \003(\0132#.google.bigtable.v2.StreamPartitionB\017\n\r" + + "stream_record\"\241\003\n" + + "\023ExecuteQueryRequest\022D\n\r" + + "instance_name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\033\n" + + "\016app_profile_id\030\002 \001(\tB\003\340A\001\022\024\n" + + "\005query\030\003 \001(\tB\005\030\001\340A\002\022\026\n" + + "\016prepared_query\030\t \001(\014\022;\n" + + "\014proto_format\030\004" + + " \001(\0132\037.google.bigtable.v2.ProtoFormatB\002\030\001H\000\022\031\n" + + "\014resume_token\030\010 \001(\014B\003\340A\001\022H\n" + + "\006params\030\007" + + " \003(\01323.google.bigtable.v2.ExecuteQueryRequest.ParamsEntryB\003\340A\002\032H\n" + + "\013ParamsEntry\022\013\n" + + "\003key\030\001 \001(\t\022(\n" + + "\005value\030\002 \001(\0132\031.google.bigtable.v2.Value:\0028\001B\r\n" + + "\013data_format\"\226\001\n" + + "\024ExecuteQueryResponse\0229\n" + + "\010metadata\030\001 \001(\0132%.google.bigtable.v2.ResultSetMetadataH\000\0227\n" + + "\007results\030\002 \001(\0132$.google.bigtable.v2.PartialResultSetH\000B\n\n" + + "\010response\"\364\002\n" + + "\023PrepareQueryRequest\022D\n\r" + + "instance_name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\033\n" + + "\016app_profile_id\030\002 \001(\tB\003\340A\001\022\022\n" + + "\005query\030\003 \001(\tB\003\340A\002\0227\n" + + "\014proto_format\030\004 \001(\0132\037.google.bigtable.v2.ProtoFormatH\000\022Q\n" + + "\013param_types\030\006" + + " \003(\01327.google.bigtable.v2.PrepareQueryRequest.ParamTypesEntryB\003\340A\002\032K\n" + + "\017ParamTypesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\'\n" + + "\005value\030\002 \001(\0132\030.google.bigtable.v2.Type:\0028\001B\r\n" + + "\013data_format\"\230\001\n" + + "\024PrepareQueryResponse\0227\n" + + "\010metadata\030\001 \001(\0132%.google.bigtable.v2.ResultSetMetadata\022\026\n" + + "\016prepared_query\030\002 \001(\014\022/\n" + + "\013valid_until\030\003 \001(\0132\032.google.protobuf.Timestamp2\215+\n" + + "\010Bigtable\022\325\004\n" + + "\010ReadRows\022#.google.b" + + "igtable.v2.ReadRowsRequest\032$.google.bigtable.v2.ReadRowsResponse\"\373\003\332A\n" + + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002\361\001\"9/v2" + + "/{table_name=projects/*/instances/*/tables/*}:readRows:\001*ZZ\"U/v2/{authorized_vie" + + "w_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows:\001*ZU\"P/v2/{ma" + + "terialized_view_name=projects/*/instance" + + "s/*/materializedViews/*}:readRows:\001*\212\323\344\223\002\323\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022:\n" + + "\026materialized_view_name\022 {name=projects/*/instances/*}/**0\001\022\352\004\n\r" + + "SampleRowKeys\022(.google.bigtable.v2.SampleRowKeysRequest\032).g" + + "oogle.bigtable.v2.SampleRowKeysResponse\"\201\004\332A\n" + + "table_name\332A\031table_name,app_profile" + + "_id\202\323\344\223\002\367\001\022>/v2/{table_name=projects/*/i" + + "nstances/*/tables/*}:sampleRowKeysZ\\\022Z/v2/{authorized_view_name=projects/*/insta" + + "nces/*/tables/*/authorizedViews/*}:sampleRowKeysZW\022U/v2/{materialized_view_name=" + + "projects/*/instances/*/materializedViews/*}:sampleRowKeys\212\323\344\223\002\323\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022:\n" + + "\026materialized_view_name\022 {name=projects/*/instances/*}/**0\001\022\351\003\n" + + "\tMutateRow\022$.google.bigtable.v2.MutateRowRequest\032%.google.bigtable.v2.MutateRow" + + "Response\"\216\003\332A\034table_name,row_key,mutatio" + + "ns\332A+table_name,row_key,mutations,app_pr" + + "ofile_id\202\323\344\223\002\234\001\":/v2/{table_name=project" + + "s/*/instances/*/tables/*}:mutateRow:\001*Z[\"V/v2/{authorized_view_name=projects/*/i" + + "nstances/*/tables/*/authorizedViews/*}:mutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024authorized_view_name" + + "\022/{table_name=projects/*/instances/*/tables/*}/**\022\334\003\n\n" + + "MutateRows\022%.google.bigtable.v2.MutateRowsRequest\032&.google.bigtabl" + + "e.v2.MutateRowsResponse\"\374\002\332A\022table_name," + + "entries\332A!table_name,entries,app_profile" + + "_id\202\323\344\223\002\236\001\";/v2/{table_name=projects/*/i" + + "nstances/*/tables/*}:mutateRows:\001*Z\\\"W/v2/{authorized_view_name=projects/*/insta" + + "nces/*/tables/*/authorizedViews/*}:mutateRows:\001*\212\323\344\223\002\227\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024authorized_view_name\022/{" + + "table_name=projects/*/instances/*/tables/*}/**0\001\022\335\004\n" + + "\021CheckAndMutateRow\022,.google.bigtable.v2.CheckAndMutateRowRequest\032-.g" + + "oogle.bigtable.v2.CheckAndMutateRowRespo" + + "nse\"\352\003\332ABtable_name,row_key,predicate_fi" + + "lter,true_mutations,false_mutations\332AQtable_name,row_key,predicate_filter,true_m" + + "utations,false_mutations,app_profile_id\202" + + "\323\344\223\002\254\001\"B/v2/{table_name=projects/*/insta" + + "nces/*/tables/*}:checkAndMutateRow:\001*Zc\"^/v2/{authorized_view_name=projects/*/in" + + "stances/*/tables/*/authorizedViews/*}:checkAndMutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024authorized_vi" + + "ew_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\356\001\n" + + "\013PingAndWarm\022&.google.bigtable.v2.PingAndWarmRequest\032\'.googl" + + "e.bigtable.v2.PingAndWarmResponse\"\215\001\332A\004n" + + "ame\332A\023name,app_profile_id\202\323\344\223\002+\"&/v2/{na" + + "me=projects/*/instances/*}:ping:\001*\212\323\344\223\0029\022%\n" + + "\004name\022\035{name=projects/*/instances/*}\022\020\n" + + "\016app_profile_id\022\216\004\n" + + "\022ReadModifyWriteRow\022-.google.bigtable.v2.ReadModifyWriteRow" + + "Request\032..google.bigtable.v2.ReadModifyW" + + "riteRowResponse\"\230\003\332A\030table_name,row_key," + + "rules\332A\'table_name,row_key,rules,app_pro" + + "file_id\202\323\344\223\002\256\001\"C/v2/{table_name=projects" + + "/*/instances/*/tables/*}:readModifyWriteRow:\001*Zd\"_/v2/{authorized_view_name=proj" + + "ects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + + "\016app_profile_id\022G\n" + + "\024aut" + + "horized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\273\002\n" + + "%GenerateInitialChangeStreamPartitions\022@.google.bi" + + "gtable.v2.GenerateInitialChangeStreamPartitionsRequest\032A.google.bigtable.v2.Gene" + + "rateInitialChangeStreamPartitionsResponse\"\212\001\332A\n" + + "table_name\332A\031table_name,app_profi" + + "le_id\202\323\344\223\002[\"V/v2/{table_name=projects/*/" + + "instances/*/tables/*}:generateInitialChangeStreamPartitions:\001*0\001\022\346\001\n" + + "\020ReadChangeStream\022+.google.bigtable.v2.ReadChangeStr" + + "eamRequest\032,.google.bigtable.v2.ReadChangeStreamResponse\"u\332A\n" + + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002F\"A/v2/{table_na" + + "me=projects/*/instances/*/tables/*}:readChangeStream:\001*0\001\022\251\002\n" + + "\014PrepareQuery\022\'.google.bigtable.v2.PrepareQueryRequest\032(.go" + + "ogle.bigtable.v2.PrepareQueryResponse\"\305\001" + + "\332A\023instance_name,query\332A\"instance_name,q" + + "uery,app_profile_id\202\323\344\223\002<\"7/v2/{instance" + + "_name=projects/*/instances/*}:prepareQuery:\001*\212\323\344\223\002B\022.\n\r" + + "instance_name\022\035{name=projects/*/instances/*}\022\020\n" + + "\016app_profile_id\022\253\002\n" + + "\014ExecuteQuery\022\'.google.bigtable.v2.Exec" + + "uteQueryRequest\032(.google.bigtable.v2.Exe" + + "cuteQueryResponse\"\305\001\332A\023instance_name,que" + + "ry\332A\"instance_name,query,app_profile_id\202" + + "\323\344\223\002<\"7/v2/{instance_name=projects/*/instances/*}:executeQuery:\001*\212\323\344\223\002B\022.\n\r" + + "instance_name\022\035{name=projects/*/instances/*}\022\020\n" + + "\016app_profile_id0\001\022v\n" + + "\026GetClientConfiguration\0221.google.bigtable.v2.GetClientConf" + + "igurationRequest\032\'.google.bigtable.v2.ClientConfiguration\"\000\022`\n" + + "\tOpenTable\022\".googl" + + "e.bigtable.v2.SessionRequest\032#.google.bigtable.v2.SessionResponse\"\006\240\320\245\216\004\001(\0010\001\022i\n" + + "\022OpenAuthorizedView\022\".google.bigtable.v2" + + ".SessionRequest\032#.google.bigtable.v2.SessionResponse\"\006\240\320\245\216\004\002(\0010\001\022k\n" + + "\024OpenMaterializedView\022\".google.bigtable.v2.SessionReq" + + "uest\032#.google.bigtable.v2.SessionRespons" + + "e\"\006\240\320\245\216\004\003(\0010\001\032\333\002\312A\027bigtable.googleapis.c" + + "om\322A\275\002https://www.googleapis.com/auth/bi" + + "gtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,https://www.g" + + "oogleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/auth/cloud-big" + + "table.data.readonly,https://www.googleapis.com/auth/cloud-platform,https://www.g" + + "oogleapis.com/auth/cloud-platform.read-onlyB\365\004\n" + + "\026com.google.bigtable.v2B\r" + + "BigtableProtoP\001Z8cloud.google.com/go/bigtable/ap" + + "iv2/bigtablepb;bigtablepb\252\002\030Google.Cloud" + + ".Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Google::Cloud::Bigtable::V2\352AP\n" + + "%bigtab" + + "leadmin.googleapis.com/Instance\022\'projects/{project}/instances/{instance}\352A\\\n" + + "\"bigtableadmin.googleapis.com/Table\0226project" + + "s/{project}/instances/{instance}/tables/{table}\352A\207\001\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022Xprojects/{project}/ins" + + "tances/{instance}/tables/{table}/authorizedViews/{authorized_view}\352A~\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022Mpr" + + "ojects/{project}/instances/{instance}/materializedViews/{materialized_view}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + 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.bigtable.v2.RequestStatsProto.getDescriptor(), + com.google.bigtable.v2.SessionProto.getDescriptor(), + com.google.bigtable.v2.TypesProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_ReadRowsRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadRowsRequest_descriptor, + new java.lang.String[] { + "TableName", + "AuthorizedViewName", + "MaterializedViewName", + "AppProfileId", + "Rows", + "Filter", + "RowsLimit", + "RequestStatsView", + "Reversed", + }); + internal_static_google_bigtable_v2_ReadRowsResponse_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadRowsResponse_descriptor, + new java.lang.String[] { + "Chunks", "LastScannedRowKey", "RequestStats", + }); + internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor = + internal_static_google_bigtable_v2_ReadRowsResponse_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor, + new java.lang.String[] { + "RowKey", + "FamilyName", + "Qualifier", + "TimestampMicros", + "Labels", + "Value", + "ValueSize", + "ResetRow", + "CommitRow", + "RowStatus", + }); + internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor, + new java.lang.String[] { + "TableName", "AuthorizedViewName", "MaterializedViewName", "AppProfileId", + }); + internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor, + new java.lang.String[] { + "RowKey", "OffsetBytes", + }); + internal_static_google_bigtable_v2_MutateRowRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowRequest_descriptor, + new java.lang.String[] { + "TableName", + "AuthorizedViewName", + "AppProfileId", + "RowKey", + "Mutations", + "Idempotency", + }); + internal_static_google_bigtable_v2_MutateRowResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_MutateRowsRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowsRequest_descriptor, + new java.lang.String[] { + "TableName", "AuthorizedViewName", "AppProfileId", "Entries", + }); + internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor = + internal_static_google_bigtable_v2_MutateRowsRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor, + new java.lang.String[] { + "RowKey", "Mutations", "Idempotency", + }); + internal_static_google_bigtable_v2_MutateRowsResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowsResponse_descriptor, + new java.lang.String[] { + "Entries", "RateLimitInfo", + }); + internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor = + internal_static_google_bigtable_v2_MutateRowsResponse_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor, + new java.lang.String[] { + "Index", "Status", + }); + internal_static_google_bigtable_v2_RateLimitInfo_descriptor = getDescriptor().getMessageType(8); + internal_static_google_bigtable_v2_RateLimitInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RateLimitInfo_descriptor, + new java.lang.String[] { + "Period", "Factor", + }); + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor, + new java.lang.String[] { + "TableName", + "AuthorizedViewName", + "AppProfileId", + "RowKey", + "PredicateFilter", + "TrueMutations", + "FalseMutations", + }); + internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor, + new java.lang.String[] { + "PredicateMatched", + }); + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor, + new java.lang.String[] { + "Name", "AppProfileId", + }); + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor, + new java.lang.String[] { + "TableName", "AuthorizedViewName", "AppProfileId", "RowKey", "Rules", + }); + internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor, + new java.lang.String[] { + "Row", + }); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor, + new java.lang.String[] { + "TableName", "AppProfileId", + }); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor, + new java.lang.String[] { + "Partition", + }); + internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_bigtable_v2_ReadChangeStreamRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor, + new java.lang.String[] { + "TableName", + "AppProfileId", + "Partition", + "StartTime", + "ContinuationTokens", + "EndTime", + "HeartbeatDuration", + "StartFrom", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor, + new java.lang.String[] { + "DataChange", "Heartbeat", "CloseStream", "StreamRecord", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor = + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor, + new java.lang.String[] { + "ChunkInfo", "Mutation", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor = + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor + .getNestedType(0); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor, + new java.lang.String[] { + "ChunkedValueSize", "ChunkedValueOffset", "LastChunk", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor = + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor, + new java.lang.String[] { + "Type", + "SourceClusterId", + "RowKey", + "CommitTimestamp", + "Tiebreaker", + "Chunks", + "Done", + "Token", + "EstimatedLowWatermark", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor = + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor, + new java.lang.String[] { + "ContinuationToken", "EstimatedLowWatermark", + }); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor = + internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor.getNestedType(3); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor, + new java.lang.String[] { + "Status", "ContinuationTokens", "NewPartitions", + }); + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_bigtable_v2_ExecuteQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor, + new java.lang.String[] { + "InstanceName", + "AppProfileId", + "Query", + "PreparedQuery", + "ProtoFormat", + "ResumeToken", + "Params", + "DataFormat", + }); + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor = + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor, + new java.lang.String[] { + "Metadata", "Results", "Response", + }); + internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_bigtable_v2_PrepareQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor, + new java.lang.String[] { + "InstanceName", "AppProfileId", "Query", "ProtoFormat", "ParamTypes", "DataFormat", + }); + internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_descriptor = + internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor = + getDescriptor().getMessageType(22); + internal_static_google_bigtable_v2_PrepareQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor, + new java.lang.String[] { + "Metadata", "PreparedQuery", "ValidUntil", + }); + descriptor.resolveAllFeaturesImmutable(); + 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.bigtable.v2.RequestStatsProto.getDescriptor(); + com.google.bigtable.v2.SessionProto.getDescriptor(); + com.google.bigtable.v2.TypesProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + 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); + registry.add(com.google.bigtable.v2.SessionProto.rpcSessionType); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java new file mode 100644 index 000000000000..17f06c8b622e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java @@ -0,0 +1,913 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies (some of) the contents of a single row/column/timestamp of a table.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Cell} + */ +@com.google.protobuf.Generated +public final class Cell extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Cell) + CellOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Cell"); + } + + // Use Cell.newBuilder() to construct. + private Cell(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Cell() { + value_ = com.google.protobuf.ByteString.EMPTY; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Cell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Cell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Cell.class, com.google.bigtable.v2.Cell.Builder.class); + } + + public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 1; + private long timestampMicros_ = 0L; + + /** + * + * + *
+   * The cell's stored timestamp, which also uniquely identifies it within
+   * its column.
+   * Values are always expressed in microseconds, but individual tables may set
+   * a coarser granularity to further restrict the allowed values. For
+   * example, a table which specifies millisecond granularity will only allow
+   * values of `timestamp_micros` which are multiples of 1000.
+   * 
+ * + * int64 timestamp_micros = 1; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The value stored in the cell.
+   * May contain any byte string, including the empty string, up to 100MiB in
+   * length.
+   * 
+ * + * bytes value = 2; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + public static final int LABELS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @return A list containing the labels. + */ + public com.google.protobuf.ProtocolStringList getLabelsList() { + return labels_; + } + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @return The count of labels. + */ + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + public java.lang.String getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + public com.google.protobuf.ByteString getLabelsBytes(int index) { + return labels_.getByteString(index); + } + + 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 (timestampMicros_ != 0L) { + output.writeInt64(1, timestampMicros_); + } + if (!value_.isEmpty()) { + output.writeBytes(2, value_); + } + for (int i = 0; i < labels_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, labels_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timestampMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, timestampMicros_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, value_); + } + { + int dataSize = 0; + for (int i = 0; i < labels_.size(); i++) { + dataSize += computeStringSizeNoTag(labels_.getRaw(i)); + } + size += dataSize; + size += 1 * getLabelsList().size(); + } + size += getUnknownFields().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.Cell)) { + return super.equals(obj); + } + com.google.bigtable.v2.Cell other = (com.google.bigtable.v2.Cell) obj; + + if (getTimestampMicros() != other.getTimestampMicros()) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getLabelsList().equals(other.getLabelsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestampMicros()); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + if (getLabelsCount() > 0) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + getLabelsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Cell parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Cell 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.Cell parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Cell 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.Cell parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Cell parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Cell parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Cell parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Cell parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Cell parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Cell parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Cell parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Cell 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies (some of) the contents of a single row/column/timestamp of a table.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Cell} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Cell) + com.google.bigtable.v2.CellOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Cell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Cell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Cell.class, com.google.bigtable.v2.Cell.Builder.class); + } + + // Construct using com.google.bigtable.v2.Cell.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestampMicros_ = 0L; + value_ = com.google.protobuf.ByteString.EMPTY; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Cell_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Cell getDefaultInstanceForType() { + return com.google.bigtable.v2.Cell.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Cell build() { + com.google.bigtable.v2.Cell result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Cell buildPartial() { + com.google.bigtable.v2.Cell result = new com.google.bigtable.v2.Cell(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Cell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestampMicros_ = timestampMicros_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + labels_.makeImmutable(); + result.labels_ = labels_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Cell) { + return mergeFrom((com.google.bigtable.v2.Cell) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Cell other) { + if (other == com.google.bigtable.v2.Cell.getDefaultInstance()) return this; + if (other.getTimestampMicros() != 0L) { + setTimestampMicros(other.getTimestampMicros()); + } + if (!other.getValue().isEmpty()) { + setValue(other.getValue()); + } + if (!other.labels_.isEmpty()) { + if (labels_.isEmpty()) { + labels_ = other.labels_; + bitField0_ |= 0x00000004; + } else { + ensureLabelsIsMutable(); + labels_.addAll(other.labels_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + timestampMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + value_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLabelsIsMutable(); + labels_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long timestampMicros_; + + /** + * + * + *
+     * The cell's stored timestamp, which also uniquely identifies it within
+     * its column.
+     * Values are always expressed in microseconds, but individual tables may set
+     * a coarser granularity to further restrict the allowed values. For
+     * example, a table which specifies millisecond granularity will only allow
+     * values of `timestamp_micros` which are multiples of 1000.
+     * 
+ * + * int64 timestamp_micros = 1; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + /** + * + * + *
+     * The cell's stored timestamp, which also uniquely identifies it within
+     * its column.
+     * Values are always expressed in microseconds, but individual tables may set
+     * a coarser granularity to further restrict the allowed values. For
+     * example, a table which specifies millisecond granularity will only allow
+     * values of `timestamp_micros` which are multiples of 1000.
+     * 
+ * + * int64 timestamp_micros = 1; + * + * @param value The timestampMicros to set. + * @return This builder for chaining. + */ + public Builder setTimestampMicros(long value) { + + timestampMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cell's stored timestamp, which also uniquely identifies it within
+     * its column.
+     * Values are always expressed in microseconds, but individual tables may set
+     * a coarser granularity to further restrict the allowed values. For
+     * example, a table which specifies millisecond granularity will only allow
+     * values of `timestamp_micros` which are multiples of 1000.
+     * 
+ * + * int64 timestamp_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearTimestampMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + timestampMicros_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The value stored in the cell.
+     * May contain any byte string, including the empty string, up to 100MiB in
+     * length.
+     * 
+ * + * bytes value = 2; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + /** + * + * + *
+     * The value stored in the cell.
+     * May contain any byte string, including the empty string, up to 100MiB in
+     * length.
+     * 
+ * + * bytes value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The value stored in the cell.
+     * May contain any byte string, including the empty string, up to 100MiB in
+     * length.
+     * 
+ * + * bytes value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureLabelsIsMutable() { + if (!labels_.isModifiable()) { + labels_ = new com.google.protobuf.LazyStringArrayList(labels_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @return A list containing the labels. + */ + public com.google.protobuf.ProtocolStringList getLabelsList() { + labels_.makeImmutable(); + return labels_; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @return The count of labels. + */ + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + public java.lang.String getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + public com.google.protobuf.ByteString getLabelsBytes(int index) { + return labels_.getByteString(index); + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param index The index to set the value at. + * @param value The labels to set. + * @return This builder for chaining. + */ + public Builder setLabels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param value The labels to add. + * @return This builder for chaining. + */ + public Builder addLabels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param values The labels to add. + * @return This builder for chaining. + */ + public Builder addAllLabels(java.lang.Iterable values) { + ensureLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @return This builder for chaining. + */ + public Builder clearLabels() { + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+     * 
+ * + * repeated string labels = 3; + * + * @param value The bytes of the labels to add. + * @return This builder for chaining. + */ + public Builder addLabelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLabelsIsMutable(); + labels_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Cell) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Cell) + private static final com.google.bigtable.v2.Cell DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Cell(); + } + + public static com.google.bigtable.v2.Cell getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cell parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Cell getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java new file mode 100644 index 000000000000..1706b7cccbc0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface CellOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Cell) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The cell's stored timestamp, which also uniquely identifies it within
+   * its column.
+   * Values are always expressed in microseconds, but individual tables may set
+   * a coarser granularity to further restrict the allowed values. For
+   * example, a table which specifies millisecond granularity will only allow
+   * values of `timestamp_micros` which are multiples of 1000.
+   * 
+ * + * int64 timestamp_micros = 1; + * + * @return The timestampMicros. + */ + long getTimestampMicros(); + + /** + * + * + *
+   * The value stored in the cell.
+   * May contain any byte string, including the empty string, up to 100MiB in
+   * length.
+   * 
+ * + * bytes value = 2; + * + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @return A list containing the labels. + */ + java.util.List getLabelsList(); + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @return The count of labels. + */ + int getLabelsCount(); + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + java.lang.String getLabels(int index); + + /** + * + * + *
+   * Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter].
+   * 
+ * + * repeated string labels = 3; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + com.google.protobuf.ByteString getLabelsBytes(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java new file mode 100644 index 000000000000..230c65a21ec4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java @@ -0,0 +1,2711 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.CheckAndMutateRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowRequest} + */ +@com.google.protobuf.Generated +public final class CheckAndMutateRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.CheckAndMutateRowRequest) + CheckAndMutateRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckAndMutateRowRequest"); + } + + // Use CheckAndMutateRowRequest.newBuilder() to construct. + private CheckAndMutateRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CheckAndMutateRowRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + trueMutations_ = java.util.Collections.emptyList(); + falseMutations_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CheckAndMutateRowRequest.class, + com.google.bigtable.v2.CheckAndMutateRowRequest.Builder.class); + } + + private int bitField0_; + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table to which the conditional mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table to which the conditional mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the conditional
+   * mutation should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the conditional
+   * mutation should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + 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 = 7; + * + * @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 = 7; + * + * @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; + } + } + + public static final int ROW_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. The key of the row to which the conditional mutation should be
+   * applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int PREDICATE_FILTER_FIELD_NUMBER = 6; + private com.google.bigtable.v2.RowFilter predicateFilter_; + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return Whether the predicateFilter field is set. + */ + @java.lang.Override + public boolean hasPredicateFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return The predicateFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getPredicateFilter() { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + + public static final int TRUE_MUTATIONS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List trueMutations_; + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + @java.lang.Override + public java.util.List getTrueMutationsList() { + return trueMutations_; + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + @java.lang.Override + public java.util.List + getTrueMutationsOrBuilderList() { + return trueMutations_; + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + @java.lang.Override + public int getTrueMutationsCount() { + return trueMutations_.size(); + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getTrueMutations(int index) { + return trueMutations_.get(index); + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int index) { + return trueMutations_.get(index); + } + + public static final int FALSE_MUTATIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List falseMutations_; + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + @java.lang.Override + public java.util.List getFalseMutationsList() { + return falseMutations_; + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + @java.lang.Override + public java.util.List + getFalseMutationsOrBuilderList() { + return falseMutations_; + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + @java.lang.Override + public int getFalseMutationsCount() { + return falseMutations_.size(); + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getFalseMutations(int index) { + return falseMutations_.get(index); + } + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int index) { + return falseMutations_.get(index); + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!rowKey_.isEmpty()) { + output.writeBytes(2, rowKey_); + } + for (int i = 0; i < trueMutations_.size(); i++) { + output.writeMessage(4, trueMutations_.get(i)); + } + for (int i = 0; i < falseMutations_.size(); i++) { + output.writeMessage(5, falseMutations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getPredicateFilter()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, authorizedViewName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, rowKey_); + } + for (int i = 0; i < trueMutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, trueMutations_.get(i)); + } + for (int i = 0; i < falseMutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, falseMutations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPredicateFilter()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, authorizedViewName_); + } + size += getUnknownFields().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.CheckAndMutateRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.CheckAndMutateRowRequest other = + (com.google.bigtable.v2.CheckAndMutateRowRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getRowKey().equals(other.getRowKey())) return false; + if (hasPredicateFilter() != other.hasPredicateFilter()) return false; + if (hasPredicateFilter()) { + if (!getPredicateFilter().equals(other.getPredicateFilter())) return false; + } + if (!getTrueMutationsList().equals(other.getTrueMutationsList())) return false; + if (!getFalseMutationsList().equals(other.getFalseMutationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (hasPredicateFilter()) { + hash = (37 * hash) + PREDICATE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getPredicateFilter().hashCode(); + } + if (getTrueMutationsCount() > 0) { + hash = (37 * hash) + TRUE_MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getTrueMutationsList().hashCode(); + } + if (getFalseMutationsCount() > 0) { + hash = (37 * hash) + FALSE_MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFalseMutationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest 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.CheckAndMutateRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest 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.CheckAndMutateRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.CheckAndMutateRowRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.CheckAndMutateRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.CheckAndMutateRowRequest) + com.google.bigtable.v2.CheckAndMutateRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CheckAndMutateRowRequest.class, + com.google.bigtable.v2.CheckAndMutateRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.CheckAndMutateRowRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPredicateFilterFieldBuilder(); + internalGetTrueMutationsFieldBuilder(); + internalGetFalseMutationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); + predicateFilterBuilder_ = null; + } + if (trueMutationsBuilder_ == null) { + trueMutations_ = java.util.Collections.emptyList(); + } else { + trueMutations_ = null; + trueMutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (falseMutationsBuilder_ == null) { + falseMutations_ = java.util.Collections.emptyList(); + } else { + falseMutations_ = null; + falseMutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.CheckAndMutateRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowRequest build() { + com.google.bigtable.v2.CheckAndMutateRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowRequest buildPartial() { + com.google.bigtable.v2.CheckAndMutateRowRequest result = + new com.google.bigtable.v2.CheckAndMutateRowRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.CheckAndMutateRowRequest result) { + if (trueMutationsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + trueMutations_ = java.util.Collections.unmodifiableList(trueMutations_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.trueMutations_ = trueMutations_; + } else { + result.trueMutations_ = trueMutationsBuilder_.build(); + } + if (falseMutationsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + falseMutations_ = java.util.Collections.unmodifiableList(falseMutations_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.falseMutations_ = falseMutations_; + } else { + result.falseMutations_ = falseMutationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.CheckAndMutateRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rowKey_ = rowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.predicateFilter_ = + predicateFilterBuilder_ == null ? predicateFilter_ : predicateFilterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.CheckAndMutateRowRequest) { + return mergeFrom((com.google.bigtable.v2.CheckAndMutateRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) { + if (other == com.google.bigtable.v2.CheckAndMutateRowRequest.getDefaultInstance()) + return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (other.hasPredicateFilter()) { + mergePredicateFilter(other.getPredicateFilter()); + } + if (trueMutationsBuilder_ == null) { + if (!other.trueMutations_.isEmpty()) { + if (trueMutations_.isEmpty()) { + trueMutations_ = other.trueMutations_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTrueMutationsIsMutable(); + trueMutations_.addAll(other.trueMutations_); + } + onChanged(); + } + } else { + if (!other.trueMutations_.isEmpty()) { + if (trueMutationsBuilder_.isEmpty()) { + trueMutationsBuilder_.dispose(); + trueMutationsBuilder_ = null; + trueMutations_ = other.trueMutations_; + bitField0_ = (bitField0_ & ~0x00000020); + trueMutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTrueMutationsFieldBuilder() + : null; + } else { + trueMutationsBuilder_.addAllMessages(other.trueMutations_); + } + } + } + if (falseMutationsBuilder_ == null) { + if (!other.falseMutations_.isEmpty()) { + if (falseMutations_.isEmpty()) { + falseMutations_ = other.falseMutations_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureFalseMutationsIsMutable(); + falseMutations_.addAll(other.falseMutations_); + } + onChanged(); + } + } else { + if (!other.falseMutations_.isEmpty()) { + if (falseMutationsBuilder_.isEmpty()) { + falseMutationsBuilder_.dispose(); + falseMutationsBuilder_ = null; + falseMutations_ = other.falseMutations_; + bitField0_ = (bitField0_ & ~0x00000040); + falseMutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFalseMutationsFieldBuilder() + : null; + } else { + falseMutationsBuilder_.addAllMessages(other.falseMutations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 34: + { + com.google.bigtable.v2.Mutation m = + input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + trueMutations_.add(m); + } else { + trueMutationsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + com.google.bigtable.v2.Mutation m = + input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + falseMutations_.add(m); + } else { + falseMutationsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetPredicateFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 58 + case 74: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table to which the conditional mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the conditional mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the conditional mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the conditional mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the conditional mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the conditional
+     * mutation should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the conditional
+     * mutation should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the conditional
+     * mutation should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the conditional
+     * mutation should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the conditional
+     * mutation should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + 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 = 7; + * + * @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 = 7; + * + * @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 = 7; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 7; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. The key of the row to which the conditional mutation should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+     * Required. The key of the row to which the conditional mutation should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The key of the row to which the conditional mutation should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000008); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private com.google.bigtable.v2.RowFilter predicateFilter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + predicateFilterBuilder_; + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return Whether the predicateFilter field is set. + */ + public boolean hasPredicateFilter() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return The predicateFilter. + */ + public com.google.bigtable.v2.RowFilter getPredicateFilter() { + if (predicateFilterBuilder_ == null) { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } else { + return predicateFilterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) { + if (predicateFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predicateFilter_ = value; + } else { + predicateFilterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (predicateFilterBuilder_ == null) { + predicateFilter_ = builderForValue.build(); + } else { + predicateFilterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) { + if (predicateFilterBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && predicateFilter_ != null + && predicateFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getPredicateFilterBuilder().mergeFrom(value); + } else { + predicateFilter_ = value; + } + } else { + predicateFilterBuilder_.mergeFrom(value); + } + if (predicateFilter_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public Builder clearPredicateFilter() { + bitField0_ = (bitField0_ & ~0x00000010); + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); + predicateFilterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetPredicateFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { + if (predicateFilterBuilder_ != null) { + return predicateFilterBuilder_.getMessageOrBuilder(); + } else { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + } + + /** + * + * + *
+     * The filter to be applied to the contents of the specified row. Depending
+     * on whether or not any results are yielded, either `true_mutations` or
+     * `false_mutations` will be executed. If unset, checks that the row contains
+     * any values at all.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetPredicateFilterFieldBuilder() { + if (predicateFilterBuilder_ == null) { + predicateFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getPredicateFilter(), getParentForChildren(), isClean()); + predicateFilter_ = null; + } + return predicateFilterBuilder_; + } + + private java.util.List trueMutations_ = + java.util.Collections.emptyList(); + + private void ensureTrueMutationsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + trueMutations_ = new java.util.ArrayList(trueMutations_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + trueMutationsBuilder_; + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public java.util.List getTrueMutationsList() { + if (trueMutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(trueMutations_); + } else { + return trueMutationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public int getTrueMutationsCount() { + if (trueMutationsBuilder_ == null) { + return trueMutations_.size(); + } else { + return trueMutationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public com.google.bigtable.v2.Mutation getTrueMutations(int index) { + if (trueMutationsBuilder_ == null) { + return trueMutations_.get(index); + } else { + return trueMutationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder setTrueMutations(int index, com.google.bigtable.v2.Mutation value) { + if (trueMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrueMutationsIsMutable(); + trueMutations_.set(index, value); + onChanged(); + } else { + trueMutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder setTrueMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + trueMutations_.set(index, builderForValue.build()); + onChanged(); + } else { + trueMutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder addTrueMutations(com.google.bigtable.v2.Mutation value) { + if (trueMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrueMutationsIsMutable(); + trueMutations_.add(value); + onChanged(); + } else { + trueMutationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder addTrueMutations(int index, com.google.bigtable.v2.Mutation value) { + if (trueMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTrueMutationsIsMutable(); + trueMutations_.add(index, value); + onChanged(); + } else { + trueMutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder addTrueMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + trueMutations_.add(builderForValue.build()); + onChanged(); + } else { + trueMutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder addTrueMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + trueMutations_.add(index, builderForValue.build()); + onChanged(); + } else { + trueMutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder addAllTrueMutations( + java.lang.Iterable values) { + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, trueMutations_); + onChanged(); + } else { + trueMutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder clearTrueMutations() { + if (trueMutationsBuilder_ == null) { + trueMutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + trueMutationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public Builder removeTrueMutations(int index) { + if (trueMutationsBuilder_ == null) { + ensureTrueMutationsIsMutable(); + trueMutations_.remove(index); + onChanged(); + } else { + trueMutationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public com.google.bigtable.v2.Mutation.Builder getTrueMutationsBuilder(int index) { + return internalGetTrueMutationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int index) { + if (trueMutationsBuilder_ == null) { + return trueMutations_.get(index); + } else { + return trueMutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public java.util.List + getTrueMutationsOrBuilderList() { + if (trueMutationsBuilder_ != null) { + return trueMutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(trueMutations_); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder() { + return internalGetTrueMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder(int index) { + return internalGetTrueMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * yields at least one cell when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `false_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + public java.util.List getTrueMutationsBuilderList() { + return internalGetTrueMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetTrueMutationsFieldBuilder() { + if (trueMutationsBuilder_ == null) { + trueMutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + trueMutations_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + trueMutations_ = null; + } + return trueMutationsBuilder_; + } + + private java.util.List falseMutations_ = + java.util.Collections.emptyList(); + + private void ensureFalseMutationsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + falseMutations_ = new java.util.ArrayList(falseMutations_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + falseMutationsBuilder_; + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public java.util.List getFalseMutationsList() { + if (falseMutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(falseMutations_); + } else { + return falseMutationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public int getFalseMutationsCount() { + if (falseMutationsBuilder_ == null) { + return falseMutations_.size(); + } else { + return falseMutationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public com.google.bigtable.v2.Mutation getFalseMutations(int index) { + if (falseMutationsBuilder_ == null) { + return falseMutations_.get(index); + } else { + return falseMutationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder setFalseMutations(int index, com.google.bigtable.v2.Mutation value) { + if (falseMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFalseMutationsIsMutable(); + falseMutations_.set(index, value); + onChanged(); + } else { + falseMutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder setFalseMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + falseMutations_.set(index, builderForValue.build()); + onChanged(); + } else { + falseMutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder addFalseMutations(com.google.bigtable.v2.Mutation value) { + if (falseMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFalseMutationsIsMutable(); + falseMutations_.add(value); + onChanged(); + } else { + falseMutationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder addFalseMutations(int index, com.google.bigtable.v2.Mutation value) { + if (falseMutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFalseMutationsIsMutable(); + falseMutations_.add(index, value); + onChanged(); + } else { + falseMutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder addFalseMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + falseMutations_.add(builderForValue.build()); + onChanged(); + } else { + falseMutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder addFalseMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + falseMutations_.add(index, builderForValue.build()); + onChanged(); + } else { + falseMutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder addAllFalseMutations( + java.lang.Iterable values) { + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, falseMutations_); + onChanged(); + } else { + falseMutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder clearFalseMutations() { + if (falseMutationsBuilder_ == null) { + falseMutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + falseMutationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public Builder removeFalseMutations(int index) { + if (falseMutationsBuilder_ == null) { + ensureFalseMutationsIsMutable(); + falseMutations_.remove(index); + onChanged(); + } else { + falseMutationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public com.google.bigtable.v2.Mutation.Builder getFalseMutationsBuilder(int index) { + return internalGetFalseMutationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int index) { + if (falseMutationsBuilder_ == null) { + return falseMutations_.get(index); + } else { + return falseMutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public java.util.List + getFalseMutationsOrBuilderList() { + if (falseMutationsBuilder_ != null) { + return falseMutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(falseMutations_); + } + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder() { + return internalGetFalseMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder(int index) { + return internalGetFalseMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Changes to be atomically applied to the specified row if `predicate_filter`
+     * does not yield any cells when applied to `row_key`. Entries are applied in
+     * order, meaning that earlier mutations can be masked by later ones.
+     * Must contain at least one entry if `true_mutations` is empty, and at most
+     * 100000.
+     * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + public java.util.List getFalseMutationsBuilderList() { + return internalGetFalseMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetFalseMutationsFieldBuilder() { + if (falseMutationsBuilder_ == null) { + falseMutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + falseMutations_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + falseMutations_ = null; + } + return falseMutationsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CheckAndMutateRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.CheckAndMutateRowRequest) + private static final com.google.bigtable.v2.CheckAndMutateRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.CheckAndMutateRowRequest(); + } + + public static com.google.bigtable.v2.CheckAndMutateRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckAndMutateRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CheckAndMutateRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java new file mode 100644 index 000000000000..4e2fa437a1d4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java @@ -0,0 +1,344 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface CheckAndMutateRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.CheckAndMutateRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table to which the conditional mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table to which the conditional mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the conditional
+   * mutation should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the conditional
+   * mutation should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 7; + * + * @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 = 7; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The key of the row to which the conditional mutation should be
+   * applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return Whether the predicateFilter field is set. + */ + boolean hasPredicateFilter(); + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + * + * @return The predicateFilter. + */ + com.google.bigtable.v2.RowFilter getPredicateFilter(); + + /** + * + * + *
+   * The filter to be applied to the contents of the specified row. Depending
+   * on whether or not any results are yielded, either `true_mutations` or
+   * `false_mutations` will be executed. If unset, checks that the row contains
+   * any values at all.
+   * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 6; + */ + com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + java.util.List getTrueMutationsList(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + com.google.bigtable.v2.Mutation getTrueMutations(int index); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + int getTrueMutationsCount(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + java.util.List + getTrueMutationsOrBuilderList(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * yields at least one cell when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `false_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation true_mutations = 4; + */ + com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int index); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + java.util.List getFalseMutationsList(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + com.google.bigtable.v2.Mutation getFalseMutations(int index); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + int getFalseMutationsCount(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + java.util.List + getFalseMutationsOrBuilderList(); + + /** + * + * + *
+   * Changes to be atomically applied to the specified row if `predicate_filter`
+   * does not yield any cells when applied to `row_key`. Entries are applied in
+   * order, meaning that earlier mutations can be masked by later ones.
+   * Must contain at least one entry if `true_mutations` is empty, and at most
+   * 100000.
+   * 
+ * + * repeated .google.bigtable.v2.Mutation false_mutations = 5; + */ + com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java new file mode 100644 index 000000000000..852a8acf48a9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java @@ -0,0 +1,507 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.CheckAndMutateRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} + */ +@com.google.protobuf.Generated +public final class CheckAndMutateRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.CheckAndMutateRowResponse) + CheckAndMutateRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckAndMutateRowResponse"); + } + + // Use CheckAndMutateRowResponse.newBuilder() to construct. + private CheckAndMutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CheckAndMutateRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CheckAndMutateRowResponse.class, + com.google.bigtable.v2.CheckAndMutateRowResponse.Builder.class); + } + + public static final int PREDICATE_MATCHED_FIELD_NUMBER = 1; + private boolean predicateMatched_ = false; + + /** + * + * + *
+   * Whether or not the request's `predicate_filter` yielded any results for
+   * the specified row.
+   * 
+ * + * bool predicate_matched = 1; + * + * @return The predicateMatched. + */ + @java.lang.Override + public boolean getPredicateMatched() { + return predicateMatched_; + } + + 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 (predicateMatched_ != false) { + output.writeBool(1, predicateMatched_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (predicateMatched_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, predicateMatched_); + } + size += getUnknownFields().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.CheckAndMutateRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.CheckAndMutateRowResponse other = + (com.google.bigtable.v2.CheckAndMutateRowResponse) obj; + + if (getPredicateMatched() != other.getPredicateMatched()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PREDICATE_MATCHED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPredicateMatched()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse 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.CheckAndMutateRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse 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.CheckAndMutateRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.CheckAndMutateRowResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.CheckAndMutateRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.CheckAndMutateRowResponse) + com.google.bigtable.v2.CheckAndMutateRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CheckAndMutateRowResponse.class, + com.google.bigtable.v2.CheckAndMutateRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.CheckAndMutateRowResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + predicateMatched_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.CheckAndMutateRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowResponse build() { + com.google.bigtable.v2.CheckAndMutateRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.CheckAndMutateRowResponse buildPartial() { + com.google.bigtable.v2.CheckAndMutateRowResponse result = + new com.google.bigtable.v2.CheckAndMutateRowResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.CheckAndMutateRowResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predicateMatched_ = predicateMatched_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.CheckAndMutateRowResponse) { + return mergeFrom((com.google.bigtable.v2.CheckAndMutateRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowResponse other) { + if (other == com.google.bigtable.v2.CheckAndMutateRowResponse.getDefaultInstance()) + return this; + if (other.getPredicateMatched() != false) { + setPredicateMatched(other.getPredicateMatched()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + predicateMatched_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean predicateMatched_; + + /** + * + * + *
+     * Whether or not the request's `predicate_filter` yielded any results for
+     * the specified row.
+     * 
+ * + * bool predicate_matched = 1; + * + * @return The predicateMatched. + */ + @java.lang.Override + public boolean getPredicateMatched() { + return predicateMatched_; + } + + /** + * + * + *
+     * Whether or not the request's `predicate_filter` yielded any results for
+     * the specified row.
+     * 
+ * + * bool predicate_matched = 1; + * + * @param value The predicateMatched to set. + * @return This builder for chaining. + */ + public Builder setPredicateMatched(boolean value) { + + predicateMatched_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether or not the request's `predicate_filter` yielded any results for
+     * the specified row.
+     * 
+ * + * bool predicate_matched = 1; + * + * @return This builder for chaining. + */ + public Builder clearPredicateMatched() { + bitField0_ = (bitField0_ & ~0x00000001); + predicateMatched_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CheckAndMutateRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.CheckAndMutateRowResponse) + private static final com.google.bigtable.v2.CheckAndMutateRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.CheckAndMutateRowResponse(); + } + + public static com.google.bigtable.v2.CheckAndMutateRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CheckAndMutateRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CheckAndMutateRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java new file mode 100644 index 000000000000..d7e3c9567d6e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface CheckAndMutateRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.CheckAndMutateRowResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether or not the request's `predicate_filter` yielded any results for
+   * the specified row.
+   * 
+ * + * bool predicate_matched = 1; + * + * @return The predicateMatched. + */ + boolean getPredicateMatched(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java new file mode 100644 index 000000000000..0e8c7601b313 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java @@ -0,0 +1,3171 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for the Session API. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ClientConfiguration} + */ +@com.google.protobuf.Generated +public final class ClientConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClientConfiguration) + ClientConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientConfiguration"); + } + + // Use ClientConfiguration.newBuilder() to construct. + private ClientConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClientConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.Builder.class); + } + + public interface PollingConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + boolean hasPollingInterval(); + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + com.google.protobuf.Duration getPollingInterval(); + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + boolean hasValidityDuration(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + com.google.protobuf.Duration getValidityDuration(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder(); + + /** + * + * + *
+     * Number of times the client should retry a failed
+     * GetClientConfiguration RPC per polling interval before giving up.
+     * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + int getMaxRpcRetryCount(); + } + + /** Protobuf type {@code google.bigtable.v2.ClientConfiguration.PollingConfiguration} */ + public static final class PollingConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + PollingConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PollingConfiguration"); + } + + // Use PollingConfiguration.newBuilder() to construct. + private PollingConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PollingConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder.class); + } + + private int bitField0_; + public static final int POLLING_INTERVAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration pollingInterval_; + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + public boolean hasPollingInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getPollingInterval() { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + + public static final int VALIDITY_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration validityDuration_; + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + @java.lang.Override + public boolean hasValidityDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidityDuration() { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder() { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + + public static final int MAX_RPC_RETRY_COUNT_FIELD_NUMBER = 6; + private int maxRpcRetryCount_ = 0; + + /** + * + * + *
+     * Number of times the client should retry a failed
+     * GetClientConfiguration RPC per polling interval before giving up.
+     * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + @java.lang.Override + public int getMaxRpcRetryCount() { + return maxRpcRetryCount_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPollingInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getValidityDuration()); + } + if (maxRpcRetryCount_ != 0) { + output.writeInt32(6, maxRpcRetryCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPollingInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValidityDuration()); + } + if (maxRpcRetryCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, maxRpcRetryCount_); + } + size += getUnknownFields().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.ClientConfiguration.PollingConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration other = + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) obj; + + if (hasPollingInterval() != other.hasPollingInterval()) return false; + if (hasPollingInterval()) { + if (!getPollingInterval().equals(other.getPollingInterval())) return false; + } + if (hasValidityDuration() != other.hasValidityDuration()) return false; + if (hasValidityDuration()) { + if (!getValidityDuration().equals(other.getValidityDuration())) return false; + } + if (getMaxRpcRetryCount() != other.getMaxRpcRetryCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPollingInterval()) { + hash = (37 * hash) + POLLING_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPollingInterval().hashCode(); + } + if (hasValidityDuration()) { + hash = (37 * hash) + VALIDITY_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidityDuration().hashCode(); + } + hash = (37 * hash) + MAX_RPC_RETRY_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxRpcRetryCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration 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.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration 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.ClientConfiguration.PollingConfiguration parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ClientConfiguration.PollingConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.bigtable.v2.ClientConfiguration.PollingConfiguration} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPollingIntervalFieldBuilder(); + internalGetValidityDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pollingInterval_ = null; + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.dispose(); + pollingIntervalBuilder_ = null; + } + validityDuration_ = null; + if (validityDurationBuilder_ != null) { + validityDurationBuilder_.dispose(); + validityDurationBuilder_ = null; + } + maxRpcRetryCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration build() { + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration buildPartial() { + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result = + new com.google.bigtable.v2.ClientConfiguration.PollingConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pollingInterval_ = + pollingIntervalBuilder_ == null ? pollingInterval_ : pollingIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validityDuration_ = + validityDurationBuilder_ == null + ? validityDuration_ + : validityDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxRpcRetryCount_ = maxRpcRetryCount_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) { + return mergeFrom((com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration other) { + if (other + == com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance()) + return this; + if (other.hasPollingInterval()) { + mergePollingInterval(other.getPollingInterval()); + } + if (other.hasValidityDuration()) { + mergeValidityDuration(other.getValidityDuration()); + } + if (other.getMaxRpcRetryCount() != 0) { + setMaxRpcRetryCount(other.getMaxRpcRetryCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetPollingIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetValidityDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 48: + { + maxRpcRetryCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration pollingInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pollingIntervalBuilder_; + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + public boolean hasPollingInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + public com.google.protobuf.Duration getPollingInterval() { + if (pollingIntervalBuilder_ == null) { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } else { + return pollingIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder setPollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pollingInterval_ = value; + } else { + pollingIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder setPollingInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (pollingIntervalBuilder_ == null) { + pollingInterval_ = builderForValue.build(); + } else { + pollingIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder mergePollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && pollingInterval_ != null + && pollingInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPollingIntervalBuilder().mergeFrom(value); + } else { + pollingInterval_ = value; + } + } else { + pollingIntervalBuilder_.mergeFrom(value); + } + if (pollingInterval_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder clearPollingInterval() { + bitField0_ = (bitField0_ & ~0x00000001); + pollingInterval_ = null; + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.dispose(); + pollingIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public com.google.protobuf.Duration.Builder getPollingIntervalBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPollingIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if (pollingIntervalBuilder_ != null) { + return pollingIntervalBuilder_.getMessageOrBuilder(); + } else { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPollingIntervalFieldBuilder() { + if (pollingIntervalBuilder_ == null) { + pollingIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPollingInterval(), getParentForChildren(), isClean()); + pollingInterval_ = null; + } + return pollingIntervalBuilder_; + } + + private com.google.protobuf.Duration validityDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validityDurationBuilder_; + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + public boolean hasValidityDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + public com.google.protobuf.Duration getValidityDuration() { + if (validityDurationBuilder_ == null) { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } else { + return validityDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder setValidityDuration(com.google.protobuf.Duration value) { + if (validityDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validityDuration_ = value; + } else { + validityDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder setValidityDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validityDurationBuilder_ == null) { + validityDuration_ = builderForValue.build(); + } else { + validityDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder mergeValidityDuration(com.google.protobuf.Duration value) { + if (validityDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && validityDuration_ != null + && validityDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValidityDurationBuilder().mergeFrom(value); + } else { + validityDuration_ = value; + } + } else { + validityDurationBuilder_.mergeFrom(value); + } + if (validityDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder clearValidityDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + validityDuration_ = null; + if (validityDurationBuilder_ != null) { + validityDurationBuilder_.dispose(); + validityDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public com.google.protobuf.Duration.Builder getValidityDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetValidityDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder() { + if (validityDurationBuilder_ != null) { + return validityDurationBuilder_.getMessageOrBuilder(); + } else { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetValidityDurationFieldBuilder() { + if (validityDurationBuilder_ == null) { + validityDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getValidityDuration(), getParentForChildren(), isClean()); + validityDuration_ = null; + } + return validityDurationBuilder_; + } + + private int maxRpcRetryCount_; + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + @java.lang.Override + public int getMaxRpcRetryCount() { + return maxRpcRetryCount_; + } + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @param value The maxRpcRetryCount to set. + * @return This builder for chaining. + */ + public Builder setMaxRpcRetryCount(int value) { + + maxRpcRetryCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearMaxRpcRetryCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxRpcRetryCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + private static final com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClientConfiguration.PollingConfiguration(); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PollingConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ClientConfiguration.PollingConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int pollingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object polling_; + + public enum PollingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STOP_POLLING(3), + @java.lang.Deprecated + POLLING_INTERVAL(4), + POLLING_CONFIGURATION(5), + POLLING_NOT_SET(0); + private final int value; + + private PollingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PollingCase valueOf(int value) { + return forNumber(value); + } + + public static PollingCase forNumber(int value) { + switch (value) { + case 3: + return STOP_POLLING; + case 4: + return POLLING_INTERVAL; + case 5: + return POLLING_CONFIGURATION; + case 0: + return POLLING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PollingCase getPollingCase() { + return PollingCase.forNumber(pollingCase_); + } + + public static final int SESSION_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.bigtable.v2.SessionClientConfiguration sessionConfiguration_; + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + @java.lang.Override + public boolean hasSessionConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration() { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfigurationOrBuilder + getSessionConfigurationOrBuilder() { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + + public static final int STOP_POLLING_FIELD_NUMBER = 3; + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + @java.lang.Override + public boolean hasStopPolling() { + return pollingCase_ == 3; + } + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + @java.lang.Override + public boolean getStopPolling() { + if (pollingCase_ == 3) { + return (java.lang.Boolean) polling_; + } + return false; + } + + public static final int POLLING_INTERVAL_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPollingInterval() { + return pollingCase_ == 4; + } + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Duration getPollingInterval() { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int POLLING_CONFIGURATION_FIELD_NUMBER = 5; + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + @java.lang.Override + public boolean hasPollingConfiguration() { + return pollingCase_ == 5; + } + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration getPollingConfiguration() { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder() { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + public static final int TELEMETRY_CONFIGURATION_FIELD_NUMBER = 6; + private com.google.bigtable.v2.TelemetryConfiguration telemetryConfiguration_; + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + @java.lang.Override + public boolean hasTelemetryConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration() { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfigurationOrBuilder + getTelemetryConfigurationOrBuilder() { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSessionConfiguration()); + } + if (pollingCase_ == 3) { + output.writeBool(3, (boolean) ((java.lang.Boolean) polling_)); + } + if (pollingCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) polling_); + } + if (pollingCase_ == 5) { + output.writeMessage( + 5, (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getTelemetryConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSessionConfiguration()); + } + if (pollingCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, (boolean) ((java.lang.Boolean) polling_)); + } + if (pollingCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Duration) polling_); + } + if (pollingCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTelemetryConfiguration()); + } + size += getUnknownFields().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.ClientConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClientConfiguration other = + (com.google.bigtable.v2.ClientConfiguration) obj; + + if (hasSessionConfiguration() != other.hasSessionConfiguration()) return false; + if (hasSessionConfiguration()) { + if (!getSessionConfiguration().equals(other.getSessionConfiguration())) return false; + } + if (hasTelemetryConfiguration() != other.hasTelemetryConfiguration()) return false; + if (hasTelemetryConfiguration()) { + if (!getTelemetryConfiguration().equals(other.getTelemetryConfiguration())) return false; + } + if (!getPollingCase().equals(other.getPollingCase())) return false; + switch (pollingCase_) { + case 3: + if (getStopPolling() != other.getStopPolling()) return false; + break; + case 4: + if (!getPollingInterval().equals(other.getPollingInterval())) return false; + break; + case 5: + if (!getPollingConfiguration().equals(other.getPollingConfiguration())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSessionConfiguration()) { + hash = (37 * hash) + SESSION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getSessionConfiguration().hashCode(); + } + if (hasTelemetryConfiguration()) { + hash = (37 * hash) + TELEMETRY_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getTelemetryConfiguration().hashCode(); + } + switch (pollingCase_) { + case 3: + hash = (37 * hash) + STOP_POLLING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getStopPolling()); + break; + case 4: + hash = (37 * hash) + POLLING_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPollingInterval().hashCode(); + break; + case 5: + hash = (37 * hash) + POLLING_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getPollingConfiguration().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration 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.ClientConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration 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.ClientConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ClientConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for the Session API. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ClientConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClientConfiguration) + com.google.bigtable.v2.ClientConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.ClientConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSessionConfigurationFieldBuilder(); + internalGetTelemetryConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sessionConfiguration_ = null; + if (sessionConfigurationBuilder_ != null) { + sessionConfigurationBuilder_.dispose(); + sessionConfigurationBuilder_ = null; + } + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.clear(); + } + if (pollingConfigurationBuilder_ != null) { + pollingConfigurationBuilder_.clear(); + } + telemetryConfiguration_ = null; + if (telemetryConfigurationBuilder_ != null) { + telemetryConfigurationBuilder_.dispose(); + telemetryConfigurationBuilder_ = null; + } + pollingCase_ = 0; + polling_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.ClientConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration build() { + com.google.bigtable.v2.ClientConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration buildPartial() { + com.google.bigtable.v2.ClientConfiguration result = + new com.google.bigtable.v2.ClientConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ClientConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sessionConfiguration_ = + sessionConfigurationBuilder_ == null + ? sessionConfiguration_ + : sessionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.telemetryConfiguration_ = + telemetryConfigurationBuilder_ == null + ? telemetryConfiguration_ + : telemetryConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ClientConfiguration result) { + result.pollingCase_ = pollingCase_; + result.polling_ = this.polling_; + if (pollingCase_ == 4 && pollingIntervalBuilder_ != null) { + result.polling_ = pollingIntervalBuilder_.build(); + } + if (pollingCase_ == 5 && pollingConfigurationBuilder_ != null) { + result.polling_ = pollingConfigurationBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClientConfiguration) { + return mergeFrom((com.google.bigtable.v2.ClientConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ClientConfiguration other) { + if (other == com.google.bigtable.v2.ClientConfiguration.getDefaultInstance()) return this; + if (other.hasSessionConfiguration()) { + mergeSessionConfiguration(other.getSessionConfiguration()); + } + if (other.hasTelemetryConfiguration()) { + mergeTelemetryConfiguration(other.getTelemetryConfiguration()); + } + switch (other.getPollingCase()) { + case STOP_POLLING: + { + setStopPolling(other.getStopPolling()); + break; + } + case POLLING_INTERVAL: + { + mergePollingInterval(other.getPollingInterval()); + break; + } + case POLLING_CONFIGURATION: + { + mergePollingConfiguration(other.getPollingConfiguration()); + break; + } + case POLLING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + input.readMessage( + internalGetSessionConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 24: + { + polling_ = input.readBool(); + pollingCase_ = 3; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetPollingIntervalFieldBuilder().getBuilder(), extensionRegistry); + pollingCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPollingConfigurationFieldBuilder().getBuilder(), extensionRegistry); + pollingCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetTelemetryConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int pollingCase_ = 0; + private java.lang.Object polling_; + + public PollingCase getPollingCase() { + return PollingCase.forNumber(pollingCase_); + } + + public Builder clearPolling() { + pollingCase_ = 0; + polling_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.SessionClientConfiguration sessionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder> + sessionConfigurationBuilder_; + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + public boolean hasSessionConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration() { + if (sessionConfigurationBuilder_ == null) { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } else { + return sessionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder setSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration value) { + if (sessionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionConfiguration_ = value; + } else { + sessionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder setSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.Builder builderForValue) { + if (sessionConfigurationBuilder_ == null) { + sessionConfiguration_ = builderForValue.build(); + } else { + sessionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder mergeSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration value) { + if (sessionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sessionConfiguration_ != null + && sessionConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance()) { + getSessionConfigurationBuilder().mergeFrom(value); + } else { + sessionConfiguration_ = value; + } + } else { + sessionConfigurationBuilder_.mergeFrom(value); + } + if (sessionConfiguration_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder clearSessionConfiguration() { + bitField0_ = (bitField0_ & ~0x00000001); + sessionConfiguration_ = null; + if (sessionConfigurationBuilder_ != null) { + sessionConfigurationBuilder_.dispose(); + sessionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public com.google.bigtable.v2.SessionClientConfiguration.Builder + getSessionConfigurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSessionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public com.google.bigtable.v2.SessionClientConfigurationOrBuilder + getSessionConfigurationOrBuilder() { + if (sessionConfigurationBuilder_ != null) { + return sessionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder> + internalGetSessionConfigurationFieldBuilder() { + if (sessionConfigurationBuilder_ == null) { + sessionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder>( + getSessionConfiguration(), getParentForChildren(), isClean()); + sessionConfiguration_ = null; + } + return sessionConfigurationBuilder_; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + public boolean hasStopPolling() { + return pollingCase_ == 3; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + public boolean getStopPolling() { + if (pollingCase_ == 3) { + return (java.lang.Boolean) polling_; + } + return false; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @param value The stopPolling to set. + * @return This builder for chaining. + */ + public Builder setStopPolling(boolean value) { + + pollingCase_ = 3; + polling_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return This builder for chaining. + */ + public Builder clearStopPolling() { + if (pollingCase_ == 3) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pollingIntervalBuilder_; + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPollingInterval() { + return pollingCase_ == 4; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Duration getPollingInterval() { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (pollingCase_ == 4) { + return pollingIntervalBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setPollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polling_ = value; + onChanged(); + } else { + pollingIntervalBuilder_.setMessage(value); + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setPollingInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (pollingIntervalBuilder_ == null) { + polling_ = builderForValue.build(); + onChanged(); + } else { + pollingIntervalBuilder_.setMessage(builderForValue.build()); + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergePollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4 && polling_ != com.google.protobuf.Duration.getDefaultInstance()) { + polling_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) polling_) + .mergeFrom(value) + .buildPartial(); + } else { + polling_ = value; + } + onChanged(); + } else { + if (pollingCase_ == 4) { + pollingIntervalBuilder_.mergeFrom(value); + } else { + pollingIntervalBuilder_.setMessage(value); + } + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearPollingInterval() { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + } else { + if (pollingCase_ == 4) { + pollingCase_ = 0; + polling_ = null; + } + pollingIntervalBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Duration.Builder getPollingIntervalBuilder() { + return internalGetPollingIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if ((pollingCase_ == 4) && (pollingIntervalBuilder_ != null)) { + return pollingIntervalBuilder_.getMessageOrBuilder(); + } else { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPollingIntervalFieldBuilder() { + if (pollingIntervalBuilder_ == null) { + if (!(pollingCase_ == 4)) { + polling_ = com.google.protobuf.Duration.getDefaultInstance(); + } + pollingIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) polling_, getParentForChildren(), isClean()); + polling_ = null; + } + pollingCase_ = 4; + onChanged(); + return pollingIntervalBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder> + pollingConfigurationBuilder_; + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + @java.lang.Override + public boolean hasPollingConfiguration() { + return pollingCase_ == 5; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getPollingConfiguration() { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } else { + if (pollingCase_ == 5) { + return pollingConfigurationBuilder_.getMessage(); + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder setPollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration value) { + if (pollingConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polling_ = value; + onChanged(); + } else { + pollingConfigurationBuilder_.setMessage(value); + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder setPollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder builderForValue) { + if (pollingConfigurationBuilder_ == null) { + polling_ = builderForValue.build(); + onChanged(); + } else { + pollingConfigurationBuilder_.setMessage(builderForValue.build()); + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder mergePollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration value) { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5 + && polling_ + != com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + .getDefaultInstance()) { + polling_ = + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.newBuilder( + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_) + .mergeFrom(value) + .buildPartial(); + } else { + polling_ = value; + } + onChanged(); + } else { + if (pollingCase_ == 5) { + pollingConfigurationBuilder_.mergeFrom(value); + } else { + pollingConfigurationBuilder_.setMessage(value); + } + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder clearPollingConfiguration() { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + } else { + if (pollingCase_ == 5) { + pollingCase_ = 0; + polling_ = null; + } + pollingConfigurationBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder + getPollingConfigurationBuilder() { + return internalGetPollingConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder() { + if ((pollingCase_ == 5) && (pollingConfigurationBuilder_ != null)) { + return pollingConfigurationBuilder_.getMessageOrBuilder(); + } else { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder> + internalGetPollingConfigurationFieldBuilder() { + if (pollingConfigurationBuilder_ == null) { + if (!(pollingCase_ == 5)) { + polling_ = + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + pollingConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder>( + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_, + getParentForChildren(), + isClean()); + polling_ = null; + } + pollingCase_ = 5; + onChanged(); + return pollingConfigurationBuilder_; + } + + private com.google.bigtable.v2.TelemetryConfiguration telemetryConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder> + telemetryConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + public boolean hasTelemetryConfiguration() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + public com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration() { + if (telemetryConfigurationBuilder_ == null) { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } else { + return telemetryConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder setTelemetryConfiguration(com.google.bigtable.v2.TelemetryConfiguration value) { + if (telemetryConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + telemetryConfiguration_ = value; + } else { + telemetryConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder setTelemetryConfiguration( + com.google.bigtable.v2.TelemetryConfiguration.Builder builderForValue) { + if (telemetryConfigurationBuilder_ == null) { + telemetryConfiguration_ = builderForValue.build(); + } else { + telemetryConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder mergeTelemetryConfiguration( + com.google.bigtable.v2.TelemetryConfiguration value) { + if (telemetryConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && telemetryConfiguration_ != null + && telemetryConfiguration_ + != com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance()) { + getTelemetryConfigurationBuilder().mergeFrom(value); + } else { + telemetryConfiguration_ = value; + } + } else { + telemetryConfigurationBuilder_.mergeFrom(value); + } + if (telemetryConfiguration_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder clearTelemetryConfiguration() { + bitField0_ = (bitField0_ & ~0x00000010); + telemetryConfiguration_ = null; + if (telemetryConfigurationBuilder_ != null) { + telemetryConfigurationBuilder_.dispose(); + telemetryConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public com.google.bigtable.v2.TelemetryConfiguration.Builder + getTelemetryConfigurationBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetTelemetryConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public com.google.bigtable.v2.TelemetryConfigurationOrBuilder + getTelemetryConfigurationOrBuilder() { + if (telemetryConfigurationBuilder_ != null) { + return telemetryConfigurationBuilder_.getMessageOrBuilder(); + } else { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder> + internalGetTelemetryConfigurationFieldBuilder() { + if (telemetryConfigurationBuilder_ == null) { + telemetryConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder>( + getTelemetryConfiguration(), getParentForChildren(), isClean()); + telemetryConfiguration_ = null; + } + return telemetryConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClientConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClientConfiguration) + private static final com.google.bigtable.v2.ClientConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClientConfiguration(); + } + + public static com.google.bigtable.v2.ClientConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ClientConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java new file mode 100644 index 000000000000..c0e671a1f549 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java @@ -0,0 +1,226 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ClientConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClientConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + boolean hasSessionConfiguration(); + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration(); + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + com.google.bigtable.v2.SessionClientConfigurationOrBuilder getSessionConfigurationOrBuilder(); + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + boolean hasStopPolling(); + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + boolean getStopPolling(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Deprecated + boolean hasPollingInterval(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Deprecated + com.google.protobuf.Duration getPollingInterval(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + boolean hasPollingConfiguration(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration getPollingConfiguration(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + boolean hasTelemetryConfiguration(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + com.google.bigtable.v2.TelemetryConfigurationOrBuilder getTelemetryConfigurationOrBuilder(); + + com.google.bigtable.v2.ClientConfiguration.PollingCase getPollingCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java new file mode 100644 index 000000000000..9cb65a2fd5dd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java @@ -0,0 +1,821 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.CloseSessionRequest} + */ +@com.google.protobuf.Generated +public final class CloseSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.CloseSessionRequest) + CloseSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloseSessionRequest"); + } + + // Use CloseSessionRequest.newBuilder() to construct. + private CloseSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloseSessionRequest() { + reason_ = 0; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CloseSessionRequest.class, + com.google.bigtable.v2.CloseSessionRequest.Builder.class); + } + + /** + * + * + *
+   * Client-generated reason for terminating the session, including a
+   * plain-text description of why.
+   * 'reason' may be used for metrics, while both may be logged (server-side).
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.CloseSessionRequest.CloseSessionReason} + */ + public enum CloseSessionReason implements com.google.protobuf.ProtocolMessageEnum { + /** CLOSE_SESSION_REASON_UNSET = 0; */ + CLOSE_SESSION_REASON_UNSET(0), + /** CLOSE_SESSION_REASON_GOAWAY = 1; */ + CLOSE_SESSION_REASON_GOAWAY(1), + /** CLOSE_SESSION_REASON_ERROR = 2; */ + CLOSE_SESSION_REASON_ERROR(2), + /** CLOSE_SESSION_REASON_USER = 3; */ + CLOSE_SESSION_REASON_USER(3), + /** CLOSE_SESSION_REASON_DOWNSIZE = 4; */ + CLOSE_SESSION_REASON_DOWNSIZE(4), + /** CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; */ + CLOSE_SESSION_REASON_MISSED_HEARTBEAT(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloseSessionReason"); + } + + /** CLOSE_SESSION_REASON_UNSET = 0; */ + public static final int CLOSE_SESSION_REASON_UNSET_VALUE = 0; + + /** CLOSE_SESSION_REASON_GOAWAY = 1; */ + public static final int CLOSE_SESSION_REASON_GOAWAY_VALUE = 1; + + /** CLOSE_SESSION_REASON_ERROR = 2; */ + public static final int CLOSE_SESSION_REASON_ERROR_VALUE = 2; + + /** CLOSE_SESSION_REASON_USER = 3; */ + public static final int CLOSE_SESSION_REASON_USER_VALUE = 3; + + /** CLOSE_SESSION_REASON_DOWNSIZE = 4; */ + public static final int CLOSE_SESSION_REASON_DOWNSIZE_VALUE = 4; + + /** CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; */ + public static final int CLOSE_SESSION_REASON_MISSED_HEARTBEAT_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloseSessionReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CloseSessionReason forNumber(int value) { + switch (value) { + case 0: + return CLOSE_SESSION_REASON_UNSET; + case 1: + return CLOSE_SESSION_REASON_GOAWAY; + case 2: + return CLOSE_SESSION_REASON_ERROR; + case 3: + return CLOSE_SESSION_REASON_USER; + case 4: + return CLOSE_SESSION_REASON_DOWNSIZE; + case 5: + return CLOSE_SESSION_REASON_MISSED_HEARTBEAT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CloseSessionReason findValueByNumber(int number) { + return CloseSessionReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.CloseSessionRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final CloseSessionReason[] VALUES = values(); + + public static CloseSessionReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CloseSessionReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.CloseSessionRequest.CloseSessionReason) + } + + public static final int REASON_FIELD_NUMBER = 1; + private int reason_ = 0; + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason() { + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason result = + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.forNumber(reason_); + return result == null + ? com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.UNRECOGNIZED + : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = 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 (reason_ + != com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_UNSET + .getNumber()) { + output.writeEnum(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reason_ + != com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + size += getUnknownFields().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.CloseSessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.CloseSessionRequest other = + (com.google.bigtable.v2.CloseSessionRequest) obj; + + if (reason_ != other.reason_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REASON_FIELD_NUMBER; + hash = (53 * hash) + reason_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest 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.CloseSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest 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.CloseSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.CloseSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.CloseSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.CloseSessionRequest) + com.google.bigtable.v2.CloseSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CloseSessionRequest.class, + com.google.bigtable.v2.CloseSessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.CloseSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reason_ = 0; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest build() { + com.google.bigtable.v2.CloseSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest buildPartial() { + com.google.bigtable.v2.CloseSessionRequest result = + new com.google.bigtable.v2.CloseSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.CloseSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.CloseSessionRequest) { + return mergeFrom((com.google.bigtable.v2.CloseSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.CloseSessionRequest other) { + if (other == com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance()) return this; + if (other.reason_ != 0) { + setReasonValue(other.getReasonValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + reason_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int reason_ = 0; + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @param value The enum numeric value on the wire for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonValue(int value) { + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason() { + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason result = + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.forNumber(reason_); + return result == null + ? com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.UNRECOGNIZED + : result; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + reason_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + bitField0_ = (bitField0_ & ~0x00000001); + reason_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CloseSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.CloseSessionRequest) + private static final com.google.bigtable.v2.CloseSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.CloseSessionRequest(); + } + + public static com.google.bigtable.v2.CloseSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloseSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CloseSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java new file mode 100644 index 000000000000..e7f1fd2994e1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface CloseSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.CloseSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + int getReasonValue(); + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason(); + + /** + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java new file mode 100644 index 000000000000..9e7d108425e2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java @@ -0,0 +1,702 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Information on which Cluster served a vRPC, e.g. for Client-Side metrics.
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ClusterInformation} + */ +@com.google.protobuf.Generated +public final class ClusterInformation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClusterInformation) + ClusterInformationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClusterInformation"); + } + + // Use ClusterInformation.newBuilder() to construct. + private ClusterInformation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClusterInformation() { + clusterId_ = ""; + zoneId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClusterInformation.class, + com.google.bigtable.v2.ClusterInformation.Builder.class); + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ZONE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = 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.GeneratedMessage.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, clusterId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zoneId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, zoneId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, clusterId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zoneId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, zoneId_); + } + size += getUnknownFields().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.ClusterInformation)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClusterInformation other = + (com.google.bigtable.v2.ClusterInformation) obj; + + if (!getClusterId().equals(other.getClusterId())) return false; + if (!getZoneId().equals(other.getZoneId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + hash = (37 * hash) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation 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.ClusterInformation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation 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.ClusterInformation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ClusterInformation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information on which Cluster served a vRPC, e.g. for Client-Side metrics.
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ClusterInformation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClusterInformation) + com.google.bigtable.v2.ClusterInformationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClusterInformation.class, + com.google.bigtable.v2.ClusterInformation.Builder.class); + } + + // Construct using com.google.bigtable.v2.ClusterInformation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clusterId_ = ""; + zoneId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getDefaultInstanceForType() { + return com.google.bigtable.v2.ClusterInformation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation build() { + com.google.bigtable.v2.ClusterInformation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation buildPartial() { + com.google.bigtable.v2.ClusterInformation result = + new com.google.bigtable.v2.ClusterInformation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ClusterInformation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.zoneId_ = zoneId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClusterInformation) { + return mergeFrom((com.google.bigtable.v2.ClusterInformation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ClusterInformation other) { + if (other == com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) return this; + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getZoneId().isEmpty()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object clusterId_ = ""; + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string cluster_id = 1; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string cluster_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string cluster_id = 1; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object zoneId_ = ""; + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string zone_id = 2; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string zone_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string zone_id = 2; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClusterInformation) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClusterInformation) + private static final com.google.bigtable.v2.ClusterInformation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClusterInformation(); + } + + public static com.google.bigtable.v2.ClusterInformation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterInformation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ClusterInformation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java new file mode 100644 index 000000000000..392d0b7a67b9 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ClusterInformationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClusterInformation) + com.google.protobuf.MessageOrBuilder { + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java new file mode 100644 index 000000000000..6ccfb8de32cc --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java @@ -0,0 +1,1022 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies (some of) the contents of a single row/column intersection of a
+ * table.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Column} + */ +@com.google.protobuf.Generated +public final class Column extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Column) + ColumnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Column"); + } + + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Column() { + qualifier_ = com.google.protobuf.ByteString.EMPTY; + cells_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Column.class, com.google.bigtable.v2.Column.Builder.class); + } + + public static final int QUALIFIER_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString qualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The unique key which identifies this column within its family. This is the
+   * same key that's used to identify the column in, for example, a RowFilter
+   * which sets its `column_qualifier_regex_filter` field.
+   * May contain any byte string, including the empty string, up to 16kiB in
+   * length.
+   * 
+ * + * bytes qualifier = 1; + * + * @return The qualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQualifier() { + return qualifier_; + } + + public static final int CELLS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List cells_; + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + @java.lang.Override + public java.util.List getCellsList() { + return cells_; + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + @java.lang.Override + public java.util.List getCellsOrBuilderList() { + return cells_; + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + @java.lang.Override + public int getCellsCount() { + return cells_.size(); + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Cell getCells(int index) { + return cells_.get(index); + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.CellOrBuilder getCellsOrBuilder(int index) { + return cells_.get(index); + } + + 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 (!qualifier_.isEmpty()) { + output.writeBytes(1, qualifier_); + } + for (int i = 0; i < cells_.size(); i++) { + output.writeMessage(2, cells_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!qualifier_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, qualifier_); + } + for (int i = 0; i < cells_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, cells_.get(i)); + } + size += getUnknownFields().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.Column)) { + return super.equals(obj); + } + com.google.bigtable.v2.Column other = (com.google.bigtable.v2.Column) obj; + + if (!getQualifier().equals(other.getQualifier())) return false; + if (!getCellsList().equals(other.getCellsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getQualifier().hashCode(); + if (getCellsCount() > 0) { + hash = (37 * hash) + CELLS_FIELD_NUMBER; + hash = (53 * hash) + getCellsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Column parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Column 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.Column parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Column 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.Column parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Column parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Column parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Column parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Column parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Column parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Column parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Column parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Column 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies (some of) the contents of a single row/column intersection of a
+   * table.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Column} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Column) + com.google.bigtable.v2.ColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Column.class, com.google.bigtable.v2.Column.Builder.class); + } + + // Construct using com.google.bigtable.v2.Column.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + qualifier_ = com.google.protobuf.ByteString.EMPTY; + if (cellsBuilder_ == null) { + cells_ = java.util.Collections.emptyList(); + } else { + cells_ = null; + cellsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Column_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Column getDefaultInstanceForType() { + return com.google.bigtable.v2.Column.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Column build() { + com.google.bigtable.v2.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Column buildPartial() { + com.google.bigtable.v2.Column result = new com.google.bigtable.v2.Column(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Column result) { + if (cellsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + cells_ = java.util.Collections.unmodifiableList(cells_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.cells_ = cells_; + } else { + result.cells_ = cellsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.qualifier_ = qualifier_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Column) { + return mergeFrom((com.google.bigtable.v2.Column) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Column other) { + if (other == com.google.bigtable.v2.Column.getDefaultInstance()) return this; + if (!other.getQualifier().isEmpty()) { + setQualifier(other.getQualifier()); + } + if (cellsBuilder_ == null) { + if (!other.cells_.isEmpty()) { + if (cells_.isEmpty()) { + cells_ = other.cells_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCellsIsMutable(); + cells_.addAll(other.cells_); + } + onChanged(); + } + } else { + if (!other.cells_.isEmpty()) { + if (cellsBuilder_.isEmpty()) { + cellsBuilder_.dispose(); + cellsBuilder_ = null; + cells_ = other.cells_; + bitField0_ = (bitField0_ & ~0x00000002); + cellsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCellsFieldBuilder() + : null; + } else { + cellsBuilder_.addAllMessages(other.cells_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + qualifier_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Cell m = + input.readMessage(com.google.bigtable.v2.Cell.parser(), extensionRegistry); + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + cells_.add(m); + } else { + cellsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString qualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The unique key which identifies this column within its family. This is the
+     * same key that's used to identify the column in, for example, a RowFilter
+     * which sets its `column_qualifier_regex_filter` field.
+     * May contain any byte string, including the empty string, up to 16kiB in
+     * length.
+     * 
+ * + * bytes qualifier = 1; + * + * @return The qualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQualifier() { + return qualifier_; + } + + /** + * + * + *
+     * The unique key which identifies this column within its family. This is the
+     * same key that's used to identify the column in, for example, a RowFilter
+     * which sets its `column_qualifier_regex_filter` field.
+     * May contain any byte string, including the empty string, up to 16kiB in
+     * length.
+     * 
+ * + * bytes qualifier = 1; + * + * @param value The qualifier to set. + * @return This builder for chaining. + */ + public Builder setQualifier(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + qualifier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique key which identifies this column within its family. This is the
+     * same key that's used to identify the column in, for example, a RowFilter
+     * which sets its `column_qualifier_regex_filter` field.
+     * May contain any byte string, including the empty string, up to 16kiB in
+     * length.
+     * 
+ * + * bytes qualifier = 1; + * + * @return This builder for chaining. + */ + public Builder clearQualifier() { + bitField0_ = (bitField0_ & ~0x00000001); + qualifier_ = getDefaultInstance().getQualifier(); + onChanged(); + return this; + } + + private java.util.List cells_ = java.util.Collections.emptyList(); + + private void ensureCellsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + cells_ = new java.util.ArrayList(cells_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Cell, + com.google.bigtable.v2.Cell.Builder, + com.google.bigtable.v2.CellOrBuilder> + cellsBuilder_; + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public java.util.List getCellsList() { + if (cellsBuilder_ == null) { + return java.util.Collections.unmodifiableList(cells_); + } else { + return cellsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public int getCellsCount() { + if (cellsBuilder_ == null) { + return cells_.size(); + } else { + return cellsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public com.google.bigtable.v2.Cell getCells(int index) { + if (cellsBuilder_ == null) { + return cells_.get(index); + } else { + return cellsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder setCells(int index, com.google.bigtable.v2.Cell value) { + if (cellsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCellsIsMutable(); + cells_.set(index, value); + onChanged(); + } else { + cellsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder setCells(int index, com.google.bigtable.v2.Cell.Builder builderForValue) { + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + cells_.set(index, builderForValue.build()); + onChanged(); + } else { + cellsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder addCells(com.google.bigtable.v2.Cell value) { + if (cellsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCellsIsMutable(); + cells_.add(value); + onChanged(); + } else { + cellsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder addCells(int index, com.google.bigtable.v2.Cell value) { + if (cellsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCellsIsMutable(); + cells_.add(index, value); + onChanged(); + } else { + cellsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder addCells(com.google.bigtable.v2.Cell.Builder builderForValue) { + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + cells_.add(builderForValue.build()); + onChanged(); + } else { + cellsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder addCells(int index, com.google.bigtable.v2.Cell.Builder builderForValue) { + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + cells_.add(index, builderForValue.build()); + onChanged(); + } else { + cellsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder addAllCells(java.lang.Iterable values) { + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, cells_); + onChanged(); + } else { + cellsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder clearCells() { + if (cellsBuilder_ == null) { + cells_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + cellsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public Builder removeCells(int index) { + if (cellsBuilder_ == null) { + ensureCellsIsMutable(); + cells_.remove(index); + onChanged(); + } else { + cellsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public com.google.bigtable.v2.Cell.Builder getCellsBuilder(int index) { + return internalGetCellsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public com.google.bigtable.v2.CellOrBuilder getCellsOrBuilder(int index) { + if (cellsBuilder_ == null) { + return cells_.get(index); + } else { + return cellsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public java.util.List getCellsOrBuilderList() { + if (cellsBuilder_ != null) { + return cellsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cells_); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public com.google.bigtable.v2.Cell.Builder addCellsBuilder() { + return internalGetCellsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Cell.getDefaultInstance()); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public com.google.bigtable.v2.Cell.Builder addCellsBuilder(int index) { + return internalGetCellsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Cell.getDefaultInstance()); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+     * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + public java.util.List getCellsBuilderList() { + return internalGetCellsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Cell, + com.google.bigtable.v2.Cell.Builder, + com.google.bigtable.v2.CellOrBuilder> + internalGetCellsFieldBuilder() { + if (cellsBuilder_ == null) { + cellsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Cell, + com.google.bigtable.v2.Cell.Builder, + com.google.bigtable.v2.CellOrBuilder>( + cells_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + cells_ = null; + } + return cellsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Column) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Column) + private static final com.google.bigtable.v2.Column DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Column(); + } + + public static com.google.bigtable.v2.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java new file mode 100644 index 000000000000..d73499cdf141 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java @@ -0,0 +1,875 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Describes a column in a Bigtable Query Language result set.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ColumnMetadata} + */ +@com.google.protobuf.Generated +public final class ColumnMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ColumnMetadata) + ColumnMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ColumnMetadata"); + } + + // Use ColumnMetadata.newBuilder() to construct. + private ColumnMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ColumnMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ColumnMetadata.class, + com.google.bigtable.v2.ColumnMetadata.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the column.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The name of the column.
+   * 
+ * + * string name = 1; + * + * @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 TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Type type_; + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getType() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + size += getUnknownFields().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.ColumnMetadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.ColumnMetadata other = (com.google.bigtable.v2.ColumnMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnMetadata 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.ColumnMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnMetadata 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.ColumnMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ColumnMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Describes a column in a Bigtable Query Language result set.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ColumnMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ColumnMetadata) + com.google.bigtable.v2.ColumnMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ColumnMetadata.class, + com.google.bigtable.v2.ColumnMetadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.ColumnMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnMetadata getDefaultInstanceForType() { + return com.google.bigtable.v2.ColumnMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnMetadata build() { + com.google.bigtable.v2.ColumnMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnMetadata buildPartial() { + com.google.bigtable.v2.ColumnMetadata result = + new com.google.bigtable.v2.ColumnMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ColumnMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ColumnMetadata) { + return mergeFrom((com.google.bigtable.v2.ColumnMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ColumnMetadata other) { + if (other == com.google.bigtable.v2.ColumnMetadata.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasType()) { + mergeType(other.getType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the column.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the column.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The name of the column.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.v2.Type type_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + public com.google.bigtable.v2.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder mergeType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && type_ != null + && type_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public com.google.bigtable.v2.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+     * The type of the column.
+     * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ColumnMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ColumnMetadata) + private static final com.google.bigtable.v2.ColumnMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ColumnMetadata(); + } + + public static com.google.bigtable.v2.ColumnMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColumnMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ColumnMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java new file mode 100644 index 000000000000..fa42bea19b48 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ColumnMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ColumnMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the column.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the column.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + com.google.bigtable.v2.Type getType(); + + /** + * + * + *
+   * The type of the column.
+   * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java new file mode 100644 index 000000000000..5d29131b2a25 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique key which identifies this column within its family. This is the
+   * same key that's used to identify the column in, for example, a RowFilter
+   * which sets its `column_qualifier_regex_filter` field.
+   * May contain any byte string, including the empty string, up to 16kiB in
+   * length.
+   * 
+ * + * bytes qualifier = 1; + * + * @return The qualifier. + */ + com.google.protobuf.ByteString getQualifier(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + java.util.List getCellsList(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + com.google.bigtable.v2.Cell getCells(int index); + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + int getCellsCount(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + java.util.List getCellsOrBuilderList(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of decreasing "timestamp_micros".
+   * 
+ * + * repeated .google.bigtable.v2.Cell cells = 2; + */ + com.google.bigtable.v2.CellOrBuilder getCellsOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java new file mode 100644 index 000000000000..df6d511e3b04 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java @@ -0,0 +1,1320 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies a contiguous range of columns within a single column family.
+ * The range spans from &lt;column_family&gt;:&lt;start_qualifier&gt; to
+ * &lt;column_family&gt;:&lt;end_qualifier&gt;, where both bounds can be either
+ * inclusive or exclusive.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ColumnRange} + */ +@com.google.protobuf.Generated +public final class ColumnRange extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ColumnRange) + ColumnRangeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ColumnRange"); + } + + // Use ColumnRange.newBuilder() to construct. + private ColumnRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ColumnRange() { + familyName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ColumnRange.class, + com.google.bigtable.v2.ColumnRange.Builder.class); + } + + private int startQualifierCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object startQualifier_; + + public enum StartQualifierCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + START_QUALIFIER_CLOSED(2), + START_QUALIFIER_OPEN(3), + STARTQUALIFIER_NOT_SET(0); + private final int value; + + private StartQualifierCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StartQualifierCase valueOf(int value) { + return forNumber(value); + } + + public static StartQualifierCase forNumber(int value) { + switch (value) { + case 2: + return START_QUALIFIER_CLOSED; + case 3: + return START_QUALIFIER_OPEN; + case 0: + return STARTQUALIFIER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StartQualifierCase getStartQualifierCase() { + return StartQualifierCase.forNumber(startQualifierCase_); + } + + private int endQualifierCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object endQualifier_; + + public enum EndQualifierCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_QUALIFIER_CLOSED(4), + END_QUALIFIER_OPEN(5), + ENDQUALIFIER_NOT_SET(0); + private final int value; + + private EndQualifierCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndQualifierCase valueOf(int value) { + return forNumber(value); + } + + public static EndQualifierCase forNumber(int value) { + switch (value) { + case 4: + return END_QUALIFIER_CLOSED; + case 5: + return END_QUALIFIER_OPEN; + case 0: + return ENDQUALIFIER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndQualifierCase getEndQualifierCase() { + return EndQualifierCase.forNumber(endQualifierCase_); + } + + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+   * The name of the column family within which this range falls.
+   * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the column family within which this range falls.
+   * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_QUALIFIER_CLOSED_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return Whether the startQualifierClosed field is set. + */ + @java.lang.Override + public boolean hasStartQualifierClosed() { + return startQualifierCase_ == 2; + } + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return The startQualifierClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartQualifierClosed() { + if (startQualifierCase_ == 2) { + return (com.google.protobuf.ByteString) startQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int START_QUALIFIER_OPEN_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_open = 3; + * + * @return Whether the startQualifierOpen field is set. + */ + @java.lang.Override + public boolean hasStartQualifierOpen() { + return startQualifierCase_ == 3; + } + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_open = 3; + * + * @return The startQualifierOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartQualifierOpen() { + if (startQualifierCase_ == 3) { + return (com.google.protobuf.ByteString) startQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_QUALIFIER_CLOSED_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return Whether the endQualifierClosed field is set. + */ + @java.lang.Override + public boolean hasEndQualifierClosed() { + return endQualifierCase_ == 4; + } + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return The endQualifierClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndQualifierClosed() { + if (endQualifierCase_ == 4) { + return (com.google.protobuf.ByteString) endQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_QUALIFIER_OPEN_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_open = 5; + * + * @return Whether the endQualifierOpen field is set. + */ + @java.lang.Override + public boolean hasEndQualifierOpen() { + return endQualifierCase_ == 5; + } + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_open = 5; + * + * @return The endQualifierOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndQualifierOpen() { + if (endQualifierCase_ == 5) { + return (com.google.protobuf.ByteString) endQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (startQualifierCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) startQualifier_); + } + if (startQualifierCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) startQualifier_); + } + if (endQualifierCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) endQualifier_); + } + if (endQualifierCase_ == 5) { + output.writeBytes(5, (com.google.protobuf.ByteString) endQualifier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (startQualifierCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) startQualifier_); + } + if (startQualifierCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) startQualifier_); + } + if (endQualifierCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) endQualifier_); + } + if (endQualifierCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 5, (com.google.protobuf.ByteString) endQualifier_); + } + size += getUnknownFields().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.ColumnRange)) { + return super.equals(obj); + } + com.google.bigtable.v2.ColumnRange other = (com.google.bigtable.v2.ColumnRange) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (!getStartQualifierCase().equals(other.getStartQualifierCase())) return false; + switch (startQualifierCase_) { + case 2: + if (!getStartQualifierClosed().equals(other.getStartQualifierClosed())) return false; + break; + case 3: + if (!getStartQualifierOpen().equals(other.getStartQualifierOpen())) return false; + break; + case 0: + default: + } + if (!getEndQualifierCase().equals(other.getEndQualifierCase())) return false; + switch (endQualifierCase_) { + case 4: + if (!getEndQualifierClosed().equals(other.getEndQualifierClosed())) return false; + break; + case 5: + if (!getEndQualifierOpen().equals(other.getEndQualifierOpen())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + switch (startQualifierCase_) { + case 2: + hash = (37 * hash) + START_QUALIFIER_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getStartQualifierClosed().hashCode(); + break; + case 3: + hash = (37 * hash) + START_QUALIFIER_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getStartQualifierOpen().hashCode(); + break; + case 0: + default: + } + switch (endQualifierCase_) { + case 4: + hash = (37 * hash) + END_QUALIFIER_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getEndQualifierClosed().hashCode(); + break; + case 5: + hash = (37 * hash) + END_QUALIFIER_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getEndQualifierOpen().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ColumnRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnRange 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.ColumnRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnRange 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.ColumnRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ColumnRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ColumnRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ColumnRange 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a contiguous range of columns within a single column family.
+   * The range spans from &lt;column_family&gt;:&lt;start_qualifier&gt; to
+   * &lt;column_family&gt;:&lt;end_qualifier&gt;, where both bounds can be either
+   * inclusive or exclusive.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ColumnRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ColumnRange) + com.google.bigtable.v2.ColumnRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ColumnRange.class, + com.google.bigtable.v2.ColumnRange.Builder.class); + } + + // Construct using com.google.bigtable.v2.ColumnRange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + startQualifierCase_ = 0; + startQualifier_ = null; + endQualifierCase_ = 0; + endQualifier_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ColumnRange_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnRange getDefaultInstanceForType() { + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnRange build() { + com.google.bigtable.v2.ColumnRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ColumnRange buildPartial() { + com.google.bigtable.v2.ColumnRange result = new com.google.bigtable.v2.ColumnRange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ColumnRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + } + + private void buildPartialOneofs(com.google.bigtable.v2.ColumnRange result) { + result.startQualifierCase_ = startQualifierCase_; + result.startQualifier_ = this.startQualifier_; + result.endQualifierCase_ = endQualifierCase_; + result.endQualifier_ = this.endQualifier_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ColumnRange) { + return mergeFrom((com.google.bigtable.v2.ColumnRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ColumnRange other) { + if (other == com.google.bigtable.v2.ColumnRange.getDefaultInstance()) return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + switch (other.getStartQualifierCase()) { + case START_QUALIFIER_CLOSED: + { + setStartQualifierClosed(other.getStartQualifierClosed()); + break; + } + case START_QUALIFIER_OPEN: + { + setStartQualifierOpen(other.getStartQualifierOpen()); + break; + } + case STARTQUALIFIER_NOT_SET: + { + break; + } + } + switch (other.getEndQualifierCase()) { + case END_QUALIFIER_CLOSED: + { + setEndQualifierClosed(other.getEndQualifierClosed()); + break; + } + case END_QUALIFIER_OPEN: + { + setEndQualifierOpen(other.getEndQualifierOpen()); + break; + } + case ENDQUALIFIER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + startQualifier_ = input.readBytes(); + startQualifierCase_ = 2; + break; + } // case 18 + case 26: + { + startQualifier_ = input.readBytes(); + startQualifierCase_ = 3; + break; + } // case 26 + case 34: + { + endQualifier_ = input.readBytes(); + endQualifierCase_ = 4; + break; + } // case 34 + case 42: + { + endQualifier_ = input.readBytes(); + endQualifierCase_ = 5; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startQualifierCase_ = 0; + private java.lang.Object startQualifier_; + + public StartQualifierCase getStartQualifierCase() { + return StartQualifierCase.forNumber(startQualifierCase_); + } + + public Builder clearStartQualifier() { + startQualifierCase_ = 0; + startQualifier_ = null; + onChanged(); + return this; + } + + private int endQualifierCase_ = 0; + private java.lang.Object endQualifier_; + + public EndQualifierCase getEndQualifierCase() { + return EndQualifierCase.forNumber(endQualifierCase_); + } + + public Builder clearEndQualifier() { + endQualifierCase_ = 0; + endQualifier_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the column family within which this range falls.
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the column family within which this range falls.
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the column family within which this range falls.
+     * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column family within which this range falls.
+     * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column family within which this range falls.
+     * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return Whether the startQualifierClosed field is set. + */ + public boolean hasStartQualifierClosed() { + return startQualifierCase_ == 2; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return The startQualifierClosed. + */ + public com.google.protobuf.ByteString getStartQualifierClosed() { + if (startQualifierCase_ == 2) { + return (com.google.protobuf.ByteString) startQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_closed = 2; + * + * @param value The startQualifierClosed to set. + * @return This builder for chaining. + */ + public Builder setStartQualifierClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startQualifierCase_ = 2; + startQualifier_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return This builder for chaining. + */ + public Builder clearStartQualifierClosed() { + if (startQualifierCase_ == 2) { + startQualifierCase_ = 0; + startQualifier_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_open = 3; + * + * @return Whether the startQualifierOpen field is set. + */ + public boolean hasStartQualifierOpen() { + return startQualifierCase_ == 3; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_open = 3; + * + * @return The startQualifierOpen. + */ + public com.google.protobuf.ByteString getStartQualifierOpen() { + if (startQualifierCase_ == 3) { + return (com.google.protobuf.ByteString) startQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_open = 3; + * + * @param value The startQualifierOpen to set. + * @return This builder for chaining. + */ + public Builder setStartQualifierOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startQualifierCase_ = 3; + startQualifier_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_qualifier_open = 3; + * + * @return This builder for chaining. + */ + public Builder clearStartQualifierOpen() { + if (startQualifierCase_ == 3) { + startQualifierCase_ = 0; + startQualifier_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return Whether the endQualifierClosed field is set. + */ + public boolean hasEndQualifierClosed() { + return endQualifierCase_ == 4; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return The endQualifierClosed. + */ + public com.google.protobuf.ByteString getEndQualifierClosed() { + if (endQualifierCase_ == 4) { + return (com.google.protobuf.ByteString) endQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_closed = 4; + * + * @param value The endQualifierClosed to set. + * @return This builder for chaining. + */ + public Builder setEndQualifierClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endQualifierCase_ = 4; + endQualifier_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return This builder for chaining. + */ + public Builder clearEndQualifierClosed() { + if (endQualifierCase_ == 4) { + endQualifierCase_ = 0; + endQualifier_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_open = 5; + * + * @return Whether the endQualifierOpen field is set. + */ + public boolean hasEndQualifierOpen() { + return endQualifierCase_ == 5; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_open = 5; + * + * @return The endQualifierOpen. + */ + public com.google.protobuf.ByteString getEndQualifierOpen() { + if (endQualifierCase_ == 5) { + return (com.google.protobuf.ByteString) endQualifier_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_open = 5; + * + * @param value The endQualifierOpen to set. + * @return This builder for chaining. + */ + public Builder setEndQualifierOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endQualifierCase_ = 5; + endQualifier_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_qualifier_open = 5; + * + * @return This builder for chaining. + */ + public Builder clearEndQualifierOpen() { + if (endQualifierCase_ == 5) { + endQualifierCase_ = 0; + endQualifier_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ColumnRange) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ColumnRange) + private static final com.google.bigtable.v2.ColumnRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ColumnRange(); + } + + public static com.google.bigtable.v2.ColumnRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColumnRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ColumnRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java new file mode 100644 index 000000000000..b7eab1ee34db --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ColumnRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ColumnRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the column family within which this range falls.
+   * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+   * The name of the column family within which this range falls.
+   * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return Whether the startQualifierClosed field is set. + */ + boolean hasStartQualifierClosed(); + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_closed = 2; + * + * @return The startQualifierClosed. + */ + com.google.protobuf.ByteString getStartQualifierClosed(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_open = 3; + * + * @return Whether the startQualifierOpen field is set. + */ + boolean hasStartQualifierOpen(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_qualifier_open = 3; + * + * @return The startQualifierOpen. + */ + com.google.protobuf.ByteString getStartQualifierOpen(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return Whether the endQualifierClosed field is set. + */ + boolean hasEndQualifierClosed(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_closed = 4; + * + * @return The endQualifierClosed. + */ + com.google.protobuf.ByteString getEndQualifierClosed(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_open = 5; + * + * @return Whether the endQualifierOpen field is set. + */ + boolean hasEndQualifierOpen(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_qualifier_open = 5; + * + * @return The endQualifierOpen. + */ + com.google.protobuf.ByteString getEndQualifierOpen(); + + com.google.bigtable.v2.ColumnRange.StartQualifierCase getStartQualifierCase(); + + com.google.bigtable.v2.ColumnRange.EndQualifierCase getEndQualifierCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java new file mode 100644 index 000000000000..36dd67332395 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java @@ -0,0 +1,704 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class DataProto extends com.google.protobuf.GeneratedFile { + private DataProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Row_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Row_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Family_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Family_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Column_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Column_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Cell_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Cell_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Value_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Value_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ArrayValue_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ArrayValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowRange_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowSet_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ColumnRange_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TimestampRange_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ValueRange_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ValueBitmask_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ValueBitmask_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowFilter_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowFilter_Chain_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RowFilter_Condition_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_StreamPartition_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_StreamPartition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_StreamContinuationTokens_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_StreamContinuationToken_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_StreamContinuationToken_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ProtoFormat_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ProtoFormat_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ColumnMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ColumnMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ProtoSchema_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ProtoSchema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ResultSetMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ResultSetMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ProtoRows_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ProtoRows_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ProtoRowsBatch_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PartialResultSet_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Idempotency_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Idempotency_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "\035google/bigtable/v2/data.proto\022\022google." + + "bigtable.v2\032\037google/api/field_behavior.p" + + "roto\032\036google/bigtable/v2/types.proto\032\037go" + + "ogle/protobuf/timestamp.proto\032\026google/type/date.proto\"@\n" + + "\003Row\022\013\n" + + "\003key\030\001 \001(\014\022,\n" + + "\010families\030\002 \003(\0132\032.google.bigtable.v2.Family\"C\n" + + "\006Family\022\014\n" + + "\004name\030\001 \001(\t\022+\n" + + "\007columns\030\002 \003(\0132\032.google.bigtable.v2.Column\"D\n" + + "\006Column\022\021\n" + + "\tqualifier\030\001 \001(\014\022\'\n" + + "\005cells\030\002 \003(\0132\030.google.bigtable.v2.Cell\"?\n" + + "\004Cell\022\030\n" + + "\020timestamp_micros\030\001 \001(\003\022\r\n" + + "\005value\030\002 \001(\014\022\016\n" + + "\006labels\030\003 \003(\t\"\364\002\n" + + "\005Value\022&\n" + + "\004type\030\007 \001(\0132\030.google.bigtable.v2.Type\022\023\n" + + "\traw_value\030\010 \001(\014H\000\022\036\n" + + "\024raw_timestamp_micros\030\t \001(\003H\000\022\025\n" + + "\013bytes_value\030\002 \001(\014H\000\022\026\n" + + "\014string_value\030\003 \001(\tH\000\022\023\n" + + "\tint_value\030\006 \001(\003H\000\022\024\n\n" + + "bool_value\030\n" + + " \001(\010H\000\022\025\n" + + "\013float_value\030\013 \001(\001H\000\0225\n" + + "\017timestamp_value\030\014 \001(\0132\032.google.protobuf.TimestampH\000\022\'\n\n" + + "date_value\030\r" + + " \001(\0132\021.google.type.DateH\000\0225\n" + + "\013array_value\030\004 \001(\0132\036.google.bigtable.v2.ArrayValueH\000B\006\n" + + "\004kind\"7\n\n" + + "ArrayValue\022)\n" + + "\006values\030\001 \003(\0132\031.google.bigtable.v2.Value\"\212\001\n" + + "\010RowRange\022\032\n" + + "\020start_key_closed\030\001 \001(\014H\000\022\030\n" + + "\016start_key_open\030\002 \001(\014H\000\022\026\n" + + "\014end_key_open\030\003 \001(\014H\001\022\030\n" + + "\016end_key_closed\030\004 \001(\014H\001B\013\n" + + "\tstart_keyB\t\n" + + "\007end_key\"L\n" + + "\006RowSet\022\020\n" + + "\010row_keys\030\001 \003(\014\0220\n\n" + + "row_ranges\030\002 \003(\0132\034.google.bigtable.v2.RowRange\"\306\001\n" + + "\013ColumnRange\022\023\n" + + "\013family_name\030\001 \001(\t\022 \n" + + "\026start_qualifier_closed\030\002 \001(\014H\000\022\036\n" + + "\024start_qualifier_open\030\003 \001(\014H\000\022\036\n" + + "\024end_qualifier_closed\030\004 \001(\014H\001\022\034\n" + + "\022end_qualifier_open\030\005 \001(\014H\001B\021\n" + + "\017start_qualifierB\017\n\r" + + "end_qualifier\"N\n" + + "\016TimestampRange\022\036\n" + + "\026start_timestamp_micros\030\001 \001(\003\022\034\n" + + "\024end_timestamp_micros\030\002 \001(\003\"\230\001\n\n" + + "ValueRange\022\034\n" + + "\022start_value_closed\030\001 \001(\014H\000\022\032\n" + + "\020start_value_open\030\002 \001(\014H\000\022\032\n" + + "\020end_value_closed\030\003 \001(\014H\001\022\030\n" + + "\016end_value_open\030\004 \001(\014H\001B\r\n" + + "\013start_valueB\013\n" + + "\tend_value\"!\n" + + "\014ValueBitmask\022\021\n" + + "\004mask\030\001 \001(\014B\003\340A\002\"\241\t\n" + + "\tRowFilter\0224\n" + + "\005chain\030\001 \001(\0132#.google.bigtable.v2.RowFilter.ChainH\000\022>\n\n" + + "interleave\030\002 \001(\0132(.google.bigtable.v2.RowFilter.InterleaveH\000\022<\n" + + "\tcondition\030\003 \001(\0132\'.google.bigtable.v2.RowFilter.ConditionH\000\022\016\n" + + "\004sink\030\020 \001(\010H\000\022\031\n" + + "\017pass_all_filter\030\021 \001(\010H\000\022\032\n" + + "\020block_all_filter\030\022 \001(\010H\000\022\036\n" + + "\024row_key_regex_filter\030\004 \001(\014H\000\022\033\n" + + "\021row_sample_filter\030\016 \001(\001H\000\022\"\n" + + "\030family_name_regex_filter\030\005 \001(\tH\000\022\'\n" + + "\035column_qualifier_regex_filter\030\006 \001(\014H\000\022>\n" + + "\023column_range_filter\030\007" + + " \001(\0132\037.google.bigtable.v2.ColumnRangeH\000\022D\n" + + "\026timestamp_range_filter\030\010" + + " \001(\0132\".google.bigtable.v2.TimestampRangeH\000\022\034\n" + + "\022value_regex_filter\030\t \001(\014H\000\022<\n" + + "\022value_range_filter\030\017" + + " \001(\0132\036.google.bigtable.v2.ValueRangeH\000\022%\n" + + "\033cells_per_row_offset_filter\030\n" + + " \001(\005H\000\022$\n" + + "\032cells_per_row_limit_filter\030\013 \001(\005H\000\022\'\n" + + "\035cells_per_column_limit_filter\030\014 \001(\005H\000\022!\n" + + "\027strip_value_transformer\030\r" + + " \001(\010H\000\022!\n" + + "\027apply_label_transformer\030\023 \001(\tH\000\022@\n" + + "\024value_bitmask_filter\030\024 \001(\0132" + + " .google.bigtable.v2.ValueBitmaskH\000\0327\n" + + "\005Chain\022.\n" + + "\007filters\030\001 \003(\0132\035.google.bigtable.v2.RowFilter\032<\n\n" + + "Interleave\022.\n" + + "\007filters\030\001 \003(\0132\035.google.bigtable.v2.RowFilter\032\255\001\n" + + "\tCondition\0227\n" + + "\020predicate_filter\030\001 \001(\0132\035.google.bigtable.v2.RowFilter\0222\n" + + "\013true_filter\030\002 \001(\0132\035.google.bigtable.v2.RowFilter\0223\n" + + "\014false_filter\030\003 \001(\0132\035.google.bigtable.v2.RowFilterB\010\n" + + "\006filter\"\255\010\n" + + "\010Mutation\0228\n" + + "\010set_cell\030\001 \001(\0132$.google.bigtable.v2.Mutation.SetCellH\000\022=\n" + + "\013add_to_cell\030\005" + + " \001(\0132&.google.bigtable.v2.Mutation.AddToCellH\000\022A\n\r" + + "merge_to_cell\030\006 \001(\0132(.google.bigtable.v2.Mutation.MergeToCellH\000\022K\n" + + "\022delete_from_column\030\002" + + " \001(\0132-.google.bigtable.v2.Mutation.DeleteFromColumnH\000\022K\n" + + "\022delete_from_family\030\003" + + " \001(\0132-.google.bigtable.v2.Mutation.DeleteFromFamilyH\000\022E\n" + + "\017delete_from_row\030\004" + + " \001(\0132*.google.bigtable.v2.Mutation.DeleteFromRowH\000\032a\n" + + "\007SetCell\022\023\n" + + "\013family_name\030\001 \001(\t\022\030\n" + + "\020column_qualifier\030\002 \001(\014\022\030\n" + + "\020timestamp_micros\030\003 \001(\003\022\r\n" + + "\005value\030\004 \001(\014\032\255\001\n" + + "\tAddToCell\022\023\n" + + "\013family_name\030\001 \001(\t\0223\n" + + "\020column_qualifier\030\002 \001(\0132\031.google.bigtable.v2.Value\022,\n" + + "\ttimestamp\030\003 \001(\0132\031.google.bigtable.v2.Value\022(\n" + + "\005input\030\004 \001(\0132\031.google.bigtable.v2.Value\032\257\001\n" + + "\013MergeToCell\022\023\n" + + "\013family_name\030\001 \001(\t\0223\n" + + "\020column_qualifier\030\002 \001(\0132\031.google.bigtable.v2.Value\022,\n" + + "\ttimestamp\030\003 \001(\0132\031.google.bigtable.v2.Value\022(\n" + + "\005input\030\004 \001(\0132\031.google.bigtable.v2.Value\032y\n" + + "\020DeleteFromColumn\022\023\n" + + "\013family_name\030\001 \001(\t\022\030\n" + + "\020column_qualifier\030\002 \001(\014\0226\n\n" + + "time_range\030\003 \001(\0132\".google.bigtable.v2.TimestampRange\032\'\n" + + "\020DeleteFromFamily\022\023\n" + + "\013family_name\030\001 \001(\t\032\017\n\r" + + "DeleteFromRowB\n\n" + + "\010mutation\"\200\001\n" + + "\023ReadModifyWriteRule\022\023\n" + + "\013family_name\030\001 \001(\t\022\030\n" + + "\020column_qualifier\030\002 \001(\014\022\026\n" + + "\014append_value\030\003 \001(\014H\000\022\032\n" + + "\020increment_amount\030\004 \001(\003H\000B\006\n" + + "\004rule\"B\n" + + "\017StreamPartition\022/\n" + + "\trow_range\030\001 \001(\0132\034.google.bigtable.v2.RowRange\"W\n" + + "\030StreamContinuationTokens\022;\n" + + "\006tokens\030\001 \003(\0132+.google.bigtable.v2.StreamContinuationToken\"`\n" + + "\027StreamContinuationToken\0226\n" + + "\tpartition\030\001 \001(\0132#.google.bigtable.v2.StreamPartition\022\r\n" + + "\005token\030\002 \001(\t\"\r\n" + + "\013ProtoFormat\"F\n" + + "\016ColumnMetadata\022\014\n" + + "\004name\030\001 \001(\t\022&\n" + + "\004type\030\002 \001(\0132\030.google.bigtable.v2.Type\"B\n" + + "\013ProtoSchema\0223\n" + + "\007columns\030\001 \003(\0132\".google.bigtable.v2.ColumnMetadata\"V\n" + + "\021ResultSetMetadata\0227\n" + + "\014proto_schema\030\001 \001(\0132\037.google.bigtable.v2.ProtoSchemaH\000B\010\n" + + "\006schema\"6\n" + + "\tProtoRows\022)\n" + + "\006values\030\002 \003(\0132\031.google.bigtable.v2.Value\"$\n" + + "\016ProtoRowsBatch\022\022\n\n" + + "batch_data\030\001 \001(\014\"\325\001\n" + + "\020PartialResultSet\022>\n" + + "\020proto_rows_batch\030\003" + + " \001(\0132\".google.bigtable.v2.ProtoRowsBatchH\000\022\033\n" + + "\016batch_checksum\030\006 \001(\r" + + "H\001\210\001\001\022\024\n" + + "\014resume_token\030\005 \001(\014\022\r\n" + + "\005reset\030\007 \001(\010\022\034\n" + + "\024estimated_batch_size\030\004 \001(\005B\016\n" + + "\014partial_rowsB\021\n" + + "\017_batch_checksum\"L\n" + + "\013Idempotency\022\r\n" + + "\005token\030\001 \001(\014\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.TimestampB\263\001\n" + + "\026com.google.bigtable.v2B\tDataProtoP\001Z8cloud.google.com/go/bigtable/apiv2/b" + + "igtablepb;bigtablepb\252\002\030Google.Cloud.Bigt" + + "able.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Goo" + + "gle::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.bigtable.v2.TypesProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_Row_descriptor = getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_Row_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Row_descriptor, + new java.lang.String[] { + "Key", "Families", + }); + internal_static_google_bigtable_v2_Family_descriptor = getDescriptor().getMessageType(1); + internal_static_google_bigtable_v2_Family_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Family_descriptor, + new java.lang.String[] { + "Name", "Columns", + }); + internal_static_google_bigtable_v2_Column_descriptor = getDescriptor().getMessageType(2); + internal_static_google_bigtable_v2_Column_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Column_descriptor, + new java.lang.String[] { + "Qualifier", "Cells", + }); + internal_static_google_bigtable_v2_Cell_descriptor = getDescriptor().getMessageType(3); + internal_static_google_bigtable_v2_Cell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Cell_descriptor, + new java.lang.String[] { + "TimestampMicros", "Value", "Labels", + }); + internal_static_google_bigtable_v2_Value_descriptor = getDescriptor().getMessageType(4); + internal_static_google_bigtable_v2_Value_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Value_descriptor, + new java.lang.String[] { + "Type", + "RawValue", + "RawTimestampMicros", + "BytesValue", + "StringValue", + "IntValue", + "BoolValue", + "FloatValue", + "TimestampValue", + "DateValue", + "ArrayValue", + "Kind", + }); + internal_static_google_bigtable_v2_ArrayValue_descriptor = getDescriptor().getMessageType(5); + internal_static_google_bigtable_v2_ArrayValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ArrayValue_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_bigtable_v2_RowRange_descriptor = getDescriptor().getMessageType(6); + internal_static_google_bigtable_v2_RowRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowRange_descriptor, + new java.lang.String[] { + "StartKeyClosed", "StartKeyOpen", "EndKeyOpen", "EndKeyClosed", "StartKey", "EndKey", + }); + internal_static_google_bigtable_v2_RowSet_descriptor = getDescriptor().getMessageType(7); + internal_static_google_bigtable_v2_RowSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowSet_descriptor, + new java.lang.String[] { + "RowKeys", "RowRanges", + }); + internal_static_google_bigtable_v2_ColumnRange_descriptor = getDescriptor().getMessageType(8); + internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ColumnRange_descriptor, + new java.lang.String[] { + "FamilyName", + "StartQualifierClosed", + "StartQualifierOpen", + "EndQualifierClosed", + "EndQualifierOpen", + "StartQualifier", + "EndQualifier", + }); + internal_static_google_bigtable_v2_TimestampRange_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TimestampRange_descriptor, + new java.lang.String[] { + "StartTimestampMicros", "EndTimestampMicros", + }); + internal_static_google_bigtable_v2_ValueRange_descriptor = getDescriptor().getMessageType(10); + internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ValueRange_descriptor, + new java.lang.String[] { + "StartValueClosed", + "StartValueOpen", + "EndValueClosed", + "EndValueOpen", + "StartValue", + "EndValue", + }); + internal_static_google_bigtable_v2_ValueBitmask_descriptor = getDescriptor().getMessageType(11); + internal_static_google_bigtable_v2_ValueBitmask_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ValueBitmask_descriptor, + new java.lang.String[] { + "Mask", + }); + internal_static_google_bigtable_v2_RowFilter_descriptor = getDescriptor().getMessageType(12); + internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowFilter_descriptor, + new java.lang.String[] { + "Chain", + "Interleave", + "Condition", + "Sink", + "PassAllFilter", + "BlockAllFilter", + "RowKeyRegexFilter", + "RowSampleFilter", + "FamilyNameRegexFilter", + "ColumnQualifierRegexFilter", + "ColumnRangeFilter", + "TimestampRangeFilter", + "ValueRegexFilter", + "ValueRangeFilter", + "CellsPerRowOffsetFilter", + "CellsPerRowLimitFilter", + "CellsPerColumnLimitFilter", + "StripValueTransformer", + "ApplyLabelTransformer", + "ValueBitmaskFilter", + "Filter", + }); + internal_static_google_bigtable_v2_RowFilter_Chain_descriptor = + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowFilter_Chain_descriptor, + new java.lang.String[] { + "Filters", + }); + internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor = + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor, + new java.lang.String[] { + "Filters", + }); + internal_static_google_bigtable_v2_RowFilter_Condition_descriptor = + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RowFilter_Condition_descriptor, + new java.lang.String[] { + "PredicateFilter", "TrueFilter", "FalseFilter", + }); + internal_static_google_bigtable_v2_Mutation_descriptor = getDescriptor().getMessageType(13); + internal_static_google_bigtable_v2_Mutation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_descriptor, + new java.lang.String[] { + "SetCell", + "AddToCell", + "MergeToCell", + "DeleteFromColumn", + "DeleteFromFamily", + "DeleteFromRow", + "Mutation", + }); + internal_static_google_bigtable_v2_Mutation_SetCell_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_SetCell_descriptor, + new java.lang.String[] { + "FamilyName", "ColumnQualifier", "TimestampMicros", "Value", + }); + internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor, + new java.lang.String[] { + "FamilyName", "ColumnQualifier", "Timestamp", "Input", + }); + internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor, + new java.lang.String[] { + "FamilyName", "ColumnQualifier", "Timestamp", "Input", + }); + internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(3); + internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor, + new java.lang.String[] { + "FamilyName", "ColumnQualifier", "TimeRange", + }); + internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(4); + internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor, + new java.lang.String[] { + "FamilyName", + }); + internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor = + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(5); + internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor, + new java.lang.String[] { + "FamilyName", "ColumnQualifier", "AppendValue", "IncrementAmount", "Rule", + }); + internal_static_google_bigtable_v2_StreamPartition_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_bigtable_v2_StreamPartition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamPartition_descriptor, + new java.lang.String[] { + "RowRange", + }); + internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_bigtable_v2_StreamContinuationTokens_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor, + new java.lang.String[] { + "Tokens", + }); + internal_static_google_bigtable_v2_StreamContinuationToken_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_bigtable_v2_StreamContinuationToken_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamContinuationToken_descriptor, + new java.lang.String[] { + "Partition", "Token", + }); + internal_static_google_bigtable_v2_ProtoFormat_descriptor = getDescriptor().getMessageType(18); + internal_static_google_bigtable_v2_ProtoFormat_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoFormat_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_ColumnMetadata_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_bigtable_v2_ColumnMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ColumnMetadata_descriptor, + new java.lang.String[] { + "Name", "Type", + }); + internal_static_google_bigtable_v2_ProtoSchema_descriptor = getDescriptor().getMessageType(20); + internal_static_google_bigtable_v2_ProtoSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoSchema_descriptor, + new java.lang.String[] { + "Columns", + }); + internal_static_google_bigtable_v2_ResultSetMetadata_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_bigtable_v2_ResultSetMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ResultSetMetadata_descriptor, + new java.lang.String[] { + "ProtoSchema", "Schema", + }); + internal_static_google_bigtable_v2_ProtoRows_descriptor = getDescriptor().getMessageType(22); + internal_static_google_bigtable_v2_ProtoRows_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoRows_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_bigtable_v2_ProtoRowsBatch_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor, + new java.lang.String[] { + "BatchData", + }); + internal_static_google_bigtable_v2_PartialResultSet_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PartialResultSet_descriptor, + new java.lang.String[] { + "ProtoRowsBatch", + "BatchChecksum", + "ResumeToken", + "Reset", + "EstimatedBatchSize", + "PartialRows", + }); + internal_static_google_bigtable_v2_Idempotency_descriptor = getDescriptor().getMessageType(25); + internal_static_google_bigtable_v2_Idempotency_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Idempotency_descriptor, + new java.lang.String[] { + "Token", "StartTime", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.bigtable.v2.TypesProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java new file mode 100644 index 000000000000..8f3bd0504820 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ErrorResponse} + */ +@com.google.protobuf.Generated +public final class ErrorResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ErrorResponse) + ErrorResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorResponse"); + } + + // Use ErrorResponse.newBuilder() to construct. + private ErrorResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ErrorResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ErrorResponse.class, + com.google.bigtable.v2.ErrorResponse.Builder.class); + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int CLUSTER_INFO_FIELD_NUMBER = 2; + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + @java.lang.Override + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int RETRY_INFO_FIELD_NUMBER = 4; + private com.google.rpc.RetryInfo retryInfo_; + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + 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 (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getClusterInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getStatus()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRetryInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClusterInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRetryInfo()); + } + size += getUnknownFields().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.ErrorResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ErrorResponse other = (com.google.bigtable.v2.ErrorResponse) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasClusterInfo() != other.hasClusterInfo()) return false; + if (hasClusterInfo()) { + if (!getClusterInfo().equals(other.getClusterInfo())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo().equals(other.getRetryInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasClusterInfo()) { + hash = (37 * hash) + CLUSTER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getClusterInfo().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse 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.ErrorResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse 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.ErrorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ErrorResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ErrorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ErrorResponse) + com.google.bigtable.v2.ErrorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ErrorResponse.class, + com.google.bigtable.v2.ErrorResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ErrorResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterInfoFieldBuilder(); + internalGetStatusFieldBuilder(); + internalGetRetryInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse build() { + com.google.bigtable.v2.ErrorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse buildPartial() { + com.google.bigtable.v2.ErrorResponse result = new com.google.bigtable.v2.ErrorResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ErrorResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterInfo_ = + clusterInfoBuilder_ == null ? clusterInfo_ : clusterInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.retryInfo_ = retryInfoBuilder_ == null ? retryInfo_ : retryInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ErrorResponse) { + return mergeFrom((com.google.bigtable.v2.ErrorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ErrorResponse other) { + if (other == com.google.bigtable.v2.ErrorResponse.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasClusterInfo()) { + mergeClusterInfo(other.getClusterInfo()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetClusterInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetRetryInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + clusterInfoBuilder_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + if (clusterInfoBuilder_ == null) { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } else { + return clusterInfoBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterInfo_ = value; + } else { + clusterInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo( + com.google.bigtable.v2.ClusterInformation.Builder builderForValue) { + if (clusterInfoBuilder_ == null) { + clusterInfo_ = builderForValue.build(); + } else { + clusterInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder mergeClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && clusterInfo_ != null + && clusterInfo_ != com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) { + getClusterInfoBuilder().mergeFrom(value); + } else { + clusterInfo_ = value; + } + } else { + clusterInfoBuilder_.mergeFrom(value); + } + if (clusterInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder clearClusterInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformation.Builder getClusterInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetClusterInfoFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + if (clusterInfoBuilder_ != null) { + return clusterInfoBuilder_.getMessageOrBuilder(); + } else { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + internalGetClusterInfoFieldBuilder() { + if (clusterInfoBuilder_ == null) { + clusterInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder>( + getClusterInfo(), getParentForChildren(), isClean()); + clusterInfo_ = null; + } + return clusterInfoBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + retryInfoBuilder_; + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + } else { + retryInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder setRetryInfo(com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && retryInfo_ != null + && retryInfo_ != com.google.rpc.RetryInfo.getDefaultInstance()) { + getRetryInfoBuilder().mergeFrom(value); + } else { + retryInfo_ = value; + } + } else { + retryInfoBuilder_.mergeFrom(value); + } + if (retryInfo_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder clearRetryInfo() { + bitField0_ = (bitField0_ & ~0x00000008); + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRetryInfoFieldBuilder().getBuilder(); + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + internalGetRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), getParentForChildren(), isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ErrorResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ErrorResponse) + private static final com.google.bigtable.v2.ErrorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ErrorResponse(); + } + + public static com.google.bigtable.v2.ErrorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ErrorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java new file mode 100644 index 000000000000..d29988fedcec --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ErrorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ErrorResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + boolean hasClusterInfo(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + com.google.bigtable.v2.ClusterInformation getClusterInfo(); + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + + /** .google.rpc.RetryInfo retry_info = 4; */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java new file mode 100644 index 000000000000..65808fb8668f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java @@ -0,0 +1,2433 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.ExecuteQuery
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryRequest} + */ +@com.google.protobuf.Generated +public final class ExecuteQueryRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ExecuteQueryRequest) + ExecuteQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExecuteQueryRequest"); + } + + // Use ExecuteQueryRequest.newBuilder() to construct. + private ExecuteQueryRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExecuteQueryRequest() { + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ExecuteQueryRequest.class, + com.google.bigtable.v2.ExecuteQueryRequest.Builder.class); + } + + private int dataFormatCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object dataFormat_; + + public enum DataFormatCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + @java.lang.Deprecated + PROTO_FORMAT(4), + DATAFORMAT_NOT_SET(0); + private final int value; + + private DataFormatCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataFormatCase valueOf(int value) { + return forNumber(value); + } + + public static DataFormatCase forNumber(int value) { + switch (value) { + case 4: + return PROTO_FORMAT; + case 0: + return DATAFORMAT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataFormatCase getDataFormatCase() { + return DataFormatCase.forNumber(dataFormatCase_); + } + + public static final int INSTANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + @java.lang.Override + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + 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(); + instanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * Optional. This value specifies routing for replication. If not specified,
+   * the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. This value specifies routing for replication. If not specified,
+   * the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
+   * Required. The query string.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The query. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The query string.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The bytes for query. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREPARED_QUERY_FIELD_NUMBER = 9; + private com.google.protobuf.ByteString preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * A prepared query that was returned from `PrepareQueryResponse`.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   *
+   * Setting this field also places restrictions on several other fields:
+   * - `data_format` must be empty.
+   * - `validate_only` must be false.
+   * - `params` must match the `param_types` set in the `PrepareQueryRequest`.
+   * 
+ * + * bytes prepared_query = 9; + * + * @return The preparedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreparedQuery() { + return preparedQuery_; + } + + public static final int PROTO_FORMAT_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return Whether the protoFormat field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasProtoFormat() { + return dataFormatCase_ == 4; + } + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return The protoFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.ProtoFormat getProtoFormat() { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder() { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + + public static final int RESUME_TOKEN_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Optional. If this request is resuming a previously interrupted query
+   * execution, `resume_token` should be copied from the last
+   * PartialResultSet yielded before the interruption. Doing this
+   * enables the query execution to resume where the last one left
+   * off.
+   * The rest of the request parameters must exactly match the
+   * request that yielded this token. Otherwise the request will fail.
+   * 
+ * + * bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resumeToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + + public static final int PARAMS_FIELD_NUMBER = 7; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.v2.Value.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField params_; + + private com.google.protobuf.MapField + internalGetParams() { + if (params_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); + } + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().getMap().containsKey(key); + } + + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.v2.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetParams().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetParams().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(instanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, query_); + } + if (dataFormatCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.ProtoFormat) dataFormat_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 7); + if (!resumeToken_.isEmpty()) { + output.writeBytes(8, resumeToken_); + } + if (!preparedQuery_.isEmpty()) { + output.writeBytes(9, preparedQuery_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, query_); + } + if (dataFormatCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.ProtoFormat) dataFormat_); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, params__); + } + if (!resumeToken_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(8, resumeToken_); + } + if (!preparedQuery_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(9, preparedQuery_); + } + size += getUnknownFields().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.ExecuteQueryRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.ExecuteQueryRequest other = + (com.google.bigtable.v2.ExecuteQueryRequest) obj; + + if (!getInstanceName().equals(other.getInstanceName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getPreparedQuery().equals(other.getPreparedQuery())) return false; + if (!getResumeToken().equals(other.getResumeToken())) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!getDataFormatCase().equals(other.getDataFormatCase())) return false; + switch (dataFormatCase_) { + case 4: + if (!getProtoFormat().equals(other.getProtoFormat())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PREPARED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getPreparedQuery().hashCode(); + hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getResumeToken().hashCode(); + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + switch (dataFormatCase_) { + case 4: + hash = (37 * hash) + PROTO_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getProtoFormat().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest 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.ExecuteQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest 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.ExecuteQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ExecuteQueryRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.ExecuteQuery
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ExecuteQueryRequest) + com.google.bigtable.v2.ExecuteQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetMutableParams(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ExecuteQueryRequest.class, + com.google.bigtable.v2.ExecuteQueryRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.ExecuteQueryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + if (protoFormatBuilder_ != null) { + protoFormatBuilder_.clear(); + } + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + internalGetMutableParams().clear(); + dataFormatCase_ = 0; + dataFormat_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.ExecuteQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryRequest build() { + com.google.bigtable.v2.ExecuteQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryRequest buildPartial() { + com.google.bigtable.v2.ExecuteQueryRequest result = + new com.google.bigtable.v2.ExecuteQueryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ExecuteQueryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instanceName_ = instanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.preparedQuery_ = preparedQuery_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.resumeToken_ = resumeToken_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.params_ = internalGetParams().build(ParamsDefaultEntryHolder.defaultEntry); + } + } + + private void buildPartialOneofs(com.google.bigtable.v2.ExecuteQueryRequest result) { + result.dataFormatCase_ = dataFormatCase_; + result.dataFormat_ = this.dataFormat_; + if (dataFormatCase_ == 4 && protoFormatBuilder_ != null) { + result.dataFormat_ = protoFormatBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ExecuteQueryRequest) { + return mergeFrom((com.google.bigtable.v2.ExecuteQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ExecuteQueryRequest other) { + if (other == com.google.bigtable.v2.ExecuteQueryRequest.getDefaultInstance()) return this; + if (!other.getInstanceName().isEmpty()) { + instanceName_ = other.instanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getPreparedQuery().isEmpty()) { + setPreparedQuery(other.getPreparedQuery()); + } + if (!other.getResumeToken().isEmpty()) { + setResumeToken(other.getResumeToken()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + bitField0_ |= 0x00000040; + switch (other.getDataFormatCase()) { + case PROTO_FORMAT: + { + mergeProtoFormat(other.getProtoFormat()); + break; + } + case DATAFORMAT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetProtoFormatFieldBuilder().getBuilder(), extensionRegistry); + dataFormatCase_ = 4; + break; + } // case 34 + case 58: + { + com.google.protobuf.MapEntry + params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableParams() + .ensureBuilderMap() + .put(params__.getKey(), params__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + resumeToken_ = input.readBytes(); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 74: + { + preparedQuery_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataFormatCase_ = 0; + private java.lang.Object dataFormat_; + + public DataFormatCase getDataFormatCase() { + return DataFormatCase.forNumber(dataFormatCase_); + } + + public Builder clearDataFormat() { + dataFormatCase_ = 0; + dataFormat_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instanceName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceName() { + instanceName_ = getDefaultInstance().getInstanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * Optional. This value specifies routing for replication. If not specified,
+     * the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. This value specifies routing for replication. If not specified,
+     * the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. This value specifies routing for replication. If not specified,
+     * the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This value specifies routing for replication. If not specified,
+     * the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This value specifies routing for replication. If not specified,
+     * the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + + /** + * + * + *
+     * Required. The query string.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The query. + */ + @java.lang.Deprecated + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The query string.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The bytes for query. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The query string.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @param value The query to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The query string.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The query string.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * A prepared query that was returned from `PrepareQueryResponse`.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     *
+     * Setting this field also places restrictions on several other fields:
+     * - `data_format` must be empty.
+     * - `validate_only` must be false.
+     * - `params` must match the `param_types` set in the `PrepareQueryRequest`.
+     * 
+ * + * bytes prepared_query = 9; + * + * @return The preparedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreparedQuery() { + return preparedQuery_; + } + + /** + * + * + *
+     * A prepared query that was returned from `PrepareQueryResponse`.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     *
+     * Setting this field also places restrictions on several other fields:
+     * - `data_format` must be empty.
+     * - `validate_only` must be false.
+     * - `params` must match the `param_types` set in the `PrepareQueryRequest`.
+     * 
+ * + * bytes prepared_query = 9; + * + * @param value The preparedQuery to set. + * @return This builder for chaining. + */ + public Builder setPreparedQuery(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + preparedQuery_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * A prepared query that was returned from `PrepareQueryResponse`.
+     *
+     * Exactly one of `query` and `prepared_query` is required. Setting both
+     * or neither is an `INVALID_ARGUMENT`.
+     *
+     * Setting this field also places restrictions on several other fields:
+     * - `data_format` must be empty.
+     * - `validate_only` must be false.
+     * - `params` must match the `param_types` set in the `PrepareQueryRequest`.
+     * 
+ * + * bytes prepared_query = 9; + * + * @return This builder for chaining. + */ + public Builder clearPreparedQuery() { + bitField0_ = (bitField0_ & ~0x00000008); + preparedQuery_ = getDefaultInstance().getPreparedQuery(); + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder> + protoFormatBuilder_; + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return Whether the protoFormat field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasProtoFormat() { + return dataFormatCase_ == 4; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return The protoFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.ProtoFormat getProtoFormat() { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } else { + if (dataFormatCase_ == 4) { + return protoFormatBuilder_.getMessage(); + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setProtoFormat(com.google.bigtable.v2.ProtoFormat value) { + if (protoFormatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataFormat_ = value; + onChanged(); + } else { + protoFormatBuilder_.setMessage(value); + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setProtoFormat(com.google.bigtable.v2.ProtoFormat.Builder builderForValue) { + if (protoFormatBuilder_ == null) { + dataFormat_ = builderForValue.build(); + onChanged(); + } else { + protoFormatBuilder_.setMessage(builderForValue.build()); + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeProtoFormat(com.google.bigtable.v2.ProtoFormat value) { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4 + && dataFormat_ != com.google.bigtable.v2.ProtoFormat.getDefaultInstance()) { + dataFormat_ = + com.google.bigtable.v2.ProtoFormat.newBuilder( + (com.google.bigtable.v2.ProtoFormat) dataFormat_) + .mergeFrom(value) + .buildPartial(); + } else { + dataFormat_ = value; + } + onChanged(); + } else { + if (dataFormatCase_ == 4) { + protoFormatBuilder_.mergeFrom(value); + } else { + protoFormatBuilder_.setMessage(value); + } + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearProtoFormat() { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4) { + dataFormatCase_ = 0; + dataFormat_ = null; + onChanged(); + } + } else { + if (dataFormatCase_ == 4) { + dataFormatCase_ = 0; + dataFormat_ = null; + } + protoFormatBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.bigtable.v2.ProtoFormat.Builder getProtoFormatBuilder() { + return internalGetProtoFormatFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder() { + if ((dataFormatCase_ == 4) && (protoFormatBuilder_ != null)) { + return protoFormatBuilder_.getMessageOrBuilder(); + } else { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder> + internalGetProtoFormatFieldBuilder() { + if (protoFormatBuilder_ == null) { + if (!(dataFormatCase_ == 4)) { + dataFormat_ = com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + protoFormatBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder>( + (com.google.bigtable.v2.ProtoFormat) dataFormat_, + getParentForChildren(), + isClean()); + dataFormat_ = null; + } + dataFormatCase_ = 4; + onChanged(); + return protoFormatBuilder_; + } + + private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Optional. If this request is resuming a previously interrupted query
+     * execution, `resume_token` should be copied from the last
+     * PartialResultSet yielded before the interruption. Doing this
+     * enables the query execution to resume where the last one left
+     * off.
+     * The rest of the request parameters must exactly match the
+     * request that yielded this token. Otherwise the request will fail.
+     * 
+ * + * bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resumeToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + + /** + * + * + *
+     * Optional. If this request is resuming a previously interrupted query
+     * execution, `resume_token` should be copied from the last
+     * PartialResultSet yielded before the interruption. Doing this
+     * enables the query execution to resume where the last one left
+     * off.
+     * The rest of the request parameters must exactly match the
+     * request that yielded this token. Otherwise the request will fail.
+     * 
+ * + * bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The resumeToken to set. + * @return This builder for chaining. + */ + public Builder setResumeToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + resumeToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If this request is resuming a previously interrupted query
+     * execution, `resume_token` should be copied from the last
+     * PartialResultSet yielded before the interruption. Doing this
+     * enables the query execution to resume where the last one left
+     * off.
+     * The rest of the request parameters must exactly match the
+     * request that yielded this token. Otherwise the request will fail.
+     * 
+ * + * bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearResumeToken() { + bitField0_ = (bitField0_ & ~0x00000020); + resumeToken_ = getDefaultInstance().getResumeToken(); + onChanged(); + return this; + } + + private static final class ParamsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, com.google.bigtable.v2.ValueOrBuilder, com.google.bigtable.v2.Value> { + @java.lang.Override + public com.google.bigtable.v2.Value build(com.google.bigtable.v2.ValueOrBuilder val) { + if (val instanceof com.google.bigtable.v2.Value) { + return (com.google.bigtable.v2.Value) val; + } + return ((com.google.bigtable.v2.Value.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry + defaultEntry() { + return ParamsDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final ParamsConverter paramsConverter = new ParamsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.ValueOrBuilder, + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder> + params_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.ValueOrBuilder, + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder> + internalGetParams() { + if (params_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(paramsConverter); + } + return params_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.ValueOrBuilder, + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder> + internalGetMutableParams() { + if (params_ == null) { + params_ = new com.google.protobuf.MapFieldBuilder<>(paramsConverter); + } + bitField0_ |= 0x00000040; + onChanged(); + return params_; + } + + public int getParamsCount() { + return internalGetParams().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParams().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParams() { + return getParamsMap(); + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getImmutableMap(); + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.v2.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Value defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableParams().ensureBuilderMap(); + return map.containsKey(key) ? paramsConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Value getParamsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableParams().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return paramsConverter.build(map.get(key)); + } + + public Builder clearParams() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableParams().clear(); + return this; + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeParams(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableParams().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParams() { + bitField0_ |= 0x00000040; + return internalGetMutableParams().ensureMessageMap(); + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putParams(java.lang.String key, com.google.bigtable.v2.Value value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableParams().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllParams( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableParams().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + /** + * + * + *
+     * Required. params contains string type keys and Bigtable type values that
+     * bind to placeholders in the query string. In query string, a parameter
+     * placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if
+     * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+     * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+     * query string during query evaluation.
+     *
+     * If `Value.kind` is not set, the value is treated as a NULL value of the
+     * given type. For example, if
+     * `params["firstName"] = type {string_type {}}`
+     * then `@firstName` will be replaced with googlesql null string.
+     *
+     * If `query` is set, any empty `Value.type` in the map will be rejected with
+     * `INVALID_ARGUMENT`.
+     *
+     * If `prepared_query` is set, any empty `Value.type` in the map will be
+     * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+     * `Value.type` must match the corresponding `param_types` entry, or be
+     * rejected with `INVALID_ARGUMENT`.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Value.Builder putParamsBuilderIfAbsent(java.lang.String key) { + java.util.Map builderMap = + internalGetMutableParams().ensureBuilderMap(); + com.google.bigtable.v2.ValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.v2.Value.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.v2.Value) { + entry = ((com.google.bigtable.v2.Value) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.v2.Value.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ExecuteQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ExecuteQueryRequest) + private static final com.google.bigtable.v2.ExecuteQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ExecuteQueryRequest(); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecuteQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ExecuteQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java new file mode 100644 index 000000000000..262acc8a149a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java @@ -0,0 +1,400 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ExecuteQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ExecuteQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + java.lang.String getInstanceName(); + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + com.google.protobuf.ByteString getInstanceNameBytes(); + + /** + * + * + *
+   * Optional. This value specifies routing for replication. If not specified,
+   * the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * Optional. This value specifies routing for replication. If not specified,
+   * the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The query string.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The query. + */ + @java.lang.Deprecated + java.lang.String getQuery(); + + /** + * + * + *
+   * Required. The query string.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   * 
+ * + * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1132 + * @return The bytes for query. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * A prepared query that was returned from `PrepareQueryResponse`.
+   *
+   * Exactly one of `query` and `prepared_query` is required. Setting both
+   * or neither is an `INVALID_ARGUMENT`.
+   *
+   * Setting this field also places restrictions on several other fields:
+   * - `data_format` must be empty.
+   * - `validate_only` must be false.
+   * - `params` must match the `param_types` set in the `PrepareQueryRequest`.
+   * 
+ * + * bytes prepared_query = 9; + * + * @return The preparedQuery. + */ + com.google.protobuf.ByteString getPreparedQuery(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return Whether the protoFormat field is set. + */ + @java.lang.Deprecated + boolean hasProtoFormat(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See + * google/bigtable/v2/bigtable.proto;l=1153 + * @return The protoFormat. + */ + @java.lang.Deprecated + com.google.bigtable.v2.ProtoFormat getProtoFormat(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder(); + + /** + * + * + *
+   * Optional. If this request is resuming a previously interrupted query
+   * execution, `resume_token` should be copied from the last
+   * PartialResultSet yielded before the interruption. Doing this
+   * enables the query execution to resume where the last one left
+   * off.
+   * The rest of the request parameters must exactly match the
+   * request that yielded this token. Otherwise the request will fail.
+   * 
+ * + * bytes resume_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The resumeToken. + */ + com.google.protobuf.ByteString getResumeToken(); + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getParamsCount(); + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsParams(java.lang.String key); + + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map getParamsMap(); + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.bigtable.v2.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Value defaultValue); + + /** + * + * + *
+   * Required. params contains string type keys and Bigtable type values that
+   * bind to placeholders in the query string. In query string, a parameter
+   * placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if
+   * `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
+   * then `@firstName` will be replaced with googlesql bytes value "foo" in the
+   * query string during query evaluation.
+   *
+   * If `Value.kind` is not set, the value is treated as a NULL value of the
+   * given type. For example, if
+   * `params["firstName"] = type {string_type {}}`
+   * then `@firstName` will be replaced with googlesql null string.
+   *
+   * If `query` is set, any empty `Value.type` in the map will be rejected with
+   * `INVALID_ARGUMENT`.
+   *
+   * If `prepared_query` is set, any empty `Value.type` in the map will be
+   * inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
+   * `Value.type` must match the corresponding `param_types` entry, or be
+   * rejected with `INVALID_ARGUMENT`.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Value> params = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.Value getParamsOrThrow(java.lang.String key); + + com.google.bigtable.v2.ExecuteQueryRequest.DataFormatCase getDataFormatCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java new file mode 100644 index 000000000000..a022efc48fee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java @@ -0,0 +1,1135 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.ExecuteQuery
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryResponse} + */ +@com.google.protobuf.Generated +public final class ExecuteQueryResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ExecuteQueryResponse) + ExecuteQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExecuteQueryResponse"); + } + + // Use ExecuteQueryResponse.newBuilder() to construct. + private ExecuteQueryResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExecuteQueryResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ExecuteQueryResponse.class, + com.google.bigtable.v2.ExecuteQueryResponse.Builder.class); + } + + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + METADATA(1), + RESULTS(2), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: + return METADATA; + case 2: + return RESULTS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int METADATA_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return responseCase_ == 1; + } + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata getMetadata() { + if (responseCase_ == 1) { + return (com.google.bigtable.v2.ResultSetMetadata) response_; + } + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder() { + if (responseCase_ == 1) { + return (com.google.bigtable.v2.ResultSetMetadata) response_; + } + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return Whether the results field is set. + */ + @java.lang.Override + public boolean hasResults() { + return responseCase_ == 2; + } + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return The results. + */ + @java.lang.Override + public com.google.bigtable.v2.PartialResultSet getResults() { + if (responseCase_ == 2) { + return (com.google.bigtable.v2.PartialResultSet) response_; + } + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.PartialResultSetOrBuilder getResultsOrBuilder() { + if (responseCase_ == 2) { + return (com.google.bigtable.v2.PartialResultSet) response_; + } + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + + 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 (responseCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.ResultSetMetadata) response_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.PartialResultSet) response_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.ResultSetMetadata) response_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.PartialResultSet) response_); + } + size += getUnknownFields().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.ExecuteQueryResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ExecuteQueryResponse other = + (com.google.bigtable.v2.ExecuteQueryResponse) obj; + + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getMetadata().equals(other.getMetadata())) return false; + break; + case 2: + if (!getResults().equals(other.getResults())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (responseCase_) { + case 1: + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + break; + case 2: + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResults().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse 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.ExecuteQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse 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.ExecuteQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ExecuteQueryResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.ExecuteQuery
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ExecuteQueryResponse) + com.google.bigtable.v2.ExecuteQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ExecuteQueryResponse.class, + com.google.bigtable.v2.ExecuteQueryResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ExecuteQueryResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (metadataBuilder_ != null) { + metadataBuilder_.clear(); + } + if (resultsBuilder_ != null) { + resultsBuilder_.clear(); + } + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ExecuteQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryResponse build() { + com.google.bigtable.v2.ExecuteQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ExecuteQueryResponse buildPartial() { + com.google.bigtable.v2.ExecuteQueryResponse result = + new com.google.bigtable.v2.ExecuteQueryResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ExecuteQueryResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ExecuteQueryResponse result) { + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 1 && metadataBuilder_ != null) { + result.response_ = metadataBuilder_.build(); + } + if (responseCase_ == 2 && resultsBuilder_ != null) { + result.response_ = resultsBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ExecuteQueryResponse) { + return mergeFrom((com.google.bigtable.v2.ExecuteQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ExecuteQueryResponse other) { + if (other == com.google.bigtable.v2.ExecuteQueryResponse.getDefaultInstance()) return this; + switch (other.getResponseCase()) { + case METADATA: + { + mergeMetadata(other.getMetadata()); + break; + } + case RESULTS: + { + mergeResults(other.getResults()); + break; + } + case RESPONSE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetResultsFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return responseCase_ == 1; + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata getMetadata() { + if (metadataBuilder_ == null) { + if (responseCase_ == 1) { + return (com.google.bigtable.v2.ResultSetMetadata) response_; + } + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } else { + if (responseCase_ == 1) { + return metadataBuilder_.getMessage(); + } + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder setMetadata(com.google.bigtable.v2.ResultSetMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + responseCase_ = 1; + return this; + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder setMetadata(com.google.bigtable.v2.ResultSetMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 1; + return this; + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder mergeMetadata(com.google.bigtable.v2.ResultSetMetadata value) { + if (metadataBuilder_ == null) { + if (responseCase_ == 1 + && response_ != com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance()) { + response_ = + com.google.bigtable.v2.ResultSetMetadata.newBuilder( + (com.google.bigtable.v2.ResultSetMetadata) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 1) { + metadataBuilder_.mergeFrom(value); + } else { + metadataBuilder_.setMessage(value); + } + } + responseCase_ = 1; + return this; + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + } + metadataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public com.google.bigtable.v2.ResultSetMetadata.Builder getMetadataBuilder() { + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder() { + if ((responseCase_ == 1) && (metadataBuilder_ != null)) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 1) { + return (com.google.bigtable.v2.ResultSetMetadata) response_; + } + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Structure of rows in this response stream. The first (and only the first)
+     * response streamed from the server will be of this type.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + if (!(responseCase_ == 1)) { + response_ = com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder>( + (com.google.bigtable.v2.ResultSetMetadata) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 1; + onChanged(); + return metadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.PartialResultSet, + com.google.bigtable.v2.PartialResultSet.Builder, + com.google.bigtable.v2.PartialResultSetOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return Whether the results field is set. + */ + @java.lang.Override + public boolean hasResults() { + return responseCase_ == 2; + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return The results. + */ + @java.lang.Override + public com.google.bigtable.v2.PartialResultSet getResults() { + if (resultsBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.bigtable.v2.PartialResultSet) response_; + } + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return resultsBuilder_.getMessage(); + } + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + public Builder setResults(com.google.bigtable.v2.PartialResultSet value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + resultsBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + public Builder setResults(com.google.bigtable.v2.PartialResultSet.Builder builderForValue) { + if (resultsBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + resultsBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + public Builder mergeResults(com.google.bigtable.v2.PartialResultSet value) { + if (resultsBuilder_ == null) { + if (responseCase_ == 2 + && response_ != com.google.bigtable.v2.PartialResultSet.getDefaultInstance()) { + response_ = + com.google.bigtable.v2.PartialResultSet.newBuilder( + (com.google.bigtable.v2.PartialResultSet) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + resultsBuilder_.mergeFrom(value); + } else { + resultsBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + resultsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + public com.google.bigtable.v2.PartialResultSet.Builder getResultsBuilder() { + return internalGetResultsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.PartialResultSetOrBuilder getResultsOrBuilder() { + if ((responseCase_ == 2) && (resultsBuilder_ != null)) { + return resultsBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.bigtable.v2.PartialResultSet) response_; + } + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A partial result set with row data potentially including additional
+     * instructions on how recent past and future partial responses should be
+     * interpreted.
+     * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.PartialResultSet, + com.google.bigtable.v2.PartialResultSet.Builder, + com.google.bigtable.v2.PartialResultSetOrBuilder> + internalGetResultsFieldBuilder() { + if (resultsBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + resultsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.PartialResultSet, + com.google.bigtable.v2.PartialResultSet.Builder, + com.google.bigtable.v2.PartialResultSetOrBuilder>( + (com.google.bigtable.v2.PartialResultSet) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return resultsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ExecuteQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ExecuteQueryResponse) + private static final com.google.bigtable.v2.ExecuteQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ExecuteQueryResponse(); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecuteQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ExecuteQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.java new file mode 100644 index 000000000000..0ef540b872bc --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ExecuteQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ExecuteQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + com.google.bigtable.v2.ResultSetMetadata getMetadata(); + + /** + * + * + *
+   * Structure of rows in this response stream. The first (and only the first)
+   * response streamed from the server will be of this type.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return Whether the results field is set. + */ + boolean hasResults(); + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + * + * @return The results. + */ + com.google.bigtable.v2.PartialResultSet getResults(); + + /** + * + * + *
+   * A partial result set with row data potentially including additional
+   * instructions on how recent past and future partial responses should be
+   * interpreted.
+   * 
+ * + * .google.bigtable.v2.PartialResultSet results = 2; + */ + com.google.bigtable.v2.PartialResultSetOrBuilder getResultsOrBuilder(); + + com.google.bigtable.v2.ExecuteQueryResponse.ResponseCase getResponseCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java new file mode 100644 index 000000000000..4dff09c262fe --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java @@ -0,0 +1,1134 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies (some of) the contents of a single row/column family intersection
+ * of a table.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Family} + */ +@com.google.protobuf.Generated +public final class Family extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Family) + FamilyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Family"); + } + + // Use Family.newBuilder() to construct. + private Family(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Family() { + name_ = ""; + columns_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Family_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Family_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Family.class, com.google.bigtable.v2.Family.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The unique key which identifies this family within its row. This is the
+   * same key that's used to identify the family in, for example, a RowFilter
+   * which sets its "family_name_regex_filter" field.
+   * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+   * produce cells in a sentinel family with an empty name.
+   * Must be no greater than 64 characters in length.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The unique key which identifies this family within its row. This is the
+   * same key that's used to identify the family in, for example, a RowFilter
+   * which sets its "family_name_regex_filter" field.
+   * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+   * produce cells in a sentinel family with an empty name.
+   * Must be no greater than 64 characters in length.
+   * 
+ * + * string name = 1; + * + * @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 COLUMNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Column getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < columns_.size(); i++) { + output.writeMessage(2, columns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, columns_.get(i)); + } + size += getUnknownFields().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.Family)) { + return super.equals(obj); + } + com.google.bigtable.v2.Family other = (com.google.bigtable.v2.Family) obj; + + if (!getName().equals(other.getName())) return false; + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Family parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Family 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.Family parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Family 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.Family parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Family parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Family parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Family parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Family parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Family parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Family parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Family parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Family 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies (some of) the contents of a single row/column family intersection
+   * of a table.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Family} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Family) + com.google.bigtable.v2.FamilyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Family_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Family_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Family.class, com.google.bigtable.v2.Family.Builder.class); + } + + // Construct using com.google.bigtable.v2.Family.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Family_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Family getDefaultInstanceForType() { + return com.google.bigtable.v2.Family.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Family build() { + com.google.bigtable.v2.Family result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Family buildPartial() { + com.google.bigtable.v2.Family result = new com.google.bigtable.v2.Family(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Family result) { + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.Family result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Family) { + return mergeFrom((com.google.bigtable.v2.Family) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Family other) { + if (other == com.google.bigtable.v2.Family.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000002); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Column m = + input.readMessage(com.google.bigtable.v2.Column.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The unique key which identifies this family within its row. This is the
+     * same key that's used to identify the family in, for example, a RowFilter
+     * which sets its "family_name_regex_filter" field.
+     * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+     * produce cells in a sentinel family with an empty name.
+     * Must be no greater than 64 characters in length.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique key which identifies this family within its row. This is the
+     * same key that's used to identify the family in, for example, a RowFilter
+     * which sets its "family_name_regex_filter" field.
+     * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+     * produce cells in a sentinel family with an empty name.
+     * Must be no greater than 64 characters in length.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+     * The unique key which identifies this family within its row. This is the
+     * same key that's used to identify the family in, for example, a RowFilter
+     * which sets its "family_name_regex_filter" field.
+     * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+     * produce cells in a sentinel family with an empty name.
+     * Must be no greater than 64 characters in length.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique key which identifies this family within its row. This is the
+     * same key that's used to identify the family in, for example, a RowFilter
+     * which sets its "family_name_regex_filter" field.
+     * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+     * produce cells in a sentinel family with an empty name.
+     * Must be no greater than 64 characters in length.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique key which identifies this family within its row. This is the
+     * same key that's used to identify the family in, for example, a RowFilter
+     * which sets its "family_name_regex_filter" field.
+     * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+     * produce cells in a sentinel family with an empty name.
+     * Must be no greater than 64 characters in length.
+     * 
+ * + * string name = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Column, + com.google.bigtable.v2.Column.Builder, + com.google.bigtable.v2.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public com.google.bigtable.v2.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder setColumns(int index, com.google.bigtable.v2.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder setColumns(int index, com.google.bigtable.v2.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder addColumns(com.google.bigtable.v2.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder addColumns(int index, com.google.bigtable.v2.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder addColumns(com.google.bigtable.v2.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder addColumns(int index, com.google.bigtable.v2.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public com.google.bigtable.v2.Column.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public com.google.bigtable.v2.Column.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public com.google.bigtable.v2.Column.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * Must not be empty. Sorted in order of increasing "qualifier".
+     * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + public java.util.List getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Column, + com.google.bigtable.v2.Column.Builder, + com.google.bigtable.v2.ColumnOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Column, + com.google.bigtable.v2.Column.Builder, + com.google.bigtable.v2.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Family) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Family) + private static final com.google.bigtable.v2.Family DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Family(); + } + + public static com.google.bigtable.v2.Family getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Family parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Family getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java new file mode 100644 index 000000000000..866950768214 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface FamilyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Family) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique key which identifies this family within its row. This is the
+   * same key that's used to identify the family in, for example, a RowFilter
+   * which sets its "family_name_regex_filter" field.
+   * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+   * produce cells in a sentinel family with an empty name.
+   * Must be no greater than 64 characters in length.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The unique key which identifies this family within its row. This is the
+   * same key that's used to identify the family in, for example, a RowFilter
+   * which sets its "family_name_regex_filter" field.
+   * Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may
+   * produce cells in a sentinel family with an empty name.
+   * Must be no greater than 64 characters in length.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + com.google.bigtable.v2.Column getColumns(int index); + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + int getColumnsCount(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + java.util.List getColumnsOrBuilderList(); + + /** + * + * + *
+   * Must not be empty. Sorted in order of increasing "qualifier".
+   * 
+ * + * repeated .google.bigtable.v2.Column columns = 2; + */ + com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java new file mode 100644 index 000000000000..0f3f05cae226 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java @@ -0,0 +1,1612 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/feature_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Feature flags supported or enabled by a client.
+ * This is intended to be sent as part of request metadata to assure the server
+ * that certain behaviors are safe to enable. This proto is meant to be
+ * serialized and websafe-base64 encoded under the `bigtable-features` metadata
+ * key. The value will remain constant for the lifetime of a client and due to
+ * HTTP2's HPACK compression, the request overhead will be tiny.
+ * This is an internal implementation detail and should not be used by end users
+ * directly.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.FeatureFlags} + */ +@com.google.protobuf.Generated +public final class FeatureFlags extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.FeatureFlags) + FeatureFlagsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FeatureFlags"); + } + + // Use FeatureFlags.newBuilder() to construct. + private FeatureFlags(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FeatureFlags() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.FeatureFlagsProto + .internal_static_google_bigtable_v2_FeatureFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.FeatureFlagsProto + .internal_static_google_bigtable_v2_FeatureFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.FeatureFlags.class, + com.google.bigtable.v2.FeatureFlags.Builder.class); + } + + public static final int REVERSE_SCANS_FIELD_NUMBER = 1; + private boolean reverseScans_ = false; + + /** + * + * + *
+   * Notify the server that the client supports reverse scans. The server will
+   * reject ReadRowsRequests with the reverse bit set when this is absent.
+   * 
+ * + * bool reverse_scans = 1; + * + * @return The reverseScans. + */ + @java.lang.Override + public boolean getReverseScans() { + return reverseScans_; + } + + public static final int MUTATE_ROWS_RATE_LIMIT_FIELD_NUMBER = 3; + private boolean mutateRowsRateLimit_ = false; + + /** + * + * + *
+   * Notify the server that the client enables batch write flow control by
+   * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
+   * this disables partial retries.
+   * 
+ * + * bool mutate_rows_rate_limit = 3; + * + * @return The mutateRowsRateLimit. + */ + @java.lang.Override + public boolean getMutateRowsRateLimit() { + return mutateRowsRateLimit_; + } + + public static final int MUTATE_ROWS_RATE_LIMIT2_FIELD_NUMBER = 5; + private boolean mutateRowsRateLimit2_ = false; + + /** + * + * + *
+   * Notify the server that the client enables batch write flow control by
+   * requesting RateLimitInfo from MutateRowsResponse. With partial retries
+   * enabled.
+   * 
+ * + * bool mutate_rows_rate_limit2 = 5; + * + * @return The mutateRowsRateLimit2. + */ + @java.lang.Override + public boolean getMutateRowsRateLimit2() { + return mutateRowsRateLimit2_; + } + + public static final int LAST_SCANNED_ROW_RESPONSES_FIELD_NUMBER = 4; + private boolean lastScannedRowResponses_ = false; + + /** + * + * + *
+   * Notify the server that the client supports the last_scanned_row field
+   * in ReadRowsResponse for long-running scans.
+   * 
+ * + * bool last_scanned_row_responses = 4; + * + * @return The lastScannedRowResponses. + */ + @java.lang.Override + public boolean getLastScannedRowResponses() { + return lastScannedRowResponses_; + } + + public static final int ROUTING_COOKIE_FIELD_NUMBER = 6; + private boolean routingCookie_ = false; + + /** + * + * + *
+   * Notify the server that the client supports using encoded routing cookie
+   * strings to retry requests with.
+   * 
+ * + * bool routing_cookie = 6; + * + * @return The routingCookie. + */ + @java.lang.Override + public boolean getRoutingCookie() { + return routingCookie_; + } + + public static final int RETRY_INFO_FIELD_NUMBER = 7; + private boolean retryInfo_ = false; + + /** + * + * + *
+   * Notify the server that the client supports using retry info back off
+   * durations to retry requests with.
+   * 
+ * + * bool retry_info = 7; + * + * @return The retryInfo. + */ + @java.lang.Override + public boolean getRetryInfo() { + return retryInfo_; + } + + public static final int CLIENT_SIDE_METRICS_ENABLED_FIELD_NUMBER = 8; + private boolean clientSideMetricsEnabled_ = false; + + /** + * + * + *
+   * Notify the server that the client has client side metrics enabled.
+   * 
+ * + * bool client_side_metrics_enabled = 8; + * + * @return The clientSideMetricsEnabled. + */ + @java.lang.Override + public boolean getClientSideMetricsEnabled() { + return clientSideMetricsEnabled_; + } + + public static final int TRAFFIC_DIRECTOR_ENABLED_FIELD_NUMBER = 9; + private boolean trafficDirectorEnabled_ = false; + + /** + * + * + *
+   * Notify the server that the client using Traffic Director endpoint.
+   * 
+ * + * bool traffic_director_enabled = 9; + * + * @return The trafficDirectorEnabled. + */ + @java.lang.Override + public boolean getTrafficDirectorEnabled() { + return trafficDirectorEnabled_; + } + + public static final int DIRECT_ACCESS_REQUESTED_FIELD_NUMBER = 10; + private boolean directAccessRequested_ = false; + + /** + * + * + *
+   * Notify the server that the client explicitly opted in for Direct Access.
+   * 
+ * + * bool direct_access_requested = 10; + * + * @return The directAccessRequested. + */ + @java.lang.Override + public boolean getDirectAccessRequested() { + return directAccessRequested_; + } + + public static final int PEER_INFO_FIELD_NUMBER = 11; + private boolean peerInfo_ = false; + + /** + * + * + *
+   * If the client can support using BigtablePeerInfo.
+   * 
+ * + * bool peer_info = 11; + * + * @return The peerInfo. + */ + @java.lang.Override + public boolean getPeerInfo() { + return peerInfo_; + } + + public static final int SESSIONS_COMPATIBLE_FIELD_NUMBER = 12; + private boolean sessionsCompatible_ = false; + + /** + * + * + *
+   * Indicates whether the client supports the Bigtable Sessions API.
+   * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + @java.lang.Override + public boolean getSessionsCompatible() { + return sessionsCompatible_; + } + + public static final int SESSIONS_REQUIRED_FIELD_NUMBER = 13; + private boolean sessionsRequired_ = false; + + /** + * + * + *
+   * Internal flag to force sessions for internal projects.
+   * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + @java.lang.Override + public boolean getSessionsRequired() { + return sessionsRequired_; + } + + 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 (reverseScans_ != false) { + output.writeBool(1, reverseScans_); + } + if (mutateRowsRateLimit_ != false) { + output.writeBool(3, mutateRowsRateLimit_); + } + if (lastScannedRowResponses_ != false) { + output.writeBool(4, lastScannedRowResponses_); + } + if (mutateRowsRateLimit2_ != false) { + output.writeBool(5, mutateRowsRateLimit2_); + } + if (routingCookie_ != false) { + output.writeBool(6, routingCookie_); + } + if (retryInfo_ != false) { + output.writeBool(7, retryInfo_); + } + if (clientSideMetricsEnabled_ != false) { + output.writeBool(8, clientSideMetricsEnabled_); + } + if (trafficDirectorEnabled_ != false) { + output.writeBool(9, trafficDirectorEnabled_); + } + if (directAccessRequested_ != false) { + output.writeBool(10, directAccessRequested_); + } + if (peerInfo_ != false) { + output.writeBool(11, peerInfo_); + } + if (sessionsCompatible_ != false) { + output.writeBool(12, sessionsCompatible_); + } + if (sessionsRequired_ != false) { + output.writeBool(13, sessionsRequired_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reverseScans_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, reverseScans_); + } + if (mutateRowsRateLimit_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, mutateRowsRateLimit_); + } + if (lastScannedRowResponses_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, lastScannedRowResponses_); + } + if (mutateRowsRateLimit2_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, mutateRowsRateLimit2_); + } + if (routingCookie_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, routingCookie_); + } + if (retryInfo_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, retryInfo_); + } + if (clientSideMetricsEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, clientSideMetricsEnabled_); + } + if (trafficDirectorEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, trafficDirectorEnabled_); + } + if (directAccessRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, directAccessRequested_); + } + if (peerInfo_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, peerInfo_); + } + if (sessionsCompatible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, sessionsCompatible_); + } + if (sessionsRequired_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, sessionsRequired_); + } + size += getUnknownFields().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.FeatureFlags)) { + return super.equals(obj); + } + com.google.bigtable.v2.FeatureFlags other = (com.google.bigtable.v2.FeatureFlags) obj; + + if (getReverseScans() != other.getReverseScans()) return false; + if (getMutateRowsRateLimit() != other.getMutateRowsRateLimit()) return false; + if (getMutateRowsRateLimit2() != other.getMutateRowsRateLimit2()) return false; + if (getLastScannedRowResponses() != other.getLastScannedRowResponses()) return false; + if (getRoutingCookie() != other.getRoutingCookie()) return false; + if (getRetryInfo() != other.getRetryInfo()) return false; + if (getClientSideMetricsEnabled() != other.getClientSideMetricsEnabled()) return false; + if (getTrafficDirectorEnabled() != other.getTrafficDirectorEnabled()) return false; + if (getDirectAccessRequested() != other.getDirectAccessRequested()) return false; + if (getPeerInfo() != other.getPeerInfo()) return false; + if (getSessionsCompatible() != other.getSessionsCompatible()) return false; + if (getSessionsRequired() != other.getSessionsRequired()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REVERSE_SCANS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReverseScans()); + hash = (37 * hash) + MUTATE_ROWS_RATE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMutateRowsRateLimit()); + hash = (37 * hash) + MUTATE_ROWS_RATE_LIMIT2_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMutateRowsRateLimit2()); + hash = (37 * hash) + LAST_SCANNED_ROW_RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLastScannedRowResponses()); + hash = (37 * hash) + ROUTING_COOKIE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRoutingCookie()); + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRetryInfo()); + hash = (37 * hash) + CLIENT_SIDE_METRICS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClientSideMetricsEnabled()); + hash = (37 * hash) + TRAFFIC_DIRECTOR_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTrafficDirectorEnabled()); + hash = (37 * hash) + DIRECT_ACCESS_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectAccessRequested()); + hash = (37 * hash) + PEER_INFO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPeerInfo()); + hash = (37 * hash) + SESSIONS_COMPATIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSessionsCompatible()); + hash = (37 * hash) + SESSIONS_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSessionsRequired()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FeatureFlags 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.FeatureFlags parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FeatureFlags 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.FeatureFlags parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FeatureFlags parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FeatureFlags parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FeatureFlags parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.FeatureFlags 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Feature flags supported or enabled by a client.
+   * This is intended to be sent as part of request metadata to assure the server
+   * that certain behaviors are safe to enable. This proto is meant to be
+   * serialized and websafe-base64 encoded under the `bigtable-features` metadata
+   * key. The value will remain constant for the lifetime of a client and due to
+   * HTTP2's HPACK compression, the request overhead will be tiny.
+   * This is an internal implementation detail and should not be used by end users
+   * directly.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.FeatureFlags} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.FeatureFlags) + com.google.bigtable.v2.FeatureFlagsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.FeatureFlagsProto + .internal_static_google_bigtable_v2_FeatureFlags_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.FeatureFlagsProto + .internal_static_google_bigtable_v2_FeatureFlags_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.FeatureFlags.class, + com.google.bigtable.v2.FeatureFlags.Builder.class); + } + + // Construct using com.google.bigtable.v2.FeatureFlags.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reverseScans_ = false; + mutateRowsRateLimit_ = false; + mutateRowsRateLimit2_ = false; + lastScannedRowResponses_ = false; + routingCookie_ = false; + retryInfo_ = false; + clientSideMetricsEnabled_ = false; + trafficDirectorEnabled_ = false; + directAccessRequested_ = false; + peerInfo_ = false; + sessionsCompatible_ = false; + sessionsRequired_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.FeatureFlagsProto + .internal_static_google_bigtable_v2_FeatureFlags_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.FeatureFlags getDefaultInstanceForType() { + return com.google.bigtable.v2.FeatureFlags.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.FeatureFlags build() { + com.google.bigtable.v2.FeatureFlags result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.FeatureFlags buildPartial() { + com.google.bigtable.v2.FeatureFlags result = new com.google.bigtable.v2.FeatureFlags(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.FeatureFlags result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reverseScans_ = reverseScans_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mutateRowsRateLimit_ = mutateRowsRateLimit_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mutateRowsRateLimit2_ = mutateRowsRateLimit2_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.lastScannedRowResponses_ = lastScannedRowResponses_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.routingCookie_ = routingCookie_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.retryInfo_ = retryInfo_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.clientSideMetricsEnabled_ = clientSideMetricsEnabled_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.trafficDirectorEnabled_ = trafficDirectorEnabled_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.directAccessRequested_ = directAccessRequested_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.peerInfo_ = peerInfo_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sessionsCompatible_ = sessionsCompatible_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.sessionsRequired_ = sessionsRequired_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.FeatureFlags) { + return mergeFrom((com.google.bigtable.v2.FeatureFlags) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.FeatureFlags other) { + if (other == com.google.bigtable.v2.FeatureFlags.getDefaultInstance()) return this; + if (other.getReverseScans() != false) { + setReverseScans(other.getReverseScans()); + } + if (other.getMutateRowsRateLimit() != false) { + setMutateRowsRateLimit(other.getMutateRowsRateLimit()); + } + if (other.getMutateRowsRateLimit2() != false) { + setMutateRowsRateLimit2(other.getMutateRowsRateLimit2()); + } + if (other.getLastScannedRowResponses() != false) { + setLastScannedRowResponses(other.getLastScannedRowResponses()); + } + if (other.getRoutingCookie() != false) { + setRoutingCookie(other.getRoutingCookie()); + } + if (other.getRetryInfo() != false) { + setRetryInfo(other.getRetryInfo()); + } + if (other.getClientSideMetricsEnabled() != false) { + setClientSideMetricsEnabled(other.getClientSideMetricsEnabled()); + } + if (other.getTrafficDirectorEnabled() != false) { + setTrafficDirectorEnabled(other.getTrafficDirectorEnabled()); + } + if (other.getDirectAccessRequested() != false) { + setDirectAccessRequested(other.getDirectAccessRequested()); + } + if (other.getPeerInfo() != false) { + setPeerInfo(other.getPeerInfo()); + } + if (other.getSessionsCompatible() != false) { + setSessionsCompatible(other.getSessionsCompatible()); + } + if (other.getSessionsRequired() != false) { + setSessionsRequired(other.getSessionsRequired()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + reverseScans_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 24: + { + mutateRowsRateLimit_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + lastScannedRowResponses_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + mutateRowsRateLimit2_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 40 + case 48: + { + routingCookie_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 56: + { + retryInfo_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: + { + clientSideMetricsEnabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: + { + trafficDirectorEnabled_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 80: + { + directAccessRequested_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 88: + { + peerInfo_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 88 + case 96: + { + sessionsCompatible_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 96 + case 104: + { + sessionsRequired_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 104 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean reverseScans_; + + /** + * + * + *
+     * Notify the server that the client supports reverse scans. The server will
+     * reject ReadRowsRequests with the reverse bit set when this is absent.
+     * 
+ * + * bool reverse_scans = 1; + * + * @return The reverseScans. + */ + @java.lang.Override + public boolean getReverseScans() { + return reverseScans_; + } + + /** + * + * + *
+     * Notify the server that the client supports reverse scans. The server will
+     * reject ReadRowsRequests with the reverse bit set when this is absent.
+     * 
+ * + * bool reverse_scans = 1; + * + * @param value The reverseScans to set. + * @return This builder for chaining. + */ + public Builder setReverseScans(boolean value) { + + reverseScans_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client supports reverse scans. The server will
+     * reject ReadRowsRequests with the reverse bit set when this is absent.
+     * 
+ * + * bool reverse_scans = 1; + * + * @return This builder for chaining. + */ + public Builder clearReverseScans() { + bitField0_ = (bitField0_ & ~0x00000001); + reverseScans_ = false; + onChanged(); + return this; + } + + private boolean mutateRowsRateLimit_; + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
+     * this disables partial retries.
+     * 
+ * + * bool mutate_rows_rate_limit = 3; + * + * @return The mutateRowsRateLimit. + */ + @java.lang.Override + public boolean getMutateRowsRateLimit() { + return mutateRowsRateLimit_; + } + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
+     * this disables partial retries.
+     * 
+ * + * bool mutate_rows_rate_limit = 3; + * + * @param value The mutateRowsRateLimit to set. + * @return This builder for chaining. + */ + public Builder setMutateRowsRateLimit(boolean value) { + + mutateRowsRateLimit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
+     * this disables partial retries.
+     * 
+ * + * bool mutate_rows_rate_limit = 3; + * + * @return This builder for chaining. + */ + public Builder clearMutateRowsRateLimit() { + bitField0_ = (bitField0_ & ~0x00000002); + mutateRowsRateLimit_ = false; + onChanged(); + return this; + } + + private boolean mutateRowsRateLimit2_; + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. With partial retries
+     * enabled.
+     * 
+ * + * bool mutate_rows_rate_limit2 = 5; + * + * @return The mutateRowsRateLimit2. + */ + @java.lang.Override + public boolean getMutateRowsRateLimit2() { + return mutateRowsRateLimit2_; + } + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. With partial retries
+     * enabled.
+     * 
+ * + * bool mutate_rows_rate_limit2 = 5; + * + * @param value The mutateRowsRateLimit2 to set. + * @return This builder for chaining. + */ + public Builder setMutateRowsRateLimit2(boolean value) { + + mutateRowsRateLimit2_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client enables batch write flow control by
+     * requesting RateLimitInfo from MutateRowsResponse. With partial retries
+     * enabled.
+     * 
+ * + * bool mutate_rows_rate_limit2 = 5; + * + * @return This builder for chaining. + */ + public Builder clearMutateRowsRateLimit2() { + bitField0_ = (bitField0_ & ~0x00000004); + mutateRowsRateLimit2_ = false; + onChanged(); + return this; + } + + private boolean lastScannedRowResponses_; + + /** + * + * + *
+     * Notify the server that the client supports the last_scanned_row field
+     * in ReadRowsResponse for long-running scans.
+     * 
+ * + * bool last_scanned_row_responses = 4; + * + * @return The lastScannedRowResponses. + */ + @java.lang.Override + public boolean getLastScannedRowResponses() { + return lastScannedRowResponses_; + } + + /** + * + * + *
+     * Notify the server that the client supports the last_scanned_row field
+     * in ReadRowsResponse for long-running scans.
+     * 
+ * + * bool last_scanned_row_responses = 4; + * + * @param value The lastScannedRowResponses to set. + * @return This builder for chaining. + */ + public Builder setLastScannedRowResponses(boolean value) { + + lastScannedRowResponses_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client supports the last_scanned_row field
+     * in ReadRowsResponse for long-running scans.
+     * 
+ * + * bool last_scanned_row_responses = 4; + * + * @return This builder for chaining. + */ + public Builder clearLastScannedRowResponses() { + bitField0_ = (bitField0_ & ~0x00000008); + lastScannedRowResponses_ = false; + onChanged(); + return this; + } + + private boolean routingCookie_; + + /** + * + * + *
+     * Notify the server that the client supports using encoded routing cookie
+     * strings to retry requests with.
+     * 
+ * + * bool routing_cookie = 6; + * + * @return The routingCookie. + */ + @java.lang.Override + public boolean getRoutingCookie() { + return routingCookie_; + } + + /** + * + * + *
+     * Notify the server that the client supports using encoded routing cookie
+     * strings to retry requests with.
+     * 
+ * + * bool routing_cookie = 6; + * + * @param value The routingCookie to set. + * @return This builder for chaining. + */ + public Builder setRoutingCookie(boolean value) { + + routingCookie_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client supports using encoded routing cookie
+     * strings to retry requests with.
+     * 
+ * + * bool routing_cookie = 6; + * + * @return This builder for chaining. + */ + public Builder clearRoutingCookie() { + bitField0_ = (bitField0_ & ~0x00000010); + routingCookie_ = false; + onChanged(); + return this; + } + + private boolean retryInfo_; + + /** + * + * + *
+     * Notify the server that the client supports using retry info back off
+     * durations to retry requests with.
+     * 
+ * + * bool retry_info = 7; + * + * @return The retryInfo. + */ + @java.lang.Override + public boolean getRetryInfo() { + return retryInfo_; + } + + /** + * + * + *
+     * Notify the server that the client supports using retry info back off
+     * durations to retry requests with.
+     * 
+ * + * bool retry_info = 7; + * + * @param value The retryInfo to set. + * @return This builder for chaining. + */ + public Builder setRetryInfo(boolean value) { + + retryInfo_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client supports using retry info back off
+     * durations to retry requests with.
+     * 
+ * + * bool retry_info = 7; + * + * @return This builder for chaining. + */ + public Builder clearRetryInfo() { + bitField0_ = (bitField0_ & ~0x00000020); + retryInfo_ = false; + onChanged(); + return this; + } + + private boolean clientSideMetricsEnabled_; + + /** + * + * + *
+     * Notify the server that the client has client side metrics enabled.
+     * 
+ * + * bool client_side_metrics_enabled = 8; + * + * @return The clientSideMetricsEnabled. + */ + @java.lang.Override + public boolean getClientSideMetricsEnabled() { + return clientSideMetricsEnabled_; + } + + /** + * + * + *
+     * Notify the server that the client has client side metrics enabled.
+     * 
+ * + * bool client_side_metrics_enabled = 8; + * + * @param value The clientSideMetricsEnabled to set. + * @return This builder for chaining. + */ + public Builder setClientSideMetricsEnabled(boolean value) { + + clientSideMetricsEnabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client has client side metrics enabled.
+     * 
+ * + * bool client_side_metrics_enabled = 8; + * + * @return This builder for chaining. + */ + public Builder clearClientSideMetricsEnabled() { + bitField0_ = (bitField0_ & ~0x00000040); + clientSideMetricsEnabled_ = false; + onChanged(); + return this; + } + + private boolean trafficDirectorEnabled_; + + /** + * + * + *
+     * Notify the server that the client using Traffic Director endpoint.
+     * 
+ * + * bool traffic_director_enabled = 9; + * + * @return The trafficDirectorEnabled. + */ + @java.lang.Override + public boolean getTrafficDirectorEnabled() { + return trafficDirectorEnabled_; + } + + /** + * + * + *
+     * Notify the server that the client using Traffic Director endpoint.
+     * 
+ * + * bool traffic_director_enabled = 9; + * + * @param value The trafficDirectorEnabled to set. + * @return This builder for chaining. + */ + public Builder setTrafficDirectorEnabled(boolean value) { + + trafficDirectorEnabled_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client using Traffic Director endpoint.
+     * 
+ * + * bool traffic_director_enabled = 9; + * + * @return This builder for chaining. + */ + public Builder clearTrafficDirectorEnabled() { + bitField0_ = (bitField0_ & ~0x00000080); + trafficDirectorEnabled_ = false; + onChanged(); + return this; + } + + private boolean directAccessRequested_; + + /** + * + * + *
+     * Notify the server that the client explicitly opted in for Direct Access.
+     * 
+ * + * bool direct_access_requested = 10; + * + * @return The directAccessRequested. + */ + @java.lang.Override + public boolean getDirectAccessRequested() { + return directAccessRequested_; + } + + /** + * + * + *
+     * Notify the server that the client explicitly opted in for Direct Access.
+     * 
+ * + * bool direct_access_requested = 10; + * + * @param value The directAccessRequested to set. + * @return This builder for chaining. + */ + public Builder setDirectAccessRequested(boolean value) { + + directAccessRequested_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Notify the server that the client explicitly opted in for Direct Access.
+     * 
+ * + * bool direct_access_requested = 10; + * + * @return This builder for chaining. + */ + public Builder clearDirectAccessRequested() { + bitField0_ = (bitField0_ & ~0x00000100); + directAccessRequested_ = false; + onChanged(); + return this; + } + + private boolean peerInfo_; + + /** + * + * + *
+     * If the client can support using BigtablePeerInfo.
+     * 
+ * + * bool peer_info = 11; + * + * @return The peerInfo. + */ + @java.lang.Override + public boolean getPeerInfo() { + return peerInfo_; + } + + /** + * + * + *
+     * If the client can support using BigtablePeerInfo.
+     * 
+ * + * bool peer_info = 11; + * + * @param value The peerInfo to set. + * @return This builder for chaining. + */ + public Builder setPeerInfo(boolean value) { + + peerInfo_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * If the client can support using BigtablePeerInfo.
+     * 
+ * + * bool peer_info = 11; + * + * @return This builder for chaining. + */ + public Builder clearPeerInfo() { + bitField0_ = (bitField0_ & ~0x00000200); + peerInfo_ = false; + onChanged(); + return this; + } + + private boolean sessionsCompatible_; + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + @java.lang.Override + public boolean getSessionsCompatible() { + return sessionsCompatible_; + } + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @param value The sessionsCompatible to set. + * @return This builder for chaining. + */ + public Builder setSessionsCompatible(boolean value) { + + sessionsCompatible_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @return This builder for chaining. + */ + public Builder clearSessionsCompatible() { + bitField0_ = (bitField0_ & ~0x00000400); + sessionsCompatible_ = false; + onChanged(); + return this; + } + + private boolean sessionsRequired_; + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + @java.lang.Override + public boolean getSessionsRequired() { + return sessionsRequired_; + } + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @param value The sessionsRequired to set. + * @return This builder for chaining. + */ + public Builder setSessionsRequired(boolean value) { + + sessionsRequired_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @return This builder for chaining. + */ + public Builder clearSessionsRequired() { + bitField0_ = (bitField0_ & ~0x00000800); + sessionsRequired_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.FeatureFlags) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.FeatureFlags) + private static final com.google.bigtable.v2.FeatureFlags DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.FeatureFlags(); + } + + public static com.google.bigtable.v2.FeatureFlags getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureFlags parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FeatureFlags getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java new file mode 100644 index 000000000000..c6d5769116e0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/feature_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface FeatureFlagsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.FeatureFlags) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Notify the server that the client supports reverse scans. The server will
+   * reject ReadRowsRequests with the reverse bit set when this is absent.
+   * 
+ * + * bool reverse_scans = 1; + * + * @return The reverseScans. + */ + boolean getReverseScans(); + + /** + * + * + *
+   * Notify the server that the client enables batch write flow control by
+   * requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
+   * this disables partial retries.
+   * 
+ * + * bool mutate_rows_rate_limit = 3; + * + * @return The mutateRowsRateLimit. + */ + boolean getMutateRowsRateLimit(); + + /** + * + * + *
+   * Notify the server that the client enables batch write flow control by
+   * requesting RateLimitInfo from MutateRowsResponse. With partial retries
+   * enabled.
+   * 
+ * + * bool mutate_rows_rate_limit2 = 5; + * + * @return The mutateRowsRateLimit2. + */ + boolean getMutateRowsRateLimit2(); + + /** + * + * + *
+   * Notify the server that the client supports the last_scanned_row field
+   * in ReadRowsResponse for long-running scans.
+   * 
+ * + * bool last_scanned_row_responses = 4; + * + * @return The lastScannedRowResponses. + */ + boolean getLastScannedRowResponses(); + + /** + * + * + *
+   * Notify the server that the client supports using encoded routing cookie
+   * strings to retry requests with.
+   * 
+ * + * bool routing_cookie = 6; + * + * @return The routingCookie. + */ + boolean getRoutingCookie(); + + /** + * + * + *
+   * Notify the server that the client supports using retry info back off
+   * durations to retry requests with.
+   * 
+ * + * bool retry_info = 7; + * + * @return The retryInfo. + */ + boolean getRetryInfo(); + + /** + * + * + *
+   * Notify the server that the client has client side metrics enabled.
+   * 
+ * + * bool client_side_metrics_enabled = 8; + * + * @return The clientSideMetricsEnabled. + */ + boolean getClientSideMetricsEnabled(); + + /** + * + * + *
+   * Notify the server that the client using Traffic Director endpoint.
+   * 
+ * + * bool traffic_director_enabled = 9; + * + * @return The trafficDirectorEnabled. + */ + boolean getTrafficDirectorEnabled(); + + /** + * + * + *
+   * Notify the server that the client explicitly opted in for Direct Access.
+   * 
+ * + * bool direct_access_requested = 10; + * + * @return The directAccessRequested. + */ + boolean getDirectAccessRequested(); + + /** + * + * + *
+   * If the client can support using BigtablePeerInfo.
+   * 
+ * + * bool peer_info = 11; + * + * @return The peerInfo. + */ + boolean getPeerInfo(); + + /** + * + * + *
+   * Indicates whether the client supports the Bigtable Sessions API.
+   * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + boolean getSessionsCompatible(); + + /** + * + * + *
+   * Internal flag to force sessions for internal projects.
+   * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + boolean getSessionsRequired(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java new file mode 100644 index 000000000000..b0bbffce2b87 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/feature_flags.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class FeatureFlagsProto extends com.google.protobuf.GeneratedFile { + private FeatureFlagsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FeatureFlagsProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_FeatureFlags_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_FeatureFlags_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/bigtable/v2/feature_flags.proto" + + "\022\022google.bigtable.v2\"\351\002\n\014FeatureFlags\022\025\n" + + "\rreverse_scans\030\001 \001(\010\022\036\n\026mutate_rows_rate" + + "_limit\030\003 \001(\010\022\037\n\027mutate_rows_rate_limit2\030" + + "\005 \001(\010\022\"\n\032last_scanned_row_responses\030\004 \001(" + + "\010\022\026\n\016routing_cookie\030\006 \001(\010\022\022\n\nretry_info\030" + + "\007 \001(\010\022#\n\033client_side_metrics_enabled\030\010 \001" + + "(\010\022 \n\030traffic_director_enabled\030\t \001(\010\022\037\n\027" + + "direct_access_requested\030\n \001(\010\022\021\n\tpeer_in" + + "fo\030\013 \001(\010\022\033\n\023sessions_compatible\030\014 \001(\010\022\031\n" + + "\021sessions_required\030\r \001(\010B\273\001\n\026com.google." + + "bigtable.v2B\021FeatureFlagsProtoP\001Z8cloud." + + "google.com/go/bigtable/apiv2/bigtablepb;" + + "bigtablepb\252\002\030Google.Cloud.Bigtable.V2\312\002\030" + + "Google\\Cloud\\Bigtable\\V2\352\002\033Google::Cloud" + + "::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_bigtable_v2_FeatureFlags_descriptor = getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_FeatureFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_FeatureFlags_descriptor, + new java.lang.String[] { + "ReverseScans", + "MutateRowsRateLimit", + "MutateRowsRateLimit2", + "LastScannedRowResponses", + "RoutingCookie", + "RetryInfo", + "ClientSideMetricsEnabled", + "TrafficDirectorEnabled", + "DirectAccessRequested", + "PeerInfo", + "SessionsCompatible", + "SessionsRequired", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java new file mode 100644 index 000000000000..9e2e6fe8552a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java @@ -0,0 +1,1035 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * FullReadStatsView captures all known information about a read.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.FullReadStatsView} + */ +@com.google.protobuf.Generated +public final class FullReadStatsView extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.FullReadStatsView) + FullReadStatsViewOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FullReadStatsView"); + } + + // Use FullReadStatsView.newBuilder() to construct. + private FullReadStatsView(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FullReadStatsView() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_FullReadStatsView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_FullReadStatsView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.FullReadStatsView.class, + com.google.bigtable.v2.FullReadStatsView.Builder.class); + } + + private int bitField0_; + public static final int READ_ITERATION_STATS_FIELD_NUMBER = 1; + private com.google.bigtable.v2.ReadIterationStats readIterationStats_; + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return Whether the readIterationStats field is set. + */ + @java.lang.Override + public boolean hasReadIterationStats() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return The readIterationStats. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadIterationStats getReadIterationStats() { + return readIterationStats_ == null + ? com.google.bigtable.v2.ReadIterationStats.getDefaultInstance() + : readIterationStats_; + } + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadIterationStatsOrBuilder getReadIterationStatsOrBuilder() { + return readIterationStats_ == null + ? com.google.bigtable.v2.ReadIterationStats.getDefaultInstance() + : readIterationStats_; + } + + public static final int REQUEST_LATENCY_STATS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RequestLatencyStats requestLatencyStats_; + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return Whether the requestLatencyStats field is set. + */ + @java.lang.Override + public boolean hasRequestLatencyStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return The requestLatencyStats. + */ + @java.lang.Override + public com.google.bigtable.v2.RequestLatencyStats getRequestLatencyStats() { + return requestLatencyStats_ == null + ? com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance() + : requestLatencyStats_; + } + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RequestLatencyStatsOrBuilder getRequestLatencyStatsOrBuilder() { + return requestLatencyStats_ == null + ? com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance() + : requestLatencyStats_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getReadIterationStats()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequestLatencyStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReadIterationStats()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestLatencyStats()); + } + size += getUnknownFields().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.FullReadStatsView)) { + return super.equals(obj); + } + com.google.bigtable.v2.FullReadStatsView other = (com.google.bigtable.v2.FullReadStatsView) obj; + + if (hasReadIterationStats() != other.hasReadIterationStats()) return false; + if (hasReadIterationStats()) { + if (!getReadIterationStats().equals(other.getReadIterationStats())) return false; + } + if (hasRequestLatencyStats() != other.hasRequestLatencyStats()) return false; + if (hasRequestLatencyStats()) { + if (!getRequestLatencyStats().equals(other.getRequestLatencyStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasReadIterationStats()) { + hash = (37 * hash) + READ_ITERATION_STATS_FIELD_NUMBER; + hash = (53 * hash) + getReadIterationStats().hashCode(); + } + if (hasRequestLatencyStats()) { + hash = (37 * hash) + REQUEST_LATENCY_STATS_FIELD_NUMBER; + hash = (53 * hash) + getRequestLatencyStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FullReadStatsView 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.FullReadStatsView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FullReadStatsView 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.FullReadStatsView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FullReadStatsView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FullReadStatsView parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.FullReadStatsView parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.FullReadStatsView 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * FullReadStatsView captures all known information about a read.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.FullReadStatsView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.FullReadStatsView) + com.google.bigtable.v2.FullReadStatsViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_FullReadStatsView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_FullReadStatsView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.FullReadStatsView.class, + com.google.bigtable.v2.FullReadStatsView.Builder.class); + } + + // Construct using com.google.bigtable.v2.FullReadStatsView.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReadIterationStatsFieldBuilder(); + internalGetRequestLatencyStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + readIterationStats_ = null; + if (readIterationStatsBuilder_ != null) { + readIterationStatsBuilder_.dispose(); + readIterationStatsBuilder_ = null; + } + requestLatencyStats_ = null; + if (requestLatencyStatsBuilder_ != null) { + requestLatencyStatsBuilder_.dispose(); + requestLatencyStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_FullReadStatsView_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsView getDefaultInstanceForType() { + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsView build() { + com.google.bigtable.v2.FullReadStatsView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsView buildPartial() { + com.google.bigtable.v2.FullReadStatsView result = + new com.google.bigtable.v2.FullReadStatsView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.FullReadStatsView result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.readIterationStats_ = + readIterationStatsBuilder_ == null + ? readIterationStats_ + : readIterationStatsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestLatencyStats_ = + requestLatencyStatsBuilder_ == null + ? requestLatencyStats_ + : requestLatencyStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.FullReadStatsView) { + return mergeFrom((com.google.bigtable.v2.FullReadStatsView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.FullReadStatsView other) { + if (other == com.google.bigtable.v2.FullReadStatsView.getDefaultInstance()) return this; + if (other.hasReadIterationStats()) { + mergeReadIterationStats(other.getReadIterationStats()); + } + if (other.hasRequestLatencyStats()) { + mergeRequestLatencyStats(other.getRequestLatencyStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetReadIterationStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetRequestLatencyStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.ReadIterationStats readIterationStats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadIterationStats, + com.google.bigtable.v2.ReadIterationStats.Builder, + com.google.bigtable.v2.ReadIterationStatsOrBuilder> + readIterationStatsBuilder_; + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return Whether the readIterationStats field is set. + */ + public boolean hasReadIterationStats() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return The readIterationStats. + */ + public com.google.bigtable.v2.ReadIterationStats getReadIterationStats() { + if (readIterationStatsBuilder_ == null) { + return readIterationStats_ == null + ? com.google.bigtable.v2.ReadIterationStats.getDefaultInstance() + : readIterationStats_; + } else { + return readIterationStatsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public Builder setReadIterationStats(com.google.bigtable.v2.ReadIterationStats value) { + if (readIterationStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readIterationStats_ = value; + } else { + readIterationStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public Builder setReadIterationStats( + com.google.bigtable.v2.ReadIterationStats.Builder builderForValue) { + if (readIterationStatsBuilder_ == null) { + readIterationStats_ = builderForValue.build(); + } else { + readIterationStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public Builder mergeReadIterationStats(com.google.bigtable.v2.ReadIterationStats value) { + if (readIterationStatsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && readIterationStats_ != null + && readIterationStats_ + != com.google.bigtable.v2.ReadIterationStats.getDefaultInstance()) { + getReadIterationStatsBuilder().mergeFrom(value); + } else { + readIterationStats_ = value; + } + } else { + readIterationStatsBuilder_.mergeFrom(value); + } + if (readIterationStats_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public Builder clearReadIterationStats() { + bitField0_ = (bitField0_ & ~0x00000001); + readIterationStats_ = null; + if (readIterationStatsBuilder_ != null) { + readIterationStatsBuilder_.dispose(); + readIterationStatsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public com.google.bigtable.v2.ReadIterationStats.Builder getReadIterationStatsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetReadIterationStatsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + public com.google.bigtable.v2.ReadIterationStatsOrBuilder getReadIterationStatsOrBuilder() { + if (readIterationStatsBuilder_ != null) { + return readIterationStatsBuilder_.getMessageOrBuilder(); + } else { + return readIterationStats_ == null + ? com.google.bigtable.v2.ReadIterationStats.getDefaultInstance() + : readIterationStats_; + } + } + + /** + * + * + *
+     * Iteration stats describe how efficient the read is, e.g. comparing
+     * rows seen vs. rows returned or cells seen vs cells returned can provide an
+     * indication of read efficiency (the higher the ratio of seen to retuned the
+     * better).
+     * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadIterationStats, + com.google.bigtable.v2.ReadIterationStats.Builder, + com.google.bigtable.v2.ReadIterationStatsOrBuilder> + internalGetReadIterationStatsFieldBuilder() { + if (readIterationStatsBuilder_ == null) { + readIterationStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadIterationStats, + com.google.bigtable.v2.ReadIterationStats.Builder, + com.google.bigtable.v2.ReadIterationStatsOrBuilder>( + getReadIterationStats(), getParentForChildren(), isClean()); + readIterationStats_ = null; + } + return readIterationStatsBuilder_; + } + + private com.google.bigtable.v2.RequestLatencyStats requestLatencyStats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestLatencyStats, + com.google.bigtable.v2.RequestLatencyStats.Builder, + com.google.bigtable.v2.RequestLatencyStatsOrBuilder> + requestLatencyStatsBuilder_; + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return Whether the requestLatencyStats field is set. + */ + public boolean hasRequestLatencyStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return The requestLatencyStats. + */ + public com.google.bigtable.v2.RequestLatencyStats getRequestLatencyStats() { + if (requestLatencyStatsBuilder_ == null) { + return requestLatencyStats_ == null + ? com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance() + : requestLatencyStats_; + } else { + return requestLatencyStatsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public Builder setRequestLatencyStats(com.google.bigtable.v2.RequestLatencyStats value) { + if (requestLatencyStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestLatencyStats_ = value; + } else { + requestLatencyStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public Builder setRequestLatencyStats( + com.google.bigtable.v2.RequestLatencyStats.Builder builderForValue) { + if (requestLatencyStatsBuilder_ == null) { + requestLatencyStats_ = builderForValue.build(); + } else { + requestLatencyStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public Builder mergeRequestLatencyStats(com.google.bigtable.v2.RequestLatencyStats value) { + if (requestLatencyStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestLatencyStats_ != null + && requestLatencyStats_ + != com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance()) { + getRequestLatencyStatsBuilder().mergeFrom(value); + } else { + requestLatencyStats_ = value; + } + } else { + requestLatencyStatsBuilder_.mergeFrom(value); + } + if (requestLatencyStats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public Builder clearRequestLatencyStats() { + bitField0_ = (bitField0_ & ~0x00000002); + requestLatencyStats_ = null; + if (requestLatencyStatsBuilder_ != null) { + requestLatencyStatsBuilder_.dispose(); + requestLatencyStatsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public com.google.bigtable.v2.RequestLatencyStats.Builder getRequestLatencyStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRequestLatencyStatsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + public com.google.bigtable.v2.RequestLatencyStatsOrBuilder getRequestLatencyStatsOrBuilder() { + if (requestLatencyStatsBuilder_ != null) { + return requestLatencyStatsBuilder_.getMessageOrBuilder(); + } else { + return requestLatencyStats_ == null + ? com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance() + : requestLatencyStats_; + } + } + + /** + * + * + *
+     * Request latency stats describe the time taken to complete a request, from
+     * the server side.
+     * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestLatencyStats, + com.google.bigtable.v2.RequestLatencyStats.Builder, + com.google.bigtable.v2.RequestLatencyStatsOrBuilder> + internalGetRequestLatencyStatsFieldBuilder() { + if (requestLatencyStatsBuilder_ == null) { + requestLatencyStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestLatencyStats, + com.google.bigtable.v2.RequestLatencyStats.Builder, + com.google.bigtable.v2.RequestLatencyStatsOrBuilder>( + getRequestLatencyStats(), getParentForChildren(), isClean()); + requestLatencyStats_ = null; + } + return requestLatencyStatsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.FullReadStatsView) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.FullReadStatsView) + private static final com.google.bigtable.v2.FullReadStatsView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.FullReadStatsView(); + } + + public static com.google.bigtable.v2.FullReadStatsView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FullReadStatsView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FullReadStatsView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.java new file mode 100644 index 000000000000..6355563d96d5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface FullReadStatsViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.FullReadStatsView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return Whether the readIterationStats field is set. + */ + boolean hasReadIterationStats(); + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + * + * @return The readIterationStats. + */ + com.google.bigtable.v2.ReadIterationStats getReadIterationStats(); + + /** + * + * + *
+   * Iteration stats describe how efficient the read is, e.g. comparing
+   * rows seen vs. rows returned or cells seen vs cells returned can provide an
+   * indication of read efficiency (the higher the ratio of seen to retuned the
+   * better).
+   * 
+ * + * .google.bigtable.v2.ReadIterationStats read_iteration_stats = 1; + */ + com.google.bigtable.v2.ReadIterationStatsOrBuilder getReadIterationStatsOrBuilder(); + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return Whether the requestLatencyStats field is set. + */ + boolean hasRequestLatencyStats(); + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + * + * @return The requestLatencyStats. + */ + com.google.bigtable.v2.RequestLatencyStats getRequestLatencyStats(); + + /** + * + * + *
+   * Request latency stats describe the time taken to complete a request, from
+   * the server side.
+   * 
+ * + * .google.bigtable.v2.RequestLatencyStats request_latency_stats = 2; + */ + com.google.bigtable.v2.RequestLatencyStatsOrBuilder getRequestLatencyStatsOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java new file mode 100644 index 000000000000..8d49f29c98d7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java @@ -0,0 +1,853 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * Request message for Bigtable.GenerateInitialChangeStreamPartitions.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} + */ +@com.google.protobuf.Generated +public final class GenerateInitialChangeStreamPartitionsRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + GenerateInitialChangeStreamPartitionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateInitialChangeStreamPartitionsRequest"); + } + + // Use GenerateInitialChangeStreamPartitionsRequest.newBuilder() to construct. + private GenerateInitialChangeStreamPartitionsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateInitialChangeStreamPartitionsRequest() { + tableName_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.class, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.Builder.class); + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table from which to get change stream
+   * partitions. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the table from which to get change stream
+   * partitions. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + size += getUnknownFields().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.GenerateInitialChangeStreamPartitionsRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest other = + (com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest 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.GenerateInitialChangeStreamPartitionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest 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.GenerateInitialChangeStreamPartitionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GenerateInitialChangeStreamPartitionsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * Request message for Bigtable.GenerateInitialChangeStreamPartitions.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.class, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + appProfileId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + getDefaultInstanceForType() { + return com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest build() { + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest buildPartial() { + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest result = + new com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) { + return mergeFrom( + (com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest other) { + if (other + == com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + .getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table from which to get change stream
+     * partitions. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table from which to get change stream
+     * partitions. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table from which to get change stream
+     * partitions. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table from which to get change stream
+     * partitions. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table from which to get change stream
+     * partitions. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + private static final com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest(); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateInitialChangeStreamPartitionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GenerateInitialChangeStreamPartitionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java new file mode 100644 index 000000000000..480a01e981b1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GenerateInitialChangeStreamPartitionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table from which to get change stream
+   * partitions. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Required. The unique name of the table from which to get change stream
+   * partitions. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java new file mode 100644 index 000000000000..553e33d3fcba --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java @@ -0,0 +1,717 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * Response message for Bigtable.GenerateInitialChangeStreamPartitions.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} + */ +@com.google.protobuf.Generated +public final class GenerateInitialChangeStreamPartitionsResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + GenerateInitialChangeStreamPartitionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GenerateInitialChangeStreamPartitionsResponse"); + } + + // Use GenerateInitialChangeStreamPartitionsResponse.newBuilder() to construct. + private GenerateInitialChangeStreamPartitionsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GenerateInitialChangeStreamPartitionsResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.class, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.Builder.class); + } + + private int bitField0_; + public static final int PARTITION_FIELD_NUMBER = 1; + private com.google.bigtable.v2.StreamPartition partition_; + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + @java.lang.Override + public boolean hasPartition() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartition getPartition() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPartition()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPartition()); + } + size += getUnknownFields().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.GenerateInitialChangeStreamPartitionsResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse other = + (com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) obj; + + if (hasPartition() != other.hasPartition()) return false; + if (hasPartition()) { + if (!getPartition().equals(other.getPartition())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPartition()) { + hash = (37 * hash) + PARTITION_FIELD_NUMBER; + hash = (53 * hash) + getPartition().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse 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.GenerateInitialChangeStreamPartitionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse 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.GenerateInitialChangeStreamPartitionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GenerateInitialChangeStreamPartitionsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * Response message for Bigtable.GenerateInitialChangeStreamPartitions.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.class, + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPartitionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + getDefaultInstanceForType() { + return com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse build() { + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse buildPartial() { + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse result = + new com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.partition_ = partitionBuilder_ == null ? partition_ : partitionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) { + return mergeFrom( + (com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse other) { + if (other + == com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + .getDefaultInstance()) return this; + if (other.hasPartition()) { + mergePartition(other.getPartition()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetPartitionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.StreamPartition partition_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + partitionBuilder_; + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + public boolean hasPartition() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + public com.google.bigtable.v2.StreamPartition getPartition() { + if (partitionBuilder_ == null) { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } else { + return partitionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + } else { + partitionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (partitionBuilder_ == null) { + partition_ = builderForValue.build(); + } else { + partitionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder mergePartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && partition_ != null + && partition_ != com.google.bigtable.v2.StreamPartition.getDefaultInstance()) { + getPartitionBuilder().mergeFrom(value); + } else { + partition_ = value; + } + } else { + partitionBuilder_.mergeFrom(value); + } + if (partition_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder clearPartition() { + bitField0_ = (bitField0_ & ~0x00000001); + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public com.google.bigtable.v2.StreamPartition.Builder getPartitionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPartitionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + if (partitionBuilder_ != null) { + return partitionBuilder_.getMessageOrBuilder(); + } else { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + } + + /** + * + * + *
+     * A partition of the change stream.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + internalGetPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder>( + getPartition(), getParentForChildren(), isClean()); + partition_ = null; + } + return partitionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + private static final com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse(); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateInitialChangeStreamPartitionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GenerateInitialChangeStreamPartitionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.java new file mode 100644 index 000000000000..af2531624543 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GenerateInitialChangeStreamPartitionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + boolean hasPartition(); + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + com.google.bigtable.v2.StreamPartition getPartition(); + + /** + * + * + *
+   * A partition of the change stream.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java new file mode 100644 index 000000000000..bece1ef4436f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java @@ -0,0 +1,841 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * See GetClientConfiguration() RPC in bigtable.proto. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GetClientConfigurationRequest} + */ +@com.google.protobuf.Generated +public final class GetClientConfigurationRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GetClientConfigurationRequest) + GetClientConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetClientConfigurationRequest"); + } + + // Use GetClientConfigurationRequest.newBuilder() to construct. + private GetClientConfigurationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetClientConfigurationRequest() { + instanceName_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GetClientConfigurationRequest.class, + com.google.bigtable.v2.GetClientConfigurationRequest.Builder.class); + } + + public static final int INSTANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + @java.lang.Override + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + 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(); + instanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.GeneratedMessage.isStringEmpty(instanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + size += getUnknownFields().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.GetClientConfigurationRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.GetClientConfigurationRequest other = + (com.google.bigtable.v2.GetClientConfigurationRequest) obj; + + if (!getInstanceName().equals(other.getInstanceName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest 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.GetClientConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest 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.GetClientConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GetClientConfigurationRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * See GetClientConfiguration() RPC in bigtable.proto. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GetClientConfigurationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GetClientConfigurationRequest) + com.google.bigtable.v2.GetClientConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GetClientConfigurationRequest.class, + com.google.bigtable.v2.GetClientConfigurationRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.GetClientConfigurationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceName_ = ""; + appProfileId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.GetClientConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest build() { + com.google.bigtable.v2.GetClientConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest buildPartial() { + com.google.bigtable.v2.GetClientConfigurationRequest result = + new com.google.bigtable.v2.GetClientConfigurationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.GetClientConfigurationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instanceName_ = instanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GetClientConfigurationRequest) { + return mergeFrom((com.google.bigtable.v2.GetClientConfigurationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.GetClientConfigurationRequest other) { + if (other == com.google.bigtable.v2.GetClientConfigurationRequest.getDefaultInstance()) + return this; + if (!other.getInstanceName().isEmpty()) { + instanceName_ = other.instanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instanceName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceName() { + instanceName_ = getDefaultInstance().getInstanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GetClientConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GetClientConfigurationRequest) + private static final com.google.bigtable.v2.GetClientConfigurationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GetClientConfigurationRequest(); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClientConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GetClientConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java new file mode 100644 index 000000000000..1cb100829d07 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GetClientConfigurationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GetClientConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + java.lang.String getInstanceName(); + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + com.google.protobuf.ByteString getInstanceNameBytes(); + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java new file mode 100644 index 000000000000..bc76b7771535 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java @@ -0,0 +1,852 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GoAwayResponse} + */ +@com.google.protobuf.Generated +public final class GoAwayResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GoAwayResponse) + GoAwayResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GoAwayResponse"); + } + + // Use GoAwayResponse.newBuilder() to construct. + private GoAwayResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GoAwayResponse() { + reason_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GoAwayResponse.class, + com.google.bigtable.v2.GoAwayResponse.Builder.class); + } + + public static final int REASON_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object reason_ = ""; + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public java.lang.String getReason() { + java.lang.Object ref = reason_; + 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(); + reason_ = s; + return s; + } + } + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_RPC_ID_ADMITTED_FIELD_NUMBER = 3; + private long lastRpcIdAdmitted_ = 0L; + + /** + * + * + *
+   * The last vRPC which was admitted by the AFE. The client may expect the
+   * result from the vRPC on the stream before disconnecting, and should
+   * retry vRPCs beyond this boundary.
+   * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + @java.lang.Override + public long getLastRpcIdAdmitted() { + return lastRpcIdAdmitted_; + } + + 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.GeneratedMessage.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (lastRpcIdAdmitted_ != 0L) { + output.writeInt64(3, lastRpcIdAdmitted_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (lastRpcIdAdmitted_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, lastRpcIdAdmitted_); + } + size += getUnknownFields().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.GoAwayResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.GoAwayResponse other = (com.google.bigtable.v2.GoAwayResponse) obj; + + if (!getReason().equals(other.getReason())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getLastRpcIdAdmitted() != other.getLastRpcIdAdmitted()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REASON_FIELD_NUMBER; + hash = (53 * hash) + getReason().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LAST_RPC_ID_ADMITTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLastRpcIdAdmitted()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse 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.GoAwayResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse 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.GoAwayResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GoAwayResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GoAwayResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GoAwayResponse) + com.google.bigtable.v2.GoAwayResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GoAwayResponse.class, + com.google.bigtable.v2.GoAwayResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.GoAwayResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reason_ = ""; + description_ = ""; + lastRpcIdAdmitted_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse build() { + com.google.bigtable.v2.GoAwayResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse buildPartial() { + com.google.bigtable.v2.GoAwayResponse result = + new com.google.bigtable.v2.GoAwayResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.GoAwayResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lastRpcIdAdmitted_ = lastRpcIdAdmitted_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GoAwayResponse) { + return mergeFrom((com.google.bigtable.v2.GoAwayResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.GoAwayResponse other) { + if (other == com.google.bigtable.v2.GoAwayResponse.getDefaultInstance()) return this; + if (!other.getReason().isEmpty()) { + reason_ = other.reason_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getLastRpcIdAdmitted() != 0L) { + setLastRpcIdAdmitted(other.getLastRpcIdAdmitted()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + reason_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + lastRpcIdAdmitted_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object reason_ = ""; + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return The reason. + */ + public java.lang.String getReason() { + java.lang.Object ref = reason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + reason_ = getDefaultInstance().getReason(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @param value The bytes for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long lastRpcIdAdmitted_; + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + @java.lang.Override + public long getLastRpcIdAdmitted() { + return lastRpcIdAdmitted_; + } + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @param value The lastRpcIdAdmitted to set. + * @return This builder for chaining. + */ + public Builder setLastRpcIdAdmitted(long value) { + + lastRpcIdAdmitted_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return This builder for chaining. + */ + public Builder clearLastRpcIdAdmitted() { + bitField0_ = (bitField0_ & ~0x00000004); + lastRpcIdAdmitted_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GoAwayResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GoAwayResponse) + private static final com.google.bigtable.v2.GoAwayResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GoAwayResponse(); + } + + public static com.google.bigtable.v2.GoAwayResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GoAwayResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GoAwayResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java new file mode 100644 index 000000000000..3bddd8a3bdfe --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GoAwayResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GoAwayResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The reason. + */ + java.lang.String getReason(); + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + com.google.protobuf.ByteString getReasonBytes(); + + /** + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The last vRPC which was admitted by the AFE. The client may expect the
+   * result from the vRPC on the stream before disconnecting, and should
+   * retry vRPCs beyond this boundary.
+   * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + long getLastRpcIdAdmitted(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java new file mode 100644 index 000000000000..3c10f838b891 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.HeartbeatResponse} + */ +@com.google.protobuf.Generated +public final class HeartbeatResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.HeartbeatResponse) + HeartbeatResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HeartbeatResponse"); + } + + // Use HeartbeatResponse.newBuilder() to construct. + private HeartbeatResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private HeartbeatResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.HeartbeatResponse.class, + com.google.bigtable.v2.HeartbeatResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.HeartbeatResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.HeartbeatResponse other = (com.google.bigtable.v2.HeartbeatResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse 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.HeartbeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse 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.HeartbeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.HeartbeatResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.HeartbeatResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.HeartbeatResponse) + com.google.bigtable.v2.HeartbeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.HeartbeatResponse.class, + com.google.bigtable.v2.HeartbeatResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.HeartbeatResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse build() { + com.google.bigtable.v2.HeartbeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse buildPartial() { + com.google.bigtable.v2.HeartbeatResponse result = + new com.google.bigtable.v2.HeartbeatResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.HeartbeatResponse) { + return mergeFrom((com.google.bigtable.v2.HeartbeatResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.HeartbeatResponse other) { + if (other == com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.HeartbeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.HeartbeatResponse) + private static final com.google.bigtable.v2.HeartbeatResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.HeartbeatResponse(); + } + + public static com.google.bigtable.v2.HeartbeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HeartbeatResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.HeartbeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java new file mode 100644 index 000000000000..7e298530990c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface HeartbeatResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.HeartbeatResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Idempotency.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Idempotency.java new file mode 100644 index 000000000000..b90af09d6a6c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Idempotency.java @@ -0,0 +1,855 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Parameters on mutations where clients want to ensure idempotency (i.e.
+ * at-most-once semantics). This is currently only needed for certain aggregate
+ * types.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Idempotency} + */ +@com.google.protobuf.Generated +public final class Idempotency extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Idempotency) + IdempotencyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Idempotency"); + } + + // Use Idempotency.newBuilder() to construct. + private Idempotency(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Idempotency() { + token_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Idempotency_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Idempotency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Idempotency.class, + com.google.bigtable.v2.Idempotency.Builder.class); + } + + private int bitField0_; + public static final int TOKEN_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString token_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Unique token used to identify replays of this mutation.
+   * Must be at least 8 bytes long.
+   * 
+ * + * bytes token = 1; + * + * @return The token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getToken() { + return token_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + 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 (!token_.isEmpty()) { + output.writeBytes(1, token_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!token_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, token_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + size += getUnknownFields().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.Idempotency)) { + return super.equals(obj); + } + com.google.bigtable.v2.Idempotency other = (com.google.bigtable.v2.Idempotency) obj; + + if (!getToken().equals(other.getToken())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Idempotency parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Idempotency 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.Idempotency parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Idempotency 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.Idempotency parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Idempotency parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Idempotency parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Idempotency parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Idempotency parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Idempotency parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Idempotency parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Idempotency parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Idempotency 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Parameters on mutations where clients want to ensure idempotency (i.e.
+   * at-most-once semantics). This is currently only needed for certain aggregate
+   * types.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Idempotency} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Idempotency) + com.google.bigtable.v2.IdempotencyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Idempotency_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Idempotency_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Idempotency.class, + com.google.bigtable.v2.Idempotency.Builder.class); + } + + // Construct using com.google.bigtable.v2.Idempotency.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + token_ = com.google.protobuf.ByteString.EMPTY; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Idempotency_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Idempotency getDefaultInstanceForType() { + return com.google.bigtable.v2.Idempotency.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Idempotency build() { + com.google.bigtable.v2.Idempotency result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Idempotency buildPartial() { + com.google.bigtable.v2.Idempotency result = new com.google.bigtable.v2.Idempotency(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Idempotency result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.token_ = token_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Idempotency) { + return mergeFrom((com.google.bigtable.v2.Idempotency) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Idempotency other) { + if (other == com.google.bigtable.v2.Idempotency.getDefaultInstance()) return this; + if (!other.getToken().isEmpty()) { + setToken(other.getToken()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + token_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString token_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Unique token used to identify replays of this mutation.
+     * Must be at least 8 bytes long.
+     * 
+ * + * bytes token = 1; + * + * @return The token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getToken() { + return token_; + } + + /** + * + * + *
+     * Unique token used to identify replays of this mutation.
+     * Must be at least 8 bytes long.
+     * 
+ * + * bytes token = 1; + * + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unique token used to identify replays of this mutation.
+     * Must be at least 8 bytes long.
+     * 
+ * + * bytes token = 1; + * + * @return This builder for chaining. + */ + public Builder clearToken() { + bitField0_ = (bitField0_ & ~0x00000001); + token_ = getDefaultInstance().getToken(); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * Client-assigned timestamp when the mutation's first attempt was sent.
+     * Used to reject mutations that arrive after idempotency protection may
+     * have expired. May cause spurious rejections if clock skew is too high.
+     *
+     * Leave unset or zero to always accept the mutation, at the risk of
+     * double counting if the protection for previous attempts has expired.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Idempotency) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Idempotency) + private static final com.google.bigtable.v2.Idempotency DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Idempotency(); + } + + public static com.google.bigtable.v2.Idempotency getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Idempotency parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Idempotency getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/IdempotencyOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/IdempotencyOrBuilder.java new file mode 100644 index 000000000000..95e40c3547b3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/IdempotencyOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface IdempotencyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Idempotency) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Unique token used to identify replays of this mutation.
+   * Must be at least 8 bytes long.
+   * 
+ * + * bytes token = 1; + * + * @return The token. + */ + com.google.protobuf.ByteString getToken(); + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Client-assigned timestamp when the mutation's first attempt was sent.
+   * Used to reject mutations that arrive after idempotency protection may
+   * have expired. May cause spurious rejections if clock skew is too high.
+   *
+   * Leave unset or zero to always accept the mutation, at the risk of
+   * double counting if the protection for previous attempts has expired.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java new file mode 100644 index 000000000000..d36d4f04c14a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java new file mode 100644 index 000000000000..e9443eecbe43 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java @@ -0,0 +1,2567 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for how to balance vRPCs over sessions. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions} + */ +@com.google.protobuf.Generated +public final class LoadBalancingOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions) + LoadBalancingOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoadBalancingOptions"); + } + + // Use LoadBalancingOptions.newBuilder() to construct. + private LoadBalancingOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LoadBalancingOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.class, + com.google.bigtable.v2.LoadBalancingOptions.Builder.class); + } + + public interface LeastInFlightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to run the algorithm
+     * on. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + long getRandomSubsetSize(); + } + + /** + * + * + *
+   * Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the
+   * least number of active vRPCs.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.LeastInFlight} + */ + public static final class LeastInFlight extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + LeastInFlightOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LeastInFlight"); + } + + // Use LeastInFlight.newBuilder() to construct. + private LeastInFlight(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LeastInFlight() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.class, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder.class); + } + + public static final int RANDOM_SUBSET_SIZE_FIELD_NUMBER = 1; + private long randomSubsetSize_ = 0L; + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to run the algorithm
+     * on. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + 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 (randomSubsetSize_ != 0L) { + output.writeInt64(1, randomSubsetSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (randomSubsetSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, randomSubsetSize_); + } + size += getUnknownFields().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.LoadBalancingOptions.LeastInFlight)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight other = + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) obj; + + if (getRandomSubsetSize() != other.getRandomSubsetSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RANDOM_SUBSET_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRandomSubsetSize()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight 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.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight 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.LoadBalancingOptions.LeastInFlight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.LoadBalancingOptions.LeastInFlight 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the
+     * least number of active vRPCs.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.LeastInFlight} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.class, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + randomSubsetSize_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight build() { + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result = + new com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.randomSubsetSize_ = randomSubsetSize_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance()) + return this; + if (other.getRandomSubsetSize() != 0L) { + setRandomSubsetSize(other.getRandomSubsetSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + randomSubsetSize_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long randomSubsetSize_; + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @param value The randomSubsetSize to set. + * @return This builder for chaining. + */ + public Builder setRandomSubsetSize(long value) { + + randomSubsetSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearRandomSubsetSize() { + bitField0_ = (bitField0_ & ~0x00000001); + randomSubsetSize_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + private static final com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LeastInFlight parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LoadBalancingOptions.LeastInFlight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PeakEwmaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to compare costs
+     * over. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + long getRandomSubsetSize(); + } + + /** + * + * + *
+   * Balances vRPCs over backends, by maintaining a moving average of each AFE's
+   * round-trip time, weighted by the number of outstanding vRPCs, and
+   * distribute traffic to AFEs where that cost function is smallest.
+   *
+   * See:
+   * https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.PeakEwma} + */ + public static final class PeakEwma extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + PeakEwmaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PeakEwma"); + } + + // Use PeakEwma.newBuilder() to construct. + private PeakEwma(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PeakEwma() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.class, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder.class); + } + + public static final int RANDOM_SUBSET_SIZE_FIELD_NUMBER = 1; + private long randomSubsetSize_ = 0L; + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to compare costs
+     * over. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + 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 (randomSubsetSize_ != 0L) { + output.writeInt64(1, randomSubsetSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (randomSubsetSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, randomSubsetSize_); + } + size += getUnknownFields().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.LoadBalancingOptions.PeakEwma)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma other = + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) obj; + + if (getRandomSubsetSize() != other.getRandomSubsetSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RANDOM_SUBSET_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRandomSubsetSize()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma 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.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma 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.LoadBalancingOptions.PeakEwma parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.LoadBalancingOptions.PeakEwma 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, by maintaining a moving average of each AFE's
+     * round-trip time, weighted by the number of outstanding vRPCs, and
+     * distribute traffic to AFEs where that cost function is smallest.
+     *
+     * See:
+     * https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.PeakEwma} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.class, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + randomSubsetSize_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma build() { + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result = + new com.google.bigtable.v2.LoadBalancingOptions.PeakEwma(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.randomSubsetSize_ = randomSubsetSize_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance()) + return this; + if (other.getRandomSubsetSize() != 0L) { + setRandomSubsetSize(other.getRandomSubsetSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + randomSubsetSize_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long randomSubsetSize_; + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @param value The randomSubsetSize to set. + * @return This builder for chaining. + */ + public Builder setRandomSubsetSize(long value) { + + randomSubsetSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearRandomSubsetSize() { + bitField0_ = (bitField0_ & ~0x00000001); + randomSubsetSize_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + private static final com.google.bigtable.v2.LoadBalancingOptions.PeakEwma DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.PeakEwma(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PeakEwma parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LoadBalancingOptions.PeakEwma getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RandomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.Random) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Balances vRPCs over backends, by randomly selecting a backend.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.Random} + */ + public static final class Random extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.Random) + RandomOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Random"); + } + + // Use Random.newBuilder() to construct. + private Random(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Random() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.Random.class, + com.google.bigtable.v2.LoadBalancingOptions.Random.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.LoadBalancingOptions.Random)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.Random other = + (com.google.bigtable.v2.LoadBalancingOptions.Random) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random 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.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random 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.LoadBalancingOptions.Random parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.LoadBalancingOptions.Random 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, by randomly selecting a backend.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.Random} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.Random) + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.Random.class, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.Random.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random build() { + com.google.bigtable.v2.LoadBalancingOptions.Random result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.Random result = + new com.google.bigtable.v2.LoadBalancingOptions.Random(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.Random) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.Random) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.Random other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.Random) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.Random) + private static final com.google.bigtable.v2.LoadBalancingOptions.Random DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.Random(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Random parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LoadBalancingOptions.Random getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int loadBalancingStrategyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object loadBalancingStrategy_; + + public enum LoadBalancingStrategyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEAST_IN_FLIGHT(1), + PEAK_EWMA(2), + RANDOM(4), + LOADBALANCINGSTRATEGY_NOT_SET(0); + private final int value; + + private LoadBalancingStrategyCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LoadBalancingStrategyCase valueOf(int value) { + return forNumber(value); + } + + public static LoadBalancingStrategyCase forNumber(int value) { + switch (value) { + case 1: + return LEAST_IN_FLIGHT; + case 2: + return PEAK_EWMA; + case 4: + return RANDOM; + case 0: + return LOADBALANCINGSTRATEGY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LoadBalancingStrategyCase getLoadBalancingStrategyCase() { + return LoadBalancingStrategyCase.forNumber(loadBalancingStrategyCase_); + } + + public static final int LEAST_IN_FLIGHT_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + @java.lang.Override + public boolean hasLeastInFlight() { + return loadBalancingStrategyCase_ == 1; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight() { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder + getLeastInFlightOrBuilder() { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + public static final int PEAK_EWMA_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + @java.lang.Override + public boolean hasPeakEwma() { + return loadBalancingStrategyCase_ == 2; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma() { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder() { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + public static final int RANDOM_FIELD_NUMBER = 4; + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + @java.lang.Override + public boolean hasRandom() { + return loadBalancingStrategyCase_ == 4; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getRandom() { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder() { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + 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 (loadBalancingStrategyCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 4) { + output.writeMessage( + 4, (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (loadBalancingStrategyCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_); + } + size += getUnknownFields().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.LoadBalancingOptions)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions other = + (com.google.bigtable.v2.LoadBalancingOptions) obj; + + if (!getLoadBalancingStrategyCase().equals(other.getLoadBalancingStrategyCase())) return false; + switch (loadBalancingStrategyCase_) { + case 1: + if (!getLeastInFlight().equals(other.getLeastInFlight())) return false; + break; + case 2: + if (!getPeakEwma().equals(other.getPeakEwma())) return false; + break; + case 4: + if (!getRandom().equals(other.getRandom())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (loadBalancingStrategyCase_) { + case 1: + hash = (37 * hash) + LEAST_IN_FLIGHT_FIELD_NUMBER; + hash = (53 * hash) + getLeastInFlight().hashCode(); + break; + case 2: + hash = (37 * hash) + PEAK_EWMA_FIELD_NUMBER; + hash = (53 * hash) + getPeakEwma().hashCode(); + break; + case 4: + hash = (37 * hash) + RANDOM_FIELD_NUMBER; + hash = (53 * hash) + getRandom().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions 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.LoadBalancingOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions 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.LoadBalancingOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.LoadBalancingOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for how to balance vRPCs over sessions. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions) + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.class, + com.google.bigtable.v2.LoadBalancingOptions.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (leastInFlightBuilder_ != null) { + leastInFlightBuilder_.clear(); + } + if (peakEwmaBuilder_ != null) { + peakEwmaBuilder_.clear(); + } + if (randomBuilder_ != null) { + randomBuilder_.clear(); + } + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions build() { + com.google.bigtable.v2.LoadBalancingOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions result = + new com.google.bigtable.v2.LoadBalancingOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.LoadBalancingOptions result) { + result.loadBalancingStrategyCase_ = loadBalancingStrategyCase_; + result.loadBalancingStrategy_ = this.loadBalancingStrategy_; + if (loadBalancingStrategyCase_ == 1 && leastInFlightBuilder_ != null) { + result.loadBalancingStrategy_ = leastInFlightBuilder_.build(); + } + if (loadBalancingStrategyCase_ == 2 && peakEwmaBuilder_ != null) { + result.loadBalancingStrategy_ = peakEwmaBuilder_.build(); + } + if (loadBalancingStrategyCase_ == 4 && randomBuilder_ != null) { + result.loadBalancingStrategy_ = randomBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) return this; + switch (other.getLoadBalancingStrategyCase()) { + case LEAST_IN_FLIGHT: + { + mergeLeastInFlight(other.getLeastInFlight()); + break; + } + case PEAK_EWMA: + { + mergePeakEwma(other.getPeakEwma()); + break; + } + case RANDOM: + { + mergeRandom(other.getRandom()); + break; + } + case LOADBALANCINGSTRATEGY_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetLeastInFlightFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetPeakEwmaFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 2; + break; + } // case 18 + case 34: + { + input.readMessage(internalGetRandomFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int loadBalancingStrategyCase_ = 0; + private java.lang.Object loadBalancingStrategy_; + + public LoadBalancingStrategyCase getLoadBalancingStrategyCase() { + return LoadBalancingStrategyCase.forNumber(loadBalancingStrategyCase_); + } + + public Builder clearLoadBalancingStrategy() { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder> + leastInFlightBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + @java.lang.Override + public boolean hasLeastInFlight() { + return loadBalancingStrategyCase_ == 1; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight() { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 1) { + return leastInFlightBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder setLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight value) { + if (leastInFlightBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + leastInFlightBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder setLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder builderForValue) { + if (leastInFlightBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + leastInFlightBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder mergeLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight value) { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 1) { + leastInFlightBuilder_.mergeFrom(value); + } else { + leastInFlightBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder clearLeastInFlight() { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 1) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + leastInFlightBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder + getLeastInFlightBuilder() { + return internalGetLeastInFlightFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder + getLeastInFlightOrBuilder() { + if ((loadBalancingStrategyCase_ == 1) && (leastInFlightBuilder_ != null)) { + return leastInFlightBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder> + internalGetLeastInFlightFieldBuilder() { + if (leastInFlightBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 1)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + leastInFlightBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 1; + onChanged(); + return leastInFlightBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder> + peakEwmaBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + @java.lang.Override + public boolean hasPeakEwma() { + return loadBalancingStrategyCase_ == 2; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma() { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 2) { + return peakEwmaBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder setPeakEwma(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma value) { + if (peakEwmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + peakEwmaBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder setPeakEwma( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder builderForValue) { + if (peakEwmaBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + peakEwmaBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder mergePeakEwma(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma value) { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 2) { + peakEwmaBuilder_.mergeFrom(value); + } else { + peakEwmaBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder clearPeakEwma() { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 2) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + peakEwmaBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder getPeakEwmaBuilder() { + return internalGetPeakEwmaFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder() { + if ((loadBalancingStrategyCase_ == 2) && (peakEwmaBuilder_ != null)) { + return peakEwmaBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder> + internalGetPeakEwmaFieldBuilder() { + if (peakEwmaBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 2)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + peakEwmaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 2; + onChanged(); + return peakEwmaBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder> + randomBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + @java.lang.Override + public boolean hasRandom() { + return loadBalancingStrategyCase_ == 4; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getRandom() { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 4) { + return randomBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder setRandom(com.google.bigtable.v2.LoadBalancingOptions.Random value) { + if (randomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + randomBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder setRandom( + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder builderForValue) { + if (randomBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + randomBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder mergeRandom(com.google.bigtable.v2.LoadBalancingOptions.Random value) { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.Random.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 4) { + randomBuilder_.mergeFrom(value); + } else { + randomBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder clearRandom() { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 4) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + randomBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public com.google.bigtable.v2.LoadBalancingOptions.Random.Builder getRandomBuilder() { + return internalGetRandomFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder() { + if ((loadBalancingStrategyCase_ == 4) && (randomBuilder_ != null)) { + return randomBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder> + internalGetRandomFieldBuilder() { + if (randomBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 4)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + randomBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 4; + onChanged(); + return randomBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions) + private static final com.google.bigtable.v2.LoadBalancingOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LoadBalancingOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LoadBalancingOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java new file mode 100644 index 000000000000..5d2b6f2fa4a5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface LoadBalancingOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + boolean hasLeastInFlight(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight(); + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder getLeastInFlightOrBuilder(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + boolean hasPeakEwma(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma(); + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + boolean hasRandom(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + com.google.bigtable.v2.LoadBalancingOptions.Random getRandom(); + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder(); + + com.google.bigtable.v2.LoadBalancingOptions.LoadBalancingStrategyCase + getLoadBalancingStrategyCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewName.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewName.java new file mode 100644 index 000000000000..a1e665074ada --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2026 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 MaterializedViewName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_MATERIALIZED_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/materializedViews/{materialized_view}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String materializedView; + + @Deprecated + protected MaterializedViewName() { + project = null; + instance = null; + materializedView = null; + } + + private MaterializedViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + materializedView = Preconditions.checkNotNull(builder.getMaterializedView()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getMaterializedView() { + return materializedView; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static MaterializedViewName of(String project, String instance, String materializedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setMaterializedView(materializedView) + .build(); + } + + public static String format(String project, String instance, String materializedView) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setMaterializedView(materializedView) + .build() + .toString(); + } + + public static MaterializedViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_MATERIALIZED_VIEW.validatedMatch( + formattedString, "MaterializedViewName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("materialized_view")); + } + + 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 (MaterializedViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_MATERIALIZED_VIEW.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); + } + if (materializedView != null) { + fieldMapBuilder.put("materialized_view", materializedView); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_MATERIALIZED_VIEW.instantiate( + "project", project, "instance", instance, "materialized_view", materializedView); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + MaterializedViewName that = ((MaterializedViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.materializedView, that.materializedView); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(materializedView); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/materializedViews/{materialized_view}. */ + public static class Builder { + private String project; + private String instance; + private String materializedView; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getMaterializedView() { + return materializedView; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setMaterializedView(String materializedView) { + this.materializedView = materializedView; + return this; + } + + private Builder(MaterializedViewName materializedViewName) { + this.project = materializedViewName.project; + this.instance = materializedViewName.instance; + this.materializedView = materializedViewName.materializedView; + } + + public MaterializedViewName build() { + return new MaterializedViewName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java new file mode 100644 index 000000000000..af602741d475 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java @@ -0,0 +1,705 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A request wrapper for operations on a materialized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class MaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MaterializedViewRequest) + MaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaterializedViewRequest"); + } + + // Use MaterializedViewRequest.newBuilder() to construct. + private MaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaterializedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewRequest.class, + com.google.bigtable.v2.MaterializedViewRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + size += getUnknownFields().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.MaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.MaterializedViewRequest other = + (com.google.bigtable.v2.MaterializedViewRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest 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.MaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest 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.MaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request wrapper for operations on a materialized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MaterializedViewRequest) + com.google.bigtable.v2.MaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewRequest.class, + com.google.bigtable.v2.MaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.MaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.MaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest build() { + com.google.bigtable.v2.MaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest buildPartial() { + com.google.bigtable.v2.MaterializedViewRequest result = + new com.google.bigtable.v2.MaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.MaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.MaterializedViewRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MaterializedViewRequest) { + return mergeFrom((com.google.bigtable.v2.MaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MaterializedViewRequest other) { + if (other == com.google.bigtable.v2.MaterializedViewRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MaterializedViewRequest) + private static final com.google.bigtable.v2.MaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MaterializedViewRequest(); + } + + public static com.google.bigtable.v2.MaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..09d0c7e81d2a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + com.google.bigtable.v2.MaterializedViewRequest.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java new file mode 100644 index 000000000000..8bfc871eaf41 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java @@ -0,0 +1,708 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A response wrapper for operations on a materialized view. Internal usage
+ * only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewResponse} + */ +@com.google.protobuf.Generated +public final class MaterializedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MaterializedViewResponse) + MaterializedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaterializedViewResponse"); + } + + // Use MaterializedViewResponse.newBuilder() to construct. + private MaterializedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaterializedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewResponse.class, + com.google.bigtable.v2.MaterializedViewResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + size += getUnknownFields().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.MaterializedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.MaterializedViewResponse other = + (com.google.bigtable.v2.MaterializedViewResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse 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.MaterializedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse 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.MaterializedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MaterializedViewResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A response wrapper for operations on a materialized view. Internal usage
+   * only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MaterializedViewResponse) + com.google.bigtable.v2.MaterializedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewResponse.class, + com.google.bigtable.v2.MaterializedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.MaterializedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.MaterializedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse build() { + com.google.bigtable.v2.MaterializedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse buildPartial() { + com.google.bigtable.v2.MaterializedViewResponse result = + new com.google.bigtable.v2.MaterializedViewResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.MaterializedViewResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.MaterializedViewResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MaterializedViewResponse) { + return mergeFrom((com.google.bigtable.v2.MaterializedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MaterializedViewResponse other) { + if (other == com.google.bigtable.v2.MaterializedViewResponse.getDefaultInstance()) + return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MaterializedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MaterializedViewResponse) + private static final com.google.bigtable.v2.MaterializedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MaterializedViewResponse(); + } + + public static com.google.bigtable.v2.MaterializedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaterializedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MaterializedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java new file mode 100644 index 000000000000..ab9241e6de6b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MaterializedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MaterializedViewResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + com.google.bigtable.v2.MaterializedViewResponse.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java new file mode 100644 index 000000000000..ff0558b23842 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java @@ -0,0 +1,2073 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.MutateRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowRequest} + */ +@com.google.protobuf.Generated +public final class MutateRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowRequest) + MutateRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutateRowRequest"); + } + + // Use MutateRowRequest.newBuilder() to construct. + private MutateRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MutateRowRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + mutations_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowRequest.class, + com.google.bigtable.v2.MutateRowRequest.Builder.class); + } + + private int bitField0_; + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutation should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutation should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + 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 = 4; + * + * @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 = 4; + * + * @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; + } + } + + public static final int ROW_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. The key of the row to which the mutation should be applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int MUTATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List mutations_; + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getMutationsList() { + return mutations_; + } + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getMutationsOrBuilderList() { + return mutations_; + } + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getMutationsCount() { + return mutations_.size(); + } + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getMutations(int index) { + return mutations_.get(index); + } + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + return mutations_.get(index); + } + + public static final int IDEMPOTENCY_FIELD_NUMBER = 8; + private com.google.bigtable.v2.Idempotency idempotency_; + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return Whether the idempotency field is set. + */ + @java.lang.Override + public boolean hasIdempotency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return The idempotency. + */ + @java.lang.Override + public com.google.bigtable.v2.Idempotency getIdempotency() { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + @java.lang.Override + public com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder() { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!rowKey_.isEmpty()) { + output.writeBytes(2, rowKey_); + } + for (int i = 0; i < mutations_.size(); i++) { + output.writeMessage(3, mutations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, authorizedViewName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getIdempotency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, rowKey_); + } + for (int i = 0; i < mutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, mutations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, authorizedViewName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getIdempotency()); + } + size += getUnknownFields().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.MutateRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowRequest other = (com.google.bigtable.v2.MutateRowRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getRowKey().equals(other.getRowKey())) return false; + if (!getMutationsList().equals(other.getMutationsList())) return false; + if (hasIdempotency() != other.hasIdempotency()) return false; + if (hasIdempotency()) { + if (!getIdempotency().equals(other.getIdempotency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (getMutationsCount() > 0) { + hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getMutationsList().hashCode(); + } + if (hasIdempotency()) { + hash = (37 * hash) + IDEMPOTENCY_FIELD_NUMBER; + hash = (53 * hash) + getIdempotency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowRequest 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.MutateRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowRequest 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.MutateRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.MutateRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowRequest) + com.google.bigtable.v2.MutateRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowRequest.class, + com.google.bigtable.v2.MutateRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMutationsFieldBuilder(); + internalGetIdempotencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + } else { + mutations_ = null; + mutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowRequest build() { + com.google.bigtable.v2.MutateRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowRequest buildPartial() { + com.google.bigtable.v2.MutateRowRequest result = + new com.google.bigtable.v2.MutateRowRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.MutateRowRequest result) { + if (mutationsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + mutations_ = java.util.Collections.unmodifiableList(mutations_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.mutations_ = mutations_; + } else { + result.mutations_ = mutationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rowKey_ = rowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.idempotency_ = + idempotencyBuilder_ == null ? idempotency_ : idempotencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowRequest) { + return mergeFrom((com.google.bigtable.v2.MutateRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { + if (other == com.google.bigtable.v2.MutateRowRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (mutationsBuilder_ == null) { + if (!other.mutations_.isEmpty()) { + if (mutations_.isEmpty()) { + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureMutationsIsMutable(); + mutations_.addAll(other.mutations_); + } + onChanged(); + } + } else { + if (!other.mutations_.isEmpty()) { + if (mutationsBuilder_.isEmpty()) { + mutationsBuilder_.dispose(); + mutationsBuilder_ = null; + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000010); + mutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() + : null; + } else { + mutationsBuilder_.addAllMessages(other.mutations_); + } + } + } + if (other.hasIdempotency()) { + mergeIdempotency(other.getIdempotency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + com.google.bigtable.v2.Mutation m = + input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(m); + } else { + mutationsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 50: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 66: + { + input.readMessage( + internalGetIdempotencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutation should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutation should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutation should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutation should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutation should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutation
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + 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 = 4; + * + * @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 = 4; + * + * @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 = 4; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 4; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. The key of the row to which the mutation should be applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+     * Required. The key of the row to which the mutation should be applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The key of the row to which the mutation should be applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000008); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private java.util.List mutations_ = + java.util.Collections.emptyList(); + + private void ensureMutationsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + mutations_ = new java.util.ArrayList(mutations_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + mutationsBuilder_; + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getMutationsList() { + if (mutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mutations_); + } else { + return mutationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getMutationsCount() { + if (mutationsBuilder_ == null) { + return mutations_.size(); + } else { + return mutationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation getMutations(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.set(index, value); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.set(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(value); + onChanged(); + } else { + mutationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(index, value); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllMutations( + java.lang.Iterable values) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutations_); + onChanged(); + } else { + mutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMutations() { + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + mutationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeMutations(int index) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.remove(index); + onChanged(); + } else { + mutationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getMutationsOrBuilderList() { + if (mutationsBuilder_ != null) { + return mutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mutations_); + } + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { + return internalGetMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row. Entries
+     * are applied in order, meaning that earlier mutations can be masked by later
+     * ones. Must contain at least one entry and at most 100000.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getMutationsBuilderList() { + return internalGetMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetMutationsFieldBuilder() { + if (mutationsBuilder_ == null) { + mutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + mutations_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + mutations_ = null; + } + return mutationsBuilder_; + } + + private com.google.bigtable.v2.Idempotency idempotency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder> + idempotencyBuilder_; + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return Whether the idempotency field is set. + */ + public boolean hasIdempotency() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return The idempotency. + */ + public com.google.bigtable.v2.Idempotency getIdempotency() { + if (idempotencyBuilder_ == null) { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } else { + return idempotencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public Builder setIdempotency(com.google.bigtable.v2.Idempotency value) { + if (idempotencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + idempotency_ = value; + } else { + idempotencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public Builder setIdempotency(com.google.bigtable.v2.Idempotency.Builder builderForValue) { + if (idempotencyBuilder_ == null) { + idempotency_ = builderForValue.build(); + } else { + idempotencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public Builder mergeIdempotency(com.google.bigtable.v2.Idempotency value) { + if (idempotencyBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && idempotency_ != null + && idempotency_ != com.google.bigtable.v2.Idempotency.getDefaultInstance()) { + getIdempotencyBuilder().mergeFrom(value); + } else { + idempotency_ = value; + } + } else { + idempotencyBuilder_.mergeFrom(value); + } + if (idempotency_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public Builder clearIdempotency() { + bitField0_ = (bitField0_ & ~0x00000020); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public com.google.bigtable.v2.Idempotency.Builder getIdempotencyBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetIdempotencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + public com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder() { + if (idempotencyBuilder_ != null) { + return idempotencyBuilder_.getMessageOrBuilder(); + } else { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder> + internalGetIdempotencyFieldBuilder() { + if (idempotencyBuilder_ == null) { + idempotencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder>( + getIdempotency(), getParentForChildren(), isClean()); + idempotency_ = null; + } + return idempotencyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowRequest) + private static final com.google.bigtable.v2.MutateRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowRequest(); + } + + public static com.google.bigtable.v2.MutateRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java new file mode 100644 index 000000000000..653a6fb7e759 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java @@ -0,0 +1,260 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MutateRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutation should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutation should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutation
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 4; + * + * @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 = 4; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The key of the row to which the mutation should be applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getMutationsList(); + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.Mutation getMutations(int index); + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getMutationsCount(); + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getMutationsOrBuilderList(); + + /** + * + * + *
+   * Required. Changes to be atomically applied to the specified row. Entries
+   * are applied in order, meaning that earlier mutations can be masked by later
+   * ones. Must contain at least one entry and at most 100000.
+   * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index); + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return Whether the idempotency field is set. + */ + boolean hasIdempotency(); + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + * + * @return The idempotency. + */ + com.google.bigtable.v2.Idempotency getIdempotency(); + + /** + * + * + *
+   * If set consistently across retries, prevents this mutation from being
+   * double applied to aggregate column families within a 15m window.
+   * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 8; + */ + com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java new file mode 100644 index 000000000000..8abbb588599f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.MutateRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowResponse} + */ +@com.google.protobuf.Generated +public final class MutateRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowResponse) + MutateRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutateRowResponse"); + } + + // Use MutateRowResponse.newBuilder() to construct. + private MutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MutateRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowResponse.class, + com.google.bigtable.v2.MutateRowResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.MutateRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowResponse other = (com.google.bigtable.v2.MutateRowResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowResponse 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.MutateRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowResponse 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.MutateRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.MutateRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowResponse) + com.google.bigtable.v2.MutateRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowResponse.class, + com.google.bigtable.v2.MutateRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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_MutateRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowResponse build() { + com.google.bigtable.v2.MutateRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowResponse buildPartial() { + com.google.bigtable.v2.MutateRowResponse result = + new com.google.bigtable.v2.MutateRowResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowResponse) { + return mergeFrom((com.google.bigtable.v2.MutateRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowResponse other) { + if (other == com.google.bigtable.v2.MutateRowResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowResponse) + private static final com.google.bigtable.v2.MutateRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowResponse(); + } + + public static com.google.bigtable.v2.MutateRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java new file mode 100644 index 000000000000..099ede364897 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MutateRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java new file mode 100644 index 000000000000..3c4a869639d6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java @@ -0,0 +1,3249 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for BigtableService.MutateRows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsRequest} + */ +@com.google.protobuf.Generated +public final class MutateRowsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowsRequest) + MutateRowsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutateRowsRequest"); + } + + // Use MutateRowsRequest.newBuilder() to construct. + private MutateRowsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MutateRowsRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + entries_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsRequest.class, + com.google.bigtable.v2.MutateRowsRequest.Builder.class); + } + + public interface EntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowsRequest.Entry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key of the row to which the `mutations` should be applied.
+     * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getMutationsList(); + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.Mutation getMutations(int index); + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getMutationsCount(); + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getMutationsOrBuilderList(); + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index); + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return Whether the idempotency field is set. + */ + boolean hasIdempotency(); + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return The idempotency. + */ + com.google.bigtable.v2.Idempotency getIdempotency(); + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder(); + } + + /** + * + * + *
+   * A mutation for a given row.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsRequest.Entry} + */ + public static final class Entry extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowsRequest.Entry) + EntryOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Entry"); + } + + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Entry() { + rowKey_ = com.google.protobuf.ByteString.EMPTY; + mutations_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsRequest.Entry.class, + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder.class); + } + + private int bitField0_; + public static final int ROW_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The key of the row to which the `mutations` should be applied.
+     * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int MUTATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List mutations_; + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getMutationsList() { + return mutations_; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getMutationsOrBuilderList() { + return mutations_; + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getMutationsCount() { + return mutations_.size(); + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getMutations(int index) { + return mutations_.get(index); + } + + /** + * + * + *
+     * Required. Changes to be atomically applied to the specified row.
+     * Mutations are applied in order, meaning that earlier mutations can be
+     * masked by later ones. You must specify at least one mutation.
+     * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + return mutations_.get(index); + } + + public static final int IDEMPOTENCY_FIELD_NUMBER = 3; + private com.google.bigtable.v2.Idempotency idempotency_; + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return Whether the idempotency field is set. + */ + @java.lang.Override + public boolean hasIdempotency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return The idempotency. + */ + @java.lang.Override + public com.google.bigtable.v2.Idempotency getIdempotency() { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + + /** + * + * + *
+     * If set consistently across retries, prevents this mutation from being
+     * double applied to aggregate column families within a 15m window.
+     * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder() { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + + 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 (!rowKey_.isEmpty()) { + output.writeBytes(1, rowKey_); + } + for (int i = 0; i < mutations_.size(); i++) { + output.writeMessage(2, mutations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getIdempotency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, rowKey_); + } + for (int i = 0; i < mutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, mutations_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIdempotency()); + } + size += getUnknownFields().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.MutateRowsRequest.Entry)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowsRequest.Entry other = + (com.google.bigtable.v2.MutateRowsRequest.Entry) obj; + + if (!getRowKey().equals(other.getRowKey())) return false; + if (!getMutationsList().equals(other.getMutationsList())) return false; + if (hasIdempotency() != other.hasIdempotency()) return false; + if (hasIdempotency()) { + if (!getIdempotency().equals(other.getIdempotency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (getMutationsCount() > 0) { + hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getMutationsList().hashCode(); + } + if (hasIdempotency()) { + hash = (37 * hash) + IDEMPOTENCY_FIELD_NUMBER; + hash = (53 * hash) + getIdempotency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry 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.MutateRowsRequest.Entry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry 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.MutateRowsRequest.Entry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowsRequest.Entry 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A mutation for a given row.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsRequest.Entry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowsRequest.Entry) + com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsRequest.Entry.class, + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowsRequest.Entry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMutationsFieldBuilder(); + internalGetIdempotencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + } else { + mutations_ = null; + mutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest.Entry getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest.Entry build() { + com.google.bigtable.v2.MutateRowsRequest.Entry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest.Entry buildPartial() { + com.google.bigtable.v2.MutateRowsRequest.Entry result = + new com.google.bigtable.v2.MutateRowsRequest.Entry(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.MutateRowsRequest.Entry result) { + if (mutationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + mutations_ = java.util.Collections.unmodifiableList(mutations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.mutations_ = mutations_; + } else { + result.mutations_ = mutationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowsRequest.Entry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.idempotency_ = + idempotencyBuilder_ == null ? idempotency_ : idempotencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowsRequest.Entry) { + return mergeFrom((com.google.bigtable.v2.MutateRowsRequest.Entry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest.Entry other) { + if (other == com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()) + return this; + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (mutationsBuilder_ == null) { + if (!other.mutations_.isEmpty()) { + if (mutations_.isEmpty()) { + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMutationsIsMutable(); + mutations_.addAll(other.mutations_); + } + onChanged(); + } + } else { + if (!other.mutations_.isEmpty()) { + if (mutationsBuilder_.isEmpty()) { + mutationsBuilder_.dispose(); + mutationsBuilder_ = null; + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + mutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() + : null; + } else { + mutationsBuilder_.addAllMessages(other.mutations_); + } + } + } + if (other.hasIdempotency()) { + mergeIdempotency(other.getIdempotency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Mutation m = + input.readMessage( + com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(m); + } else { + mutationsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetIdempotencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The key of the row to which the `mutations` should be applied.
+       * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+       * The key of the row to which the `mutations` should be applied.
+       * 
+ * + * bytes row_key = 1; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The key of the row to which the `mutations` should be applied.
+       * 
+ * + * bytes row_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000001); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private java.util.List mutations_ = + java.util.Collections.emptyList(); + + private void ensureMutationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + mutations_ = new java.util.ArrayList(mutations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + mutationsBuilder_; + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getMutationsList() { + if (mutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mutations_); + } else { + return mutationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getMutationsCount() { + if (mutationsBuilder_ == null) { + return mutations_.size(); + } else { + return mutationsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation getMutations(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.set(index, value); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.set(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(value); + onChanged(); + } else { + mutationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(index, value); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllMutations( + java.lang.Iterable values) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutations_); + onChanged(); + } else { + mutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMutations() { + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + mutationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeMutations(int index) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.remove(index); + onChanged(); + } else { + mutationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getMutationsOrBuilderList() { + if (mutationsBuilder_ != null) { + return mutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mutations_); + } + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { + return internalGetMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** + * + * + *
+       * Required. Changes to be atomically applied to the specified row.
+       * Mutations are applied in order, meaning that earlier mutations can be
+       * masked by later ones. You must specify at least one mutation.
+       * 
+ * + * + * repeated .google.bigtable.v2.Mutation mutations = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getMutationsBuilderList() { + return internalGetMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetMutationsFieldBuilder() { + if (mutationsBuilder_ == null) { + mutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + mutations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + mutations_ = null; + } + return mutationsBuilder_; + } + + private com.google.bigtable.v2.Idempotency idempotency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder> + idempotencyBuilder_; + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return Whether the idempotency field is set. + */ + public boolean hasIdempotency() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + * + * @return The idempotency. + */ + public com.google.bigtable.v2.Idempotency getIdempotency() { + if (idempotencyBuilder_ == null) { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } else { + return idempotencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public Builder setIdempotency(com.google.bigtable.v2.Idempotency value) { + if (idempotencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + idempotency_ = value; + } else { + idempotencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public Builder setIdempotency(com.google.bigtable.v2.Idempotency.Builder builderForValue) { + if (idempotencyBuilder_ == null) { + idempotency_ = builderForValue.build(); + } else { + idempotencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public Builder mergeIdempotency(com.google.bigtable.v2.Idempotency value) { + if (idempotencyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && idempotency_ != null + && idempotency_ != com.google.bigtable.v2.Idempotency.getDefaultInstance()) { + getIdempotencyBuilder().mergeFrom(value); + } else { + idempotency_ = value; + } + } else { + idempotencyBuilder_.mergeFrom(value); + } + if (idempotency_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public Builder clearIdempotency() { + bitField0_ = (bitField0_ & ~0x00000004); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public com.google.bigtable.v2.Idempotency.Builder getIdempotencyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetIdempotencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + public com.google.bigtable.v2.IdempotencyOrBuilder getIdempotencyOrBuilder() { + if (idempotencyBuilder_ != null) { + return idempotencyBuilder_.getMessageOrBuilder(); + } else { + return idempotency_ == null + ? com.google.bigtable.v2.Idempotency.getDefaultInstance() + : idempotency_; + } + } + + /** + * + * + *
+       * If set consistently across retries, prevents this mutation from being
+       * double applied to aggregate column families within a 15m window.
+       * 
+ * + * .google.bigtable.v2.Idempotency idempotency = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder> + internalGetIdempotencyFieldBuilder() { + if (idempotencyBuilder_ == null) { + idempotencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Idempotency, + com.google.bigtable.v2.Idempotency.Builder, + com.google.bigtable.v2.IdempotencyOrBuilder>( + getIdempotency(), getParentForChildren(), isClean()); + idempotency_ = null; + } + return idempotencyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsRequest.Entry) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowsRequest.Entry) + private static final com.google.bigtable.v2.MutateRowsRequest.Entry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowsRequest.Entry(); + } + + public static com.google.bigtable.v2.MutateRowsRequest.Entry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowsRequest.Entry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutations should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutations should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutations
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutations
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + 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 = 3; + * + * @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 = 3; + * + * @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; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List entries_; + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index) { + return entries_.get(index); + } + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuilder(int index) { + return entries_.get(index); + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(2, entries_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, authorizedViewName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, entries_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, authorizedViewName_); + } + size += getUnknownFields().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.MutateRowsRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowsRequest other = (com.google.bigtable.v2.MutateRowsRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest 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.MutateRowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest 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.MutateRowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for BigtableService.MutateRows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowsRequest) + com.google.bigtable.v2.MutateRowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsRequest.class, + com.google.bigtable.v2.MutateRowsRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest build() { + com.google.bigtable.v2.MutateRowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsRequest buildPartial() { + com.google.bigtable.v2.MutateRowsRequest result = + new com.google.bigtable.v2.MutateRowsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.MutateRowsRequest result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowsRequest) { + return mergeFrom((com.google.bigtable.v2.MutateRowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest other) { + if (other == com.google.bigtable.v2.MutateRowsRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + entriesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.MutateRowsRequest.Entry m = + input.readMessage( + com.google.bigtable.v2.MutateRowsRequest.Entry.parser(), extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutations should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutations should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutations should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutations should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the mutations should be
+     * applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutations
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutations
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutations
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutations
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the mutations
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + 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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 3; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + entries_ = + new java.util.ArrayList(entries_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsRequest.Entry, + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder, + com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntries(int index, com.google.bigtable.v2.MutateRowsRequest.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntries( + int index, com.google.bigtable.v2.MutateRowsRequest.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(com.google.bigtable.v2.MutateRowsRequest.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(int index, com.google.bigtable.v2.MutateRowsRequest.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries( + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries( + int index, com.google.bigtable.v2.MutateRowsRequest.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder getEntriesBuilder(int index) { + return internalGetEntriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuilder(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder() { + return internalGetEntriesFieldBuilder() + .addBuilder(com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder(int index) { + return internalGetEntriesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. The row keys and corresponding mutations to be applied in bulk.
+     * Each entry is applied as an atomic mutation, but the entries may be
+     * applied in arbitrary order (even between entries for the same row).
+     * At least one entry must be specified, and in total the entries can
+     * contain at most 100000 mutations.
+     * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getEntriesBuilderList() { + return internalGetEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsRequest.Entry, + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder, + com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder> + internalGetEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsRequest.Entry, + com.google.bigtable.v2.MutateRowsRequest.Entry.Builder, + com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder>( + entries_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowsRequest) + private static final com.google.bigtable.v2.MutateRowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowsRequest(); + } + + public static com.google.bigtable.v2.MutateRowsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateRowsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java new file mode 100644 index 000000000000..2bf701791c36 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MutateRowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutations should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table to which the mutations should be
+   * applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutations
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the mutations
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 3; + * + * @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 = 3; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getEntriesList(); + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index); + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getEntriesCount(); + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getEntriesOrBuilderList(); + + /** + * + * + *
+   * Required. The row keys and corresponding mutations to be applied in bulk.
+   * Each entry is applied as an atomic mutation, but the entries may be
+   * applied in arbitrary order (even between entries for the same row).
+   * At least one entry must be specified, and in total the entries can
+   * contain at most 100000 mutations.
+   * 
+ * + * + * repeated .google.bigtable.v2.MutateRowsRequest.Entry entries = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java new file mode 100644 index 000000000000..2a664cc9c9de --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java @@ -0,0 +1,2108 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for BigtableService.MutateRows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsResponse} + */ +@com.google.protobuf.Generated +public final class MutateRowsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowsResponse) + MutateRowsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutateRowsResponse"); + } + + // Use MutateRowsResponse.newBuilder() to construct. + private MutateRowsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MutateRowsResponse() { + entries_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsResponse.class, + com.google.bigtable.v2.MutateRowsResponse.Builder.class); + } + + public interface EntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowsResponse.Entry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The index into the original request's `entries` list of the Entry
+     * for which a result is being reported.
+     * 
+ * + * int64 index = 1; + * + * @return The index. + */ + long getIndex(); + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
+   * The result of applying a passed mutation in the original request.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsResponse.Entry} + */ + public static final class Entry extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MutateRowsResponse.Entry) + EntryOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Entry"); + } + + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Entry() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsResponse.Entry.class, + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder.class); + } + + private int bitField0_; + public static final int INDEX_FIELD_NUMBER = 1; + private long index_ = 0L; + + /** + * + * + *
+     * The index into the original request's `entries` list of the Entry
+     * for which a result is being reported.
+     * 
+ * + * int64 index = 1; + * + * @return The index. + */ + @java.lang.Override + public long getIndex() { + return index_; + } + + public static final int STATUS_FIELD_NUMBER = 2; + private com.google.rpc.Status status_; + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+     * The result of the request Entry identified by `index`.
+     * Depending on how requests are batched during execution, it is possible
+     * for one Entry to fail due to an error with another Entry. In the event
+     * that this occurs, the same error will be reported for both entries.
+     * 
+ * + * .google.rpc.Status status = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (index_ != 0L) { + output.writeInt64(1, index_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (index_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, index_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); + } + size += getUnknownFields().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.MutateRowsResponse.Entry)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowsResponse.Entry other = + (com.google.bigtable.v2.MutateRowsResponse.Entry) obj; + + if (getIndex() != other.getIndex()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIndex()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry 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.MutateRowsResponse.Entry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry 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.MutateRowsResponse.Entry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowsResponse.Entry 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * The result of applying a passed mutation in the original request.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsResponse.Entry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowsResponse.Entry) + com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsResponse.Entry.class, + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowsResponse.Entry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + index_ = 0L; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse.Entry getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse.Entry build() { + com.google.bigtable.v2.MutateRowsResponse.Entry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse.Entry buildPartial() { + com.google.bigtable.v2.MutateRowsResponse.Entry result = + new com.google.bigtable.v2.MutateRowsResponse.Entry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowsResponse.Entry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.index_ = index_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowsResponse.Entry) { + return mergeFrom((com.google.bigtable.v2.MutateRowsResponse.Entry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowsResponse.Entry other) { + if (other == com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance()) + return this; + if (other.getIndex() != 0L) { + setIndex(other.getIndex()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + index_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long index_; + + /** + * + * + *
+       * The index into the original request's `entries` list of the Entry
+       * for which a result is being reported.
+       * 
+ * + * int64 index = 1; + * + * @return The index. + */ + @java.lang.Override + public long getIndex() { + return index_; + } + + /** + * + * + *
+       * The index into the original request's `entries` list of the Entry
+       * for which a result is being reported.
+       * 
+ * + * int64 index = 1; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(long value) { + + index_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The index into the original request's `entries` list of the Entry
+       * for which a result is being reported.
+       * 
+ * + * int64 index = 1; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + index_ = 0L; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+       * The result of the request Entry identified by `index`.
+       * Depending on how requests are batched during execution, it is possible
+       * for one Entry to fail due to an error with another Entry. In the event
+       * that this occurs, the same error will be reported for both entries.
+       * 
+ * + * .google.rpc.Status status = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsResponse.Entry) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowsResponse.Entry) + private static final com.google.bigtable.v2.MutateRowsResponse.Entry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowsResponse.Entry(); + } + + public static com.google.bigtable.v2.MutateRowsResponse.Entry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowsResponse.Entry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENTRIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List entries_; + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index) { + return entries_.get(index); + } + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuilder(int index) { + return entries_.get(index); + } + + public static final int RATE_LIMIT_INFO_FIELD_NUMBER = 3; + private com.google.bigtable.v2.RateLimitInfo rateLimitInfo_; + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return Whether the rateLimitInfo field is set. + */ + @java.lang.Override + public boolean hasRateLimitInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return The rateLimitInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.RateLimitInfo getRateLimitInfo() { + return rateLimitInfo_ == null + ? com.google.bigtable.v2.RateLimitInfo.getDefaultInstance() + : rateLimitInfo_; + } + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RateLimitInfoOrBuilder getRateLimitInfoOrBuilder() { + return rateLimitInfo_ == null + ? com.google.bigtable.v2.RateLimitInfo.getDefaultInstance() + : rateLimitInfo_; + } + + 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 { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRateLimitInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRateLimitInfo()); + } + size += getUnknownFields().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.MutateRowsResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.MutateRowsResponse other = + (com.google.bigtable.v2.MutateRowsResponse) obj; + + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (hasRateLimitInfo() != other.hasRateLimitInfo()) return false; + if (hasRateLimitInfo()) { + if (!getRateLimitInfo().equals(other.getRateLimitInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + if (hasRateLimitInfo()) { + hash = (37 * hash) + RATE_LIMIT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRateLimitInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse 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.MutateRowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse 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.MutateRowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MutateRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.MutateRowsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for BigtableService.MutateRows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MutateRowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MutateRowsResponse) + com.google.bigtable.v2.MutateRowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MutateRowsResponse.class, + com.google.bigtable.v2.MutateRowsResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.MutateRowsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEntriesFieldBuilder(); + internalGetRateLimitInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + rateLimitInfo_ = null; + if (rateLimitInfoBuilder_ != null) { + rateLimitInfoBuilder_.dispose(); + rateLimitInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_MutateRowsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.MutateRowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse build() { + com.google.bigtable.v2.MutateRowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MutateRowsResponse buildPartial() { + com.google.bigtable.v2.MutateRowsResponse result = + new com.google.bigtable.v2.MutateRowsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.MutateRowsResponse result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rateLimitInfo_ = + rateLimitInfoBuilder_ == null ? rateLimitInfo_ : rateLimitInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MutateRowsResponse) { + return mergeFrom((com.google.bigtable.v2.MutateRowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MutateRowsResponse other) { + if (other == com.google.bigtable.v2.MutateRowsResponse.getDefaultInstance()) return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (other.hasRateLimitInfo()) { + mergeRateLimitInfo(other.getRateLimitInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.MutateRowsResponse.Entry m = + input.readMessage( + com.google.bigtable.v2.MutateRowsResponse.Entry.parser(), + extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: + { + input.readMessage( + internalGetRateLimitInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = + new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsResponse.Entry, + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, + com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder setEntries(int index, com.google.bigtable.v2.MutateRowsResponse.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder setEntries( + int index, com.google.bigtable.v2.MutateRowsResponse.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder addEntries(com.google.bigtable.v2.MutateRowsResponse.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder addEntries(int index, com.google.bigtable.v2.MutateRowsResponse.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder addEntries( + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder addEntries( + int index, com.google.bigtable.v2.MutateRowsResponse.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder getEntriesBuilder(int index) { + return internalGetEntriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuilder(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder() { + return internalGetEntriesFieldBuilder() + .addBuilder(com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance()); + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder(int index) { + return internalGetEntriesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance()); + } + + /** + * + * + *
+     * One or more results for Entries from the batch request.
+     * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + public java.util.List + getEntriesBuilderList() { + return internalGetEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsResponse.Entry, + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, + com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder> + internalGetEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.MutateRowsResponse.Entry, + com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, + com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder>( + entries_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private com.google.bigtable.v2.RateLimitInfo rateLimitInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder> + rateLimitInfoBuilder_; + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return Whether the rateLimitInfo field is set. + */ + public boolean hasRateLimitInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return The rateLimitInfo. + */ + public com.google.bigtable.v2.RateLimitInfo getRateLimitInfo() { + if (rateLimitInfoBuilder_ == null) { + return rateLimitInfo_ == null + ? com.google.bigtable.v2.RateLimitInfo.getDefaultInstance() + : rateLimitInfo_; + } else { + return rateLimitInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder setRateLimitInfo(com.google.bigtable.v2.RateLimitInfo value) { + if (rateLimitInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rateLimitInfo_ = value; + } else { + rateLimitInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder setRateLimitInfo(com.google.bigtable.v2.RateLimitInfo.Builder builderForValue) { + if (rateLimitInfoBuilder_ == null) { + rateLimitInfo_ = builderForValue.build(); + } else { + rateLimitInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder mergeRateLimitInfo(com.google.bigtable.v2.RateLimitInfo value) { + if (rateLimitInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rateLimitInfo_ != null + && rateLimitInfo_ != com.google.bigtable.v2.RateLimitInfo.getDefaultInstance()) { + getRateLimitInfoBuilder().mergeFrom(value); + } else { + rateLimitInfo_ = value; + } + } else { + rateLimitInfoBuilder_.mergeFrom(value); + } + if (rateLimitInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder clearRateLimitInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + rateLimitInfo_ = null; + if (rateLimitInfoBuilder_ != null) { + rateLimitInfoBuilder_.dispose(); + rateLimitInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public com.google.bigtable.v2.RateLimitInfo.Builder getRateLimitInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetRateLimitInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public com.google.bigtable.v2.RateLimitInfoOrBuilder getRateLimitInfoOrBuilder() { + if (rateLimitInfoBuilder_ != null) { + return rateLimitInfoBuilder_.getMessageOrBuilder(); + } else { + return rateLimitInfo_ == null + ? com.google.bigtable.v2.RateLimitInfo.getDefaultInstance() + : rateLimitInfo_; + } + } + + /** + * + * + *
+     * Information about how client should limit the rate (QPS). Primirily used by
+     * supported official Cloud Bigtable clients. If unset, the rate limit info is
+     * not provided by the server.
+     * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder> + internalGetRateLimitInfoFieldBuilder() { + if (rateLimitInfoBuilder_ == null) { + rateLimitInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder>( + getRateLimitInfo(), getParentForChildren(), isClean()); + rateLimitInfo_ = null; + } + return rateLimitInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MutateRowsResponse) + private static final com.google.bigtable.v2.MutateRowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MutateRowsResponse(); + } + + public static com.google.bigtable.v2.MutateRowsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateRowsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MutateRowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java new file mode 100644 index 000000000000..1a984328322f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MutateRowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MutateRowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + java.util.List getEntriesList(); + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index); + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + int getEntriesCount(); + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + java.util.List + getEntriesOrBuilderList(); + + /** + * + * + *
+   * One or more results for Entries from the batch request.
+   * 
+ * + * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; + */ + com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuilder(int index); + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return Whether the rateLimitInfo field is set. + */ + boolean hasRateLimitInfo(); + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return The rateLimitInfo. + */ + com.google.bigtable.v2.RateLimitInfo getRateLimitInfo(); + + /** + * + * + *
+   * Information about how client should limit the rate (QPS). Primirily used by
+   * supported official Cloud Bigtable clients. If unset, the rate limit info is
+   * not provided by the server.
+   * 
+ * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + com.google.bigtable.v2.RateLimitInfoOrBuilder getRateLimitInfoOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java new file mode 100644 index 000000000000..9aff81a1324f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java @@ -0,0 +1,8626 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies a particular change to be made to the contents of a row.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation} + */ +@com.google.protobuf.Generated +public final class Mutation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation) + MutationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Mutation"); + } + + // Use Mutation.newBuilder() to construct. + private Mutation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Mutation() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Mutation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.class, com.google.bigtable.v2.Mutation.Builder.class); + } + + public interface SetCellOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.SetCell) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the family into which new data should be written.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+     * The name of the family into which new data should be written.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be written.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + com.google.protobuf.ByteString getColumnQualifier(); + + /** + * + * + *
+     * The timestamp of the cell into which new data should be written.
+     * Use -1 for current Bigtable server time.
+     * Otherwise, the client should set this value itself, noting that the
+     * default value is a timestamp of zero if the field is left unspecified.
+     * Values must match the granularity of the table (e.g. micros, millis).
+     * 
+ * + * int64 timestamp_micros = 3; + * + * @return The timestampMicros. + */ + long getTimestampMicros(); + + /** + * + * + *
+     * The value to be written into the specified cell.
+     * 
+ * + * bytes value = 4; + * + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + } + + /** + * + * + *
+   * A Mutation which sets the value of the specified cell.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.SetCell} + */ + public static final class SetCell extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.SetCell) + SetCellOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SetCell"); + } + + // Use SetCell.newBuilder() to construct. + private SetCell(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SetCell() { + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.SetCell.class, + com.google.bigtable.v2.Mutation.SetCell.Builder.class); + } + + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the family into which new data should be written.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the family into which new data should be written.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The qualifier of the column into which new data should be written.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 3; + private long timestampMicros_ = 0L; + + /** + * + * + *
+     * The timestamp of the cell into which new data should be written.
+     * Use -1 for current Bigtable server time.
+     * Otherwise, the client should set this value itself, noting that the
+     * default value is a timestamp of zero if the field is left unspecified.
+     * Values must match the granularity of the table (e.g. micros, millis).
+     * 
+ * + * int64 timestamp_micros = 3; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + public static final int VALUE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The value to be written into the specified cell.
+     * 
+ * + * bytes value = 4; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + output.writeBytes(2, columnQualifier_); + } + if (timestampMicros_ != 0L) { + output.writeInt64(3, timestampMicros_); + } + if (!value_.isEmpty()) { + output.writeBytes(4, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, columnQualifier_); + } + if (timestampMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, timestampMicros_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, value_); + } + size += getUnknownFields().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.Mutation.SetCell)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.SetCell other = (com.google.bigtable.v2.Mutation.SetCell) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; + if (getTimestampMicros() != other.getTimestampMicros()) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + hash = (37 * hash) + COLUMN_QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifier().hashCode(); + hash = (37 * hash) + TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestampMicros()); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.SetCell 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.Mutation.SetCell parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.SetCell 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.Mutation.SetCell parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.SetCell parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.SetCell 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which sets the value of the specified cell.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.SetCell} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.SetCell) + com.google.bigtable.v2.Mutation.SetCellOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.SetCell.class, + com.google.bigtable.v2.Mutation.SetCell.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.SetCell.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + timestampMicros_ = 0L; + value_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCell getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCell build() { + com.google.bigtable.v2.Mutation.SetCell result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCell buildPartial() { + com.google.bigtable.v2.Mutation.SetCell result = + new com.google.bigtable.v2.Mutation.SetCell(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation.SetCell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = columnQualifier_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestampMicros_ = timestampMicros_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.SetCell) { + return mergeFrom((com.google.bigtable.v2.Mutation.SetCell) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.SetCell other) { + if (other == com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance()) return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getColumnQualifier().isEmpty()) { + setColumnQualifier(other.getColumnQualifier()); + } + if (other.getTimestampMicros() != 0L) { + setTimestampMicros(other.getTimestampMicros()); + } + if (!other.getValue().isEmpty()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + columnQualifier_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + timestampMicros_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + value_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+       * The name of the family into which new data should be written.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the family into which new data should be written.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the family into which new data should be written.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family into which new data should be written.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family into which new data should be written.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString columnQualifier_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The qualifier of the column into which new data should be written.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be written.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @param value The columnQualifier to set. + * @return This builder for chaining. + */ + public Builder setColumnQualifier(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + columnQualifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be written.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @return This builder for chaining. + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = getDefaultInstance().getColumnQualifier(); + onChanged(); + return this; + } + + private long timestampMicros_; + + /** + * + * + *
+       * The timestamp of the cell into which new data should be written.
+       * Use -1 for current Bigtable server time.
+       * Otherwise, the client should set this value itself, noting that the
+       * default value is a timestamp of zero if the field is left unspecified.
+       * Values must match the granularity of the table (e.g. micros, millis).
+       * 
+ * + * int64 timestamp_micros = 3; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + /** + * + * + *
+       * The timestamp of the cell into which new data should be written.
+       * Use -1 for current Bigtable server time.
+       * Otherwise, the client should set this value itself, noting that the
+       * default value is a timestamp of zero if the field is left unspecified.
+       * Values must match the granularity of the table (e.g. micros, millis).
+       * 
+ * + * int64 timestamp_micros = 3; + * + * @param value The timestampMicros to set. + * @return This builder for chaining. + */ + public Builder setTimestampMicros(long value) { + + timestampMicros_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell into which new data should be written.
+       * Use -1 for current Bigtable server time.
+       * Otherwise, the client should set this value itself, noting that the
+       * default value is a timestamp of zero if the field is left unspecified.
+       * Values must match the granularity of the table (e.g. micros, millis).
+       * 
+ * + * int64 timestamp_micros = 3; + * + * @return This builder for chaining. + */ + public Builder clearTimestampMicros() { + bitField0_ = (bitField0_ & ~0x00000004); + timestampMicros_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The value to be written into the specified cell.
+       * 
+ * + * bytes value = 4; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + /** + * + * + *
+       * The value to be written into the specified cell.
+       * 
+ * + * bytes value = 4; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The value to be written into the specified cell.
+       * 
+ * + * bytes value = 4; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000008); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.SetCell) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.SetCell) + private static final com.google.bigtable.v2.Mutation.SetCell DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.SetCell(); + } + + public static com.google.bigtable.v2.Mutation.SetCell getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetCell parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.SetCell getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AddToCellOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.AddToCell) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + boolean hasColumnQualifier(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + com.google.bigtable.v2.Value getColumnQualifier(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + com.google.bigtable.v2.Value getTimestamp(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder(); + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + boolean hasInput(); + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + com.google.bigtable.v2.Value getInput(); + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder(); + } + + /** + * + * + *
+   * A Mutation which incrementally updates a cell in an `Aggregate` family.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.AddToCell} + */ + public static final class AddToCell extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.AddToCell) + AddToCellOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AddToCell"); + } + + // Use AddToCell.newBuilder() to construct. + private AddToCell(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AddToCell() { + familyName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.AddToCell.class, + com.google.bigtable.v2.Mutation.AddToCell.Builder.class); + } + + private int bitField0_; + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Value columnQualifier_; + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + @java.lang.Override + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getColumnQualifier() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.bigtable.v2.Value timestamp_; + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getTimestamp() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + public static final int INPUT_FIELD_NUMBER = 4; + private com.google.bigtable.v2.Value input_; + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + @java.lang.Override + public boolean hasInput() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getInput() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + + /** + * + * + *
+     * The input value to be accumulated into the specified cell. This must be
+     * compatible with the family's `value_type.input_type`.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getColumnQualifier()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getInput()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getColumnQualifier()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getInput()); + } + size += getUnknownFields().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.Mutation.AddToCell)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.AddToCell other = + (com.google.bigtable.v2.Mutation.AddToCell) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (hasColumnQualifier() != other.hasColumnQualifier()) return false; + if (hasColumnQualifier()) { + if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) return false; + } + if (hasInput() != other.hasInput()) return false; + if (hasInput()) { + if (!getInput().equals(other.getInput())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + if (hasColumnQualifier()) { + hash = (37 * hash) + COLUMN_QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifier().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (hasInput()) { + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.AddToCell 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.Mutation.AddToCell parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.AddToCell 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.Mutation.AddToCell parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.AddToCell 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which incrementally updates a cell in an `Aggregate` family.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.AddToCell} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.AddToCell) + com.google.bigtable.v2.Mutation.AddToCellOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.AddToCell.class, + com.google.bigtable.v2.Mutation.AddToCell.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.AddToCell.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetColumnQualifierFieldBuilder(); + internalGetTimestampFieldBuilder(); + internalGetInputFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; + } + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + input_ = null; + if (inputBuilder_ != null) { + inputBuilder_.dispose(); + inputBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell build() { + com.google.bigtable.v2.Mutation.AddToCell result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell buildPartial() { + com.google.bigtable.v2.Mutation.AddToCell result = + new com.google.bigtable.v2.Mutation.AddToCell(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation.AddToCell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = + columnQualifierBuilder_ == null ? columnQualifier_ : columnQualifierBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.input_ = inputBuilder_ == null ? input_ : inputBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.AddToCell) { + return mergeFrom((com.google.bigtable.v2.Mutation.AddToCell) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.AddToCell other) { + if (other == com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance()) return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasColumnQualifier()) { + mergeColumnQualifier(other.getColumnQualifier()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.hasInput()) { + mergeInput(other.getInput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetColumnQualifierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetInputFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.v2.Value columnQualifier_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + columnQualifierBuilder_; + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + public com.google.bigtable.v2.Value getColumnQualifier() { + if (columnQualifierBuilder_ == null) { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } else { + return columnQualifierBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder setColumnQualifier(com.google.bigtable.v2.Value value) { + if (columnQualifierBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + columnQualifier_ = value; + } else { + columnQualifierBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder setColumnQualifier(com.google.bigtable.v2.Value.Builder builderForValue) { + if (columnQualifierBuilder_ == null) { + columnQualifier_ = builderForValue.build(); + } else { + columnQualifierBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder mergeColumnQualifier(com.google.bigtable.v2.Value value) { + if (columnQualifierBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && columnQualifier_ != null + && columnQualifier_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getColumnQualifierBuilder().mergeFrom(value); + } else { + columnQualifier_ = value; + } + } else { + columnQualifierBuilder_.mergeFrom(value); + } + if (columnQualifier_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public com.google.bigtable.v2.Value.Builder getColumnQualifierBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetColumnQualifierFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder() { + if (columnQualifierBuilder_ != null) { + return columnQualifierBuilder_.getMessageOrBuilder(); + } else { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetColumnQualifierFieldBuilder() { + if (columnQualifierBuilder_ == null) { + columnQualifierBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getColumnQualifier(), getParentForChildren(), isClean()); + columnQualifier_ = null; + } + return columnQualifierBuilder_; + } + + private com.google.bigtable.v2.Value timestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + timestampBuilder_; + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + public com.google.bigtable.v2.Value getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder setTimestamp(com.google.bigtable.v2.Value value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder setTimestamp(com.google.bigtable.v2.Value.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder mergeTimestamp(com.google.bigtable.v2.Value value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timestamp_ != null + && timestamp_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public com.google.bigtable.v2.Value.Builder getTimestampBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : timestamp_; + } + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private com.google.bigtable.v2.Value input_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + inputBuilder_; + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + public boolean hasInput() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + public com.google.bigtable.v2.Value getInput() { + if (inputBuilder_ == null) { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } else { + return inputBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder setInput(com.google.bigtable.v2.Value value) { + if (inputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + } else { + inputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder setInput(com.google.bigtable.v2.Value.Builder builderForValue) { + if (inputBuilder_ == null) { + input_ = builderForValue.build(); + } else { + inputBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder mergeInput(com.google.bigtable.v2.Value value) { + if (inputBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && input_ != null + && input_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getInputBuilder().mergeFrom(value); + } else { + input_ = value; + } + } else { + inputBuilder_.mergeFrom(value); + } + if (input_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder clearInput() { + bitField0_ = (bitField0_ & ~0x00000008); + input_ = null; + if (inputBuilder_ != null) { + inputBuilder_.dispose(); + inputBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public com.google.bigtable.v2.Value.Builder getInputBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetInputFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + if (inputBuilder_ != null) { + return inputBuilder_.getMessageOrBuilder(); + } else { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + } + + /** + * + * + *
+       * The input value to be accumulated into the specified cell. This must be
+       * compatible with the family's `value_type.input_type`.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetInputFieldBuilder() { + if (inputBuilder_ == null) { + inputBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getInput(), getParentForChildren(), isClean()); + input_ = null; + } + return inputBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.AddToCell) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.AddToCell) + private static final com.google.bigtable.v2.Mutation.AddToCell DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.AddToCell(); + } + + public static com.google.bigtable.v2.Mutation.AddToCell getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddToCell parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.AddToCell getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MergeToCellOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.MergeToCell) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + boolean hasColumnQualifier(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + com.google.bigtable.v2.Value getColumnQualifier(); + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + com.google.bigtable.v2.Value getTimestamp(); + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder(); + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + boolean hasInput(); + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + com.google.bigtable.v2.Value getInput(); + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder(); + } + + /** + * + * + *
+   * A Mutation which merges accumulated state into a cell in an `Aggregate`
+   * family.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.MergeToCell} + */ + public static final class MergeToCell extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.MergeToCell) + MergeToCellOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MergeToCell"); + } + + // Use MergeToCell.newBuilder() to construct. + private MergeToCell(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MergeToCell() { + familyName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.MergeToCell.class, + com.google.bigtable.v2.Mutation.MergeToCell.Builder.class); + } + + private int bitField0_; + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the `Aggregate` family into which new data should be added.
+     * This must be a family with a `value_type` of `Aggregate`.
+     * Format: `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Value columnQualifier_; + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + @java.lang.Override + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getColumnQualifier() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + + /** + * + * + *
+     * The qualifier of the column into which new data should be added. This
+     * must be a `raw_value`.
+     * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.bigtable.v2.Value timestamp_; + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getTimestamp() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + /** + * + * + *
+     * The timestamp of the cell to which new data should be added. This must
+     * be a `raw_timestamp_micros` that matches the table's `granularity`.
+     * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + public static final int INPUT_FIELD_NUMBER = 4; + private com.google.bigtable.v2.Value input_; + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + @java.lang.Override + public boolean hasInput() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getInput() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + + /** + * + * + *
+     * The input value to be merged into the specified cell. This must be
+     * compatible with the family's `value_type.state_type`. Merging `NULL` is
+     * allowed, but has no effect.
+     * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getColumnQualifier()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getInput()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getColumnQualifier()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getInput()); + } + size += getUnknownFields().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.Mutation.MergeToCell)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.MergeToCell other = + (com.google.bigtable.v2.Mutation.MergeToCell) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (hasColumnQualifier() != other.hasColumnQualifier()) return false; + if (hasColumnQualifier()) { + if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) return false; + } + if (hasInput() != other.hasInput()) return false; + if (hasInput()) { + if (!getInput().equals(other.getInput())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + if (hasColumnQualifier()) { + hash = (37 * hash) + COLUMN_QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifier().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (hasInput()) { + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell 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.Mutation.MergeToCell parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell 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.Mutation.MergeToCell parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.MergeToCell 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which merges accumulated state into a cell in an `Aggregate`
+     * family.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.MergeToCell} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.MergeToCell) + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.MergeToCell.class, + com.google.bigtable.v2.Mutation.MergeToCell.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.MergeToCell.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetColumnQualifierFieldBuilder(); + internalGetTimestampFieldBuilder(); + internalGetInputFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; + } + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + input_ = null; + if (inputBuilder_ != null) { + inputBuilder_.dispose(); + inputBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell build() { + com.google.bigtable.v2.Mutation.MergeToCell result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell buildPartial() { + com.google.bigtable.v2.Mutation.MergeToCell result = + new com.google.bigtable.v2.Mutation.MergeToCell(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation.MergeToCell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = + columnQualifierBuilder_ == null ? columnQualifier_ : columnQualifierBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.input_ = inputBuilder_ == null ? input_ : inputBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.MergeToCell) { + return mergeFrom((com.google.bigtable.v2.Mutation.MergeToCell) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.MergeToCell other) { + if (other == com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance()) return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasColumnQualifier()) { + mergeColumnQualifier(other.getColumnQualifier()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.hasInput()) { + mergeInput(other.getInput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetColumnQualifierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetInputFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the `Aggregate` family into which new data should be added.
+       * This must be a family with a `value_type` of `Aggregate`.
+       * Format: `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.v2.Value columnQualifier_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + columnQualifierBuilder_; + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + public com.google.bigtable.v2.Value getColumnQualifier() { + if (columnQualifierBuilder_ == null) { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } else { + return columnQualifierBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder setColumnQualifier(com.google.bigtable.v2.Value value) { + if (columnQualifierBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + columnQualifier_ = value; + } else { + columnQualifierBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder setColumnQualifier(com.google.bigtable.v2.Value.Builder builderForValue) { + if (columnQualifierBuilder_ == null) { + columnQualifier_ = builderForValue.build(); + } else { + columnQualifierBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder mergeColumnQualifier(com.google.bigtable.v2.Value value) { + if (columnQualifierBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && columnQualifier_ != null + && columnQualifier_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getColumnQualifierBuilder().mergeFrom(value); + } else { + columnQualifier_ = value; + } + } else { + columnQualifierBuilder_.mergeFrom(value); + } + if (columnQualifier_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public com.google.bigtable.v2.Value.Builder getColumnQualifierBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetColumnQualifierFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder() { + if (columnQualifierBuilder_ != null) { + return columnQualifierBuilder_.getMessageOrBuilder(); + } else { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + } + + /** + * + * + *
+       * The qualifier of the column into which new data should be added. This
+       * must be a `raw_value`.
+       * 
+ * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetColumnQualifierFieldBuilder() { + if (columnQualifierBuilder_ == null) { + columnQualifierBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getColumnQualifier(), getParentForChildren(), isClean()); + columnQualifier_ = null; + } + return columnQualifierBuilder_; + } + + private com.google.bigtable.v2.Value timestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + timestampBuilder_; + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + public com.google.bigtable.v2.Value getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder setTimestamp(com.google.bigtable.v2.Value value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder setTimestamp(com.google.bigtable.v2.Value.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder mergeTimestamp(com.google.bigtable.v2.Value value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timestamp_ != null + && timestamp_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public com.google.bigtable.v2.Value.Builder getTimestampBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : timestamp_; + } + } + + /** + * + * + *
+       * The timestamp of the cell to which new data should be added. This must
+       * be a `raw_timestamp_micros` that matches the table's `granularity`.
+       * 
+ * + * .google.bigtable.v2.Value timestamp = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private com.google.bigtable.v2.Value input_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + inputBuilder_; + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + public boolean hasInput() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + public com.google.bigtable.v2.Value getInput() { + if (inputBuilder_ == null) { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } else { + return inputBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder setInput(com.google.bigtable.v2.Value value) { + if (inputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + } else { + inputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder setInput(com.google.bigtable.v2.Value.Builder builderForValue) { + if (inputBuilder_ == null) { + input_ = builderForValue.build(); + } else { + inputBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder mergeInput(com.google.bigtable.v2.Value value) { + if (inputBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && input_ != null + && input_ != com.google.bigtable.v2.Value.getDefaultInstance()) { + getInputBuilder().mergeFrom(value); + } else { + input_ = value; + } + } else { + inputBuilder_.mergeFrom(value); + } + if (input_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public Builder clearInput() { + bitField0_ = (bitField0_ & ~0x00000008); + input_ = null; + if (inputBuilder_ != null) { + inputBuilder_.dispose(); + inputBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public com.google.bigtable.v2.Value.Builder getInputBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetInputFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + if (inputBuilder_ != null) { + return inputBuilder_.getMessageOrBuilder(); + } else { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + } + + /** + * + * + *
+       * The input value to be merged into the specified cell. This must be
+       * compatible with the family's `value_type.state_type`. Merging `NULL` is
+       * allowed, but has no effect.
+       * 
+ * + * .google.bigtable.v2.Value input = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetInputFieldBuilder() { + if (inputBuilder_ == null) { + inputBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getInput(), getParentForChildren(), isClean()); + input_ = null; + } + return inputBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.MergeToCell) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.MergeToCell) + private static final com.google.bigtable.v2.Mutation.MergeToCell DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.MergeToCell(); + } + + public static com.google.bigtable.v2.Mutation.MergeToCell getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MergeToCell parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.MergeToCell getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeleteFromColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromColumn) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+     * The qualifier of the column from which cells should be deleted.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + com.google.protobuf.ByteString getColumnQualifier(); + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return Whether the timeRange field is set. + */ + boolean hasTimeRange(); + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return The timeRange. + */ + com.google.bigtable.v2.TimestampRange getTimeRange(); + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder(); + } + + /** + * + * + *
+   * A Mutation which deletes cells from the specified column, optionally
+   * restricting the deletions to a given timestamp range.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromColumn} + */ + public static final class DeleteFromColumn extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromColumn) + DeleteFromColumnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteFromColumn"); + } + + // Use DeleteFromColumn.newBuilder() to construct. + private DeleteFromColumn(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteFromColumn() { + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromColumn.class, + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder.class); + } + + private int bitField0_; + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The qualifier of the column from which cells should be deleted.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + public static final int TIME_RANGE_FIELD_NUMBER = 3; + private com.google.bigtable.v2.TimestampRange timeRange_; + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return Whether the timeRange field is set. + */ + @java.lang.Override + public boolean hasTimeRange() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return The timeRange. + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRange getTimeRange() { + return timeRange_ == null + ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() + : timeRange_; + } + + /** + * + * + *
+     * The range of timestamps within which cells should be deleted.
+     * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { + return timeRange_ == null + ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() + : timeRange_; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + output.writeBytes(2, columnQualifier_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTimeRange()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, columnQualifier_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimeRange()); + } + size += getUnknownFields().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.Mutation.DeleteFromColumn)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.DeleteFromColumn other = + (com.google.bigtable.v2.Mutation.DeleteFromColumn) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; + if (hasTimeRange() != other.hasTimeRange()) return false; + if (hasTimeRange()) { + if (!getTimeRange().equals(other.getTimeRange())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + hash = (37 * hash) + COLUMN_QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifier().hashCode(); + if (hasTimeRange()) { + hash = (37 * hash) + TIME_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getTimeRange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn 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.Mutation.DeleteFromColumn parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn 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.Mutation.DeleteFromColumn parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.DeleteFromColumn 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which deletes cells from the specified column, optionally
+     * restricting the deletions to a given timestamp range.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromColumn} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.DeleteFromColumn) + com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromColumn.class, + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.DeleteFromColumn.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimeRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + timeRange_ = null; + if (timeRangeBuilder_ != null) { + timeRangeBuilder_.dispose(); + timeRangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumn getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumn build() { + com.google.bigtable.v2.Mutation.DeleteFromColumn result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumn buildPartial() { + com.google.bigtable.v2.Mutation.DeleteFromColumn result = + new com.google.bigtable.v2.Mutation.DeleteFromColumn(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation.DeleteFromColumn result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = columnQualifier_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timeRange_ = timeRangeBuilder_ == null ? timeRange_ : timeRangeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.DeleteFromColumn) { + return mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromColumn) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.DeleteFromColumn other) { + if (other == com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance()) + return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getColumnQualifier().isEmpty()) { + setColumnQualifier(other.getColumnQualifier()); + } + if (other.hasTimeRange()) { + mergeTimeRange(other.getTimeRange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + columnQualifier_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetTimeRangeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString columnQualifier_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The qualifier of the column from which cells should be deleted.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + /** + * + * + *
+       * The qualifier of the column from which cells should be deleted.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @param value The columnQualifier to set. + * @return This builder for chaining. + */ + public Builder setColumnQualifier(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + columnQualifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The qualifier of the column from which cells should be deleted.
+       * Can be any byte string, including the empty string.
+       * 
+ * + * bytes column_qualifier = 2; + * + * @return This builder for chaining. + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = getDefaultInstance().getColumnQualifier(); + onChanged(); + return this; + } + + private com.google.bigtable.v2.TimestampRange timeRange_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder> + timeRangeBuilder_; + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return Whether the timeRange field is set. + */ + public boolean hasTimeRange() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + * + * @return The timeRange. + */ + public com.google.bigtable.v2.TimestampRange getTimeRange() { + if (timeRangeBuilder_ == null) { + return timeRange_ == null + ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() + : timeRange_; + } else { + return timeRangeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public Builder setTimeRange(com.google.bigtable.v2.TimestampRange value) { + if (timeRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeRange_ = value; + } else { + timeRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public Builder setTimeRange(com.google.bigtable.v2.TimestampRange.Builder builderForValue) { + if (timeRangeBuilder_ == null) { + timeRange_ = builderForValue.build(); + } else { + timeRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public Builder mergeTimeRange(com.google.bigtable.v2.TimestampRange value) { + if (timeRangeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timeRange_ != null + && timeRange_ != com.google.bigtable.v2.TimestampRange.getDefaultInstance()) { + getTimeRangeBuilder().mergeFrom(value); + } else { + timeRange_ = value; + } + } else { + timeRangeBuilder_.mergeFrom(value); + } + if (timeRange_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public Builder clearTimeRange() { + bitField0_ = (bitField0_ & ~0x00000004); + timeRange_ = null; + if (timeRangeBuilder_ != null) { + timeRangeBuilder_.dispose(); + timeRangeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public com.google.bigtable.v2.TimestampRange.Builder getTimeRangeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimeRangeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { + if (timeRangeBuilder_ != null) { + return timeRangeBuilder_.getMessageOrBuilder(); + } else { + return timeRange_ == null + ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() + : timeRange_; + } + } + + /** + * + * + *
+       * The range of timestamps within which cells should be deleted.
+       * 
+ * + * .google.bigtable.v2.TimestampRange time_range = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder> + internalGetTimeRangeFieldBuilder() { + if (timeRangeBuilder_ == null) { + timeRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder>( + getTimeRange(), getParentForChildren(), isClean()); + timeRange_ = null; + } + return timeRangeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromColumn) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromColumn) + private static final com.google.bigtable.v2.Mutation.DeleteFromColumn DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromColumn(); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromColumn getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFromColumn parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.DeleteFromColumn getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeleteFromFamilyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromFamily) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + } + + /** + * + * + *
+   * A Mutation which deletes all cells from the specified column family.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromFamily} + */ + public static final class DeleteFromFamily extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromFamily) + DeleteFromFamilyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteFromFamily"); + } + + // Use DeleteFromFamily.newBuilder() to construct. + private DeleteFromFamily(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteFromFamily() { + familyName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromFamily.class, + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder.class); + } + + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+     * The name of the family from which cells should be deleted.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + size += getUnknownFields().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.Mutation.DeleteFromFamily)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.DeleteFromFamily other = + (com.google.bigtable.v2.Mutation.DeleteFromFamily) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily 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.Mutation.DeleteFromFamily parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily 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.Mutation.DeleteFromFamily parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.DeleteFromFamily 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which deletes all cells from the specified column family.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromFamily} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.DeleteFromFamily) + com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromFamily.class, + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.DeleteFromFamily.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily build() { + com.google.bigtable.v2.Mutation.DeleteFromFamily result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily buildPartial() { + com.google.bigtable.v2.Mutation.DeleteFromFamily result = + new com.google.bigtable.v2.Mutation.DeleteFromFamily(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation.DeleteFromFamily result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.DeleteFromFamily) { + return mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromFamily) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.DeleteFromFamily other) { + if (other == com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance()) + return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The name of the family from which cells should be deleted.
+       * Must match `[-_.a-zA-Z0-9]+`
+       * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromFamily) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromFamily) + private static final com.google.bigtable.v2.Mutation.DeleteFromFamily DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromFamily(); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFromFamily parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.DeleteFromFamily getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeleteFromRowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromRow) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * A Mutation which deletes all cells from the containing row.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} + */ + public static final class DeleteFromRow extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromRow) + DeleteFromRowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteFromRow"); + } + + // Use DeleteFromRow.newBuilder() to construct. + private DeleteFromRow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteFromRow() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromRow.class, + com.google.bigtable.v2.Mutation.DeleteFromRow.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Mutation.DeleteFromRow)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation.DeleteFromRow other = + (com.google.bigtable.v2.Mutation.DeleteFromRow) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow 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.Mutation.DeleteFromRow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow 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.Mutation.DeleteFromRow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation.DeleteFromRow 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A Mutation which deletes all cells from the containing row.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation.DeleteFromRow) + com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.DeleteFromRow.class, + com.google.bigtable.v2.Mutation.DeleteFromRow.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.DeleteFromRow.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.DataProto + .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRow getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRow build() { + com.google.bigtable.v2.Mutation.DeleteFromRow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRow buildPartial() { + com.google.bigtable.v2.Mutation.DeleteFromRow result = + new com.google.bigtable.v2.Mutation.DeleteFromRow(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation.DeleteFromRow) { + return mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromRow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation.DeleteFromRow other) { + if (other == com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromRow) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromRow) + private static final com.google.bigtable.v2.Mutation.DeleteFromRow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromRow(); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromRow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFromRow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation.DeleteFromRow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int mutationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object mutation_; + + public enum MutationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SET_CELL(1), + ADD_TO_CELL(5), + MERGE_TO_CELL(6), + DELETE_FROM_COLUMN(2), + DELETE_FROM_FAMILY(3), + DELETE_FROM_ROW(4), + MUTATION_NOT_SET(0); + private final int value; + + private MutationCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MutationCase valueOf(int value) { + return forNumber(value); + } + + public static MutationCase forNumber(int value) { + switch (value) { + case 1: + return SET_CELL; + case 5: + return ADD_TO_CELL; + case 6: + return MERGE_TO_CELL; + case 2: + return DELETE_FROM_COLUMN; + case 3: + return DELETE_FROM_FAMILY; + case 4: + return DELETE_FROM_ROW; + case 0: + return MUTATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MutationCase getMutationCase() { + return MutationCase.forNumber(mutationCase_); + } + + public static final int SET_CELL_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return Whether the setCell field is set. + */ + @java.lang.Override + public boolean hasSetCell() { + return mutationCase_ == 1; + } + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return The setCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCell getSetCell() { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + + public static final int ADD_TO_CELL_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return Whether the addToCell field is set. + */ + @java.lang.Override + public boolean hasAddToCell() { + return mutationCase_ == 5; + } + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return The addToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell getAddToCell() { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCellOrBuilder getAddToCellOrBuilder() { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + + public static final int MERGE_TO_CELL_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return Whether the mergeToCell field is set. + */ + @java.lang.Override + public boolean hasMergeToCell() { + return mutationCase_ == 6; + } + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return The mergeToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell getMergeToCell() { + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCellOrBuilder getMergeToCellOrBuilder() { + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + + public static final int DELETE_FROM_COLUMN_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return Whether the deleteFromColumn field is set. + */ + @java.lang.Override + public boolean hasDeleteFromColumn() { + return mutationCase_ == 2; + } + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return The deleteFromColumn. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn() { + if (mutationCase_ == 2) { + return (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder getDeleteFromColumnOrBuilder() { + if (mutationCase_ == 2) { + return (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + + public static final int DELETE_FROM_FAMILY_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return Whether the deleteFromFamily field is set. + */ + @java.lang.Override + public boolean hasDeleteFromFamily() { + return mutationCase_ == 3; + } + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return The deleteFromFamily. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily() { + if (mutationCase_ == 3) { + return (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder getDeleteFromFamilyOrBuilder() { + if (mutationCase_ == 3) { + return (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + + public static final int DELETE_FROM_ROW_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return Whether the deleteFromRow field is set. + */ + @java.lang.Override + public boolean hasDeleteFromRow() { + return mutationCase_ == 4; + } + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return The deleteFromRow. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow() { + if (mutationCase_ == 4) { + return (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOrBuilder() { + if (mutationCase_ == 4) { + return (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + + 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 (mutationCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Mutation.SetCell) mutation_); + } + if (mutationCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_); + } + if (mutationCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_); + } + if (mutationCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_); + } + if (mutationCase_ == 5) { + output.writeMessage(5, (com.google.bigtable.v2.Mutation.AddToCell) mutation_); + } + if (mutationCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.Mutation.MergeToCell) mutation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mutationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Mutation.SetCell) mutation_); + } + if (mutationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_); + } + if (mutationCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_); + } + if (mutationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_); + } + if (mutationCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.Mutation.AddToCell) mutation_); + } + if (mutationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.Mutation.MergeToCell) mutation_); + } + size += getUnknownFields().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.Mutation)) { + return super.equals(obj); + } + com.google.bigtable.v2.Mutation other = (com.google.bigtable.v2.Mutation) obj; + + if (!getMutationCase().equals(other.getMutationCase())) return false; + switch (mutationCase_) { + case 1: + if (!getSetCell().equals(other.getSetCell())) return false; + break; + case 5: + if (!getAddToCell().equals(other.getAddToCell())) return false; + break; + case 6: + if (!getMergeToCell().equals(other.getMergeToCell())) return false; + break; + case 2: + if (!getDeleteFromColumn().equals(other.getDeleteFromColumn())) return false; + break; + case 3: + if (!getDeleteFromFamily().equals(other.getDeleteFromFamily())) return false; + break; + case 4: + if (!getDeleteFromRow().equals(other.getDeleteFromRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (mutationCase_) { + case 1: + hash = (37 * hash) + SET_CELL_FIELD_NUMBER; + hash = (53 * hash) + getSetCell().hashCode(); + break; + case 5: + hash = (37 * hash) + ADD_TO_CELL_FIELD_NUMBER; + hash = (53 * hash) + getAddToCell().hashCode(); + break; + case 6: + hash = (37 * hash) + MERGE_TO_CELL_FIELD_NUMBER; + hash = (53 * hash) + getMergeToCell().hashCode(); + break; + case 2: + hash = (37 * hash) + DELETE_FROM_COLUMN_FIELD_NUMBER; + hash = (53 * hash) + getDeleteFromColumn().hashCode(); + break; + case 3: + hash = (37 * hash) + DELETE_FROM_FAMILY_FIELD_NUMBER; + hash = (53 * hash) + getDeleteFromFamily().hashCode(); + break; + case 4: + hash = (37 * hash) + DELETE_FROM_ROW_FIELD_NUMBER; + hash = (53 * hash) + getDeleteFromRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Mutation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation 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.Mutation parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation 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.Mutation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Mutation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Mutation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Mutation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Mutation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a particular change to be made to the contents of a row.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Mutation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Mutation) + com.google.bigtable.v2.MutationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.class, com.google.bigtable.v2.Mutation.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (setCellBuilder_ != null) { + setCellBuilder_.clear(); + } + if (addToCellBuilder_ != null) { + addToCellBuilder_.clear(); + } + if (mergeToCellBuilder_ != null) { + mergeToCellBuilder_.clear(); + } + if (deleteFromColumnBuilder_ != null) { + deleteFromColumnBuilder_.clear(); + } + if (deleteFromFamilyBuilder_ != null) { + deleteFromFamilyBuilder_.clear(); + } + if (deleteFromRowBuilder_ != null) { + deleteFromRowBuilder_.clear(); + } + mutationCase_ = 0; + mutation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation build() { + com.google.bigtable.v2.Mutation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation buildPartial() { + com.google.bigtable.v2.Mutation result = new com.google.bigtable.v2.Mutation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Mutation result) { + result.mutationCase_ = mutationCase_; + result.mutation_ = this.mutation_; + if (mutationCase_ == 1 && setCellBuilder_ != null) { + result.mutation_ = setCellBuilder_.build(); + } + if (mutationCase_ == 5 && addToCellBuilder_ != null) { + result.mutation_ = addToCellBuilder_.build(); + } + if (mutationCase_ == 6 && mergeToCellBuilder_ != null) { + result.mutation_ = mergeToCellBuilder_.build(); + } + if (mutationCase_ == 2 && deleteFromColumnBuilder_ != null) { + result.mutation_ = deleteFromColumnBuilder_.build(); + } + if (mutationCase_ == 3 && deleteFromFamilyBuilder_ != null) { + result.mutation_ = deleteFromFamilyBuilder_.build(); + } + if (mutationCase_ == 4 && deleteFromRowBuilder_ != null) { + result.mutation_ = deleteFromRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Mutation) { + return mergeFrom((com.google.bigtable.v2.Mutation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Mutation other) { + if (other == com.google.bigtable.v2.Mutation.getDefaultInstance()) return this; + switch (other.getMutationCase()) { + case SET_CELL: + { + mergeSetCell(other.getSetCell()); + break; + } + case ADD_TO_CELL: + { + mergeAddToCell(other.getAddToCell()); + break; + } + case MERGE_TO_CELL: + { + mergeMergeToCell(other.getMergeToCell()); + break; + } + case DELETE_FROM_COLUMN: + { + mergeDeleteFromColumn(other.getDeleteFromColumn()); + break; + } + case DELETE_FROM_FAMILY: + { + mergeDeleteFromFamily(other.getDeleteFromFamily()); + break; + } + case DELETE_FROM_ROW: + { + mergeDeleteFromRow(other.getDeleteFromRow()); + break; + } + case MUTATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetSetCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetDeleteFromColumnFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetDeleteFromFamilyFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetDeleteFromRowFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetAddToCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetMergeToCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int mutationCase_ = 0; + private java.lang.Object mutation_; + + public MutationCase getMutationCase() { + return MutationCase.forNumber(mutationCase_); + } + + public Builder clearMutation() { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.SetCell, + com.google.bigtable.v2.Mutation.SetCell.Builder, + com.google.bigtable.v2.Mutation.SetCellOrBuilder> + setCellBuilder_; + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return Whether the setCell field is set. + */ + @java.lang.Override + public boolean hasSetCell() { + return mutationCase_ == 1; + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return The setCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCell getSetCell() { + if (setCellBuilder_ == null) { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } else { + if (mutationCase_ == 1) { + return setCellBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder setSetCell(com.google.bigtable.v2.Mutation.SetCell value) { + if (setCellBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + setCellBuilder_.setMessage(value); + } + mutationCase_ = 1; + return this; + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder setSetCell(com.google.bigtable.v2.Mutation.SetCell.Builder builderForValue) { + if (setCellBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + setCellBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 1; + return this; + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder mergeSetCell(com.google.bigtable.v2.Mutation.SetCell value) { + if (setCellBuilder_ == null) { + if (mutationCase_ == 1 + && mutation_ != com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.SetCell.newBuilder( + (com.google.bigtable.v2.Mutation.SetCell) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 1) { + setCellBuilder_.mergeFrom(value); + } else { + setCellBuilder_.setMessage(value); + } + } + mutationCase_ = 1; + return this; + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder clearSetCell() { + if (setCellBuilder_ == null) { + if (mutationCase_ == 1) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 1) { + mutationCase_ = 0; + mutation_ = null; + } + setCellBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public com.google.bigtable.v2.Mutation.SetCell.Builder getSetCellBuilder() { + return internalGetSetCellFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { + if ((mutationCase_ == 1) && (setCellBuilder_ != null)) { + return setCellBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Set a cell's value.
+     * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.SetCell, + com.google.bigtable.v2.Mutation.SetCell.Builder, + com.google.bigtable.v2.Mutation.SetCellOrBuilder> + internalGetSetCellFieldBuilder() { + if (setCellBuilder_ == null) { + if (!(mutationCase_ == 1)) { + mutation_ = com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + setCellBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.SetCell, + com.google.bigtable.v2.Mutation.SetCell.Builder, + com.google.bigtable.v2.Mutation.SetCellOrBuilder>( + (com.google.bigtable.v2.Mutation.SetCell) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 1; + onChanged(); + return setCellBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.AddToCell, + com.google.bigtable.v2.Mutation.AddToCell.Builder, + com.google.bigtable.v2.Mutation.AddToCellOrBuilder> + addToCellBuilder_; + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return Whether the addToCell field is set. + */ + @java.lang.Override + public boolean hasAddToCell() { + return mutationCase_ == 5; + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return The addToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell getAddToCell() { + if (addToCellBuilder_ == null) { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } else { + if (mutationCase_ == 5) { + return addToCellBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder setAddToCell(com.google.bigtable.v2.Mutation.AddToCell value) { + if (addToCellBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + addToCellBuilder_.setMessage(value); + } + mutationCase_ = 5; + return this; + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder setAddToCell(com.google.bigtable.v2.Mutation.AddToCell.Builder builderForValue) { + if (addToCellBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + addToCellBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 5; + return this; + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder mergeAddToCell(com.google.bigtable.v2.Mutation.AddToCell value) { + if (addToCellBuilder_ == null) { + if (mutationCase_ == 5 + && mutation_ != com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.AddToCell.newBuilder( + (com.google.bigtable.v2.Mutation.AddToCell) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 5) { + addToCellBuilder_.mergeFrom(value); + } else { + addToCellBuilder_.setMessage(value); + } + } + mutationCase_ = 5; + return this; + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder clearAddToCell() { + if (addToCellBuilder_ == null) { + if (mutationCase_ == 5) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 5) { + mutationCase_ = 0; + mutation_ = null; + } + addToCellBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public com.google.bigtable.v2.Mutation.AddToCell.Builder getAddToCellBuilder() { + return internalGetAddToCellFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCellOrBuilder getAddToCellOrBuilder() { + if ((mutationCase_ == 5) && (addToCellBuilder_ != null)) { + return addToCellBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Incrementally updates an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.AddToCell, + com.google.bigtable.v2.Mutation.AddToCell.Builder, + com.google.bigtable.v2.Mutation.AddToCellOrBuilder> + internalGetAddToCellFieldBuilder() { + if (addToCellBuilder_ == null) { + if (!(mutationCase_ == 5)) { + mutation_ = com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + addToCellBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.AddToCell, + com.google.bigtable.v2.Mutation.AddToCell.Builder, + com.google.bigtable.v2.Mutation.AddToCellOrBuilder>( + (com.google.bigtable.v2.Mutation.AddToCell) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 5; + onChanged(); + return addToCellBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.MergeToCell, + com.google.bigtable.v2.Mutation.MergeToCell.Builder, + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder> + mergeToCellBuilder_; + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return Whether the mergeToCell field is set. + */ + @java.lang.Override + public boolean hasMergeToCell() { + return mutationCase_ == 6; + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return The mergeToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell getMergeToCell() { + if (mergeToCellBuilder_ == null) { + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } else { + if (mutationCase_ == 6) { + return mergeToCellBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + public Builder setMergeToCell(com.google.bigtable.v2.Mutation.MergeToCell value) { + if (mergeToCellBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + mergeToCellBuilder_.setMessage(value); + } + mutationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + public Builder setMergeToCell( + com.google.bigtable.v2.Mutation.MergeToCell.Builder builderForValue) { + if (mergeToCellBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + mergeToCellBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + public Builder mergeMergeToCell(com.google.bigtable.v2.Mutation.MergeToCell value) { + if (mergeToCellBuilder_ == null) { + if (mutationCase_ == 6 + && mutation_ != com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.MergeToCell.newBuilder( + (com.google.bigtable.v2.Mutation.MergeToCell) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 6) { + mergeToCellBuilder_.mergeFrom(value); + } else { + mergeToCellBuilder_.setMessage(value); + } + } + mutationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + public Builder clearMergeToCell() { + if (mergeToCellBuilder_ == null) { + if (mutationCase_ == 6) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 6) { + mutationCase_ = 0; + mutation_ = null; + } + mergeToCellBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + public com.google.bigtable.v2.Mutation.MergeToCell.Builder getMergeToCellBuilder() { + return internalGetMergeToCellFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCellOrBuilder getMergeToCellOrBuilder() { + if ((mutationCase_ == 6) && (mergeToCellBuilder_ != null)) { + return mergeToCellBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Merges accumulated state to an `Aggregate` cell.
+     * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.MergeToCell, + com.google.bigtable.v2.Mutation.MergeToCell.Builder, + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder> + internalGetMergeToCellFieldBuilder() { + if (mergeToCellBuilder_ == null) { + if (!(mutationCase_ == 6)) { + mutation_ = com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); + } + mergeToCellBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.MergeToCell, + com.google.bigtable.v2.Mutation.MergeToCell.Builder, + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder>( + (com.google.bigtable.v2.Mutation.MergeToCell) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 6; + onChanged(); + return mergeToCellBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromColumn, + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder, + com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder> + deleteFromColumnBuilder_; + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return Whether the deleteFromColumn field is set. + */ + @java.lang.Override + public boolean hasDeleteFromColumn() { + return mutationCase_ == 2; + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return The deleteFromColumn. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn() { + if (deleteFromColumnBuilder_ == null) { + if (mutationCase_ == 2) { + return (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } else { + if (mutationCase_ == 2) { + return deleteFromColumnBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + public Builder setDeleteFromColumn(com.google.bigtable.v2.Mutation.DeleteFromColumn value) { + if (deleteFromColumnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + deleteFromColumnBuilder_.setMessage(value); + } + mutationCase_ = 2; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + public Builder setDeleteFromColumn( + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder builderForValue) { + if (deleteFromColumnBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + deleteFromColumnBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 2; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + public Builder mergeDeleteFromColumn(com.google.bigtable.v2.Mutation.DeleteFromColumn value) { + if (deleteFromColumnBuilder_ == null) { + if (mutationCase_ == 2 + && mutation_ != com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.DeleteFromColumn.newBuilder( + (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 2) { + deleteFromColumnBuilder_.mergeFrom(value); + } else { + deleteFromColumnBuilder_.setMessage(value); + } + } + mutationCase_ = 2; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + public Builder clearDeleteFromColumn() { + if (deleteFromColumnBuilder_ == null) { + if (mutationCase_ == 2) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 2) { + mutationCase_ = 0; + mutation_ = null; + } + deleteFromColumnBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromColumnBuilder() { + return internalGetDeleteFromColumnFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder + getDeleteFromColumnOrBuilder() { + if ((mutationCase_ == 2) && (deleteFromColumnBuilder_ != null)) { + return deleteFromColumnBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 2) { + return (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from a column.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromColumn, + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder, + com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder> + internalGetDeleteFromColumnFieldBuilder() { + if (deleteFromColumnBuilder_ == null) { + if (!(mutationCase_ == 2)) { + mutation_ = com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + } + deleteFromColumnBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromColumn, + com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder, + com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder>( + (com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 2; + onChanged(); + return deleteFromColumnBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromFamily, + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder, + com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder> + deleteFromFamilyBuilder_; + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return Whether the deleteFromFamily field is set. + */ + @java.lang.Override + public boolean hasDeleteFromFamily() { + return mutationCase_ == 3; + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return The deleteFromFamily. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily() { + if (deleteFromFamilyBuilder_ == null) { + if (mutationCase_ == 3) { + return (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } else { + if (mutationCase_ == 3) { + return deleteFromFamilyBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + public Builder setDeleteFromFamily(com.google.bigtable.v2.Mutation.DeleteFromFamily value) { + if (deleteFromFamilyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + deleteFromFamilyBuilder_.setMessage(value); + } + mutationCase_ = 3; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + public Builder setDeleteFromFamily( + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder builderForValue) { + if (deleteFromFamilyBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + deleteFromFamilyBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 3; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + public Builder mergeDeleteFromFamily(com.google.bigtable.v2.Mutation.DeleteFromFamily value) { + if (deleteFromFamilyBuilder_ == null) { + if (mutationCase_ == 3 + && mutation_ != com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.DeleteFromFamily.newBuilder( + (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 3) { + deleteFromFamilyBuilder_.mergeFrom(value); + } else { + deleteFromFamilyBuilder_.setMessage(value); + } + } + mutationCase_ = 3; + return this; + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + public Builder clearDeleteFromFamily() { + if (deleteFromFamilyBuilder_ == null) { + if (mutationCase_ == 3) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 3) { + mutationCase_ = 0; + mutation_ = null; + } + deleteFromFamilyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFamilyBuilder() { + return internalGetDeleteFromFamilyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder + getDeleteFromFamilyOrBuilder() { + if ((mutationCase_ == 3) && (deleteFromFamilyBuilder_ != null)) { + return deleteFromFamilyBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 3) { + return (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from a column family.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromFamily, + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder, + com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder> + internalGetDeleteFromFamilyFieldBuilder() { + if (deleteFromFamilyBuilder_ == null) { + if (!(mutationCase_ == 3)) { + mutation_ = com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + } + deleteFromFamilyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromFamily, + com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder, + com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder>( + (com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 3; + onChanged(); + return deleteFromFamilyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromRow, + com.google.bigtable.v2.Mutation.DeleteFromRow.Builder, + com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder> + deleteFromRowBuilder_; + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return Whether the deleteFromRow field is set. + */ + @java.lang.Override + public boolean hasDeleteFromRow() { + return mutationCase_ == 4; + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return The deleteFromRow. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow() { + if (deleteFromRowBuilder_ == null) { + if (mutationCase_ == 4) { + return (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } else { + if (mutationCase_ == 4) { + return deleteFromRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + public Builder setDeleteFromRow(com.google.bigtable.v2.Mutation.DeleteFromRow value) { + if (deleteFromRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + deleteFromRowBuilder_.setMessage(value); + } + mutationCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + public Builder setDeleteFromRow( + com.google.bigtable.v2.Mutation.DeleteFromRow.Builder builderForValue) { + if (deleteFromRowBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + deleteFromRowBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + public Builder mergeDeleteFromRow(com.google.bigtable.v2.Mutation.DeleteFromRow value) { + if (deleteFromRowBuilder_ == null) { + if (mutationCase_ == 4 + && mutation_ != com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.DeleteFromRow.newBuilder( + (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 4) { + deleteFromRowBuilder_.mergeFrom(value); + } else { + deleteFromRowBuilder_.setMessage(value); + } + } + mutationCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + public Builder clearDeleteFromRow() { + if (deleteFromRowBuilder_ == null) { + if (mutationCase_ == 4) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 4) { + mutationCase_ = 0; + mutation_ = null; + } + deleteFromRowBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + public com.google.bigtable.v2.Mutation.DeleteFromRow.Builder getDeleteFromRowBuilder() { + return internalGetDeleteFromRowFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOrBuilder() { + if ((mutationCase_ == 4) && (deleteFromRowBuilder_ != null)) { + return deleteFromRowBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 4) { + return (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_; + } + return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deletes cells from the entire row.
+     * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromRow, + com.google.bigtable.v2.Mutation.DeleteFromRow.Builder, + com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder> + internalGetDeleteFromRowFieldBuilder() { + if (deleteFromRowBuilder_ == null) { + if (!(mutationCase_ == 4)) { + mutation_ = com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); + } + deleteFromRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation.DeleteFromRow, + com.google.bigtable.v2.Mutation.DeleteFromRow.Builder, + com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder>( + (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 4; + onChanged(); + return deleteFromRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation) + private static final com.google.bigtable.v2.Mutation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation(); + } + + public static com.google.bigtable.v2.Mutation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Mutation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Mutation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java new file mode 100644 index 000000000000..0463a62ec166 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java @@ -0,0 +1,252 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MutationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return Whether the setCell field is set. + */ + boolean hasSetCell(); + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return The setCell. + */ + com.google.bigtable.v2.Mutation.SetCell getSetCell(); + + /** + * + * + *
+   * Set a cell's value.
+   * 
+ * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder(); + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return Whether the addToCell field is set. + */ + boolean hasAddToCell(); + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return The addToCell. + */ + com.google.bigtable.v2.Mutation.AddToCell getAddToCell(); + + /** + * + * + *
+   * Incrementally updates an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + com.google.bigtable.v2.Mutation.AddToCellOrBuilder getAddToCellOrBuilder(); + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return Whether the mergeToCell field is set. + */ + boolean hasMergeToCell(); + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return The mergeToCell. + */ + com.google.bigtable.v2.Mutation.MergeToCell getMergeToCell(); + + /** + * + * + *
+   * Merges accumulated state to an `Aggregate` cell.
+   * 
+ * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + */ + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder getMergeToCellOrBuilder(); + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return Whether the deleteFromColumn field is set. + */ + boolean hasDeleteFromColumn(); + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + * + * @return The deleteFromColumn. + */ + com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn(); + + /** + * + * + *
+   * Deletes cells from a column.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; + */ + com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder getDeleteFromColumnOrBuilder(); + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return Whether the deleteFromFamily field is set. + */ + boolean hasDeleteFromFamily(); + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + * + * @return The deleteFromFamily. + */ + com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily(); + + /** + * + * + *
+   * Deletes cells from a column family.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; + */ + com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder getDeleteFromFamilyOrBuilder(); + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return Whether the deleteFromRow field is set. + */ + boolean hasDeleteFromRow(); + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + * + * @return The deleteFromRow. + */ + com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow(); + + /** + * + * + *
+   * Deletes cells from the entire row.
+   * 
+ * + * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; + */ + com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOrBuilder(); + + com.google.bigtable.v2.Mutation.MutationCase getMutationCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java new file mode 100644 index 000000000000..57b67a81a5e5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java @@ -0,0 +1,1076 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Open sessions for an AuthorizedView. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class OpenAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenAuthorizedViewRequest) + OpenAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenAuthorizedViewRequest"); + } + + // Use OpenAuthorizedViewRequest.newBuilder() to construct. + private OpenAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenAuthorizedViewRequest() { + authorizedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewRequest.class, + com.google.bigtable.v2.OpenAuthorizedViewRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenAuthorizedViewRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + /** PERMISSION_WRITE = 2; */ + PERMISSION_WRITE(2), + /** PERMISSION_READ_WRITE = 3; */ + PERMISSION_READ_WRITE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + /** PERMISSION_WRITE = 2; */ + public static final int PERMISSION_WRITE_VALUE = 2; + + /** PERMISSION_READ_WRITE = 3; */ + public static final int PERMISSION_READ_WRITE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + case 2: + return PERMISSION_WRITE; + case 3: + return PERMISSION_READ_WRITE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenAuthorizedViewRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenAuthorizedViewRequest.Permission) + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * 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; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission result = + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.UNRECOGNIZED + : result; + } + + 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.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().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.OpenAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenAuthorizedViewRequest other = + (com.google.bigtable.v2.OpenAuthorizedViewRequest) obj; + + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest 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.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest 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.OpenAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenAuthorizedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Open sessions for an AuthorizedView. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenAuthorizedViewRequest) + com.google.bigtable.v2.OpenAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewRequest.class, + com.google.bigtable.v2.OpenAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenAuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest build() { + com.google.bigtable.v2.OpenAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest buildPartial() { + com.google.bigtable.v2.OpenAuthorizedViewRequest result = + new com.google.bigtable.v2.OpenAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.v2.OpenAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenAuthorizedViewRequest other) { + if (other == com.google.bigtable.v2.OpenAuthorizedViewRequest.getDefaultInstance()) + return this; + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission result = + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission( + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenAuthorizedViewRequest) + private static final com.google.bigtable.v2.OpenAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenAuthorizedViewRequest(); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..1844ca34fb51 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java new file mode 100644 index 000000000000..a9aa9e13818e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewResponse} + */ +@com.google.protobuf.Generated +public final class OpenAuthorizedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenAuthorizedViewResponse) + OpenAuthorizedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenAuthorizedViewResponse"); + } + + // Use OpenAuthorizedViewResponse.newBuilder() to construct. + private OpenAuthorizedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenAuthorizedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewResponse.class, + com.google.bigtable.v2.OpenAuthorizedViewResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.OpenAuthorizedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenAuthorizedViewResponse other = + (com.google.bigtable.v2.OpenAuthorizedViewResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse 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.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse 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.OpenAuthorizedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenAuthorizedViewResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenAuthorizedViewResponse) + com.google.bigtable.v2.OpenAuthorizedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewResponse.class, + com.google.bigtable.v2.OpenAuthorizedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenAuthorizedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenAuthorizedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse build() { + com.google.bigtable.v2.OpenAuthorizedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse buildPartial() { + com.google.bigtable.v2.OpenAuthorizedViewResponse result = + new com.google.bigtable.v2.OpenAuthorizedViewResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenAuthorizedViewResponse) { + return mergeFrom((com.google.bigtable.v2.OpenAuthorizedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenAuthorizedViewResponse other) { + if (other == com.google.bigtable.v2.OpenAuthorizedViewResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenAuthorizedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenAuthorizedViewResponse) + private static final com.google.bigtable.v2.OpenAuthorizedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenAuthorizedViewResponse(); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenAuthorizedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenAuthorizedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java new file mode 100644 index 000000000000..41487837a96d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenAuthorizedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenAuthorizedViewResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java new file mode 100644 index 000000000000..46af0c122736 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java @@ -0,0 +1,1064 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Open sessions for a MaterializedView. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class OpenMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenMaterializedViewRequest) + OpenMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenMaterializedViewRequest"); + } + + // Use OpenMaterializedViewRequest.newBuilder() to construct. + private OpenMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenMaterializedViewRequest() { + materializedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewRequest.class, + com.google.bigtable.v2.OpenMaterializedViewRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenMaterializedViewRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenMaterializedViewRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenMaterializedViewRequest.Permission) + } + + public static final int MATERIALIZED_VIEW_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + @java.lang.Override + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + 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(); + materializedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * 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; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission result = + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.UNRECOGNIZED + : result; + } + + 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.GeneratedMessage.isStringEmpty(materializedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, materializedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, materializedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().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.OpenMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenMaterializedViewRequest other = + (com.google.bigtable.v2.OpenMaterializedViewRequest) obj; + + if (!getMaterializedViewName().equals(other.getMaterializedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MATERIALIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest 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.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest 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.OpenMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenMaterializedViewRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Open sessions for a MaterializedView. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenMaterializedViewRequest) + com.google.bigtable.v2.OpenMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewRequest.class, + com.google.bigtable.v2.OpenMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenMaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + materializedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest build() { + com.google.bigtable.v2.OpenMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest buildPartial() { + com.google.bigtable.v2.OpenMaterializedViewRequest result = + new com.google.bigtable.v2.OpenMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.materializedViewName_ = materializedViewName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.v2.OpenMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenMaterializedViewRequest other) { + if (other == com.google.bigtable.v2.OpenMaterializedViewRequest.getDefaultInstance()) + return this; + if (!other.getMaterializedViewName().isEmpty()) { + materializedViewName_ = other.materializedViewName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + materializedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + materializedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @param value The materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + materializedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaterializedViewName() { + materializedViewName_ = getDefaultInstance().getMaterializedViewName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @param value The bytes for materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + materializedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission result = + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission( + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenMaterializedViewRequest) + private static final com.google.bigtable.v2.OpenMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenMaterializedViewRequest(); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..e020a78e4615 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + java.lang.String getMaterializedViewName(); + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + com.google.protobuf.ByteString getMaterializedViewNameBytes(); + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java new file mode 100644 index 000000000000..37d6086066ea --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewResponse} + */ +@com.google.protobuf.Generated +public final class OpenMaterializedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenMaterializedViewResponse) + OpenMaterializedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenMaterializedViewResponse"); + } + + // Use OpenMaterializedViewResponse.newBuilder() to construct. + private OpenMaterializedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenMaterializedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewResponse.class, + com.google.bigtable.v2.OpenMaterializedViewResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.OpenMaterializedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenMaterializedViewResponse other = + (com.google.bigtable.v2.OpenMaterializedViewResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse 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.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse 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.OpenMaterializedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenMaterializedViewResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenMaterializedViewResponse) + com.google.bigtable.v2.OpenMaterializedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewResponse.class, + com.google.bigtable.v2.OpenMaterializedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenMaterializedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenMaterializedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse build() { + com.google.bigtable.v2.OpenMaterializedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse buildPartial() { + com.google.bigtable.v2.OpenMaterializedViewResponse result = + new com.google.bigtable.v2.OpenMaterializedViewResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenMaterializedViewResponse) { + return mergeFrom((com.google.bigtable.v2.OpenMaterializedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenMaterializedViewResponse other) { + if (other == com.google.bigtable.v2.OpenMaterializedViewResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenMaterializedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenMaterializedViewResponse) + private static final com.google.bigtable.v2.OpenMaterializedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenMaterializedViewResponse(); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenMaterializedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenMaterializedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java new file mode 100644 index 000000000000..f37e4cd2a843 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenMaterializedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenMaterializedViewResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java new file mode 100644 index 000000000000..1b7374f77b08 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java @@ -0,0 +1,1108 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionRequest} + */ +@com.google.protobuf.Generated +public final class OpenSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenSessionRequest) + OpenSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenSessionRequest"); + } + + // Use OpenSessionRequest.newBuilder() to construct. + private OpenSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenSessionRequest() { + routingCookie_ = com.google.protobuf.ByteString.EMPTY; + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionRequest.class, + com.google.bigtable.v2.OpenSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int PROTOCOL_VERSION_FIELD_NUMBER = 1; + private long protocolVersion_ = 0L; + + /** + * + * + *
+   * A version indicator from the client stating its understanding of the
+   * protocol. This is to disambiguate client behavior amidst changes in
+   * semantic usage of the API, e.g. if the structure remains the same but
+   * behavior changes.
+   * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + @java.lang.Override + public long getProtocolVersion() { + return protocolVersion_; + } + + public static final int FLAGS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.FeatureFlags flags_; + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + @java.lang.Override + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + @java.lang.Override + public com.google.bigtable.v2.FeatureFlags getFlags() { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder() { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + + public static final int CONSECUTIVE_FAILED_CONNECTION_ATTEMPTS_FIELD_NUMBER = 3; + private long consecutiveFailedConnectionAttempts_ = 0L; + + /** + * + * + *
+   * Used for serverside observability.
+   * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + @java.lang.Override + public long getConsecutiveFailedConnectionAttempts() { + return consecutiveFailedConnectionAttempts_; + } + + public static final int ROUTING_COOKIE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString routingCookie_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * How the request should be routed (if presented as part of a GOAWAY
+   * from a previous session). Post V1.
+   * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingCookie() { + return routingCookie_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+   * (or in post-V1, PrepareSqlQueryRequest)
+   * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + 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 (protocolVersion_ != 0L) { + output.writeInt64(1, protocolVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFlags()); + } + if (consecutiveFailedConnectionAttempts_ != 0L) { + output.writeInt64(3, consecutiveFailedConnectionAttempts_); + } + if (!routingCookie_.isEmpty()) { + output.writeBytes(4, routingCookie_); + } + if (!payload_.isEmpty()) { + output.writeBytes(5, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (protocolVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, protocolVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFlags()); + } + if (consecutiveFailedConnectionAttempts_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 3, consecutiveFailedConnectionAttempts_); + } + if (!routingCookie_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, routingCookie_); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, payload_); + } + size += getUnknownFields().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.OpenSessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenSessionRequest other = + (com.google.bigtable.v2.OpenSessionRequest) obj; + + if (getProtocolVersion() != other.getProtocolVersion()) return false; + if (hasFlags() != other.hasFlags()) return false; + if (hasFlags()) { + if (!getFlags().equals(other.getFlags())) return false; + } + if (getConsecutiveFailedConnectionAttempts() != other.getConsecutiveFailedConnectionAttempts()) + return false; + if (!getRoutingCookie().equals(other.getRoutingCookie())) return false; + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROTOCOL_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getProtocolVersion()); + if (hasFlags()) { + hash = (37 * hash) + FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getFlags().hashCode(); + } + hash = (37 * hash) + CONSECUTIVE_FAILED_CONNECTION_ATTEMPTS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(getConsecutiveFailedConnectionAttempts()); + hash = (37 * hash) + ROUTING_COOKIE_FIELD_NUMBER; + hash = (53 * hash) + getRoutingCookie().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest 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.OpenSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest 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.OpenSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenSessionRequest) + com.google.bigtable.v2.OpenSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionRequest.class, + com.google.bigtable.v2.OpenSessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFlagsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + protocolVersion_ = 0L; + flags_ = null; + if (flagsBuilder_ != null) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + } + consecutiveFailedConnectionAttempts_ = 0L; + routingCookie_ = com.google.protobuf.ByteString.EMPTY; + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest build() { + com.google.bigtable.v2.OpenSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest buildPartial() { + com.google.bigtable.v2.OpenSessionRequest result = + new com.google.bigtable.v2.OpenSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.protocolVersion_ = protocolVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flags_ = flagsBuilder_ == null ? flags_ : flagsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.consecutiveFailedConnectionAttempts_ = consecutiveFailedConnectionAttempts_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.routingCookie_ = routingCookie_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenSessionRequest) { + return mergeFrom((com.google.bigtable.v2.OpenSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenSessionRequest other) { + if (other == com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) return this; + if (other.getProtocolVersion() != 0L) { + setProtocolVersion(other.getProtocolVersion()); + } + if (other.hasFlags()) { + mergeFlags(other.getFlags()); + } + if (other.getConsecutiveFailedConnectionAttempts() != 0L) { + setConsecutiveFailedConnectionAttempts(other.getConsecutiveFailedConnectionAttempts()); + } + if (!other.getRoutingCookie().isEmpty()) { + setRoutingCookie(other.getRoutingCookie()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + protocolVersion_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(internalGetFlagsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + consecutiveFailedConnectionAttempts_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + routingCookie_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long protocolVersion_; + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + @java.lang.Override + public long getProtocolVersion() { + return protocolVersion_; + } + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @param value The protocolVersion to set. + * @return This builder for chaining. + */ + public Builder setProtocolVersion(long value) { + + protocolVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearProtocolVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + protocolVersion_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.FeatureFlags flags_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder> + flagsBuilder_; + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + public com.google.bigtable.v2.FeatureFlags getFlags() { + if (flagsBuilder_ == null) { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } else { + return flagsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder setFlags(com.google.bigtable.v2.FeatureFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flags_ = value; + } else { + flagsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder setFlags(com.google.bigtable.v2.FeatureFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + flags_ = builderForValue.build(); + } else { + flagsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder mergeFlags(com.google.bigtable.v2.FeatureFlags value) { + if (flagsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && flags_ != null + && flags_ != com.google.bigtable.v2.FeatureFlags.getDefaultInstance()) { + getFlagsBuilder().mergeFrom(value); + } else { + flags_ = value; + } + } else { + flagsBuilder_.mergeFrom(value); + } + if (flags_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + flags_ = null; + if (flagsBuilder_ != null) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public com.google.bigtable.v2.FeatureFlags.Builder getFlagsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFlagsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder() { + if (flagsBuilder_ != null) { + return flagsBuilder_.getMessageOrBuilder(); + } else { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder> + internalGetFlagsFieldBuilder() { + if (flagsBuilder_ == null) { + flagsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder>( + getFlags(), getParentForChildren(), isClean()); + flags_ = null; + } + return flagsBuilder_; + } + + private long consecutiveFailedConnectionAttempts_; + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + @java.lang.Override + public long getConsecutiveFailedConnectionAttempts() { + return consecutiveFailedConnectionAttempts_; + } + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @param value The consecutiveFailedConnectionAttempts to set. + * @return This builder for chaining. + */ + public Builder setConsecutiveFailedConnectionAttempts(long value) { + + consecutiveFailedConnectionAttempts_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return This builder for chaining. + */ + public Builder clearConsecutiveFailedConnectionAttempts() { + bitField0_ = (bitField0_ & ~0x00000004); + consecutiveFailedConnectionAttempts_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString routingCookie_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingCookie() { + return routingCookie_; + } + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @param value The routingCookie to set. + * @return This builder for chaining. + */ + public Builder setRoutingCookie(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + routingCookie_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @return This builder for chaining. + */ + public Builder clearRoutingCookie() { + bitField0_ = (bitField0_ & ~0x00000008); + routingCookie_ = getDefaultInstance().getRoutingCookie(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000010); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenSessionRequest) + private static final com.google.bigtable.v2.OpenSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenSessionRequest(); + } + + public static com.google.bigtable.v2.OpenSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java new file mode 100644 index 000000000000..0ec579f66c5b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A version indicator from the client stating its understanding of the
+   * protocol. This is to disambiguate client behavior amidst changes in
+   * semantic usage of the API, e.g. if the structure remains the same but
+   * behavior changes.
+   * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + long getProtocolVersion(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + boolean hasFlags(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + com.google.bigtable.v2.FeatureFlags getFlags(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder(); + + /** + * + * + *
+   * Used for serverside observability.
+   * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + long getConsecutiveFailedConnectionAttempts(); + + /** + * + * + *
+   * How the request should be routed (if presented as part of a GOAWAY
+   * from a previous session). Post V1.
+   * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + com.google.protobuf.ByteString getRoutingCookie(); + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+   * (or in post-V1, PrepareSqlQueryRequest)
+   * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java new file mode 100644 index 000000000000..241c47f12a7c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java @@ -0,0 +1,801 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionResponse} + */ +@com.google.protobuf.Generated +public final class OpenSessionResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenSessionResponse) + OpenSessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenSessionResponse"); + } + + // Use OpenSessionResponse.newBuilder() to construct. + private OpenSessionResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenSessionResponse() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionResponse.class, + com.google.bigtable.v2.OpenSessionResponse.Builder.class); + } + + private int bitField0_; + public static final int BACKEND_FIELD_NUMBER = 2; + private com.google.bigtable.v2.BackendIdentifier backend_; + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + @java.lang.Override + public boolean hasBackend() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier getBackend() { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder() { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+   * (or in post-V1, PrepareSqlQueryResponse)
+   * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + 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 (!payload_.isEmpty()) { + output.writeBytes(1, payload_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBackend()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, payload_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackend()); + } + size += getUnknownFields().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.OpenSessionResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenSessionResponse other = + (com.google.bigtable.v2.OpenSessionResponse) obj; + + if (hasBackend() != other.hasBackend()) return false; + if (hasBackend()) { + if (!getBackend().equals(other.getBackend())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackend()) { + hash = (37 * hash) + BACKEND_FIELD_NUMBER; + hash = (53 * hash) + getBackend().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse 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.OpenSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse 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.OpenSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenSessionResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenSessionResponse) + com.google.bigtable.v2.OpenSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionResponse.class, + com.google.bigtable.v2.OpenSessionResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenSessionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackendFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); + backendBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse build() { + com.google.bigtable.v2.OpenSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse buildPartial() { + com.google.bigtable.v2.OpenSessionResponse result = + new com.google.bigtable.v2.OpenSessionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenSessionResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backend_ = backendBuilder_ == null ? backend_ : backendBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenSessionResponse) { + return mergeFrom((com.google.bigtable.v2.OpenSessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenSessionResponse other) { + if (other == com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance()) return this; + if (other.hasBackend()) { + mergeBackend(other.getBackend()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetBackendFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.BackendIdentifier backend_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder> + backendBuilder_; + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + public boolean hasBackend() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + public com.google.bigtable.v2.BackendIdentifier getBackend() { + if (backendBuilder_ == null) { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } else { + return backendBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder setBackend(com.google.bigtable.v2.BackendIdentifier value) { + if (backendBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backend_ = value; + } else { + backendBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder setBackend(com.google.bigtable.v2.BackendIdentifier.Builder builderForValue) { + if (backendBuilder_ == null) { + backend_ = builderForValue.build(); + } else { + backendBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder mergeBackend(com.google.bigtable.v2.BackendIdentifier value) { + if (backendBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backend_ != null + && backend_ != com.google.bigtable.v2.BackendIdentifier.getDefaultInstance()) { + getBackendBuilder().mergeFrom(value); + } else { + backend_ = value; + } + } else { + backendBuilder_.mergeFrom(value); + } + if (backend_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder clearBackend() { + bitField0_ = (bitField0_ & ~0x00000001); + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); + backendBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public com.google.bigtable.v2.BackendIdentifier.Builder getBackendBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackendFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder() { + if (backendBuilder_ != null) { + return backendBuilder_.getMessageOrBuilder(); + } else { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder> + internalGetBackendFieldBuilder() { + if (backendBuilder_ == null) { + backendBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder>( + getBackend(), getParentForChildren(), isClean()); + backend_ = null; + } + return backendBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000002); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenSessionResponse) + private static final com.google.bigtable.v2.OpenSessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenSessionResponse(); + } + + public static com.google.bigtable.v2.OpenSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenSessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java new file mode 100644 index 000000000000..c27747a34028 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenSessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + boolean hasBackend(); + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + com.google.bigtable.v2.BackendIdentifier getBackend(); + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder(); + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+   * (or in post-V1, PrepareSqlQueryResponse)
+   * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java new file mode 100644 index 000000000000..924a7926f468 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java @@ -0,0 +1,938 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableRequest} + */ +@com.google.protobuf.Generated +public final class OpenTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenTableRequest) + OpenTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenTableRequest"); + } + + // Use OpenTableRequest.newBuilder() to construct. + private OpenTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenTableRequest() { + tableName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableRequest.class, + com.google.bigtable.v2.OpenTableRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenTableRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + /** PERMISSION_WRITE = 2; */ + PERMISSION_WRITE(2), + /** PERMISSION_READ_WRITE = 3; */ + PERMISSION_READ_WRITE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + /** PERMISSION_WRITE = 2; */ + public static final int PERMISSION_WRITE_VALUE = 2; + + /** PERMISSION_READ_WRITE = 3; */ + public static final int PERMISSION_READ_WRITE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + case 2: + return PERMISSION_WRITE; + case 3: + return PERMISSION_READ_WRITE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenTableRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenTableRequest.Permission) + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * string table_name = 1; + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest.Permission getPermission() { + com.google.bigtable.v2.OpenTableRequest.Permission result = + com.google.bigtable.v2.OpenTableRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenTableRequest.Permission.UNRECOGNIZED + : result; + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenTableRequest.Permission.PERMISSION_UNSET.getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenTableRequest.Permission.PERMISSION_UNSET.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().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.OpenTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenTableRequest other = (com.google.bigtable.v2.OpenTableRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest 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.OpenTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest 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.OpenTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenTableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenTableRequest) + com.google.bigtable.v2.OpenTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableRequest.class, + com.google.bigtable.v2.OpenTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest build() { + com.google.bigtable.v2.OpenTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest buildPartial() { + com.google.bigtable.v2.OpenTableRequest result = + new com.google.bigtable.v2.OpenTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenTableRequest) { + return mergeFrom((com.google.bigtable.v2.OpenTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenTableRequest other) { + if (other == com.google.bigtable.v2.OpenTableRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * string table_name = 1; + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string table_name = 1; + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string table_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string table_name = 1; + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest.Permission getPermission() { + com.google.bigtable.v2.OpenTableRequest.Permission result = + com.google.bigtable.v2.OpenTableRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenTableRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission(com.google.bigtable.v2.OpenTableRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenTableRequest) + private static final com.google.bigtable.v2.OpenTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenTableRequest(); + } + + public static com.google.bigtable.v2.OpenTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java new file mode 100644 index 000000000000..968dc3a1dbad --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string table_name = 1; + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenTableRequest.Permission getPermission(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java new file mode 100644 index 000000000000..a738487aefaf --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableResponse} + */ +@com.google.protobuf.Generated +public final class OpenTableResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenTableResponse) + OpenTableResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenTableResponse"); + } + + // Use OpenTableResponse.newBuilder() to construct. + private OpenTableResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenTableResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableResponse.class, + com.google.bigtable.v2.OpenTableResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.OpenTableResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenTableResponse other = (com.google.bigtable.v2.OpenTableResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse 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.OpenTableResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse 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.OpenTableResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.OpenTableResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenTableResponse) + com.google.bigtable.v2.OpenTableResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableResponse.class, + com.google.bigtable.v2.OpenTableResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenTableResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenTableResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse build() { + com.google.bigtable.v2.OpenTableResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse buildPartial() { + com.google.bigtable.v2.OpenTableResponse result = + new com.google.bigtable.v2.OpenTableResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenTableResponse) { + return mergeFrom((com.google.bigtable.v2.OpenTableResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenTableResponse other) { + if (other == com.google.bigtable.v2.OpenTableResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenTableResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenTableResponse) + private static final com.google.bigtable.v2.OpenTableResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenTableResponse(); + } + + public static com.google.bigtable.v2.OpenTableResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenTableResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpenTableResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java new file mode 100644 index 000000000000..2f872a59f996 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenTableResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenTableResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java new file mode 100644 index 000000000000..ca2dd85f010c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java @@ -0,0 +1,1500 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A partial result set from the streaming query API.
+ * Cloud Bigtable clients buffer partial results received in this message until
+ * a `resume_token` is received.
+ *
+ * The pseudocode below describes how to buffer and parse a stream of
+ * `PartialResultSet` messages.
+ *
+ * Having:
+ * - queue of row results waiting to be returned `queue`
+ * - extensible buffer of bytes `buffer`
+ * - a place to keep track of the most recent `resume_token`
+ * for each PartialResultSet `p` received {
+ * if p.reset {
+ * ensure `queue` is empty
+ * ensure `buffer` is empty
+ * }
+ * if p.estimated_batch_size != 0 {
+ * (optional) ensure `buffer` is sized to at least `p.estimated_batch_size`
+ * }
+ * if `p.proto_rows_batch` is set {
+ * append `p.proto_rows_batch.bytes` to `buffer`
+ * }
+ * if p.batch_checksum is set and `buffer` is not empty {
+ * validate the checksum matches the contents of `buffer`
+ * (see comments on `batch_checksum`)
+ * parse `buffer` as `ProtoRows` message, clearing `buffer`
+ * add parsed rows to end of `queue`
+ * }
+ * if p.resume_token is set {
+ * release results in `queue`
+ * save `p.resume_token` in `resume_token`
+ * }
+ * }
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PartialResultSet} + */ +@com.google.protobuf.Generated +public final class PartialResultSet extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PartialResultSet) + PartialResultSetOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialResultSet"); + } + + // Use PartialResultSet.newBuilder() to construct. + private PartialResultSet(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PartialResultSet() { + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_PartialResultSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PartialResultSet.class, + com.google.bigtable.v2.PartialResultSet.Builder.class); + } + + private int bitField0_; + private int partialRowsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object partialRows_; + + public enum PartialRowsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROTO_ROWS_BATCH(3), + PARTIALROWS_NOT_SET(0); + private final int value; + + private PartialRowsCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PartialRowsCase valueOf(int value) { + return forNumber(value); + } + + public static PartialRowsCase forNumber(int value) { + switch (value) { + case 3: + return PROTO_ROWS_BATCH; + case 0: + return PARTIALROWS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PartialRowsCase getPartialRowsCase() { + return PartialRowsCase.forNumber(partialRowsCase_); + } + + public static final int PROTO_ROWS_BATCH_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return Whether the protoRowsBatch field is set. + */ + @java.lang.Override + public boolean hasProtoRowsBatch() { + return partialRowsCase_ == 3; + } + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return The protoRowsBatch. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatch getProtoRowsBatch() { + if (partialRowsCase_ == 3) { + return (com.google.bigtable.v2.ProtoRowsBatch) partialRows_; + } + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatchOrBuilder getProtoRowsBatchOrBuilder() { + if (partialRowsCase_ == 3) { + return (com.google.bigtable.v2.ProtoRowsBatch) partialRows_; + } + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + + public static final int BATCH_CHECKSUM_FIELD_NUMBER = 6; + private int batchChecksum_ = 0; + + /** + * + * + *
+   * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+   *
+   * When present, the buffered data from `partial_rows` forms a complete
+   * parseable message of the appropriate type.
+   *
+   * The client should mark the end of a parseable message and prepare to
+   * receive a new one starting from the next `PartialResultSet` message.
+   * Clients must verify the checksum of the serialized batch before yielding it
+   * to the caller.
+   *
+   * This does NOT mean the values can be yielded to the callers since a
+   * `resume_token` is required to safely do so.
+   *
+   * If `resume_token` is non-empty and any data has been received since the
+   * last one, this field is guaranteed to be non-empty. In other words, clients
+   * may assume that a batch will never cross a `resume_token` boundary.
+   * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return Whether the batchChecksum field is set. + */ + @java.lang.Override + public boolean hasBatchChecksum() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+   *
+   * When present, the buffered data from `partial_rows` forms a complete
+   * parseable message of the appropriate type.
+   *
+   * The client should mark the end of a parseable message and prepare to
+   * receive a new one starting from the next `PartialResultSet` message.
+   * Clients must verify the checksum of the serialized batch before yielding it
+   * to the caller.
+   *
+   * This does NOT mean the values can be yielded to the callers since a
+   * `resume_token` is required to safely do so.
+   *
+   * If `resume_token` is non-empty and any data has been received since the
+   * last one, this field is guaranteed to be non-empty. In other words, clients
+   * may assume that a batch will never cross a `resume_token` boundary.
+   * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return The batchChecksum. + */ + @java.lang.Override + public int getBatchChecksum() { + return batchChecksum_; + } + + public static final int RESUME_TOKEN_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * An opaque token sent by the server to allow query resumption and signal
+   * that the buffered values constructed from received `partial_rows` can be
+   * yielded to the caller. Clients can provide this token in a subsequent
+   * request to resume the result stream from the current point.
+   *
+   * When `resume_token` is non-empty, the buffered values received from
+   * `partial_rows` since the last non-empty `resume_token` can be yielded to
+   * the callers, provided that the client keeps the value of `resume_token` and
+   * uses it on subsequent retries.
+   *
+   * A `resume_token` may be sent without information in `partial_rows` to
+   * checkpoint the progress of a sparse query. Any previous `partial_rows` data
+   * should still be yielded in this case, and the new `resume_token` should be
+   * saved for future retries as normal.
+   *
+   * A `resume_token` will only be sent on a boundary where there is either no
+   * ongoing result batch, or `batch_checksum` is also populated.
+   *
+   * The server will also send a sentinel `resume_token` when last batch of
+   * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with
+   * the sentinel `resume_token`, the server will emit it again without any
+   * data in `partial_rows`, then return OK.
+   * 
+ * + * bytes resume_token = 5; + * + * @return The resumeToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + + public static final int RESET_FIELD_NUMBER = 7; + private boolean reset_ = false; + + /** + * + * + *
+   * If `true`, any data buffered since the last non-empty `resume_token` must
+   * be discarded before the other parts of this message, if any, are handled.
+   * 
+ * + * bool reset = 7; + * + * @return The reset. + */ + @java.lang.Override + public boolean getReset() { + return reset_; + } + + public static final int ESTIMATED_BATCH_SIZE_FIELD_NUMBER = 4; + private int estimatedBatchSize_ = 0; + + /** + * + * + *
+   * Estimated size of the buffer required to hold the next batch of results.
+   *
+   * This value will be sent with the first `partial_rows` of a batch. That is,
+   * on the first `partial_rows` received in a stream, on the first message
+   * after a `batch_checksum` message, and any time `reset` is true.
+   *
+   * The client can use this estimate to allocate a buffer for the next batch of
+   * results. This helps minimize the number of allocations required, though the
+   * buffer size may still need to be increased if the estimate is too low.
+   * 
+ * + * int32 estimated_batch_size = 4; + * + * @return The estimatedBatchSize. + */ + @java.lang.Override + public int getEstimatedBatchSize() { + return estimatedBatchSize_; + } + + 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 (partialRowsCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.ProtoRowsBatch) partialRows_); + } + if (estimatedBatchSize_ != 0) { + output.writeInt32(4, estimatedBatchSize_); + } + if (!resumeToken_.isEmpty()) { + output.writeBytes(5, resumeToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(6, batchChecksum_); + } + if (reset_ != false) { + output.writeBool(7, reset_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (partialRowsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.ProtoRowsBatch) partialRows_); + } + if (estimatedBatchSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, estimatedBatchSize_); + } + if (!resumeToken_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, resumeToken_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(6, batchChecksum_); + } + if (reset_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, reset_); + } + size += getUnknownFields().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.PartialResultSet)) { + return super.equals(obj); + } + com.google.bigtable.v2.PartialResultSet other = (com.google.bigtable.v2.PartialResultSet) obj; + + if (hasBatchChecksum() != other.hasBatchChecksum()) return false; + if (hasBatchChecksum()) { + if (getBatchChecksum() != other.getBatchChecksum()) return false; + } + if (!getResumeToken().equals(other.getResumeToken())) return false; + if (getReset() != other.getReset()) return false; + if (getEstimatedBatchSize() != other.getEstimatedBatchSize()) return false; + if (!getPartialRowsCase().equals(other.getPartialRowsCase())) return false; + switch (partialRowsCase_) { + case 3: + if (!getProtoRowsBatch().equals(other.getProtoRowsBatch())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBatchChecksum()) { + hash = (37 * hash) + BATCH_CHECKSUM_FIELD_NUMBER; + hash = (53 * hash) + getBatchChecksum(); + } + hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getResumeToken().hashCode(); + hash = (37 * hash) + RESET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReset()); + hash = (37 * hash) + ESTIMATED_BATCH_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getEstimatedBatchSize(); + switch (partialRowsCase_) { + case 3: + hash = (37 * hash) + PROTO_ROWS_BATCH_FIELD_NUMBER; + hash = (53 * hash) + getProtoRowsBatch().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PartialResultSet 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.PartialResultSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PartialResultSet 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.PartialResultSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PartialResultSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PartialResultSet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PartialResultSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.PartialResultSet 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A partial result set from the streaming query API.
+   * Cloud Bigtable clients buffer partial results received in this message until
+   * a `resume_token` is received.
+   *
+   * The pseudocode below describes how to buffer and parse a stream of
+   * `PartialResultSet` messages.
+   *
+   * Having:
+   * - queue of row results waiting to be returned `queue`
+   * - extensible buffer of bytes `buffer`
+   * - a place to keep track of the most recent `resume_token`
+   * for each PartialResultSet `p` received {
+   * if p.reset {
+   * ensure `queue` is empty
+   * ensure `buffer` is empty
+   * }
+   * if p.estimated_batch_size != 0 {
+   * (optional) ensure `buffer` is sized to at least `p.estimated_batch_size`
+   * }
+   * if `p.proto_rows_batch` is set {
+   * append `p.proto_rows_batch.bytes` to `buffer`
+   * }
+   * if p.batch_checksum is set and `buffer` is not empty {
+   * validate the checksum matches the contents of `buffer`
+   * (see comments on `batch_checksum`)
+   * parse `buffer` as `ProtoRows` message, clearing `buffer`
+   * add parsed rows to end of `queue`
+   * }
+   * if p.resume_token is set {
+   * release results in `queue`
+   * save `p.resume_token` in `resume_token`
+   * }
+   * }
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PartialResultSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PartialResultSet) + com.google.bigtable.v2.PartialResultSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_PartialResultSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PartialResultSet.class, + com.google.bigtable.v2.PartialResultSet.Builder.class); + } + + // Construct using com.google.bigtable.v2.PartialResultSet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (protoRowsBatchBuilder_ != null) { + protoRowsBatchBuilder_.clear(); + } + batchChecksum_ = 0; + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + reset_ = false; + estimatedBatchSize_ = 0; + partialRowsCase_ = 0; + partialRows_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_PartialResultSet_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PartialResultSet getDefaultInstanceForType() { + return com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PartialResultSet build() { + com.google.bigtable.v2.PartialResultSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PartialResultSet buildPartial() { + com.google.bigtable.v2.PartialResultSet result = + new com.google.bigtable.v2.PartialResultSet(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.PartialResultSet result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.batchChecksum_ = batchChecksum_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resumeToken_ = resumeToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.reset_ = reset_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.estimatedBatchSize_ = estimatedBatchSize_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.PartialResultSet result) { + result.partialRowsCase_ = partialRowsCase_; + result.partialRows_ = this.partialRows_; + if (partialRowsCase_ == 3 && protoRowsBatchBuilder_ != null) { + result.partialRows_ = protoRowsBatchBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PartialResultSet) { + return mergeFrom((com.google.bigtable.v2.PartialResultSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PartialResultSet other) { + if (other == com.google.bigtable.v2.PartialResultSet.getDefaultInstance()) return this; + if (other.hasBatchChecksum()) { + setBatchChecksum(other.getBatchChecksum()); + } + if (!other.getResumeToken().isEmpty()) { + setResumeToken(other.getResumeToken()); + } + if (other.getReset() != false) { + setReset(other.getReset()); + } + if (other.getEstimatedBatchSize() != 0) { + setEstimatedBatchSize(other.getEstimatedBatchSize()); + } + switch (other.getPartialRowsCase()) { + case PROTO_ROWS_BATCH: + { + mergeProtoRowsBatch(other.getProtoRowsBatch()); + break; + } + case PARTIALROWS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 26: + { + input.readMessage( + internalGetProtoRowsBatchFieldBuilder().getBuilder(), extensionRegistry); + partialRowsCase_ = 3; + break; + } // case 26 + case 32: + { + estimatedBatchSize_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 42: + { + resumeToken_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 48: + { + batchChecksum_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 48 + case 56: + { + reset_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int partialRowsCase_ = 0; + private java.lang.Object partialRows_; + + public PartialRowsCase getPartialRowsCase() { + return PartialRowsCase.forNumber(partialRowsCase_); + } + + public Builder clearPartialRows() { + partialRowsCase_ = 0; + partialRows_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoRowsBatch, + com.google.bigtable.v2.ProtoRowsBatch.Builder, + com.google.bigtable.v2.ProtoRowsBatchOrBuilder> + protoRowsBatchBuilder_; + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return Whether the protoRowsBatch field is set. + */ + @java.lang.Override + public boolean hasProtoRowsBatch() { + return partialRowsCase_ == 3; + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return The protoRowsBatch. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatch getProtoRowsBatch() { + if (protoRowsBatchBuilder_ == null) { + if (partialRowsCase_ == 3) { + return (com.google.bigtable.v2.ProtoRowsBatch) partialRows_; + } + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } else { + if (partialRowsCase_ == 3) { + return protoRowsBatchBuilder_.getMessage(); + } + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + public Builder setProtoRowsBatch(com.google.bigtable.v2.ProtoRowsBatch value) { + if (protoRowsBatchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partialRows_ = value; + onChanged(); + } else { + protoRowsBatchBuilder_.setMessage(value); + } + partialRowsCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + public Builder setProtoRowsBatch( + com.google.bigtable.v2.ProtoRowsBatch.Builder builderForValue) { + if (protoRowsBatchBuilder_ == null) { + partialRows_ = builderForValue.build(); + onChanged(); + } else { + protoRowsBatchBuilder_.setMessage(builderForValue.build()); + } + partialRowsCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + public Builder mergeProtoRowsBatch(com.google.bigtable.v2.ProtoRowsBatch value) { + if (protoRowsBatchBuilder_ == null) { + if (partialRowsCase_ == 3 + && partialRows_ != com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance()) { + partialRows_ = + com.google.bigtable.v2.ProtoRowsBatch.newBuilder( + (com.google.bigtable.v2.ProtoRowsBatch) partialRows_) + .mergeFrom(value) + .buildPartial(); + } else { + partialRows_ = value; + } + onChanged(); + } else { + if (partialRowsCase_ == 3) { + protoRowsBatchBuilder_.mergeFrom(value); + } else { + protoRowsBatchBuilder_.setMessage(value); + } + } + partialRowsCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + public Builder clearProtoRowsBatch() { + if (protoRowsBatchBuilder_ == null) { + if (partialRowsCase_ == 3) { + partialRowsCase_ = 0; + partialRows_ = null; + onChanged(); + } + } else { + if (partialRowsCase_ == 3) { + partialRowsCase_ = 0; + partialRows_ = null; + } + protoRowsBatchBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + public com.google.bigtable.v2.ProtoRowsBatch.Builder getProtoRowsBatchBuilder() { + return internalGetProtoRowsBatchFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatchOrBuilder getProtoRowsBatchOrBuilder() { + if ((partialRowsCase_ == 3) && (protoRowsBatchBuilder_ != null)) { + return protoRowsBatchBuilder_.getMessageOrBuilder(); + } else { + if (partialRowsCase_ == 3) { + return (com.google.bigtable.v2.ProtoRowsBatch) partialRows_; + } + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partial rows in serialized ProtoRows format.
+     * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoRowsBatch, + com.google.bigtable.v2.ProtoRowsBatch.Builder, + com.google.bigtable.v2.ProtoRowsBatchOrBuilder> + internalGetProtoRowsBatchFieldBuilder() { + if (protoRowsBatchBuilder_ == null) { + if (!(partialRowsCase_ == 3)) { + partialRows_ = com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + protoRowsBatchBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoRowsBatch, + com.google.bigtable.v2.ProtoRowsBatch.Builder, + com.google.bigtable.v2.ProtoRowsBatchOrBuilder>( + (com.google.bigtable.v2.ProtoRowsBatch) partialRows_, + getParentForChildren(), + isClean()); + partialRows_ = null; + } + partialRowsCase_ = 3; + onChanged(); + return protoRowsBatchBuilder_; + } + + private int batchChecksum_; + + /** + * + * + *
+     * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+     *
+     * When present, the buffered data from `partial_rows` forms a complete
+     * parseable message of the appropriate type.
+     *
+     * The client should mark the end of a parseable message and prepare to
+     * receive a new one starting from the next `PartialResultSet` message.
+     * Clients must verify the checksum of the serialized batch before yielding it
+     * to the caller.
+     *
+     * This does NOT mean the values can be yielded to the callers since a
+     * `resume_token` is required to safely do so.
+     *
+     * If `resume_token` is non-empty and any data has been received since the
+     * last one, this field is guaranteed to be non-empty. In other words, clients
+     * may assume that a batch will never cross a `resume_token` boundary.
+     * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return Whether the batchChecksum field is set. + */ + @java.lang.Override + public boolean hasBatchChecksum() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+     *
+     * When present, the buffered data from `partial_rows` forms a complete
+     * parseable message of the appropriate type.
+     *
+     * The client should mark the end of a parseable message and prepare to
+     * receive a new one starting from the next `PartialResultSet` message.
+     * Clients must verify the checksum of the serialized batch before yielding it
+     * to the caller.
+     *
+     * This does NOT mean the values can be yielded to the callers since a
+     * `resume_token` is required to safely do so.
+     *
+     * If `resume_token` is non-empty and any data has been received since the
+     * last one, this field is guaranteed to be non-empty. In other words, clients
+     * may assume that a batch will never cross a `resume_token` boundary.
+     * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return The batchChecksum. + */ + @java.lang.Override + public int getBatchChecksum() { + return batchChecksum_; + } + + /** + * + * + *
+     * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+     *
+     * When present, the buffered data from `partial_rows` forms a complete
+     * parseable message of the appropriate type.
+     *
+     * The client should mark the end of a parseable message and prepare to
+     * receive a new one starting from the next `PartialResultSet` message.
+     * Clients must verify the checksum of the serialized batch before yielding it
+     * to the caller.
+     *
+     * This does NOT mean the values can be yielded to the callers since a
+     * `resume_token` is required to safely do so.
+     *
+     * If `resume_token` is non-empty and any data has been received since the
+     * last one, this field is guaranteed to be non-empty. In other words, clients
+     * may assume that a batch will never cross a `resume_token` boundary.
+     * 
+ * + * optional uint32 batch_checksum = 6; + * + * @param value The batchChecksum to set. + * @return This builder for chaining. + */ + public Builder setBatchChecksum(int value) { + + batchChecksum_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+     *
+     * When present, the buffered data from `partial_rows` forms a complete
+     * parseable message of the appropriate type.
+     *
+     * The client should mark the end of a parseable message and prepare to
+     * receive a new one starting from the next `PartialResultSet` message.
+     * Clients must verify the checksum of the serialized batch before yielding it
+     * to the caller.
+     *
+     * This does NOT mean the values can be yielded to the callers since a
+     * `resume_token` is required to safely do so.
+     *
+     * If `resume_token` is non-empty and any data has been received since the
+     * last one, this field is guaranteed to be non-empty. In other words, clients
+     * may assume that a batch will never cross a `resume_token` boundary.
+     * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return This builder for chaining. + */ + public Builder clearBatchChecksum() { + bitField0_ = (bitField0_ & ~0x00000002); + batchChecksum_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * An opaque token sent by the server to allow query resumption and signal
+     * that the buffered values constructed from received `partial_rows` can be
+     * yielded to the caller. Clients can provide this token in a subsequent
+     * request to resume the result stream from the current point.
+     *
+     * When `resume_token` is non-empty, the buffered values received from
+     * `partial_rows` since the last non-empty `resume_token` can be yielded to
+     * the callers, provided that the client keeps the value of `resume_token` and
+     * uses it on subsequent retries.
+     *
+     * A `resume_token` may be sent without information in `partial_rows` to
+     * checkpoint the progress of a sparse query. Any previous `partial_rows` data
+     * should still be yielded in this case, and the new `resume_token` should be
+     * saved for future retries as normal.
+     *
+     * A `resume_token` will only be sent on a boundary where there is either no
+     * ongoing result batch, or `batch_checksum` is also populated.
+     *
+     * The server will also send a sentinel `resume_token` when last batch of
+     * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with
+     * the sentinel `resume_token`, the server will emit it again without any
+     * data in `partial_rows`, then return OK.
+     * 
+ * + * bytes resume_token = 5; + * + * @return The resumeToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResumeToken() { + return resumeToken_; + } + + /** + * + * + *
+     * An opaque token sent by the server to allow query resumption and signal
+     * that the buffered values constructed from received `partial_rows` can be
+     * yielded to the caller. Clients can provide this token in a subsequent
+     * request to resume the result stream from the current point.
+     *
+     * When `resume_token` is non-empty, the buffered values received from
+     * `partial_rows` since the last non-empty `resume_token` can be yielded to
+     * the callers, provided that the client keeps the value of `resume_token` and
+     * uses it on subsequent retries.
+     *
+     * A `resume_token` may be sent without information in `partial_rows` to
+     * checkpoint the progress of a sparse query. Any previous `partial_rows` data
+     * should still be yielded in this case, and the new `resume_token` should be
+     * saved for future retries as normal.
+     *
+     * A `resume_token` will only be sent on a boundary where there is either no
+     * ongoing result batch, or `batch_checksum` is also populated.
+     *
+     * The server will also send a sentinel `resume_token` when last batch of
+     * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with
+     * the sentinel `resume_token`, the server will emit it again without any
+     * data in `partial_rows`, then return OK.
+     * 
+ * + * bytes resume_token = 5; + * + * @param value The resumeToken to set. + * @return This builder for chaining. + */ + public Builder setResumeToken(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + resumeToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque token sent by the server to allow query resumption and signal
+     * that the buffered values constructed from received `partial_rows` can be
+     * yielded to the caller. Clients can provide this token in a subsequent
+     * request to resume the result stream from the current point.
+     *
+     * When `resume_token` is non-empty, the buffered values received from
+     * `partial_rows` since the last non-empty `resume_token` can be yielded to
+     * the callers, provided that the client keeps the value of `resume_token` and
+     * uses it on subsequent retries.
+     *
+     * A `resume_token` may be sent without information in `partial_rows` to
+     * checkpoint the progress of a sparse query. Any previous `partial_rows` data
+     * should still be yielded in this case, and the new `resume_token` should be
+     * saved for future retries as normal.
+     *
+     * A `resume_token` will only be sent on a boundary where there is either no
+     * ongoing result batch, or `batch_checksum` is also populated.
+     *
+     * The server will also send a sentinel `resume_token` when last batch of
+     * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with
+     * the sentinel `resume_token`, the server will emit it again without any
+     * data in `partial_rows`, then return OK.
+     * 
+ * + * bytes resume_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearResumeToken() { + bitField0_ = (bitField0_ & ~0x00000004); + resumeToken_ = getDefaultInstance().getResumeToken(); + onChanged(); + return this; + } + + private boolean reset_; + + /** + * + * + *
+     * If `true`, any data buffered since the last non-empty `resume_token` must
+     * be discarded before the other parts of this message, if any, are handled.
+     * 
+ * + * bool reset = 7; + * + * @return The reset. + */ + @java.lang.Override + public boolean getReset() { + return reset_; + } + + /** + * + * + *
+     * If `true`, any data buffered since the last non-empty `resume_token` must
+     * be discarded before the other parts of this message, if any, are handled.
+     * 
+ * + * bool reset = 7; + * + * @param value The reset to set. + * @return This builder for chaining. + */ + public Builder setReset(boolean value) { + + reset_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * If `true`, any data buffered since the last non-empty `resume_token` must
+     * be discarded before the other parts of this message, if any, are handled.
+     * 
+ * + * bool reset = 7; + * + * @return This builder for chaining. + */ + public Builder clearReset() { + bitField0_ = (bitField0_ & ~0x00000008); + reset_ = false; + onChanged(); + return this; + } + + private int estimatedBatchSize_; + + /** + * + * + *
+     * Estimated size of the buffer required to hold the next batch of results.
+     *
+     * This value will be sent with the first `partial_rows` of a batch. That is,
+     * on the first `partial_rows` received in a stream, on the first message
+     * after a `batch_checksum` message, and any time `reset` is true.
+     *
+     * The client can use this estimate to allocate a buffer for the next batch of
+     * results. This helps minimize the number of allocations required, though the
+     * buffer size may still need to be increased if the estimate is too low.
+     * 
+ * + * int32 estimated_batch_size = 4; + * + * @return The estimatedBatchSize. + */ + @java.lang.Override + public int getEstimatedBatchSize() { + return estimatedBatchSize_; + } + + /** + * + * + *
+     * Estimated size of the buffer required to hold the next batch of results.
+     *
+     * This value will be sent with the first `partial_rows` of a batch. That is,
+     * on the first `partial_rows` received in a stream, on the first message
+     * after a `batch_checksum` message, and any time `reset` is true.
+     *
+     * The client can use this estimate to allocate a buffer for the next batch of
+     * results. This helps minimize the number of allocations required, though the
+     * buffer size may still need to be increased if the estimate is too low.
+     * 
+ * + * int32 estimated_batch_size = 4; + * + * @param value The estimatedBatchSize to set. + * @return This builder for chaining. + */ + public Builder setEstimatedBatchSize(int value) { + + estimatedBatchSize_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Estimated size of the buffer required to hold the next batch of results.
+     *
+     * This value will be sent with the first `partial_rows` of a batch. That is,
+     * on the first `partial_rows` received in a stream, on the first message
+     * after a `batch_checksum` message, and any time `reset` is true.
+     *
+     * The client can use this estimate to allocate a buffer for the next batch of
+     * results. This helps minimize the number of allocations required, though the
+     * buffer size may still need to be increased if the estimate is too low.
+     * 
+ * + * int32 estimated_batch_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearEstimatedBatchSize() { + bitField0_ = (bitField0_ & ~0x00000010); + estimatedBatchSize_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PartialResultSet) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PartialResultSet) + private static final com.google.bigtable.v2.PartialResultSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PartialResultSet(); + } + + public static com.google.bigtable.v2.PartialResultSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartialResultSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.PartialResultSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.java new file mode 100644 index 000000000000..b0f0454d61ae --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface PartialResultSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PartialResultSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return Whether the protoRowsBatch field is set. + */ + boolean hasProtoRowsBatch(); + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + * + * @return The protoRowsBatch. + */ + com.google.bigtable.v2.ProtoRowsBatch getProtoRowsBatch(); + + /** + * + * + *
+   * Partial rows in serialized ProtoRows format.
+   * 
+ * + * .google.bigtable.v2.ProtoRowsBatch proto_rows_batch = 3; + */ + com.google.bigtable.v2.ProtoRowsBatchOrBuilder getProtoRowsBatchOrBuilder(); + + /** + * + * + *
+   * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+   *
+   * When present, the buffered data from `partial_rows` forms a complete
+   * parseable message of the appropriate type.
+   *
+   * The client should mark the end of a parseable message and prepare to
+   * receive a new one starting from the next `PartialResultSet` message.
+   * Clients must verify the checksum of the serialized batch before yielding it
+   * to the caller.
+   *
+   * This does NOT mean the values can be yielded to the callers since a
+   * `resume_token` is required to safely do so.
+   *
+   * If `resume_token` is non-empty and any data has been received since the
+   * last one, this field is guaranteed to be non-empty. In other words, clients
+   * may assume that a batch will never cross a `resume_token` boundary.
+   * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return Whether the batchChecksum field is set. + */ + boolean hasBatchChecksum(); + + /** + * + * + *
+   * CRC32C checksum of concatenated `partial_rows` data for the current batch.
+   *
+   * When present, the buffered data from `partial_rows` forms a complete
+   * parseable message of the appropriate type.
+   *
+   * The client should mark the end of a parseable message and prepare to
+   * receive a new one starting from the next `PartialResultSet` message.
+   * Clients must verify the checksum of the serialized batch before yielding it
+   * to the caller.
+   *
+   * This does NOT mean the values can be yielded to the callers since a
+   * `resume_token` is required to safely do so.
+   *
+   * If `resume_token` is non-empty and any data has been received since the
+   * last one, this field is guaranteed to be non-empty. In other words, clients
+   * may assume that a batch will never cross a `resume_token` boundary.
+   * 
+ * + * optional uint32 batch_checksum = 6; + * + * @return The batchChecksum. + */ + int getBatchChecksum(); + + /** + * + * + *
+   * An opaque token sent by the server to allow query resumption and signal
+   * that the buffered values constructed from received `partial_rows` can be
+   * yielded to the caller. Clients can provide this token in a subsequent
+   * request to resume the result stream from the current point.
+   *
+   * When `resume_token` is non-empty, the buffered values received from
+   * `partial_rows` since the last non-empty `resume_token` can be yielded to
+   * the callers, provided that the client keeps the value of `resume_token` and
+   * uses it on subsequent retries.
+   *
+   * A `resume_token` may be sent without information in `partial_rows` to
+   * checkpoint the progress of a sparse query. Any previous `partial_rows` data
+   * should still be yielded in this case, and the new `resume_token` should be
+   * saved for future retries as normal.
+   *
+   * A `resume_token` will only be sent on a boundary where there is either no
+   * ongoing result batch, or `batch_checksum` is also populated.
+   *
+   * The server will also send a sentinel `resume_token` when last batch of
+   * `partial_rows` is sent. If the client retries the ExecuteQueryRequest with
+   * the sentinel `resume_token`, the server will emit it again without any
+   * data in `partial_rows`, then return OK.
+   * 
+ * + * bytes resume_token = 5; + * + * @return The resumeToken. + */ + com.google.protobuf.ByteString getResumeToken(); + + /** + * + * + *
+   * If `true`, any data buffered since the last non-empty `resume_token` must
+   * be discarded before the other parts of this message, if any, are handled.
+   * 
+ * + * bool reset = 7; + * + * @return The reset. + */ + boolean getReset(); + + /** + * + * + *
+   * Estimated size of the buffer required to hold the next batch of results.
+   *
+   * This value will be sent with the first `partial_rows` of a batch. That is,
+   * on the first `partial_rows` received in a stream, on the first message
+   * after a `batch_checksum` message, and any time `reset` is true.
+   *
+   * The client can use this estimate to allocate a buffer for the next batch of
+   * results. This helps minimize the number of allocations required, though the
+   * buffer size may still need to be increased if the estimate is too low.
+   * 
+ * + * int32 estimated_batch_size = 4; + * + * @return The estimatedBatchSize. + */ + int getEstimatedBatchSize(); + + com.google.bigtable.v2.PartialResultSet.PartialRowsCase getPartialRowsCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java new file mode 100644 index 000000000000..60d7fd2655e1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java @@ -0,0 +1,1616 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/peer_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * PeerInfo contains information about the peer that the client is
+ * connecting to.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PeerInfo} + */ +@com.google.protobuf.Generated +public final class PeerInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PeerInfo) + PeerInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PeerInfo"); + } + + // Use PeerInfo.newBuilder() to construct. + private PeerInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PeerInfo() { + applicationFrontendRegion_ = ""; + applicationFrontendZone_ = ""; + applicationFrontendSubzone_ = ""; + transportType_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.PeerInfoProto + .internal_static_google_bigtable_v2_PeerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.PeerInfoProto + .internal_static_google_bigtable_v2_PeerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PeerInfo.class, com.google.bigtable.v2.PeerInfo.Builder.class); + } + + /** + * + * + *
+   * The transport type that the client used to connect to this peer.
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.PeerInfo.TransportType} + */ + public enum TransportType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The transport type is unknown.
+     * 
+ * + * TRANSPORT_TYPE_UNKNOWN = 0; + */ + TRANSPORT_TYPE_UNKNOWN(0), + /** + * + * + *
+     * The client connected to this peer via an external network
+     * (e.g. outside Google Coud).
+     * 
+ * + * TRANSPORT_TYPE_EXTERNAL = 1; + */ + TRANSPORT_TYPE_EXTERNAL(1), + /** + * + * + *
+     * The client connected to this peer via CloudPath.
+     * 
+ * + * TRANSPORT_TYPE_CLOUD_PATH = 2; + */ + TRANSPORT_TYPE_CLOUD_PATH(2), + /** + * + * + *
+     * The client connected to this peer via DirectAccess.
+     * 
+ * + * TRANSPORT_TYPE_DIRECT_ACCESS = 3; + */ + TRANSPORT_TYPE_DIRECT_ACCESS(3), + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using an unknown
+     * transport type.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_UNKNOWN = 4; + */ + TRANSPORT_TYPE_SESSION_UNKNOWN(4), + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions on an external
+     * network (e.g. outside Google Cloud).
+     * 
+ * + * TRANSPORT_TYPE_SESSION_EXTERNAL = 5; + */ + TRANSPORT_TYPE_SESSION_EXTERNAL(5), + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using CloudPath.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6; + */ + TRANSPORT_TYPE_SESSION_CLOUD_PATH(6), + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using
+     * DirectAccess.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7; + */ + TRANSPORT_TYPE_SESSION_DIRECT_ACCESS(7), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TransportType"); + } + + /** + * + * + *
+     * The transport type is unknown.
+     * 
+ * + * TRANSPORT_TYPE_UNKNOWN = 0; + */ + public static final int TRANSPORT_TYPE_UNKNOWN_VALUE = 0; + + /** + * + * + *
+     * The client connected to this peer via an external network
+     * (e.g. outside Google Coud).
+     * 
+ * + * TRANSPORT_TYPE_EXTERNAL = 1; + */ + public static final int TRANSPORT_TYPE_EXTERNAL_VALUE = 1; + + /** + * + * + *
+     * The client connected to this peer via CloudPath.
+     * 
+ * + * TRANSPORT_TYPE_CLOUD_PATH = 2; + */ + public static final int TRANSPORT_TYPE_CLOUD_PATH_VALUE = 2; + + /** + * + * + *
+     * The client connected to this peer via DirectAccess.
+     * 
+ * + * TRANSPORT_TYPE_DIRECT_ACCESS = 3; + */ + public static final int TRANSPORT_TYPE_DIRECT_ACCESS_VALUE = 3; + + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using an unknown
+     * transport type.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_UNKNOWN = 4; + */ + public static final int TRANSPORT_TYPE_SESSION_UNKNOWN_VALUE = 4; + + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions on an external
+     * network (e.g. outside Google Cloud).
+     * 
+ * + * TRANSPORT_TYPE_SESSION_EXTERNAL = 5; + */ + public static final int TRANSPORT_TYPE_SESSION_EXTERNAL_VALUE = 5; + + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using CloudPath.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6; + */ + public static final int TRANSPORT_TYPE_SESSION_CLOUD_PATH_VALUE = 6; + + /** + * + * + *
+     * The client connected to this peer via Bigtable Sessions using
+     * DirectAccess.
+     * 
+ * + * TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7; + */ + public static final int TRANSPORT_TYPE_SESSION_DIRECT_ACCESS_VALUE = 7; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TransportType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TransportType forNumber(int value) { + switch (value) { + case 0: + return TRANSPORT_TYPE_UNKNOWN; + case 1: + return TRANSPORT_TYPE_EXTERNAL; + case 2: + return TRANSPORT_TYPE_CLOUD_PATH; + case 3: + return TRANSPORT_TYPE_DIRECT_ACCESS; + case 4: + return TRANSPORT_TYPE_SESSION_UNKNOWN; + case 5: + return TRANSPORT_TYPE_SESSION_EXTERNAL; + case 6: + return TRANSPORT_TYPE_SESSION_CLOUD_PATH; + case 7: + return TRANSPORT_TYPE_SESSION_DIRECT_ACCESS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TransportType findValueByNumber(int number) { + return TransportType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.PeerInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final TransportType[] VALUES = values(); + + public static TransportType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TransportType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.PeerInfo.TransportType) + } + + public static final int GOOGLE_FRONTEND_ID_FIELD_NUMBER = 1; + private long googleFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + public static final int APPLICATION_FRONTEND_ID_FIELD_NUMBER = 2; + private long applicationFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + public static final int APPLICATION_FRONTEND_REGION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendRegion_ = ""; + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + @java.lang.Override + public java.lang.String getApplicationFrontendRegion() { + java.lang.Object ref = applicationFrontendRegion_; + 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(); + applicationFrontendRegion_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationFrontendRegionBytes() { + java.lang.Object ref = applicationFrontendRegion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_FRONTEND_ZONE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+   * The Cloud zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The applicationFrontendZone. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + 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(); + applicationFrontendZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The bytes for applicationFrontendZone. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_FRONTEND_SUBZONE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendSubzone_ = ""; + + /** + * + * + *
+   * The subzone of the application frontend that served this request, e.g. an
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
+   * 
+ * + * string application_frontend_subzone = 4; + * + * @return The applicationFrontendSubzone. + */ + @java.lang.Override + public java.lang.String getApplicationFrontendSubzone() { + java.lang.Object ref = applicationFrontendSubzone_; + 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(); + applicationFrontendSubzone_ = s; + return s; + } + } + + /** + * + * + *
+   * The subzone of the application frontend that served this request, e.g. an
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
+   * 
+ * + * string application_frontend_subzone = 4; + * + * @return The bytes for applicationFrontendSubzone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationFrontendSubzoneBytes() { + java.lang.Object ref = applicationFrontendSubzone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendSubzone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSPORT_TYPE_FIELD_NUMBER = 5; + private int transportType_ = 0; + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The enum numeric value on the wire for transportType. + */ + @java.lang.Override + public int getTransportTypeValue() { + return transportType_; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The transportType. + */ + @java.lang.Override + public com.google.bigtable.v2.PeerInfo.TransportType getTransportType() { + com.google.bigtable.v2.PeerInfo.TransportType result = + com.google.bigtable.v2.PeerInfo.TransportType.forNumber(transportType_); + return result == null ? com.google.bigtable.v2.PeerInfo.TransportType.UNRECOGNIZED : result; + } + + 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 (googleFrontendId_ != 0L) { + output.writeInt64(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + output.writeInt64(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, applicationFrontendZone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendSubzone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, applicationFrontendSubzone_); + } + if (transportType_ + != com.google.bigtable.v2.PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN.getNumber()) { + output.writeEnum(5, transportType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendRegion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, applicationFrontendRegion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (googleFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, applicationFrontendZone_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendSubzone_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize(4, applicationFrontendSubzone_); + } + if (transportType_ + != com.google.bigtable.v2.PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, transportType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendRegion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, applicationFrontendRegion_); + } + size += getUnknownFields().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.PeerInfo)) { + return super.equals(obj); + } + com.google.bigtable.v2.PeerInfo other = (com.google.bigtable.v2.PeerInfo) obj; + + if (getGoogleFrontendId() != other.getGoogleFrontendId()) return false; + if (getApplicationFrontendId() != other.getApplicationFrontendId()) return false; + if (!getApplicationFrontendRegion().equals(other.getApplicationFrontendRegion())) return false; + if (!getApplicationFrontendZone().equals(other.getApplicationFrontendZone())) return false; + if (!getApplicationFrontendSubzone().equals(other.getApplicationFrontendSubzone())) + return false; + if (transportType_ != other.transportType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GOOGLE_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGoogleFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getApplicationFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_REGION_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendRegion().hashCode(); + hash = (37 * hash) + APPLICATION_FRONTEND_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendZone().hashCode(); + hash = (37 * hash) + APPLICATION_FRONTEND_SUBZONE_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendSubzone().hashCode(); + hash = (37 * hash) + TRANSPORT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + transportType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PeerInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PeerInfo 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.PeerInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PeerInfo 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.PeerInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PeerInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PeerInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PeerInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PeerInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PeerInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PeerInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PeerInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.PeerInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * PeerInfo contains information about the peer that the client is
+   * connecting to.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PeerInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PeerInfo) + com.google.bigtable.v2.PeerInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.PeerInfoProto + .internal_static_google_bigtable_v2_PeerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.PeerInfoProto + .internal_static_google_bigtable_v2_PeerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PeerInfo.class, com.google.bigtable.v2.PeerInfo.Builder.class); + } + + // Construct using com.google.bigtable.v2.PeerInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + googleFrontendId_ = 0L; + applicationFrontendId_ = 0L; + applicationFrontendRegion_ = ""; + applicationFrontendZone_ = ""; + applicationFrontendSubzone_ = ""; + transportType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.PeerInfoProto + .internal_static_google_bigtable_v2_PeerInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PeerInfo getDefaultInstanceForType() { + return com.google.bigtable.v2.PeerInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PeerInfo build() { + com.google.bigtable.v2.PeerInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PeerInfo buildPartial() { + com.google.bigtable.v2.PeerInfo result = new com.google.bigtable.v2.PeerInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.PeerInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.googleFrontendId_ = googleFrontendId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.applicationFrontendId_ = applicationFrontendId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.applicationFrontendRegion_ = applicationFrontendRegion_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.applicationFrontendZone_ = applicationFrontendZone_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.applicationFrontendSubzone_ = applicationFrontendSubzone_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.transportType_ = transportType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PeerInfo) { + return mergeFrom((com.google.bigtable.v2.PeerInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PeerInfo other) { + if (other == com.google.bigtable.v2.PeerInfo.getDefaultInstance()) return this; + if (other.getGoogleFrontendId() != 0L) { + setGoogleFrontendId(other.getGoogleFrontendId()); + } + if (other.getApplicationFrontendId() != 0L) { + setApplicationFrontendId(other.getApplicationFrontendId()); + } + if (!other.getApplicationFrontendRegion().isEmpty()) { + applicationFrontendRegion_ = other.applicationFrontendRegion_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getApplicationFrontendZone().isEmpty()) { + applicationFrontendZone_ = other.applicationFrontendZone_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getApplicationFrontendSubzone().isEmpty()) { + applicationFrontendSubzone_ = other.applicationFrontendSubzone_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.transportType_ != 0) { + setTransportTypeValue(other.getTransportTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + googleFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + applicationFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + applicationFrontendZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + applicationFrontendSubzone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 40: + { + transportType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 50: + { + applicationFrontendRegion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long googleFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @param value The googleFrontendId to set. + * @return This builder for chaining. + */ + public Builder setGoogleFrontendId(long value) { + + googleFrontendId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearGoogleFrontendId() { + bitField0_ = (bitField0_ & ~0x00000001); + googleFrontendId_ = 0L; + onChanged(); + return this; + } + + private long applicationFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @param value The applicationFrontendId to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendId(long value) { + + applicationFrontendId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendId() { + bitField0_ = (bitField0_ & ~0x00000002); + applicationFrontendId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object applicationFrontendRegion_ = ""; + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + public java.lang.String getApplicationFrontendRegion() { + java.lang.Object ref = applicationFrontendRegion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendRegion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + public com.google.protobuf.ByteString getApplicationFrontendRegionBytes() { + java.lang.Object ref = applicationFrontendRegion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @param value The applicationFrontendRegion to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendRegion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendRegion() { + applicationFrontendRegion_ = getDefaultInstance().getApplicationFrontendRegion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @param value The bytes for applicationFrontendRegion to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendRegion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+     * The Cloud zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The applicationFrontendZone. + */ + @java.lang.Deprecated + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The bytes for applicationFrontendZone. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @param value The applicationFrontendZone to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setApplicationFrontendZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendZone_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearApplicationFrontendZone() { + applicationFrontendZone_ = getDefaultInstance().getApplicationFrontendZone(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @param value The bytes for applicationFrontendZone to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setApplicationFrontendZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendZone_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object applicationFrontendSubzone_ = ""; + + /** + * + * + *
+     * The subzone of the application frontend that served this request, e.g. an
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
+     * 
+ * + * string application_frontend_subzone = 4; + * + * @return The applicationFrontendSubzone. + */ + public java.lang.String getApplicationFrontendSubzone() { + java.lang.Object ref = applicationFrontendSubzone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendSubzone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The subzone of the application frontend that served this request, e.g. an
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
+     * 
+ * + * string application_frontend_subzone = 4; + * + * @return The bytes for applicationFrontendSubzone. + */ + public com.google.protobuf.ByteString getApplicationFrontendSubzoneBytes() { + java.lang.Object ref = applicationFrontendSubzone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendSubzone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The subzone of the application frontend that served this request, e.g. an
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
+     * 
+ * + * string application_frontend_subzone = 4; + * + * @param value The applicationFrontendSubzone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendSubzone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendSubzone_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The subzone of the application frontend that served this request, e.g. an
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
+     * 
+ * + * string application_frontend_subzone = 4; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendSubzone() { + applicationFrontendSubzone_ = getDefaultInstance().getApplicationFrontendSubzone(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * The subzone of the application frontend that served this request, e.g. an
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
+     * 
+ * + * string application_frontend_subzone = 4; + * + * @param value The bytes for applicationFrontendSubzone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendSubzoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendSubzone_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int transportType_ = 0; + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The enum numeric value on the wire for transportType. + */ + @java.lang.Override + public int getTransportTypeValue() { + return transportType_; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @param value The enum numeric value on the wire for transportType to set. + * @return This builder for chaining. + */ + public Builder setTransportTypeValue(int value) { + transportType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The transportType. + */ + @java.lang.Override + public com.google.bigtable.v2.PeerInfo.TransportType getTransportType() { + com.google.bigtable.v2.PeerInfo.TransportType result = + com.google.bigtable.v2.PeerInfo.TransportType.forNumber(transportType_); + return result == null ? com.google.bigtable.v2.PeerInfo.TransportType.UNRECOGNIZED : result; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @param value The transportType to set. + * @return This builder for chaining. + */ + public Builder setTransportType(com.google.bigtable.v2.PeerInfo.TransportType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + transportType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return This builder for chaining. + */ + public Builder clearTransportType() { + bitField0_ = (bitField0_ & ~0x00000020); + transportType_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PeerInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PeerInfo) + private static final com.google.bigtable.v2.PeerInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PeerInfo(); + } + + public static com.google.bigtable.v2.PeerInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PeerInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.PeerInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java new file mode 100644 index 000000000000..3819533d0a14 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java @@ -0,0 +1,158 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/peer_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface PeerInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PeerInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + long getGoogleFrontendId(); + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + long getApplicationFrontendId(); + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + java.lang.String getApplicationFrontendRegion(); + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + com.google.protobuf.ByteString getApplicationFrontendRegionBytes(); + + /** + * + * + *
+   * The Cloud zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The applicationFrontendZone. + */ + @java.lang.Deprecated + java.lang.String getApplicationFrontendZone(); + + /** + * + * + *
+   * The Cloud zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3 [deprecated = true]; + * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 + * @return The bytes for applicationFrontendZone. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getApplicationFrontendZoneBytes(); + + /** + * + * + *
+   * The subzone of the application frontend that served this request, e.g. an
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
+   * 
+ * + * string application_frontend_subzone = 4; + * + * @return The applicationFrontendSubzone. + */ + java.lang.String getApplicationFrontendSubzone(); + + /** + * + * + *
+   * The subzone of the application frontend that served this request, e.g. an
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
+   * 
+ * + * string application_frontend_subzone = 4; + * + * @return The bytes for applicationFrontendSubzone. + */ + com.google.protobuf.ByteString getApplicationFrontendSubzoneBytes(); + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The enum numeric value on the wire for transportType. + */ + int getTransportTypeValue(); + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return The transportType. + */ + com.google.bigtable.v2.PeerInfo.TransportType getTransportType(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java new file mode 100644 index 000000000000..70745c4ef99f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/peer_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class PeerInfoProto extends com.google.protobuf.GeneratedFile { + private PeerInfoProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PeerInfoProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PeerInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_PeerInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\"google/bigtable/v2/peer_info.proto\022\022go" + + "ogle.bigtable.v2\"\243\004\n\010PeerInfo\022\032\n\022google_" + + "frontend_id\030\001 \001(\003\022\037\n\027application_fronten" + + "d_id\030\002 \001(\003\022#\n\033application_frontend_regio" + + "n\030\006 \001(\t\022%\n\031application_frontend_zone\030\003 \001" + + "(\tB\002\030\001\022$\n\034application_frontend_subzone\030\004" + + " \001(\t\022B\n\016transport_type\030\005 \001(\0162*.google.bi" + + "gtable.v2.PeerInfo.TransportType\"\243\002\n\rTra" + + "nsportType\022\032\n\026TRANSPORT_TYPE_UNKNOWN\020\000\022\033" + + "\n\027TRANSPORT_TYPE_EXTERNAL\020\001\022\035\n\031TRANSPORT" + + "_TYPE_CLOUD_PATH\020\002\022 \n\034TRANSPORT_TYPE_DIR" + + "ECT_ACCESS\020\003\022\"\n\036TRANSPORT_TYPE_SESSION_U" + + "NKNOWN\020\004\022#\n\037TRANSPORT_TYPE_SESSION_EXTER" + + "NAL\020\005\022%\n!TRANSPORT_TYPE_SESSION_CLOUD_PA" + + "TH\020\006\022(\n$TRANSPORT_TYPE_SESSION_DIRECT_AC" + + "CESS\020\007B\267\001\n\026com.google.bigtable.v2B\rPeerI" + + "nfoProtoP\001Z8cloud.google.com/go/bigtable" + + "/apiv2/bigtablepb;bigtablepb\252\002\030Google.Cl" + + "oud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\" + + "V2\352\002\033Google::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_bigtable_v2_PeerInfo_descriptor = getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_PeerInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_PeerInfo_descriptor, + new java.lang.String[] { + "GoogleFrontendId", + "ApplicationFrontendId", + "ApplicationFrontendRegion", + "ApplicationFrontendZone", + "ApplicationFrontendSubzone", + "TransportType", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java new file mode 100644 index 000000000000..a215684dfa2c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java @@ -0,0 +1,819 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for client connection keep-alive and warming.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmRequest} + */ +@com.google.protobuf.Generated +public final class PingAndWarmRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmRequest) + PingAndWarmRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PingAndWarmRequest"); + } + + // Use PingAndWarmRequest.newBuilder() to construct. + private PingAndWarmRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PingAndWarmRequest() { + name_ = ""; + appProfileId_ = ""; + } + + 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.GeneratedMessage.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; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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.GeneratedMessage.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.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + 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); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.PingAndWarmRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @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_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + 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; + bitField0_ |= 0x00000002; + 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(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java new file mode 100644 index 000000000000..4fb5debf8060 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +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/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java new file mode 100644 index 000000000000..0b086c3d7418 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java @@ -0,0 +1,395 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.PingAndWarm connection keepalive and warming.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmResponse} + */ +@com.google.protobuf.Generated +public final class PingAndWarmResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmResponse) + PingAndWarmResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PingAndWarmResponse"); + } + + // Use PingAndWarmResponse.newBuilder() to construct. + private PingAndWarmResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PingAndWarmResponse() {} + + 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.GeneratedMessage.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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.GeneratedMessage.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.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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 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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java new file mode 100644 index 000000000000..ae5f4c612bce --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface PingAndWarmResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PingAndWarmResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequest.java new file mode 100644 index 000000000000..0f81145c0eed --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequest.java @@ -0,0 +1,1981 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.PrepareQuery
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PrepareQueryRequest} + */ +@com.google.protobuf.Generated +public final class PrepareQueryRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PrepareQueryRequest) + PrepareQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrepareQueryRequest"); + } + + // Use PrepareQueryRequest.newBuilder() to construct. + private PrepareQueryRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrepareQueryRequest() { + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetParamTypes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PrepareQueryRequest.class, + com.google.bigtable.v2.PrepareQueryRequest.Builder.class); + } + + private int dataFormatCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object dataFormat_; + + public enum DataFormatCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROTO_FORMAT(4), + DATAFORMAT_NOT_SET(0); + private final int value; + + private DataFormatCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataFormatCase valueOf(int value) { + return forNumber(value); + } + + public static DataFormatCase forNumber(int value) { + switch (value) { + case 4: + return PROTO_FORMAT; + case 0: + return DATAFORMAT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataFormatCase getDataFormatCase() { + return DataFormatCase.forNumber(dataFormatCase_); + } + + public static final int INSTANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + @java.lang.Override + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + 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(); + instanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * Optional. This value specifies routing for preparing the query. Note that
+   * this `app_profile_id` is only used for preparing the query. The actual
+   * query execution will use the app profile specified in the
+   * `ExecuteQueryRequest`. If not specified, the `default` application profile
+   * will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. This value specifies routing for preparing the query. Note that
+   * this `app_profile_id` is only used for preparing the query. The actual
+   * query execution will use the app profile specified in the
+   * `ExecuteQueryRequest`. If not specified, the `default` application profile
+   * will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
+   * Required. The query string.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The query string.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROTO_FORMAT_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return Whether the protoFormat field is set. + */ + @java.lang.Override + public boolean hasProtoFormat() { + return dataFormatCase_ == 4; + } + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return The protoFormat. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoFormat getProtoFormat() { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder() { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + + public static final int PARAM_TYPES_FIELD_NUMBER = 6; + + private static final class ParamTypesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_ParamTypesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.v2.Type.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField paramTypes_; + + private com.google.protobuf.MapField + internalGetParamTypes() { + if (paramTypes_ == null) { + return com.google.protobuf.MapField.emptyMapField(ParamTypesDefaultEntryHolder.defaultEntry); + } + return paramTypes_; + } + + public int getParamTypesCount() { + return internalGetParamTypes().getMap().size(); + } + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsParamTypes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParamTypes().getMap().containsKey(key); + } + + /** Use {@link #getParamTypesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParamTypes() { + return getParamTypesMap(); + } + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getParamTypesMap() { + return internalGetParamTypes().getMap(); + } + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.v2.Type getParamTypesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Type defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetParamTypes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type getParamTypesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetParamTypes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(instanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, query_); + } + if (dataFormatCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.ProtoFormat) dataFormat_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetParamTypes(), ParamTypesDefaultEntryHolder.defaultEntry, 6); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, query_); + } + if (dataFormatCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.ProtoFormat) dataFormat_); + } + for (java.util.Map.Entry entry : + internalGetParamTypes().getMap().entrySet()) { + com.google.protobuf.MapEntry paramTypes__ = + ParamTypesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, paramTypes__); + } + size += getUnknownFields().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.PrepareQueryRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.PrepareQueryRequest other = + (com.google.bigtable.v2.PrepareQueryRequest) obj; + + if (!getInstanceName().equals(other.getInstanceName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!internalGetParamTypes().equals(other.internalGetParamTypes())) return false; + if (!getDataFormatCase().equals(other.getDataFormatCase())) return false; + switch (dataFormatCase_) { + case 4: + if (!getProtoFormat().equals(other.getProtoFormat())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (!internalGetParamTypes().getMap().isEmpty()) { + hash = (37 * hash) + PARAM_TYPES_FIELD_NUMBER; + hash = (53 * hash) + internalGetParamTypes().hashCode(); + } + switch (dataFormatCase_) { + case 4: + hash = (37 * hash) + PROTO_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getProtoFormat().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryRequest 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.PrepareQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryRequest 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.PrepareQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.PrepareQueryRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.PrepareQuery
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PrepareQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PrepareQueryRequest) + com.google.bigtable.v2.PrepareQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetParamTypes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableParamTypes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PrepareQueryRequest.class, + com.google.bigtable.v2.PrepareQueryRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.PrepareQueryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + if (protoFormatBuilder_ != null) { + protoFormatBuilder_.clear(); + } + internalGetMutableParamTypes().clear(); + dataFormatCase_ = 0; + dataFormat_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.PrepareQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryRequest build() { + com.google.bigtable.v2.PrepareQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryRequest buildPartial() { + com.google.bigtable.v2.PrepareQueryRequest result = + new com.google.bigtable.v2.PrepareQueryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.PrepareQueryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instanceName_ = instanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.paramTypes_ = + internalGetParamTypes().build(ParamTypesDefaultEntryHolder.defaultEntry); + } + } + + private void buildPartialOneofs(com.google.bigtable.v2.PrepareQueryRequest result) { + result.dataFormatCase_ = dataFormatCase_; + result.dataFormat_ = this.dataFormat_; + if (dataFormatCase_ == 4 && protoFormatBuilder_ != null) { + result.dataFormat_ = protoFormatBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PrepareQueryRequest) { + return mergeFrom((com.google.bigtable.v2.PrepareQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PrepareQueryRequest other) { + if (other == com.google.bigtable.v2.PrepareQueryRequest.getDefaultInstance()) return this; + if (!other.getInstanceName().isEmpty()) { + instanceName_ = other.instanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000004; + onChanged(); + } + internalGetMutableParamTypes().mergeFrom(other.internalGetParamTypes()); + bitField0_ |= 0x00000010; + switch (other.getDataFormatCase()) { + case PROTO_FORMAT: + { + mergeProtoFormat(other.getProtoFormat()); + break; + } + case DATAFORMAT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetProtoFormatFieldBuilder().getBuilder(), extensionRegistry); + dataFormatCase_ = 4; + break; + } // case 34 + case 50: + { + com.google.protobuf.MapEntry + paramTypes__ = + input.readMessage( + ParamTypesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableParamTypes() + .ensureBuilderMap() + .put(paramTypes__.getKey(), paramTypes__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataFormatCase_ = 0; + private java.lang.Object dataFormat_; + + public DataFormatCase getDataFormatCase() { + return DataFormatCase.forNumber(dataFormatCase_); + } + + public Builder clearDataFormat() { + dataFormatCase_ = 0; + dataFormat_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object instanceName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceName() { + instanceName_ = getDefaultInstance().getInstanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance against which the query should be
+     * executed.
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * Optional. This value specifies routing for preparing the query. Note that
+     * this `app_profile_id` is only used for preparing the query. The actual
+     * query execution will use the app profile specified in the
+     * `ExecuteQueryRequest`. If not specified, the `default` application profile
+     * will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. This value specifies routing for preparing the query. Note that
+     * this `app_profile_id` is only used for preparing the query. The actual
+     * query execution will use the app profile specified in the
+     * `ExecuteQueryRequest`. If not specified, the `default` application profile
+     * will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. This value specifies routing for preparing the query. Note that
+     * this `app_profile_id` is only used for preparing the query. The actual
+     * query execution will use the app profile specified in the
+     * `ExecuteQueryRequest`. If not specified, the `default` application profile
+     * will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This value specifies routing for preparing the query. Note that
+     * this `app_profile_id` is only used for preparing the query. The actual
+     * query execution will use the app profile specified in the
+     * `ExecuteQueryRequest`. If not specified, the `default` application profile
+     * will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This value specifies routing for preparing the query. Note that
+     * this `app_profile_id` is only used for preparing the query. The actual
+     * query execution will use the app profile specified in the
+     * `ExecuteQueryRequest`. If not specified, the `default` application profile
+     * will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + + /** + * + * + *
+     * Required. The query string.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The query string.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The query string.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The query string.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The query string.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder> + protoFormatBuilder_; + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return Whether the protoFormat field is set. + */ + @java.lang.Override + public boolean hasProtoFormat() { + return dataFormatCase_ == 4; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return The protoFormat. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoFormat getProtoFormat() { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } else { + if (dataFormatCase_ == 4) { + return protoFormatBuilder_.getMessage(); + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + public Builder setProtoFormat(com.google.bigtable.v2.ProtoFormat value) { + if (protoFormatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataFormat_ = value; + onChanged(); + } else { + protoFormatBuilder_.setMessage(value); + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + public Builder setProtoFormat(com.google.bigtable.v2.ProtoFormat.Builder builderForValue) { + if (protoFormatBuilder_ == null) { + dataFormat_ = builderForValue.build(); + onChanged(); + } else { + protoFormatBuilder_.setMessage(builderForValue.build()); + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + public Builder mergeProtoFormat(com.google.bigtable.v2.ProtoFormat value) { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4 + && dataFormat_ != com.google.bigtable.v2.ProtoFormat.getDefaultInstance()) { + dataFormat_ = + com.google.bigtable.v2.ProtoFormat.newBuilder( + (com.google.bigtable.v2.ProtoFormat) dataFormat_) + .mergeFrom(value) + .buildPartial(); + } else { + dataFormat_ = value; + } + onChanged(); + } else { + if (dataFormatCase_ == 4) { + protoFormatBuilder_.mergeFrom(value); + } else { + protoFormatBuilder_.setMessage(value); + } + } + dataFormatCase_ = 4; + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + public Builder clearProtoFormat() { + if (protoFormatBuilder_ == null) { + if (dataFormatCase_ == 4) { + dataFormatCase_ = 0; + dataFormat_ = null; + onChanged(); + } + } else { + if (dataFormatCase_ == 4) { + dataFormatCase_ = 0; + dataFormat_ = null; + } + protoFormatBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + public com.google.bigtable.v2.ProtoFormat.Builder getProtoFormatBuilder() { + return internalGetProtoFormatFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder() { + if ((dataFormatCase_ == 4) && (protoFormatBuilder_ != null)) { + return protoFormatBuilder_.getMessageOrBuilder(); + } else { + if (dataFormatCase_ == 4) { + return (com.google.bigtable.v2.ProtoFormat) dataFormat_; + } + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Protocol buffer format as described by ProtoSchema and ProtoRows
+     * messages.
+     * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder> + internalGetProtoFormatFieldBuilder() { + if (protoFormatBuilder_ == null) { + if (!(dataFormatCase_ == 4)) { + dataFormat_ = com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + protoFormatBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder>( + (com.google.bigtable.v2.ProtoFormat) dataFormat_, + getParentForChildren(), + isClean()); + dataFormat_ = null; + } + dataFormatCase_ = 4; + onChanged(); + return protoFormatBuilder_; + } + + private static final class ParamTypesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, com.google.bigtable.v2.TypeOrBuilder, com.google.bigtable.v2.Type> { + @java.lang.Override + public com.google.bigtable.v2.Type build(com.google.bigtable.v2.TypeOrBuilder val) { + if (val instanceof com.google.bigtable.v2.Type) { + return (com.google.bigtable.v2.Type) val; + } + return ((com.google.bigtable.v2.Type.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry + defaultEntry() { + return ParamTypesDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final ParamTypesConverter paramTypesConverter = new ParamTypesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.TypeOrBuilder, + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder> + paramTypes_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.TypeOrBuilder, + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder> + internalGetParamTypes() { + if (paramTypes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(paramTypesConverter); + } + return paramTypes_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.v2.TypeOrBuilder, + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder> + internalGetMutableParamTypes() { + if (paramTypes_ == null) { + paramTypes_ = new com.google.protobuf.MapFieldBuilder<>(paramTypesConverter); + } + bitField0_ |= 0x00000010; + onChanged(); + return paramTypes_; + } + + public int getParamTypesCount() { + return internalGetParamTypes().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsParamTypes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetParamTypes().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getParamTypesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParamTypes() { + return getParamTypesMap(); + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map getParamTypesMap() { + return internalGetParamTypes().getImmutableMap(); + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.v2.Type getParamTypesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Type defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableParamTypes().ensureBuilderMap(); + return map.containsKey(key) ? paramTypesConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type getParamTypesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableParamTypes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return paramTypesConverter.build(map.get(key)); + } + + public Builder clearParamTypes() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableParamTypes().clear(); + return this; + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeParamTypes(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableParamTypes().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableParamTypes() { + bitField0_ |= 0x00000010; + return internalGetMutableParamTypes().ensureMessageMap(); + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putParamTypes(java.lang.String key, com.google.bigtable.v2.Type value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableParamTypes().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllParamTypes( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableParamTypes().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
+     * Required. `param_types` is a map of parameter identifier strings to their
+     * `Type`s.
+     *
+     * In query string, a parameter placeholder consists of the
+     * `@` character followed by the parameter name (for example, `@firstName`) in
+     * the query string.
+     *
+     * For example, if param_types["firstName"] = Bytes then @firstName will be a
+     * query parameter of type Bytes. The specific `Value` to be used for the
+     * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+     * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.Type.Builder putParamTypesBuilderIfAbsent(java.lang.String key) { + java.util.Map builderMap = + internalGetMutableParamTypes().ensureBuilderMap(); + com.google.bigtable.v2.TypeOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.v2.Type.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.v2.Type) { + entry = ((com.google.bigtable.v2.Type) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.v2.Type.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PrepareQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PrepareQueryRequest) + private static final com.google.bigtable.v2.PrepareQueryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PrepareQueryRequest(); + } + + public static com.google.bigtable.v2.PrepareQueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrepareQueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.PrepareQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequestOrBuilder.java new file mode 100644 index 000000000000..02cacd393dce --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequestOrBuilder.java @@ -0,0 +1,282 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface PrepareQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PrepareQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + java.lang.String getInstanceName(); + + /** + * + * + *
+   * Required. The unique name of the instance against which the query should be
+   * executed.
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + com.google.protobuf.ByteString getInstanceNameBytes(); + + /** + * + * + *
+   * Optional. This value specifies routing for preparing the query. Note that
+   * this `app_profile_id` is only used for preparing the query. The actual
+   * query execution will use the app profile specified in the
+   * `ExecuteQueryRequest`. If not specified, the `default` application profile
+   * will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * Optional. This value specifies routing for preparing the query. Note that
+   * this `app_profile_id` is only used for preparing the query. The actual
+   * query execution will use the app profile specified in the
+   * `ExecuteQueryRequest`. If not specified, the `default` application profile
+   * will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The query string.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
+   * Required. The query string.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return Whether the protoFormat field is set. + */ + boolean hasProtoFormat(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + * + * @return The protoFormat. + */ + com.google.bigtable.v2.ProtoFormat getProtoFormat(); + + /** + * + * + *
+   * Protocol buffer format as described by ProtoSchema and ProtoRows
+   * messages.
+   * 
+ * + * .google.bigtable.v2.ProtoFormat proto_format = 4; + */ + com.google.bigtable.v2.ProtoFormatOrBuilder getProtoFormatOrBuilder(); + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getParamTypesCount(); + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsParamTypes(java.lang.String key); + + /** Use {@link #getParamTypesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParamTypes(); + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map getParamTypesMap(); + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.bigtable.v2.Type getParamTypesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.v2.Type defaultValue); + + /** + * + * + *
+   * Required. `param_types` is a map of parameter identifier strings to their
+   * `Type`s.
+   *
+   * In query string, a parameter placeholder consists of the
+   * `@` character followed by the parameter name (for example, `@firstName`) in
+   * the query string.
+   *
+   * For example, if param_types["firstName"] = Bytes then @firstName will be a
+   * query parameter of type Bytes. The specific `Value` to be used for the
+   * query execution must be sent in `ExecuteQueryRequest` in the `params` map.
+   * 
+ * + * + * map<string, .google.bigtable.v2.Type> param_types = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.Type getParamTypesOrThrow(java.lang.String key); + + com.google.bigtable.v2.PrepareQueryRequest.DataFormatCase getDataFormatCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponse.java new file mode 100644 index 000000000000..4f4fc8fa5cda --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponse.java @@ -0,0 +1,1115 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.PrepareQueryResponse
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PrepareQueryResponse} + */ +@com.google.protobuf.Generated +public final class PrepareQueryResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PrepareQueryResponse) + PrepareQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrepareQueryResponse"); + } + + // Use PrepareQueryResponse.newBuilder() to construct. + private PrepareQueryResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrepareQueryResponse() { + preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PrepareQueryResponse.class, + com.google.bigtable.v2.PrepareQueryResponse.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private com.google.bigtable.v2.ResultSetMetadata metadata_; + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata getMetadata() { + return metadata_ == null + ? com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance() + : metadata_; + } + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance() + : metadata_; + } + + public static final int PREPARED_QUERY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * A serialized prepared query. Clients should treat this as an opaque
+   * blob of bytes to send in `ExecuteQueryRequest`.
+   * 
+ * + * bytes prepared_query = 2; + * + * @return The preparedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreparedQuery() { + return preparedQuery_; + } + + public static final int VALID_UNTIL_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp validUntil_; + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return Whether the validUntil field is set. + */ + @java.lang.Override + public boolean hasValidUntil() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return The validUntil. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getValidUntil() { + return validUntil_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : validUntil_; + } + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValidUntilOrBuilder() { + return validUntil_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : validUntil_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMetadata()); + } + if (!preparedQuery_.isEmpty()) { + output.writeBytes(2, preparedQuery_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getValidUntil()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + if (!preparedQuery_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, preparedQuery_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getValidUntil()); + } + size += getUnknownFields().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.PrepareQueryResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.PrepareQueryResponse other = + (com.google.bigtable.v2.PrepareQueryResponse) obj; + + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getPreparedQuery().equals(other.getPreparedQuery())) return false; + if (hasValidUntil() != other.hasValidUntil()) return false; + if (hasValidUntil()) { + if (!getValidUntil().equals(other.getValidUntil())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (37 * hash) + PREPARED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getPreparedQuery().hashCode(); + if (hasValidUntil()) { + hash = (37 * hash) + VALID_UNTIL_FIELD_NUMBER; + hash = (53 * hash) + getValidUntil().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryResponse 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.PrepareQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryResponse 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.PrepareQueryResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PrepareQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.PrepareQueryResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.PrepareQueryResponse
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PrepareQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PrepareQueryResponse) + com.google.bigtable.v2.PrepareQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PrepareQueryResponse.class, + com.google.bigtable.v2.PrepareQueryResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.PrepareQueryResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMetadataFieldBuilder(); + internalGetValidUntilFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + validUntil_ = null; + if (validUntilBuilder_ != null) { + validUntilBuilder_.dispose(); + validUntilBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PrepareQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.PrepareQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryResponse build() { + com.google.bigtable.v2.PrepareQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PrepareQueryResponse buildPartial() { + com.google.bigtable.v2.PrepareQueryResponse result = + new com.google.bigtable.v2.PrepareQueryResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.PrepareQueryResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.preparedQuery_ = preparedQuery_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validUntil_ = validUntilBuilder_ == null ? validUntil_ : validUntilBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PrepareQueryResponse) { + return mergeFrom((com.google.bigtable.v2.PrepareQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PrepareQueryResponse other) { + if (other == com.google.bigtable.v2.PrepareQueryResponse.getDefaultInstance()) return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.getPreparedQuery().isEmpty()) { + setPreparedQuery(other.getPreparedQuery()); + } + if (other.hasValidUntil()) { + mergeValidUntil(other.getValidUntil()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + preparedQuery_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetValidUntilFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.ResultSetMetadata metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + public com.google.bigtable.v2.ResultSetMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder setMetadata(com.google.bigtable.v2.ResultSetMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder setMetadata(com.google.bigtable.v2.ResultSetMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder mergeMetadata(com.google.bigtable.v2.ResultSetMetadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && metadata_ != null + && metadata_ != com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public com.google.bigtable.v2.ResultSetMetadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + public com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance() + : metadata_; + } + } + + /** + * + * + *
+     * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+     * returned `prepared_query`.
+     * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.ByteString preparedQuery_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * A serialized prepared query. Clients should treat this as an opaque
+     * blob of bytes to send in `ExecuteQueryRequest`.
+     * 
+ * + * bytes prepared_query = 2; + * + * @return The preparedQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPreparedQuery() { + return preparedQuery_; + } + + /** + * + * + *
+     * A serialized prepared query. Clients should treat this as an opaque
+     * blob of bytes to send in `ExecuteQueryRequest`.
+     * 
+ * + * bytes prepared_query = 2; + * + * @param value The preparedQuery to set. + * @return This builder for chaining. + */ + public Builder setPreparedQuery(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + preparedQuery_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A serialized prepared query. Clients should treat this as an opaque
+     * blob of bytes to send in `ExecuteQueryRequest`.
+     * 
+ * + * bytes prepared_query = 2; + * + * @return This builder for chaining. + */ + public Builder clearPreparedQuery() { + bitField0_ = (bitField0_ & ~0x00000002); + preparedQuery_ = getDefaultInstance().getPreparedQuery(); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp validUntil_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + validUntilBuilder_; + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return Whether the validUntil field is set. + */ + public boolean hasValidUntil() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return The validUntil. + */ + public com.google.protobuf.Timestamp getValidUntil() { + if (validUntilBuilder_ == null) { + return validUntil_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : validUntil_; + } else { + return validUntilBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public Builder setValidUntil(com.google.protobuf.Timestamp value) { + if (validUntilBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validUntil_ = value; + } else { + validUntilBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public Builder setValidUntil(com.google.protobuf.Timestamp.Builder builderForValue) { + if (validUntilBuilder_ == null) { + validUntil_ = builderForValue.build(); + } else { + validUntilBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public Builder mergeValidUntil(com.google.protobuf.Timestamp value) { + if (validUntilBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && validUntil_ != null + && validUntil_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValidUntilBuilder().mergeFrom(value); + } else { + validUntil_ = value; + } + } else { + validUntilBuilder_.mergeFrom(value); + } + if (validUntil_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public Builder clearValidUntil() { + bitField0_ = (bitField0_ & ~0x00000004); + validUntil_ = null; + if (validUntilBuilder_ != null) { + validUntilBuilder_.dispose(); + validUntilBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public com.google.protobuf.Timestamp.Builder getValidUntilBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetValidUntilFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + public com.google.protobuf.TimestampOrBuilder getValidUntilOrBuilder() { + if (validUntilBuilder_ != null) { + return validUntilBuilder_.getMessageOrBuilder(); + } else { + return validUntil_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : validUntil_; + } + } + + /** + * + * + *
+     * The time at which the prepared query token becomes invalid.
+     * A token may become invalid early due to changes in the data being read, but
+     * it provides a guideline to refresh query plans asynchronously.
+     * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetValidUntilFieldBuilder() { + if (validUntilBuilder_ == null) { + validUntilBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getValidUntil(), getParentForChildren(), isClean()); + validUntil_ = null; + } + return validUntilBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PrepareQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PrepareQueryResponse) + private static final com.google.bigtable.v2.PrepareQueryResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PrepareQueryResponse(); + } + + public static com.google.bigtable.v2.PrepareQueryResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrepareQueryResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.PrepareQueryResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponseOrBuilder.java new file mode 100644 index 000000000000..95fd497e2ad5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponseOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface PrepareQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PrepareQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + * + * @return The metadata. + */ + com.google.bigtable.v2.ResultSetMetadata getMetadata(); + + /** + * + * + *
+   * Structure of rows in the response stream of `ExecuteQueryResponse` for the
+   * returned `prepared_query`.
+   * 
+ * + * .google.bigtable.v2.ResultSetMetadata metadata = 1; + */ + com.google.bigtable.v2.ResultSetMetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * A serialized prepared query. Clients should treat this as an opaque
+   * blob of bytes to send in `ExecuteQueryRequest`.
+   * 
+ * + * bytes prepared_query = 2; + * + * @return The preparedQuery. + */ + com.google.protobuf.ByteString getPreparedQuery(); + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return Whether the validUntil field is set. + */ + boolean hasValidUntil(); + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + * + * @return The validUntil. + */ + com.google.protobuf.Timestamp getValidUntil(); + + /** + * + * + *
+   * The time at which the prepared query token becomes invalid.
+   * A token may become invalid early due to changes in the data being read, but
+   * it provides a guideline to refresh query plans asynchronously.
+   * 
+ * + * .google.protobuf.Timestamp valid_until = 3; + */ + com.google.protobuf.TimestampOrBuilder getValidUntilOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java new file mode 100644 index 000000000000..4328352d16a5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Protocol buffers format descriptor, as described by Messages ProtoSchema and
+ * ProtoRows
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoFormat} + */ +@com.google.protobuf.Generated +public final class ProtoFormat extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoFormat) + ProtoFormatOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProtoFormat"); + } + + // Use ProtoFormat.newBuilder() to construct. + private ProtoFormat(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ProtoFormat() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoFormat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoFormat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoFormat.class, + com.google.bigtable.v2.ProtoFormat.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.ProtoFormat)) { + return super.equals(obj); + } + com.google.bigtable.v2.ProtoFormat other = (com.google.bigtable.v2.ProtoFormat) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoFormat 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.ProtoFormat parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoFormat 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.ProtoFormat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoFormat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoFormat parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoFormat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ProtoFormat 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Protocol buffers format descriptor, as described by Messages ProtoSchema and
+   * ProtoRows
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoFormat} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ProtoFormat) + com.google.bigtable.v2.ProtoFormatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoFormat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoFormat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoFormat.class, + com.google.bigtable.v2.ProtoFormat.Builder.class); + } + + // Construct using com.google.bigtable.v2.ProtoFormat.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.DataProto + .internal_static_google_bigtable_v2_ProtoFormat_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoFormat getDefaultInstanceForType() { + return com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoFormat build() { + com.google.bigtable.v2.ProtoFormat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoFormat buildPartial() { + com.google.bigtable.v2.ProtoFormat result = new com.google.bigtable.v2.ProtoFormat(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ProtoFormat) { + return mergeFrom((com.google.bigtable.v2.ProtoFormat) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ProtoFormat other) { + if (other == com.google.bigtable.v2.ProtoFormat.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ProtoFormat) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ProtoFormat) + private static final com.google.bigtable.v2.ProtoFormat DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ProtoFormat(); + } + + public static com.google.bigtable.v2.ProtoFormat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProtoFormat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProtoFormat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.java new file mode 100644 index 000000000000..f3e1dd600f0a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ProtoFormatOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ProtoFormat) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java new file mode 100644 index 000000000000..7d06b910a467 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java @@ -0,0 +1,963 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Rows represented in proto format.
+ *
+ * This should be constructed by concatenating the `batch_data` from each
+ * of the relevant `ProtoRowsBatch` messages and parsing the result as a
+ * `ProtoRows` message.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoRows} + */ +@com.google.protobuf.Generated +public final class ProtoRows extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoRows) + ProtoRowsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProtoRows"); + } + + // Use ProtoRows.newBuilder() to construct. + private ProtoRows(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ProtoRows() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_ProtoRows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoRows.class, com.google.bigtable.v2.ProtoRows.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List values_; + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + @java.lang.Override + public java.util.List getValuesOrBuilderList() { + return values_; + } + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Value getValues(int index) { + return values_.get(index); + } + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index) { + return values_.get(index); + } + + 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 { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); + } + size += getUnknownFields().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.ProtoRows)) { + return super.equals(obj); + } + com.google.bigtable.v2.ProtoRows other = (com.google.bigtable.v2.ProtoRows) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ProtoRows parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRows 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.ProtoRows parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRows 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.ProtoRows parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRows parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRows parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRows parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRows parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRows parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRows parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRows parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ProtoRows 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Rows represented in proto format.
+   *
+   * This should be constructed by concatenating the `batch_data` from each
+   * of the relevant `ProtoRowsBatch` messages and parsing the result as a
+   * `ProtoRows` message.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoRows} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ProtoRows) + com.google.bigtable.v2.ProtoRowsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoRows.class, + com.google.bigtable.v2.ProtoRows.Builder.class); + } + + // Construct using com.google.bigtable.v2.ProtoRows.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRows_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRows getDefaultInstanceForType() { + return com.google.bigtable.v2.ProtoRows.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRows build() { + com.google.bigtable.v2.ProtoRows result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRows buildPartial() { + com.google.bigtable.v2.ProtoRows result = new com.google.bigtable.v2.ProtoRows(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.ProtoRows result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.ProtoRows result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ProtoRows) { + return mergeFrom((com.google.bigtable.v2.ProtoRows) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ProtoRows other) { + if (other == com.google.bigtable.v2.ProtoRows.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.bigtable.v2.Value m = + input.readMessage(com.google.bigtable.v2.Value.parser(), extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public com.google.bigtable.v2.Value getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder setValues(int index, com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder setValues(int index, com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder addValues(com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder addValues(int index, com.google.bigtable.v2.Value value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder addValues(com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder addValues(int index, com.google.bigtable.v2.Value.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder addAllValues(java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public com.google.bigtable.v2.Value.Builder getValuesBuilder(int index) { + return internalGetValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public com.google.bigtable.v2.Value.Builder addValuesBuilder() { + return internalGetValuesFieldBuilder() + .addBuilder(com.google.bigtable.v2.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public com.google.bigtable.v2.Value.Builder addValuesBuilder(int index) { + return internalGetValuesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Value.getDefaultInstance()); + } + + /** + * + * + *
+     * A proto rows message consists of a list of values. Every N complete values
+     * defines a row, where N is equal to the  number of entries in the
+     * `metadata.proto_schema.columns` value received in the first response.
+     * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + public java.util.List getValuesBuilderList() { + return internalGetValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + internalGetValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + values_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ProtoRows) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ProtoRows) + private static final com.google.bigtable.v2.ProtoRows DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ProtoRows(); + } + + public static com.google.bigtable.v2.ProtoRows getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProtoRows parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProtoRows getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java new file mode 100644 index 000000000000..4f2b96697589 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java @@ -0,0 +1,520 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A part of a serialized `ProtoRows` message.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoRowsBatch} + */ +@com.google.protobuf.Generated +public final class ProtoRowsBatch extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoRowsBatch) + ProtoRowsBatchOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProtoRowsBatch"); + } + + // Use ProtoRowsBatch.newBuilder() to construct. + private ProtoRowsBatch(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ProtoRowsBatch() { + batchData_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRowsBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoRowsBatch.class, + com.google.bigtable.v2.ProtoRowsBatch.Builder.class); + } + + public static final int BATCH_DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString batchData_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Part of a serialized `ProtoRows` message.
+   * A complete, parseable ProtoRows message is constructed by
+   * concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The
+   * `PartialResultSet` that contains the last part has `complete_batch` set to
+   * `true`.
+   * 
+ * + * bytes batch_data = 1; + * + * @return The batchData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBatchData() { + return batchData_; + } + + 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 (!batchData_.isEmpty()) { + output.writeBytes(1, batchData_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!batchData_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, batchData_); + } + size += getUnknownFields().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.ProtoRowsBatch)) { + return super.equals(obj); + } + com.google.bigtable.v2.ProtoRowsBatch other = (com.google.bigtable.v2.ProtoRowsBatch) obj; + + if (!getBatchData().equals(other.getBatchData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BATCH_DATA_FIELD_NUMBER; + hash = (53 * hash) + getBatchData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRowsBatch 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.ProtoRowsBatch parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRowsBatch 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.ProtoRowsBatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ProtoRowsBatch 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A part of a serialized `ProtoRows` message.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoRowsBatch} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ProtoRowsBatch) + com.google.bigtable.v2.ProtoRowsBatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRowsBatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoRowsBatch.class, + com.google.bigtable.v2.ProtoRowsBatch.Builder.class); + } + + // Construct using com.google.bigtable.v2.ProtoRowsBatch.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + batchData_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatch getDefaultInstanceForType() { + return com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatch build() { + com.google.bigtable.v2.ProtoRowsBatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoRowsBatch buildPartial() { + com.google.bigtable.v2.ProtoRowsBatch result = + new com.google.bigtable.v2.ProtoRowsBatch(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ProtoRowsBatch result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.batchData_ = batchData_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ProtoRowsBatch) { + return mergeFrom((com.google.bigtable.v2.ProtoRowsBatch) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ProtoRowsBatch other) { + if (other == com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance()) return this; + if (!other.getBatchData().isEmpty()) { + setBatchData(other.getBatchData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + batchData_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString batchData_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Part of a serialized `ProtoRows` message.
+     * A complete, parseable ProtoRows message is constructed by
+     * concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The
+     * `PartialResultSet` that contains the last part has `complete_batch` set to
+     * `true`.
+     * 
+ * + * bytes batch_data = 1; + * + * @return The batchData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBatchData() { + return batchData_; + } + + /** + * + * + *
+     * Part of a serialized `ProtoRows` message.
+     * A complete, parseable ProtoRows message is constructed by
+     * concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The
+     * `PartialResultSet` that contains the last part has `complete_batch` set to
+     * `true`.
+     * 
+ * + * bytes batch_data = 1; + * + * @param value The batchData to set. + * @return This builder for chaining. + */ + public Builder setBatchData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + batchData_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Part of a serialized `ProtoRows` message.
+     * A complete, parseable ProtoRows message is constructed by
+     * concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The
+     * `PartialResultSet` that contains the last part has `complete_batch` set to
+     * `true`.
+     * 
+ * + * bytes batch_data = 1; + * + * @return This builder for chaining. + */ + public Builder clearBatchData() { + bitField0_ = (bitField0_ & ~0x00000001); + batchData_ = getDefaultInstance().getBatchData(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ProtoRowsBatch) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ProtoRowsBatch) + private static final com.google.bigtable.v2.ProtoRowsBatch DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ProtoRowsBatch(); + } + + public static com.google.bigtable.v2.ProtoRowsBatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProtoRowsBatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProtoRowsBatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java new file mode 100644 index 000000000000..58abe5659148 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ProtoRowsBatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ProtoRowsBatch) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Part of a serialized `ProtoRows` message.
+   * A complete, parseable ProtoRows message is constructed by
+   * concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The
+   * `PartialResultSet` that contains the last part has `complete_batch` set to
+   * `true`.
+   * 
+ * + * bytes batch_data = 1; + * + * @return The batchData. + */ + com.google.protobuf.ByteString getBatchData(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.java new file mode 100644 index 000000000000..928f4b54ed55 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ProtoRowsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ProtoRows) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + java.util.List getValuesList(); + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + com.google.bigtable.v2.Value getValues(int index); + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + int getValuesCount(); + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + java.util.List getValuesOrBuilderList(); + + /** + * + * + *
+   * A proto rows message consists of a list of values. Every N complete values
+   * defines a row, where N is equal to the  number of entries in the
+   * `metadata.proto_schema.columns` value received in the first response.
+   * 
+ * + * repeated .google.bigtable.v2.Value values = 2; + */ + com.google.bigtable.v2.ValueOrBuilder getValuesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java new file mode 100644 index 000000000000..e8efbf52a30e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java @@ -0,0 +1,916 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * ResultSet schema in proto format
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoSchema} + */ +@com.google.protobuf.Generated +public final class ProtoSchema extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoSchema) + ProtoSchemaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProtoSchema"); + } + + // Use ProtoSchema.newBuilder() to construct. + private ProtoSchema(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ProtoSchema() { + columns_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoSchema.class, + com.google.bigtable.v2.ProtoSchema.Builder.class); + } + + public static final int COLUMNS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnMetadata getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnMetadataOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + 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 { + for (int i = 0; i < columns_.size(); i++) { + output.writeMessage(1, columns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, columns_.get(i)); + } + size += getUnknownFields().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.ProtoSchema)) { + return super.equals(obj); + } + com.google.bigtable.v2.ProtoSchema other = (com.google.bigtable.v2.ProtoSchema) obj; + + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoSchema 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.ProtoSchema parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoSchema 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.ProtoSchema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoSchema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoSchema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ProtoSchema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ProtoSchema 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * ResultSet schema in proto format
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ProtoSchema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ProtoSchema) + com.google.bigtable.v2.ProtoSchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoSchema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ProtoSchema.class, + com.google.bigtable.v2.ProtoSchema.Builder.class); + } + + // Construct using com.google.bigtable.v2.ProtoSchema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ProtoSchema_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoSchema getDefaultInstanceForType() { + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoSchema build() { + com.google.bigtable.v2.ProtoSchema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ProtoSchema buildPartial() { + com.google.bigtable.v2.ProtoSchema result = new com.google.bigtable.v2.ProtoSchema(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.ProtoSchema result) { + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.ProtoSchema result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ProtoSchema) { + return mergeFrom((com.google.bigtable.v2.ProtoSchema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ProtoSchema other) { + if (other == com.google.bigtable.v2.ProtoSchema.getDefaultInstance()) return this; + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.ColumnMetadata m = + input.readMessage( + com.google.bigtable.v2.ColumnMetadata.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ColumnMetadata, + com.google.bigtable.v2.ColumnMetadata.Builder, + com.google.bigtable.v2.ColumnMetadataOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public com.google.bigtable.v2.ColumnMetadata getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder setColumns(int index, com.google.bigtable.v2.ColumnMetadata value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder setColumns( + int index, com.google.bigtable.v2.ColumnMetadata.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder addColumns(com.google.bigtable.v2.ColumnMetadata value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder addColumns(int index, com.google.bigtable.v2.ColumnMetadata value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder addColumns(com.google.bigtable.v2.ColumnMetadata.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder addColumns( + int index, com.google.bigtable.v2.ColumnMetadata.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public com.google.bigtable.v2.ColumnMetadata.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public com.google.bigtable.v2.ColumnMetadataOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public com.google.bigtable.v2.ColumnMetadata.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.bigtable.v2.ColumnMetadata.getDefaultInstance()); + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public com.google.bigtable.v2.ColumnMetadata.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.ColumnMetadata.getDefaultInstance()); + } + + /** + * + * + *
+     * The columns in the result set.
+     * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + public java.util.List getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ColumnMetadata, + com.google.bigtable.v2.ColumnMetadata.Builder, + com.google.bigtable.v2.ColumnMetadataOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ColumnMetadata, + com.google.bigtable.v2.ColumnMetadata.Builder, + com.google.bigtable.v2.ColumnMetadataOrBuilder>( + columns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ProtoSchema) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ProtoSchema) + private static final com.google.bigtable.v2.ProtoSchema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ProtoSchema(); + } + + public static com.google.bigtable.v2.ProtoSchema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProtoSchema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProtoSchema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java new file mode 100644 index 000000000000..1b29f94d7cb0 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ProtoSchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ProtoSchema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + com.google.bigtable.v2.ColumnMetadata getColumns(int index); + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + int getColumnsCount(); + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + java.util.List + getColumnsOrBuilderList(); + + /** + * + * + *
+   * The columns in the result set.
+   * 
+ * + * repeated .google.bigtable.v2.ColumnMetadata columns = 1; + */ + com.google.bigtable.v2.ColumnMetadataOrBuilder getColumnsOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java new file mode 100644 index 000000000000..eb4d94200398 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java @@ -0,0 +1,877 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Information about how client should adjust the load to Bigtable.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RateLimitInfo} + */ +@com.google.protobuf.Generated +public final class RateLimitInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RateLimitInfo) + RateLimitInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RateLimitInfo"); + } + + // Use RateLimitInfo.newBuilder() to construct. + private RateLimitInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RateLimitInfo() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_RateLimitInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_RateLimitInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RateLimitInfo.class, + com.google.bigtable.v2.RateLimitInfo.Builder.class); + } + + private int bitField0_; + public static final int PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration period_; + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return Whether the period field is set. + */ + @java.lang.Override + public boolean hasPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return The period. + */ + @java.lang.Override + public com.google.protobuf.Duration getPeriod() { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + } + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + } + + public static final int FACTOR_FIELD_NUMBER = 2; + private double factor_ = 0D; + + /** + * + * + *
+   * If it has been at least one `period` since the last load adjustment, the
+   * client should multiply the current load by this value to get the new target
+   * load. For example, if the current load is 100 and `factor` is 0.8, the new
+   * target load should be 80. After adjusting, the client should ignore
+   * `factor` until another `period` has passed.
+   *
+   * The client can measure its load using any unit that's comparable over time.
+   * For example, QPS can be used as long as each request involves a similar
+   * amount of work.
+   * 
+ * + * double factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public double getFactor() { + return factor_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPeriod()); + } + if (java.lang.Double.doubleToRawLongBits(factor_) != 0) { + output.writeDouble(2, factor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPeriod()); + } + if (java.lang.Double.doubleToRawLongBits(factor_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, factor_); + } + size += getUnknownFields().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.RateLimitInfo)) { + return super.equals(obj); + } + com.google.bigtable.v2.RateLimitInfo other = (com.google.bigtable.v2.RateLimitInfo) obj; + + if (hasPeriod() != other.hasPeriod()) return false; + if (hasPeriod()) { + if (!getPeriod().equals(other.getPeriod())) return false; + } + if (java.lang.Double.doubleToLongBits(getFactor()) + != java.lang.Double.doubleToLongBits(other.getFactor())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPeriod()) { + hash = (37 * hash) + PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getPeriod().hashCode(); + } + hash = (37 * hash) + FACTOR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getFactor())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RateLimitInfo 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.RateLimitInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RateLimitInfo 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.RateLimitInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RateLimitInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RateLimitInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RateLimitInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RateLimitInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information about how client should adjust the load to Bigtable.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RateLimitInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RateLimitInfo) + com.google.bigtable.v2.RateLimitInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_RateLimitInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_RateLimitInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RateLimitInfo.class, + com.google.bigtable.v2.RateLimitInfo.Builder.class); + } + + // Construct using com.google.bigtable.v2.RateLimitInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPeriodFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + period_ = null; + if (periodBuilder_ != null) { + periodBuilder_.dispose(); + periodBuilder_ = null; + } + factor_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_RateLimitInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RateLimitInfo getDefaultInstanceForType() { + return com.google.bigtable.v2.RateLimitInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RateLimitInfo build() { + com.google.bigtable.v2.RateLimitInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RateLimitInfo buildPartial() { + com.google.bigtable.v2.RateLimitInfo result = new com.google.bigtable.v2.RateLimitInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RateLimitInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.period_ = periodBuilder_ == null ? period_ : periodBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.factor_ = factor_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RateLimitInfo) { + return mergeFrom((com.google.bigtable.v2.RateLimitInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RateLimitInfo other) { + if (other == com.google.bigtable.v2.RateLimitInfo.getDefaultInstance()) return this; + if (other.hasPeriod()) { + mergePeriod(other.getPeriod()); + } + if (java.lang.Double.doubleToRawLongBits(other.getFactor()) != 0) { + setFactor(other.getFactor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + factor_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration period_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + periodBuilder_; + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return Whether the period field is set. + */ + public boolean hasPeriod() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return The period. + */ + public com.google.protobuf.Duration getPeriod() { + if (periodBuilder_ == null) { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + } else { + return periodBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder setPeriod(com.google.protobuf.Duration value) { + if (periodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + period_ = value; + } else { + periodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder setPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (periodBuilder_ == null) { + period_ = builderForValue.build(); + } else { + periodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder mergePeriod(com.google.protobuf.Duration value) { + if (periodBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && period_ != null + && period_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPeriodBuilder().mergeFrom(value); + } else { + period_ = value; + } + } else { + periodBuilder_.mergeFrom(value); + } + if (period_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public Builder clearPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + period_ = null; + if (periodBuilder_ != null) { + periodBuilder_.dispose(); + periodBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public com.google.protobuf.Duration.Builder getPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPeriodFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + public com.google.protobuf.DurationOrBuilder getPeriodOrBuilder() { + if (periodBuilder_ != null) { + return periodBuilder_.getMessageOrBuilder(); + } else { + return period_ == null ? com.google.protobuf.Duration.getDefaultInstance() : period_; + } + } + + /** + * + * + *
+     * Time that clients should wait before adjusting the target rate again.
+     * If clients adjust rate too frequently, the impact of the previous
+     * adjustment may not have been taken into account and may
+     * over-throttle or under-throttle. If clients adjust rate too slowly, they
+     * will not be responsive to load changes on server side, and may
+     * over-throttle or under-throttle.
+     * 
+ * + * .google.protobuf.Duration period = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPeriodFieldBuilder() { + if (periodBuilder_ == null) { + periodBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPeriod(), getParentForChildren(), isClean()); + period_ = null; + } + return periodBuilder_; + } + + private double factor_; + + /** + * + * + *
+     * If it has been at least one `period` since the last load adjustment, the
+     * client should multiply the current load by this value to get the new target
+     * load. For example, if the current load is 100 and `factor` is 0.8, the new
+     * target load should be 80. After adjusting, the client should ignore
+     * `factor` until another `period` has passed.
+     *
+     * The client can measure its load using any unit that's comparable over time.
+     * For example, QPS can be used as long as each request involves a similar
+     * amount of work.
+     * 
+ * + * double factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public double getFactor() { + return factor_; + } + + /** + * + * + *
+     * If it has been at least one `period` since the last load adjustment, the
+     * client should multiply the current load by this value to get the new target
+     * load. For example, if the current load is 100 and `factor` is 0.8, the new
+     * target load should be 80. After adjusting, the client should ignore
+     * `factor` until another `period` has passed.
+     *
+     * The client can measure its load using any unit that's comparable over time.
+     * For example, QPS can be used as long as each request involves a similar
+     * amount of work.
+     * 
+ * + * double factor = 2; + * + * @param value The factor to set. + * @return This builder for chaining. + */ + public Builder setFactor(double value) { + + factor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If it has been at least one `period` since the last load adjustment, the
+     * client should multiply the current load by this value to get the new target
+     * load. For example, if the current load is 100 and `factor` is 0.8, the new
+     * target load should be 80. After adjusting, the client should ignore
+     * `factor` until another `period` has passed.
+     *
+     * The client can measure its load using any unit that's comparable over time.
+     * For example, QPS can be used as long as each request involves a similar
+     * amount of work.
+     * 
+ * + * double factor = 2; + * + * @return This builder for chaining. + */ + public Builder clearFactor() { + bitField0_ = (bitField0_ & ~0x00000002); + factor_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RateLimitInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RateLimitInfo) + private static final com.google.bigtable.v2.RateLimitInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RateLimitInfo(); + } + + public static com.google.bigtable.v2.RateLimitInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RateLimitInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RateLimitInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.java new file mode 100644 index 000000000000..f6798ac14af7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RateLimitInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RateLimitInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return Whether the period field is set. + */ + boolean hasPeriod(); + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + * + * @return The period. + */ + com.google.protobuf.Duration getPeriod(); + + /** + * + * + *
+   * Time that clients should wait before adjusting the target rate again.
+   * If clients adjust rate too frequently, the impact of the previous
+   * adjustment may not have been taken into account and may
+   * over-throttle or under-throttle. If clients adjust rate too slowly, they
+   * will not be responsive to load changes on server side, and may
+   * over-throttle or under-throttle.
+   * 
+ * + * .google.protobuf.Duration period = 1; + */ + com.google.protobuf.DurationOrBuilder getPeriodOrBuilder(); + + /** + * + * + *
+   * If it has been at least one `period` since the last load adjustment, the
+   * client should multiply the current load by this value to get the new target
+   * load. For example, if the current load is 100 and `factor` is 0.8, the new
+   * target load should be 80. After adjusting, the client should ignore
+   * `factor` until another `period` has passed.
+   *
+   * The client can measure its load using any unit that's comparable over time.
+   * For example, QPS can be used as long as each request involves a similar
+   * amount of work.
+   * 
+ * + * double factor = 2; + * + * @return The factor. + */ + double getFactor(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java new file mode 100644 index 000000000000..5ce915028b4c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java @@ -0,0 +1,2557 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * Request message for Bigtable.ReadChangeStream.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamRequest} + */ +@com.google.protobuf.Generated +public final class ReadChangeStreamRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamRequest) + ReadChangeStreamRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadChangeStreamRequest"); + } + + // Use ReadChangeStreamRequest.newBuilder() to construct. + private ReadChangeStreamRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadChangeStreamRequest() { + tableName_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamRequest.class, + com.google.bigtable.v2.ReadChangeStreamRequest.Builder.class); + } + + private int bitField0_; + private int startFromCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object startFrom_; + + public enum StartFromCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + START_TIME(4), + CONTINUATION_TOKENS(6), + STARTFROM_NOT_SET(0); + private final int value; + + private StartFromCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StartFromCase valueOf(int value) { + return forNumber(value); + } + + public static StartFromCase forNumber(int value) { + switch (value) { + case 4: + return START_TIME; + case 6: + return CONTINUATION_TOKENS; + case 0: + return STARTFROM_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StartFromCase getStartFromCase() { + return StartFromCase.forNumber(startFromCase_); + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the table from which to read a change stream.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the table from which to read a change stream.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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; + } + } + + public static final int PARTITION_FIELD_NUMBER = 3; + private com.google.bigtable.v2.StreamPartition partition_; + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return Whether the partition field is set. + */ + @java.lang.Override + public boolean hasPartition() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return The partition. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartition getPartition() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + public static final int START_TIME_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startFromCase_ == 4; + } + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + if (startFromCase_ == 4) { + return (com.google.protobuf.Timestamp) startFrom_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startFromCase_ == 4) { + return (com.google.protobuf.Timestamp) startFrom_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int CONTINUATION_TOKENS_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return Whether the continuationTokens field is set. + */ + @java.lang.Override + public boolean hasContinuationTokens() { + return startFromCase_ == 6; + } + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return The continuationTokens. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokens getContinuationTokens() { + if (startFromCase_ == 6) { + return (com.google.bigtable.v2.StreamContinuationTokens) startFrom_; + } + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokensOrBuilder getContinuationTokensOrBuilder() { + if (startFromCase_ == 6) { + return (com.google.bigtable.v2.StreamContinuationTokens) startFrom_; + } + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + + public static final int END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int HEARTBEAT_DURATION_FIELD_NUMBER = 7; + private com.google.protobuf.Duration heartbeatDuration_; + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return Whether the heartbeatDuration field is set. + */ + @java.lang.Override + public boolean hasHeartbeatDuration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return The heartbeatDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getHeartbeatDuration() { + return heartbeatDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : heartbeatDuration_; + } + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getHeartbeatDurationOrBuilder() { + return heartbeatDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : heartbeatDuration_; + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPartition()); + } + if (startFromCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Timestamp) startFrom_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getEndTime()); + } + if (startFromCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.StreamContinuationTokens) startFrom_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getHeartbeatDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPartition()); + } + if (startFromCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Timestamp) startFrom_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); + } + if (startFromCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.StreamContinuationTokens) startFrom_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getHeartbeatDuration()); + } + size += getUnknownFields().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.ReadChangeStreamRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamRequest other = + (com.google.bigtable.v2.ReadChangeStreamRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (hasPartition() != other.hasPartition()) return false; + if (hasPartition()) { + if (!getPartition().equals(other.getPartition())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasHeartbeatDuration() != other.hasHeartbeatDuration()) return false; + if (hasHeartbeatDuration()) { + if (!getHeartbeatDuration().equals(other.getHeartbeatDuration())) return false; + } + if (!getStartFromCase().equals(other.getStartFromCase())) return false; + switch (startFromCase_) { + case 4: + if (!getStartTime().equals(other.getStartTime())) return false; + break; + case 6: + if (!getContinuationTokens().equals(other.getContinuationTokens())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + if (hasPartition()) { + hash = (37 * hash) + PARTITION_FIELD_NUMBER; + hash = (53 * hash) + getPartition().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasHeartbeatDuration()) { + hash = (37 * hash) + HEARTBEAT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getHeartbeatDuration().hashCode(); + } + switch (startFromCase_) { + case 4: + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + break; + case 6: + hash = (37 * hash) + CONTINUATION_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getContinuationTokens().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest 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.ReadChangeStreamRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest 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.ReadChangeStreamRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * Request message for Bigtable.ReadChangeStream.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamRequest) + com.google.bigtable.v2.ReadChangeStreamRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamRequest.class, + com.google.bigtable.v2.ReadChangeStreamRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPartitionFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetHeartbeatDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + appProfileId_ = ""; + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + if (startTimeBuilder_ != null) { + startTimeBuilder_.clear(); + } + if (continuationTokensBuilder_ != null) { + continuationTokensBuilder_.clear(); + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + heartbeatDuration_ = null; + if (heartbeatDurationBuilder_ != null) { + heartbeatDurationBuilder_.dispose(); + heartbeatDurationBuilder_ = null; + } + startFromCase_ = 0; + startFrom_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamRequest build() { + com.google.bigtable.v2.ReadChangeStreamRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamRequest buildPartial() { + com.google.bigtable.v2.ReadChangeStreamRequest result = + new com.google.bigtable.v2.ReadChangeStreamRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadChangeStreamRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.partition_ = partitionBuilder_ == null ? partition_ : partitionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.heartbeatDuration_ = + heartbeatDurationBuilder_ == null + ? heartbeatDuration_ + : heartbeatDurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadChangeStreamRequest result) { + result.startFromCase_ = startFromCase_; + result.startFrom_ = this.startFrom_; + if (startFromCase_ == 4 && startTimeBuilder_ != null) { + result.startFrom_ = startTimeBuilder_.build(); + } + if (startFromCase_ == 6 && continuationTokensBuilder_ != null) { + result.startFrom_ = continuationTokensBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamRequest) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadChangeStreamRequest other) { + if (other == com.google.bigtable.v2.ReadChangeStreamRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPartition()) { + mergePartition(other.getPartition()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasHeartbeatDuration()) { + mergeHeartbeatDuration(other.getHeartbeatDuration()); + } + switch (other.getStartFromCase()) { + case START_TIME: + { + mergeStartTime(other.getStartTime()); + break; + } + case CONTINUATION_TOKENS: + { + mergeContinuationTokens(other.getContinuationTokens()); + break; + } + case STARTFROM_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPartitionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry); + startFromCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetContinuationTokensFieldBuilder().getBuilder(), extensionRegistry); + startFromCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetHeartbeatDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startFromCase_ = 0; + private java.lang.Object startFrom_; + + public StartFromCase getStartFromCase() { + return StartFromCase.forNumber(startFromCase_); + } + + public Builder clearStartFrom() { + startFromCase_ = 0; + startFrom_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the table from which to read a change stream.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table from which to read a change stream.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the table from which to read a change stream.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table from which to read a change stream.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the table from which to read a change stream.
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * Change streaming must be enabled on the table.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * Single cluster routing must be configured on the profile.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.bigtable.v2.StreamPartition partition_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + partitionBuilder_; + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return Whether the partition field is set. + */ + public boolean hasPartition() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return The partition. + */ + public com.google.bigtable.v2.StreamPartition getPartition() { + if (partitionBuilder_ == null) { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } else { + return partitionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + } else { + partitionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (partitionBuilder_ == null) { + partition_ = builderForValue.build(); + } else { + partitionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public Builder mergePartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && partition_ != null + && partition_ != com.google.bigtable.v2.StreamPartition.getDefaultInstance()) { + getPartitionBuilder().mergeFrom(value); + } else { + partition_ = value; + } + } else { + partitionBuilder_.mergeFrom(value); + } + if (partition_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public Builder clearPartition() { + bitField0_ = (bitField0_ & ~0x00000004); + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public com.google.bigtable.v2.StreamPartition.Builder getPartitionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPartitionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + if (partitionBuilder_ != null) { + return partitionBuilder_.getMessageOrBuilder(); + } else { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + } + + /** + * + * + *
+     * The partition to read changes from.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + internalGetPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder>( + getPartition(), getParentForChildren(), isClean()); + partition_ = null; + } + return partitionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startFromCase_ == 4; + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + if (startFromCase_ == 4) { + return (com.google.protobuf.Timestamp) startFrom_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (startFromCase_ == 4) { + return startTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startFrom_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + startFromCase_ = 4; + return this; + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startFrom_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + startFromCase_ = 4; + return this; + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startFromCase_ == 4 + && startFrom_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + startFrom_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) startFrom_) + .mergeFrom(value) + .buildPartial(); + } else { + startFrom_ = value; + } + onChanged(); + } else { + if (startFromCase_ == 4) { + startTimeBuilder_.mergeFrom(value); + } else { + startTimeBuilder_.setMessage(value); + } + } + startFromCase_ = 4; + return this; + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + if (startFromCase_ == 4) { + startFromCase_ = 0; + startFrom_ = null; + onChanged(); + } + } else { + if (startFromCase_ == 4) { + startFromCase_ = 0; + startFrom_ = null; + } + startTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + return internalGetStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if ((startFromCase_ == 4) && (startTimeBuilder_ != null)) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + if (startFromCase_ == 4) { + return (com.google.protobuf.Timestamp) startFrom_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Start reading the stream at the specified timestamp. This timestamp must
+     * be within the change stream retention period, less than or equal to the
+     * current time, and after change stream creation, whichever is greater.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + if (!(startFromCase_ == 4)) { + startFrom_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) startFrom_, getParentForChildren(), isClean()); + startFrom_ = null; + } + startFromCase_ = 4; + onChanged(); + return startTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationTokens, + com.google.bigtable.v2.StreamContinuationTokens.Builder, + com.google.bigtable.v2.StreamContinuationTokensOrBuilder> + continuationTokensBuilder_; + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return Whether the continuationTokens field is set. + */ + @java.lang.Override + public boolean hasContinuationTokens() { + return startFromCase_ == 6; + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return The continuationTokens. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokens getContinuationTokens() { + if (continuationTokensBuilder_ == null) { + if (startFromCase_ == 6) { + return (com.google.bigtable.v2.StreamContinuationTokens) startFrom_; + } + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } else { + if (startFromCase_ == 6) { + return continuationTokensBuilder_.getMessage(); + } + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + public Builder setContinuationTokens(com.google.bigtable.v2.StreamContinuationTokens value) { + if (continuationTokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startFrom_ = value; + onChanged(); + } else { + continuationTokensBuilder_.setMessage(value); + } + startFromCase_ = 6; + return this; + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + public Builder setContinuationTokens( + com.google.bigtable.v2.StreamContinuationTokens.Builder builderForValue) { + if (continuationTokensBuilder_ == null) { + startFrom_ = builderForValue.build(); + onChanged(); + } else { + continuationTokensBuilder_.setMessage(builderForValue.build()); + } + startFromCase_ = 6; + return this; + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + public Builder mergeContinuationTokens(com.google.bigtable.v2.StreamContinuationTokens value) { + if (continuationTokensBuilder_ == null) { + if (startFromCase_ == 6 + && startFrom_ != com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance()) { + startFrom_ = + com.google.bigtable.v2.StreamContinuationTokens.newBuilder( + (com.google.bigtable.v2.StreamContinuationTokens) startFrom_) + .mergeFrom(value) + .buildPartial(); + } else { + startFrom_ = value; + } + onChanged(); + } else { + if (startFromCase_ == 6) { + continuationTokensBuilder_.mergeFrom(value); + } else { + continuationTokensBuilder_.setMessage(value); + } + } + startFromCase_ = 6; + return this; + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + public Builder clearContinuationTokens() { + if (continuationTokensBuilder_ == null) { + if (startFromCase_ == 6) { + startFromCase_ = 0; + startFrom_ = null; + onChanged(); + } + } else { + if (startFromCase_ == 6) { + startFromCase_ = 0; + startFrom_ = null; + } + continuationTokensBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + public com.google.bigtable.v2.StreamContinuationTokens.Builder getContinuationTokensBuilder() { + return internalGetContinuationTokensFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokensOrBuilder + getContinuationTokensOrBuilder() { + if ((startFromCase_ == 6) && (continuationTokensBuilder_ != null)) { + return continuationTokensBuilder_.getMessageOrBuilder(); + } else { + if (startFromCase_ == 6) { + return (com.google.bigtable.v2.StreamContinuationTokens) startFrom_; + } + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Tokens that describe how to resume reading a stream where reading
+     * previously left off. If specified, changes will be read starting at the
+     * the position. Tokens are delivered on the stream as part of `Heartbeat`
+     * and `CloseStream` messages.
+     *
+     * If a single token is provided, the token's partition must exactly match
+     * the request's partition. If multiple tokens are provided, as in the case
+     * of a partition merge, the union of the token partitions must exactly
+     * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+     * returned.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationTokens, + com.google.bigtable.v2.StreamContinuationTokens.Builder, + com.google.bigtable.v2.StreamContinuationTokensOrBuilder> + internalGetContinuationTokensFieldBuilder() { + if (continuationTokensBuilder_ == null) { + if (!(startFromCase_ == 6)) { + startFrom_ = com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + continuationTokensBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationTokens, + com.google.bigtable.v2.StreamContinuationTokens.Builder, + com.google.bigtable.v2.StreamContinuationTokensOrBuilder>( + (com.google.bigtable.v2.StreamContinuationTokens) startFrom_, + getParentForChildren(), + isClean()); + startFrom_ = null; + } + startFromCase_ = 6; + onChanged(); + return continuationTokensBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * If specified, OK will be returned when the stream advances beyond
+     * this time. Otherwise, changes will be continuously delivered on the stream.
+     * This value is inclusive and will be truncated to microsecond granularity.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Duration heartbeatDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + heartbeatDurationBuilder_; + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return Whether the heartbeatDuration field is set. + */ + public boolean hasHeartbeatDuration() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return The heartbeatDuration. + */ + public com.google.protobuf.Duration getHeartbeatDuration() { + if (heartbeatDurationBuilder_ == null) { + return heartbeatDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : heartbeatDuration_; + } else { + return heartbeatDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public Builder setHeartbeatDuration(com.google.protobuf.Duration value) { + if (heartbeatDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + heartbeatDuration_ = value; + } else { + heartbeatDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public Builder setHeartbeatDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (heartbeatDurationBuilder_ == null) { + heartbeatDuration_ = builderForValue.build(); + } else { + heartbeatDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public Builder mergeHeartbeatDuration(com.google.protobuf.Duration value) { + if (heartbeatDurationBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && heartbeatDuration_ != null + && heartbeatDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getHeartbeatDurationBuilder().mergeFrom(value); + } else { + heartbeatDuration_ = value; + } + } else { + heartbeatDurationBuilder_.mergeFrom(value); + } + if (heartbeatDuration_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public Builder clearHeartbeatDuration() { + bitField0_ = (bitField0_ & ~0x00000040); + heartbeatDuration_ = null; + if (heartbeatDurationBuilder_ != null) { + heartbeatDurationBuilder_.dispose(); + heartbeatDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public com.google.protobuf.Duration.Builder getHeartbeatDurationBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetHeartbeatDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + public com.google.protobuf.DurationOrBuilder getHeartbeatDurationOrBuilder() { + if (heartbeatDurationBuilder_ != null) { + return heartbeatDurationBuilder_.getMessageOrBuilder(); + } else { + return heartbeatDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : heartbeatDuration_; + } + } + + /** + * + * + *
+     * If specified, the duration between `Heartbeat` messages on the stream.
+     * Otherwise, defaults to 5 seconds.
+     * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetHeartbeatDurationFieldBuilder() { + if (heartbeatDurationBuilder_ == null) { + heartbeatDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getHeartbeatDuration(), getParentForChildren(), isClean()); + heartbeatDuration_ = null; + } + return heartbeatDurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamRequest) + private static final com.google.bigtable.v2.ReadChangeStreamRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamRequest(); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadChangeStreamRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java new file mode 100644 index 000000000000..6f675afcd72a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java @@ -0,0 +1,326 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadChangeStreamRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the table from which to read a change stream.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Required. The unique name of the table from which to read a change stream.
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * Change streaming must be enabled on the table.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * 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.
+   * Single cluster routing must be configured on the profile.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return Whether the partition field is set. + */ + boolean hasPartition(); + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + * + * @return The partition. + */ + com.google.bigtable.v2.StreamPartition getPartition(); + + /** + * + * + *
+   * The partition to read changes from.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 3; + */ + com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder(); + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * Start reading the stream at the specified timestamp. This timestamp must
+   * be within the change stream retention period, less than or equal to the
+   * current time, and after change stream creation, whichever is greater.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return Whether the continuationTokens field is set. + */ + boolean hasContinuationTokens(); + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + * + * @return The continuationTokens. + */ + com.google.bigtable.v2.StreamContinuationTokens getContinuationTokens(); + + /** + * + * + *
+   * Tokens that describe how to resume reading a stream where reading
+   * previously left off. If specified, changes will be read starting at the
+   * the position. Tokens are delivered on the stream as part of `Heartbeat`
+   * and `CloseStream` messages.
+   *
+   * If a single token is provided, the token's partition must exactly match
+   * the request's partition. If multiple tokens are provided, as in the case
+   * of a partition merge, the union of the token partitions must exactly
+   * cover the request's partition. Otherwise, INVALID_ARGUMENT will be
+   * returned.
+   * 
+ * + * .google.bigtable.v2.StreamContinuationTokens continuation_tokens = 6; + */ + com.google.bigtable.v2.StreamContinuationTokensOrBuilder getContinuationTokensOrBuilder(); + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * If specified, OK will be returned when the stream advances beyond
+   * this time. Otherwise, changes will be continuously delivered on the stream.
+   * This value is inclusive and will be truncated to microsecond granularity.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return Whether the heartbeatDuration field is set. + */ + boolean hasHeartbeatDuration(); + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + * + * @return The heartbeatDuration. + */ + com.google.protobuf.Duration getHeartbeatDuration(); + + /** + * + * + *
+   * If specified, the duration between `Heartbeat` messages on the stream.
+   * Otherwise, defaults to 5 seconds.
+   * 
+ * + * .google.protobuf.Duration heartbeat_duration = 7; + */ + com.google.protobuf.DurationOrBuilder getHeartbeatDurationOrBuilder(); + + com.google.bigtable.v2.ReadChangeStreamRequest.StartFromCase getStartFromCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java new file mode 100644 index 000000000000..b6e30ba04b92 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java @@ -0,0 +1,9472 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * Response message for Bigtable.ReadChangeStream.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse} + */ +@com.google.protobuf.Generated +public final class ReadChangeStreamResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse) + ReadChangeStreamResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadChangeStreamResponse"); + } + + // Use ReadChangeStreamResponse.newBuilder() to construct. + private ReadChangeStreamResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadChangeStreamResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.class, + com.google.bigtable.v2.ReadChangeStreamResponse.Builder.class); + } + + public interface MutationChunkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return Whether the chunkInfo field is set. + */ + boolean hasChunkInfo(); + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return The chunkInfo. + */ + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo getChunkInfo(); + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder + getChunkInfoOrBuilder(); + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return Whether the mutation field is set. + */ + boolean hasMutation(); + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return The mutation. + */ + com.google.bigtable.v2.Mutation getMutation(); + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + com.google.bigtable.v2.MutationOrBuilder getMutationOrBuilder(); + } + + /** + * + * + *
+   * A partial or complete mutation.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} + */ + public static final class MutationChunk extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + MutationChunkOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutationChunk"); + } + + // Use MutationChunk.newBuilder() to construct. + private MutationChunk(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MutationChunk() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.class, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder.class); + } + + public interface ChunkInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The total value size of all the chunks that make up the `SetCell`.
+       * 
+ * + * int32 chunked_value_size = 1; + * + * @return The chunkedValueSize. + */ + int getChunkedValueSize(); + + /** + * + * + *
+       * The byte offset of this chunk into the total value size of the
+       * mutation.
+       * 
+ * + * int32 chunked_value_offset = 2; + * + * @return The chunkedValueOffset. + */ + int getChunkedValueOffset(); + + /** + * + * + *
+       * When true, this is the last chunk of a chunked `SetCell`.
+       * 
+ * + * bool last_chunk = 3; + * + * @return The lastChunk. + */ + boolean getLastChunk(); + } + + /** + * + * + *
+     * Information about the chunking of this mutation.
+     * Only `SetCell` mutations can be chunked, and all chunks for a `SetCell`
+     * will be delivered contiguously with no other mutation types interleaved.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} + */ + public static final class ChunkInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + ChunkInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChunkInfo"); + } + + // Use ChunkInfo.newBuilder() to construct. + private ChunkInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ChunkInfo() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.class, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder + .class); + } + + public static final int CHUNKED_VALUE_SIZE_FIELD_NUMBER = 1; + private int chunkedValueSize_ = 0; + + /** + * + * + *
+       * The total value size of all the chunks that make up the `SetCell`.
+       * 
+ * + * int32 chunked_value_size = 1; + * + * @return The chunkedValueSize. + */ + @java.lang.Override + public int getChunkedValueSize() { + return chunkedValueSize_; + } + + public static final int CHUNKED_VALUE_OFFSET_FIELD_NUMBER = 2; + private int chunkedValueOffset_ = 0; + + /** + * + * + *
+       * The byte offset of this chunk into the total value size of the
+       * mutation.
+       * 
+ * + * int32 chunked_value_offset = 2; + * + * @return The chunkedValueOffset. + */ + @java.lang.Override + public int getChunkedValueOffset() { + return chunkedValueOffset_; + } + + public static final int LAST_CHUNK_FIELD_NUMBER = 3; + private boolean lastChunk_ = false; + + /** + * + * + *
+       * When true, this is the last chunk of a chunked `SetCell`.
+       * 
+ * + * bool last_chunk = 3; + * + * @return The lastChunk. + */ + @java.lang.Override + public boolean getLastChunk() { + return lastChunk_; + } + + 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 (chunkedValueSize_ != 0) { + output.writeInt32(1, chunkedValueSize_); + } + if (chunkedValueOffset_ != 0) { + output.writeInt32(2, chunkedValueOffset_); + } + if (lastChunk_ != false) { + output.writeBool(3, lastChunk_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (chunkedValueSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, chunkedValueSize_); + } + if (chunkedValueOffset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, chunkedValueOffset_); + } + if (lastChunk_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, lastChunk_); + } + size += getUnknownFields().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.ReadChangeStreamResponse.MutationChunk.ChunkInfo)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo other = + (com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) obj; + + if (getChunkedValueSize() != other.getChunkedValueSize()) return false; + if (getChunkedValueOffset() != other.getChunkedValueOffset()) return false; + if (getLastChunk() != other.getLastChunk()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CHUNKED_VALUE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getChunkedValueSize(); + hash = (37 * hash) + CHUNKED_VALUE_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getChunkedValueOffset(); + hash = (37 * hash) + LAST_CHUNK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLastChunk()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + 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.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + 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.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse.MutationChunk.ChunkInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Information about the chunking of this mutation.
+       * Only `SetCell` mutations can be chunked, and all chunks for a `SetCell`
+       * will be delivered contiguously with no other mutation types interleaved.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.class, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + chunkedValueSize_ = 0; + chunkedValueOffset_ = 0; + lastChunk_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo build() { + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo result = + new com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.chunkedValueSize_ = chunkedValueSize_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.chunkedValueOffset_ = chunkedValueOffset_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lastChunk_ = lastChunk_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) { + return mergeFrom( + (com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo other) { + if (other + == com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance()) return this; + if (other.getChunkedValueSize() != 0) { + setChunkedValueSize(other.getChunkedValueSize()); + } + if (other.getChunkedValueOffset() != 0) { + setChunkedValueOffset(other.getChunkedValueOffset()); + } + if (other.getLastChunk() != false) { + setLastChunk(other.getLastChunk()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + chunkedValueSize_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + chunkedValueOffset_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + lastChunk_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int chunkedValueSize_; + + /** + * + * + *
+         * The total value size of all the chunks that make up the `SetCell`.
+         * 
+ * + * int32 chunked_value_size = 1; + * + * @return The chunkedValueSize. + */ + @java.lang.Override + public int getChunkedValueSize() { + return chunkedValueSize_; + } + + /** + * + * + *
+         * The total value size of all the chunks that make up the `SetCell`.
+         * 
+ * + * int32 chunked_value_size = 1; + * + * @param value The chunkedValueSize to set. + * @return This builder for chaining. + */ + public Builder setChunkedValueSize(int value) { + + chunkedValueSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * The total value size of all the chunks that make up the `SetCell`.
+         * 
+ * + * int32 chunked_value_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearChunkedValueSize() { + bitField0_ = (bitField0_ & ~0x00000001); + chunkedValueSize_ = 0; + onChanged(); + return this; + } + + private int chunkedValueOffset_; + + /** + * + * + *
+         * The byte offset of this chunk into the total value size of the
+         * mutation.
+         * 
+ * + * int32 chunked_value_offset = 2; + * + * @return The chunkedValueOffset. + */ + @java.lang.Override + public int getChunkedValueOffset() { + return chunkedValueOffset_; + } + + /** + * + * + *
+         * The byte offset of this chunk into the total value size of the
+         * mutation.
+         * 
+ * + * int32 chunked_value_offset = 2; + * + * @param value The chunkedValueOffset to set. + * @return This builder for chaining. + */ + public Builder setChunkedValueOffset(int value) { + + chunkedValueOffset_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The byte offset of this chunk into the total value size of the
+         * mutation.
+         * 
+ * + * int32 chunked_value_offset = 2; + * + * @return This builder for chaining. + */ + public Builder clearChunkedValueOffset() { + bitField0_ = (bitField0_ & ~0x00000002); + chunkedValueOffset_ = 0; + onChanged(); + return this; + } + + private boolean lastChunk_; + + /** + * + * + *
+         * When true, this is the last chunk of a chunked `SetCell`.
+         * 
+ * + * bool last_chunk = 3; + * + * @return The lastChunk. + */ + @java.lang.Override + public boolean getLastChunk() { + return lastChunk_; + } + + /** + * + * + *
+         * When true, this is the last chunk of a chunked `SetCell`.
+         * 
+ * + * bool last_chunk = 3; + * + * @param value The lastChunk to set. + * @return This builder for chaining. + */ + public Builder setLastChunk(boolean value) { + + lastChunk_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+         * When true, this is the last chunk of a chunked `SetCell`.
+         * 
+ * + * bool last_chunk = 3; + * + * @return This builder for chaining. + */ + public Builder clearLastChunk() { + bitField0_ = (bitField0_ & ~0x00000004); + lastChunk_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + private static final com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChunkInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse.MutationChunk.ChunkInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CHUNK_INFO_FIELD_NUMBER = 1; + private com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunkInfo_; + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return Whether the chunkInfo field is set. + */ + @java.lang.Override + public boolean hasChunkInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return The chunkInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo getChunkInfo() { + return chunkInfo_ == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance() + : chunkInfo_; + } + + /** + * + * + *
+     * If set, then the mutation is a `SetCell` with a chunked value across
+     * multiple messages.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder + getChunkInfoOrBuilder() { + return chunkInfo_ == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance() + : chunkInfo_; + } + + public static final int MUTATION_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Mutation mutation_; + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return Whether the mutation field is set. + */ + @java.lang.Override + public boolean hasMutation() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return The mutation. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getMutation() { + return mutation_ == null ? com.google.bigtable.v2.Mutation.getDefaultInstance() : mutation_; + } + + /** + * + * + *
+     * If this is a continuation of a chunked message (`chunked_value_offset` >
+     * 0), ignore all fields except the `SetCell`'s value and merge it with
+     * the previous message by concatenating the value fields.
+     * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getMutationOrBuilder() { + return mutation_ == null ? com.google.bigtable.v2.Mutation.getDefaultInstance() : mutation_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getChunkInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getMutation()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getChunkInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMutation()); + } + size += getUnknownFields().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.ReadChangeStreamResponse.MutationChunk)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk other = + (com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) obj; + + if (hasChunkInfo() != other.hasChunkInfo()) return false; + if (hasChunkInfo()) { + if (!getChunkInfo().equals(other.getChunkInfo())) return false; + } + if (hasMutation() != other.hasMutation()) return false; + if (hasMutation()) { + if (!getMutation().equals(other.getMutation())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasChunkInfo()) { + hash = (37 * hash) + CHUNK_INFO_FIELD_NUMBER; + hash = (53 * hash) + getChunkInfo().hashCode(); + } + if (hasMutation()) { + hash = (37 * hash) + MUTATION_FIELD_NUMBER; + hash = (53 * hash) + getMutation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk 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.ReadChangeStreamResponse.MutationChunk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk 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.ReadChangeStreamResponse.MutationChunk parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse.MutationChunk 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A partial or complete mutation.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.MutationChunk} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.class, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetChunkInfoFieldBuilder(); + internalGetMutationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + chunkInfo_ = null; + if (chunkInfoBuilder_ != null) { + chunkInfoBuilder_.dispose(); + chunkInfoBuilder_ = null; + } + mutation_ = null; + if (mutationBuilder_ != null) { + mutationBuilder_.dispose(); + mutationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk build() { + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk result = + new com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.chunkInfo_ = chunkInfoBuilder_ == null ? chunkInfo_ : chunkInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mutation_ = mutationBuilder_ == null ? mutation_ : mutationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk other) { + if (other + == com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.getDefaultInstance()) + return this; + if (other.hasChunkInfo()) { + mergeChunkInfo(other.getChunkInfo()); + } + if (other.hasMutation()) { + mergeMutation(other.getMutation()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetChunkInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunkInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder> + chunkInfoBuilder_; + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return Whether the chunkInfo field is set. + */ + public boolean hasChunkInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + * + * @return The chunkInfo. + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + getChunkInfo() { + if (chunkInfoBuilder_ == null) { + return chunkInfo_ == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance() + : chunkInfo_; + } else { + return chunkInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public Builder setChunkInfo( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo value) { + if (chunkInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + chunkInfo_ = value; + } else { + chunkInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public Builder setChunkInfo( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder + builderForValue) { + if (chunkInfoBuilder_ == null) { + chunkInfo_ = builderForValue.build(); + } else { + chunkInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public Builder mergeChunkInfo( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo value) { + if (chunkInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && chunkInfo_ != null + && chunkInfo_ + != com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance()) { + getChunkInfoBuilder().mergeFrom(value); + } else { + chunkInfo_ = value; + } + } else { + chunkInfoBuilder_.mergeFrom(value); + } + if (chunkInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public Builder clearChunkInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + chunkInfo_ = null; + if (chunkInfoBuilder_ != null) { + chunkInfoBuilder_.dispose(); + chunkInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder + getChunkInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetChunkInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder + getChunkInfoOrBuilder() { + if (chunkInfoBuilder_ != null) { + return chunkInfoBuilder_.getMessageOrBuilder(); + } else { + return chunkInfo_ == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo + .getDefaultInstance() + : chunkInfo_; + } + } + + /** + * + * + *
+       * If set, then the mutation is a `SetCell` with a chunked value across
+       * multiple messages.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder> + internalGetChunkInfoFieldBuilder() { + if (chunkInfoBuilder_ == null) { + chunkInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder>( + getChunkInfo(), getParentForChildren(), isClean()); + chunkInfo_ = null; + } + return chunkInfoBuilder_; + } + + private com.google.bigtable.v2.Mutation mutation_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + mutationBuilder_; + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return Whether the mutation field is set. + */ + public boolean hasMutation() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + * + * @return The mutation. + */ + public com.google.bigtable.v2.Mutation getMutation() { + if (mutationBuilder_ == null) { + return mutation_ == null + ? com.google.bigtable.v2.Mutation.getDefaultInstance() + : mutation_; + } else { + return mutationBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public Builder setMutation(com.google.bigtable.v2.Mutation value) { + if (mutationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + } else { + mutationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public Builder setMutation(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationBuilder_ == null) { + mutation_ = builderForValue.build(); + } else { + mutationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public Builder mergeMutation(com.google.bigtable.v2.Mutation value) { + if (mutationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && mutation_ != null + && mutation_ != com.google.bigtable.v2.Mutation.getDefaultInstance()) { + getMutationBuilder().mergeFrom(value); + } else { + mutation_ = value; + } + } else { + mutationBuilder_.mergeFrom(value); + } + if (mutation_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public Builder clearMutation() { + bitField0_ = (bitField0_ & ~0x00000002); + mutation_ = null; + if (mutationBuilder_ != null) { + mutationBuilder_.dispose(); + mutationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public com.google.bigtable.v2.Mutation.Builder getMutationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMutationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + public com.google.bigtable.v2.MutationOrBuilder getMutationOrBuilder() { + if (mutationBuilder_ != null) { + return mutationBuilder_.getMessageOrBuilder(); + } else { + return mutation_ == null + ? com.google.bigtable.v2.Mutation.getDefaultInstance() + : mutation_; + } + } + + /** + * + * + *
+       * If this is a continuation of a chunked message (`chunked_value_offset` >
+       * 0), ignore all fields except the `SetCell`'s value and merge it with
+       * the previous message by concatenating the value fields.
+       * 
+ * + * .google.bigtable.v2.Mutation mutation = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetMutationFieldBuilder() { + if (mutationBuilder_ == null) { + mutationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + getMutation(), getParentForChildren(), isClean()); + mutation_ = null; + } + return mutationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + private static final com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutationChunk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse.MutationChunk + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DataChangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of the mutation.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+     * The type of the mutation.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The type. + */ + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type getType(); + + /** + * + * + *
+     * The cluster where the mutation was applied.
+     * Not set when `type` is `GARBAGE_COLLECTION`.
+     * 
+ * + * string source_cluster_id = 2; + * + * @return The sourceClusterId. + */ + java.lang.String getSourceClusterId(); + + /** + * + * + *
+     * The cluster where the mutation was applied.
+     * Not set when `type` is `GARBAGE_COLLECTION`.
+     * 
+ * + * string source_cluster_id = 2; + * + * @return The bytes for sourceClusterId. + */ + com.google.protobuf.ByteString getSourceClusterIdBytes(); + + /** + * + * + *
+     * The row key for all mutations that are part of this `DataChange`.
+     * If the `DataChange` is chunked across multiple messages, then this field
+     * will only be set for the first message.
+     * 
+ * + * bytes row_key = 3; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return Whether the commitTimestamp field is set. + */ + boolean hasCommitTimestamp(); + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return The commitTimestamp. + */ + com.google.protobuf.Timestamp getCommitTimestamp(); + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder(); + + /** + * + * + *
+     * A value that lets stream consumers reconstruct Bigtable's
+     * conflict resolution semantics.
+     * https://cloud.google.com/bigtable/docs/writes#conflict-resolution
+     * In the event that the same row key, column family, column qualifier,
+     * timestamp are modified on different clusters at the same
+     * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
+     * one chosen for the eventually consistent state of the system.
+     * 
+ * + * int32 tiebreaker = 5; + * + * @return The tiebreaker. + */ + int getTiebreaker(); + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + java.util.List getChunksList(); + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk getChunks(int index); + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + int getChunksCount(); + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + java.util.List + getChunksOrBuilderList(); + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder getChunksOrBuilder( + int index); + + /** + * + * + *
+     * When true, indicates that the entire `DataChange` has been read
+     * and the client can safely process the message.
+     * 
+ * + * bool done = 8; + * + * @return The done. + */ + boolean getDone(); + + /** + * + * + *
+     * An encoded position for this stream's partition to restart reading from.
+     * This token is for the StreamPartition from the request.
+     * 
+ * + * string token = 9; + * + * @return The token. + */ + java.lang.String getToken(); + + /** + * + * + *
+     * An encoded position for this stream's partition to restart reading from.
+     * This token is for the StreamPartition from the request.
+     * 
+ * + * string token = 9; + * + * @return The bytes for token. + */ + com.google.protobuf.ByteString getTokenBytes(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return Whether the estimatedLowWatermark field is set. + */ + boolean hasEstimatedLowWatermark(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return The estimatedLowWatermark. + */ + com.google.protobuf.Timestamp getEstimatedLowWatermark(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder(); + } + + /** + * + * + *
+   * A message corresponding to one or more mutations to the partition
+   * being streamed. A single logical `DataChange` message may also be split
+   * across a sequence of multiple individual messages. Messages other than
+   * the first in a sequence will only have the `type` and `chunks` fields
+   * populated, with the final message in the sequence also containing `done`
+   * set to true.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.DataChange} + */ + public static final class DataChange extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + DataChangeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DataChange"); + } + + // Use DataChange.newBuilder() to construct. + private DataChange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DataChange() { + type_ = 0; + sourceClusterId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + chunks_ = java.util.Collections.emptyList(); + token_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.class, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder.class); + } + + /** + * + * + *
+     * The type of mutation.
+     * 
+ * + * Protobuf enum {@code google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The type is unspecified.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * A user-initiated mutation.
+       * 
+ * + * USER = 1; + */ + USER(1), + /** + * + * + *
+       * A system-initiated mutation as part of garbage collection.
+       * https://cloud.google.com/bigtable/docs/garbage-collection
+       * 
+ * + * GARBAGE_COLLECTION = 2; + */ + GARBAGE_COLLECTION(2), + /** + * + * + *
+       * This is a continuation of a multi-message change.
+       * 
+ * + * CONTINUATION = 3; + */ + CONTINUATION(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + /** + * + * + *
+       * The type is unspecified.
+       * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * A user-initiated mutation.
+       * 
+ * + * USER = 1; + */ + public static final int USER_VALUE = 1; + + /** + * + * + *
+       * A system-initiated mutation as part of garbage collection.
+       * https://cloud.google.com/bigtable/docs/garbage-collection
+       * 
+ * + * GARBAGE_COLLECTION = 2; + */ + public static final int GARBAGE_COLLECTION_VALUE = 2; + + /** + * + * + *
+       * This is a continuation of a multi-message change.
+       * 
+ * + * CONTINUATION = 3; + */ + public static final int CONTINUATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return USER; + case 2: + return GARBAGE_COLLECTION; + case 3: + return CONTINUATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+     * The type of the mutation.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * The type of the mutation.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type getType() { + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type result = + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.forNumber(type_); + return result == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.UNRECOGNIZED + : result; + } + + public static final int SOURCE_CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceClusterId_ = ""; + + /** + * + * + *
+     * The cluster where the mutation was applied.
+     * Not set when `type` is `GARBAGE_COLLECTION`.
+     * 
+ * + * string source_cluster_id = 2; + * + * @return The sourceClusterId. + */ + @java.lang.Override + public java.lang.String getSourceClusterId() { + java.lang.Object ref = sourceClusterId_; + 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(); + sourceClusterId_ = s; + return s; + } + } + + /** + * + * + *
+     * The cluster where the mutation was applied.
+     * Not set when `type` is `GARBAGE_COLLECTION`.
+     * 
+ * + * string source_cluster_id = 2; + * + * @return The bytes for sourceClusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceClusterIdBytes() { + java.lang.Object ref = sourceClusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ROW_KEY_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The row key for all mutations that are part of this `DataChange`.
+     * If the `DataChange` is chunked across multiple messages, then this field
+     * will only be set for the first message.
+     * 
+ * + * bytes row_key = 3; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int COMMIT_TIMESTAMP_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp commitTimestamp_; + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return Whether the commitTimestamp field is set. + */ + @java.lang.Override + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return The commitTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCommitTimestamp() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + /** + * + * + *
+     * The timestamp at which the mutation was applied on the Bigtable server.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + public static final int TIEBREAKER_FIELD_NUMBER = 5; + private int tiebreaker_ = 0; + + /** + * + * + *
+     * A value that lets stream consumers reconstruct Bigtable's
+     * conflict resolution semantics.
+     * https://cloud.google.com/bigtable/docs/writes#conflict-resolution
+     * In the event that the same row key, column family, column qualifier,
+     * timestamp are modified on different clusters at the same
+     * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
+     * one chosen for the eventually consistent state of the system.
+     * 
+ * + * int32 tiebreaker = 5; + * + * @return The tiebreaker. + */ + @java.lang.Override + public int getTiebreaker() { + return tiebreaker_; + } + + public static final int CHUNKS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List chunks_; + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + @java.lang.Override + public java.util.List + getChunksList() { + return chunks_; + } + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder> + getChunksOrBuilderList() { + return chunks_; + } + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + @java.lang.Override + public int getChunksCount() { + return chunks_.size(); + } + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk getChunks(int index) { + return chunks_.get(index); + } + + /** + * + * + *
+     * The mutations associated with this change to the partition.
+     * May contain complete mutations or chunks of a multi-message chunked
+     * `DataChange` record.
+     * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder + getChunksOrBuilder(int index) { + return chunks_.get(index); + } + + public static final int DONE_FIELD_NUMBER = 8; + private boolean done_ = false; + + /** + * + * + *
+     * When true, indicates that the entire `DataChange` has been read
+     * and the client can safely process the message.
+     * 
+ * + * bool done = 8; + * + * @return The done. + */ + @java.lang.Override + public boolean getDone() { + return done_; + } + + public static final int TOKEN_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + + /** + * + * + *
+     * An encoded position for this stream's partition to restart reading from.
+     * This token is for the StreamPartition from the request.
+     * 
+ * + * string token = 9; + * + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + 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(); + token_ = s; + return s; + } + } + + /** + * + * + *
+     * An encoded position for this stream's partition to restart reading from.
+     * This token is for the StreamPartition from the request.
+     * 
+ * + * string token = 9; + * + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ESTIMATED_LOW_WATERMARK_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp estimatedLowWatermark_; + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return Whether the estimatedLowWatermark field is set. + */ + @java.lang.Override + public boolean hasEstimatedLowWatermark() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return The estimatedLowWatermark. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEstimatedLowWatermark() { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder() { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + + 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 (type_ + != com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceClusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sourceClusterId_); + } + if (!rowKey_.isEmpty()) { + output.writeBytes(3, rowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCommitTimestamp()); + } + if (tiebreaker_ != 0) { + output.writeInt32(5, tiebreaker_); + } + for (int i = 0; i < chunks_.size(); i++) { + output.writeMessage(6, chunks_.get(i)); + } + if (done_ != false) { + output.writeBool(8, done_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, token_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getEstimatedLowWatermark()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceClusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sourceClusterId_); + } + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, rowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCommitTimestamp()); + } + if (tiebreaker_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, tiebreaker_); + } + for (int i = 0; i < chunks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, chunks_.get(i)); + } + if (done_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, done_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, token_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getEstimatedLowWatermark()); + } + size += getUnknownFields().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.ReadChangeStreamResponse.DataChange)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange other = + (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) obj; + + if (type_ != other.type_) return false; + if (!getSourceClusterId().equals(other.getSourceClusterId())) return false; + if (!getRowKey().equals(other.getRowKey())) return false; + if (hasCommitTimestamp() != other.hasCommitTimestamp()) return false; + if (hasCommitTimestamp()) { + if (!getCommitTimestamp().equals(other.getCommitTimestamp())) return false; + } + if (getTiebreaker() != other.getTiebreaker()) return false; + if (!getChunksList().equals(other.getChunksList())) return false; + if (getDone() != other.getDone()) return false; + if (!getToken().equals(other.getToken())) return false; + if (hasEstimatedLowWatermark() != other.hasEstimatedLowWatermark()) return false; + if (hasEstimatedLowWatermark()) { + if (!getEstimatedLowWatermark().equals(other.getEstimatedLowWatermark())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + SOURCE_CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getSourceClusterId().hashCode(); + hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (hasCommitTimestamp()) { + hash = (37 * hash) + COMMIT_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCommitTimestamp().hashCode(); + } + hash = (37 * hash) + TIEBREAKER_FIELD_NUMBER; + hash = (53 * hash) + getTiebreaker(); + if (getChunksCount() > 0) { + hash = (37 * hash) + CHUNKS_FIELD_NUMBER; + hash = (53 * hash) + getChunksList().hashCode(); + } + hash = (37 * hash) + DONE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDone()); + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + if (hasEstimatedLowWatermark()) { + hash = (37 * hash) + ESTIMATED_LOW_WATERMARK_FIELD_NUMBER; + hash = (53 * hash) + getEstimatedLowWatermark().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange 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.ReadChangeStreamResponse.DataChange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange 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.ReadChangeStreamResponse.DataChange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse.DataChange 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A message corresponding to one or more mutations to the partition
+     * being streamed. A single logical `DataChange` message may also be split
+     * across a sequence of multiple individual messages. Messages other than
+     * the first in a sequence will only have the `type` and `chunks` fields
+     * populated, with the final message in the sequence also containing `done`
+     * set to true.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.DataChange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.class, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommitTimestampFieldBuilder(); + internalGetChunksFieldBuilder(); + internalGetEstimatedLowWatermarkFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + sourceClusterId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + tiebreaker_ = 0; + if (chunksBuilder_ == null) { + chunks_ = java.util.Collections.emptyList(); + } else { + chunks_ = null; + chunksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + done_ = false; + token_ = ""; + estimatedLowWatermark_ = null; + if (estimatedLowWatermarkBuilder_ != null) { + estimatedLowWatermarkBuilder_.dispose(); + estimatedLowWatermarkBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange + getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange build() { + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange result = + new com.google.bigtable.v2.ReadChangeStreamResponse.DataChange(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange result) { + if (chunksBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + chunks_ = java.util.Collections.unmodifiableList(chunks_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.chunks_ = chunks_; + } else { + result.chunks_ = chunksBuilder_.build(); + } + } + + private void buildPartial0( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceClusterId_ = sourceClusterId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rowKey_ = rowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.commitTimestamp_ = + commitTimestampBuilder_ == null ? commitTimestamp_ : commitTimestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tiebreaker_ = tiebreaker_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.done_ = done_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.token_ = token_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.estimatedLowWatermark_ = + estimatedLowWatermarkBuilder_ == null + ? estimatedLowWatermark_ + : estimatedLowWatermarkBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadChangeStreamResponse.DataChange other) { + if (other + == com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance()) + return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getSourceClusterId().isEmpty()) { + sourceClusterId_ = other.sourceClusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (other.hasCommitTimestamp()) { + mergeCommitTimestamp(other.getCommitTimestamp()); + } + if (other.getTiebreaker() != 0) { + setTiebreaker(other.getTiebreaker()); + } + if (chunksBuilder_ == null) { + if (!other.chunks_.isEmpty()) { + if (chunks_.isEmpty()) { + chunks_ = other.chunks_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureChunksIsMutable(); + chunks_.addAll(other.chunks_); + } + onChanged(); + } + } else { + if (!other.chunks_.isEmpty()) { + if (chunksBuilder_.isEmpty()) { + chunksBuilder_.dispose(); + chunksBuilder_ = null; + chunks_ = other.chunks_; + bitField0_ = (bitField0_ & ~0x00000020); + chunksBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetChunksFieldBuilder() + : null; + } else { + chunksBuilder_.addAllMessages(other.chunks_); + } + } + } + if (other.getDone() != false) { + setDone(other.getDone()); + } + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasEstimatedLowWatermark()) { + mergeEstimatedLowWatermark(other.getEstimatedLowWatermark()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + sourceClusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetCommitTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + tiebreaker_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk m = + input.readMessage( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.parser(), + extensionRegistry); + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(m); + } else { + chunksBuilder_.addMessage(m); + } + break; + } // case 50 + case 64: + { + done_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetEstimatedLowWatermarkFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + + /** + * + * + *
+       * The type of the mutation.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+       * The type of the mutation.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the mutation.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type getType() { + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type result = + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.forNumber(type_); + return result == null + ? com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The type of the mutation.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the mutation.
+       * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object sourceClusterId_ = ""; + + /** + * + * + *
+       * The cluster where the mutation was applied.
+       * Not set when `type` is `GARBAGE_COLLECTION`.
+       * 
+ * + * string source_cluster_id = 2; + * + * @return The sourceClusterId. + */ + public java.lang.String getSourceClusterId() { + java.lang.Object ref = sourceClusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceClusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The cluster where the mutation was applied.
+       * Not set when `type` is `GARBAGE_COLLECTION`.
+       * 
+ * + * string source_cluster_id = 2; + * + * @return The bytes for sourceClusterId. + */ + public com.google.protobuf.ByteString getSourceClusterIdBytes() { + java.lang.Object ref = sourceClusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The cluster where the mutation was applied.
+       * Not set when `type` is `GARBAGE_COLLECTION`.
+       * 
+ * + * string source_cluster_id = 2; + * + * @param value The sourceClusterId to set. + * @return This builder for chaining. + */ + public Builder setSourceClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceClusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The cluster where the mutation was applied.
+       * Not set when `type` is `GARBAGE_COLLECTION`.
+       * 
+ * + * string source_cluster_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceClusterId() { + sourceClusterId_ = getDefaultInstance().getSourceClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The cluster where the mutation was applied.
+       * Not set when `type` is `GARBAGE_COLLECTION`.
+       * 
+ * + * string source_cluster_id = 2; + * + * @param value The bytes for sourceClusterId to set. + * @return This builder for chaining. + */ + public Builder setSourceClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceClusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The row key for all mutations that are part of this `DataChange`.
+       * If the `DataChange` is chunked across multiple messages, then this field
+       * will only be set for the first message.
+       * 
+ * + * bytes row_key = 3; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+       * The row key for all mutations that are part of this `DataChange`.
+       * If the `DataChange` is chunked across multiple messages, then this field
+       * will only be set for the first message.
+       * 
+ * + * bytes row_key = 3; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The row key for all mutations that are part of this `DataChange`.
+       * If the `DataChange` is chunked across multiple messages, then this field
+       * will only be set for the first message.
+       * 
+ * + * bytes row_key = 3; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000004); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp commitTimestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitTimestampBuilder_; + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return Whether the commitTimestamp field is set. + */ + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + * + * @return The commitTimestamp. + */ + public com.google.protobuf.Timestamp getCommitTimestamp() { + if (commitTimestampBuilder_ == null) { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } else { + return commitTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitTimestamp_ = value; + } else { + commitTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitTimestampBuilder_ == null) { + commitTimestamp_ = builderForValue.build(); + } else { + commitTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public Builder mergeCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && commitTimestamp_ != null + && commitTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCommitTimestampBuilder().mergeFrom(value); + } else { + commitTimestamp_ = value; + } + } else { + commitTimestampBuilder_.mergeFrom(value); + } + if (commitTimestamp_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public Builder clearCommitTimestamp() { + bitField0_ = (bitField0_ & ~0x00000008); + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public com.google.protobuf.Timestamp.Builder getCommitTimestampBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCommitTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + if (commitTimestampBuilder_ != null) { + return commitTimestampBuilder_.getMessageOrBuilder(); + } else { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + } + + /** + * + * + *
+       * The timestamp at which the mutation was applied on the Bigtable server.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCommitTimestampFieldBuilder() { + if (commitTimestampBuilder_ == null) { + commitTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitTimestamp(), getParentForChildren(), isClean()); + commitTimestamp_ = null; + } + return commitTimestampBuilder_; + } + + private int tiebreaker_; + + /** + * + * + *
+       * A value that lets stream consumers reconstruct Bigtable's
+       * conflict resolution semantics.
+       * https://cloud.google.com/bigtable/docs/writes#conflict-resolution
+       * In the event that the same row key, column family, column qualifier,
+       * timestamp are modified on different clusters at the same
+       * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
+       * one chosen for the eventually consistent state of the system.
+       * 
+ * + * int32 tiebreaker = 5; + * + * @return The tiebreaker. + */ + @java.lang.Override + public int getTiebreaker() { + return tiebreaker_; + } + + /** + * + * + *
+       * A value that lets stream consumers reconstruct Bigtable's
+       * conflict resolution semantics.
+       * https://cloud.google.com/bigtable/docs/writes#conflict-resolution
+       * In the event that the same row key, column family, column qualifier,
+       * timestamp are modified on different clusters at the same
+       * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
+       * one chosen for the eventually consistent state of the system.
+       * 
+ * + * int32 tiebreaker = 5; + * + * @param value The tiebreaker to set. + * @return This builder for chaining. + */ + public Builder setTiebreaker(int value) { + + tiebreaker_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * A value that lets stream consumers reconstruct Bigtable's
+       * conflict resolution semantics.
+       * https://cloud.google.com/bigtable/docs/writes#conflict-resolution
+       * In the event that the same row key, column family, column qualifier,
+       * timestamp are modified on different clusters at the same
+       * `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
+       * one chosen for the eventually consistent state of the system.
+       * 
+ * + * int32 tiebreaker = 5; + * + * @return This builder for chaining. + */ + public Builder clearTiebreaker() { + bitField0_ = (bitField0_ & ~0x00000010); + tiebreaker_ = 0; + onChanged(); + return this; + } + + private java.util.List + chunks_ = java.util.Collections.emptyList(); + + private void ensureChunksIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + chunks_ = + new java.util.ArrayList< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk>(chunks_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder> + chunksBuilder_; + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public java.util.List + getChunksList() { + if (chunksBuilder_ == null) { + return java.util.Collections.unmodifiableList(chunks_); + } else { + return chunksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public int getChunksCount() { + if (chunksBuilder_ == null) { + return chunks_.size(); + } else { + return chunksBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk getChunks(int index) { + if (chunksBuilder_ == null) { + return chunks_.get(index); + } else { + return chunksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder setChunks( + int index, com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.set(index, value); + onChanged(); + } else { + chunksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder setChunks( + int index, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.set(index, builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder addChunks( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.add(value); + onChanged(); + } else { + chunksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder addChunks( + int index, com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.add(index, value); + onChanged(); + } else { + chunksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder addChunks( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder addChunks( + int index, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(index, builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder addAllChunks( + java.lang.Iterable< + ? extends com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk> + values) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, chunks_); + onChanged(); + } else { + chunksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder clearChunks() { + if (chunksBuilder_ == null) { + chunks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + chunksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public Builder removeChunks(int index) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.remove(index); + onChanged(); + } else { + chunksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder getChunksBuilder( + int index) { + return internalGetChunksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder + getChunksOrBuilder(int index) { + if (chunksBuilder_ == null) { + return chunks_.get(index); + } else { + return chunksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public java.util.List< + ? extends com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder> + getChunksOrBuilderList() { + if (chunksBuilder_ != null) { + return chunksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(chunks_); + } + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder + addChunksBuilder() { + return internalGetChunksFieldBuilder() + .addBuilder( + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.getDefaultInstance()); + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder addChunksBuilder( + int index) { + return internalGetChunksFieldBuilder() + .addBuilder( + index, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.getDefaultInstance()); + } + + /** + * + * + *
+       * The mutations associated with this change to the partition.
+       * May contain complete mutations or chunks of a multi-message chunked
+       * `DataChange` record.
+       * 
+ * + * repeated .google.bigtable.v2.ReadChangeStreamResponse.MutationChunk chunks = 6; + * + */ + public java.util.List + getChunksBuilderList() { + return internalGetChunksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder> + internalGetChunksFieldBuilder() { + if (chunksBuilder_ == null) { + chunksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder>( + chunks_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + chunks_ = null; + } + return chunksBuilder_; + } + + private boolean done_; + + /** + * + * + *
+       * When true, indicates that the entire `DataChange` has been read
+       * and the client can safely process the message.
+       * 
+ * + * bool done = 8; + * + * @return The done. + */ + @java.lang.Override + public boolean getDone() { + return done_; + } + + /** + * + * + *
+       * When true, indicates that the entire `DataChange` has been read
+       * and the client can safely process the message.
+       * 
+ * + * bool done = 8; + * + * @param value The done to set. + * @return This builder for chaining. + */ + public Builder setDone(boolean value) { + + done_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * When true, indicates that the entire `DataChange` has been read
+       * and the client can safely process the message.
+       * 
+ * + * bool done = 8; + * + * @return This builder for chaining. + */ + public Builder clearDone() { + bitField0_ = (bitField0_ & ~0x00000040); + done_ = false; + onChanged(); + return this; + } + + private java.lang.Object token_ = ""; + + /** + * + * + *
+       * An encoded position for this stream's partition to restart reading from.
+       * This token is for the StreamPartition from the request.
+       * 
+ * + * string token = 9; + * + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * An encoded position for this stream's partition to restart reading from.
+       * This token is for the StreamPartition from the request.
+       * 
+ * + * string token = 9; + * + * @return The bytes for token. + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * An encoded position for this stream's partition to restart reading from.
+       * This token is for the StreamPartition from the request.
+       * 
+ * + * string token = 9; + * + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + token_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * An encoded position for this stream's partition to restart reading from.
+       * This token is for the StreamPartition from the request.
+       * 
+ * + * string token = 9; + * + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+       * An encoded position for this stream's partition to restart reading from.
+       * This token is for the StreamPartition from the request.
+       * 
+ * + * string token = 9; + * + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp estimatedLowWatermark_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + estimatedLowWatermarkBuilder_; + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return Whether the estimatedLowWatermark field is set. + */ + public boolean hasEstimatedLowWatermark() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + * + * @return The estimatedLowWatermark. + */ + public com.google.protobuf.Timestamp getEstimatedLowWatermark() { + if (estimatedLowWatermarkBuilder_ == null) { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } else { + return estimatedLowWatermarkBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public Builder setEstimatedLowWatermark(com.google.protobuf.Timestamp value) { + if (estimatedLowWatermarkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + estimatedLowWatermark_ = value; + } else { + estimatedLowWatermarkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public Builder setEstimatedLowWatermark( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermark_ = builderForValue.build(); + } else { + estimatedLowWatermarkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public Builder mergeEstimatedLowWatermark(com.google.protobuf.Timestamp value) { + if (estimatedLowWatermarkBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && estimatedLowWatermark_ != null + && estimatedLowWatermark_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEstimatedLowWatermarkBuilder().mergeFrom(value); + } else { + estimatedLowWatermark_ = value; + } + } else { + estimatedLowWatermarkBuilder_.mergeFrom(value); + } + if (estimatedLowWatermark_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public Builder clearEstimatedLowWatermark() { + bitField0_ = (bitField0_ & ~0x00000100); + estimatedLowWatermark_ = null; + if (estimatedLowWatermarkBuilder_ != null) { + estimatedLowWatermarkBuilder_.dispose(); + estimatedLowWatermarkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public com.google.protobuf.Timestamp.Builder getEstimatedLowWatermarkBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetEstimatedLowWatermarkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + public com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder() { + if (estimatedLowWatermarkBuilder_ != null) { + return estimatedLowWatermarkBuilder_.getMessageOrBuilder(); + } else { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEstimatedLowWatermarkFieldBuilder() { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermarkBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEstimatedLowWatermark(), getParentForChildren(), isClean()); + estimatedLowWatermark_ = null; + } + return estimatedLowWatermarkBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + private static final com.google.bigtable.v2.ReadChangeStreamResponse.DataChange + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamResponse.DataChange(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.DataChange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse.DataChange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HeartbeatOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return Whether the continuationToken field is set. + */ + boolean hasContinuationToken(); + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return The continuationToken. + */ + com.google.bigtable.v2.StreamContinuationToken getContinuationToken(); + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + com.google.bigtable.v2.StreamContinuationTokenOrBuilder getContinuationTokenOrBuilder(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return Whether the estimatedLowWatermark field is set. + */ + boolean hasEstimatedLowWatermark(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return The estimatedLowWatermark. + */ + com.google.protobuf.Timestamp getEstimatedLowWatermark(); + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder(); + } + + /** + * + * + *
+   * A periodic message with information that can be used to checkpoint
+   * the state of a stream.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} + */ + public static final class Heartbeat extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + HeartbeatOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Heartbeat"); + } + + // Use Heartbeat.newBuilder() to construct. + private Heartbeat(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Heartbeat() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.class, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder.class); + } + + private int bitField0_; + public static final int CONTINUATION_TOKEN_FIELD_NUMBER = 1; + private com.google.bigtable.v2.StreamContinuationToken continuationToken_; + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return Whether the continuationToken field is set. + */ + @java.lang.Override + public boolean hasContinuationToken() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return The continuationToken. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken getContinuationToken() { + return continuationToken_ == null + ? com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance() + : continuationToken_; + } + + /** + * + * + *
+     * A token that can be provided to a subsequent `ReadChangeStream` call
+     * to pick up reading at the current stream position.
+     * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder getContinuationTokenOrBuilder() { + return continuationToken_ == null + ? com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance() + : continuationToken_; + } + + public static final int ESTIMATED_LOW_WATERMARK_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp estimatedLowWatermark_; + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return Whether the estimatedLowWatermark field is set. + */ + @java.lang.Override + public boolean hasEstimatedLowWatermark() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return The estimatedLowWatermark. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEstimatedLowWatermark() { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + + /** + * + * + *
+     * An estimate of the commit timestamp that is usually lower than or equal
+     * to any timestamp for a record that will be delivered in the future on the
+     * stream. It is possible that, under particular circumstances that a future
+     * record has a timestamp that is lower than a previously seen timestamp.
+     * For an example usage see
+     * https://beam.apache.org/documentation/basics/#watermarks
+     * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder() { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getContinuationToken()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEstimatedLowWatermark()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getContinuationToken()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEstimatedLowWatermark()); + } + size += getUnknownFields().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.ReadChangeStreamResponse.Heartbeat)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat other = + (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) obj; + + if (hasContinuationToken() != other.hasContinuationToken()) return false; + if (hasContinuationToken()) { + if (!getContinuationToken().equals(other.getContinuationToken())) return false; + } + if (hasEstimatedLowWatermark() != other.hasEstimatedLowWatermark()) return false; + if (hasEstimatedLowWatermark()) { + if (!getEstimatedLowWatermark().equals(other.getEstimatedLowWatermark())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContinuationToken()) { + hash = (37 * hash) + CONTINUATION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getContinuationToken().hashCode(); + } + if (hasEstimatedLowWatermark()) { + hash = (37 * hash) + ESTIMATED_LOW_WATERMARK_FIELD_NUMBER; + hash = (53 * hash) + getEstimatedLowWatermark().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat 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.ReadChangeStreamResponse.Heartbeat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat 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.ReadChangeStreamResponse.Heartbeat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse.Heartbeat 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A periodic message with information that can be used to checkpoint
+     * the state of a stream.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.Heartbeat} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.class, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetContinuationTokenFieldBuilder(); + internalGetEstimatedLowWatermarkFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + continuationToken_ = null; + if (continuationTokenBuilder_ != null) { + continuationTokenBuilder_.dispose(); + continuationTokenBuilder_ = null; + } + estimatedLowWatermark_ = null; + if (estimatedLowWatermarkBuilder_ != null) { + estimatedLowWatermarkBuilder_.dispose(); + estimatedLowWatermarkBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat build() { + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat result = + new com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.continuationToken_ = + continuationTokenBuilder_ == null + ? continuationToken_ + : continuationTokenBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.estimatedLowWatermark_ = + estimatedLowWatermarkBuilder_ == null + ? estimatedLowWatermark_ + : estimatedLowWatermarkBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat other) { + if (other == com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance()) + return this; + if (other.hasContinuationToken()) { + mergeContinuationToken(other.getContinuationToken()); + } + if (other.hasEstimatedLowWatermark()) { + mergeEstimatedLowWatermark(other.getEstimatedLowWatermark()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetContinuationTokenFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetEstimatedLowWatermarkFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.StreamContinuationToken continuationToken_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + continuationTokenBuilder_; + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return Whether the continuationToken field is set. + */ + public boolean hasContinuationToken() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + * + * @return The continuationToken. + */ + public com.google.bigtable.v2.StreamContinuationToken getContinuationToken() { + if (continuationTokenBuilder_ == null) { + return continuationToken_ == null + ? com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance() + : continuationToken_; + } else { + return continuationTokenBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public Builder setContinuationToken(com.google.bigtable.v2.StreamContinuationToken value) { + if (continuationTokenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + continuationToken_ = value; + } else { + continuationTokenBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public Builder setContinuationToken( + com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (continuationTokenBuilder_ == null) { + continuationToken_ = builderForValue.build(); + } else { + continuationTokenBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public Builder mergeContinuationToken(com.google.bigtable.v2.StreamContinuationToken value) { + if (continuationTokenBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && continuationToken_ != null + && continuationToken_ + != com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()) { + getContinuationTokenBuilder().mergeFrom(value); + } else { + continuationToken_ = value; + } + } else { + continuationTokenBuilder_.mergeFrom(value); + } + if (continuationToken_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public Builder clearContinuationToken() { + bitField0_ = (bitField0_ & ~0x00000001); + continuationToken_ = null; + if (continuationTokenBuilder_ != null) { + continuationTokenBuilder_.dispose(); + continuationTokenBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder getContinuationTokenBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetContinuationTokenFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder + getContinuationTokenOrBuilder() { + if (continuationTokenBuilder_ != null) { + return continuationTokenBuilder_.getMessageOrBuilder(); + } else { + return continuationToken_ == null + ? com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance() + : continuationToken_; + } + } + + /** + * + * + *
+       * A token that can be provided to a subsequent `ReadChangeStream` call
+       * to pick up reading at the current stream position.
+       * 
+ * + * .google.bigtable.v2.StreamContinuationToken continuation_token = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + internalGetContinuationTokenFieldBuilder() { + if (continuationTokenBuilder_ == null) { + continuationTokenBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder>( + getContinuationToken(), getParentForChildren(), isClean()); + continuationToken_ = null; + } + return continuationTokenBuilder_; + } + + private com.google.protobuf.Timestamp estimatedLowWatermark_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + estimatedLowWatermarkBuilder_; + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return Whether the estimatedLowWatermark field is set. + */ + public boolean hasEstimatedLowWatermark() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + * + * @return The estimatedLowWatermark. + */ + public com.google.protobuf.Timestamp getEstimatedLowWatermark() { + if (estimatedLowWatermarkBuilder_ == null) { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } else { + return estimatedLowWatermarkBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public Builder setEstimatedLowWatermark(com.google.protobuf.Timestamp value) { + if (estimatedLowWatermarkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + estimatedLowWatermark_ = value; + } else { + estimatedLowWatermarkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public Builder setEstimatedLowWatermark( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermark_ = builderForValue.build(); + } else { + estimatedLowWatermarkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public Builder mergeEstimatedLowWatermark(com.google.protobuf.Timestamp value) { + if (estimatedLowWatermarkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && estimatedLowWatermark_ != null + && estimatedLowWatermark_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEstimatedLowWatermarkBuilder().mergeFrom(value); + } else { + estimatedLowWatermark_ = value; + } + } else { + estimatedLowWatermarkBuilder_.mergeFrom(value); + } + if (estimatedLowWatermark_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public Builder clearEstimatedLowWatermark() { + bitField0_ = (bitField0_ & ~0x00000002); + estimatedLowWatermark_ = null; + if (estimatedLowWatermarkBuilder_ != null) { + estimatedLowWatermarkBuilder_.dispose(); + estimatedLowWatermarkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public com.google.protobuf.Timestamp.Builder getEstimatedLowWatermarkBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEstimatedLowWatermarkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEstimatedLowWatermarkOrBuilder() { + if (estimatedLowWatermarkBuilder_ != null) { + return estimatedLowWatermarkBuilder_.getMessageOrBuilder(); + } else { + return estimatedLowWatermark_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : estimatedLowWatermark_; + } + } + + /** + * + * + *
+       * An estimate of the commit timestamp that is usually lower than or equal
+       * to any timestamp for a record that will be delivered in the future on the
+       * stream. It is possible that, under particular circumstances that a future
+       * record has a timestamp that is lower than a previously seen timestamp.
+       * For an example usage see
+       * https://beam.apache.org/documentation/basics/#watermarks
+       * 
+ * + * .google.protobuf.Timestamp estimated_low_watermark = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEstimatedLowWatermarkFieldBuilder() { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermarkBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEstimatedLowWatermark(), getParentForChildren(), isClean()); + estimatedLowWatermark_ = null; + } + return estimatedLowWatermarkBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + private static final com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Heartbeat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse.Heartbeat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloseStreamOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + java.util.List getContinuationTokensList(); + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + com.google.bigtable.v2.StreamContinuationToken getContinuationTokens(int index); + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + int getContinuationTokensCount(); + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + java.util.List + getContinuationTokensOrBuilderList(); + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + com.google.bigtable.v2.StreamContinuationTokenOrBuilder getContinuationTokensOrBuilder( + int index); + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + java.util.List getNewPartitionsList(); + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + com.google.bigtable.v2.StreamPartition getNewPartitions(int index); + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + int getNewPartitionsCount(); + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + java.util.List + getNewPartitionsOrBuilderList(); + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + com.google.bigtable.v2.StreamPartitionOrBuilder getNewPartitionsOrBuilder(int index); + } + + /** + * + * + *
+   * A message indicating that the client should stop reading from the stream.
+   * If status is OK and `continuation_tokens` & `new_partitions` are empty, the
+   * stream has finished (for example if there was an `end_time` specified).
+   * If `continuation_tokens` & `new_partitions` are present, then a change in
+   * partitioning requires the client to open a new stream for each token to
+   * resume reading. Example:
+   *
+   * [B,      D) ends
+   * |
+   * v
+   * new_partitions:  [A,  C) [C,  E)
+   * continuation_tokens.partitions:  [B,C) [C,D)
+   * ^---^ ^---^
+   * ^     ^
+   * |     |
+   * |     StreamContinuationToken 2
+   * |
+   * StreamContinuationToken 1
+   *
+   * To read the new partition [A,C), supply the continuation tokens whose
+   * ranges cover the new partition, for example ContinuationToken[A,B) &
+   * ContinuationToken[B,C).
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.CloseStream} + */ + public static final class CloseStream extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + CloseStreamOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloseStream"); + } + + // Use CloseStream.newBuilder() to construct. + private CloseStream(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloseStream() { + continuationTokens_ = java.util.Collections.emptyList(); + newPartitions_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.class, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+     * The status of the stream.
+     * 
+ * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int CONTINUATION_TOKENS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List continuationTokens_; + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + @java.lang.Override + public java.util.List + getContinuationTokensList() { + return continuationTokens_; + } + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + @java.lang.Override + public java.util.List + getContinuationTokensOrBuilderList() { + return continuationTokens_; + } + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + @java.lang.Override + public int getContinuationTokensCount() { + return continuationTokens_.size(); + } + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken getContinuationTokens(int index) { + return continuationTokens_.get(index); + } + + /** + * + * + *
+     * If non-empty, contains the information needed to resume reading their
+     * associated partitions.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder getContinuationTokensOrBuilder( + int index) { + return continuationTokens_.get(index); + } + + public static final int NEW_PARTITIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List newPartitions_; + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + @java.lang.Override + public java.util.List getNewPartitionsList() { + return newPartitions_; + } + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + @java.lang.Override + public java.util.List + getNewPartitionsOrBuilderList() { + return newPartitions_; + } + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + @java.lang.Override + public int getNewPartitionsCount() { + return newPartitions_.size(); + } + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartition getNewPartitions(int index) { + return newPartitions_.get(index); + } + + /** + * + * + *
+     * If non-empty, contains the new partitions to start reading from, which
+     * are related to but not necessarily identical to the partitions for the
+     * above `continuation_tokens`.
+     * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartitionOrBuilder getNewPartitionsOrBuilder(int index) { + return newPartitions_.get(index); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStatus()); + } + for (int i = 0; i < continuationTokens_.size(); i++) { + output.writeMessage(2, continuationTokens_.get(i)); + } + for (int i = 0; i < newPartitions_.size(); i++) { + output.writeMessage(3, newPartitions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStatus()); + } + for (int i = 0; i < continuationTokens_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, continuationTokens_.get(i)); + } + for (int i = 0; i < newPartitions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, newPartitions_.get(i)); + } + size += getUnknownFields().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.ReadChangeStreamResponse.CloseStream)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream other = + (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!getContinuationTokensList().equals(other.getContinuationTokensList())) return false; + if (!getNewPartitionsList().equals(other.getNewPartitionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (getContinuationTokensCount() > 0) { + hash = (37 * hash) + CONTINUATION_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getContinuationTokensList().hashCode(); + } + if (getNewPartitionsCount() > 0) { + hash = (37 * hash) + NEW_PARTITIONS_FIELD_NUMBER; + hash = (53 * hash) + getNewPartitionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream 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.ReadChangeStreamResponse.CloseStream parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream 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.ReadChangeStreamResponse.CloseStream parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse.CloseStream 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A message indicating that the client should stop reading from the stream.
+     * If status is OK and `continuation_tokens` & `new_partitions` are empty, the
+     * stream has finished (for example if there was an `end_time` specified).
+     * If `continuation_tokens` & `new_partitions` are present, then a change in
+     * partitioning requires the client to open a new stream for each token to
+     * resume reading. Example:
+     *
+     * [B,      D) ends
+     * |
+     * v
+     * new_partitions:  [A,  C) [C,  E)
+     * continuation_tokens.partitions:  [B,C) [C,D)
+     * ^---^ ^---^
+     * ^     ^
+     * |     |
+     * |     StreamContinuationToken 2
+     * |
+     * StreamContinuationToken 1
+     *
+     * To read the new partition [A,C), supply the continuation tokens whose
+     * ranges cover the new partition, for example ContinuationToken[A,B) &
+     * ContinuationToken[B,C).
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse.CloseStream} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.class, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + internalGetContinuationTokensFieldBuilder(); + internalGetNewPartitionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + if (continuationTokensBuilder_ == null) { + continuationTokens_ = java.util.Collections.emptyList(); + } else { + continuationTokens_ = null; + continuationTokensBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (newPartitionsBuilder_ == null) { + newPartitions_ = java.util.Collections.emptyList(); + } else { + newPartitions_ = null; + newPartitionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream + getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream build() { + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream result = + new com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream result) { + if (continuationTokensBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + continuationTokens_ = java.util.Collections.unmodifiableList(continuationTokens_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.continuationTokens_ = continuationTokens_; + } else { + result.continuationTokens_ = continuationTokensBuilder_.build(); + } + if (newPartitionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + newPartitions_ = java.util.Collections.unmodifiableList(newPartitions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.newPartitions_ = newPartitions_; + } else { + result.newPartitions_ = newPartitionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream other) { + if (other + == com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (continuationTokensBuilder_ == null) { + if (!other.continuationTokens_.isEmpty()) { + if (continuationTokens_.isEmpty()) { + continuationTokens_ = other.continuationTokens_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureContinuationTokensIsMutable(); + continuationTokens_.addAll(other.continuationTokens_); + } + onChanged(); + } + } else { + if (!other.continuationTokens_.isEmpty()) { + if (continuationTokensBuilder_.isEmpty()) { + continuationTokensBuilder_.dispose(); + continuationTokensBuilder_ = null; + continuationTokens_ = other.continuationTokens_; + bitField0_ = (bitField0_ & ~0x00000002); + continuationTokensBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetContinuationTokensFieldBuilder() + : null; + } else { + continuationTokensBuilder_.addAllMessages(other.continuationTokens_); + } + } + } + if (newPartitionsBuilder_ == null) { + if (!other.newPartitions_.isEmpty()) { + if (newPartitions_.isEmpty()) { + newPartitions_ = other.newPartitions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNewPartitionsIsMutable(); + newPartitions_.addAll(other.newPartitions_); + } + onChanged(); + } + } else { + if (!other.newPartitions_.isEmpty()) { + if (newPartitionsBuilder_.isEmpty()) { + newPartitionsBuilder_.dispose(); + newPartitionsBuilder_ = null; + newPartitions_ = other.newPartitions_; + bitField0_ = (bitField0_ & ~0x00000004); + newPartitionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetNewPartitionsFieldBuilder() + : null; + } else { + newPartitionsBuilder_.addAllMessages(other.newPartitions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.StreamContinuationToken m = + input.readMessage( + com.google.bigtable.v2.StreamContinuationToken.parser(), + extensionRegistry); + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + continuationTokens_.add(m); + } else { + continuationTokensBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.bigtable.v2.StreamPartition m = + input.readMessage( + com.google.bigtable.v2.StreamPartition.parser(), extensionRegistry); + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + newPartitions_.add(m); + } else { + newPartitionsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+       * The status of the stream.
+       * 
+ * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private java.util.List continuationTokens_ = + java.util.Collections.emptyList(); + + private void ensureContinuationTokensIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + continuationTokens_ = + new java.util.ArrayList( + continuationTokens_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + continuationTokensBuilder_; + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public java.util.List + getContinuationTokensList() { + if (continuationTokensBuilder_ == null) { + return java.util.Collections.unmodifiableList(continuationTokens_); + } else { + return continuationTokensBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public int getContinuationTokensCount() { + if (continuationTokensBuilder_ == null) { + return continuationTokens_.size(); + } else { + return continuationTokensBuilder_.getCount(); + } + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public com.google.bigtable.v2.StreamContinuationToken getContinuationTokens(int index) { + if (continuationTokensBuilder_ == null) { + return continuationTokens_.get(index); + } else { + return continuationTokensBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder setContinuationTokens( + int index, com.google.bigtable.v2.StreamContinuationToken value) { + if (continuationTokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContinuationTokensIsMutable(); + continuationTokens_.set(index, value); + onChanged(); + } else { + continuationTokensBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder setContinuationTokens( + int index, com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + continuationTokens_.set(index, builderForValue.build()); + onChanged(); + } else { + continuationTokensBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder addContinuationTokens(com.google.bigtable.v2.StreamContinuationToken value) { + if (continuationTokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContinuationTokensIsMutable(); + continuationTokens_.add(value); + onChanged(); + } else { + continuationTokensBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder addContinuationTokens( + int index, com.google.bigtable.v2.StreamContinuationToken value) { + if (continuationTokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContinuationTokensIsMutable(); + continuationTokens_.add(index, value); + onChanged(); + } else { + continuationTokensBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder addContinuationTokens( + com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + continuationTokens_.add(builderForValue.build()); + onChanged(); + } else { + continuationTokensBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder addContinuationTokens( + int index, com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + continuationTokens_.add(index, builderForValue.build()); + onChanged(); + } else { + continuationTokensBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder addAllContinuationTokens( + java.lang.Iterable values) { + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, continuationTokens_); + onChanged(); + } else { + continuationTokensBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder clearContinuationTokens() { + if (continuationTokensBuilder_ == null) { + continuationTokens_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + continuationTokensBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public Builder removeContinuationTokens(int index) { + if (continuationTokensBuilder_ == null) { + ensureContinuationTokensIsMutable(); + continuationTokens_.remove(index); + onChanged(); + } else { + continuationTokensBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder getContinuationTokensBuilder( + int index) { + return internalGetContinuationTokensFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder getContinuationTokensOrBuilder( + int index) { + if (continuationTokensBuilder_ == null) { + return continuationTokens_.get(index); + } else { + return continuationTokensBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public java.util.List + getContinuationTokensOrBuilderList() { + if (continuationTokensBuilder_ != null) { + return continuationTokensBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(continuationTokens_); + } + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder addContinuationTokensBuilder() { + return internalGetContinuationTokensFieldBuilder() + .addBuilder(com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()); + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder addContinuationTokensBuilder( + int index) { + return internalGetContinuationTokensFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()); + } + + /** + * + * + *
+       * If non-empty, contains the information needed to resume reading their
+       * associated partitions.
+       * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken continuation_tokens = 2; + */ + public java.util.List + getContinuationTokensBuilderList() { + return internalGetContinuationTokensFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + internalGetContinuationTokensFieldBuilder() { + if (continuationTokensBuilder_ == null) { + continuationTokensBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder>( + continuationTokens_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + continuationTokens_ = null; + } + return continuationTokensBuilder_; + } + + private java.util.List newPartitions_ = + java.util.Collections.emptyList(); + + private void ensureNewPartitionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + newPartitions_ = + new java.util.ArrayList(newPartitions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + newPartitionsBuilder_; + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public java.util.List getNewPartitionsList() { + if (newPartitionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(newPartitions_); + } else { + return newPartitionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public int getNewPartitionsCount() { + if (newPartitionsBuilder_ == null) { + return newPartitions_.size(); + } else { + return newPartitionsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public com.google.bigtable.v2.StreamPartition getNewPartitions(int index) { + if (newPartitionsBuilder_ == null) { + return newPartitions_.get(index); + } else { + return newPartitionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder setNewPartitions(int index, com.google.bigtable.v2.StreamPartition value) { + if (newPartitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionsIsMutable(); + newPartitions_.set(index, value); + onChanged(); + } else { + newPartitionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder setNewPartitions( + int index, com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + newPartitions_.set(index, builderForValue.build()); + onChanged(); + } else { + newPartitionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder addNewPartitions(com.google.bigtable.v2.StreamPartition value) { + if (newPartitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionsIsMutable(); + newPartitions_.add(value); + onChanged(); + } else { + newPartitionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder addNewPartitions(int index, com.google.bigtable.v2.StreamPartition value) { + if (newPartitionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewPartitionsIsMutable(); + newPartitions_.add(index, value); + onChanged(); + } else { + newPartitionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder addNewPartitions( + com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + newPartitions_.add(builderForValue.build()); + onChanged(); + } else { + newPartitionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder addNewPartitions( + int index, com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + newPartitions_.add(index, builderForValue.build()); + onChanged(); + } else { + newPartitionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder addAllNewPartitions( + java.lang.Iterable values) { + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, newPartitions_); + onChanged(); + } else { + newPartitionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder clearNewPartitions() { + if (newPartitionsBuilder_ == null) { + newPartitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + newPartitionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public Builder removeNewPartitions(int index) { + if (newPartitionsBuilder_ == null) { + ensureNewPartitionsIsMutable(); + newPartitions_.remove(index); + onChanged(); + } else { + newPartitionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public com.google.bigtable.v2.StreamPartition.Builder getNewPartitionsBuilder(int index) { + return internalGetNewPartitionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public com.google.bigtable.v2.StreamPartitionOrBuilder getNewPartitionsOrBuilder(int index) { + if (newPartitionsBuilder_ == null) { + return newPartitions_.get(index); + } else { + return newPartitionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public java.util.List + getNewPartitionsOrBuilderList() { + if (newPartitionsBuilder_ != null) { + return newPartitionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(newPartitions_); + } + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public com.google.bigtable.v2.StreamPartition.Builder addNewPartitionsBuilder() { + return internalGetNewPartitionsFieldBuilder() + .addBuilder(com.google.bigtable.v2.StreamPartition.getDefaultInstance()); + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public com.google.bigtable.v2.StreamPartition.Builder addNewPartitionsBuilder(int index) { + return internalGetNewPartitionsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.StreamPartition.getDefaultInstance()); + } + + /** + * + * + *
+       * If non-empty, contains the new partitions to start reading from, which
+       * are related to but not necessarily identical to the partitions for the
+       * above `continuation_tokens`.
+       * 
+ * + * repeated .google.bigtable.v2.StreamPartition new_partitions = 3; + */ + public java.util.List + getNewPartitionsBuilderList() { + return internalGetNewPartitionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + internalGetNewPartitionsFieldBuilder() { + if (newPartitionsBuilder_ == null) { + newPartitionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder>( + newPartitions_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + newPartitions_ = null; + } + return newPartitionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + private static final com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloseStream parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse.CloseStream getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int streamRecordCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object streamRecord_; + + public enum StreamRecordCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DATA_CHANGE(1), + HEARTBEAT(2), + CLOSE_STREAM(3), + STREAMRECORD_NOT_SET(0); + private final int value; + + private StreamRecordCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StreamRecordCase valueOf(int value) { + return forNumber(value); + } + + public static StreamRecordCase forNumber(int value) { + switch (value) { + case 1: + return DATA_CHANGE; + case 2: + return HEARTBEAT; + case 3: + return CLOSE_STREAM; + case 0: + return STREAMRECORD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StreamRecordCase getStreamRecordCase() { + return StreamRecordCase.forNumber(streamRecordCase_); + } + + public static final int DATA_CHANGE_FIELD_NUMBER = 1; + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return Whether the dataChange field is set. + */ + @java.lang.Override + public boolean hasDataChange() { + return streamRecordCase_ == 1; + } + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return The dataChange. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange getDataChange() { + if (streamRecordCase_ == 1) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder + getDataChangeOrBuilder() { + if (streamRecordCase_ == 1) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + + public static final int HEARTBEAT_FIELD_NUMBER = 2; + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return streamRecordCase_ == 2; + } + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat getHeartbeat() { + if (streamRecordCase_ == 2) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder + getHeartbeatOrBuilder() { + if (streamRecordCase_ == 2) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + + public static final int CLOSE_STREAM_FIELD_NUMBER = 3; + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return Whether the closeStream field is set. + */ + @java.lang.Override + public boolean hasCloseStream() { + return streamRecordCase_ == 3; + } + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return The closeStream. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream getCloseStream() { + if (streamRecordCase_ == 3) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder + getCloseStreamOrBuilder() { + if (streamRecordCase_ == 3) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + + 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 (streamRecordCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_); + } + if (streamRecordCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_); + } + if (streamRecordCase_ == 3) { + output.writeMessage( + 3, (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streamRecordCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_); + } + if (streamRecordCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_); + } + if (streamRecordCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_); + } + size += getUnknownFields().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.ReadChangeStreamResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadChangeStreamResponse other = + (com.google.bigtable.v2.ReadChangeStreamResponse) obj; + + if (!getStreamRecordCase().equals(other.getStreamRecordCase())) return false; + switch (streamRecordCase_) { + case 1: + if (!getDataChange().equals(other.getDataChange())) return false; + break; + case 2: + if (!getHeartbeat().equals(other.getHeartbeat())) return false; + break; + case 3: + if (!getCloseStream().equals(other.getCloseStream())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (streamRecordCase_) { + case 1: + hash = (37 * hash) + DATA_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + getDataChange().hashCode(); + break; + case 2: + hash = (37 * hash) + HEARTBEAT_FIELD_NUMBER; + hash = (53 * hash) + getHeartbeat().hashCode(); + break; + case 3: + hash = (37 * hash) + CLOSE_STREAM_FIELD_NUMBER; + hash = (53 * hash) + getCloseStream().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse 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.ReadChangeStreamResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse 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.ReadChangeStreamResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadChangeStreamResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * Response message for Bigtable.ReadChangeStream.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadChangeStreamResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadChangeStreamResponse) + com.google.bigtable.v2.ReadChangeStreamResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadChangeStreamResponse.class, + com.google.bigtable.v2.ReadChangeStreamResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadChangeStreamResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dataChangeBuilder_ != null) { + dataChangeBuilder_.clear(); + } + if (heartbeatBuilder_ != null) { + heartbeatBuilder_.clear(); + } + if (closeStreamBuilder_ != null) { + closeStreamBuilder_.clear(); + } + streamRecordCase_ = 0; + streamRecord_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadChangeStreamResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadChangeStreamResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse build() { + com.google.bigtable.v2.ReadChangeStreamResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse buildPartial() { + com.google.bigtable.v2.ReadChangeStreamResponse result = + new com.google.bigtable.v2.ReadChangeStreamResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadChangeStreamResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadChangeStreamResponse result) { + result.streamRecordCase_ = streamRecordCase_; + result.streamRecord_ = this.streamRecord_; + if (streamRecordCase_ == 1 && dataChangeBuilder_ != null) { + result.streamRecord_ = dataChangeBuilder_.build(); + } + if (streamRecordCase_ == 2 && heartbeatBuilder_ != null) { + result.streamRecord_ = heartbeatBuilder_.build(); + } + if (streamRecordCase_ == 3 && closeStreamBuilder_ != null) { + result.streamRecord_ = closeStreamBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadChangeStreamResponse) { + return mergeFrom((com.google.bigtable.v2.ReadChangeStreamResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadChangeStreamResponse other) { + if (other == com.google.bigtable.v2.ReadChangeStreamResponse.getDefaultInstance()) + return this; + switch (other.getStreamRecordCase()) { + case DATA_CHANGE: + { + mergeDataChange(other.getDataChange()); + break; + } + case HEARTBEAT: + { + mergeHeartbeat(other.getHeartbeat()); + break; + } + case CLOSE_STREAM: + { + mergeCloseStream(other.getCloseStream()); + break; + } + case STREAMRECORD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetDataChangeFieldBuilder().getBuilder(), extensionRegistry); + streamRecordCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetHeartbeatFieldBuilder().getBuilder(), extensionRegistry); + streamRecordCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetCloseStreamFieldBuilder().getBuilder(), extensionRegistry); + streamRecordCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int streamRecordCase_ = 0; + private java.lang.Object streamRecord_; + + public StreamRecordCase getStreamRecordCase() { + return StreamRecordCase.forNumber(streamRecordCase_); + } + + public Builder clearStreamRecord() { + streamRecordCase_ = 0; + streamRecord_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder> + dataChangeBuilder_; + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return Whether the dataChange field is set. + */ + @java.lang.Override + public boolean hasDataChange() { + return streamRecordCase_ == 1; + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return The dataChange. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange getDataChange() { + if (dataChangeBuilder_ == null) { + if (streamRecordCase_ == 1) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } else { + if (streamRecordCase_ == 1) { + return dataChangeBuilder_.getMessage(); + } + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + public Builder setDataChange(com.google.bigtable.v2.ReadChangeStreamResponse.DataChange value) { + if (dataChangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamRecord_ = value; + onChanged(); + } else { + dataChangeBuilder_.setMessage(value); + } + streamRecordCase_ = 1; + return this; + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + public Builder setDataChange( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder builderForValue) { + if (dataChangeBuilder_ == null) { + streamRecord_ = builderForValue.build(); + onChanged(); + } else { + dataChangeBuilder_.setMessage(builderForValue.build()); + } + streamRecordCase_ = 1; + return this; + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + public Builder mergeDataChange( + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange value) { + if (dataChangeBuilder_ == null) { + if (streamRecordCase_ == 1 + && streamRecord_ + != com.google.bigtable.v2.ReadChangeStreamResponse.DataChange + .getDefaultInstance()) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.newBuilder( + (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_) + .mergeFrom(value) + .buildPartial(); + } else { + streamRecord_ = value; + } + onChanged(); + } else { + if (streamRecordCase_ == 1) { + dataChangeBuilder_.mergeFrom(value); + } else { + dataChangeBuilder_.setMessage(value); + } + } + streamRecordCase_ = 1; + return this; + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + public Builder clearDataChange() { + if (dataChangeBuilder_ == null) { + if (streamRecordCase_ == 1) { + streamRecordCase_ = 0; + streamRecord_ = null; + onChanged(); + } + } else { + if (streamRecordCase_ == 1) { + streamRecordCase_ = 0; + streamRecord_ = null; + } + dataChangeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder + getDataChangeBuilder() { + return internalGetDataChangeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder + getDataChangeOrBuilder() { + if ((streamRecordCase_ == 1) && (dataChangeBuilder_ != null)) { + return dataChangeBuilder_.getMessageOrBuilder(); + } else { + if (streamRecordCase_ == 1) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A mutation to the partition.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder> + internalGetDataChangeFieldBuilder() { + if (dataChangeBuilder_ == null) { + if (!(streamRecordCase_ == 1)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + dataChangeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder>( + (com.google.bigtable.v2.ReadChangeStreamResponse.DataChange) streamRecord_, + getParentForChildren(), + isClean()); + streamRecord_ = null; + } + streamRecordCase_ = 1; + onChanged(); + return dataChangeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder> + heartbeatBuilder_; + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return streamRecordCase_ == 2; + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat getHeartbeat() { + if (heartbeatBuilder_ == null) { + if (streamRecordCase_ == 2) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } else { + if (streamRecordCase_ == 2) { + return heartbeatBuilder_.getMessage(); + } + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + public Builder setHeartbeat(com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat value) { + if (heartbeatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamRecord_ = value; + onChanged(); + } else { + heartbeatBuilder_.setMessage(value); + } + streamRecordCase_ = 2; + return this; + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + public Builder setHeartbeat( + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder builderForValue) { + if (heartbeatBuilder_ == null) { + streamRecord_ = builderForValue.build(); + onChanged(); + } else { + heartbeatBuilder_.setMessage(builderForValue.build()); + } + streamRecordCase_ = 2; + return this; + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + public Builder mergeHeartbeat(com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat value) { + if (heartbeatBuilder_ == null) { + if (streamRecordCase_ == 2 + && streamRecord_ + != com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance()) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.newBuilder( + (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_) + .mergeFrom(value) + .buildPartial(); + } else { + streamRecord_ = value; + } + onChanged(); + } else { + if (streamRecordCase_ == 2) { + heartbeatBuilder_.mergeFrom(value); + } else { + heartbeatBuilder_.setMessage(value); + } + } + streamRecordCase_ = 2; + return this; + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + public Builder clearHeartbeat() { + if (heartbeatBuilder_ == null) { + if (streamRecordCase_ == 2) { + streamRecordCase_ = 0; + streamRecord_ = null; + onChanged(); + } + } else { + if (streamRecordCase_ == 2) { + streamRecordCase_ = 0; + streamRecord_ = null; + } + heartbeatBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder getHeartbeatBuilder() { + return internalGetHeartbeatFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder + getHeartbeatOrBuilder() { + if ((streamRecordCase_ == 2) && (heartbeatBuilder_ != null)) { + return heartbeatBuilder_.getMessageOrBuilder(); + } else { + if (streamRecordCase_ == 2) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A periodic heartbeat message.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder> + internalGetHeartbeatFieldBuilder() { + if (heartbeatBuilder_ == null) { + if (!(streamRecordCase_ == 2)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + heartbeatBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder>( + (com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) streamRecord_, + getParentForChildren(), + isClean()); + streamRecord_ = null; + } + streamRecordCase_ = 2; + onChanged(); + return heartbeatBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder> + closeStreamBuilder_; + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return Whether the closeStream field is set. + */ + @java.lang.Override + public boolean hasCloseStream() { + return streamRecordCase_ == 3; + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return The closeStream. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream getCloseStream() { + if (closeStreamBuilder_ == null) { + if (streamRecordCase_ == 3) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } else { + if (streamRecordCase_ == 3) { + return closeStreamBuilder_.getMessage(); + } + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + public Builder setCloseStream( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream value) { + if (closeStreamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamRecord_ = value; + onChanged(); + } else { + closeStreamBuilder_.setMessage(value); + } + streamRecordCase_ = 3; + return this; + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + public Builder setCloseStream( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder builderForValue) { + if (closeStreamBuilder_ == null) { + streamRecord_ = builderForValue.build(); + onChanged(); + } else { + closeStreamBuilder_.setMessage(builderForValue.build()); + } + streamRecordCase_ = 3; + return this; + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + public Builder mergeCloseStream( + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream value) { + if (closeStreamBuilder_ == null) { + if (streamRecordCase_ == 3 + && streamRecord_ + != com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream + .getDefaultInstance()) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.newBuilder( + (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_) + .mergeFrom(value) + .buildPartial(); + } else { + streamRecord_ = value; + } + onChanged(); + } else { + if (streamRecordCase_ == 3) { + closeStreamBuilder_.mergeFrom(value); + } else { + closeStreamBuilder_.setMessage(value); + } + } + streamRecordCase_ = 3; + return this; + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + public Builder clearCloseStream() { + if (closeStreamBuilder_ == null) { + if (streamRecordCase_ == 3) { + streamRecordCase_ = 0; + streamRecord_ = null; + onChanged(); + } + } else { + if (streamRecordCase_ == 3) { + streamRecordCase_ = 0; + streamRecord_ = null; + } + closeStreamBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder + getCloseStreamBuilder() { + return internalGetCloseStreamFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder + getCloseStreamOrBuilder() { + if ((streamRecordCase_ == 3) && (closeStreamBuilder_ != null)) { + return closeStreamBuilder_.getMessageOrBuilder(); + } else { + if (streamRecordCase_ == 3) { + return (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_; + } + return com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An indication that the stream should be closed.
+     * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder> + internalGetCloseStreamFieldBuilder() { + if (closeStreamBuilder_ == null) { + if (!(streamRecordCase_ == 3)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + closeStreamBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder>( + (com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream) streamRecord_, + getParentForChildren(), + isClean()); + streamRecord_ = null; + } + streamRecordCase_ = 3; + onChanged(); + return closeStreamBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadChangeStreamResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadChangeStreamResponse) + private static final com.google.bigtable.v2.ReadChangeStreamResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadChangeStreamResponse(); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadChangeStreamResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadChangeStreamResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java new file mode 100644 index 000000000000..f38885c8ac1c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadChangeStreamResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadChangeStreamResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return Whether the dataChange field is set. + */ + boolean hasDataChange(); + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + * + * @return The dataChange. + */ + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange getDataChange(); + + /** + * + * + *
+   * A mutation to the partition.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1; + */ + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder getDataChangeOrBuilder(); + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return Whether the heartbeat field is set. + */ + boolean hasHeartbeat(); + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + * + * @return The heartbeat. + */ + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat getHeartbeat(); + + /** + * + * + *
+   * A periodic heartbeat message.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2; + */ + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder getHeartbeatOrBuilder(); + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return Whether the closeStream field is set. + */ + boolean hasCloseStream(); + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + * + * @return The closeStream. + */ + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream getCloseStream(); + + /** + * + * + *
+   * An indication that the stream should be closed.
+   * 
+ * + * .google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3; + */ + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder getCloseStreamOrBuilder(); + + com.google.bigtable.v2.ReadChangeStreamResponse.StreamRecordCase getStreamRecordCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java new file mode 100644 index 000000000000..c7120cf557ac --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java @@ -0,0 +1,805 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * ReadIterationStats captures information about the iteration of rows or cells
+ * over the course of a read, e.g. how many results were scanned in a read
+ * operation versus the results returned.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadIterationStats} + */ +@com.google.protobuf.Generated +public final class ReadIterationStats extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadIterationStats) + ReadIterationStatsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadIterationStats"); + } + + // Use ReadIterationStats.newBuilder() to construct. + private ReadIterationStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadIterationStats() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_ReadIterationStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_ReadIterationStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadIterationStats.class, + com.google.bigtable.v2.ReadIterationStats.Builder.class); + } + + public static final int ROWS_SEEN_COUNT_FIELD_NUMBER = 1; + private long rowsSeenCount_ = 0L; + + /** + * + * + *
+   * The rows seen (scanned) as part of the request. This includes the count of
+   * rows returned, as captured below.
+   * 
+ * + * int64 rows_seen_count = 1; + * + * @return The rowsSeenCount. + */ + @java.lang.Override + public long getRowsSeenCount() { + return rowsSeenCount_; + } + + public static final int ROWS_RETURNED_COUNT_FIELD_NUMBER = 2; + private long rowsReturnedCount_ = 0L; + + /** + * + * + *
+   * The rows returned as part of the request.
+   * 
+ * + * int64 rows_returned_count = 2; + * + * @return The rowsReturnedCount. + */ + @java.lang.Override + public long getRowsReturnedCount() { + return rowsReturnedCount_; + } + + public static final int CELLS_SEEN_COUNT_FIELD_NUMBER = 3; + private long cellsSeenCount_ = 0L; + + /** + * + * + *
+   * The cells seen (scanned) as part of the request. This includes the count of
+   * cells returned, as captured below.
+   * 
+ * + * int64 cells_seen_count = 3; + * + * @return The cellsSeenCount. + */ + @java.lang.Override + public long getCellsSeenCount() { + return cellsSeenCount_; + } + + public static final int CELLS_RETURNED_COUNT_FIELD_NUMBER = 4; + private long cellsReturnedCount_ = 0L; + + /** + * + * + *
+   * The cells returned as part of the request.
+   * 
+ * + * int64 cells_returned_count = 4; + * + * @return The cellsReturnedCount. + */ + @java.lang.Override + public long getCellsReturnedCount() { + return cellsReturnedCount_; + } + + 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 (rowsSeenCount_ != 0L) { + output.writeInt64(1, rowsSeenCount_); + } + if (rowsReturnedCount_ != 0L) { + output.writeInt64(2, rowsReturnedCount_); + } + if (cellsSeenCount_ != 0L) { + output.writeInt64(3, cellsSeenCount_); + } + if (cellsReturnedCount_ != 0L) { + output.writeInt64(4, cellsReturnedCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rowsSeenCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rowsSeenCount_); + } + if (rowsReturnedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, rowsReturnedCount_); + } + if (cellsSeenCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, cellsSeenCount_); + } + if (cellsReturnedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, cellsReturnedCount_); + } + size += getUnknownFields().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.ReadIterationStats)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadIterationStats other = + (com.google.bigtable.v2.ReadIterationStats) obj; + + if (getRowsSeenCount() != other.getRowsSeenCount()) return false; + if (getRowsReturnedCount() != other.getRowsReturnedCount()) return false; + if (getCellsSeenCount() != other.getCellsSeenCount()) return false; + if (getCellsReturnedCount() != other.getCellsReturnedCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ROWS_SEEN_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowsSeenCount()); + hash = (37 * hash) + ROWS_RETURNED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowsReturnedCount()); + hash = (37 * hash) + CELLS_SEEN_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCellsSeenCount()); + hash = (37 * hash) + CELLS_RETURNED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCellsReturnedCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadIterationStats 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.ReadIterationStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadIterationStats 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.ReadIterationStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadIterationStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadIterationStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadIterationStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadIterationStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * ReadIterationStats captures information about the iteration of rows or cells
+   * over the course of a read, e.g. how many results were scanned in a read
+   * operation versus the results returned.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadIterationStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadIterationStats) + com.google.bigtable.v2.ReadIterationStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_ReadIterationStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_ReadIterationStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadIterationStats.class, + com.google.bigtable.v2.ReadIterationStats.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadIterationStats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowsSeenCount_ = 0L; + rowsReturnedCount_ = 0L; + cellsSeenCount_ = 0L; + cellsReturnedCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_ReadIterationStats_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadIterationStats getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadIterationStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadIterationStats build() { + com.google.bigtable.v2.ReadIterationStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadIterationStats buildPartial() { + com.google.bigtable.v2.ReadIterationStats result = + new com.google.bigtable.v2.ReadIterationStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadIterationStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowsSeenCount_ = rowsSeenCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rowsReturnedCount_ = rowsReturnedCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cellsSeenCount_ = cellsSeenCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cellsReturnedCount_ = cellsReturnedCount_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadIterationStats) { + return mergeFrom((com.google.bigtable.v2.ReadIterationStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadIterationStats other) { + if (other == com.google.bigtable.v2.ReadIterationStats.getDefaultInstance()) return this; + if (other.getRowsSeenCount() != 0L) { + setRowsSeenCount(other.getRowsSeenCount()); + } + if (other.getRowsReturnedCount() != 0L) { + setRowsReturnedCount(other.getRowsReturnedCount()); + } + if (other.getCellsSeenCount() != 0L) { + setCellsSeenCount(other.getCellsSeenCount()); + } + if (other.getCellsReturnedCount() != 0L) { + setCellsReturnedCount(other.getCellsReturnedCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rowsSeenCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + rowsReturnedCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + cellsSeenCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + cellsReturnedCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rowsSeenCount_; + + /** + * + * + *
+     * The rows seen (scanned) as part of the request. This includes the count of
+     * rows returned, as captured below.
+     * 
+ * + * int64 rows_seen_count = 1; + * + * @return The rowsSeenCount. + */ + @java.lang.Override + public long getRowsSeenCount() { + return rowsSeenCount_; + } + + /** + * + * + *
+     * The rows seen (scanned) as part of the request. This includes the count of
+     * rows returned, as captured below.
+     * 
+ * + * int64 rows_seen_count = 1; + * + * @param value The rowsSeenCount to set. + * @return This builder for chaining. + */ + public Builder setRowsSeenCount(long value) { + + rowsSeenCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The rows seen (scanned) as part of the request. This includes the count of
+     * rows returned, as captured below.
+     * 
+ * + * int64 rows_seen_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowsSeenCount() { + bitField0_ = (bitField0_ & ~0x00000001); + rowsSeenCount_ = 0L; + onChanged(); + return this; + } + + private long rowsReturnedCount_; + + /** + * + * + *
+     * The rows returned as part of the request.
+     * 
+ * + * int64 rows_returned_count = 2; + * + * @return The rowsReturnedCount. + */ + @java.lang.Override + public long getRowsReturnedCount() { + return rowsReturnedCount_; + } + + /** + * + * + *
+     * The rows returned as part of the request.
+     * 
+ * + * int64 rows_returned_count = 2; + * + * @param value The rowsReturnedCount to set. + * @return This builder for chaining. + */ + public Builder setRowsReturnedCount(long value) { + + rowsReturnedCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The rows returned as part of the request.
+     * 
+ * + * int64 rows_returned_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearRowsReturnedCount() { + bitField0_ = (bitField0_ & ~0x00000002); + rowsReturnedCount_ = 0L; + onChanged(); + return this; + } + + private long cellsSeenCount_; + + /** + * + * + *
+     * The cells seen (scanned) as part of the request. This includes the count of
+     * cells returned, as captured below.
+     * 
+ * + * int64 cells_seen_count = 3; + * + * @return The cellsSeenCount. + */ + @java.lang.Override + public long getCellsSeenCount() { + return cellsSeenCount_; + } + + /** + * + * + *
+     * The cells seen (scanned) as part of the request. This includes the count of
+     * cells returned, as captured below.
+     * 
+ * + * int64 cells_seen_count = 3; + * + * @param value The cellsSeenCount to set. + * @return This builder for chaining. + */ + public Builder setCellsSeenCount(long value) { + + cellsSeenCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cells seen (scanned) as part of the request. This includes the count of
+     * cells returned, as captured below.
+     * 
+ * + * int64 cells_seen_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCellsSeenCount() { + bitField0_ = (bitField0_ & ~0x00000004); + cellsSeenCount_ = 0L; + onChanged(); + return this; + } + + private long cellsReturnedCount_; + + /** + * + * + *
+     * The cells returned as part of the request.
+     * 
+ * + * int64 cells_returned_count = 4; + * + * @return The cellsReturnedCount. + */ + @java.lang.Override + public long getCellsReturnedCount() { + return cellsReturnedCount_; + } + + /** + * + * + *
+     * The cells returned as part of the request.
+     * 
+ * + * int64 cells_returned_count = 4; + * + * @param value The cellsReturnedCount to set. + * @return This builder for chaining. + */ + public Builder setCellsReturnedCount(long value) { + + cellsReturnedCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cells returned as part of the request.
+     * 
+ * + * int64 cells_returned_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearCellsReturnedCount() { + bitField0_ = (bitField0_ & ~0x00000008); + cellsReturnedCount_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadIterationStats) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadIterationStats) + private static final com.google.bigtable.v2.ReadIterationStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadIterationStats(); + } + + public static com.google.bigtable.v2.ReadIterationStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadIterationStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadIterationStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java new file mode 100644 index 000000000000..1c84e56f7b7e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadIterationStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadIterationStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The rows seen (scanned) as part of the request. This includes the count of
+   * rows returned, as captured below.
+   * 
+ * + * int64 rows_seen_count = 1; + * + * @return The rowsSeenCount. + */ + long getRowsSeenCount(); + + /** + * + * + *
+   * The rows returned as part of the request.
+   * 
+ * + * int64 rows_returned_count = 2; + * + * @return The rowsReturnedCount. + */ + long getRowsReturnedCount(); + + /** + * + * + *
+   * The cells seen (scanned) as part of the request. This includes the count of
+   * cells returned, as captured below.
+   * 
+ * + * int64 cells_seen_count = 3; + * + * @return The cellsSeenCount. + */ + long getCellsSeenCount(); + + /** + * + * + *
+   * The cells returned as part of the request.
+   * 
+ * + * int64 cells_returned_count = 4; + * + * @return The cellsReturnedCount. + */ + long getCellsReturnedCount(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java new file mode 100644 index 000000000000..397646657629 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java @@ -0,0 +1,1799 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.ReadModifyWriteRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowRequest} + */ +@com.google.protobuf.Generated +public final class ReadModifyWriteRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadModifyWriteRowRequest) + ReadModifyWriteRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadModifyWriteRowRequest"); + } + + // Use ReadModifyWriteRowRequest.newBuilder() to construct. + private ReadModifyWriteRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadModifyWriteRowRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + rules_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRowRequest.class, + com.google.bigtable.v2.ReadModifyWriteRowRequest.Builder.class); + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table to which the read/modify/write rules
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table to which the read/modify/write rules
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the
+   * read/modify/write rules should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the
+   * read/modify/write rules should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + 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 = 4; + * + * @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 = 4; + * + * @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; + } + } + + public static final int ROW_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. The key of the row to which the read/modify/write rules should be
+   * applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int RULES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List rules_; + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRule getRules(int index) { + return rules_.get(index); + } + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!rowKey_.isEmpty()) { + output.writeBytes(2, rowKey_); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(3, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, authorizedViewName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, rowKey_); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, authorizedViewName_); + } + size += getUnknownFields().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.ReadModifyWriteRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadModifyWriteRowRequest other = + (com.google.bigtable.v2.ReadModifyWriteRowRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getRowKey().equals(other.getRowKey())) return false; + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest 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.ReadModifyWriteRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest 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.ReadModifyWriteRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadModifyWriteRowRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.ReadModifyWriteRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadModifyWriteRowRequest) + com.google.bigtable.v2.ReadModifyWriteRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRowRequest.class, + com.google.bigtable.v2.ReadModifyWriteRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadModifyWriteRowRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + appProfileId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadModifyWriteRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowRequest build() { + com.google.bigtable.v2.ReadModifyWriteRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowRequest buildPartial() { + com.google.bigtable.v2.ReadModifyWriteRowRequest result = + new com.google.bigtable.v2.ReadModifyWriteRowRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.ReadModifyWriteRowRequest result) { + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.ReadModifyWriteRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rowKey_ = rowKey_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadModifyWriteRowRequest) { + return mergeFrom((com.google.bigtable.v2.ReadModifyWriteRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowRequest other) { + if (other == com.google.bigtable.v2.ReadModifyWriteRowRequest.getDefaultInstance()) + return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000010); + rulesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + com.google.bigtable.v2.ReadModifyWriteRule m = + input.readMessage( + com.google.bigtable.v2.ReadModifyWriteRule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 50: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table to which the read/modify/write rules
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the read/modify/write rules
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the read/modify/write rules
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the read/modify/write rules
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table to which the read/modify/write rules
+     * should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the
+     * read/modify/write rules should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the
+     * read/modify/write rules should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the
+     * read/modify/write rules should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the
+     * read/modify/write rules should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView to which the
+     * read/modify/write rules should be applied.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + 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 = 4; + * + * @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 = 4; + * + * @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 = 4; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 4; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. The key of the row to which the read/modify/write rules should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+     * Required. The key of the row to which the read/modify/write rules should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The key of the row to which the read/modify/write rules should be
+     * applied.
+     * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000008); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadModifyWriteRule, + com.google.bigtable.v2.ReadModifyWriteRule.Builder, + com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.ReadModifyWriteRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules(int index, com.google.bigtable.v2.ReadModifyWriteRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules( + int index, com.google.bigtable.v2.ReadModifyWriteRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(int index, com.google.bigtable.v2.ReadModifyWriteRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + int index, com.google.bigtable.v2.ReadModifyWriteRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.ReadModifyWriteRule.Builder getRulesBuilder(int index) { + return internalGetRulesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder() { + return internalGetRulesFieldBuilder() + .addBuilder(com.google.bigtable.v2.ReadModifyWriteRule.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder(int index) { + return internalGetRulesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.ReadModifyWriteRule.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. Rules specifying how the specified row's contents are to be
+     * transformed into writes. Entries are applied in order, meaning that earlier
+     * rules will affect the results of later ones. At least one entry must be
+     * specified, and there can be at most 100000 rules.
+     * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRulesBuilderList() { + return internalGetRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadModifyWriteRule, + com.google.bigtable.v2.ReadModifyWriteRule.Builder, + com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder> + internalGetRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadModifyWriteRule, + com.google.bigtable.v2.ReadModifyWriteRule.Builder, + com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadModifyWriteRowRequest) + private static final com.google.bigtable.v2.ReadModifyWriteRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadModifyWriteRowRequest(); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadModifyWriteRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadModifyWriteRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java new file mode 100644 index 000000000000..fdda8039803c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java @@ -0,0 +1,227 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadModifyWriteRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadModifyWriteRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table to which the read/modify/write rules
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table to which the read/modify/write rules
+   * should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the
+   * read/modify/write rules should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView to which the
+   * read/modify/write rules should be applied.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 4; + * + * @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 = 4; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Required. The key of the row to which the read/modify/write rules should be
+   * applied.
+   * 
+ * + * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getRulesList(); + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.ReadModifyWriteRule getRules(int index); + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getRulesCount(); + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getRulesOrBuilderList(); + + /** + * + * + *
+   * Required. Rules specifying how the specified row's contents are to be
+   * transformed into writes. Entries are applied in order, meaning that earlier
+   * rules will affect the results of later ones. At least one entry must be
+   * specified, and there can be at most 100000 rules.
+   * 
+ * + * + * repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java new file mode 100644 index 000000000000..e9bb1ff2ace5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java @@ -0,0 +1,688 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.ReadModifyWriteRow.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowResponse} + */ +@com.google.protobuf.Generated +public final class ReadModifyWriteRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadModifyWriteRowResponse) + ReadModifyWriteRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadModifyWriteRowResponse"); + } + + // Use ReadModifyWriteRowResponse.newBuilder() to construct. + private ReadModifyWriteRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadModifyWriteRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRowResponse.class, + com.google.bigtable.v2.ReadModifyWriteRowResponse.Builder.class); + } + + private int bitField0_; + public static final int ROW_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Row row_; + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + @java.lang.Override + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + @java.lang.Override + public com.google.bigtable.v2.Row getRow() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRow()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRow()); + } + size += getUnknownFields().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.ReadModifyWriteRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadModifyWriteRowResponse other = + (com.google.bigtable.v2.ReadModifyWriteRowResponse) obj; + + if (hasRow() != other.hasRow()) return false; + if (hasRow()) { + if (!getRow().equals(other.getRow())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRow()) { + hash = (37 * hash) + ROW_FIELD_NUMBER; + hash = (53 * hash) + getRow().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse 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.ReadModifyWriteRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse 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.ReadModifyWriteRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadModifyWriteRowResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.ReadModifyWriteRow.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadModifyWriteRowResponse) + com.google.bigtable.v2.ReadModifyWriteRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRowResponse.class, + com.google.bigtable.v2.ReadModifyWriteRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadModifyWriteRowResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadModifyWriteRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowResponse build() { + com.google.bigtable.v2.ReadModifyWriteRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRowResponse buildPartial() { + com.google.bigtable.v2.ReadModifyWriteRowResponse result = + new com.google.bigtable.v2.ReadModifyWriteRowResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadModifyWriteRowResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.row_ = rowBuilder_ == null ? row_ : rowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadModifyWriteRowResponse) { + return mergeFrom((com.google.bigtable.v2.ReadModifyWriteRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowResponse other) { + if (other == com.google.bigtable.v2.ReadModifyWriteRowResponse.getDefaultInstance()) + return this; + if (other.hasRow()) { + mergeRow(other.getRow()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetRowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Row row_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + rowBuilder_; + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + public com.google.bigtable.v2.Row getRow() { + if (rowBuilder_ == null) { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } else { + return rowBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public Builder setRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + row_ = value; + } else { + rowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public Builder setRow(com.google.bigtable.v2.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + row_ = builderForValue.build(); + } else { + rowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public Builder mergeRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && row_ != null + && row_ != com.google.bigtable.v2.Row.getDefaultInstance()) { + getRowBuilder().mergeFrom(value); + } else { + row_ = value; + } + } else { + rowBuilder_.mergeFrom(value); + } + if (row_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public Builder clearRow() { + bitField0_ = (bitField0_ & ~0x00000001); + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public com.google.bigtable.v2.Row.Builder getRowBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRowFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + if (rowBuilder_ != null) { + return rowBuilder_.getMessageOrBuilder(); + } else { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + } + + /** + * + * + *
+     * A Row containing the new contents of all cells modified by the request.
+     * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + internalGetRowFieldBuilder() { + if (rowBuilder_ == null) { + rowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder>(getRow(), getParentForChildren(), isClean()); + row_ = null; + } + return rowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadModifyWriteRowResponse) + private static final com.google.bigtable.v2.ReadModifyWriteRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadModifyWriteRowResponse(); + } + + public static com.google.bigtable.v2.ReadModifyWriteRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadModifyWriteRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadModifyWriteRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java new file mode 100644 index 000000000000..73de2685c3e1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadModifyWriteRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadModifyWriteRowResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + boolean hasRow(); + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + com.google.bigtable.v2.Row getRow(); + + /** + * + * + *
+   * A Row containing the new contents of all cells modified by the request.
+   * 
+ * + * .google.bigtable.v2.Row row = 1; + */ + com.google.bigtable.v2.RowOrBuilder getRowOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java new file mode 100644 index 000000000000..8d740aa7d038 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies an atomic read/modify/write operation on the latest value of the
+ * specified column.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRule} + */ +@com.google.protobuf.Generated +public final class ReadModifyWriteRule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadModifyWriteRule) + ReadModifyWriteRuleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadModifyWriteRule"); + } + + // Use ReadModifyWriteRule.newBuilder() to construct. + private ReadModifyWriteRule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadModifyWriteRule() { + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRule.class, + com.google.bigtable.v2.ReadModifyWriteRule.Builder.class); + } + + private int ruleCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object rule_; + + public enum RuleCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + APPEND_VALUE(3), + INCREMENT_AMOUNT(4), + RULE_NOT_SET(0); + private final int value; + + private RuleCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RuleCase valueOf(int value) { + return forNumber(value); + } + + public static RuleCase forNumber(int value) { + switch (value) { + case 3: + return APPEND_VALUE; + case 4: + return INCREMENT_AMOUNT; + case 0: + return RULE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public static final int FAMILY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + + /** + * + * + *
+   * The name of the family to which the read/modify/write should be applied.
+   * Must match `[-_.a-zA-Z0-9]+`
+   * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + @java.lang.Override + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + 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(); + familyName_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the family to which the read/modify/write should be applied.
+   * Must match `[-_.a-zA-Z0-9]+`
+   * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The qualifier of the column to which the read/modify/write should be
+   * applied.
+   * Can be any byte string, including the empty string.
+   * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + public static final int APPEND_VALUE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Rule specifying that `append_value` be appended to the existing value.
+   * If the targeted cell is unset, it will be treated as containing the
+   * empty string.
+   * 
+ * + * bytes append_value = 3; + * + * @return Whether the appendValue field is set. + */ + @java.lang.Override + public boolean hasAppendValue() { + return ruleCase_ == 3; + } + + /** + * + * + *
+   * Rule specifying that `append_value` be appended to the existing value.
+   * If the targeted cell is unset, it will be treated as containing the
+   * empty string.
+   * 
+ * + * bytes append_value = 3; + * + * @return The appendValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppendValue() { + if (ruleCase_ == 3) { + return (com.google.protobuf.ByteString) rule_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int INCREMENT_AMOUNT_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Rule specifying that `increment_amount` be added to the existing value.
+   * If the targeted cell is unset, it will be treated as containing a zero.
+   * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+   * as a 64-bit big-endian signed integer), or the entire request will fail.
+   * 
+ * + * int64 increment_amount = 4; + * + * @return Whether the incrementAmount field is set. + */ + @java.lang.Override + public boolean hasIncrementAmount() { + return ruleCase_ == 4; + } + + /** + * + * + *
+   * Rule specifying that `increment_amount` be added to the existing value.
+   * If the targeted cell is unset, it will be treated as containing a zero.
+   * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+   * as a 64-bit big-endian signed integer), or the entire request will fail.
+   * 
+ * + * int64 increment_amount = 4; + * + * @return The incrementAmount. + */ + @java.lang.Override + public long getIncrementAmount() { + if (ruleCase_ == 4) { + return (java.lang.Long) rule_; + } + return 0L; + } + + 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.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + output.writeBytes(2, columnQualifier_); + } + if (ruleCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) rule_); + } + if (ruleCase_ == 4) { + output.writeInt64(4, (long) ((java.lang.Long) rule_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); + } + if (!columnQualifier_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, columnQualifier_); + } + if (ruleCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) rule_); + } + if (ruleCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 4, (long) ((java.lang.Long) rule_)); + } + size += getUnknownFields().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.ReadModifyWriteRule)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadModifyWriteRule other = + (com.google.bigtable.v2.ReadModifyWriteRule) obj; + + if (!getFamilyName().equals(other.getFamilyName())) return false; + if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; + if (!getRuleCase().equals(other.getRuleCase())) return false; + switch (ruleCase_) { + case 3: + if (!getAppendValue().equals(other.getAppendValue())) return false; + break; + case 4: + if (getIncrementAmount() != other.getIncrementAmount()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + hash = (37 * hash) + COLUMN_QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifier().hashCode(); + switch (ruleCase_) { + case 3: + hash = (37 * hash) + APPEND_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getAppendValue().hashCode(); + break; + case 4: + hash = (37 * hash) + INCREMENT_AMOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIncrementAmount()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule 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.ReadModifyWriteRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule 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.ReadModifyWriteRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadModifyWriteRule 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies an atomic read/modify/write operation on the latest value of the
+   * specified column.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadModifyWriteRule) + com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadModifyWriteRule.class, + com.google.bigtable.v2.ReadModifyWriteRule.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadModifyWriteRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + familyName_ = ""; + columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + ruleCase_ = 0; + rule_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRule getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadModifyWriteRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRule build() { + com.google.bigtable.v2.ReadModifyWriteRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadModifyWriteRule buildPartial() { + com.google.bigtable.v2.ReadModifyWriteRule result = + new com.google.bigtable.v2.ReadModifyWriteRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadModifyWriteRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = columnQualifier_; + } + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadModifyWriteRule result) { + result.ruleCase_ = ruleCase_; + result.rule_ = this.rule_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadModifyWriteRule) { + return mergeFrom((com.google.bigtable.v2.ReadModifyWriteRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRule other) { + if (other == com.google.bigtable.v2.ReadModifyWriteRule.getDefaultInstance()) return this; + if (!other.getFamilyName().isEmpty()) { + familyName_ = other.familyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getColumnQualifier().isEmpty()) { + setColumnQualifier(other.getColumnQualifier()); + } + switch (other.getRuleCase()) { + case APPEND_VALUE: + { + setAppendValue(other.getAppendValue()); + break; + } + case INCREMENT_AMOUNT: + { + setIncrementAmount(other.getIncrementAmount()); + break; + } + case RULE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + familyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + columnQualifier_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + rule_ = input.readBytes(); + ruleCase_ = 3; + break; + } // case 26 + case 32: + { + rule_ = input.readInt64(); + ruleCase_ = 4; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int ruleCase_ = 0; + private java.lang.Object rule_; + + public RuleCase getRuleCase() { + return RuleCase.forNumber(ruleCase_); + } + + public Builder clearRule() { + ruleCase_ = 0; + rule_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object familyName_ = ""; + + /** + * + * + *
+     * The name of the family to which the read/modify/write should be applied.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + public java.lang.String getFamilyName() { + java.lang.Object ref = familyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + familyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the family to which the read/modify/write should be applied.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + public com.google.protobuf.ByteString getFamilyNameBytes() { + java.lang.Object ref = familyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + familyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the family to which the read/modify/write should be applied.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @param value The familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the family to which the read/modify/write should be applied.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFamilyName() { + familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the family to which the read/modify/write should be applied.
+     * Must match `[-_.a-zA-Z0-9]+`
+     * 
+ * + * string family_name = 1; + * + * @param value The bytes for familyName to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + familyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The qualifier of the column to which the read/modify/write should be
+     * applied.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifier() { + return columnQualifier_; + } + + /** + * + * + *
+     * The qualifier of the column to which the read/modify/write should be
+     * applied.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @param value The columnQualifier to set. + * @return This builder for chaining. + */ + public Builder setColumnQualifier(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + columnQualifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The qualifier of the column to which the read/modify/write should be
+     * applied.
+     * Can be any byte string, including the empty string.
+     * 
+ * + * bytes column_qualifier = 2; + * + * @return This builder for chaining. + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = getDefaultInstance().getColumnQualifier(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule specifying that `append_value` be appended to the existing value.
+     * If the targeted cell is unset, it will be treated as containing the
+     * empty string.
+     * 
+ * + * bytes append_value = 3; + * + * @return Whether the appendValue field is set. + */ + public boolean hasAppendValue() { + return ruleCase_ == 3; + } + + /** + * + * + *
+     * Rule specifying that `append_value` be appended to the existing value.
+     * If the targeted cell is unset, it will be treated as containing the
+     * empty string.
+     * 
+ * + * bytes append_value = 3; + * + * @return The appendValue. + */ + public com.google.protobuf.ByteString getAppendValue() { + if (ruleCase_ == 3) { + return (com.google.protobuf.ByteString) rule_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Rule specifying that `append_value` be appended to the existing value.
+     * If the targeted cell is unset, it will be treated as containing the
+     * empty string.
+     * 
+ * + * bytes append_value = 3; + * + * @param value The appendValue to set. + * @return This builder for chaining. + */ + public Builder setAppendValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ruleCase_ = 3; + rule_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule specifying that `append_value` be appended to the existing value.
+     * If the targeted cell is unset, it will be treated as containing the
+     * empty string.
+     * 
+ * + * bytes append_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearAppendValue() { + if (ruleCase_ == 3) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Rule specifying that `increment_amount` be added to the existing value.
+     * If the targeted cell is unset, it will be treated as containing a zero.
+     * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+     * as a 64-bit big-endian signed integer), or the entire request will fail.
+     * 
+ * + * int64 increment_amount = 4; + * + * @return Whether the incrementAmount field is set. + */ + public boolean hasIncrementAmount() { + return ruleCase_ == 4; + } + + /** + * + * + *
+     * Rule specifying that `increment_amount` be added to the existing value.
+     * If the targeted cell is unset, it will be treated as containing a zero.
+     * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+     * as a 64-bit big-endian signed integer), or the entire request will fail.
+     * 
+ * + * int64 increment_amount = 4; + * + * @return The incrementAmount. + */ + public long getIncrementAmount() { + if (ruleCase_ == 4) { + return (java.lang.Long) rule_; + } + return 0L; + } + + /** + * + * + *
+     * Rule specifying that `increment_amount` be added to the existing value.
+     * If the targeted cell is unset, it will be treated as containing a zero.
+     * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+     * as a 64-bit big-endian signed integer), or the entire request will fail.
+     * 
+ * + * int64 increment_amount = 4; + * + * @param value The incrementAmount to set. + * @return This builder for chaining. + */ + public Builder setIncrementAmount(long value) { + + ruleCase_ = 4; + rule_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Rule specifying that `increment_amount` be added to the existing value.
+     * If the targeted cell is unset, it will be treated as containing a zero.
+     * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+     * as a 64-bit big-endian signed integer), or the entire request will fail.
+     * 
+ * + * int64 increment_amount = 4; + * + * @return This builder for chaining. + */ + public Builder clearIncrementAmount() { + if (ruleCase_ == 4) { + ruleCase_ = 0; + rule_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRule) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadModifyWriteRule) + private static final com.google.bigtable.v2.ReadModifyWriteRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadModifyWriteRule(); + } + + public static com.google.bigtable.v2.ReadModifyWriteRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadModifyWriteRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadModifyWriteRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java new file mode 100644 index 000000000000..50c9e47b5398 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadModifyWriteRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadModifyWriteRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the family to which the read/modify/write should be applied.
+   * Must match `[-_.a-zA-Z0-9]+`
+   * 
+ * + * string family_name = 1; + * + * @return The familyName. + */ + java.lang.String getFamilyName(); + + /** + * + * + *
+   * The name of the family to which the read/modify/write should be applied.
+   * Must match `[-_.a-zA-Z0-9]+`
+   * 
+ * + * string family_name = 1; + * + * @return The bytes for familyName. + */ + com.google.protobuf.ByteString getFamilyNameBytes(); + + /** + * + * + *
+   * The qualifier of the column to which the read/modify/write should be
+   * applied.
+   * Can be any byte string, including the empty string.
+   * 
+ * + * bytes column_qualifier = 2; + * + * @return The columnQualifier. + */ + com.google.protobuf.ByteString getColumnQualifier(); + + /** + * + * + *
+   * Rule specifying that `append_value` be appended to the existing value.
+   * If the targeted cell is unset, it will be treated as containing the
+   * empty string.
+   * 
+ * + * bytes append_value = 3; + * + * @return Whether the appendValue field is set. + */ + boolean hasAppendValue(); + + /** + * + * + *
+   * Rule specifying that `append_value` be appended to the existing value.
+   * If the targeted cell is unset, it will be treated as containing the
+   * empty string.
+   * 
+ * + * bytes append_value = 3; + * + * @return The appendValue. + */ + com.google.protobuf.ByteString getAppendValue(); + + /** + * + * + *
+   * Rule specifying that `increment_amount` be added to the existing value.
+   * If the targeted cell is unset, it will be treated as containing a zero.
+   * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+   * as a 64-bit big-endian signed integer), or the entire request will fail.
+   * 
+ * + * int64 increment_amount = 4; + * + * @return Whether the incrementAmount field is set. + */ + boolean hasIncrementAmount(); + + /** + * + * + *
+   * Rule specifying that `increment_amount` be added to the existing value.
+   * If the targeted cell is unset, it will be treated as containing a zero.
+   * Otherwise, the targeted cell must contain an 8-byte value (interpreted
+   * as a 64-bit big-endian signed integer), or the entire request will fail.
+   * 
+ * + * int64 increment_amount = 4; + * + * @return The incrementAmount. + */ + long getIncrementAmount(); + + com.google.bigtable.v2.ReadModifyWriteRule.RuleCase getRuleCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java new file mode 100644 index 000000000000..b25741674607 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java @@ -0,0 +1,2435 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.ReadRows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsRequest} + */ +@com.google.protobuf.Generated +public final class ReadRowsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadRowsRequest) + ReadRowsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadRowsRequest"); + } + + // Use ReadRowsRequest.newBuilder() to construct. + private ReadRowsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadRowsRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; + appProfileId_ = ""; + requestStatsView_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsRequest.class, + com.google.bigtable.v2.ReadRowsRequest.Builder.class); + } + + /** + * + * + *
+   * The desired view into RequestStats that should be returned in the response.
+   *
+   * See also: RequestStats message.
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.ReadRowsRequest.RequestStatsView} + */ + public enum RequestStatsView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default / unset value. The API will default to the NONE option below.
+     * 
+ * + * REQUEST_STATS_VIEW_UNSPECIFIED = 0; + */ + REQUEST_STATS_VIEW_UNSPECIFIED(0), + /** + * + * + *
+     * Do not include any RequestStats in the response. This will leave the
+     * RequestStats embedded message unset in the response.
+     * 
+ * + * REQUEST_STATS_NONE = 1; + */ + REQUEST_STATS_NONE(1), + /** + * + * + *
+     * Include the full set of available RequestStats in the response,
+     * applicable to this read.
+     * 
+ * + * REQUEST_STATS_FULL = 2; + */ + REQUEST_STATS_FULL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestStatsView"); + } + + /** + * + * + *
+     * The default / unset value. The API will default to the NONE option below.
+     * 
+ * + * REQUEST_STATS_VIEW_UNSPECIFIED = 0; + */ + public static final int REQUEST_STATS_VIEW_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Do not include any RequestStats in the response. This will leave the
+     * RequestStats embedded message unset in the response.
+     * 
+ * + * REQUEST_STATS_NONE = 1; + */ + public static final int REQUEST_STATS_NONE_VALUE = 1; + + /** + * + * + *
+     * Include the full set of available RequestStats in the response,
+     * applicable to this read.
+     * 
+ * + * REQUEST_STATS_FULL = 2; + */ + public static final int REQUEST_STATS_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestStatsView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequestStatsView forNumber(int value) { + switch (value) { + case 0: + return REQUEST_STATS_VIEW_UNSPECIFIED; + case 1: + return REQUEST_STATS_NONE; + case 2: + return REQUEST_STATS_FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequestStatsView findValueByNumber(int number) { + return RequestStatsView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.ReadRowsRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final RequestStatsView[] VALUES = values(); + + public static RequestStatsView valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RequestStatsView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.ReadRowsRequest.RequestStatsView) + } + + private int bitField0_; + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATERIALIZED_VIEW_NAME_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + @java.lang.Override + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + 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(); + materializedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + 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 = 5; + * + * @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 = 5; + * + * @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; + } + } + + public static final int ROWS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RowSet rows_; + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return Whether the rows field is set. + */ + @java.lang.Override + public boolean hasRows() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return The rows. + */ + @java.lang.Override + public com.google.bigtable.v2.RowSet getRows() { + return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; + } + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { + return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; + } + + public static final int FILTER_FIELD_NUMBER = 3; + private com.google.bigtable.v2.RowFilter filter_; + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return Whether the filter field is set. + */ + @java.lang.Override + public boolean hasFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return The filter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFilter() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + public static final int ROWS_LIMIT_FIELD_NUMBER = 4; + private long rowsLimit_ = 0L; + + /** + * + * + *
+   * The read will stop after committing to N rows' worth of results. The
+   * default (zero) is to return all results.
+   * 
+ * + * int64 rows_limit = 4; + * + * @return The rowsLimit. + */ + @java.lang.Override + public long getRowsLimit() { + return rowsLimit_; + } + + public static final int REQUEST_STATS_VIEW_FIELD_NUMBER = 6; + private int requestStatsView_ = 0; + + /** + * + * + *
+   * The view into RequestStats, as described above.
+   * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The enum numeric value on the wire for requestStatsView. + */ + @java.lang.Override + public int getRequestStatsViewValue() { + return requestStatsView_; + } + + /** + * + * + *
+   * The view into RequestStats, as described above.
+   * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The requestStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest.RequestStatsView getRequestStatsView() { + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView result = + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.forNumber(requestStatsView_); + return result == null + ? com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.UNRECOGNIZED + : result; + } + + public static final int REVERSED_FIELD_NUMBER = 7; + private boolean reversed_ = false; + + /** + * + * + *
+   * Experimental API - Please note that this API is currently experimental
+   * and can change in the future.
+   *
+   * Return rows in lexiographical descending order of the row keys. The row
+   * contents will not be affected by this flag.
+   *
+   * Example result set:
+   *
+   * [
+   * {key: "k2", "f:col1": "v1", "f:col2": "v1"},
+   * {key: "k1", "f:col1": "v2", "f:col2": "v2"}
+   * ]
+   * 
+ * + * bool reversed = 7; + * + * @return The reversed. + */ + @java.lang.Override + public boolean getReversed() { + return reversed_; + } + + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRows()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getFilter()); + } + if (rowsLimit_ != 0L) { + output.writeInt64(4, rowsLimit_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, appProfileId_); + } + if (requestStatsView_ + != com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.REQUEST_STATS_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, requestStatsView_); + } + if (reversed_ != false) { + output.writeBool(7, reversed_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, materializedViewName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRows()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFilter()); + } + if (rowsLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, rowsLimit_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, appProfileId_); + } + if (requestStatsView_ + != com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.REQUEST_STATS_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, requestStatsView_); + } + if (reversed_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, reversed_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, materializedViewName_); + } + size += getUnknownFields().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.ReadRowsRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadRowsRequest other = (com.google.bigtable.v2.ReadRowsRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getMaterializedViewName().equals(other.getMaterializedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (hasRows() != other.hasRows()) return false; + if (hasRows()) { + if (!getRows().equals(other.getRows())) return false; + } + if (hasFilter() != other.hasFilter()) return false; + if (hasFilter()) { + if (!getFilter().equals(other.getFilter())) return false; + } + if (getRowsLimit() != other.getRowsLimit()) return false; + if (requestStatsView_ != other.requestStatsView_) return false; + if (getReversed() != other.getReversed()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + MATERIALIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + if (hasRows()) { + hash = (37 * hash) + ROWS_FIELD_NUMBER; + hash = (53 * hash) + getRows().hashCode(); + } + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + hash = (37 * hash) + ROWS_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowsLimit()); + hash = (37 * hash) + REQUEST_STATS_VIEW_FIELD_NUMBER; + hash = (53 * hash) + requestStatsView_; + hash = (37 * hash) + REVERSED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReversed()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsRequest 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.ReadRowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsRequest 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.ReadRowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadRowsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.ReadRows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadRowsRequest) + com.google.bigtable.v2.ReadRowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsRequest.class, + com.google.bigtable.v2.ReadRowsRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadRowsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowsFieldBuilder(); + internalGetFilterFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; + appProfileId_ = ""; + rows_ = null; + if (rowsBuilder_ != null) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + } + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + rowsLimit_ = 0L; + requestStatsView_ = 0; + reversed_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest build() { + com.google.bigtable.v2.ReadRowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest buildPartial() { + com.google.bigtable.v2.ReadRowsRequest result = + new com.google.bigtable.v2.ReadRowsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadRowsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.materializedViewName_ = materializedViewName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.appProfileId_ = appProfileId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.rows_ = rowsBuilder_ == null ? rows_ : rowsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.filter_ = filterBuilder_ == null ? filter_ : filterBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.rowsLimit_ = rowsLimit_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requestStatsView_ = requestStatsView_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.reversed_ = reversed_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadRowsRequest) { + return mergeFrom((com.google.bigtable.v2.ReadRowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadRowsRequest other) { + if (other == com.google.bigtable.v2.ReadRowsRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMaterializedViewName().isEmpty()) { + materializedViewName_ = other.materializedViewName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasRows()) { + mergeRows(other.getRows()); + } + if (other.hasFilter()) { + mergeFilter(other.getFilter()); + } + if (other.getRowsLimit() != 0L) { + setRowsLimit(other.getRowsLimit()); + } + if (other.requestStatsView_ != 0) { + setRequestStatsViewValue(other.getRequestStatsViewValue()); + } + if (other.getReversed() != false) { + setReversed(other.getReversed()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetRowsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 26 + case 32: + { + rowsLimit_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 32 + case 42: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + requestStatsView_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 56: + { + reversed_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 56 + case 74: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 74 + case 90: + { + materializedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + materializedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + materializedViewName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearMaterializedViewName() { + materializedViewName_ = getDefaultInstance().getMaterializedViewName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + materializedViewName_ = value; + bitField0_ |= 0x00000004; + 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 = 5; + * + * @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 = 5; + * + * @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 = 5; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 5; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.bigtable.v2.RowSet rows_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowSet, + com.google.bigtable.v2.RowSet.Builder, + com.google.bigtable.v2.RowSetOrBuilder> + rowsBuilder_; + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return Whether the rows field is set. + */ + public boolean hasRows() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return The rows. + */ + public com.google.bigtable.v2.RowSet getRows() { + if (rowsBuilder_ == null) { + return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; + } else { + return rowsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public Builder setRows(com.google.bigtable.v2.RowSet value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rows_ = value; + } else { + rowsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public Builder setRows(com.google.bigtable.v2.RowSet.Builder builderForValue) { + if (rowsBuilder_ == null) { + rows_ = builderForValue.build(); + } else { + rowsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public Builder mergeRows(com.google.bigtable.v2.RowSet value) { + if (rowsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && rows_ != null + && rows_ != com.google.bigtable.v2.RowSet.getDefaultInstance()) { + getRowsBuilder().mergeFrom(value); + } else { + rows_ = value; + } + } else { + rowsBuilder_.mergeFrom(value); + } + if (rows_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public Builder clearRows() { + bitField0_ = (bitField0_ & ~0x00000010); + rows_ = null; + if (rowsBuilder_ != null) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public com.google.bigtable.v2.RowSet.Builder getRowsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetRowsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { + if (rowsBuilder_ != null) { + return rowsBuilder_.getMessageOrBuilder(); + } else { + return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; + } + } + + /** + * + * + *
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
+     * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowSet, + com.google.bigtable.v2.RowSet.Builder, + com.google.bigtable.v2.RowSetOrBuilder> + internalGetRowsFieldBuilder() { + if (rowsBuilder_ == null) { + rowsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowSet, + com.google.bigtable.v2.RowSet.Builder, + com.google.bigtable.v2.RowSetOrBuilder>( + getRows(), getParentForChildren(), isClean()); + rows_ = null; + } + return rowsBuilder_; + } + + private com.google.bigtable.v2.RowFilter filter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + filterBuilder_; + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return Whether the filter field is set. + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return The filter. + */ + public com.google.bigtable.v2.RowFilter getFilter() { + if (filterBuilder_ == null) { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } else { + return filterBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public Builder setFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + } else { + filterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public Builder setFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filterBuilder_ == null) { + filter_ = builderForValue.build(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public Builder mergeFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && filter_ != null + && filter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); + } else { + filter_ = value; + } + } else { + filterBuilder_.mergeFrom(value); + } + if (filter_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000020); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public com.google.bigtable.v2.RowFilter.Builder getFilterBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + if (filterBuilder_ != null) { + return filterBuilder_.getMessageOrBuilder(); + } else { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + } + + /** + * + * + *
+     * The filter to apply to the contents of the specified row(s). If unset,
+     * reads the entirety of each row.
+     * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFilterFieldBuilder() { + if (filterBuilder_ == null) { + filterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getFilter(), getParentForChildren(), isClean()); + filter_ = null; + } + return filterBuilder_; + } + + private long rowsLimit_; + + /** + * + * + *
+     * The read will stop after committing to N rows' worth of results. The
+     * default (zero) is to return all results.
+     * 
+ * + * int64 rows_limit = 4; + * + * @return The rowsLimit. + */ + @java.lang.Override + public long getRowsLimit() { + return rowsLimit_; + } + + /** + * + * + *
+     * The read will stop after committing to N rows' worth of results. The
+     * default (zero) is to return all results.
+     * 
+ * + * int64 rows_limit = 4; + * + * @param value The rowsLimit to set. + * @return This builder for chaining. + */ + public Builder setRowsLimit(long value) { + + rowsLimit_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The read will stop after committing to N rows' worth of results. The
+     * default (zero) is to return all results.
+     * 
+ * + * int64 rows_limit = 4; + * + * @return This builder for chaining. + */ + public Builder clearRowsLimit() { + bitField0_ = (bitField0_ & ~0x00000040); + rowsLimit_ = 0L; + onChanged(); + return this; + } + + private int requestStatsView_ = 0; + + /** + * + * + *
+     * The view into RequestStats, as described above.
+     * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The enum numeric value on the wire for requestStatsView. + */ + @java.lang.Override + public int getRequestStatsViewValue() { + return requestStatsView_; + } + + /** + * + * + *
+     * The view into RequestStats, as described above.
+     * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @param value The enum numeric value on the wire for requestStatsView to set. + * @return This builder for chaining. + */ + public Builder setRequestStatsViewValue(int value) { + requestStatsView_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The view into RequestStats, as described above.
+     * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The requestStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest.RequestStatsView getRequestStatsView() { + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView result = + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.forNumber(requestStatsView_); + return result == null + ? com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The view into RequestStats, as described above.
+     * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @param value The requestStatsView to set. + * @return This builder for chaining. + */ + public Builder setRequestStatsView( + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + requestStatsView_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The view into RequestStats, as described above.
+     * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequestStatsView() { + bitField0_ = (bitField0_ & ~0x00000080); + requestStatsView_ = 0; + onChanged(); + return this; + } + + private boolean reversed_; + + /** + * + * + *
+     * Experimental API - Please note that this API is currently experimental
+     * and can change in the future.
+     *
+     * Return rows in lexiographical descending order of the row keys. The row
+     * contents will not be affected by this flag.
+     *
+     * Example result set:
+     *
+     * [
+     * {key: "k2", "f:col1": "v1", "f:col2": "v1"},
+     * {key: "k1", "f:col1": "v2", "f:col2": "v2"}
+     * ]
+     * 
+ * + * bool reversed = 7; + * + * @return The reversed. + */ + @java.lang.Override + public boolean getReversed() { + return reversed_; + } + + /** + * + * + *
+     * Experimental API - Please note that this API is currently experimental
+     * and can change in the future.
+     *
+     * Return rows in lexiographical descending order of the row keys. The row
+     * contents will not be affected by this flag.
+     *
+     * Example result set:
+     *
+     * [
+     * {key: "k2", "f:col1": "v1", "f:col2": "v1"},
+     * {key: "k1", "f:col1": "v2", "f:col2": "v2"}
+     * ]
+     * 
+ * + * bool reversed = 7; + * + * @param value The reversed to set. + * @return This builder for chaining. + */ + public Builder setReversed(boolean value) { + + reversed_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Experimental API - Please note that this API is currently experimental
+     * and can change in the future.
+     *
+     * Return rows in lexiographical descending order of the row keys. The row
+     * contents will not be affected by this flag.
+     *
+     * Example result set:
+     *
+     * [
+     * {key: "k2", "f:col1": "v1", "f:col2": "v1"},
+     * {key: "k1", "f:col1": "v2", "f:col2": "v2"}
+     * ]
+     * 
+ * + * bool reversed = 7; + * + * @return This builder for chaining. + */ + public Builder clearReversed() { + bitField0_ = (bitField0_ & ~0x00000100); + reversed_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadRowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadRowsRequest) + private static final com.google.bigtable.v2.ReadRowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadRowsRequest(); + } + + public static com.google.bigtable.v2.ReadRowsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRowsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadRowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java new file mode 100644 index 000000000000..b5d0dc2438a3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java @@ -0,0 +1,308 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadRowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadRowsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + java.lang.String getMaterializedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + com.google.protobuf.ByteString getMaterializedViewNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 5; + * + * @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 = 5; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return Whether the rows field is set. + */ + boolean hasRows(); + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + * + * @return The rows. + */ + com.google.bigtable.v2.RowSet getRows(); + + /** + * + * + *
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
+   * 
+ * + * .google.bigtable.v2.RowSet rows = 2; + */ + com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder(); + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return Whether the filter field is set. + */ + boolean hasFilter(); + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + * + * @return The filter. + */ + com.google.bigtable.v2.RowFilter getFilter(); + + /** + * + * + *
+   * The filter to apply to the contents of the specified row(s). If unset,
+   * reads the entirety of each row.
+   * 
+ * + * .google.bigtable.v2.RowFilter filter = 3; + */ + com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder(); + + /** + * + * + *
+   * The read will stop after committing to N rows' worth of results. The
+   * default (zero) is to return all results.
+   * 
+ * + * int64 rows_limit = 4; + * + * @return The rowsLimit. + */ + long getRowsLimit(); + + /** + * + * + *
+   * The view into RequestStats, as described above.
+   * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The enum numeric value on the wire for requestStatsView. + */ + int getRequestStatsViewValue(); + + /** + * + * + *
+   * The view into RequestStats, as described above.
+   * 
+ * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The requestStatsView. + */ + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView getRequestStatsView(); + + /** + * + * + *
+   * Experimental API - Please note that this API is currently experimental
+   * and can change in the future.
+   *
+   * Return rows in lexiographical descending order of the row keys. The row
+   * contents will not be affected by this flag.
+   *
+   * Example result set:
+   *
+   * [
+   * {key: "k2", "f:col1": "v1", "f:col2": "v1"},
+   * {key: "k1", "f:col1": "v2", "f:col2": "v2"}
+   * ]
+   * 
+ * + * bool reversed = 7; + * + * @return The reversed. + */ + boolean getReversed(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java new file mode 100644 index 000000000000..ff3dc5309f22 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java @@ -0,0 +1,3902 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.ReadRows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsResponse} + */ +@com.google.protobuf.Generated +public final class ReadRowsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadRowsResponse) + ReadRowsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadRowsResponse"); + } + + // Use ReadRowsResponse.newBuilder() to construct. + private ReadRowsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadRowsResponse() { + chunks_ = java.util.Collections.emptyList(); + lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsResponse.class, + com.google.bigtable.v2.ReadRowsResponse.Builder.class); + } + + public interface CellChunkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadRowsResponse.CellChunk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The row key for this chunk of data.  If the row key is empty,
+     * this CellChunk is a continuation of the same row as the previous
+     * CellChunk in the response stream, even if that CellChunk was in a
+     * previous ReadRowsResponse message.
+     * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return Whether the familyName field is set. + */ + boolean hasFamilyName(); + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return The familyName. + */ + com.google.protobuf.StringValue getFamilyName(); + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder(); + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return Whether the qualifier field is set. + */ + boolean hasQualifier(); + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return The qualifier. + */ + com.google.protobuf.BytesValue getQualifier(); + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder(); + + /** + * + * + *
+     * The cell's stored timestamp, which also uniquely identifies it
+     * within its column.  Values are always expressed in
+     * microseconds, but individual tables may set a coarser
+     * granularity to further restrict the allowed values. For
+     * example, a table which specifies millisecond granularity will
+     * only allow values of `timestamp_micros` which are multiples of
+     * 1000.  Timestamps are only set in the first CellChunk per cell
+     * (for cells split into multiple chunks).
+     * 
+ * + * int64 timestamp_micros = 4; + * + * @return The timestampMicros. + */ + long getTimestampMicros(); + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @return A list containing the labels. + */ + java.util.List getLabelsList(); + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @return The count of labels. + */ + int getLabelsCount(); + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + java.lang.String getLabels(int index); + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + com.google.protobuf.ByteString getLabelsBytes(int index); + + /** + * + * + *
+     * The value stored in the cell.  Cell values can be split across
+     * multiple CellChunks.  In that case only the value field will be
+     * set in CellChunks after the first: the timestamp and labels
+     * will only be present in the first CellChunk, even if the first
+     * CellChunk came in a previous ReadRowsResponse.
+     * 
+ * + * bytes value = 6; + * + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + * + * + *
+     * If this CellChunk is part of a chunked cell value and this is
+     * not the final chunk of that cell, value_size will be set to the
+     * total length of the cell value.  The client can use this size
+     * to pre-allocate memory to hold the full cell value.
+     * 
+ * + * int32 value_size = 7; + * + * @return The valueSize. + */ + int getValueSize(); + + /** + * + * + *
+     * Indicates that the client should drop all previous chunks for
+     * `row_key`, as it will be re-read from the beginning.
+     * 
+ * + * bool reset_row = 8; + * + * @return Whether the resetRow field is set. + */ + boolean hasResetRow(); + + /** + * + * + *
+     * Indicates that the client should drop all previous chunks for
+     * `row_key`, as it will be re-read from the beginning.
+     * 
+ * + * bool reset_row = 8; + * + * @return The resetRow. + */ + boolean getResetRow(); + + /** + * + * + *
+     * Indicates that the client can safely process all previous chunks for
+     * `row_key`, as its data has been fully read.
+     * 
+ * + * bool commit_row = 9; + * + * @return Whether the commitRow field is set. + */ + boolean hasCommitRow(); + + /** + * + * + *
+     * Indicates that the client can safely process all previous chunks for
+     * `row_key`, as its data has been fully read.
+     * 
+ * + * bool commit_row = 9; + * + * @return The commitRow. + */ + boolean getCommitRow(); + + com.google.bigtable.v2.ReadRowsResponse.CellChunk.RowStatusCase getRowStatusCase(); + } + + /** + * + * + *
+   * Specifies a piece of a row's contents returned as part of the read
+   * response stream.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsResponse.CellChunk} + */ + public static final class CellChunk extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadRowsResponse.CellChunk) + CellChunkOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CellChunk"); + } + + // Use CellChunk.newBuilder() to construct. + private CellChunk(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CellChunk() { + rowKey_ = com.google.protobuf.ByteString.EMPTY; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + value_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsResponse.CellChunk.class, + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder.class); + } + + private int bitField0_; + private int rowStatusCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object rowStatus_; + + public enum RowStatusCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RESET_ROW(8), + COMMIT_ROW(9), + ROWSTATUS_NOT_SET(0); + private final int value; + + private RowStatusCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RowStatusCase valueOf(int value) { + return forNumber(value); + } + + public static RowStatusCase forNumber(int value) { + switch (value) { + case 8: + return RESET_ROW; + case 9: + return COMMIT_ROW; + case 0: + return ROWSTATUS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RowStatusCase getRowStatusCase() { + return RowStatusCase.forNumber(rowStatusCase_); + } + + public static final int ROW_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The row key for this chunk of data.  If the row key is empty,
+     * this CellChunk is a continuation of the same row as the previous
+     * CellChunk in the response stream, even if that CellChunk was in a
+     * previous ReadRowsResponse message.
+     * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int FAMILY_NAME_FIELD_NUMBER = 2; + private com.google.protobuf.StringValue familyName_; + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return Whether the familyName field is set. + */ + @java.lang.Override + public boolean hasFamilyName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return The familyName. + */ + @java.lang.Override + public com.google.protobuf.StringValue getFamilyName() { + return familyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : familyName_; + } + + /** + * + * + *
+     * The column family name for this chunk of data.  If this message
+     * is not present this CellChunk is a continuation of the same column
+     * family as the previous CellChunk.  The empty string can occur as a
+     * column family name in a response so clients must check
+     * explicitly for the presence of this message, not just for
+     * `family_name.value` being non-empty.
+     * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + @java.lang.Override + public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { + return familyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : familyName_; + } + + public static final int QUALIFIER_FIELD_NUMBER = 3; + private com.google.protobuf.BytesValue qualifier_; + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return Whether the qualifier field is set. + */ + @java.lang.Override + public boolean hasQualifier() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return The qualifier. + */ + @java.lang.Override + public com.google.protobuf.BytesValue getQualifier() { + return qualifier_ == null ? com.google.protobuf.BytesValue.getDefaultInstance() : qualifier_; + } + + /** + * + * + *
+     * The column qualifier for this chunk of data.  If this message
+     * is not present, this CellChunk is a continuation of the same column
+     * as the previous CellChunk.  Column qualifiers may be empty so
+     * clients must check for the presence of this message, not just
+     * for `qualifier.value` being non-empty.
+     * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + @java.lang.Override + public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { + return qualifier_ == null ? com.google.protobuf.BytesValue.getDefaultInstance() : qualifier_; + } + + public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 4; + private long timestampMicros_ = 0L; + + /** + * + * + *
+     * The cell's stored timestamp, which also uniquely identifies it
+     * within its column.  Values are always expressed in
+     * microseconds, but individual tables may set a coarser
+     * granularity to further restrict the allowed values. For
+     * example, a table which specifies millisecond granularity will
+     * only allow values of `timestamp_micros` which are multiples of
+     * 1000.  Timestamps are only set in the first CellChunk per cell
+     * (for cells split into multiple chunks).
+     * 
+ * + * int64 timestamp_micros = 4; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + public static final int LABELS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @return A list containing the labels. + */ + public com.google.protobuf.ProtocolStringList getLabelsList() { + return labels_; + } + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @return The count of labels. + */ + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + public java.lang.String getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+     * Labels applied to the cell by a
+     * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+     * on the first CellChunk per cell.
+     * 
+ * + * repeated string labels = 5; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + public com.google.protobuf.ByteString getLabelsBytes(int index) { + return labels_.getByteString(index); + } + + public static final int VALUE_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The value stored in the cell.  Cell values can be split across
+     * multiple CellChunks.  In that case only the value field will be
+     * set in CellChunks after the first: the timestamp and labels
+     * will only be present in the first CellChunk, even if the first
+     * CellChunk came in a previous ReadRowsResponse.
+     * 
+ * + * bytes value = 6; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + public static final int VALUE_SIZE_FIELD_NUMBER = 7; + private int valueSize_ = 0; + + /** + * + * + *
+     * If this CellChunk is part of a chunked cell value and this is
+     * not the final chunk of that cell, value_size will be set to the
+     * total length of the cell value.  The client can use this size
+     * to pre-allocate memory to hold the full cell value.
+     * 
+ * + * int32 value_size = 7; + * + * @return The valueSize. + */ + @java.lang.Override + public int getValueSize() { + return valueSize_; + } + + public static final int RESET_ROW_FIELD_NUMBER = 8; + + /** + * + * + *
+     * Indicates that the client should drop all previous chunks for
+     * `row_key`, as it will be re-read from the beginning.
+     * 
+ * + * bool reset_row = 8; + * + * @return Whether the resetRow field is set. + */ + @java.lang.Override + public boolean hasResetRow() { + return rowStatusCase_ == 8; + } + + /** + * + * + *
+     * Indicates that the client should drop all previous chunks for
+     * `row_key`, as it will be re-read from the beginning.
+     * 
+ * + * bool reset_row = 8; + * + * @return The resetRow. + */ + @java.lang.Override + public boolean getResetRow() { + if (rowStatusCase_ == 8) { + return (java.lang.Boolean) rowStatus_; + } + return false; + } + + public static final int COMMIT_ROW_FIELD_NUMBER = 9; + + /** + * + * + *
+     * Indicates that the client can safely process all previous chunks for
+     * `row_key`, as its data has been fully read.
+     * 
+ * + * bool commit_row = 9; + * + * @return Whether the commitRow field is set. + */ + @java.lang.Override + public boolean hasCommitRow() { + return rowStatusCase_ == 9; + } + + /** + * + * + *
+     * Indicates that the client can safely process all previous chunks for
+     * `row_key`, as its data has been fully read.
+     * 
+ * + * bool commit_row = 9; + * + * @return The commitRow. + */ + @java.lang.Override + public boolean getCommitRow() { + if (rowStatusCase_ == 9) { + return (java.lang.Boolean) rowStatus_; + } + return false; + } + + 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 (!rowKey_.isEmpty()) { + output.writeBytes(1, rowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFamilyName()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getQualifier()); + } + if (timestampMicros_ != 0L) { + output.writeInt64(4, timestampMicros_); + } + for (int i = 0; i < labels_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, labels_.getRaw(i)); + } + if (!value_.isEmpty()) { + output.writeBytes(6, value_); + } + if (valueSize_ != 0) { + output.writeInt32(7, valueSize_); + } + if (rowStatusCase_ == 8) { + output.writeBool(8, (boolean) ((java.lang.Boolean) rowStatus_)); + } + if (rowStatusCase_ == 9) { + output.writeBool(9, (boolean) ((java.lang.Boolean) rowStatus_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, rowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFamilyName()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQualifier()); + } + if (timestampMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, timestampMicros_); + } + { + int dataSize = 0; + for (int i = 0; i < labels_.size(); i++) { + dataSize += computeStringSizeNoTag(labels_.getRaw(i)); + } + size += dataSize; + size += 1 * getLabelsList().size(); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(6, value_); + } + if (valueSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, valueSize_); + } + if (rowStatusCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 8, (boolean) ((java.lang.Boolean) rowStatus_)); + } + if (rowStatusCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 9, (boolean) ((java.lang.Boolean) rowStatus_)); + } + size += getUnknownFields().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.ReadRowsResponse.CellChunk)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadRowsResponse.CellChunk other = + (com.google.bigtable.v2.ReadRowsResponse.CellChunk) obj; + + if (!getRowKey().equals(other.getRowKey())) return false; + if (hasFamilyName() != other.hasFamilyName()) return false; + if (hasFamilyName()) { + if (!getFamilyName().equals(other.getFamilyName())) return false; + } + if (hasQualifier() != other.hasQualifier()) return false; + if (hasQualifier()) { + if (!getQualifier().equals(other.getQualifier())) return false; + } + if (getTimestampMicros() != other.getTimestampMicros()) return false; + if (!getLabelsList().equals(other.getLabelsList())) return false; + if (!getValue().equals(other.getValue())) return false; + if (getValueSize() != other.getValueSize()) return false; + if (!getRowStatusCase().equals(other.getRowStatusCase())) return false; + switch (rowStatusCase_) { + case 8: + if (getResetRow() != other.getResetRow()) return false; + break; + case 9: + if (getCommitRow() != other.getCommitRow()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + if (hasFamilyName()) { + hash = (37 * hash) + FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFamilyName().hashCode(); + } + if (hasQualifier()) { + hash = (37 * hash) + QUALIFIER_FIELD_NUMBER; + hash = (53 * hash) + getQualifier().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestampMicros()); + if (getLabelsCount() > 0) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + getLabelsList().hashCode(); + } + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + VALUE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getValueSize(); + switch (rowStatusCase_) { + case 8: + hash = (37 * hash) + RESET_ROW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getResetRow()); + break; + case 9: + hash = (37 * hash) + COMMIT_ROW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCommitRow()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk 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.ReadRowsResponse.CellChunk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk 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.ReadRowsResponse.CellChunk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadRowsResponse.CellChunk 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Specifies a piece of a row's contents returned as part of the read
+     * response stream.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsResponse.CellChunk} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadRowsResponse.CellChunk) + com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsResponse.CellChunk.class, + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadRowsResponse.CellChunk.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFamilyNameFieldBuilder(); + internalGetQualifierFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + familyName_ = null; + if (familyNameBuilder_ != null) { + familyNameBuilder_.dispose(); + familyNameBuilder_ = null; + } + qualifier_ = null; + if (qualifierBuilder_ != null) { + qualifierBuilder_.dispose(); + qualifierBuilder_ = null; + } + timestampMicros_ = 0L; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + value_ = com.google.protobuf.ByteString.EMPTY; + valueSize_ = 0; + rowStatusCase_ = 0; + rowStatus_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse.CellChunk getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse.CellChunk build() { + com.google.bigtable.v2.ReadRowsResponse.CellChunk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse.CellChunk buildPartial() { + com.google.bigtable.v2.ReadRowsResponse.CellChunk result = + new com.google.bigtable.v2.ReadRowsResponse.CellChunk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ReadRowsResponse.CellChunk result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.familyName_ = + familyNameBuilder_ == null ? familyName_ : familyNameBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.qualifier_ = qualifierBuilder_ == null ? qualifier_ : qualifierBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.timestampMicros_ = timestampMicros_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + labels_.makeImmutable(); + result.labels_ = labels_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.valueSize_ = valueSize_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadRowsResponse.CellChunk result) { + result.rowStatusCase_ = rowStatusCase_; + result.rowStatus_ = this.rowStatus_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadRowsResponse.CellChunk) { + return mergeFrom((com.google.bigtable.v2.ReadRowsResponse.CellChunk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse.CellChunk other) { + if (other == com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()) + return this; + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (other.hasFamilyName()) { + mergeFamilyName(other.getFamilyName()); + } + if (other.hasQualifier()) { + mergeQualifier(other.getQualifier()); + } + if (other.getTimestampMicros() != 0L) { + setTimestampMicros(other.getTimestampMicros()); + } + if (!other.labels_.isEmpty()) { + if (labels_.isEmpty()) { + labels_ = other.labels_; + bitField0_ |= 0x00000010; + } else { + ensureLabelsIsMutable(); + labels_.addAll(other.labels_); + } + onChanged(); + } + if (!other.getValue().isEmpty()) { + setValue(other.getValue()); + } + if (other.getValueSize() != 0) { + setValueSize(other.getValueSize()); + } + switch (other.getRowStatusCase()) { + case RESET_ROW: + { + setResetRow(other.getResetRow()); + break; + } + case COMMIT_ROW: + { + setCommitRow(other.getCommitRow()); + break; + } + case ROWSTATUS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetFamilyNameFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetQualifierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + timestampMicros_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLabelsIsMutable(); + labels_.add(s); + break; + } // case 42 + case 50: + { + value_ = input.readBytes(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + valueSize_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + rowStatus_ = input.readBool(); + rowStatusCase_ = 8; + break; + } // case 64 + case 72: + { + rowStatus_ = input.readBool(); + rowStatusCase_ = 9; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int rowStatusCase_ = 0; + private java.lang.Object rowStatus_; + + public RowStatusCase getRowStatusCase() { + return RowStatusCase.forNumber(rowStatusCase_); + } + + public Builder clearRowStatus() { + rowStatusCase_ = 0; + rowStatus_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The row key for this chunk of data.  If the row key is empty,
+       * this CellChunk is a continuation of the same row as the previous
+       * CellChunk in the response stream, even if that CellChunk was in a
+       * previous ReadRowsResponse message.
+       * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+       * The row key for this chunk of data.  If the row key is empty,
+       * this CellChunk is a continuation of the same row as the previous
+       * CellChunk in the response stream, even if that CellChunk was in a
+       * previous ReadRowsResponse message.
+       * 
+ * + * bytes row_key = 1; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The row key for this chunk of data.  If the row key is empty,
+       * this CellChunk is a continuation of the same row as the previous
+       * CellChunk in the response stream, even if that CellChunk was in a
+       * previous ReadRowsResponse message.
+       * 
+ * + * bytes row_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000001); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private com.google.protobuf.StringValue familyName_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + familyNameBuilder_; + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return Whether the familyName field is set. + */ + public boolean hasFamilyName() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + * + * @return The familyName. + */ + public com.google.protobuf.StringValue getFamilyName() { + if (familyNameBuilder_ == null) { + return familyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : familyName_; + } else { + return familyNameBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public Builder setFamilyName(com.google.protobuf.StringValue value) { + if (familyNameBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + familyName_ = value; + } else { + familyNameBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public Builder setFamilyName(com.google.protobuf.StringValue.Builder builderForValue) { + if (familyNameBuilder_ == null) { + familyName_ = builderForValue.build(); + } else { + familyNameBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public Builder mergeFamilyName(com.google.protobuf.StringValue value) { + if (familyNameBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && familyName_ != null + && familyName_ != com.google.protobuf.StringValue.getDefaultInstance()) { + getFamilyNameBuilder().mergeFrom(value); + } else { + familyName_ = value; + } + } else { + familyNameBuilder_.mergeFrom(value); + } + if (familyName_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public Builder clearFamilyName() { + bitField0_ = (bitField0_ & ~0x00000002); + familyName_ = null; + if (familyNameBuilder_ != null) { + familyNameBuilder_.dispose(); + familyNameBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public com.google.protobuf.StringValue.Builder getFamilyNameBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFamilyNameFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { + if (familyNameBuilder_ != null) { + return familyNameBuilder_.getMessageOrBuilder(); + } else { + return familyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : familyName_; + } + } + + /** + * + * + *
+       * The column family name for this chunk of data.  If this message
+       * is not present this CellChunk is a continuation of the same column
+       * family as the previous CellChunk.  The empty string can occur as a
+       * column family name in a response so clients must check
+       * explicitly for the presence of this message, not just for
+       * `family_name.value` being non-empty.
+       * 
+ * + * .google.protobuf.StringValue family_name = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder> + internalGetFamilyNameFieldBuilder() { + if (familyNameBuilder_ == null) { + familyNameBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.StringValue, + com.google.protobuf.StringValue.Builder, + com.google.protobuf.StringValueOrBuilder>( + getFamilyName(), getParentForChildren(), isClean()); + familyName_ = null; + } + return familyNameBuilder_; + } + + private com.google.protobuf.BytesValue qualifier_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BytesValue, + com.google.protobuf.BytesValue.Builder, + com.google.protobuf.BytesValueOrBuilder> + qualifierBuilder_; + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return Whether the qualifier field is set. + */ + public boolean hasQualifier() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + * + * @return The qualifier. + */ + public com.google.protobuf.BytesValue getQualifier() { + if (qualifierBuilder_ == null) { + return qualifier_ == null + ? com.google.protobuf.BytesValue.getDefaultInstance() + : qualifier_; + } else { + return qualifierBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public Builder setQualifier(com.google.protobuf.BytesValue value) { + if (qualifierBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + qualifier_ = value; + } else { + qualifierBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public Builder setQualifier(com.google.protobuf.BytesValue.Builder builderForValue) { + if (qualifierBuilder_ == null) { + qualifier_ = builderForValue.build(); + } else { + qualifierBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public Builder mergeQualifier(com.google.protobuf.BytesValue value) { + if (qualifierBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && qualifier_ != null + && qualifier_ != com.google.protobuf.BytesValue.getDefaultInstance()) { + getQualifierBuilder().mergeFrom(value); + } else { + qualifier_ = value; + } + } else { + qualifierBuilder_.mergeFrom(value); + } + if (qualifier_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public Builder clearQualifier() { + bitField0_ = (bitField0_ & ~0x00000004); + qualifier_ = null; + if (qualifierBuilder_ != null) { + qualifierBuilder_.dispose(); + qualifierBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public com.google.protobuf.BytesValue.Builder getQualifierBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetQualifierFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { + if (qualifierBuilder_ != null) { + return qualifierBuilder_.getMessageOrBuilder(); + } else { + return qualifier_ == null + ? com.google.protobuf.BytesValue.getDefaultInstance() + : qualifier_; + } + } + + /** + * + * + *
+       * The column qualifier for this chunk of data.  If this message
+       * is not present, this CellChunk is a continuation of the same column
+       * as the previous CellChunk.  Column qualifiers may be empty so
+       * clients must check for the presence of this message, not just
+       * for `qualifier.value` being non-empty.
+       * 
+ * + * .google.protobuf.BytesValue qualifier = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BytesValue, + com.google.protobuf.BytesValue.Builder, + com.google.protobuf.BytesValueOrBuilder> + internalGetQualifierFieldBuilder() { + if (qualifierBuilder_ == null) { + qualifierBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BytesValue, + com.google.protobuf.BytesValue.Builder, + com.google.protobuf.BytesValueOrBuilder>( + getQualifier(), getParentForChildren(), isClean()); + qualifier_ = null; + } + return qualifierBuilder_; + } + + private long timestampMicros_; + + /** + * + * + *
+       * The cell's stored timestamp, which also uniquely identifies it
+       * within its column.  Values are always expressed in
+       * microseconds, but individual tables may set a coarser
+       * granularity to further restrict the allowed values. For
+       * example, a table which specifies millisecond granularity will
+       * only allow values of `timestamp_micros` which are multiples of
+       * 1000.  Timestamps are only set in the first CellChunk per cell
+       * (for cells split into multiple chunks).
+       * 
+ * + * int64 timestamp_micros = 4; + * + * @return The timestampMicros. + */ + @java.lang.Override + public long getTimestampMicros() { + return timestampMicros_; + } + + /** + * + * + *
+       * The cell's stored timestamp, which also uniquely identifies it
+       * within its column.  Values are always expressed in
+       * microseconds, but individual tables may set a coarser
+       * granularity to further restrict the allowed values. For
+       * example, a table which specifies millisecond granularity will
+       * only allow values of `timestamp_micros` which are multiples of
+       * 1000.  Timestamps are only set in the first CellChunk per cell
+       * (for cells split into multiple chunks).
+       * 
+ * + * int64 timestamp_micros = 4; + * + * @param value The timestampMicros to set. + * @return This builder for chaining. + */ + public Builder setTimestampMicros(long value) { + + timestampMicros_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The cell's stored timestamp, which also uniquely identifies it
+       * within its column.  Values are always expressed in
+       * microseconds, but individual tables may set a coarser
+       * granularity to further restrict the allowed values. For
+       * example, a table which specifies millisecond granularity will
+       * only allow values of `timestamp_micros` which are multiples of
+       * 1000.  Timestamps are only set in the first CellChunk per cell
+       * (for cells split into multiple chunks).
+       * 
+ * + * int64 timestamp_micros = 4; + * + * @return This builder for chaining. + */ + public Builder clearTimestampMicros() { + bitField0_ = (bitField0_ & ~0x00000008); + timestampMicros_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureLabelsIsMutable() { + if (!labels_.isModifiable()) { + labels_ = new com.google.protobuf.LazyStringArrayList(labels_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @return A list containing the labels. + */ + public com.google.protobuf.ProtocolStringList getLabelsList() { + labels_.makeImmutable(); + return labels_; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @return The count of labels. + */ + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param index The index of the element to return. + * @return The labels at the given index. + */ + public java.lang.String getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param index The index of the value to return. + * @return The bytes of the labels at the given index. + */ + public com.google.protobuf.ByteString getLabelsBytes(int index) { + return labels_.getByteString(index); + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param index The index to set the value at. + * @param value The labels to set. + * @return This builder for chaining. + */ + public Builder setLabels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param value The labels to add. + * @return This builder for chaining. + */ + public Builder addLabels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param values The labels to add. + * @return This builder for chaining. + */ + public Builder addAllLabels(java.lang.Iterable values) { + ensureLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @return This builder for chaining. + */ + public Builder clearLabels() { + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Labels applied to the cell by a
+       * [RowFilter][google.bigtable.v2.RowFilter].  Labels are only set
+       * on the first CellChunk per cell.
+       * 
+ * + * repeated string labels = 5; + * + * @param value The bytes of the labels to add. + * @return This builder for chaining. + */ + public Builder addLabelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLabelsIsMutable(); + labels_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The value stored in the cell.  Cell values can be split across
+       * multiple CellChunks.  In that case only the value field will be
+       * set in CellChunks after the first: the timestamp and labels
+       * will only be present in the first CellChunk, even if the first
+       * CellChunk came in a previous ReadRowsResponse.
+       * 
+ * + * bytes value = 6; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + /** + * + * + *
+       * The value stored in the cell.  Cell values can be split across
+       * multiple CellChunks.  In that case only the value field will be
+       * set in CellChunks after the first: the timestamp and labels
+       * will only be present in the first CellChunk, even if the first
+       * CellChunk came in a previous ReadRowsResponse.
+       * 
+ * + * bytes value = 6; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * The value stored in the cell.  Cell values can be split across
+       * multiple CellChunks.  In that case only the value field will be
+       * set in CellChunks after the first: the timestamp and labels
+       * will only be present in the first CellChunk, even if the first
+       * CellChunk came in a previous ReadRowsResponse.
+       * 
+ * + * bytes value = 6; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000020); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + private int valueSize_; + + /** + * + * + *
+       * If this CellChunk is part of a chunked cell value and this is
+       * not the final chunk of that cell, value_size will be set to the
+       * total length of the cell value.  The client can use this size
+       * to pre-allocate memory to hold the full cell value.
+       * 
+ * + * int32 value_size = 7; + * + * @return The valueSize. + */ + @java.lang.Override + public int getValueSize() { + return valueSize_; + } + + /** + * + * + *
+       * If this CellChunk is part of a chunked cell value and this is
+       * not the final chunk of that cell, value_size will be set to the
+       * total length of the cell value.  The client can use this size
+       * to pre-allocate memory to hold the full cell value.
+       * 
+ * + * int32 value_size = 7; + * + * @param value The valueSize to set. + * @return This builder for chaining. + */ + public Builder setValueSize(int value) { + + valueSize_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * If this CellChunk is part of a chunked cell value and this is
+       * not the final chunk of that cell, value_size will be set to the
+       * total length of the cell value.  The client can use this size
+       * to pre-allocate memory to hold the full cell value.
+       * 
+ * + * int32 value_size = 7; + * + * @return This builder for chaining. + */ + public Builder clearValueSize() { + bitField0_ = (bitField0_ & ~0x00000040); + valueSize_ = 0; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates that the client should drop all previous chunks for
+       * `row_key`, as it will be re-read from the beginning.
+       * 
+ * + * bool reset_row = 8; + * + * @return Whether the resetRow field is set. + */ + public boolean hasResetRow() { + return rowStatusCase_ == 8; + } + + /** + * + * + *
+       * Indicates that the client should drop all previous chunks for
+       * `row_key`, as it will be re-read from the beginning.
+       * 
+ * + * bool reset_row = 8; + * + * @return The resetRow. + */ + public boolean getResetRow() { + if (rowStatusCase_ == 8) { + return (java.lang.Boolean) rowStatus_; + } + return false; + } + + /** + * + * + *
+       * Indicates that the client should drop all previous chunks for
+       * `row_key`, as it will be re-read from the beginning.
+       * 
+ * + * bool reset_row = 8; + * + * @param value The resetRow to set. + * @return This builder for chaining. + */ + public Builder setResetRow(boolean value) { + + rowStatusCase_ = 8; + rowStatus_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates that the client should drop all previous chunks for
+       * `row_key`, as it will be re-read from the beginning.
+       * 
+ * + * bool reset_row = 8; + * + * @return This builder for chaining. + */ + public Builder clearResetRow() { + if (rowStatusCase_ == 8) { + rowStatusCase_ = 0; + rowStatus_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Indicates that the client can safely process all previous chunks for
+       * `row_key`, as its data has been fully read.
+       * 
+ * + * bool commit_row = 9; + * + * @return Whether the commitRow field is set. + */ + public boolean hasCommitRow() { + return rowStatusCase_ == 9; + } + + /** + * + * + *
+       * Indicates that the client can safely process all previous chunks for
+       * `row_key`, as its data has been fully read.
+       * 
+ * + * bool commit_row = 9; + * + * @return The commitRow. + */ + public boolean getCommitRow() { + if (rowStatusCase_ == 9) { + return (java.lang.Boolean) rowStatus_; + } + return false; + } + + /** + * + * + *
+       * Indicates that the client can safely process all previous chunks for
+       * `row_key`, as its data has been fully read.
+       * 
+ * + * bool commit_row = 9; + * + * @param value The commitRow to set. + * @return This builder for chaining. + */ + public Builder setCommitRow(boolean value) { + + rowStatusCase_ = 9; + rowStatus_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates that the client can safely process all previous chunks for
+       * `row_key`, as its data has been fully read.
+       * 
+ * + * bool commit_row = 9; + * + * @return This builder for chaining. + */ + public Builder clearCommitRow() { + if (rowStatusCase_ == 9) { + rowStatusCase_ = 0; + rowStatus_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadRowsResponse.CellChunk) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadRowsResponse.CellChunk) + private static final com.google.bigtable.v2.ReadRowsResponse.CellChunk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadRowsResponse.CellChunk(); + } + + public static com.google.bigtable.v2.ReadRowsResponse.CellChunk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CellChunk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadRowsResponse.CellChunk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CHUNKS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List chunks_; + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + @java.lang.Override + public java.util.List getChunksList() { + return chunks_; + } + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + @java.lang.Override + public java.util.List + getChunksOrBuilderList() { + return chunks_; + } + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + @java.lang.Override + public int getChunksCount() { + return chunks_.size(); + } + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index) { + return chunks_.get(index); + } + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBuilder(int index) { + return chunks_.get(index); + } + + public static final int LAST_SCANNED_ROW_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Optionally the server might return the row key of the last row it
+   * has scanned.  The client can use this to construct a more
+   * efficient retry request if needed: any row keys or portions of
+   * ranges less than this row key can be dropped from the request.
+   * This is primarily useful for cases where the server has read a
+   * lot of data that was filtered out since the last committed row
+   * key, allowing the client to skip that work on a retry.
+   * 
+ * + * bytes last_scanned_row_key = 2; + * + * @return The lastScannedRowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastScannedRowKey() { + return lastScannedRowKey_; + } + + public static final int REQUEST_STATS_FIELD_NUMBER = 3; + private com.google.bigtable.v2.RequestStats requestStats_; + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return Whether the requestStats field is set. + */ + @java.lang.Override + public boolean hasRequestStats() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return The requestStats. + */ + @java.lang.Override + public com.google.bigtable.v2.RequestStats getRequestStats() { + return requestStats_ == null + ? com.google.bigtable.v2.RequestStats.getDefaultInstance() + : requestStats_; + } + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RequestStatsOrBuilder getRequestStatsOrBuilder() { + return requestStats_ == null + ? com.google.bigtable.v2.RequestStats.getDefaultInstance() + : requestStats_; + } + + 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 { + for (int i = 0; i < chunks_.size(); i++) { + output.writeMessage(1, chunks_.get(i)); + } + if (!lastScannedRowKey_.isEmpty()) { + output.writeBytes(2, lastScannedRowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRequestStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < chunks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, chunks_.get(i)); + } + if (!lastScannedRowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, lastScannedRowKey_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestStats()); + } + size += getUnknownFields().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.ReadRowsResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ReadRowsResponse other = (com.google.bigtable.v2.ReadRowsResponse) obj; + + if (!getChunksList().equals(other.getChunksList())) return false; + if (!getLastScannedRowKey().equals(other.getLastScannedRowKey())) return false; + if (hasRequestStats() != other.hasRequestStats()) return false; + if (hasRequestStats()) { + if (!getRequestStats().equals(other.getRequestStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getChunksCount() > 0) { + hash = (37 * hash) + CHUNKS_FIELD_NUMBER; + hash = (53 * hash) + getChunksList().hashCode(); + } + hash = (37 * hash) + LAST_SCANNED_ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getLastScannedRowKey().hashCode(); + if (hasRequestStats()) { + hash = (37 * hash) + REQUEST_STATS_FIELD_NUMBER; + hash = (53 * hash) + getRequestStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse 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.ReadRowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse 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.ReadRowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ReadRowsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ReadRowsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.ReadRows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ReadRowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ReadRowsResponse) + com.google.bigtable.v2.ReadRowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ReadRowsResponse.class, + com.google.bigtable.v2.ReadRowsResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ReadRowsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetChunksFieldBuilder(); + internalGetRequestStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (chunksBuilder_ == null) { + chunks_ = java.util.Collections.emptyList(); + } else { + chunks_ = null; + chunksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; + requestStats_ = null; + if (requestStatsBuilder_ != null) { + requestStatsBuilder_.dispose(); + requestStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_ReadRowsResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ReadRowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse build() { + com.google.bigtable.v2.ReadRowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ReadRowsResponse buildPartial() { + com.google.bigtable.v2.ReadRowsResponse result = + new com.google.bigtable.v2.ReadRowsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.ReadRowsResponse result) { + if (chunksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + chunks_ = java.util.Collections.unmodifiableList(chunks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.chunks_ = chunks_; + } else { + result.chunks_ = chunksBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.ReadRowsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.lastScannedRowKey_ = lastScannedRowKey_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestStats_ = + requestStatsBuilder_ == null ? requestStats_ : requestStatsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ReadRowsResponse) { + return mergeFrom((com.google.bigtable.v2.ReadRowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse other) { + if (other == com.google.bigtable.v2.ReadRowsResponse.getDefaultInstance()) return this; + if (chunksBuilder_ == null) { + if (!other.chunks_.isEmpty()) { + if (chunks_.isEmpty()) { + chunks_ = other.chunks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChunksIsMutable(); + chunks_.addAll(other.chunks_); + } + onChanged(); + } + } else { + if (!other.chunks_.isEmpty()) { + if (chunksBuilder_.isEmpty()) { + chunksBuilder_.dispose(); + chunksBuilder_ = null; + chunks_ = other.chunks_; + bitField0_ = (bitField0_ & ~0x00000001); + chunksBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetChunksFieldBuilder() + : null; + } else { + chunksBuilder_.addAllMessages(other.chunks_); + } + } + } + if (!other.getLastScannedRowKey().isEmpty()) { + setLastScannedRowKey(other.getLastScannedRowKey()); + } + if (other.hasRequestStats()) { + mergeRequestStats(other.getRequestStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.ReadRowsResponse.CellChunk m = + input.readMessage( + com.google.bigtable.v2.ReadRowsResponse.CellChunk.parser(), + extensionRegistry); + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(m); + } else { + chunksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + lastScannedRowKey_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetRequestStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List chunks_ = + java.util.Collections.emptyList(); + + private void ensureChunksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + chunks_ = + new java.util.ArrayList(chunks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadRowsResponse.CellChunk, + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, + com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder> + chunksBuilder_; + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public java.util.List getChunksList() { + if (chunksBuilder_ == null) { + return java.util.Collections.unmodifiableList(chunks_); + } else { + return chunksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public int getChunksCount() { + if (chunksBuilder_ == null) { + return chunks_.size(); + } else { + return chunksBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index) { + if (chunksBuilder_ == null) { + return chunks_.get(index); + } else { + return chunksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder setChunks(int index, com.google.bigtable.v2.ReadRowsResponse.CellChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.set(index, value); + onChanged(); + } else { + chunksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder setChunks( + int index, com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.set(index, builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder addChunks(com.google.bigtable.v2.ReadRowsResponse.CellChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.add(value); + onChanged(); + } else { + chunksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder addChunks(int index, com.google.bigtable.v2.ReadRowsResponse.CellChunk value) { + if (chunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunksIsMutable(); + chunks_.add(index, value); + onChanged(); + } else { + chunksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder addChunks( + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder addChunks( + int index, com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder builderForValue) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.add(index, builderForValue.build()); + onChanged(); + } else { + chunksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder addAllChunks( + java.lang.Iterable values) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, chunks_); + onChanged(); + } else { + chunksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder clearChunks() { + if (chunksBuilder_ == null) { + chunks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + chunksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public Builder removeChunks(int index) { + if (chunksBuilder_ == null) { + ensureChunksIsMutable(); + chunks_.remove(index); + onChanged(); + } else { + chunksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder getChunksBuilder(int index) { + return internalGetChunksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBuilder( + int index) { + if (chunksBuilder_ == null) { + return chunks_.get(index); + } else { + return chunksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public java.util.List + getChunksOrBuilderList() { + if (chunksBuilder_ != null) { + return chunksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(chunks_); + } + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilder() { + return internalGetChunksFieldBuilder() + .addBuilder(com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()); + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilder(int index) { + return internalGetChunksFieldBuilder() + .addBuilder( + index, com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()); + } + + /** + * + * + *
+     * A collection of a row's contents as part of the read request.
+     * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + public java.util.List + getChunksBuilderList() { + return internalGetChunksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadRowsResponse.CellChunk, + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, + com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder> + internalGetChunksFieldBuilder() { + if (chunksBuilder_ == null) { + chunksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.ReadRowsResponse.CellChunk, + com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, + com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder>( + chunks_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + chunks_ = null; + } + return chunksBuilder_; + } + + private com.google.protobuf.ByteString lastScannedRowKey_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Optionally the server might return the row key of the last row it
+     * has scanned.  The client can use this to construct a more
+     * efficient retry request if needed: any row keys or portions of
+     * ranges less than this row key can be dropped from the request.
+     * This is primarily useful for cases where the server has read a
+     * lot of data that was filtered out since the last committed row
+     * key, allowing the client to skip that work on a retry.
+     * 
+ * + * bytes last_scanned_row_key = 2; + * + * @return The lastScannedRowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastScannedRowKey() { + return lastScannedRowKey_; + } + + /** + * + * + *
+     * Optionally the server might return the row key of the last row it
+     * has scanned.  The client can use this to construct a more
+     * efficient retry request if needed: any row keys or portions of
+     * ranges less than this row key can be dropped from the request.
+     * This is primarily useful for cases where the server has read a
+     * lot of data that was filtered out since the last committed row
+     * key, allowing the client to skip that work on a retry.
+     * 
+ * + * bytes last_scanned_row_key = 2; + * + * @param value The lastScannedRowKey to set. + * @return This builder for chaining. + */ + public Builder setLastScannedRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + lastScannedRowKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optionally the server might return the row key of the last row it
+     * has scanned.  The client can use this to construct a more
+     * efficient retry request if needed: any row keys or portions of
+     * ranges less than this row key can be dropped from the request.
+     * This is primarily useful for cases where the server has read a
+     * lot of data that was filtered out since the last committed row
+     * key, allowing the client to skip that work on a retry.
+     * 
+ * + * bytes last_scanned_row_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearLastScannedRowKey() { + bitField0_ = (bitField0_ & ~0x00000002); + lastScannedRowKey_ = getDefaultInstance().getLastScannedRowKey(); + onChanged(); + return this; + } + + private com.google.bigtable.v2.RequestStats requestStats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + requestStatsBuilder_; + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return Whether the requestStats field is set. + */ + public boolean hasRequestStats() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return The requestStats. + */ + public com.google.bigtable.v2.RequestStats getRequestStats() { + if (requestStatsBuilder_ == null) { + return requestStats_ == null + ? com.google.bigtable.v2.RequestStats.getDefaultInstance() + : requestStats_; + } else { + return requestStatsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public Builder setRequestStats(com.google.bigtable.v2.RequestStats value) { + if (requestStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestStats_ = value; + } else { + requestStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public Builder setRequestStats(com.google.bigtable.v2.RequestStats.Builder builderForValue) { + if (requestStatsBuilder_ == null) { + requestStats_ = builderForValue.build(); + } else { + requestStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public Builder mergeRequestStats(com.google.bigtable.v2.RequestStats value) { + if (requestStatsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && requestStats_ != null + && requestStats_ != com.google.bigtable.v2.RequestStats.getDefaultInstance()) { + getRequestStatsBuilder().mergeFrom(value); + } else { + requestStats_ = value; + } + } else { + requestStatsBuilder_.mergeFrom(value); + } + if (requestStats_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public Builder clearRequestStats() { + bitField0_ = (bitField0_ & ~0x00000004); + requestStats_ = null; + if (requestStatsBuilder_ != null) { + requestStatsBuilder_.dispose(); + requestStatsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public com.google.bigtable.v2.RequestStats.Builder getRequestStatsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRequestStatsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public com.google.bigtable.v2.RequestStatsOrBuilder getRequestStatsOrBuilder() { + if (requestStatsBuilder_ != null) { + return requestStatsBuilder_.getMessageOrBuilder(); + } else { + return requestStats_ == null + ? com.google.bigtable.v2.RequestStats.getDefaultInstance() + : requestStats_; + } + } + + /** + * + * + *
+     * If requested, return enhanced query performance statistics. The field
+     * request_stats is empty in a streamed response unless the ReadRowsResponse
+     * message contains request_stats in the last message of the stream. Always
+     * returned when requested, even when the read request returns an empty
+     * response.
+     * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + internalGetRequestStatsFieldBuilder() { + if (requestStatsBuilder_ == null) { + requestStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder>( + getRequestStats(), getParentForChildren(), isClean()); + requestStats_ = null; + } + return requestStatsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadRowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ReadRowsResponse) + private static final com.google.bigtable.v2.ReadRowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ReadRowsResponse(); + } + + public static com.google.bigtable.v2.ReadRowsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadRowsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReadRowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java new file mode 100644 index 000000000000..a1202a4020e6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ReadRowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ReadRowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + java.util.List getChunksList(); + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index); + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + int getChunksCount(); + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + java.util.List + getChunksOrBuilderList(); + + /** + * + * + *
+   * A collection of a row's contents as part of the read request.
+   * 
+ * + * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; + */ + com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBuilder(int index); + + /** + * + * + *
+   * Optionally the server might return the row key of the last row it
+   * has scanned.  The client can use this to construct a more
+   * efficient retry request if needed: any row keys or portions of
+   * ranges less than this row key can be dropped from the request.
+   * This is primarily useful for cases where the server has read a
+   * lot of data that was filtered out since the last committed row
+   * key, allowing the client to skip that work on a retry.
+   * 
+ * + * bytes last_scanned_row_key = 2; + * + * @return The lastScannedRowKey. + */ + com.google.protobuf.ByteString getLastScannedRowKey(); + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return Whether the requestStats field is set. + */ + boolean hasRequestStats(); + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return The requestStats. + */ + com.google.bigtable.v2.RequestStats getRequestStats(); + + /** + * + * + *
+   * If requested, return enhanced query performance statistics. The field
+   * request_stats is empty in a streamed response unless the ReadRowsResponse
+   * message contains request_stats in the last message of the stream. Always
+   * returned when requested, even when the read request returns an empty
+   * response.
+   * 
+ * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + com.google.bigtable.v2.RequestStatsOrBuilder getRequestStatsOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java new file mode 100644 index 000000000000..c84b987d3e1c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java @@ -0,0 +1,897 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * RequestLatencyStats provides a measurement of the latency of the request as
+ * it interacts with different systems over its lifetime, e.g. how long the
+ * request took to execute within a frontend server.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RequestLatencyStats} + */ +@com.google.protobuf.Generated +public final class RequestLatencyStats extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RequestLatencyStats) + RequestLatencyStatsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestLatencyStats"); + } + + // Use RequestLatencyStats.newBuilder() to construct. + private RequestLatencyStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RequestLatencyStats() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestLatencyStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestLatencyStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RequestLatencyStats.class, + com.google.bigtable.v2.RequestLatencyStats.Builder.class); + } + + private int bitField0_; + public static final int FRONTEND_SERVER_LATENCY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration frontendServerLatency_; + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return Whether the frontendServerLatency field is set. + */ + @java.lang.Override + public boolean hasFrontendServerLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return The frontendServerLatency. + */ + @java.lang.Override + public com.google.protobuf.Duration getFrontendServerLatency() { + return frontendServerLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frontendServerLatency_; + } + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getFrontendServerLatencyOrBuilder() { + return frontendServerLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frontendServerLatency_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getFrontendServerLatency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFrontendServerLatency()); + } + size += getUnknownFields().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.RequestLatencyStats)) { + return super.equals(obj); + } + com.google.bigtable.v2.RequestLatencyStats other = + (com.google.bigtable.v2.RequestLatencyStats) obj; + + if (hasFrontendServerLatency() != other.hasFrontendServerLatency()) return false; + if (hasFrontendServerLatency()) { + if (!getFrontendServerLatency().equals(other.getFrontendServerLatency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFrontendServerLatency()) { + hash = (37 * hash) + FRONTEND_SERVER_LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getFrontendServerLatency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestLatencyStats 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.RequestLatencyStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestLatencyStats 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.RequestLatencyStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RequestLatencyStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * RequestLatencyStats provides a measurement of the latency of the request as
+   * it interacts with different systems over its lifetime, e.g. how long the
+   * request took to execute within a frontend server.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RequestLatencyStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RequestLatencyStats) + com.google.bigtable.v2.RequestLatencyStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestLatencyStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestLatencyStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RequestLatencyStats.class, + com.google.bigtable.v2.RequestLatencyStats.Builder.class); + } + + // Construct using com.google.bigtable.v2.RequestLatencyStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFrontendServerLatencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + frontendServerLatency_ = null; + if (frontendServerLatencyBuilder_ != null) { + frontendServerLatencyBuilder_.dispose(); + frontendServerLatencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestLatencyStats_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RequestLatencyStats getDefaultInstanceForType() { + return com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RequestLatencyStats build() { + com.google.bigtable.v2.RequestLatencyStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RequestLatencyStats buildPartial() { + com.google.bigtable.v2.RequestLatencyStats result = + new com.google.bigtable.v2.RequestLatencyStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RequestLatencyStats result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.frontendServerLatency_ = + frontendServerLatencyBuilder_ == null + ? frontendServerLatency_ + : frontendServerLatencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RequestLatencyStats) { + return mergeFrom((com.google.bigtable.v2.RequestLatencyStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RequestLatencyStats other) { + if (other == com.google.bigtable.v2.RequestLatencyStats.getDefaultInstance()) return this; + if (other.hasFrontendServerLatency()) { + mergeFrontendServerLatency(other.getFrontendServerLatency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetFrontendServerLatencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration frontendServerLatency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + frontendServerLatencyBuilder_; + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return Whether the frontendServerLatency field is set. + */ + public boolean hasFrontendServerLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return The frontendServerLatency. + */ + public com.google.protobuf.Duration getFrontendServerLatency() { + if (frontendServerLatencyBuilder_ == null) { + return frontendServerLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frontendServerLatency_; + } else { + return frontendServerLatencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public Builder setFrontendServerLatency(com.google.protobuf.Duration value) { + if (frontendServerLatencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + frontendServerLatency_ = value; + } else { + frontendServerLatencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public Builder setFrontendServerLatency(com.google.protobuf.Duration.Builder builderForValue) { + if (frontendServerLatencyBuilder_ == null) { + frontendServerLatency_ = builderForValue.build(); + } else { + frontendServerLatencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public Builder mergeFrontendServerLatency(com.google.protobuf.Duration value) { + if (frontendServerLatencyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && frontendServerLatency_ != null + && frontendServerLatency_ != com.google.protobuf.Duration.getDefaultInstance()) { + getFrontendServerLatencyBuilder().mergeFrom(value); + } else { + frontendServerLatency_ = value; + } + } else { + frontendServerLatencyBuilder_.mergeFrom(value); + } + if (frontendServerLatency_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public Builder clearFrontendServerLatency() { + bitField0_ = (bitField0_ & ~0x00000001); + frontendServerLatency_ = null; + if (frontendServerLatencyBuilder_ != null) { + frontendServerLatencyBuilder_.dispose(); + frontendServerLatencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public com.google.protobuf.Duration.Builder getFrontendServerLatencyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetFrontendServerLatencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + public com.google.protobuf.DurationOrBuilder getFrontendServerLatencyOrBuilder() { + if (frontendServerLatencyBuilder_ != null) { + return frontendServerLatencyBuilder_.getMessageOrBuilder(); + } else { + return frontendServerLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frontendServerLatency_; + } + } + + /** + * + * + *
+     * The latency measured by the frontend server handling this request, from
+     * when the request was received, to when this value is sent back in the
+     * response. For more context on the component that is measuring this latency,
+     * see: https://cloud.google.com/bigtable/docs/overview
+     *
+     * Note: This value may be slightly shorter than the value reported into
+     * aggregate latency metrics in Monitoring for this request
+     * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+     * needs to be sent in the response before the latency measurement including
+     * that transmission is finalized.
+     *
+     * Note: This value includes the end-to-end latency of contacting nodes in
+     * the targeted cluster, e.g. measuring from when the first byte arrives at
+     * the frontend server, to when this value is sent back as the last value in
+     * the response, including any latency incurred by contacting nodes, waiting
+     * for results from nodes, and finally sending results from nodes back to the
+     * caller.
+     * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetFrontendServerLatencyFieldBuilder() { + if (frontendServerLatencyBuilder_ == null) { + frontendServerLatencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getFrontendServerLatency(), getParentForChildren(), isClean()); + frontendServerLatency_ = null; + } + return frontendServerLatencyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RequestLatencyStats) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RequestLatencyStats) + private static final com.google.bigtable.v2.RequestLatencyStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RequestLatencyStats(); + } + + public static com.google.bigtable.v2.RequestLatencyStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestLatencyStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RequestLatencyStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java new file mode 100644 index 000000000000..5ab3acc57f2e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RequestLatencyStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RequestLatencyStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return Whether the frontendServerLatency field is set. + */ + boolean hasFrontendServerLatency(); + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + * + * @return The frontendServerLatency. + */ + com.google.protobuf.Duration getFrontendServerLatency(); + + /** + * + * + *
+   * The latency measured by the frontend server handling this request, from
+   * when the request was received, to when this value is sent back in the
+   * response. For more context on the component that is measuring this latency,
+   * see: https://cloud.google.com/bigtable/docs/overview
+   *
+   * Note: This value may be slightly shorter than the value reported into
+   * aggregate latency metrics in Monitoring for this request
+   * (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
+   * needs to be sent in the response before the latency measurement including
+   * that transmission is finalized.
+   *
+   * Note: This value includes the end-to-end latency of contacting nodes in
+   * the targeted cluster, e.g. measuring from when the first byte arrives at
+   * the frontend server, to when this value is sent back as the last value in
+   * the response, including any latency incurred by contacting nodes, waiting
+   * for results from nodes, and finally sending results from nodes back to the
+   * caller.
+   * 
+ * + * .google.protobuf.Duration frontend_server_latency = 1; + */ + com.google.protobuf.DurationOrBuilder getFrontendServerLatencyOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java new file mode 100644 index 000000000000..20a41ad0bfee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java @@ -0,0 +1,807 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * RequestStats is the container for additional information pertaining to a
+ * single request, helpful for evaluating the performance of the sent request.
+ * Currently, the following method is supported: google.bigtable.v2.ReadRows
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RequestStats} + */ +@com.google.protobuf.Generated +public final class RequestStats extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RequestStats) + RequestStatsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestStats"); + } + + // Use RequestStats.newBuilder() to construct. + private RequestStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RequestStats() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RequestStats.class, + com.google.bigtable.v2.RequestStats.Builder.class); + } + + private int statsViewCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object statsView_; + + public enum StatsViewCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FULL_READ_STATS_VIEW(1), + STATSVIEW_NOT_SET(0); + private final int value; + + private StatsViewCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StatsViewCase valueOf(int value) { + return forNumber(value); + } + + public static StatsViewCase forNumber(int value) { + switch (value) { + case 1: + return FULL_READ_STATS_VIEW; + case 0: + return STATSVIEW_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StatsViewCase getStatsViewCase() { + return StatsViewCase.forNumber(statsViewCase_); + } + + public static final int FULL_READ_STATS_VIEW_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return Whether the fullReadStatsView field is set. + */ + @java.lang.Override + public boolean hasFullReadStatsView() { + return statsViewCase_ == 1; + } + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return The fullReadStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsView getFullReadStatsView() { + if (statsViewCase_ == 1) { + return (com.google.bigtable.v2.FullReadStatsView) statsView_; + } + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsViewOrBuilder getFullReadStatsViewOrBuilder() { + if (statsViewCase_ == 1) { + return (com.google.bigtable.v2.FullReadStatsView) statsView_; + } + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + + 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 (statsViewCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.FullReadStatsView) statsView_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (statsViewCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.FullReadStatsView) statsView_); + } + size += getUnknownFields().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.RequestStats)) { + return super.equals(obj); + } + com.google.bigtable.v2.RequestStats other = (com.google.bigtable.v2.RequestStats) obj; + + if (!getStatsViewCase().equals(other.getStatsViewCase())) return false; + switch (statsViewCase_) { + case 1: + if (!getFullReadStatsView().equals(other.getFullReadStatsView())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (statsViewCase_) { + case 1: + hash = (37 * hash) + FULL_READ_STATS_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getFullReadStatsView().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RequestStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestStats 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.RequestStats parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestStats 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.RequestStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RequestStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RequestStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RequestStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * RequestStats is the container for additional information pertaining to a
+   * single request, helpful for evaluating the performance of the sent request.
+   * Currently, the following method is supported: google.bigtable.v2.ReadRows
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RequestStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RequestStats) + com.google.bigtable.v2.RequestStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RequestStats.class, + com.google.bigtable.v2.RequestStats.Builder.class); + } + + // Construct using com.google.bigtable.v2.RequestStats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fullReadStatsViewBuilder_ != null) { + fullReadStatsViewBuilder_.clear(); + } + statsViewCase_ = 0; + statsView_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.RequestStatsProto + .internal_static_google_bigtable_v2_RequestStats_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RequestStats getDefaultInstanceForType() { + return com.google.bigtable.v2.RequestStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RequestStats build() { + com.google.bigtable.v2.RequestStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RequestStats buildPartial() { + com.google.bigtable.v2.RequestStats result = new com.google.bigtable.v2.RequestStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RequestStats result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.RequestStats result) { + result.statsViewCase_ = statsViewCase_; + result.statsView_ = this.statsView_; + if (statsViewCase_ == 1 && fullReadStatsViewBuilder_ != null) { + result.statsView_ = fullReadStatsViewBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RequestStats) { + return mergeFrom((com.google.bigtable.v2.RequestStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RequestStats other) { + if (other == com.google.bigtable.v2.RequestStats.getDefaultInstance()) return this; + switch (other.getStatsViewCase()) { + case FULL_READ_STATS_VIEW: + { + mergeFullReadStatsView(other.getFullReadStatsView()); + break; + } + case STATSVIEW_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetFullReadStatsViewFieldBuilder().getBuilder(), extensionRegistry); + statsViewCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int statsViewCase_ = 0; + private java.lang.Object statsView_; + + public StatsViewCase getStatsViewCase() { + return StatsViewCase.forNumber(statsViewCase_); + } + + public Builder clearStatsView() { + statsViewCase_ = 0; + statsView_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FullReadStatsView, + com.google.bigtable.v2.FullReadStatsView.Builder, + com.google.bigtable.v2.FullReadStatsViewOrBuilder> + fullReadStatsViewBuilder_; + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return Whether the fullReadStatsView field is set. + */ + @java.lang.Override + public boolean hasFullReadStatsView() { + return statsViewCase_ == 1; + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return The fullReadStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsView getFullReadStatsView() { + if (fullReadStatsViewBuilder_ == null) { + if (statsViewCase_ == 1) { + return (com.google.bigtable.v2.FullReadStatsView) statsView_; + } + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } else { + if (statsViewCase_ == 1) { + return fullReadStatsViewBuilder_.getMessage(); + } + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + public Builder setFullReadStatsView(com.google.bigtable.v2.FullReadStatsView value) { + if (fullReadStatsViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + statsView_ = value; + onChanged(); + } else { + fullReadStatsViewBuilder_.setMessage(value); + } + statsViewCase_ = 1; + return this; + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + public Builder setFullReadStatsView( + com.google.bigtable.v2.FullReadStatsView.Builder builderForValue) { + if (fullReadStatsViewBuilder_ == null) { + statsView_ = builderForValue.build(); + onChanged(); + } else { + fullReadStatsViewBuilder_.setMessage(builderForValue.build()); + } + statsViewCase_ = 1; + return this; + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + public Builder mergeFullReadStatsView(com.google.bigtable.v2.FullReadStatsView value) { + if (fullReadStatsViewBuilder_ == null) { + if (statsViewCase_ == 1 + && statsView_ != com.google.bigtable.v2.FullReadStatsView.getDefaultInstance()) { + statsView_ = + com.google.bigtable.v2.FullReadStatsView.newBuilder( + (com.google.bigtable.v2.FullReadStatsView) statsView_) + .mergeFrom(value) + .buildPartial(); + } else { + statsView_ = value; + } + onChanged(); + } else { + if (statsViewCase_ == 1) { + fullReadStatsViewBuilder_.mergeFrom(value); + } else { + fullReadStatsViewBuilder_.setMessage(value); + } + } + statsViewCase_ = 1; + return this; + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + public Builder clearFullReadStatsView() { + if (fullReadStatsViewBuilder_ == null) { + if (statsViewCase_ == 1) { + statsViewCase_ = 0; + statsView_ = null; + onChanged(); + } + } else { + if (statsViewCase_ == 1) { + statsViewCase_ = 0; + statsView_ = null; + } + fullReadStatsViewBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + public com.google.bigtable.v2.FullReadStatsView.Builder getFullReadStatsViewBuilder() { + return internalGetFullReadStatsViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.FullReadStatsViewOrBuilder getFullReadStatsViewOrBuilder() { + if ((statsViewCase_ == 1) && (fullReadStatsViewBuilder_ != null)) { + return fullReadStatsViewBuilder_.getMessageOrBuilder(); + } else { + if (statsViewCase_ == 1) { + return (com.google.bigtable.v2.FullReadStatsView) statsView_; + } + return com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+     * view, see package google.bigtable.v2.
+     * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FullReadStatsView, + com.google.bigtable.v2.FullReadStatsView.Builder, + com.google.bigtable.v2.FullReadStatsViewOrBuilder> + internalGetFullReadStatsViewFieldBuilder() { + if (fullReadStatsViewBuilder_ == null) { + if (!(statsViewCase_ == 1)) { + statsView_ = com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + fullReadStatsViewBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FullReadStatsView, + com.google.bigtable.v2.FullReadStatsView.Builder, + com.google.bigtable.v2.FullReadStatsViewOrBuilder>( + (com.google.bigtable.v2.FullReadStatsView) statsView_, + getParentForChildren(), + isClean()); + statsView_ = null; + } + statsViewCase_ = 1; + onChanged(); + return fullReadStatsViewBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RequestStats) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RequestStats) + private static final com.google.bigtable.v2.RequestStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RequestStats(); + } + + public static com.google.bigtable.v2.RequestStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RequestStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java new file mode 100644 index 000000000000..34e1e2b00f8a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RequestStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RequestStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return Whether the fullReadStatsView field is set. + */ + boolean hasFullReadStatsView(); + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + * + * @return The fullReadStatsView. + */ + com.google.bigtable.v2.FullReadStatsView getFullReadStatsView(); + + /** + * + * + *
+   * Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
+   * view, see package google.bigtable.v2.
+   * 
+ * + * .google.bigtable.v2.FullReadStatsView full_read_stats_view = 1; + */ + com.google.bigtable.v2.FullReadStatsViewOrBuilder getFullReadStatsViewOrBuilder(); + + com.google.bigtable.v2.RequestStats.StatsViewCase getStatsViewCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.java new file mode 100644 index 000000000000..f07650ff7876 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/request_stats.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class RequestStatsProto extends com.google.protobuf.GeneratedFile { + private RequestStatsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestStatsProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ReadIterationStats_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ReadIterationStats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RequestLatencyStats_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RequestLatencyStats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_FullReadStatsView_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_FullReadStatsView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_RequestStats_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_RequestStats_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/bigtable/v2/request_stats.proto" + + "\022\022google.bigtable.v2\032\036google/protobuf/du" + + "ration.proto\"\202\001\n\022ReadIterationStats\022\027\n\017r" + + "ows_seen_count\030\001 \001(\003\022\033\n\023rows_returned_co" + + "unt\030\002 \001(\003\022\030\n\020cells_seen_count\030\003 \001(\003\022\034\n\024c" + + "ells_returned_count\030\004 \001(\003\"Q\n\023RequestLate" + + "ncyStats\022:\n\027frontend_server_latency\030\001 \001(" + + "\0132\031.google.protobuf.Duration\"\241\001\n\021FullRea" + + "dStatsView\022D\n\024read_iteration_stats\030\001 \001(\013" + + "2&.google.bigtable.v2.ReadIterationStats" + + "\022F\n\025request_latency_stats\030\002 \001(\0132\'.google" + + ".bigtable.v2.RequestLatencyStats\"c\n\014Requ" + + "estStats\022E\n\024full_read_stats_view\030\001 \001(\0132%" + + ".google.bigtable.v2.FullReadStatsViewH\000B" + + "\014\n\nstats_viewB\273\001\n\026com.google.bigtable.v2" + + "B\021RequestStatsProtoP\001Z8cloud.google.com/" + + "go/bigtable/apiv2/bigtablepb;bigtablepb\252" + + "\002\030Google.Cloud.Bigtable.V2\312\002\030Google\\Clou" + + "d\\Bigtable\\V2\352\002\033Google::Cloud::Bigtable:" + + ":V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_ReadIterationStats_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_ReadIterationStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadIterationStats_descriptor, + new java.lang.String[] { + "RowsSeenCount", "RowsReturnedCount", "CellsSeenCount", "CellsReturnedCount", + }); + internal_static_google_bigtable_v2_RequestLatencyStats_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_v2_RequestLatencyStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RequestLatencyStats_descriptor, + new java.lang.String[] { + "FrontendServerLatency", + }); + internal_static_google_bigtable_v2_FullReadStatsView_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_v2_FullReadStatsView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_FullReadStatsView_descriptor, + new java.lang.String[] { + "ReadIterationStats", "RequestLatencyStats", + }); + internal_static_google_bigtable_v2_RequestStats_descriptor = getDescriptor().getMessageType(3); + internal_static_google_bigtable_v2_RequestStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_RequestStats_descriptor, + new java.lang.String[] { + "FullReadStatsView", "StatsView", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java new file mode 100644 index 000000000000..47cf26a024f2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java @@ -0,0 +1,1003 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/response_params.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response metadata proto
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ResponseParams} + */ +@com.google.protobuf.Generated +public final class ResponseParams extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ResponseParams) + ResponseParamsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResponseParams"); + } + + // Use ResponseParams.newBuilder() to construct. + private ResponseParams(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResponseParams() { + zoneId_ = ""; + clusterId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.ResponseParamsProto + .internal_static_google_bigtable_v2_ResponseParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.ResponseParamsProto + .internal_static_google_bigtable_v2_ResponseParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ResponseParams.class, + com.google.bigtable.v2.ResponseParams.Builder.class); + } + + private int bitField0_; + public static final int ZONE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return Whether the zoneId field is set. + */ + @java.lang.Override + public boolean hasZoneId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return Whether the clusterId field is set. + */ + @java.lang.Override + public boolean hasClusterId() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AFE_ID_FIELD_NUMBER = 3; + private long afeId_ = 0L; + + /** + * + * + *
+   * The AFE ID for the AFE that is served this request.
+   * 
+ * + * optional int64 afe_id = 3; + * + * @return Whether the afeId field is set. + */ + @java.lang.Override + public boolean hasAfeId() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The AFE ID for the AFE that is served this request.
+   * 
+ * + * optional int64 afe_id = 3; + * + * @return The afeId. + */ + @java.lang.Override + public long getAfeId() { + return afeId_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, zoneId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, clusterId_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(3, afeId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, zoneId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, clusterId_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, afeId_); + } + size += getUnknownFields().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.ResponseParams)) { + return super.equals(obj); + } + com.google.bigtable.v2.ResponseParams other = (com.google.bigtable.v2.ResponseParams) obj; + + if (hasZoneId() != other.hasZoneId()) return false; + if (hasZoneId()) { + if (!getZoneId().equals(other.getZoneId())) return false; + } + if (hasClusterId() != other.hasClusterId()) return false; + if (hasClusterId()) { + if (!getClusterId().equals(other.getClusterId())) return false; + } + if (hasAfeId() != other.hasAfeId()) return false; + if (hasAfeId()) { + if (getAfeId() != other.getAfeId()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasZoneId()) { + hash = (37 * hash) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + } + if (hasClusterId()) { + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + } + if (hasAfeId()) { + hash = (37 * hash) + AFE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAfeId()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ResponseParams parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResponseParams 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.ResponseParams parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResponseParams 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.ResponseParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResponseParams parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ResponseParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResponseParams parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResponseParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResponseParams parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResponseParams parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResponseParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ResponseParams 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response metadata proto
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ResponseParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ResponseParams) + com.google.bigtable.v2.ResponseParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.ResponseParamsProto + .internal_static_google_bigtable_v2_ResponseParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.ResponseParamsProto + .internal_static_google_bigtable_v2_ResponseParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ResponseParams.class, + com.google.bigtable.v2.ResponseParams.Builder.class); + } + + // Construct using com.google.bigtable.v2.ResponseParams.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zoneId_ = ""; + clusterId_ = ""; + afeId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.ResponseParamsProto + .internal_static_google_bigtable_v2_ResponseParams_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ResponseParams getDefaultInstanceForType() { + return com.google.bigtable.v2.ResponseParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ResponseParams build() { + com.google.bigtable.v2.ResponseParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ResponseParams buildPartial() { + com.google.bigtable.v2.ResponseParams result = + new com.google.bigtable.v2.ResponseParams(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ResponseParams result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zoneId_ = zoneId_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.afeId_ = afeId_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ResponseParams) { + return mergeFrom((com.google.bigtable.v2.ResponseParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ResponseParams other) { + if (other == com.google.bigtable.v2.ResponseParams.getDefaultInstance()) return this; + if (other.hasZoneId()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasClusterId()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasAfeId()) { + setAfeId(other.getAfeId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + afeId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object zoneId_ = ""; + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @return Whether the zoneId field is set. + */ + public boolean hasZoneId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The cloud bigtable zone associated with the cluster.
+     * 
+ * + * optional string zone_id = 1; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object clusterId_ = ""; + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @return Whether the clusterId field is set. + */ + public boolean hasClusterId() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier for a cluster that represents set of
+     * bigtable resources.
+     * 
+ * + * optional string cluster_id = 2; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long afeId_; + + /** + * + * + *
+     * The AFE ID for the AFE that is served this request.
+     * 
+ * + * optional int64 afe_id = 3; + * + * @return Whether the afeId field is set. + */ + @java.lang.Override + public boolean hasAfeId() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The AFE ID for the AFE that is served this request.
+     * 
+ * + * optional int64 afe_id = 3; + * + * @return The afeId. + */ + @java.lang.Override + public long getAfeId() { + return afeId_; + } + + /** + * + * + *
+     * The AFE ID for the AFE that is served this request.
+     * 
+ * + * optional int64 afe_id = 3; + * + * @param value The afeId to set. + * @return This builder for chaining. + */ + public Builder setAfeId(long value) { + + afeId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The AFE ID for the AFE that is served this request.
+     * 
+ * + * optional int64 afe_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearAfeId() { + bitField0_ = (bitField0_ & ~0x00000004); + afeId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ResponseParams) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ResponseParams) + private static final com.google.bigtable.v2.ResponseParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ResponseParams(); + } + + public static com.google.bigtable.v2.ResponseParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResponseParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ResponseParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.java new file mode 100644 index 000000000000..b51f794c2ec3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/response_params.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ResponseParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ResponseParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return Whether the zoneId field is set. + */ + boolean hasZoneId(); + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + + /** + * + * + *
+   * The cloud bigtable zone associated with the cluster.
+   * 
+ * + * optional string zone_id = 1; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return Whether the clusterId field is set. + */ + boolean hasClusterId(); + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + + /** + * + * + *
+   * Identifier for a cluster that represents set of
+   * bigtable resources.
+   * 
+ * + * optional string cluster_id = 2; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * The AFE ID for the AFE that is served this request.
+   * 
+ * + * optional int64 afe_id = 3; + * + * @return Whether the afeId field is set. + */ + boolean hasAfeId(); + + /** + * + * + *
+   * The AFE ID for the AFE that is served this request.
+   * 
+ * + * optional int64 afe_id = 3; + * + * @return The afeId. + */ + long getAfeId(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.java new file mode 100644 index 000000000000..023c64d58755 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/response_params.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class ResponseParamsProto extends com.google.protobuf.GeneratedFile { + private ResponseParamsProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResponseParamsProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ResponseParams_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ResponseParams_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "(google/bigtable/v2/response_params.proto\022\022google.bigtable.v2\"z\n" + + "\016ResponseParams\022\024\n" + + "\007zone_id\030\001 \001(\tH\000\210\001\001\022\027\n\n" + + "cluster_id\030\002 \001(\tH\001\210\001\001\022\023\n" + + "\006afe_id\030\003 \001(\003H\002\210\001\001B\n\n" + + "\010_zone_idB\r\n" + + "\013_cluster_idB\t\n" + + "\007_afe_idB\275\001\n" + + "\026com.google.bigtable.v2B\023ResponseParamsProtoP\001Z8cl" + + "oud.google.com/go/bigtable/apiv2/bigtabl" + + "epb;bigtablepb\252\002\030Google.Cloud.Bigtable.V" + + "2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Google::C" + + "loud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_bigtable_v2_ResponseParams_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_ResponseParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ResponseParams_descriptor, + new java.lang.String[] { + "ZoneId", "ClusterId", "AfeId", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java new file mode 100644 index 000000000000..e5704a7a3dfb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java @@ -0,0 +1,790 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Describes the structure of a Bigtable result set.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ResultSetMetadata} + */ +@com.google.protobuf.Generated +public final class ResultSetMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ResultSetMetadata) + ResultSetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResultSetMetadata"); + } + + // Use ResultSetMetadata.newBuilder() to construct. + private ResultSetMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResultSetMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ResultSetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ResultSetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ResultSetMetadata.class, + com.google.bigtable.v2.ResultSetMetadata.Builder.class); + } + + private int schemaCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object schema_; + + public enum SchemaCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROTO_SCHEMA(1), + SCHEMA_NOT_SET(0); + private final int value; + + private SchemaCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchemaCase valueOf(int value) { + return forNumber(value); + } + + public static SchemaCase forNumber(int value) { + switch (value) { + case 1: + return PROTO_SCHEMA; + case 0: + return SCHEMA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public static final int PROTO_SCHEMA_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return Whether the protoSchema field is set. + */ + @java.lang.Override + public boolean hasProtoSchema() { + return schemaCase_ == 1; + } + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return The protoSchema. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoSchema getProtoSchema() { + if (schemaCase_ == 1) { + return (com.google.bigtable.v2.ProtoSchema) schema_; + } + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder() { + if (schemaCase_ == 1) { + return (com.google.bigtable.v2.ProtoSchema) schema_; + } + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + + 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 (schemaCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.ProtoSchema) schema_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (schemaCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.ProtoSchema) schema_); + } + size += getUnknownFields().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.ResultSetMetadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.ResultSetMetadata other = (com.google.bigtable.v2.ResultSetMetadata) obj; + + if (!getSchemaCase().equals(other.getSchemaCase())) return false; + switch (schemaCase_) { + case 1: + if (!getProtoSchema().equals(other.getProtoSchema())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (schemaCase_) { + case 1: + hash = (37 * hash) + PROTO_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getProtoSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResultSetMetadata 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.ResultSetMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResultSetMetadata 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.ResultSetMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ResultSetMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Describes the structure of a Bigtable result set.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ResultSetMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ResultSetMetadata) + com.google.bigtable.v2.ResultSetMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ResultSetMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ResultSetMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ResultSetMetadata.class, + com.google.bigtable.v2.ResultSetMetadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.ResultSetMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (protoSchemaBuilder_ != null) { + protoSchemaBuilder_.clear(); + } + schemaCase_ = 0; + schema_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ResultSetMetadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata getDefaultInstanceForType() { + return com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata build() { + com.google.bigtable.v2.ResultSetMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ResultSetMetadata buildPartial() { + com.google.bigtable.v2.ResultSetMetadata result = + new com.google.bigtable.v2.ResultSetMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ResultSetMetadata result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ResultSetMetadata result) { + result.schemaCase_ = schemaCase_; + result.schema_ = this.schema_; + if (schemaCase_ == 1 && protoSchemaBuilder_ != null) { + result.schema_ = protoSchemaBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ResultSetMetadata) { + return mergeFrom((com.google.bigtable.v2.ResultSetMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ResultSetMetadata other) { + if (other == com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance()) return this; + switch (other.getSchemaCase()) { + case PROTO_SCHEMA: + { + mergeProtoSchema(other.getProtoSchema()); + break; + } + case SCHEMA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetProtoSchemaFieldBuilder().getBuilder(), extensionRegistry); + schemaCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int schemaCase_ = 0; + private java.lang.Object schema_; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public Builder clearSchema() { + schemaCase_ = 0; + schema_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoSchema, + com.google.bigtable.v2.ProtoSchema.Builder, + com.google.bigtable.v2.ProtoSchemaOrBuilder> + protoSchemaBuilder_; + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return Whether the protoSchema field is set. + */ + @java.lang.Override + public boolean hasProtoSchema() { + return schemaCase_ == 1; + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return The protoSchema. + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoSchema getProtoSchema() { + if (protoSchemaBuilder_ == null) { + if (schemaCase_ == 1) { + return (com.google.bigtable.v2.ProtoSchema) schema_; + } + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } else { + if (schemaCase_ == 1) { + return protoSchemaBuilder_.getMessage(); + } + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + public Builder setProtoSchema(com.google.bigtable.v2.ProtoSchema value) { + if (protoSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + protoSchemaBuilder_.setMessage(value); + } + schemaCase_ = 1; + return this; + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + public Builder setProtoSchema(com.google.bigtable.v2.ProtoSchema.Builder builderForValue) { + if (protoSchemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + protoSchemaBuilder_.setMessage(builderForValue.build()); + } + schemaCase_ = 1; + return this; + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + public Builder mergeProtoSchema(com.google.bigtable.v2.ProtoSchema value) { + if (protoSchemaBuilder_ == null) { + if (schemaCase_ == 1 + && schema_ != com.google.bigtable.v2.ProtoSchema.getDefaultInstance()) { + schema_ = + com.google.bigtable.v2.ProtoSchema.newBuilder( + (com.google.bigtable.v2.ProtoSchema) schema_) + .mergeFrom(value) + .buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + if (schemaCase_ == 1) { + protoSchemaBuilder_.mergeFrom(value); + } else { + protoSchemaBuilder_.setMessage(value); + } + } + schemaCase_ = 1; + return this; + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + public Builder clearProtoSchema() { + if (protoSchemaBuilder_ == null) { + if (schemaCase_ == 1) { + schemaCase_ = 0; + schema_ = null; + onChanged(); + } + } else { + if (schemaCase_ == 1) { + schemaCase_ = 0; + schema_ = null; + } + protoSchemaBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + public com.google.bigtable.v2.ProtoSchema.Builder getProtoSchemaBuilder() { + return internalGetProtoSchemaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder() { + if ((schemaCase_ == 1) && (protoSchemaBuilder_ != null)) { + return protoSchemaBuilder_.getMessageOrBuilder(); + } else { + if (schemaCase_ == 1) { + return (com.google.bigtable.v2.ProtoSchema) schema_; + } + return com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Schema in proto format
+     * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoSchema, + com.google.bigtable.v2.ProtoSchema.Builder, + com.google.bigtable.v2.ProtoSchemaOrBuilder> + internalGetProtoSchemaFieldBuilder() { + if (protoSchemaBuilder_ == null) { + if (!(schemaCase_ == 1)) { + schema_ = com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + protoSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ProtoSchema, + com.google.bigtable.v2.ProtoSchema.Builder, + com.google.bigtable.v2.ProtoSchemaOrBuilder>( + (com.google.bigtable.v2.ProtoSchema) schema_, getParentForChildren(), isClean()); + schema_ = null; + } + schemaCase_ = 1; + onChanged(); + return protoSchemaBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ResultSetMetadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ResultSetMetadata) + private static final com.google.bigtable.v2.ResultSetMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ResultSetMetadata(); + } + + public static com.google.bigtable.v2.ResultSetMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResultSetMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ResultSetMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java new file mode 100644 index 000000000000..355dd9eb5986 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ResultSetMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ResultSetMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return Whether the protoSchema field is set. + */ + boolean hasProtoSchema(); + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + * + * @return The protoSchema. + */ + com.google.bigtable.v2.ProtoSchema getProtoSchema(); + + /** + * + * + *
+   * Schema in proto format
+   * 
+ * + * .google.bigtable.v2.ProtoSchema proto_schema = 1; + */ + com.google.bigtable.v2.ProtoSchemaOrBuilder getProtoSchemaOrBuilder(); + + com.google.bigtable.v2.ResultSetMetadata.SchemaCase getSchemaCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java new file mode 100644 index 000000000000..c56f38d4a9db --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies the complete (requested) contents of a single row of a table.
+ * Rows which exceed 256MiB in size cannot be read in full.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Row} + */ +@com.google.protobuf.Generated +public final class Row extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Row"); + } + + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Row() { + key_ = com.google.protobuf.ByteString.EMPTY; + families_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Row.class, com.google.bigtable.v2.Row.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The unique key which identifies this row within its table. This is the same
+   * key that's used to identify the row in, for example, a MutateRowRequest.
+   * May contain any non-empty byte string up to 4KiB in length.
+   * 
+ * + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int FAMILIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List families_; + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + @java.lang.Override + public java.util.List getFamiliesList() { + return families_; + } + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + @java.lang.Override + public java.util.List + getFamiliesOrBuilderList() { + return families_; + } + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + @java.lang.Override + public int getFamiliesCount() { + return families_.size(); + } + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Family getFamilies(int index) { + return families_.get(index); + } + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index) { + return families_.get(index); + } + + 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 (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + for (int i = 0; i < families_.size(); i++) { + output.writeMessage(2, families_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + for (int i = 0; i < families_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, families_.get(i)); + } + size += getUnknownFields().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.Row)) { + return super.equals(obj); + } + com.google.bigtable.v2.Row other = (com.google.bigtable.v2.Row) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getFamiliesList().equals(other.getFamiliesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getFamiliesCount() > 0) { + hash = (37 * hash) + FAMILIES_FIELD_NUMBER; + hash = (53 * hash) + getFamiliesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Row parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Row 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.Row parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Row 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.Row parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Row parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Row parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Row parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Row parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Row parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Row parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Row parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Row 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies the complete (requested) contents of a single row of a table.
+   * Rows which exceed 256MiB in size cannot be read in full.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Row} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Row) + com.google.bigtable.v2.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Row.class, com.google.bigtable.v2.Row.Builder.class); + } + + // Construct using com.google.bigtable.v2.Row.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + if (familiesBuilder_ == null) { + families_ = java.util.Collections.emptyList(); + } else { + families_ = null; + familiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Row_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Row getDefaultInstanceForType() { + return com.google.bigtable.v2.Row.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Row build() { + com.google.bigtable.v2.Row result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Row buildPartial() { + com.google.bigtable.v2.Row result = new com.google.bigtable.v2.Row(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Row result) { + if (familiesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + families_ = java.util.Collections.unmodifiableList(families_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.families_ = families_; + } else { + result.families_ = familiesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.Row result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Row) { + return mergeFrom((com.google.bigtable.v2.Row) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Row other) { + if (other == com.google.bigtable.v2.Row.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + if (familiesBuilder_ == null) { + if (!other.families_.isEmpty()) { + if (families_.isEmpty()) { + families_ = other.families_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFamiliesIsMutable(); + families_.addAll(other.families_); + } + onChanged(); + } + } else { + if (!other.families_.isEmpty()) { + if (familiesBuilder_.isEmpty()) { + familiesBuilder_.dispose(); + familiesBuilder_ = null; + families_ = other.families_; + bitField0_ = (bitField0_ & ~0x00000002); + familiesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFamiliesFieldBuilder() + : null; + } else { + familiesBuilder_.addAllMessages(other.families_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Family m = + input.readMessage(com.google.bigtable.v2.Family.parser(), extensionRegistry); + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + families_.add(m); + } else { + familiesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The unique key which identifies this row within its table. This is the same
+     * key that's used to identify the row in, for example, a MutateRowRequest.
+     * May contain any non-empty byte string up to 4KiB in length.
+     * 
+ * + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * + * + *
+     * The unique key which identifies this row within its table. This is the same
+     * key that's used to identify the row in, for example, a MutateRowRequest.
+     * May contain any non-empty byte string up to 4KiB in length.
+     * 
+ * + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The unique key which identifies this row within its table. This is the same
+     * key that's used to identify the row in, for example, a MutateRowRequest.
+     * May contain any non-empty byte string up to 4KiB in length.
+     * 
+ * + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private java.util.List families_ = + java.util.Collections.emptyList(); + + private void ensureFamiliesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + families_ = new java.util.ArrayList(families_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Family, + com.google.bigtable.v2.Family.Builder, + com.google.bigtable.v2.FamilyOrBuilder> + familiesBuilder_; + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public java.util.List getFamiliesList() { + if (familiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(families_); + } else { + return familiesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public int getFamiliesCount() { + if (familiesBuilder_ == null) { + return families_.size(); + } else { + return familiesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public com.google.bigtable.v2.Family getFamilies(int index) { + if (familiesBuilder_ == null) { + return families_.get(index); + } else { + return familiesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder setFamilies(int index, com.google.bigtable.v2.Family value) { + if (familiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFamiliesIsMutable(); + families_.set(index, value); + onChanged(); + } else { + familiesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder setFamilies(int index, com.google.bigtable.v2.Family.Builder builderForValue) { + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + families_.set(index, builderForValue.build()); + onChanged(); + } else { + familiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder addFamilies(com.google.bigtable.v2.Family value) { + if (familiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFamiliesIsMutable(); + families_.add(value); + onChanged(); + } else { + familiesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder addFamilies(int index, com.google.bigtable.v2.Family value) { + if (familiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFamiliesIsMutable(); + families_.add(index, value); + onChanged(); + } else { + familiesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder addFamilies(com.google.bigtable.v2.Family.Builder builderForValue) { + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + families_.add(builderForValue.build()); + onChanged(); + } else { + familiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder addFamilies(int index, com.google.bigtable.v2.Family.Builder builderForValue) { + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + families_.add(index, builderForValue.build()); + onChanged(); + } else { + familiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder addAllFamilies( + java.lang.Iterable values) { + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, families_); + onChanged(); + } else { + familiesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder clearFamilies() { + if (familiesBuilder_ == null) { + families_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + familiesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public Builder removeFamilies(int index) { + if (familiesBuilder_ == null) { + ensureFamiliesIsMutable(); + families_.remove(index); + onChanged(); + } else { + familiesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public com.google.bigtable.v2.Family.Builder getFamiliesBuilder(int index) { + return internalGetFamiliesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index) { + if (familiesBuilder_ == null) { + return families_.get(index); + } else { + return familiesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public java.util.List + getFamiliesOrBuilderList() { + if (familiesBuilder_ != null) { + return familiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(families_); + } + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public com.google.bigtable.v2.Family.Builder addFamiliesBuilder() { + return internalGetFamiliesFieldBuilder() + .addBuilder(com.google.bigtable.v2.Family.getDefaultInstance()); + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public com.google.bigtable.v2.Family.Builder addFamiliesBuilder(int index) { + return internalGetFamiliesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Family.getDefaultInstance()); + } + + /** + * + * + *
+     * May be empty, but only if the entire row is empty.
+     * The mutual ordering of column families is not specified.
+     * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + public java.util.List getFamiliesBuilderList() { + return internalGetFamiliesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Family, + com.google.bigtable.v2.Family.Builder, + com.google.bigtable.v2.FamilyOrBuilder> + internalGetFamiliesFieldBuilder() { + if (familiesBuilder_ == null) { + familiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Family, + com.google.bigtable.v2.Family.Builder, + com.google.bigtable.v2.FamilyOrBuilder>( + families_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + families_ = null; + } + return familiesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Row) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Row) + private static final com.google.bigtable.v2.Row DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Row(); + } + + public static com.google.bigtable.v2.Row getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Row getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java new file mode 100644 index 000000000000..df520dbf7e2c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java @@ -0,0 +1,9526 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Takes a row as input and produces an alternate view of the row based on
+ * specified rules. For example, a RowFilter might trim down a row to include
+ * just the cells from columns matching a given regular expression, or might
+ * return all the cells of a row but not their values. More complicated filters
+ * can be composed out of these components to express requests such as, "within
+ * every column of a particular family, give just the two most recent cells
+ * which are older than timestamp X."
+ *
+ * There are two broad categories of RowFilters (true filters and transformers),
+ * as well as two ways to compose simple filters into more complex ones
+ * (chains and interleaves). They work as follows:
+ *
+ * * True filters alter the input row by excluding some of its cells wholesale
+ * from the output row. An example of a true filter is the `value_regex_filter`,
+ * which excludes cells whose values don't match the specified pattern. All
+ * regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax)
+ * in raw byte mode (RE2::Latin1), and are evaluated as full matches. An
+ * important point to keep in mind is that `RE2(.)` is equivalent by default to
+ * `RE2([^\n])`, meaning that it does not match newlines. When attempting to
+ * match an arbitrary byte, you should therefore use the escape sequence `\C`,
+ * which may need to be further escaped as `\\C` in your client language.
+ *
+ * * Transformers alter the input row by changing the values of some of its
+ * cells in the output, without excluding them completely. Currently, the only
+ * supported transformer is the `strip_value_transformer`, which replaces every
+ * cell's value with the empty string.
+ *
+ * * 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 20480 bytes, and RowFilters may not be nested within each other
+ * (in Chains or Interleaves) to a depth of more than 20.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter} + */ +@com.google.protobuf.Generated +public final class RowFilter extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowFilter) + RowFilterOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowFilter"); + } + + // Use RowFilter.newBuilder() to construct. + private RowFilter(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RowFilter() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.class, com.google.bigtable.v2.RowFilter.Builder.class); + } + + public interface ChainOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowFilter.Chain) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + java.util.List getFiltersList(); + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + com.google.bigtable.v2.RowFilter getFilters(int index); + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + int getFiltersCount(); + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + java.util.List getFiltersOrBuilderList(); + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index); + } + + /** + * + * + *
+   * A RowFilter which sends rows through several RowFilters in sequence.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Chain} + */ + public static final class Chain extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowFilter.Chain) + ChainOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Chain"); + } + + // Use Chain.newBuilder() to construct. + private Chain(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Chain() { + filters_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Chain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Chain.class, + com.google.bigtable.v2.RowFilter.Chain.Builder.class); + } + + public static final int FILTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List filters_; + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public java.util.List getFiltersList() { + return filters_; + } + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public java.util.List + getFiltersOrBuilderList() { + return filters_; + } + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public int getFiltersCount() { + return filters_.size(); + } + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFilters(int index) { + return filters_.get(index); + } + + /** + * + * + *
+     * The elements of "filters" are chained together to process the input row:
+     * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+     * The full chain is executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) { + return filters_.get(index); + } + + 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 { + for (int i = 0; i < filters_.size(); i++) { + output.writeMessage(1, filters_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < filters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, filters_.get(i)); + } + size += getUnknownFields().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.RowFilter.Chain)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowFilter.Chain other = (com.google.bigtable.v2.RowFilter.Chain) obj; + + if (!getFiltersList().equals(other.getFiltersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFiltersCount() > 0) { + hash = (37 * hash) + FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getFiltersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Chain 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.RowFilter.Chain parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Chain 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.RowFilter.Chain parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Chain parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowFilter.Chain 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A RowFilter which sends rows through several RowFilters in sequence.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Chain} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowFilter.Chain) + com.google.bigtable.v2.RowFilter.ChainOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Chain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Chain.class, + com.google.bigtable.v2.RowFilter.Chain.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowFilter.Chain.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + } else { + filters_ = null; + filtersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Chain_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Chain getDefaultInstanceForType() { + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Chain build() { + com.google.bigtable.v2.RowFilter.Chain result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Chain buildPartial() { + com.google.bigtable.v2.RowFilter.Chain result = + new com.google.bigtable.v2.RowFilter.Chain(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.RowFilter.Chain result) { + if (filtersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + filters_ = java.util.Collections.unmodifiableList(filters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.filters_ = filters_; + } else { + result.filters_ = filtersBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter.Chain result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowFilter.Chain) { + return mergeFrom((com.google.bigtable.v2.RowFilter.Chain) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Chain other) { + if (other == com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance()) return this; + if (filtersBuilder_ == null) { + if (!other.filters_.isEmpty()) { + if (filters_.isEmpty()) { + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFiltersIsMutable(); + filters_.addAll(other.filters_); + } + onChanged(); + } + } else { + if (!other.filters_.isEmpty()) { + if (filtersBuilder_.isEmpty()) { + filtersBuilder_.dispose(); + filtersBuilder_ = null; + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000001); + filtersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFiltersFieldBuilder() + : null; + } else { + filtersBuilder_.addAllMessages(other.filters_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.RowFilter m = + input.readMessage( + com.google.bigtable.v2.RowFilter.parser(), extensionRegistry); + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(m); + } else { + filtersBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List filters_ = + java.util.Collections.emptyList(); + + private void ensureFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + filters_ = new java.util.ArrayList(filters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + filtersBuilder_; + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List getFiltersList() { + if (filtersBuilder_ == null) { + return java.util.Collections.unmodifiableList(filters_); + } else { + return filtersBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public int getFiltersCount() { + if (filtersBuilder_ == null) { + return filters_.size(); + } else { + return filtersBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter getFilters(int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.set(index, value); + onChanged(); + } else { + filtersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder setFilters( + int index, com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.set(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(value); + onChanged(); + } else { + filtersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(index, value); + onChanged(); + } else { + filtersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters( + int index, com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addAllFilters( + java.lang.Iterable values) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filters_); + onChanged(); + } else { + filtersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder clearFilters() { + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + filtersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder removeFilters(int index) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.remove(index); + onChanged(); + } else { + filtersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder getFiltersBuilder(int index) { + return internalGetFiltersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List + getFiltersOrBuilderList() { + if (filtersBuilder_ != null) { + return filtersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(filters_); + } + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { + return internalGetFiltersFieldBuilder() + .addBuilder(com.google.bigtable.v2.RowFilter.getDefaultInstance()); + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { + return internalGetFiltersFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.RowFilter.getDefaultInstance()); + } + + /** + * + * + *
+       * The elements of "filters" are chained together to process the input row:
+       * in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
+       * The full chain is executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List getFiltersBuilderList() { + return internalGetFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFiltersFieldBuilder() { + if (filtersBuilder_ == null) { + filtersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + filters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + filters_ = null; + } + return filtersBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Chain) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowFilter.Chain) + private static final com.google.bigtable.v2.RowFilter.Chain DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowFilter.Chain(); + } + + public static com.google.bigtable.v2.RowFilter.Chain getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Chain parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowFilter.Chain getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InterleaveOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowFilter.Interleave) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + java.util.List getFiltersList(); + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + com.google.bigtable.v2.RowFilter getFilters(int index); + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + int getFiltersCount(); + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + java.util.List getFiltersOrBuilderList(); + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index); + } + + /** + * + * + *
+   * A RowFilter which sends each row to each of several component
+   * RowFilters and interleaves the results.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Interleave} + */ + public static final class Interleave extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowFilter.Interleave) + InterleaveOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Interleave"); + } + + // Use Interleave.newBuilder() to construct. + private Interleave(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Interleave() { + filters_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Interleave.class, + com.google.bigtable.v2.RowFilter.Interleave.Builder.class); + } + + public static final int FILTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List filters_; + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public java.util.List getFiltersList() { + return filters_; + } + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public java.util.List + getFiltersOrBuilderList() { + return filters_; + } + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public int getFiltersCount() { + return filters_.size(); + } + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFilters(int index) { + return filters_.get(index); + } + + /** + * + * + *
+     * The elements of "filters" all process a copy of the input row, and the
+     * results are pooled, sorted, and combined into a single output row.
+     * If multiple cells are produced with the same column and timestamp,
+     * they will all appear in the output row in an unspecified mutual order.
+     * Consider the following example, with three filters:
+     *
+     * input row
+     * |
+     * -----------------------------------------------------
+     * |                         |                         |
+     * f(0)                      f(1)                      f(2)
+     * |                         |                         |
+     * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+     * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+     * |                         |                         |
+     * -----------------------------------------------------
+     * |
+     * 1:                      foo,bar,10,z   // could have switched with #2
+     * 2:                      foo,bar,10,x   // could have switched with #1
+     * 3:                      foo,blah,11,z
+     * 4:                      far,bar,7,a
+     * 5:                      far,blah,5,x   // identical to #6
+     * 6:                      far,blah,5,x   // identical to #5
+     *
+     * All interleaved filters are executed atomically.
+     * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) { + return filters_.get(index); + } + + 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 { + for (int i = 0; i < filters_.size(); i++) { + output.writeMessage(1, filters_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < filters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, filters_.get(i)); + } + size += getUnknownFields().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.RowFilter.Interleave)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowFilter.Interleave other = + (com.google.bigtable.v2.RowFilter.Interleave) obj; + + if (!getFiltersList().equals(other.getFiltersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFiltersCount() > 0) { + hash = (37 * hash) + FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getFiltersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Interleave 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.RowFilter.Interleave parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Interleave 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.RowFilter.Interleave parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Interleave parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowFilter.Interleave 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A RowFilter which sends each row to each of several component
+     * RowFilters and interleaves the results.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Interleave} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowFilter.Interleave) + com.google.bigtable.v2.RowFilter.InterleaveOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Interleave.class, + com.google.bigtable.v2.RowFilter.Interleave.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowFilter.Interleave.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + } else { + filters_ = null; + filtersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Interleave_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Interleave getDefaultInstanceForType() { + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Interleave build() { + com.google.bigtable.v2.RowFilter.Interleave result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Interleave buildPartial() { + com.google.bigtable.v2.RowFilter.Interleave result = + new com.google.bigtable.v2.RowFilter.Interleave(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.RowFilter.Interleave result) { + if (filtersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + filters_ = java.util.Collections.unmodifiableList(filters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.filters_ = filters_; + } else { + result.filters_ = filtersBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter.Interleave result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowFilter.Interleave) { + return mergeFrom((com.google.bigtable.v2.RowFilter.Interleave) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Interleave other) { + if (other == com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance()) return this; + if (filtersBuilder_ == null) { + if (!other.filters_.isEmpty()) { + if (filters_.isEmpty()) { + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFiltersIsMutable(); + filters_.addAll(other.filters_); + } + onChanged(); + } + } else { + if (!other.filters_.isEmpty()) { + if (filtersBuilder_.isEmpty()) { + filtersBuilder_.dispose(); + filtersBuilder_ = null; + filters_ = other.filters_; + bitField0_ = (bitField0_ & ~0x00000001); + filtersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFiltersFieldBuilder() + : null; + } else { + filtersBuilder_.addAllMessages(other.filters_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.RowFilter m = + input.readMessage( + com.google.bigtable.v2.RowFilter.parser(), extensionRegistry); + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(m); + } else { + filtersBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List filters_ = + java.util.Collections.emptyList(); + + private void ensureFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + filters_ = new java.util.ArrayList(filters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + filtersBuilder_; + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List getFiltersList() { + if (filtersBuilder_ == null) { + return java.util.Collections.unmodifiableList(filters_); + } else { + return filtersBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public int getFiltersCount() { + if (filtersBuilder_ == null) { + return filters_.size(); + } else { + return filtersBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter getFilters(int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.set(index, value); + onChanged(); + } else { + filtersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder setFilters( + int index, com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.set(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(value); + onChanged(); + } else { + filtersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { + if (filtersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFiltersIsMutable(); + filters_.add(index, value); + onChanged(); + } else { + filtersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addFilters( + int index, com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.add(index, builderForValue.build()); + onChanged(); + } else { + filtersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder addAllFilters( + java.lang.Iterable values) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filters_); + onChanged(); + } else { + filtersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder clearFilters() { + if (filtersBuilder_ == null) { + filters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + filtersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public Builder removeFilters(int index) { + if (filtersBuilder_ == null) { + ensureFiltersIsMutable(); + filters_.remove(index); + onChanged(); + } else { + filtersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder getFiltersBuilder(int index) { + return internalGetFiltersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) { + if (filtersBuilder_ == null) { + return filters_.get(index); + } else { + return filtersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List + getFiltersOrBuilderList() { + if (filtersBuilder_ != null) { + return filtersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(filters_); + } + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { + return internalGetFiltersFieldBuilder() + .addBuilder(com.google.bigtable.v2.RowFilter.getDefaultInstance()); + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { + return internalGetFiltersFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.RowFilter.getDefaultInstance()); + } + + /** + * + * + *
+       * The elements of "filters" all process a copy of the input row, and the
+       * results are pooled, sorted, and combined into a single output row.
+       * If multiple cells are produced with the same column and timestamp,
+       * they will all appear in the output row in an unspecified mutual order.
+       * Consider the following example, with three filters:
+       *
+       * input row
+       * |
+       * -----------------------------------------------------
+       * |                         |                         |
+       * f(0)                      f(1)                      f(2)
+       * |                         |                         |
+       * 1: foo,bar,10,x             foo,bar,10,z              far,bar,7,a
+       * 2: foo,blah,11,z            far,blah,5,x              far,blah,5,x
+       * |                         |                         |
+       * -----------------------------------------------------
+       * |
+       * 1:                      foo,bar,10,z   // could have switched with #2
+       * 2:                      foo,bar,10,x   // could have switched with #1
+       * 3:                      foo,blah,11,z
+       * 4:                      far,bar,7,a
+       * 5:                      far,blah,5,x   // identical to #6
+       * 6:                      far,blah,5,x   // identical to #5
+       *
+       * All interleaved filters are executed atomically.
+       * 
+ * + * repeated .google.bigtable.v2.RowFilter filters = 1; + */ + public java.util.List getFiltersBuilderList() { + return internalGetFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFiltersFieldBuilder() { + if (filtersBuilder_ == null) { + filtersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + filters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + filters_ = null; + } + return filtersBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Interleave) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowFilter.Interleave) + private static final com.google.bigtable.v2.RowFilter.Interleave DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowFilter.Interleave(); + } + + public static com.google.bigtable.v2.RowFilter.Interleave getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interleave parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowFilter.Interleave getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowFilter.Condition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return Whether the predicateFilter field is set. + */ + boolean hasPredicateFilter(); + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return The predicateFilter. + */ + com.google.bigtable.v2.RowFilter getPredicateFilter(); + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return Whether the trueFilter field is set. + */ + boolean hasTrueFilter(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return The trueFilter. + */ + com.google.bigtable.v2.RowFilter getTrueFilter(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return Whether the falseFilter field is set. + */ + boolean hasFalseFilter(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return The falseFilter. + */ + com.google.bigtable.v2.RowFilter getFalseFilter(); + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder(); + } + + /** + * + * + *
+   * A RowFilter which evaluates one of two possible RowFilters, depending on
+   * whether or not a predicate RowFilter outputs any cells from the input row.
+   *
+   * IMPORTANT NOTE: The predicate filter does not execute atomically with the
+   * true and false filters, which may lead to inconsistent or unexpected
+   * results. Additionally, Condition filters have poor performance, especially
+   * when filters are set for the false condition.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Condition} + */ + public static final class Condition extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowFilter.Condition) + ConditionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Condition"); + } + + // Use Condition.newBuilder() to construct. + private Condition(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Condition() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Condition.class, + com.google.bigtable.v2.RowFilter.Condition.Builder.class); + } + + private int bitField0_; + public static final int PREDICATE_FILTER_FIELD_NUMBER = 1; + private com.google.bigtable.v2.RowFilter predicateFilter_; + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return Whether the predicateFilter field is set. + */ + @java.lang.Override + public boolean hasPredicateFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return The predicateFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getPredicateFilter() { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + + /** + * + * + *
+     * If `predicate_filter` outputs any cells, then `true_filter` will be
+     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+     * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + + public static final int TRUE_FILTER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RowFilter trueFilter_; + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return Whether the trueFilter field is set. + */ + @java.lang.Override + public boolean hasTrueFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return The trueFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getTrueFilter() { + return trueFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : trueFilter_; + } + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` returns any
+     * results. If not provided, no results will be returned in the true case.
+     * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() { + return trueFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : trueFilter_; + } + + public static final int FALSE_FILTER_FIELD_NUMBER = 3; + private com.google.bigtable.v2.RowFilter falseFilter_; + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return Whether the falseFilter field is set. + */ + @java.lang.Override + public boolean hasFalseFilter() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return The falseFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFalseFilter() { + return falseFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : falseFilter_; + } + + /** + * + * + *
+     * The filter to apply to the input row if `predicate_filter` does not
+     * return any results. If not provided, no results will be returned in the
+     * false case.
+     * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() { + return falseFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : falseFilter_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPredicateFilter()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getTrueFilter()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getFalseFilter()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPredicateFilter()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTrueFilter()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFalseFilter()); + } + size += getUnknownFields().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.RowFilter.Condition)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowFilter.Condition other = + (com.google.bigtable.v2.RowFilter.Condition) obj; + + if (hasPredicateFilter() != other.hasPredicateFilter()) return false; + if (hasPredicateFilter()) { + if (!getPredicateFilter().equals(other.getPredicateFilter())) return false; + } + if (hasTrueFilter() != other.hasTrueFilter()) return false; + if (hasTrueFilter()) { + if (!getTrueFilter().equals(other.getTrueFilter())) return false; + } + if (hasFalseFilter() != other.hasFalseFilter()) return false; + if (hasFalseFilter()) { + if (!getFalseFilter().equals(other.getFalseFilter())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPredicateFilter()) { + hash = (37 * hash) + PREDICATE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getPredicateFilter().hashCode(); + } + if (hasTrueFilter()) { + hash = (37 * hash) + TRUE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getTrueFilter().hashCode(); + } + if (hasFalseFilter()) { + hash = (37 * hash) + FALSE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFalseFilter().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Condition 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.RowFilter.Condition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Condition 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.RowFilter.Condition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter.Condition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowFilter.Condition 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A RowFilter which evaluates one of two possible RowFilters, depending on
+     * whether or not a predicate RowFilter outputs any cells from the input row.
+     *
+     * IMPORTANT NOTE: The predicate filter does not execute atomically with the
+     * true and false filters, which may lead to inconsistent or unexpected
+     * results. Additionally, Condition filters have poor performance, especially
+     * when filters are set for the false condition.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter.Condition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowFilter.Condition) + com.google.bigtable.v2.RowFilter.ConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Condition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.Condition.class, + com.google.bigtable.v2.RowFilter.Condition.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowFilter.Condition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPredicateFilterFieldBuilder(); + internalGetTrueFilterFieldBuilder(); + internalGetFalseFilterFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); + predicateFilterBuilder_ = null; + } + trueFilter_ = null; + if (trueFilterBuilder_ != null) { + trueFilterBuilder_.dispose(); + trueFilterBuilder_ = null; + } + falseFilter_ = null; + if (falseFilterBuilder_ != null) { + falseFilterBuilder_.dispose(); + falseFilterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_Condition_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Condition getDefaultInstanceForType() { + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Condition build() { + com.google.bigtable.v2.RowFilter.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Condition buildPartial() { + com.google.bigtable.v2.RowFilter.Condition result = + new com.google.bigtable.v2.RowFilter.Condition(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter.Condition result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predicateFilter_ = + predicateFilterBuilder_ == null ? predicateFilter_ : predicateFilterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.trueFilter_ = + trueFilterBuilder_ == null ? trueFilter_ : trueFilterBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.falseFilter_ = + falseFilterBuilder_ == null ? falseFilter_ : falseFilterBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowFilter.Condition) { + return mergeFrom((com.google.bigtable.v2.RowFilter.Condition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Condition other) { + if (other == com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance()) return this; + if (other.hasPredicateFilter()) { + mergePredicateFilter(other.getPredicateFilter()); + } + if (other.hasTrueFilter()) { + mergeTrueFilter(other.getTrueFilter()); + } + if (other.hasFalseFilter()) { + mergeFalseFilter(other.getFalseFilter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetPredicateFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetTrueFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetFalseFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.RowFilter predicateFilter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + predicateFilterBuilder_; + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return Whether the predicateFilter field is set. + */ + public boolean hasPredicateFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + * + * @return The predicateFilter. + */ + public com.google.bigtable.v2.RowFilter getPredicateFilter() { + if (predicateFilterBuilder_ == null) { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } else { + return predicateFilterBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) { + if (predicateFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predicateFilter_ = value; + } else { + predicateFilterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (predicateFilterBuilder_ == null) { + predicateFilter_ = builderForValue.build(); + } else { + predicateFilterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) { + if (predicateFilterBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && predicateFilter_ != null + && predicateFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getPredicateFilterBuilder().mergeFrom(value); + } else { + predicateFilter_ = value; + } + } else { + predicateFilterBuilder_.mergeFrom(value); + } + if (predicateFilter_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public Builder clearPredicateFilter() { + bitField0_ = (bitField0_ & ~0x00000001); + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); + predicateFilterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPredicateFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { + if (predicateFilterBuilder_ != null) { + return predicateFilterBuilder_.getMessageOrBuilder(); + } else { + return predicateFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : predicateFilter_; + } + } + + /** + * + * + *
+       * If `predicate_filter` outputs any cells, then `true_filter` will be
+       * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
+       * 
+ * + * .google.bigtable.v2.RowFilter predicate_filter = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetPredicateFilterFieldBuilder() { + if (predicateFilterBuilder_ == null) { + predicateFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getPredicateFilter(), getParentForChildren(), isClean()); + predicateFilter_ = null; + } + return predicateFilterBuilder_; + } + + private com.google.bigtable.v2.RowFilter trueFilter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + trueFilterBuilder_; + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return Whether the trueFilter field is set. + */ + public boolean hasTrueFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + * + * @return The trueFilter. + */ + public com.google.bigtable.v2.RowFilter getTrueFilter() { + if (trueFilterBuilder_ == null) { + return trueFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : trueFilter_; + } else { + return trueFilterBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public Builder setTrueFilter(com.google.bigtable.v2.RowFilter value) { + if (trueFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trueFilter_ = value; + } else { + trueFilterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public Builder setTrueFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (trueFilterBuilder_ == null) { + trueFilter_ = builderForValue.build(); + } else { + trueFilterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public Builder mergeTrueFilter(com.google.bigtable.v2.RowFilter value) { + if (trueFilterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && trueFilter_ != null + && trueFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getTrueFilterBuilder().mergeFrom(value); + } else { + trueFilter_ = value; + } + } else { + trueFilterBuilder_.mergeFrom(value); + } + if (trueFilter_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public Builder clearTrueFilter() { + bitField0_ = (bitField0_ & ~0x00000002); + trueFilter_ = null; + if (trueFilterBuilder_ != null) { + trueFilterBuilder_.dispose(); + trueFilterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public com.google.bigtable.v2.RowFilter.Builder getTrueFilterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetTrueFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() { + if (trueFilterBuilder_ != null) { + return trueFilterBuilder_.getMessageOrBuilder(); + } else { + return trueFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : trueFilter_; + } + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` returns any
+       * results. If not provided, no results will be returned in the true case.
+       * 
+ * + * .google.bigtable.v2.RowFilter true_filter = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetTrueFilterFieldBuilder() { + if (trueFilterBuilder_ == null) { + trueFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getTrueFilter(), getParentForChildren(), isClean()); + trueFilter_ = null; + } + return trueFilterBuilder_; + } + + private com.google.bigtable.v2.RowFilter falseFilter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + falseFilterBuilder_; + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return Whether the falseFilter field is set. + */ + public boolean hasFalseFilter() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + * + * @return The falseFilter. + */ + public com.google.bigtable.v2.RowFilter getFalseFilter() { + if (falseFilterBuilder_ == null) { + return falseFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : falseFilter_; + } else { + return falseFilterBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public Builder setFalseFilter(com.google.bigtable.v2.RowFilter value) { + if (falseFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + falseFilter_ = value; + } else { + falseFilterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public Builder setFalseFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (falseFilterBuilder_ == null) { + falseFilter_ = builderForValue.build(); + } else { + falseFilterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public Builder mergeFalseFilter(com.google.bigtable.v2.RowFilter value) { + if (falseFilterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && falseFilter_ != null + && falseFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getFalseFilterBuilder().mergeFrom(value); + } else { + falseFilter_ = value; + } + } else { + falseFilterBuilder_.mergeFrom(value); + } + if (falseFilter_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public Builder clearFalseFilter() { + bitField0_ = (bitField0_ & ~0x00000004); + falseFilter_ = null; + if (falseFilterBuilder_ != null) { + falseFilterBuilder_.dispose(); + falseFilterBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public com.google.bigtable.v2.RowFilter.Builder getFalseFilterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetFalseFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() { + if (falseFilterBuilder_ != null) { + return falseFilterBuilder_.getMessageOrBuilder(); + } else { + return falseFilter_ == null + ? com.google.bigtable.v2.RowFilter.getDefaultInstance() + : falseFilter_; + } + } + + /** + * + * + *
+       * The filter to apply to the input row if `predicate_filter` does not
+       * return any results. If not provided, no results will be returned in the
+       * false case.
+       * 
+ * + * .google.bigtable.v2.RowFilter false_filter = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFalseFilterFieldBuilder() { + if (falseFilterBuilder_ == null) { + falseFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getFalseFilter(), getParentForChildren(), isClean()); + falseFilter_ = null; + } + return falseFilterBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Condition) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowFilter.Condition) + private static final com.google.bigtable.v2.RowFilter.Condition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowFilter.Condition(); + } + + public static com.google.bigtable.v2.RowFilter.Condition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowFilter.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int filterCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object filter_; + + public enum FilterCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CHAIN(1), + INTERLEAVE(2), + CONDITION(3), + SINK(16), + PASS_ALL_FILTER(17), + BLOCK_ALL_FILTER(18), + ROW_KEY_REGEX_FILTER(4), + ROW_SAMPLE_FILTER(14), + FAMILY_NAME_REGEX_FILTER(5), + COLUMN_QUALIFIER_REGEX_FILTER(6), + COLUMN_RANGE_FILTER(7), + TIMESTAMP_RANGE_FILTER(8), + VALUE_REGEX_FILTER(9), + VALUE_RANGE_FILTER(15), + CELLS_PER_ROW_OFFSET_FILTER(10), + CELLS_PER_ROW_LIMIT_FILTER(11), + CELLS_PER_COLUMN_LIMIT_FILTER(12), + STRIP_VALUE_TRANSFORMER(13), + APPLY_LABEL_TRANSFORMER(19), + VALUE_BITMASK_FILTER(20), + FILTER_NOT_SET(0); + private final int value; + + private FilterCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FilterCase valueOf(int value) { + return forNumber(value); + } + + public static FilterCase forNumber(int value) { + switch (value) { + case 1: + return CHAIN; + case 2: + return INTERLEAVE; + case 3: + return CONDITION; + case 16: + return SINK; + case 17: + return PASS_ALL_FILTER; + case 18: + return BLOCK_ALL_FILTER; + case 4: + return ROW_KEY_REGEX_FILTER; + case 14: + return ROW_SAMPLE_FILTER; + case 5: + return FAMILY_NAME_REGEX_FILTER; + case 6: + return COLUMN_QUALIFIER_REGEX_FILTER; + case 7: + return COLUMN_RANGE_FILTER; + case 8: + return TIMESTAMP_RANGE_FILTER; + case 9: + return VALUE_REGEX_FILTER; + case 15: + return VALUE_RANGE_FILTER; + case 10: + return CELLS_PER_ROW_OFFSET_FILTER; + case 11: + return CELLS_PER_ROW_LIMIT_FILTER; + case 12: + return CELLS_PER_COLUMN_LIMIT_FILTER; + case 13: + return STRIP_VALUE_TRANSFORMER; + case 19: + return APPLY_LABEL_TRANSFORMER; + case 20: + return VALUE_BITMASK_FILTER; + case 0: + return FILTER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FilterCase getFilterCase() { + return FilterCase.forNumber(filterCase_); + } + + public static final int CHAIN_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return Whether the chain field is set. + */ + @java.lang.Override + public boolean hasChain() { + return filterCase_ == 1; + } + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return The chain. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Chain getChain() { + if (filterCase_ == 1) { + return (com.google.bigtable.v2.RowFilter.Chain) filter_; + } + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { + if (filterCase_ == 1) { + return (com.google.bigtable.v2.RowFilter.Chain) filter_; + } + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + + public static final int INTERLEAVE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return Whether the interleave field is set. + */ + @java.lang.Override + public boolean hasInterleave() { + return filterCase_ == 2; + } + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return The interleave. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Interleave getInterleave() { + if (filterCase_ == 2) { + return (com.google.bigtable.v2.RowFilter.Interleave) filter_; + } + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuilder() { + if (filterCase_ == 2) { + return (com.google.bigtable.v2.RowFilter.Interleave) filter_; + } + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + + public static final int CONDITION_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return filterCase_ == 3; + } + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return The condition. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Condition getCondition() { + if (filterCase_ == 3) { + return (com.google.bigtable.v2.RowFilter.Condition) filter_; + } + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder() { + if (filterCase_ == 3) { + return (com.google.bigtable.v2.RowFilter.Condition) filter_; + } + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + + public static final int SINK_FIELD_NUMBER = 16; + + /** + * + * + *
+   * ADVANCED USE ONLY.
+   * Hook for introspection into the RowFilter. Outputs all cells directly to
+   * the output of the read rather than to any parent filter. Consider the
+   * following example:
+   *
+   * Chain(
+   * FamilyRegex("A"),
+   * Interleave(
+   * All(),
+   * Chain(Label("foo"), Sink())
+   * ),
+   * QualifierRegex("B")
+   * )
+   *
+   * A,A,1,w
+   * A,B,2,x
+   * B,B,4,z
+   * |
+   * FamilyRegex("A")
+   * |
+   * A,A,1,w
+   * A,B,2,x
+   * |
+   * +------------+-------------+
+   * |                          |
+   * All()                    Label(foo)
+   * |                          |
+   * A,A,1,w              A,A,1,w,labels:[foo]
+   * A,B,2,x              A,B,2,x,labels:[foo]
+   * |                          |
+   * |                        Sink() --------------+
+   * |                          |                  |
+   * +------------+      x------+          A,A,1,w,labels:[foo]
+   * |                        A,B,2,x,labels:[foo]
+   * A,A,1,w                             |
+   * A,B,2,x                             |
+   * |                                |
+   * QualifierRegex("B")                      |
+   * |                                |
+   * A,B,2,x                             |
+   * |                                |
+   * +--------------------------------+
+   * |
+   * A,A,1,w,labels:[foo]
+   * A,B,2,x,labels:[foo]  // could be switched
+   * A,B,2,x               // could be switched
+   *
+   * Despite being excluded by the qualifier filter, a copy of every cell
+   * that reaches the sink is present in the final result.
+   *
+   * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+   * duplicate cells are possible, and appear in an unspecified mutual order.
+   * In this case we have a duplicate with column "A:B" and timestamp 2,
+   * because one copy passed through the all filter while the other was
+   * passed through the label and sink. Note that one copy has label "foo",
+   * while the other does not.
+   *
+   * Cannot be used within the `predicate_filter`, `true_filter`, or
+   * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+   * 
+ * + * bool sink = 16; + * + * @return Whether the sink field is set. + */ + @java.lang.Override + public boolean hasSink() { + return filterCase_ == 16; + } + + /** + * + * + *
+   * ADVANCED USE ONLY.
+   * Hook for introspection into the RowFilter. Outputs all cells directly to
+   * the output of the read rather than to any parent filter. Consider the
+   * following example:
+   *
+   * Chain(
+   * FamilyRegex("A"),
+   * Interleave(
+   * All(),
+   * Chain(Label("foo"), Sink())
+   * ),
+   * QualifierRegex("B")
+   * )
+   *
+   * A,A,1,w
+   * A,B,2,x
+   * B,B,4,z
+   * |
+   * FamilyRegex("A")
+   * |
+   * A,A,1,w
+   * A,B,2,x
+   * |
+   * +------------+-------------+
+   * |                          |
+   * All()                    Label(foo)
+   * |                          |
+   * A,A,1,w              A,A,1,w,labels:[foo]
+   * A,B,2,x              A,B,2,x,labels:[foo]
+   * |                          |
+   * |                        Sink() --------------+
+   * |                          |                  |
+   * +------------+      x------+          A,A,1,w,labels:[foo]
+   * |                        A,B,2,x,labels:[foo]
+   * A,A,1,w                             |
+   * A,B,2,x                             |
+   * |                                |
+   * QualifierRegex("B")                      |
+   * |                                |
+   * A,B,2,x                             |
+   * |                                |
+   * +--------------------------------+
+   * |
+   * A,A,1,w,labels:[foo]
+   * A,B,2,x,labels:[foo]  // could be switched
+   * A,B,2,x               // could be switched
+   *
+   * Despite being excluded by the qualifier filter, a copy of every cell
+   * that reaches the sink is present in the final result.
+   *
+   * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+   * duplicate cells are possible, and appear in an unspecified mutual order.
+   * In this case we have a duplicate with column "A:B" and timestamp 2,
+   * because one copy passed through the all filter while the other was
+   * passed through the label and sink. Note that one copy has label "foo",
+   * while the other does not.
+   *
+   * Cannot be used within the `predicate_filter`, `true_filter`, or
+   * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+   * 
+ * + * bool sink = 16; + * + * @return The sink. + */ + @java.lang.Override + public boolean getSink() { + if (filterCase_ == 16) { + return (java.lang.Boolean) filter_; + } + return false; + } + + public static final int PASS_ALL_FILTER_FIELD_NUMBER = 17; + + /** + * + * + *
+   * Matches all cells, regardless of input. Functionally equivalent to
+   * leaving `filter` unset, but included for completeness.
+   * 
+ * + * bool pass_all_filter = 17; + * + * @return Whether the passAllFilter field is set. + */ + @java.lang.Override + public boolean hasPassAllFilter() { + return filterCase_ == 17; + } + + /** + * + * + *
+   * Matches all cells, regardless of input. Functionally equivalent to
+   * leaving `filter` unset, but included for completeness.
+   * 
+ * + * bool pass_all_filter = 17; + * + * @return The passAllFilter. + */ + @java.lang.Override + public boolean getPassAllFilter() { + if (filterCase_ == 17) { + return (java.lang.Boolean) filter_; + } + return false; + } + + public static final int BLOCK_ALL_FILTER_FIELD_NUMBER = 18; + + /** + * + * + *
+   * Does not match any cells, regardless of input. Useful for temporarily
+   * disabling just part of a filter.
+   * 
+ * + * bool block_all_filter = 18; + * + * @return Whether the blockAllFilter field is set. + */ + @java.lang.Override + public boolean hasBlockAllFilter() { + return filterCase_ == 18; + } + + /** + * + * + *
+   * Does not match any cells, regardless of input. Useful for temporarily
+   * disabling just part of a filter.
+   * 
+ * + * bool block_all_filter = 18; + * + * @return The blockAllFilter. + */ + @java.lang.Override + public boolean getBlockAllFilter() { + if (filterCase_ == 18) { + return (java.lang.Boolean) filter_; + } + return false; + } + + public static final int ROW_KEY_REGEX_FILTER_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+   * other words, passes through the entire row when the key matches, and
+   * otherwise produces an empty row.
+   * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary key.
+   * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return Whether the rowKeyRegexFilter field is set. + */ + @java.lang.Override + public boolean hasRowKeyRegexFilter() { + return filterCase_ == 4; + } + + /** + * + * + *
+   * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+   * other words, passes through the entire row when the key matches, and
+   * otherwise produces an empty row.
+   * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary key.
+   * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return The rowKeyRegexFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKeyRegexFilter() { + if (filterCase_ == 4) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int ROW_SAMPLE_FILTER_FIELD_NUMBER = 14; + + /** + * + * + *
+   * Matches all cells from a row with probability p, and matches no cells
+   * from the row with probability 1-p.
+   * 
+ * + * double row_sample_filter = 14; + * + * @return Whether the rowSampleFilter field is set. + */ + @java.lang.Override + public boolean hasRowSampleFilter() { + return filterCase_ == 14; + } + + /** + * + * + *
+   * Matches all cells from a row with probability p, and matches no cells
+   * from the row with probability 1-p.
+   * 
+ * + * double row_sample_filter = 14; + * + * @return The rowSampleFilter. + */ + @java.lang.Override + public double getRowSampleFilter() { + if (filterCase_ == 14) { + return (java.lang.Double) filter_; + } + return 0D; + } + + public static final int FAMILY_NAME_REGEX_FILTER_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return Whether the familyNameRegexFilter field is set. + */ + public boolean hasFamilyNameRegexFilter() { + return filterCase_ == 5; + } + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return The familyNameRegexFilter. + */ + public java.lang.String getFamilyNameRegexFilter() { + java.lang.Object ref = ""; + if (filterCase_ == 5) { + ref = filter_; + } + 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(); + if (filterCase_ == 5) { + filter_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return The bytes for familyNameRegexFilter. + */ + public com.google.protobuf.ByteString getFamilyNameRegexFilterBytes() { + java.lang.Object ref = ""; + if (filterCase_ == 5) { + ref = filter_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (filterCase_ == 5) { + filter_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_QUALIFIER_REGEX_FILTER_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Matches only cells from columns whose qualifiers satisfy the given RE2
+   * regex.
+   * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+   * escape sequence must be used if a true wildcard is desired. The `.`
+   * character will not match the new line character `\n`, which may be
+   * present in a binary qualifier.
+   * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return Whether the columnQualifierRegexFilter field is set. + */ + @java.lang.Override + public boolean hasColumnQualifierRegexFilter() { + return filterCase_ == 6; + } + + /** + * + * + *
+   * Matches only cells from columns whose qualifiers satisfy the given RE2
+   * regex.
+   * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+   * escape sequence must be used if a true wildcard is desired. The `.`
+   * character will not match the new line character `\n`, which may be
+   * present in a binary qualifier.
+   * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return The columnQualifierRegexFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColumnQualifierRegexFilter() { + if (filterCase_ == 6) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int COLUMN_RANGE_FILTER_FIELD_NUMBER = 7; + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return Whether the columnRangeFilter field is set. + */ + @java.lang.Override + public boolean hasColumnRangeFilter() { + return filterCase_ == 7; + } + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return The columnRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnRange getColumnRangeFilter() { + if (filterCase_ == 7) { + return (com.google.bigtable.v2.ColumnRange) filter_; + } + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder() { + if (filterCase_ == 7) { + return (com.google.bigtable.v2.ColumnRange) filter_; + } + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + + public static final int TIMESTAMP_RANGE_FILTER_FIELD_NUMBER = 8; + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return Whether the timestampRangeFilter field is set. + */ + @java.lang.Override + public boolean hasTimestampRangeFilter() { + return filterCase_ == 8; + } + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return The timestampRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRange getTimestampRangeFilter() { + if (filterCase_ == 8) { + return (com.google.bigtable.v2.TimestampRange) filter_; + } + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrBuilder() { + if (filterCase_ == 8) { + return (com.google.bigtable.v2.TimestampRange) filter_; + } + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + + public static final int VALUE_REGEX_FILTER_FIELD_NUMBER = 9; + + /** + * + * + *
+   * Matches only cells with values that satisfy the given regular expression.
+   * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary value.
+   * 
+ * + * bytes value_regex_filter = 9; + * + * @return Whether the valueRegexFilter field is set. + */ + @java.lang.Override + public boolean hasValueRegexFilter() { + return filterCase_ == 9; + } + + /** + * + * + *
+   * Matches only cells with values that satisfy the given regular expression.
+   * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary value.
+   * 
+ * + * bytes value_regex_filter = 9; + * + * @return The valueRegexFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueRegexFilter() { + if (filterCase_ == 9) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int VALUE_RANGE_FILTER_FIELD_NUMBER = 15; + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return Whether the valueRangeFilter field is set. + */ + @java.lang.Override + public boolean hasValueRangeFilter() { + return filterCase_ == 15; + } + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return The valueRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ValueRange getValueRangeFilter() { + if (filterCase_ == 15) { + return (com.google.bigtable.v2.ValueRange) filter_; + } + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() { + if (filterCase_ == 15) { + return (com.google.bigtable.v2.ValueRange) filter_; + } + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + + public static final int CELLS_PER_ROW_OFFSET_FILTER_FIELD_NUMBER = 10; + + /** + * + * + *
+   * Skips the first N cells of each row, matching all subsequent cells.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return Whether the cellsPerRowOffsetFilter field is set. + */ + @java.lang.Override + public boolean hasCellsPerRowOffsetFilter() { + return filterCase_ == 10; + } + + /** + * + * + *
+   * Skips the first N cells of each row, matching all subsequent cells.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return The cellsPerRowOffsetFilter. + */ + @java.lang.Override + public int getCellsPerRowOffsetFilter() { + if (filterCase_ == 10) { + return (java.lang.Integer) filter_; + } + return 0; + } + + public static final int CELLS_PER_ROW_LIMIT_FILTER_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Matches only the first N cells of each row.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return Whether the cellsPerRowLimitFilter field is set. + */ + @java.lang.Override + public boolean hasCellsPerRowLimitFilter() { + return filterCase_ == 11; + } + + /** + * + * + *
+   * Matches only the first N cells of each row.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return The cellsPerRowLimitFilter. + */ + @java.lang.Override + public int getCellsPerRowLimitFilter() { + if (filterCase_ == 11) { + return (java.lang.Integer) filter_; + } + return 0; + } + + public static final int CELLS_PER_COLUMN_LIMIT_FILTER_FIELD_NUMBER = 12; + + /** + * + * + *
+   * Matches only the most recent N cells within each column. For example,
+   * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+   * skip all earlier cells in `foo:bar`, and then begin matching again in
+   * column `foo:bar2`.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return Whether the cellsPerColumnLimitFilter field is set. + */ + @java.lang.Override + public boolean hasCellsPerColumnLimitFilter() { + return filterCase_ == 12; + } + + /** + * + * + *
+   * Matches only the most recent N cells within each column. For example,
+   * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+   * skip all earlier cells in `foo:bar`, and then begin matching again in
+   * column `foo:bar2`.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return The cellsPerColumnLimitFilter. + */ + @java.lang.Override + public int getCellsPerColumnLimitFilter() { + if (filterCase_ == 12) { + return (java.lang.Integer) filter_; + } + return 0; + } + + public static final int STRIP_VALUE_TRANSFORMER_FIELD_NUMBER = 13; + + /** + * + * + *
+   * Replaces each cell's value with the empty string.
+   * 
+ * + * bool strip_value_transformer = 13; + * + * @return Whether the stripValueTransformer field is set. + */ + @java.lang.Override + public boolean hasStripValueTransformer() { + return filterCase_ == 13; + } + + /** + * + * + *
+   * Replaces each cell's value with the empty string.
+   * 
+ * + * bool strip_value_transformer = 13; + * + * @return The stripValueTransformer. + */ + @java.lang.Override + public boolean getStripValueTransformer() { + if (filterCase_ == 13) { + return (java.lang.Boolean) filter_; + } + return false; + } + + public static final int APPLY_LABEL_TRANSFORMER_FIELD_NUMBER = 19; + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return Whether the applyLabelTransformer field is set. + */ + public boolean hasApplyLabelTransformer() { + return filterCase_ == 19; + } + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return The applyLabelTransformer. + */ + public java.lang.String getApplyLabelTransformer() { + java.lang.Object ref = ""; + if (filterCase_ == 19) { + ref = filter_; + } + 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(); + if (filterCase_ == 19) { + filter_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return The bytes for applyLabelTransformer. + */ + public com.google.protobuf.ByteString getApplyLabelTransformerBytes() { + java.lang.Object ref = ""; + if (filterCase_ == 19) { + ref = filter_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (filterCase_ == 19) { + filter_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_BITMASK_FILTER_FIELD_NUMBER = 20; + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return Whether the valueBitmaskFilter field is set. + */ + @java.lang.Override + public boolean hasValueBitmaskFilter() { + return filterCase_ == 20; + } + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return The valueBitmaskFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ValueBitmask getValueBitmaskFilter() { + if (filterCase_ == 20) { + return (com.google.bigtable.v2.ValueBitmask) filter_; + } + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueBitmaskOrBuilder getValueBitmaskFilterOrBuilder() { + if (filterCase_ == 20) { + return (com.google.bigtable.v2.ValueBitmask) filter_; + } + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + + 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 (filterCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.RowFilter.Chain) filter_); + } + if (filterCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.RowFilter.Interleave) filter_); + } + if (filterCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.RowFilter.Condition) filter_); + } + if (filterCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 5) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, filter_); + } + if (filterCase_ == 6) { + output.writeBytes(6, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.v2.ColumnRange) filter_); + } + if (filterCase_ == 8) { + output.writeMessage(8, (com.google.bigtable.v2.TimestampRange) filter_); + } + if (filterCase_ == 9) { + output.writeBytes(9, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 10) { + output.writeInt32(10, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 11) { + output.writeInt32(11, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 12) { + output.writeInt32(12, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 13) { + output.writeBool(13, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 14) { + output.writeDouble(14, (double) ((java.lang.Double) filter_)); + } + if (filterCase_ == 15) { + output.writeMessage(15, (com.google.bigtable.v2.ValueRange) filter_); + } + if (filterCase_ == 16) { + output.writeBool(16, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 17) { + output.writeBool(17, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 18) { + output.writeBool(18, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 19) { + com.google.protobuf.GeneratedMessage.writeString(output, 19, filter_); + } + if (filterCase_ == 20) { + output.writeMessage(20, (com.google.bigtable.v2.ValueBitmask) filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (filterCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.RowFilter.Chain) filter_); + } + if (filterCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.RowFilter.Interleave) filter_); + } + if (filterCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.RowFilter.Condition) filter_); + } + if (filterCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 5) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, filter_); + } + if (filterCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 6, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.v2.ColumnRange) filter_); + } + if (filterCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.bigtable.v2.TimestampRange) filter_); + } + if (filterCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 9, (com.google.protobuf.ByteString) filter_); + } + if (filterCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 10, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 11, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 12, (int) ((java.lang.Integer) filter_)); + } + if (filterCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 13, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 14, (double) ((java.lang.Double) filter_)); + } + if (filterCase_ == 15) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 15, (com.google.bigtable.v2.ValueRange) filter_); + } + if (filterCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 16, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 17, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 18) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 18, (boolean) ((java.lang.Boolean) filter_)); + } + if (filterCase_ == 19) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(19, filter_); + } + if (filterCase_ == 20) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 20, (com.google.bigtable.v2.ValueBitmask) filter_); + } + size += getUnknownFields().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.RowFilter)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowFilter other = (com.google.bigtable.v2.RowFilter) obj; + + if (!getFilterCase().equals(other.getFilterCase())) return false; + switch (filterCase_) { + case 1: + if (!getChain().equals(other.getChain())) return false; + break; + case 2: + if (!getInterleave().equals(other.getInterleave())) return false; + break; + case 3: + if (!getCondition().equals(other.getCondition())) return false; + break; + case 16: + if (getSink() != other.getSink()) return false; + break; + case 17: + if (getPassAllFilter() != other.getPassAllFilter()) return false; + break; + case 18: + if (getBlockAllFilter() != other.getBlockAllFilter()) return false; + break; + case 4: + if (!getRowKeyRegexFilter().equals(other.getRowKeyRegexFilter())) return false; + break; + case 14: + if (java.lang.Double.doubleToLongBits(getRowSampleFilter()) + != java.lang.Double.doubleToLongBits(other.getRowSampleFilter())) return false; + break; + case 5: + if (!getFamilyNameRegexFilter().equals(other.getFamilyNameRegexFilter())) return false; + break; + case 6: + if (!getColumnQualifierRegexFilter().equals(other.getColumnQualifierRegexFilter())) + return false; + break; + case 7: + if (!getColumnRangeFilter().equals(other.getColumnRangeFilter())) return false; + break; + case 8: + if (!getTimestampRangeFilter().equals(other.getTimestampRangeFilter())) return false; + break; + case 9: + if (!getValueRegexFilter().equals(other.getValueRegexFilter())) return false; + break; + case 15: + if (!getValueRangeFilter().equals(other.getValueRangeFilter())) return false; + break; + case 10: + if (getCellsPerRowOffsetFilter() != other.getCellsPerRowOffsetFilter()) return false; + break; + case 11: + if (getCellsPerRowLimitFilter() != other.getCellsPerRowLimitFilter()) return false; + break; + case 12: + if (getCellsPerColumnLimitFilter() != other.getCellsPerColumnLimitFilter()) return false; + break; + case 13: + if (getStripValueTransformer() != other.getStripValueTransformer()) return false; + break; + case 19: + if (!getApplyLabelTransformer().equals(other.getApplyLabelTransformer())) return false; + break; + case 20: + if (!getValueBitmaskFilter().equals(other.getValueBitmaskFilter())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (filterCase_) { + case 1: + hash = (37 * hash) + CHAIN_FIELD_NUMBER; + hash = (53 * hash) + getChain().hashCode(); + break; + case 2: + hash = (37 * hash) + INTERLEAVE_FIELD_NUMBER; + hash = (53 * hash) + getInterleave().hashCode(); + break; + case 3: + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + break; + case 16: + hash = (37 * hash) + SINK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSink()); + break; + case 17: + hash = (37 * hash) + PASS_ALL_FILTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPassAllFilter()); + break; + case 18: + hash = (37 * hash) + BLOCK_ALL_FILTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBlockAllFilter()); + break; + case 4: + hash = (37 * hash) + ROW_KEY_REGEX_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getRowKeyRegexFilter().hashCode(); + break; + case 14: + hash = (37 * hash) + ROW_SAMPLE_FILTER_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRowSampleFilter())); + break; + case 5: + hash = (37 * hash) + FAMILY_NAME_REGEX_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFamilyNameRegexFilter().hashCode(); + break; + case 6: + hash = (37 * hash) + COLUMN_QUALIFIER_REGEX_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getColumnQualifierRegexFilter().hashCode(); + break; + case 7: + hash = (37 * hash) + COLUMN_RANGE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getColumnRangeFilter().hashCode(); + break; + case 8: + hash = (37 * hash) + TIMESTAMP_RANGE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getTimestampRangeFilter().hashCode(); + break; + case 9: + hash = (37 * hash) + VALUE_REGEX_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getValueRegexFilter().hashCode(); + break; + case 15: + hash = (37 * hash) + VALUE_RANGE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getValueRangeFilter().hashCode(); + break; + case 10: + hash = (37 * hash) + CELLS_PER_ROW_OFFSET_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCellsPerRowOffsetFilter(); + break; + case 11: + hash = (37 * hash) + CELLS_PER_ROW_LIMIT_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCellsPerRowLimitFilter(); + break; + case 12: + hash = (37 * hash) + CELLS_PER_COLUMN_LIMIT_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getCellsPerColumnLimitFilter(); + break; + case 13: + hash = (37 * hash) + STRIP_VALUE_TRANSFORMER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getStripValueTransformer()); + break; + case 19: + hash = (37 * hash) + APPLY_LABEL_TRANSFORMER_FIELD_NUMBER; + hash = (53 * hash) + getApplyLabelTransformer().hashCode(); + break; + case 20: + hash = (37 * hash) + VALUE_BITMASK_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getValueBitmaskFilter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter 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.RowFilter parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter 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.RowFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowFilter 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Takes a row as input and produces an alternate view of the row based on
+   * specified rules. For example, a RowFilter might trim down a row to include
+   * just the cells from columns matching a given regular expression, or might
+   * return all the cells of a row but not their values. More complicated filters
+   * can be composed out of these components to express requests such as, "within
+   * every column of a particular family, give just the two most recent cells
+   * which are older than timestamp X."
+   *
+   * There are two broad categories of RowFilters (true filters and transformers),
+   * as well as two ways to compose simple filters into more complex ones
+   * (chains and interleaves). They work as follows:
+   *
+   * * True filters alter the input row by excluding some of its cells wholesale
+   * from the output row. An example of a true filter is the `value_regex_filter`,
+   * which excludes cells whose values don't match the specified pattern. All
+   * regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax)
+   * in raw byte mode (RE2::Latin1), and are evaluated as full matches. An
+   * important point to keep in mind is that `RE2(.)` is equivalent by default to
+   * `RE2([^\n])`, meaning that it does not match newlines. When attempting to
+   * match an arbitrary byte, you should therefore use the escape sequence `\C`,
+   * which may need to be further escaped as `\\C` in your client language.
+   *
+   * * Transformers alter the input row by changing the values of some of its
+   * cells in the output, without excluding them completely. Currently, the only
+   * supported transformer is the `strip_value_transformer`, which replaces every
+   * cell's value with the empty string.
+   *
+   * * 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 20480 bytes, and RowFilters may not be nested within each other
+   * (in Chains or Interleaves) to a depth of more than 20.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowFilter) + com.google.bigtable.v2.RowFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowFilter.class, + com.google.bigtable.v2.RowFilter.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (chainBuilder_ != null) { + chainBuilder_.clear(); + } + if (interleaveBuilder_ != null) { + interleaveBuilder_.clear(); + } + if (conditionBuilder_ != null) { + conditionBuilder_.clear(); + } + if (columnRangeFilterBuilder_ != null) { + columnRangeFilterBuilder_.clear(); + } + if (timestampRangeFilterBuilder_ != null) { + timestampRangeFilterBuilder_.clear(); + } + if (valueRangeFilterBuilder_ != null) { + valueRangeFilterBuilder_.clear(); + } + if (valueBitmaskFilterBuilder_ != null) { + valueBitmaskFilterBuilder_.clear(); + } + filterCase_ = 0; + filter_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter getDefaultInstanceForType() { + return com.google.bigtable.v2.RowFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter build() { + com.google.bigtable.v2.RowFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowFilter buildPartial() { + com.google.bigtable.v2.RowFilter result = new com.google.bigtable.v2.RowFilter(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.RowFilter result) { + result.filterCase_ = filterCase_; + result.filter_ = this.filter_; + if (filterCase_ == 1 && chainBuilder_ != null) { + result.filter_ = chainBuilder_.build(); + } + if (filterCase_ == 2 && interleaveBuilder_ != null) { + result.filter_ = interleaveBuilder_.build(); + } + if (filterCase_ == 3 && conditionBuilder_ != null) { + result.filter_ = conditionBuilder_.build(); + } + if (filterCase_ == 7 && columnRangeFilterBuilder_ != null) { + result.filter_ = columnRangeFilterBuilder_.build(); + } + if (filterCase_ == 8 && timestampRangeFilterBuilder_ != null) { + result.filter_ = timestampRangeFilterBuilder_.build(); + } + if (filterCase_ == 15 && valueRangeFilterBuilder_ != null) { + result.filter_ = valueRangeFilterBuilder_.build(); + } + if (filterCase_ == 20 && valueBitmaskFilterBuilder_ != null) { + result.filter_ = valueBitmaskFilterBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowFilter) { + return mergeFrom((com.google.bigtable.v2.RowFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowFilter other) { + if (other == com.google.bigtable.v2.RowFilter.getDefaultInstance()) return this; + switch (other.getFilterCase()) { + case CHAIN: + { + mergeChain(other.getChain()); + break; + } + case INTERLEAVE: + { + mergeInterleave(other.getInterleave()); + break; + } + case CONDITION: + { + mergeCondition(other.getCondition()); + break; + } + case SINK: + { + setSink(other.getSink()); + break; + } + case PASS_ALL_FILTER: + { + setPassAllFilter(other.getPassAllFilter()); + break; + } + case BLOCK_ALL_FILTER: + { + setBlockAllFilter(other.getBlockAllFilter()); + break; + } + case ROW_KEY_REGEX_FILTER: + { + setRowKeyRegexFilter(other.getRowKeyRegexFilter()); + break; + } + case ROW_SAMPLE_FILTER: + { + setRowSampleFilter(other.getRowSampleFilter()); + break; + } + case FAMILY_NAME_REGEX_FILTER: + { + filterCase_ = 5; + filter_ = other.filter_; + onChanged(); + break; + } + case COLUMN_QUALIFIER_REGEX_FILTER: + { + setColumnQualifierRegexFilter(other.getColumnQualifierRegexFilter()); + break; + } + case COLUMN_RANGE_FILTER: + { + mergeColumnRangeFilter(other.getColumnRangeFilter()); + break; + } + case TIMESTAMP_RANGE_FILTER: + { + mergeTimestampRangeFilter(other.getTimestampRangeFilter()); + break; + } + case VALUE_REGEX_FILTER: + { + setValueRegexFilter(other.getValueRegexFilter()); + break; + } + case VALUE_RANGE_FILTER: + { + mergeValueRangeFilter(other.getValueRangeFilter()); + break; + } + case CELLS_PER_ROW_OFFSET_FILTER: + { + setCellsPerRowOffsetFilter(other.getCellsPerRowOffsetFilter()); + break; + } + case CELLS_PER_ROW_LIMIT_FILTER: + { + setCellsPerRowLimitFilter(other.getCellsPerRowLimitFilter()); + break; + } + case CELLS_PER_COLUMN_LIMIT_FILTER: + { + setCellsPerColumnLimitFilter(other.getCellsPerColumnLimitFilter()); + break; + } + case STRIP_VALUE_TRANSFORMER: + { + setStripValueTransformer(other.getStripValueTransformer()); + break; + } + case APPLY_LABEL_TRANSFORMER: + { + filterCase_ = 19; + filter_ = other.filter_; + onChanged(); + break; + } + case VALUE_BITMASK_FILTER: + { + mergeValueBitmaskFilter(other.getValueBitmaskFilter()); + break; + } + case FILTER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetChainFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetInterleaveFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetConditionFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 3; + break; + } // case 26 + case 34: + { + filter_ = input.readBytes(); + filterCase_ = 4; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + filterCase_ = 5; + filter_ = s; + break; + } // case 42 + case 50: + { + filter_ = input.readBytes(); + filterCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetColumnRangeFilterFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetTimestampRangeFilterFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 8; + break; + } // case 66 + case 74: + { + filter_ = input.readBytes(); + filterCase_ = 9; + break; + } // case 74 + case 80: + { + filter_ = input.readInt32(); + filterCase_ = 10; + break; + } // case 80 + case 88: + { + filter_ = input.readInt32(); + filterCase_ = 11; + break; + } // case 88 + case 96: + { + filter_ = input.readInt32(); + filterCase_ = 12; + break; + } // case 96 + case 104: + { + filter_ = input.readBool(); + filterCase_ = 13; + break; + } // case 104 + case 113: + { + filter_ = input.readDouble(); + filterCase_ = 14; + break; + } // case 113 + case 122: + { + input.readMessage( + internalGetValueRangeFilterFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 15; + break; + } // case 122 + case 128: + { + filter_ = input.readBool(); + filterCase_ = 16; + break; + } // case 128 + case 136: + { + filter_ = input.readBool(); + filterCase_ = 17; + break; + } // case 136 + case 144: + { + filter_ = input.readBool(); + filterCase_ = 18; + break; + } // case 144 + case 154: + { + java.lang.String s = input.readStringRequireUtf8(); + filterCase_ = 19; + filter_ = s; + break; + } // case 154 + case 162: + { + input.readMessage( + internalGetValueBitmaskFilterFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 20; + break; + } // case 162 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int filterCase_ = 0; + private java.lang.Object filter_; + + public FilterCase getFilterCase() { + return FilterCase.forNumber(filterCase_); + } + + public Builder clearFilter() { + filterCase_ = 0; + filter_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Chain, + com.google.bigtable.v2.RowFilter.Chain.Builder, + com.google.bigtable.v2.RowFilter.ChainOrBuilder> + chainBuilder_; + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return Whether the chain field is set. + */ + @java.lang.Override + public boolean hasChain() { + return filterCase_ == 1; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return The chain. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Chain getChain() { + if (chainBuilder_ == null) { + if (filterCase_ == 1) { + return (com.google.bigtable.v2.RowFilter.Chain) filter_; + } + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } else { + if (filterCase_ == 1) { + return chainBuilder_.getMessage(); + } + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + public Builder setChain(com.google.bigtable.v2.RowFilter.Chain value) { + if (chainBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + chainBuilder_.setMessage(value); + } + filterCase_ = 1; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + public Builder setChain(com.google.bigtable.v2.RowFilter.Chain.Builder builderForValue) { + if (chainBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + chainBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 1; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + public Builder mergeChain(com.google.bigtable.v2.RowFilter.Chain value) { + if (chainBuilder_ == null) { + if (filterCase_ == 1 + && filter_ != com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.RowFilter.Chain.newBuilder( + (com.google.bigtable.v2.RowFilter.Chain) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 1) { + chainBuilder_.mergeFrom(value); + } else { + chainBuilder_.setMessage(value); + } + } + filterCase_ = 1; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + public Builder clearChain() { + if (chainBuilder_ == null) { + if (filterCase_ == 1) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 1) { + filterCase_ = 0; + filter_ = null; + } + chainBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + public com.google.bigtable.v2.RowFilter.Chain.Builder getChainBuilder() { + return internalGetChainFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { + if ((filterCase_ == 1) && (chainBuilder_ != null)) { + return chainBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 1) { + return (com.google.bigtable.v2.RowFilter.Chain) filter_; + } + return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies several RowFilters to the data in sequence, progressively
+     * narrowing the results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Chain, + com.google.bigtable.v2.RowFilter.Chain.Builder, + com.google.bigtable.v2.RowFilter.ChainOrBuilder> + internalGetChainFieldBuilder() { + if (chainBuilder_ == null) { + if (!(filterCase_ == 1)) { + filter_ = com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); + } + chainBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Chain, + com.google.bigtable.v2.RowFilter.Chain.Builder, + com.google.bigtable.v2.RowFilter.ChainOrBuilder>( + (com.google.bigtable.v2.RowFilter.Chain) filter_, + getParentForChildren(), + isClean()); + filter_ = null; + } + filterCase_ = 1; + onChanged(); + return chainBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Interleave, + com.google.bigtable.v2.RowFilter.Interleave.Builder, + com.google.bigtable.v2.RowFilter.InterleaveOrBuilder> + interleaveBuilder_; + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return Whether the interleave field is set. + */ + @java.lang.Override + public boolean hasInterleave() { + return filterCase_ == 2; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return The interleave. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Interleave getInterleave() { + if (interleaveBuilder_ == null) { + if (filterCase_ == 2) { + return (com.google.bigtable.v2.RowFilter.Interleave) filter_; + } + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } else { + if (filterCase_ == 2) { + return interleaveBuilder_.getMessage(); + } + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + public Builder setInterleave(com.google.bigtable.v2.RowFilter.Interleave value) { + if (interleaveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + interleaveBuilder_.setMessage(value); + } + filterCase_ = 2; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + public Builder setInterleave( + com.google.bigtable.v2.RowFilter.Interleave.Builder builderForValue) { + if (interleaveBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + interleaveBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 2; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + public Builder mergeInterleave(com.google.bigtable.v2.RowFilter.Interleave value) { + if (interleaveBuilder_ == null) { + if (filterCase_ == 2 + && filter_ != com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.RowFilter.Interleave.newBuilder( + (com.google.bigtable.v2.RowFilter.Interleave) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 2) { + interleaveBuilder_.mergeFrom(value); + } else { + interleaveBuilder_.setMessage(value); + } + } + filterCase_ = 2; + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + public Builder clearInterleave() { + if (interleaveBuilder_ == null) { + if (filterCase_ == 2) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 2) { + filterCase_ = 0; + filter_ = null; + } + interleaveBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + public com.google.bigtable.v2.RowFilter.Interleave.Builder getInterleaveBuilder() { + return internalGetInterleaveFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuilder() { + if ((filterCase_ == 2) && (interleaveBuilder_ != null)) { + return interleaveBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 2) { + return (com.google.bigtable.v2.RowFilter.Interleave) filter_; + } + return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies several RowFilters to the data in parallel and combines the
+     * results.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Interleave, + com.google.bigtable.v2.RowFilter.Interleave.Builder, + com.google.bigtable.v2.RowFilter.InterleaveOrBuilder> + internalGetInterleaveFieldBuilder() { + if (interleaveBuilder_ == null) { + if (!(filterCase_ == 2)) { + filter_ = com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); + } + interleaveBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Interleave, + com.google.bigtable.v2.RowFilter.Interleave.Builder, + com.google.bigtable.v2.RowFilter.InterleaveOrBuilder>( + (com.google.bigtable.v2.RowFilter.Interleave) filter_, + getParentForChildren(), + isClean()); + filter_ = null; + } + filterCase_ = 2; + onChanged(); + return interleaveBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Condition, + com.google.bigtable.v2.RowFilter.Condition.Builder, + com.google.bigtable.v2.RowFilter.ConditionOrBuilder> + conditionBuilder_; + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return filterCase_ == 3; + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return The condition. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.Condition getCondition() { + if (conditionBuilder_ == null) { + if (filterCase_ == 3) { + return (com.google.bigtable.v2.RowFilter.Condition) filter_; + } + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } else { + if (filterCase_ == 3) { + return conditionBuilder_.getMessage(); + } + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + public Builder setCondition(com.google.bigtable.v2.RowFilter.Condition value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + conditionBuilder_.setMessage(value); + } + filterCase_ = 3; + return this; + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + public Builder setCondition( + com.google.bigtable.v2.RowFilter.Condition.Builder builderForValue) { + if (conditionBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 3; + return this; + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + public Builder mergeCondition(com.google.bigtable.v2.RowFilter.Condition value) { + if (conditionBuilder_ == null) { + if (filterCase_ == 3 + && filter_ != com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.RowFilter.Condition.newBuilder( + (com.google.bigtable.v2.RowFilter.Condition) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 3) { + conditionBuilder_.mergeFrom(value); + } else { + conditionBuilder_.setMessage(value); + } + } + filterCase_ = 3; + return this; + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + public Builder clearCondition() { + if (conditionBuilder_ == null) { + if (filterCase_ == 3) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 3) { + filterCase_ = 0; + filter_ = null; + } + conditionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + public com.google.bigtable.v2.RowFilter.Condition.Builder getConditionBuilder() { + return internalGetConditionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder() { + if ((filterCase_ == 3) && (conditionBuilder_ != null)) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 3) { + return (com.google.bigtable.v2.RowFilter.Condition) filter_; + } + return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Applies one of two possible RowFilters to the data based on the output of
+     * a predicate RowFilter.
+     * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Condition, + com.google.bigtable.v2.RowFilter.Condition.Builder, + com.google.bigtable.v2.RowFilter.ConditionOrBuilder> + internalGetConditionFieldBuilder() { + if (conditionBuilder_ == null) { + if (!(filterCase_ == 3)) { + filter_ = com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); + } + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter.Condition, + com.google.bigtable.v2.RowFilter.Condition.Builder, + com.google.bigtable.v2.RowFilter.ConditionOrBuilder>( + (com.google.bigtable.v2.RowFilter.Condition) filter_, + getParentForChildren(), + isClean()); + filter_ = null; + } + filterCase_ = 3; + onChanged(); + return conditionBuilder_; + } + + /** + * + * + *
+     * ADVANCED USE ONLY.
+     * Hook for introspection into the RowFilter. Outputs all cells directly to
+     * the output of the read rather than to any parent filter. Consider the
+     * following example:
+     *
+     * Chain(
+     * FamilyRegex("A"),
+     * Interleave(
+     * All(),
+     * Chain(Label("foo"), Sink())
+     * ),
+     * QualifierRegex("B")
+     * )
+     *
+     * A,A,1,w
+     * A,B,2,x
+     * B,B,4,z
+     * |
+     * FamilyRegex("A")
+     * |
+     * A,A,1,w
+     * A,B,2,x
+     * |
+     * +------------+-------------+
+     * |                          |
+     * All()                    Label(foo)
+     * |                          |
+     * A,A,1,w              A,A,1,w,labels:[foo]
+     * A,B,2,x              A,B,2,x,labels:[foo]
+     * |                          |
+     * |                        Sink() --------------+
+     * |                          |                  |
+     * +------------+      x------+          A,A,1,w,labels:[foo]
+     * |                        A,B,2,x,labels:[foo]
+     * A,A,1,w                             |
+     * A,B,2,x                             |
+     * |                                |
+     * QualifierRegex("B")                      |
+     * |                                |
+     * A,B,2,x                             |
+     * |                                |
+     * +--------------------------------+
+     * |
+     * A,A,1,w,labels:[foo]
+     * A,B,2,x,labels:[foo]  // could be switched
+     * A,B,2,x               // could be switched
+     *
+     * Despite being excluded by the qualifier filter, a copy of every cell
+     * that reaches the sink is present in the final result.
+     *
+     * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+     * duplicate cells are possible, and appear in an unspecified mutual order.
+     * In this case we have a duplicate with column "A:B" and timestamp 2,
+     * because one copy passed through the all filter while the other was
+     * passed through the label and sink. Note that one copy has label "foo",
+     * while the other does not.
+     *
+     * Cannot be used within the `predicate_filter`, `true_filter`, or
+     * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+     * 
+ * + * bool sink = 16; + * + * @return Whether the sink field is set. + */ + public boolean hasSink() { + return filterCase_ == 16; + } + + /** + * + * + *
+     * ADVANCED USE ONLY.
+     * Hook for introspection into the RowFilter. Outputs all cells directly to
+     * the output of the read rather than to any parent filter. Consider the
+     * following example:
+     *
+     * Chain(
+     * FamilyRegex("A"),
+     * Interleave(
+     * All(),
+     * Chain(Label("foo"), Sink())
+     * ),
+     * QualifierRegex("B")
+     * )
+     *
+     * A,A,1,w
+     * A,B,2,x
+     * B,B,4,z
+     * |
+     * FamilyRegex("A")
+     * |
+     * A,A,1,w
+     * A,B,2,x
+     * |
+     * +------------+-------------+
+     * |                          |
+     * All()                    Label(foo)
+     * |                          |
+     * A,A,1,w              A,A,1,w,labels:[foo]
+     * A,B,2,x              A,B,2,x,labels:[foo]
+     * |                          |
+     * |                        Sink() --------------+
+     * |                          |                  |
+     * +------------+      x------+          A,A,1,w,labels:[foo]
+     * |                        A,B,2,x,labels:[foo]
+     * A,A,1,w                             |
+     * A,B,2,x                             |
+     * |                                |
+     * QualifierRegex("B")                      |
+     * |                                |
+     * A,B,2,x                             |
+     * |                                |
+     * +--------------------------------+
+     * |
+     * A,A,1,w,labels:[foo]
+     * A,B,2,x,labels:[foo]  // could be switched
+     * A,B,2,x               // could be switched
+     *
+     * Despite being excluded by the qualifier filter, a copy of every cell
+     * that reaches the sink is present in the final result.
+     *
+     * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+     * duplicate cells are possible, and appear in an unspecified mutual order.
+     * In this case we have a duplicate with column "A:B" and timestamp 2,
+     * because one copy passed through the all filter while the other was
+     * passed through the label and sink. Note that one copy has label "foo",
+     * while the other does not.
+     *
+     * Cannot be used within the `predicate_filter`, `true_filter`, or
+     * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+     * 
+ * + * bool sink = 16; + * + * @return The sink. + */ + public boolean getSink() { + if (filterCase_ == 16) { + return (java.lang.Boolean) filter_; + } + return false; + } + + /** + * + * + *
+     * ADVANCED USE ONLY.
+     * Hook for introspection into the RowFilter. Outputs all cells directly to
+     * the output of the read rather than to any parent filter. Consider the
+     * following example:
+     *
+     * Chain(
+     * FamilyRegex("A"),
+     * Interleave(
+     * All(),
+     * Chain(Label("foo"), Sink())
+     * ),
+     * QualifierRegex("B")
+     * )
+     *
+     * A,A,1,w
+     * A,B,2,x
+     * B,B,4,z
+     * |
+     * FamilyRegex("A")
+     * |
+     * A,A,1,w
+     * A,B,2,x
+     * |
+     * +------------+-------------+
+     * |                          |
+     * All()                    Label(foo)
+     * |                          |
+     * A,A,1,w              A,A,1,w,labels:[foo]
+     * A,B,2,x              A,B,2,x,labels:[foo]
+     * |                          |
+     * |                        Sink() --------------+
+     * |                          |                  |
+     * +------------+      x------+          A,A,1,w,labels:[foo]
+     * |                        A,B,2,x,labels:[foo]
+     * A,A,1,w                             |
+     * A,B,2,x                             |
+     * |                                |
+     * QualifierRegex("B")                      |
+     * |                                |
+     * A,B,2,x                             |
+     * |                                |
+     * +--------------------------------+
+     * |
+     * A,A,1,w,labels:[foo]
+     * A,B,2,x,labels:[foo]  // could be switched
+     * A,B,2,x               // could be switched
+     *
+     * Despite being excluded by the qualifier filter, a copy of every cell
+     * that reaches the sink is present in the final result.
+     *
+     * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+     * duplicate cells are possible, and appear in an unspecified mutual order.
+     * In this case we have a duplicate with column "A:B" and timestamp 2,
+     * because one copy passed through the all filter while the other was
+     * passed through the label and sink. Note that one copy has label "foo",
+     * while the other does not.
+     *
+     * Cannot be used within the `predicate_filter`, `true_filter`, or
+     * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+     * 
+ * + * bool sink = 16; + * + * @param value The sink to set. + * @return This builder for chaining. + */ + public Builder setSink(boolean value) { + + filterCase_ = 16; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * ADVANCED USE ONLY.
+     * Hook for introspection into the RowFilter. Outputs all cells directly to
+     * the output of the read rather than to any parent filter. Consider the
+     * following example:
+     *
+     * Chain(
+     * FamilyRegex("A"),
+     * Interleave(
+     * All(),
+     * Chain(Label("foo"), Sink())
+     * ),
+     * QualifierRegex("B")
+     * )
+     *
+     * A,A,1,w
+     * A,B,2,x
+     * B,B,4,z
+     * |
+     * FamilyRegex("A")
+     * |
+     * A,A,1,w
+     * A,B,2,x
+     * |
+     * +------------+-------------+
+     * |                          |
+     * All()                    Label(foo)
+     * |                          |
+     * A,A,1,w              A,A,1,w,labels:[foo]
+     * A,B,2,x              A,B,2,x,labels:[foo]
+     * |                          |
+     * |                        Sink() --------------+
+     * |                          |                  |
+     * +------------+      x------+          A,A,1,w,labels:[foo]
+     * |                        A,B,2,x,labels:[foo]
+     * A,A,1,w                             |
+     * A,B,2,x                             |
+     * |                                |
+     * QualifierRegex("B")                      |
+     * |                                |
+     * A,B,2,x                             |
+     * |                                |
+     * +--------------------------------+
+     * |
+     * A,A,1,w,labels:[foo]
+     * A,B,2,x,labels:[foo]  // could be switched
+     * A,B,2,x               // could be switched
+     *
+     * Despite being excluded by the qualifier filter, a copy of every cell
+     * that reaches the sink is present in the final result.
+     *
+     * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+     * duplicate cells are possible, and appear in an unspecified mutual order.
+     * In this case we have a duplicate with column "A:B" and timestamp 2,
+     * because one copy passed through the all filter while the other was
+     * passed through the label and sink. Note that one copy has label "foo",
+     * while the other does not.
+     *
+     * Cannot be used within the `predicate_filter`, `true_filter`, or
+     * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+     * 
+ * + * bool sink = 16; + * + * @return This builder for chaining. + */ + public Builder clearSink() { + if (filterCase_ == 16) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches all cells, regardless of input. Functionally equivalent to
+     * leaving `filter` unset, but included for completeness.
+     * 
+ * + * bool pass_all_filter = 17; + * + * @return Whether the passAllFilter field is set. + */ + public boolean hasPassAllFilter() { + return filterCase_ == 17; + } + + /** + * + * + *
+     * Matches all cells, regardless of input. Functionally equivalent to
+     * leaving `filter` unset, but included for completeness.
+     * 
+ * + * bool pass_all_filter = 17; + * + * @return The passAllFilter. + */ + public boolean getPassAllFilter() { + if (filterCase_ == 17) { + return (java.lang.Boolean) filter_; + } + return false; + } + + /** + * + * + *
+     * Matches all cells, regardless of input. Functionally equivalent to
+     * leaving `filter` unset, but included for completeness.
+     * 
+ * + * bool pass_all_filter = 17; + * + * @param value The passAllFilter to set. + * @return This builder for chaining. + */ + public Builder setPassAllFilter(boolean value) { + + filterCase_ = 17; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches all cells, regardless of input. Functionally equivalent to
+     * leaving `filter` unset, but included for completeness.
+     * 
+ * + * bool pass_all_filter = 17; + * + * @return This builder for chaining. + */ + public Builder clearPassAllFilter() { + if (filterCase_ == 17) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Does not match any cells, regardless of input. Useful for temporarily
+     * disabling just part of a filter.
+     * 
+ * + * bool block_all_filter = 18; + * + * @return Whether the blockAllFilter field is set. + */ + public boolean hasBlockAllFilter() { + return filterCase_ == 18; + } + + /** + * + * + *
+     * Does not match any cells, regardless of input. Useful for temporarily
+     * disabling just part of a filter.
+     * 
+ * + * bool block_all_filter = 18; + * + * @return The blockAllFilter. + */ + public boolean getBlockAllFilter() { + if (filterCase_ == 18) { + return (java.lang.Boolean) filter_; + } + return false; + } + + /** + * + * + *
+     * Does not match any cells, regardless of input. Useful for temporarily
+     * disabling just part of a filter.
+     * 
+ * + * bool block_all_filter = 18; + * + * @param value The blockAllFilter to set. + * @return This builder for chaining. + */ + public Builder setBlockAllFilter(boolean value) { + + filterCase_ = 18; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Does not match any cells, regardless of input. Useful for temporarily
+     * disabling just part of a filter.
+     * 
+ * + * bool block_all_filter = 18; + * + * @return This builder for chaining. + */ + public Builder clearBlockAllFilter() { + if (filterCase_ == 18) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+     * other words, passes through the entire row when the key matches, and
+     * otherwise produces an empty row.
+     * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary key.
+     * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return Whether the rowKeyRegexFilter field is set. + */ + public boolean hasRowKeyRegexFilter() { + return filterCase_ == 4; + } + + /** + * + * + *
+     * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+     * other words, passes through the entire row when the key matches, and
+     * otherwise produces an empty row.
+     * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary key.
+     * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return The rowKeyRegexFilter. + */ + public com.google.protobuf.ByteString getRowKeyRegexFilter() { + if (filterCase_ == 4) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+     * other words, passes through the entire row when the key matches, and
+     * otherwise produces an empty row.
+     * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary key.
+     * 
+ * + * bytes row_key_regex_filter = 4; + * + * @param value The rowKeyRegexFilter to set. + * @return This builder for chaining. + */ + public Builder setRowKeyRegexFilter(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + filterCase_ = 4; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+     * other words, passes through the entire row when the key matches, and
+     * otherwise produces an empty row.
+     * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary key.
+     * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearRowKeyRegexFilter() { + if (filterCase_ == 4) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches all cells from a row with probability p, and matches no cells
+     * from the row with probability 1-p.
+     * 
+ * + * double row_sample_filter = 14; + * + * @return Whether the rowSampleFilter field is set. + */ + public boolean hasRowSampleFilter() { + return filterCase_ == 14; + } + + /** + * + * + *
+     * Matches all cells from a row with probability p, and matches no cells
+     * from the row with probability 1-p.
+     * 
+ * + * double row_sample_filter = 14; + * + * @return The rowSampleFilter. + */ + public double getRowSampleFilter() { + if (filterCase_ == 14) { + return (java.lang.Double) filter_; + } + return 0D; + } + + /** + * + * + *
+     * Matches all cells from a row with probability p, and matches no cells
+     * from the row with probability 1-p.
+     * 
+ * + * double row_sample_filter = 14; + * + * @param value The rowSampleFilter to set. + * @return This builder for chaining. + */ + public Builder setRowSampleFilter(double value) { + + filterCase_ = 14; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches all cells from a row with probability p, and matches no cells
+     * from the row with probability 1-p.
+     * 
+ * + * double row_sample_filter = 14; + * + * @return This builder for chaining. + */ + public Builder clearRowSampleFilter() { + if (filterCase_ == 14) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @return Whether the familyNameRegexFilter field is set. + */ + @java.lang.Override + public boolean hasFamilyNameRegexFilter() { + return filterCase_ == 5; + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @return The familyNameRegexFilter. + */ + @java.lang.Override + public java.lang.String getFamilyNameRegexFilter() { + java.lang.Object ref = ""; + if (filterCase_ == 5) { + ref = filter_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (filterCase_ == 5) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @return The bytes for familyNameRegexFilter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFamilyNameRegexFilterBytes() { + java.lang.Object ref = ""; + if (filterCase_ == 5) { + ref = filter_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (filterCase_ == 5) { + filter_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @param value The familyNameRegexFilter to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameRegexFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filterCase_ = 5; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFamilyNameRegexFilter() { + if (filterCase_ == 5) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells from columns whose families satisfy the given RE2
+     * regex. For technical reasons, the regex must not contain the `:`
+     * character, even if it is not being used as a literal.
+     * Note that, since column families cannot contain the new line character
+     * `\n`, it is sufficient to use `.` as a full wildcard when matching
+     * column family names.
+     * 
+ * + * string family_name_regex_filter = 5; + * + * @param value The bytes for familyNameRegexFilter to set. + * @return This builder for chaining. + */ + public Builder setFamilyNameRegexFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filterCase_ = 5; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only cells from columns whose qualifiers satisfy the given RE2
+     * regex.
+     * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+     * escape sequence must be used if a true wildcard is desired. The `.`
+     * character will not match the new line character `\n`, which may be
+     * present in a binary qualifier.
+     * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return Whether the columnQualifierRegexFilter field is set. + */ + public boolean hasColumnQualifierRegexFilter() { + return filterCase_ == 6; + } + + /** + * + * + *
+     * Matches only cells from columns whose qualifiers satisfy the given RE2
+     * regex.
+     * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+     * escape sequence must be used if a true wildcard is desired. The `.`
+     * character will not match the new line character `\n`, which may be
+     * present in a binary qualifier.
+     * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return The columnQualifierRegexFilter. + */ + public com.google.protobuf.ByteString getColumnQualifierRegexFilter() { + if (filterCase_ == 6) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Matches only cells from columns whose qualifiers satisfy the given RE2
+     * regex.
+     * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+     * escape sequence must be used if a true wildcard is desired. The `.`
+     * character will not match the new line character `\n`, which may be
+     * present in a binary qualifier.
+     * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @param value The columnQualifierRegexFilter to set. + * @return This builder for chaining. + */ + public Builder setColumnQualifierRegexFilter(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + filterCase_ = 6; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only cells from columns whose qualifiers satisfy the given RE2
+     * regex.
+     * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+     * escape sequence must be used if a true wildcard is desired. The `.`
+     * character will not match the new line character `\n`, which may be
+     * present in a binary qualifier.
+     * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return This builder for chaining. + */ + public Builder clearColumnQualifierRegexFilter() { + if (filterCase_ == 6) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ColumnRange, + com.google.bigtable.v2.ColumnRange.Builder, + com.google.bigtable.v2.ColumnRangeOrBuilder> + columnRangeFilterBuilder_; + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return Whether the columnRangeFilter field is set. + */ + @java.lang.Override + public boolean hasColumnRangeFilter() { + return filterCase_ == 7; + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return The columnRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnRange getColumnRangeFilter() { + if (columnRangeFilterBuilder_ == null) { + if (filterCase_ == 7) { + return (com.google.bigtable.v2.ColumnRange) filter_; + } + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } else { + if (filterCase_ == 7) { + return columnRangeFilterBuilder_.getMessage(); + } + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + public Builder setColumnRangeFilter(com.google.bigtable.v2.ColumnRange value) { + if (columnRangeFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + columnRangeFilterBuilder_.setMessage(value); + } + filterCase_ = 7; + return this; + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + public Builder setColumnRangeFilter( + com.google.bigtable.v2.ColumnRange.Builder builderForValue) { + if (columnRangeFilterBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + columnRangeFilterBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 7; + return this; + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + public Builder mergeColumnRangeFilter(com.google.bigtable.v2.ColumnRange value) { + if (columnRangeFilterBuilder_ == null) { + if (filterCase_ == 7 + && filter_ != com.google.bigtable.v2.ColumnRange.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.ColumnRange.newBuilder( + (com.google.bigtable.v2.ColumnRange) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 7) { + columnRangeFilterBuilder_.mergeFrom(value); + } else { + columnRangeFilterBuilder_.setMessage(value); + } + } + filterCase_ = 7; + return this; + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + public Builder clearColumnRangeFilter() { + if (columnRangeFilterBuilder_ == null) { + if (filterCase_ == 7) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 7) { + filterCase_ = 0; + filter_ = null; + } + columnRangeFilterBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + public com.google.bigtable.v2.ColumnRange.Builder getColumnRangeFilterBuilder() { + return internalGetColumnRangeFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder() { + if ((filterCase_ == 7) && (columnRangeFilterBuilder_ != null)) { + return columnRangeFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 7) { + return (com.google.bigtable.v2.ColumnRange) filter_; + } + return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells from columns within the given range.
+     * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ColumnRange, + com.google.bigtable.v2.ColumnRange.Builder, + com.google.bigtable.v2.ColumnRangeOrBuilder> + internalGetColumnRangeFilterFieldBuilder() { + if (columnRangeFilterBuilder_ == null) { + if (!(filterCase_ == 7)) { + filter_ = com.google.bigtable.v2.ColumnRange.getDefaultInstance(); + } + columnRangeFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ColumnRange, + com.google.bigtable.v2.ColumnRange.Builder, + com.google.bigtable.v2.ColumnRangeOrBuilder>( + (com.google.bigtable.v2.ColumnRange) filter_, getParentForChildren(), isClean()); + filter_ = null; + } + filterCase_ = 7; + onChanged(); + return columnRangeFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder> + timestampRangeFilterBuilder_; + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return Whether the timestampRangeFilter field is set. + */ + @java.lang.Override + public boolean hasTimestampRangeFilter() { + return filterCase_ == 8; + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return The timestampRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRange getTimestampRangeFilter() { + if (timestampRangeFilterBuilder_ == null) { + if (filterCase_ == 8) { + return (com.google.bigtable.v2.TimestampRange) filter_; + } + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } else { + if (filterCase_ == 8) { + return timestampRangeFilterBuilder_.getMessage(); + } + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + public Builder setTimestampRangeFilter(com.google.bigtable.v2.TimestampRange value) { + if (timestampRangeFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + timestampRangeFilterBuilder_.setMessage(value); + } + filterCase_ = 8; + return this; + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + public Builder setTimestampRangeFilter( + com.google.bigtable.v2.TimestampRange.Builder builderForValue) { + if (timestampRangeFilterBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + timestampRangeFilterBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 8; + return this; + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + public Builder mergeTimestampRangeFilter(com.google.bigtable.v2.TimestampRange value) { + if (timestampRangeFilterBuilder_ == null) { + if (filterCase_ == 8 + && filter_ != com.google.bigtable.v2.TimestampRange.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.TimestampRange.newBuilder( + (com.google.bigtable.v2.TimestampRange) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 8) { + timestampRangeFilterBuilder_.mergeFrom(value); + } else { + timestampRangeFilterBuilder_.setMessage(value); + } + } + filterCase_ = 8; + return this; + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + public Builder clearTimestampRangeFilter() { + if (timestampRangeFilterBuilder_ == null) { + if (filterCase_ == 8) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 8) { + filterCase_ = 0; + filter_ = null; + } + timestampRangeFilterBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + public com.google.bigtable.v2.TimestampRange.Builder getTimestampRangeFilterBuilder() { + return internalGetTimestampRangeFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + @java.lang.Override + public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrBuilder() { + if ((filterCase_ == 8) && (timestampRangeFilterBuilder_ != null)) { + return timestampRangeFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 8) { + return (com.google.bigtable.v2.TimestampRange) filter_; + } + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with timestamps within the given range.
+     * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder> + internalGetTimestampRangeFilterFieldBuilder() { + if (timestampRangeFilterBuilder_ == null) { + if (!(filterCase_ == 8)) { + filter_ = com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + timestampRangeFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TimestampRange, + com.google.bigtable.v2.TimestampRange.Builder, + com.google.bigtable.v2.TimestampRangeOrBuilder>( + (com.google.bigtable.v2.TimestampRange) filter_, getParentForChildren(), isClean()); + filter_ = null; + } + filterCase_ = 8; + onChanged(); + return timestampRangeFilterBuilder_; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the given regular expression.
+     * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary value.
+     * 
+ * + * bytes value_regex_filter = 9; + * + * @return Whether the valueRegexFilter field is set. + */ + public boolean hasValueRegexFilter() { + return filterCase_ == 9; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the given regular expression.
+     * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary value.
+     * 
+ * + * bytes value_regex_filter = 9; + * + * @return The valueRegexFilter. + */ + public com.google.protobuf.ByteString getValueRegexFilter() { + if (filterCase_ == 9) { + return (com.google.protobuf.ByteString) filter_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the given regular expression.
+     * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary value.
+     * 
+ * + * bytes value_regex_filter = 9; + * + * @param value The valueRegexFilter to set. + * @return This builder for chaining. + */ + public Builder setValueRegexFilter(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + filterCase_ = 9; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the given regular expression.
+     * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+     * sequence must be used if a true wildcard is desired. The `.` character
+     * will not match the new line character `\n`, which may be present in a
+     * binary value.
+     * 
+ * + * bytes value_regex_filter = 9; + * + * @return This builder for chaining. + */ + public Builder clearValueRegexFilter() { + if (filterCase_ == 9) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueRange, + com.google.bigtable.v2.ValueRange.Builder, + com.google.bigtable.v2.ValueRangeOrBuilder> + valueRangeFilterBuilder_; + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return Whether the valueRangeFilter field is set. + */ + @java.lang.Override + public boolean hasValueRangeFilter() { + return filterCase_ == 15; + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return The valueRangeFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ValueRange getValueRangeFilter() { + if (valueRangeFilterBuilder_ == null) { + if (filterCase_ == 15) { + return (com.google.bigtable.v2.ValueRange) filter_; + } + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } else { + if (filterCase_ == 15) { + return valueRangeFilterBuilder_.getMessage(); + } + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + public Builder setValueRangeFilter(com.google.bigtable.v2.ValueRange value) { + if (valueRangeFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + valueRangeFilterBuilder_.setMessage(value); + } + filterCase_ = 15; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + public Builder setValueRangeFilter(com.google.bigtable.v2.ValueRange.Builder builderForValue) { + if (valueRangeFilterBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + valueRangeFilterBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 15; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + public Builder mergeValueRangeFilter(com.google.bigtable.v2.ValueRange value) { + if (valueRangeFilterBuilder_ == null) { + if (filterCase_ == 15 + && filter_ != com.google.bigtable.v2.ValueRange.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.ValueRange.newBuilder( + (com.google.bigtable.v2.ValueRange) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 15) { + valueRangeFilterBuilder_.mergeFrom(value); + } else { + valueRangeFilterBuilder_.setMessage(value); + } + } + filterCase_ = 15; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + public Builder clearValueRangeFilter() { + if (valueRangeFilterBuilder_ == null) { + if (filterCase_ == 15) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 15) { + filterCase_ = 0; + filter_ = null; + } + valueRangeFilterBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + public com.google.bigtable.v2.ValueRange.Builder getValueRangeFilterBuilder() { + return internalGetValueRangeFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() { + if ((filterCase_ == 15) && (valueRangeFilterBuilder_ != null)) { + return valueRangeFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 15) { + return (com.google.bigtable.v2.ValueRange) filter_; + } + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with values that fall within the given range.
+     * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueRange, + com.google.bigtable.v2.ValueRange.Builder, + com.google.bigtable.v2.ValueRangeOrBuilder> + internalGetValueRangeFilterFieldBuilder() { + if (valueRangeFilterBuilder_ == null) { + if (!(filterCase_ == 15)) { + filter_ = com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + valueRangeFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueRange, + com.google.bigtable.v2.ValueRange.Builder, + com.google.bigtable.v2.ValueRangeOrBuilder>( + (com.google.bigtable.v2.ValueRange) filter_, getParentForChildren(), isClean()); + filter_ = null; + } + filterCase_ = 15; + onChanged(); + return valueRangeFilterBuilder_; + } + + /** + * + * + *
+     * Skips the first N cells of each row, matching all subsequent cells.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return Whether the cellsPerRowOffsetFilter field is set. + */ + public boolean hasCellsPerRowOffsetFilter() { + return filterCase_ == 10; + } + + /** + * + * + *
+     * Skips the first N cells of each row, matching all subsequent cells.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return The cellsPerRowOffsetFilter. + */ + public int getCellsPerRowOffsetFilter() { + if (filterCase_ == 10) { + return (java.lang.Integer) filter_; + } + return 0; + } + + /** + * + * + *
+     * Skips the first N cells of each row, matching all subsequent cells.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @param value The cellsPerRowOffsetFilter to set. + * @return This builder for chaining. + */ + public Builder setCellsPerRowOffsetFilter(int value) { + + filterCase_ = 10; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Skips the first N cells of each row, matching all subsequent cells.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return This builder for chaining. + */ + public Builder clearCellsPerRowOffsetFilter() { + if (filterCase_ == 10) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches only the first N cells of each row.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return Whether the cellsPerRowLimitFilter field is set. + */ + public boolean hasCellsPerRowLimitFilter() { + return filterCase_ == 11; + } + + /** + * + * + *
+     * Matches only the first N cells of each row.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return The cellsPerRowLimitFilter. + */ + public int getCellsPerRowLimitFilter() { + if (filterCase_ == 11) { + return (java.lang.Integer) filter_; + } + return 0; + } + + /** + * + * + *
+     * Matches only the first N cells of each row.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @param value The cellsPerRowLimitFilter to set. + * @return This builder for chaining. + */ + public Builder setCellsPerRowLimitFilter(int value) { + + filterCase_ = 11; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only the first N cells of each row.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return This builder for chaining. + */ + public Builder clearCellsPerRowLimitFilter() { + if (filterCase_ == 11) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Matches only the most recent N cells within each column. For example,
+     * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+     * skip all earlier cells in `foo:bar`, and then begin matching again in
+     * column `foo:bar2`.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return Whether the cellsPerColumnLimitFilter field is set. + */ + public boolean hasCellsPerColumnLimitFilter() { + return filterCase_ == 12; + } + + /** + * + * + *
+     * Matches only the most recent N cells within each column. For example,
+     * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+     * skip all earlier cells in `foo:bar`, and then begin matching again in
+     * column `foo:bar2`.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return The cellsPerColumnLimitFilter. + */ + public int getCellsPerColumnLimitFilter() { + if (filterCase_ == 12) { + return (java.lang.Integer) filter_; + } + return 0; + } + + /** + * + * + *
+     * Matches only the most recent N cells within each column. For example,
+     * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+     * skip all earlier cells in `foo:bar`, and then begin matching again in
+     * column `foo:bar2`.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @param value The cellsPerColumnLimitFilter to set. + * @return This builder for chaining. + */ + public Builder setCellsPerColumnLimitFilter(int value) { + + filterCase_ = 12; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Matches only the most recent N cells within each column. For example,
+     * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+     * skip all earlier cells in `foo:bar`, and then begin matching again in
+     * column `foo:bar2`.
+     * If duplicate cells are present, as is possible when using an Interleave,
+     * each copy of the cell is counted separately.
+     * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return This builder for chaining. + */ + public Builder clearCellsPerColumnLimitFilter() { + if (filterCase_ == 12) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Replaces each cell's value with the empty string.
+     * 
+ * + * bool strip_value_transformer = 13; + * + * @return Whether the stripValueTransformer field is set. + */ + public boolean hasStripValueTransformer() { + return filterCase_ == 13; + } + + /** + * + * + *
+     * Replaces each cell's value with the empty string.
+     * 
+ * + * bool strip_value_transformer = 13; + * + * @return The stripValueTransformer. + */ + public boolean getStripValueTransformer() { + if (filterCase_ == 13) { + return (java.lang.Boolean) filter_; + } + return false; + } + + /** + * + * + *
+     * Replaces each cell's value with the empty string.
+     * 
+ * + * bool strip_value_transformer = 13; + * + * @param value The stripValueTransformer to set. + * @return This builder for chaining. + */ + public Builder setStripValueTransformer(boolean value) { + + filterCase_ = 13; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Replaces each cell's value with the empty string.
+     * 
+ * + * bool strip_value_transformer = 13; + * + * @return This builder for chaining. + */ + public Builder clearStripValueTransformer() { + if (filterCase_ == 13) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @return Whether the applyLabelTransformer field is set. + */ + @java.lang.Override + public boolean hasApplyLabelTransformer() { + return filterCase_ == 19; + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @return The applyLabelTransformer. + */ + @java.lang.Override + public java.lang.String getApplyLabelTransformer() { + java.lang.Object ref = ""; + if (filterCase_ == 19) { + ref = filter_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (filterCase_ == 19) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @return The bytes for applyLabelTransformer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplyLabelTransformerBytes() { + java.lang.Object ref = ""; + if (filterCase_ == 19) { + ref = filter_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (filterCase_ == 19) { + filter_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @param value The applyLabelTransformer to set. + * @return This builder for chaining. + */ + public Builder setApplyLabelTransformer(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filterCase_ = 19; + filter_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @return This builder for chaining. + */ + public Builder clearApplyLabelTransformer() { + if (filterCase_ == 19) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Applies the given label to all cells in the output row. This allows
+     * the client to determine which results were produced from which part of
+     * the filter.
+     *
+     * Values must be at most 15 characters in length, and match the RE2
+     * pattern `[a-z0-9\\-]+`
+     *
+     * Due to a technical limitation, it is not currently possible to apply
+     * multiple labels to a cell. As a result, a Chain may have no more than
+     * one sub-filter which contains a `apply_label_transformer`. It is okay for
+     * an Interleave to contain multiple `apply_label_transformers`, as they
+     * will be applied to separate copies of the input. This may be relaxed in
+     * the future.
+     * 
+ * + * string apply_label_transformer = 19; + * + * @param value The bytes for applyLabelTransformer to set. + * @return This builder for chaining. + */ + public Builder setApplyLabelTransformerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filterCase_ = 19; + filter_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueBitmask, + com.google.bigtable.v2.ValueBitmask.Builder, + com.google.bigtable.v2.ValueBitmaskOrBuilder> + valueBitmaskFilterBuilder_; + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return Whether the valueBitmaskFilter field is set. + */ + @java.lang.Override + public boolean hasValueBitmaskFilter() { + return filterCase_ == 20; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return The valueBitmaskFilter. + */ + @java.lang.Override + public com.google.bigtable.v2.ValueBitmask getValueBitmaskFilter() { + if (valueBitmaskFilterBuilder_ == null) { + if (filterCase_ == 20) { + return (com.google.bigtable.v2.ValueBitmask) filter_; + } + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } else { + if (filterCase_ == 20) { + return valueBitmaskFilterBuilder_.getMessage(); + } + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + public Builder setValueBitmaskFilter(com.google.bigtable.v2.ValueBitmask value) { + if (valueBitmaskFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + valueBitmaskFilterBuilder_.setMessage(value); + } + filterCase_ = 20; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + public Builder setValueBitmaskFilter( + com.google.bigtable.v2.ValueBitmask.Builder builderForValue) { + if (valueBitmaskFilterBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + valueBitmaskFilterBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 20; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + public Builder mergeValueBitmaskFilter(com.google.bigtable.v2.ValueBitmask value) { + if (valueBitmaskFilterBuilder_ == null) { + if (filterCase_ == 20 + && filter_ != com.google.bigtable.v2.ValueBitmask.getDefaultInstance()) { + filter_ = + com.google.bigtable.v2.ValueBitmask.newBuilder( + (com.google.bigtable.v2.ValueBitmask) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 20) { + valueBitmaskFilterBuilder_.mergeFrom(value); + } else { + valueBitmaskFilterBuilder_.setMessage(value); + } + } + filterCase_ = 20; + return this; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + public Builder clearValueBitmaskFilter() { + if (valueBitmaskFilterBuilder_ == null) { + if (filterCase_ == 20) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 20) { + filterCase_ = 0; + filter_ = null; + } + valueBitmaskFilterBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + public com.google.bigtable.v2.ValueBitmask.Builder getValueBitmaskFilterBuilder() { + return internalGetValueBitmaskFilterFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueBitmaskOrBuilder getValueBitmaskFilterOrBuilder() { + if ((filterCase_ == 20) && (valueBitmaskFilterBuilder_ != null)) { + return valueBitmaskFilterBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 20) { + return (com.google.bigtable.v2.ValueBitmask) filter_; + } + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Matches only cells with values that satisfy the condition `(value & mask)
+     * == mask`.
+     * The mask length must exactly match the value length, otherwise the cell
+     * is not considered a match.
+     * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueBitmask, + com.google.bigtable.v2.ValueBitmask.Builder, + com.google.bigtable.v2.ValueBitmaskOrBuilder> + internalGetValueBitmaskFilterFieldBuilder() { + if (valueBitmaskFilterBuilder_ == null) { + if (!(filterCase_ == 20)) { + filter_ = com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + valueBitmaskFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ValueBitmask, + com.google.bigtable.v2.ValueBitmask.Builder, + com.google.bigtable.v2.ValueBitmaskOrBuilder>( + (com.google.bigtable.v2.ValueBitmask) filter_, getParentForChildren(), isClean()); + filter_ = null; + } + filterCase_ = 20; + onChanged(); + return valueBitmaskFilterBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowFilter) + private static final com.google.bigtable.v2.RowFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowFilter(); + } + + public static com.google.bigtable.v2.RowFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java new file mode 100644 index 000000000000..4a39276bf460 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java @@ -0,0 +1,892 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RowFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return Whether the chain field is set. + */ + boolean hasChain(); + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + * + * @return The chain. + */ + com.google.bigtable.v2.RowFilter.Chain getChain(); + + /** + * + * + *
+   * Applies several RowFilters to the data in sequence, progressively
+   * narrowing the results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Chain chain = 1; + */ + com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder(); + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return Whether the interleave field is set. + */ + boolean hasInterleave(); + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + * + * @return The interleave. + */ + com.google.bigtable.v2.RowFilter.Interleave getInterleave(); + + /** + * + * + *
+   * Applies several RowFilters to the data in parallel and combines the
+   * results.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Interleave interleave = 2; + */ + com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuilder(); + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + * + * @return The condition. + */ + com.google.bigtable.v2.RowFilter.Condition getCondition(); + + /** + * + * + *
+   * Applies one of two possible RowFilters to the data based on the output of
+   * a predicate RowFilter.
+   * 
+ * + * .google.bigtable.v2.RowFilter.Condition condition = 3; + */ + com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder(); + + /** + * + * + *
+   * ADVANCED USE ONLY.
+   * Hook for introspection into the RowFilter. Outputs all cells directly to
+   * the output of the read rather than to any parent filter. Consider the
+   * following example:
+   *
+   * Chain(
+   * FamilyRegex("A"),
+   * Interleave(
+   * All(),
+   * Chain(Label("foo"), Sink())
+   * ),
+   * QualifierRegex("B")
+   * )
+   *
+   * A,A,1,w
+   * A,B,2,x
+   * B,B,4,z
+   * |
+   * FamilyRegex("A")
+   * |
+   * A,A,1,w
+   * A,B,2,x
+   * |
+   * +------------+-------------+
+   * |                          |
+   * All()                    Label(foo)
+   * |                          |
+   * A,A,1,w              A,A,1,w,labels:[foo]
+   * A,B,2,x              A,B,2,x,labels:[foo]
+   * |                          |
+   * |                        Sink() --------------+
+   * |                          |                  |
+   * +------------+      x------+          A,A,1,w,labels:[foo]
+   * |                        A,B,2,x,labels:[foo]
+   * A,A,1,w                             |
+   * A,B,2,x                             |
+   * |                                |
+   * QualifierRegex("B")                      |
+   * |                                |
+   * A,B,2,x                             |
+   * |                                |
+   * +--------------------------------+
+   * |
+   * A,A,1,w,labels:[foo]
+   * A,B,2,x,labels:[foo]  // could be switched
+   * A,B,2,x               // could be switched
+   *
+   * Despite being excluded by the qualifier filter, a copy of every cell
+   * that reaches the sink is present in the final result.
+   *
+   * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+   * duplicate cells are possible, and appear in an unspecified mutual order.
+   * In this case we have a duplicate with column "A:B" and timestamp 2,
+   * because one copy passed through the all filter while the other was
+   * passed through the label and sink. Note that one copy has label "foo",
+   * while the other does not.
+   *
+   * Cannot be used within the `predicate_filter`, `true_filter`, or
+   * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+   * 
+ * + * bool sink = 16; + * + * @return Whether the sink field is set. + */ + boolean hasSink(); + + /** + * + * + *
+   * ADVANCED USE ONLY.
+   * Hook for introspection into the RowFilter. Outputs all cells directly to
+   * the output of the read rather than to any parent filter. Consider the
+   * following example:
+   *
+   * Chain(
+   * FamilyRegex("A"),
+   * Interleave(
+   * All(),
+   * Chain(Label("foo"), Sink())
+   * ),
+   * QualifierRegex("B")
+   * )
+   *
+   * A,A,1,w
+   * A,B,2,x
+   * B,B,4,z
+   * |
+   * FamilyRegex("A")
+   * |
+   * A,A,1,w
+   * A,B,2,x
+   * |
+   * +------------+-------------+
+   * |                          |
+   * All()                    Label(foo)
+   * |                          |
+   * A,A,1,w              A,A,1,w,labels:[foo]
+   * A,B,2,x              A,B,2,x,labels:[foo]
+   * |                          |
+   * |                        Sink() --------------+
+   * |                          |                  |
+   * +------------+      x------+          A,A,1,w,labels:[foo]
+   * |                        A,B,2,x,labels:[foo]
+   * A,A,1,w                             |
+   * A,B,2,x                             |
+   * |                                |
+   * QualifierRegex("B")                      |
+   * |                                |
+   * A,B,2,x                             |
+   * |                                |
+   * +--------------------------------+
+   * |
+   * A,A,1,w,labels:[foo]
+   * A,B,2,x,labels:[foo]  // could be switched
+   * A,B,2,x               // could be switched
+   *
+   * Despite being excluded by the qualifier filter, a copy of every cell
+   * that reaches the sink is present in the final result.
+   *
+   * As with an [Interleave][google.bigtable.v2.RowFilter.Interleave],
+   * duplicate cells are possible, and appear in an unspecified mutual order.
+   * In this case we have a duplicate with column "A:B" and timestamp 2,
+   * because one copy passed through the all filter while the other was
+   * passed through the label and sink. Note that one copy has label "foo",
+   * while the other does not.
+   *
+   * Cannot be used within the `predicate_filter`, `true_filter`, or
+   * `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition].
+   * 
+ * + * bool sink = 16; + * + * @return The sink. + */ + boolean getSink(); + + /** + * + * + *
+   * Matches all cells, regardless of input. Functionally equivalent to
+   * leaving `filter` unset, but included for completeness.
+   * 
+ * + * bool pass_all_filter = 17; + * + * @return Whether the passAllFilter field is set. + */ + boolean hasPassAllFilter(); + + /** + * + * + *
+   * Matches all cells, regardless of input. Functionally equivalent to
+   * leaving `filter` unset, but included for completeness.
+   * 
+ * + * bool pass_all_filter = 17; + * + * @return The passAllFilter. + */ + boolean getPassAllFilter(); + + /** + * + * + *
+   * Does not match any cells, regardless of input. Useful for temporarily
+   * disabling just part of a filter.
+   * 
+ * + * bool block_all_filter = 18; + * + * @return Whether the blockAllFilter field is set. + */ + boolean hasBlockAllFilter(); + + /** + * + * + *
+   * Does not match any cells, regardless of input. Useful for temporarily
+   * disabling just part of a filter.
+   * 
+ * + * bool block_all_filter = 18; + * + * @return The blockAllFilter. + */ + boolean getBlockAllFilter(); + + /** + * + * + *
+   * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+   * other words, passes through the entire row when the key matches, and
+   * otherwise produces an empty row.
+   * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary key.
+   * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return Whether the rowKeyRegexFilter field is set. + */ + boolean hasRowKeyRegexFilter(); + + /** + * + * + *
+   * Matches only cells from rows whose keys satisfy the given RE2 regex. In
+   * other words, passes through the entire row when the key matches, and
+   * otherwise produces an empty row.
+   * Note that, since row keys can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary key.
+   * 
+ * + * bytes row_key_regex_filter = 4; + * + * @return The rowKeyRegexFilter. + */ + com.google.protobuf.ByteString getRowKeyRegexFilter(); + + /** + * + * + *
+   * Matches all cells from a row with probability p, and matches no cells
+   * from the row with probability 1-p.
+   * 
+ * + * double row_sample_filter = 14; + * + * @return Whether the rowSampleFilter field is set. + */ + boolean hasRowSampleFilter(); + + /** + * + * + *
+   * Matches all cells from a row with probability p, and matches no cells
+   * from the row with probability 1-p.
+   * 
+ * + * double row_sample_filter = 14; + * + * @return The rowSampleFilter. + */ + double getRowSampleFilter(); + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return Whether the familyNameRegexFilter field is set. + */ + boolean hasFamilyNameRegexFilter(); + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return The familyNameRegexFilter. + */ + java.lang.String getFamilyNameRegexFilter(); + + /** + * + * + *
+   * Matches only cells from columns whose families satisfy the given RE2
+   * regex. For technical reasons, the regex must not contain the `:`
+   * character, even if it is not being used as a literal.
+   * Note that, since column families cannot contain the new line character
+   * `\n`, it is sufficient to use `.` as a full wildcard when matching
+   * column family names.
+   * 
+ * + * string family_name_regex_filter = 5; + * + * @return The bytes for familyNameRegexFilter. + */ + com.google.protobuf.ByteString getFamilyNameRegexFilterBytes(); + + /** + * + * + *
+   * Matches only cells from columns whose qualifiers satisfy the given RE2
+   * regex.
+   * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+   * escape sequence must be used if a true wildcard is desired. The `.`
+   * character will not match the new line character `\n`, which may be
+   * present in a binary qualifier.
+   * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return Whether the columnQualifierRegexFilter field is set. + */ + boolean hasColumnQualifierRegexFilter(); + + /** + * + * + *
+   * Matches only cells from columns whose qualifiers satisfy the given RE2
+   * regex.
+   * Note that, since column qualifiers can contain arbitrary bytes, the `\C`
+   * escape sequence must be used if a true wildcard is desired. The `.`
+   * character will not match the new line character `\n`, which may be
+   * present in a binary qualifier.
+   * 
+ * + * bytes column_qualifier_regex_filter = 6; + * + * @return The columnQualifierRegexFilter. + */ + com.google.protobuf.ByteString getColumnQualifierRegexFilter(); + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return Whether the columnRangeFilter field is set. + */ + boolean hasColumnRangeFilter(); + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + * + * @return The columnRangeFilter. + */ + com.google.bigtable.v2.ColumnRange getColumnRangeFilter(); + + /** + * + * + *
+   * Matches only cells from columns within the given range.
+   * 
+ * + * .google.bigtable.v2.ColumnRange column_range_filter = 7; + */ + com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder(); + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return Whether the timestampRangeFilter field is set. + */ + boolean hasTimestampRangeFilter(); + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + * + * @return The timestampRangeFilter. + */ + com.google.bigtable.v2.TimestampRange getTimestampRangeFilter(); + + /** + * + * + *
+   * Matches only cells with timestamps within the given range.
+   * 
+ * + * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; + */ + com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrBuilder(); + + /** + * + * + *
+   * Matches only cells with values that satisfy the given regular expression.
+   * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary value.
+   * 
+ * + * bytes value_regex_filter = 9; + * + * @return Whether the valueRegexFilter field is set. + */ + boolean hasValueRegexFilter(); + + /** + * + * + *
+   * Matches only cells with values that satisfy the given regular expression.
+   * Note that, since cell values can contain arbitrary bytes, the `\C` escape
+   * sequence must be used if a true wildcard is desired. The `.` character
+   * will not match the new line character `\n`, which may be present in a
+   * binary value.
+   * 
+ * + * bytes value_regex_filter = 9; + * + * @return The valueRegexFilter. + */ + com.google.protobuf.ByteString getValueRegexFilter(); + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return Whether the valueRangeFilter field is set. + */ + boolean hasValueRangeFilter(); + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + * + * @return The valueRangeFilter. + */ + com.google.bigtable.v2.ValueRange getValueRangeFilter(); + + /** + * + * + *
+   * Matches only cells with values that fall within the given range.
+   * 
+ * + * .google.bigtable.v2.ValueRange value_range_filter = 15; + */ + com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder(); + + /** + * + * + *
+   * Skips the first N cells of each row, matching all subsequent cells.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return Whether the cellsPerRowOffsetFilter field is set. + */ + boolean hasCellsPerRowOffsetFilter(); + + /** + * + * + *
+   * Skips the first N cells of each row, matching all subsequent cells.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_offset_filter = 10; + * + * @return The cellsPerRowOffsetFilter. + */ + int getCellsPerRowOffsetFilter(); + + /** + * + * + *
+   * Matches only the first N cells of each row.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return Whether the cellsPerRowLimitFilter field is set. + */ + boolean hasCellsPerRowLimitFilter(); + + /** + * + * + *
+   * Matches only the first N cells of each row.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_row_limit_filter = 11; + * + * @return The cellsPerRowLimitFilter. + */ + int getCellsPerRowLimitFilter(); + + /** + * + * + *
+   * Matches only the most recent N cells within each column. For example,
+   * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+   * skip all earlier cells in `foo:bar`, and then begin matching again in
+   * column `foo:bar2`.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return Whether the cellsPerColumnLimitFilter field is set. + */ + boolean hasCellsPerColumnLimitFilter(); + + /** + * + * + *
+   * Matches only the most recent N cells within each column. For example,
+   * if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
+   * skip all earlier cells in `foo:bar`, and then begin matching again in
+   * column `foo:bar2`.
+   * If duplicate cells are present, as is possible when using an Interleave,
+   * each copy of the cell is counted separately.
+   * 
+ * + * int32 cells_per_column_limit_filter = 12; + * + * @return The cellsPerColumnLimitFilter. + */ + int getCellsPerColumnLimitFilter(); + + /** + * + * + *
+   * Replaces each cell's value with the empty string.
+   * 
+ * + * bool strip_value_transformer = 13; + * + * @return Whether the stripValueTransformer field is set. + */ + boolean hasStripValueTransformer(); + + /** + * + * + *
+   * Replaces each cell's value with the empty string.
+   * 
+ * + * bool strip_value_transformer = 13; + * + * @return The stripValueTransformer. + */ + boolean getStripValueTransformer(); + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return Whether the applyLabelTransformer field is set. + */ + boolean hasApplyLabelTransformer(); + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return The applyLabelTransformer. + */ + java.lang.String getApplyLabelTransformer(); + + /** + * + * + *
+   * Applies the given label to all cells in the output row. This allows
+   * the client to determine which results were produced from which part of
+   * the filter.
+   *
+   * Values must be at most 15 characters in length, and match the RE2
+   * pattern `[a-z0-9\\-]+`
+   *
+   * Due to a technical limitation, it is not currently possible to apply
+   * multiple labels to a cell. As a result, a Chain may have no more than
+   * one sub-filter which contains a `apply_label_transformer`. It is okay for
+   * an Interleave to contain multiple `apply_label_transformers`, as they
+   * will be applied to separate copies of the input. This may be relaxed in
+   * the future.
+   * 
+ * + * string apply_label_transformer = 19; + * + * @return The bytes for applyLabelTransformer. + */ + com.google.protobuf.ByteString getApplyLabelTransformerBytes(); + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return Whether the valueBitmaskFilter field is set. + */ + boolean hasValueBitmaskFilter(); + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + * + * @return The valueBitmaskFilter. + */ + com.google.bigtable.v2.ValueBitmask getValueBitmaskFilter(); + + /** + * + * + *
+   * Matches only cells with values that satisfy the condition `(value & mask)
+   * == mask`.
+   * The mask length must exactly match the value length, otherwise the cell
+   * is not considered a match.
+   * 
+ * + * .google.bigtable.v2.ValueBitmask value_bitmask_filter = 20; + */ + com.google.bigtable.v2.ValueBitmaskOrBuilder getValueBitmaskFilterOrBuilder(); + + com.google.bigtable.v2.RowFilter.FilterCase getFilterCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java new file mode 100644 index 000000000000..413af8ee2934 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Row) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique key which identifies this row within its table. This is the same
+   * key that's used to identify the row in, for example, a MutateRowRequest.
+   * May contain any non-empty byte string up to 4KiB in length.
+   * 
+ * + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + java.util.List getFamiliesList(); + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + com.google.bigtable.v2.Family getFamilies(int index); + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + int getFamiliesCount(); + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + java.util.List getFamiliesOrBuilderList(); + + /** + * + * + *
+   * May be empty, but only if the entire row is empty.
+   * The mutual ordering of column families is not specified.
+   * 
+ * + * repeated .google.bigtable.v2.Family families = 2; + */ + com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java new file mode 100644 index 000000000000..67e25ef04a66 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java @@ -0,0 +1,1121 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies a contiguous range of rows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RowRange} + */ +@com.google.protobuf.Generated +public final class RowRange extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowRange) + RowRangeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowRange"); + } + + // Use RowRange.newBuilder() to construct. + private RowRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RowRange() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowRange.class, com.google.bigtable.v2.RowRange.Builder.class); + } + + private int startKeyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object startKey_; + + public enum StartKeyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + START_KEY_CLOSED(1), + START_KEY_OPEN(2), + STARTKEY_NOT_SET(0); + private final int value; + + private StartKeyCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StartKeyCase valueOf(int value) { + return forNumber(value); + } + + public static StartKeyCase forNumber(int value) { + switch (value) { + case 1: + return START_KEY_CLOSED; + case 2: + return START_KEY_OPEN; + case 0: + return STARTKEY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StartKeyCase getStartKeyCase() { + return StartKeyCase.forNumber(startKeyCase_); + } + + private int endKeyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object endKey_; + + public enum EndKeyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_KEY_OPEN(3), + END_KEY_CLOSED(4), + ENDKEY_NOT_SET(0); + private final int value; + + private EndKeyCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndKeyCase valueOf(int value) { + return forNumber(value); + } + + public static EndKeyCase forNumber(int value) { + switch (value) { + case 3: + return END_KEY_OPEN; + case 4: + return END_KEY_CLOSED; + case 0: + return ENDKEY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndKeyCase getEndKeyCase() { + return EndKeyCase.forNumber(endKeyCase_); + } + + public static final int START_KEY_CLOSED_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_key_closed = 1; + * + * @return Whether the startKeyClosed field is set. + */ + @java.lang.Override + public boolean hasStartKeyClosed() { + return startKeyCase_ == 1; + } + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_key_closed = 1; + * + * @return The startKeyClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartKeyClosed() { + if (startKeyCase_ == 1) { + return (com.google.protobuf.ByteString) startKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int START_KEY_OPEN_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_key_open = 2; + * + * @return Whether the startKeyOpen field is set. + */ + @java.lang.Override + public boolean hasStartKeyOpen() { + return startKeyCase_ == 2; + } + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_key_open = 2; + * + * @return The startKeyOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartKeyOpen() { + if (startKeyCase_ == 2) { + return (com.google.protobuf.ByteString) startKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_KEY_OPEN_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_key_open = 3; + * + * @return Whether the endKeyOpen field is set. + */ + @java.lang.Override + public boolean hasEndKeyOpen() { + return endKeyCase_ == 3; + } + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_key_open = 3; + * + * @return The endKeyOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndKeyOpen() { + if (endKeyCase_ == 3) { + return (com.google.protobuf.ByteString) endKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_KEY_CLOSED_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_key_closed = 4; + * + * @return Whether the endKeyClosed field is set. + */ + @java.lang.Override + public boolean hasEndKeyClosed() { + return endKeyCase_ == 4; + } + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_key_closed = 4; + * + * @return The endKeyClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndKeyClosed() { + if (endKeyCase_ == 4) { + return (com.google.protobuf.ByteString) endKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + 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 (startKeyCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) startKey_); + } + if (startKeyCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) startKey_); + } + if (endKeyCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) endKey_); + } + if (endKeyCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) endKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startKeyCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) startKey_); + } + if (startKeyCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) startKey_); + } + if (endKeyCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) endKey_); + } + if (endKeyCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) endKey_); + } + size += getUnknownFields().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.RowRange)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowRange other = (com.google.bigtable.v2.RowRange) obj; + + if (!getStartKeyCase().equals(other.getStartKeyCase())) return false; + switch (startKeyCase_) { + case 1: + if (!getStartKeyClosed().equals(other.getStartKeyClosed())) return false; + break; + case 2: + if (!getStartKeyOpen().equals(other.getStartKeyOpen())) return false; + break; + case 0: + default: + } + if (!getEndKeyCase().equals(other.getEndKeyCase())) return false; + switch (endKeyCase_) { + case 3: + if (!getEndKeyOpen().equals(other.getEndKeyOpen())) return false; + break; + case 4: + if (!getEndKeyClosed().equals(other.getEndKeyClosed())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (startKeyCase_) { + case 1: + hash = (37 * hash) + START_KEY_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getStartKeyClosed().hashCode(); + break; + case 2: + hash = (37 * hash) + START_KEY_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getStartKeyOpen().hashCode(); + break; + case 0: + default: + } + switch (endKeyCase_) { + case 3: + hash = (37 * hash) + END_KEY_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getEndKeyOpen().hashCode(); + break; + case 4: + hash = (37 * hash) + END_KEY_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getEndKeyClosed().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowRange 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.RowRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowRange 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.RowRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowRange 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a contiguous range of rows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowRange) + com.google.bigtable.v2.RowRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowRange.class, com.google.bigtable.v2.RowRange.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowRange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startKeyCase_ = 0; + startKey_ = null; + endKeyCase_ = 0; + endKey_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowRange_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowRange getDefaultInstanceForType() { + return com.google.bigtable.v2.RowRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowRange build() { + com.google.bigtable.v2.RowRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowRange buildPartial() { + com.google.bigtable.v2.RowRange result = new com.google.bigtable.v2.RowRange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowRange result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.RowRange result) { + result.startKeyCase_ = startKeyCase_; + result.startKey_ = this.startKey_; + result.endKeyCase_ = endKeyCase_; + result.endKey_ = this.endKey_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowRange) { + return mergeFrom((com.google.bigtable.v2.RowRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowRange other) { + if (other == com.google.bigtable.v2.RowRange.getDefaultInstance()) return this; + switch (other.getStartKeyCase()) { + case START_KEY_CLOSED: + { + setStartKeyClosed(other.getStartKeyClosed()); + break; + } + case START_KEY_OPEN: + { + setStartKeyOpen(other.getStartKeyOpen()); + break; + } + case STARTKEY_NOT_SET: + { + break; + } + } + switch (other.getEndKeyCase()) { + case END_KEY_OPEN: + { + setEndKeyOpen(other.getEndKeyOpen()); + break; + } + case END_KEY_CLOSED: + { + setEndKeyClosed(other.getEndKeyClosed()); + break; + } + case ENDKEY_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + startKey_ = input.readBytes(); + startKeyCase_ = 1; + break; + } // case 10 + case 18: + { + startKey_ = input.readBytes(); + startKeyCase_ = 2; + break; + } // case 18 + case 26: + { + endKey_ = input.readBytes(); + endKeyCase_ = 3; + break; + } // case 26 + case 34: + { + endKey_ = input.readBytes(); + endKeyCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startKeyCase_ = 0; + private java.lang.Object startKey_; + + public StartKeyCase getStartKeyCase() { + return StartKeyCase.forNumber(startKeyCase_); + } + + public Builder clearStartKey() { + startKeyCase_ = 0; + startKey_ = null; + onChanged(); + return this; + } + + private int endKeyCase_ = 0; + private java.lang.Object endKey_; + + public EndKeyCase getEndKeyCase() { + return EndKeyCase.forNumber(endKeyCase_); + } + + public Builder clearEndKey() { + endKeyCase_ = 0; + endKey_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_key_closed = 1; + * + * @return Whether the startKeyClosed field is set. + */ + public boolean hasStartKeyClosed() { + return startKeyCase_ == 1; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_key_closed = 1; + * + * @return The startKeyClosed. + */ + public com.google.protobuf.ByteString getStartKeyClosed() { + if (startKeyCase_ == 1) { + return (com.google.protobuf.ByteString) startKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_key_closed = 1; + * + * @param value The startKeyClosed to set. + * @return This builder for chaining. + */ + public Builder setStartKeyClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startKeyCase_ = 1; + startKey_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_key_closed = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartKeyClosed() { + if (startKeyCase_ == 1) { + startKeyCase_ = 0; + startKey_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_key_open = 2; + * + * @return Whether the startKeyOpen field is set. + */ + public boolean hasStartKeyOpen() { + return startKeyCase_ == 2; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_key_open = 2; + * + * @return The startKeyOpen. + */ + public com.google.protobuf.ByteString getStartKeyOpen() { + if (startKeyCase_ == 2) { + return (com.google.protobuf.ByteString) startKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_key_open = 2; + * + * @param value The startKeyOpen to set. + * @return This builder for chaining. + */ + public Builder setStartKeyOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startKeyCase_ = 2; + startKey_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_key_open = 2; + * + * @return This builder for chaining. + */ + public Builder clearStartKeyOpen() { + if (startKeyCase_ == 2) { + startKeyCase_ = 0; + startKey_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_key_open = 3; + * + * @return Whether the endKeyOpen field is set. + */ + public boolean hasEndKeyOpen() { + return endKeyCase_ == 3; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_key_open = 3; + * + * @return The endKeyOpen. + */ + public com.google.protobuf.ByteString getEndKeyOpen() { + if (endKeyCase_ == 3) { + return (com.google.protobuf.ByteString) endKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_key_open = 3; + * + * @param value The endKeyOpen to set. + * @return This builder for chaining. + */ + public Builder setEndKeyOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endKeyCase_ = 3; + endKey_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_key_open = 3; + * + * @return This builder for chaining. + */ + public Builder clearEndKeyOpen() { + if (endKeyCase_ == 3) { + endKeyCase_ = 0; + endKey_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_key_closed = 4; + * + * @return Whether the endKeyClosed field is set. + */ + public boolean hasEndKeyClosed() { + return endKeyCase_ == 4; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_key_closed = 4; + * + * @return The endKeyClosed. + */ + public com.google.protobuf.ByteString getEndKeyClosed() { + if (endKeyCase_ == 4) { + return (com.google.protobuf.ByteString) endKey_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_key_closed = 4; + * + * @param value The endKeyClosed to set. + * @return This builder for chaining. + */ + public Builder setEndKeyClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endKeyCase_ = 4; + endKey_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_key_closed = 4; + * + * @return This builder for chaining. + */ + public Builder clearEndKeyClosed() { + if (endKeyCase_ == 4) { + endKeyCase_ = 0; + endKey_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowRange) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowRange) + private static final com.google.bigtable.v2.RowRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowRange(); + } + + public static com.google.bigtable.v2.RowRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java new file mode 100644 index 000000000000..369f1b31cc15 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RowRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_key_closed = 1; + * + * @return Whether the startKeyClosed field is set. + */ + boolean hasStartKeyClosed(); + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_key_closed = 1; + * + * @return The startKeyClosed. + */ + com.google.protobuf.ByteString getStartKeyClosed(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_key_open = 2; + * + * @return Whether the startKeyOpen field is set. + */ + boolean hasStartKeyOpen(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_key_open = 2; + * + * @return The startKeyOpen. + */ + com.google.protobuf.ByteString getStartKeyOpen(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_key_open = 3; + * + * @return Whether the endKeyOpen field is set. + */ + boolean hasEndKeyOpen(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_key_open = 3; + * + * @return The endKeyOpen. + */ + com.google.protobuf.ByteString getEndKeyOpen(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_key_closed = 4; + * + * @return Whether the endKeyClosed field is set. + */ + boolean hasEndKeyClosed(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_key_closed = 4; + * + * @return The endKeyClosed. + */ + com.google.protobuf.ByteString getEndKeyClosed(); + + com.google.bigtable.v2.RowRange.StartKeyCase getStartKeyCase(); + + com.google.bigtable.v2.RowRange.EndKeyCase getEndKeyCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java new file mode 100644 index 000000000000..1a42c658cf3a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies a non-contiguous set of rows.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.RowSet} + */ +@com.google.protobuf.Generated +public final class RowSet extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RowSet) + RowSetOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowSet"); + } + + // Use RowSet.newBuilder() to construct. + private RowSet(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RowSet() { + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); + rowRanges_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowSet.class, com.google.bigtable.v2.RowSet.Builder.class); + } + + public static final int ROW_KEYS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList rowKeys_ = + emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @return A list containing the rowKeys. + */ + @java.lang.Override + public java.util.List getRowKeysList() { + return rowKeys_; + } + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @return The count of rowKeys. + */ + public int getRowKeysCount() { + return rowKeys_.size(); + } + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @param index The index of the element to return. + * @return The rowKeys at the given index. + */ + public com.google.protobuf.ByteString getRowKeys(int index) { + return rowKeys_.get(index); + } + + public static final int ROW_RANGES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List rowRanges_; + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + @java.lang.Override + public java.util.List getRowRangesList() { + return rowRanges_; + } + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + @java.lang.Override + public java.util.List + getRowRangesOrBuilderList() { + return rowRanges_; + } + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + @java.lang.Override + public int getRowRangesCount() { + return rowRanges_.size(); + } + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowRange getRowRanges(int index) { + return rowRanges_.get(index); + } + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index) { + return rowRanges_.get(index); + } + + 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 { + for (int i = 0; i < rowKeys_.size(); i++) { + output.writeBytes(1, rowKeys_.get(i)); + } + for (int i = 0; i < rowRanges_.size(); i++) { + output.writeMessage(2, rowRanges_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < rowKeys_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(rowKeys_.get(i)); + } + size += dataSize; + size += 1 * getRowKeysList().size(); + } + for (int i = 0; i < rowRanges_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rowRanges_.get(i)); + } + size += getUnknownFields().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.RowSet)) { + return super.equals(obj); + } + com.google.bigtable.v2.RowSet other = (com.google.bigtable.v2.RowSet) obj; + + if (!getRowKeysList().equals(other.getRowKeysList())) return false; + if (!getRowRangesList().equals(other.getRowRangesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRowKeysCount() > 0) { + hash = (37 * hash) + ROW_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getRowKeysList().hashCode(); + } + if (getRowRangesCount() > 0) { + hash = (37 * hash) + ROW_RANGES_FIELD_NUMBER; + hash = (53 * hash) + getRowRangesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.RowSet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowSet 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.RowSet parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowSet 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.RowSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.RowSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.RowSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowSet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowSet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RowSet parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.RowSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.RowSet 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a non-contiguous set of rows.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.RowSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.RowSet) + com.google.bigtable.v2.RowSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.RowSet.class, com.google.bigtable.v2.RowSet.Builder.class); + } + + // Construct using com.google.bigtable.v2.RowSet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); + if (rowRangesBuilder_ == null) { + rowRanges_ = java.util.Collections.emptyList(); + } else { + rowRanges_ = null; + rowRangesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowSet_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.RowSet getDefaultInstanceForType() { + return com.google.bigtable.v2.RowSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.RowSet build() { + com.google.bigtable.v2.RowSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.RowSet buildPartial() { + com.google.bigtable.v2.RowSet result = new com.google.bigtable.v2.RowSet(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.RowSet result) { + if (rowRangesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rowRanges_ = java.util.Collections.unmodifiableList(rowRanges_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rowRanges_ = rowRanges_; + } else { + result.rowRanges_ = rowRangesBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.RowSet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + rowKeys_.makeImmutable(); + result.rowKeys_ = rowKeys_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.RowSet) { + return mergeFrom((com.google.bigtable.v2.RowSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.RowSet other) { + if (other == com.google.bigtable.v2.RowSet.getDefaultInstance()) return this; + if (!other.rowKeys_.isEmpty()) { + if (rowKeys_.isEmpty()) { + rowKeys_ = other.rowKeys_; + rowKeys_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureRowKeysIsMutable(); + rowKeys_.addAll(other.rowKeys_); + } + onChanged(); + } + if (rowRangesBuilder_ == null) { + if (!other.rowRanges_.isEmpty()) { + if (rowRanges_.isEmpty()) { + rowRanges_ = other.rowRanges_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRowRangesIsMutable(); + rowRanges_.addAll(other.rowRanges_); + } + onChanged(); + } + } else { + if (!other.rowRanges_.isEmpty()) { + if (rowRangesBuilder_.isEmpty()) { + rowRangesBuilder_.dispose(); + rowRangesBuilder_ = null; + rowRanges_ = other.rowRanges_; + bitField0_ = (bitField0_ & ~0x00000002); + rowRangesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRowRangesFieldBuilder() + : null; + } else { + rowRangesBuilder_.addAllMessages(other.rowRanges_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureRowKeysIsMutable(); + rowKeys_.add(v); + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.RowRange m = + input.readMessage(com.google.bigtable.v2.RowRange.parser(), extensionRegistry); + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + rowRanges_.add(m); + } else { + rowRangesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList rowKeys_ = + emptyList(com.google.protobuf.ByteString.class); + + private void ensureRowKeysIsMutable() { + if (!rowKeys_.isModifiable()) { + rowKeys_ = makeMutableCopy(rowKeys_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @return A list containing the rowKeys. + */ + public java.util.List getRowKeysList() { + rowKeys_.makeImmutable(); + return rowKeys_; + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @return The count of rowKeys. + */ + public int getRowKeysCount() { + return rowKeys_.size(); + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @param index The index of the element to return. + * @return The rowKeys at the given index. + */ + public com.google.protobuf.ByteString getRowKeys(int index) { + return rowKeys_.get(index); + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @param index The index to set the value at. + * @param value The rowKeys to set. + * @return This builder for chaining. + */ + public Builder setRowKeys(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowKeysIsMutable(); + rowKeys_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @param value The rowKeys to add. + * @return This builder for chaining. + */ + public Builder addRowKeys(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowKeysIsMutable(); + rowKeys_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @param values The rowKeys to add. + * @return This builder for chaining. + */ + public Builder addAllRowKeys( + java.lang.Iterable values) { + ensureRowKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowKeys_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Single rows included in the set.
+     * 
+ * + * repeated bytes row_keys = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowKeys() { + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private java.util.List rowRanges_ = + java.util.Collections.emptyList(); + + private void ensureRowRangesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rowRanges_ = new java.util.ArrayList(rowRanges_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder> + rowRangesBuilder_; + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public java.util.List getRowRangesList() { + if (rowRangesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rowRanges_); + } else { + return rowRangesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public int getRowRangesCount() { + if (rowRangesBuilder_ == null) { + return rowRanges_.size(); + } else { + return rowRangesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public com.google.bigtable.v2.RowRange getRowRanges(int index) { + if (rowRangesBuilder_ == null) { + return rowRanges_.get(index); + } else { + return rowRangesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder setRowRanges(int index, com.google.bigtable.v2.RowRange value) { + if (rowRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowRangesIsMutable(); + rowRanges_.set(index, value); + onChanged(); + } else { + rowRangesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder setRowRanges( + int index, com.google.bigtable.v2.RowRange.Builder builderForValue) { + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + rowRanges_.set(index, builderForValue.build()); + onChanged(); + } else { + rowRangesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder addRowRanges(com.google.bigtable.v2.RowRange value) { + if (rowRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowRangesIsMutable(); + rowRanges_.add(value); + onChanged(); + } else { + rowRangesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder addRowRanges(int index, com.google.bigtable.v2.RowRange value) { + if (rowRangesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowRangesIsMutable(); + rowRanges_.add(index, value); + onChanged(); + } else { + rowRangesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder addRowRanges(com.google.bigtable.v2.RowRange.Builder builderForValue) { + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + rowRanges_.add(builderForValue.build()); + onChanged(); + } else { + rowRangesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder addRowRanges( + int index, com.google.bigtable.v2.RowRange.Builder builderForValue) { + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + rowRanges_.add(index, builderForValue.build()); + onChanged(); + } else { + rowRangesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder addAllRowRanges( + java.lang.Iterable values) { + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowRanges_); + onChanged(); + } else { + rowRangesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder clearRowRanges() { + if (rowRangesBuilder_ == null) { + rowRanges_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rowRangesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public Builder removeRowRanges(int index) { + if (rowRangesBuilder_ == null) { + ensureRowRangesIsMutable(); + rowRanges_.remove(index); + onChanged(); + } else { + rowRangesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public com.google.bigtable.v2.RowRange.Builder getRowRangesBuilder(int index) { + return internalGetRowRangesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index) { + if (rowRangesBuilder_ == null) { + return rowRanges_.get(index); + } else { + return rowRangesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public java.util.List + getRowRangesOrBuilderList() { + if (rowRangesBuilder_ != null) { + return rowRangesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rowRanges_); + } + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder() { + return internalGetRowRangesFieldBuilder() + .addBuilder(com.google.bigtable.v2.RowRange.getDefaultInstance()); + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder(int index) { + return internalGetRowRangesFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.RowRange.getDefaultInstance()); + } + + /** + * + * + *
+     * Contiguous row ranges included in the set.
+     * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + public java.util.List getRowRangesBuilderList() { + return internalGetRowRangesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder> + internalGetRowRangesFieldBuilder() { + if (rowRangesBuilder_ == null) { + rowRangesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder>( + rowRanges_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rowRanges_ = null; + } + return rowRangesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowSet) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.RowSet) + private static final com.google.bigtable.v2.RowSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.RowSet(); + } + + public static com.google.bigtable.v2.RowSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RowSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java new file mode 100644 index 000000000000..dc88b941dfaa --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface RowSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.RowSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @return A list containing the rowKeys. + */ + java.util.List getRowKeysList(); + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @return The count of rowKeys. + */ + int getRowKeysCount(); + + /** + * + * + *
+   * Single rows included in the set.
+   * 
+ * + * repeated bytes row_keys = 1; + * + * @param index The index of the element to return. + * @return The rowKeys at the given index. + */ + com.google.protobuf.ByteString getRowKeys(int index); + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + java.util.List getRowRangesList(); + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + com.google.bigtable.v2.RowRange getRowRanges(int index); + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + int getRowRangesCount(); + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + java.util.List getRowRangesOrBuilderList(); + + /** + * + * + *
+   * Contiguous row ranges included in the set.
+   * 
+ * + * repeated .google.bigtable.v2.RowRange row_ranges = 2; + */ + com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java new file mode 100644 index 000000000000..94757329abfd --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java @@ -0,0 +1,1281 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for Bigtable.SampleRowKeys.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SampleRowKeysRequest} + */ +@com.google.protobuf.Generated +public final class SampleRowKeysRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SampleRowKeysRequest) + SampleRowKeysRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SampleRowKeysRequest"); + } + + // Use SampleRowKeysRequest.newBuilder() to construct. + private SampleRowKeysRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SampleRowKeysRequest() { + tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SampleRowKeysRequest.class, + com.google.bigtable.v2.SampleRowKeysRequest.Builder.class); + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the table from which to sample row keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the table from which to sample row keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to sample row
+   * keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to sample row
+   * keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATERIALIZED_VIEW_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + @java.lang.Override + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + 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(); + materializedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + 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.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, materializedViewName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, materializedViewName_); + } + size += getUnknownFields().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.SampleRowKeysRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SampleRowKeysRequest other = + (com.google.bigtable.v2.SampleRowKeysRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getMaterializedViewName().equals(other.getMaterializedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + MATERIALIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest 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.SampleRowKeysRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest 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.SampleRowKeysRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SampleRowKeysRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for Bigtable.SampleRowKeys.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SampleRowKeysRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SampleRowKeysRequest) + com.google.bigtable.v2.SampleRowKeysRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SampleRowKeysRequest.class, + com.google.bigtable.v2.SampleRowKeysRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SampleRowKeysRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; + appProfileId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysRequest build() { + com.google.bigtable.v2.SampleRowKeysRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysRequest buildPartial() { + com.google.bigtable.v2.SampleRowKeysRequest result = + new com.google.bigtable.v2.SampleRowKeysRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SampleRowKeysRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.materializedViewName_ = materializedViewName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SampleRowKeysRequest) { + return mergeFrom((com.google.bigtable.v2.SampleRowKeysRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysRequest other) { + if (other == com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMaterializedViewName().isEmpty()) { + materializedViewName_ = other.materializedViewName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 34: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 34 + case 42: + { + materializedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the table from which to sample row keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to sample row keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to sample row keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to sample row keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the table from which to sample row keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>`.
+     * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to sample row
+     * keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to sample row
+     * keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to sample row
+     * keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to sample row
+     * keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the AuthorizedView from which to sample row
+     * keys.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + materializedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + materializedViewName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearMaterializedViewName() { + materializedViewName_ = getDefaultInstance().getMaterializedViewName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The unique name of the MaterializedView from which to read.
+     *
+     * Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + materializedViewName_ = value; + bitField0_ |= 0x00000004; + 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; + bitField0_ |= 0x00000008; + 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(); + bitField0_ = (bitField0_ & ~0x00000008); + 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SampleRowKeysRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SampleRowKeysRequest) + private static final com.google.bigtable.v2.SampleRowKeysRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SampleRowKeysRequest(); + } + + public static com.google.bigtable.v2.SampleRowKeysRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SampleRowKeysRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SampleRowKeysRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java new file mode 100644 index 000000000000..05555052a7a4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SampleRowKeysRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SampleRowKeysRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The unique name of the table from which to sample row keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * Optional. The unique name of the table from which to sample row keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>`.
+   * 
+ * + * + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to sample row
+   * keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the AuthorizedView from which to sample row
+   * keys.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * + * string authorized_view_name = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The materializedViewName. + */ + java.lang.String getMaterializedViewName(); + + /** + * + * + *
+   * Optional. The unique name of the MaterializedView from which to read.
+   *
+   * Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * + * string materialized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for materializedViewName. + */ + com.google.protobuf.ByteString getMaterializedViewNameBytes(); + + /** + * + * + *
+   * 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/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java new file mode 100644 index 000000000000..5b558958b516 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java @@ -0,0 +1,639 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.SampleRowKeys.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SampleRowKeysResponse} + */ +@com.google.protobuf.Generated +public final class SampleRowKeysResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SampleRowKeysResponse) + SampleRowKeysResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SampleRowKeysResponse"); + } + + // Use SampleRowKeysResponse.newBuilder() to construct. + private SampleRowKeysResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SampleRowKeysResponse() { + rowKey_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SampleRowKeysResponse.class, + com.google.bigtable.v2.SampleRowKeysResponse.Builder.class); + } + + public static final int ROW_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Sorted streamed sequence of sample row keys in the table. The table might
+   * have contents before the first row key in the list and after the last one,
+   * but a key containing the empty string indicates "end of table" and will be
+   * the last response given, if present.
+   * Note that row keys in this list may not have ever been written to or read
+   * from, and users should therefore not make any assumptions about the row key
+   * structure that are specific to their use case.
+   * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + public static final int OFFSET_BYTES_FIELD_NUMBER = 2; + private long offsetBytes_ = 0L; + + /** + * + * + *
+   * Approximate total storage space used by all rows in the table which precede
+   * `row_key`. Buffering the contents of all rows between two subsequent
+   * samples would require space roughly equal to the difference in their
+   * `offset_bytes` fields.
+   * 
+ * + * int64 offset_bytes = 2; + * + * @return The offsetBytes. + */ + @java.lang.Override + public long getOffsetBytes() { + return offsetBytes_; + } + + 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 (!rowKey_.isEmpty()) { + output.writeBytes(1, rowKey_); + } + if (offsetBytes_ != 0L) { + output.writeInt64(2, offsetBytes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!rowKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, rowKey_); + } + if (offsetBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, offsetBytes_); + } + size += getUnknownFields().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.SampleRowKeysResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SampleRowKeysResponse other = + (com.google.bigtable.v2.SampleRowKeysResponse) obj; + + if (!getRowKey().equals(other.getRowKey())) return false; + if (getOffsetBytes() != other.getOffsetBytes()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ROW_KEY_FIELD_NUMBER; + hash = (53 * hash) + getRowKey().hashCode(); + hash = (37 * hash) + OFFSET_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffsetBytes()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse 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.SampleRowKeysResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse 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.SampleRowKeysResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SampleRowKeysResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for Bigtable.SampleRowKeys.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SampleRowKeysResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SampleRowKeysResponse) + com.google.bigtable.v2.SampleRowKeysResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SampleRowKeysResponse.class, + com.google.bigtable.v2.SampleRowKeysResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SampleRowKeysResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + offsetBytes_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysResponse build() { + com.google.bigtable.v2.SampleRowKeysResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SampleRowKeysResponse buildPartial() { + com.google.bigtable.v2.SampleRowKeysResponse result = + new com.google.bigtable.v2.SampleRowKeysResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SampleRowKeysResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.offsetBytes_ = offsetBytes_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SampleRowKeysResponse) { + return mergeFrom((com.google.bigtable.v2.SampleRowKeysResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { + if (other == com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance()) return this; + if (!other.getRowKey().isEmpty()) { + setRowKey(other.getRowKey()); + } + if (other.getOffsetBytes() != 0L) { + setOffsetBytes(other.getOffsetBytes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + rowKey_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + offsetBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Sorted streamed sequence of sample row keys in the table. The table might
+     * have contents before the first row key in the list and after the last one,
+     * but a key containing the empty string indicates "end of table" and will be
+     * the last response given, if present.
+     * Note that row keys in this list may not have ever been written to or read
+     * from, and users should therefore not make any assumptions about the row key
+     * structure that are specific to their use case.
+     * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRowKey() { + return rowKey_; + } + + /** + * + * + *
+     * Sorted streamed sequence of sample row keys in the table. The table might
+     * have contents before the first row key in the list and after the last one,
+     * but a key containing the empty string indicates "end of table" and will be
+     * the last response given, if present.
+     * Note that row keys in this list may not have ever been written to or read
+     * from, and users should therefore not make any assumptions about the row key
+     * structure that are specific to their use case.
+     * 
+ * + * bytes row_key = 1; + * + * @param value The rowKey to set. + * @return This builder for chaining. + */ + public Builder setRowKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + rowKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Sorted streamed sequence of sample row keys in the table. The table might
+     * have contents before the first row key in the list and after the last one,
+     * but a key containing the empty string indicates "end of table" and will be
+     * the last response given, if present.
+     * Note that row keys in this list may not have ever been written to or read
+     * from, and users should therefore not make any assumptions about the row key
+     * structure that are specific to their use case.
+     * 
+ * + * bytes row_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearRowKey() { + bitField0_ = (bitField0_ & ~0x00000001); + rowKey_ = getDefaultInstance().getRowKey(); + onChanged(); + return this; + } + + private long offsetBytes_; + + /** + * + * + *
+     * Approximate total storage space used by all rows in the table which precede
+     * `row_key`. Buffering the contents of all rows between two subsequent
+     * samples would require space roughly equal to the difference in their
+     * `offset_bytes` fields.
+     * 
+ * + * int64 offset_bytes = 2; + * + * @return The offsetBytes. + */ + @java.lang.Override + public long getOffsetBytes() { + return offsetBytes_; + } + + /** + * + * + *
+     * Approximate total storage space used by all rows in the table which precede
+     * `row_key`. Buffering the contents of all rows between two subsequent
+     * samples would require space roughly equal to the difference in their
+     * `offset_bytes` fields.
+     * 
+ * + * int64 offset_bytes = 2; + * + * @param value The offsetBytes to set. + * @return This builder for chaining. + */ + public Builder setOffsetBytes(long value) { + + offsetBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Approximate total storage space used by all rows in the table which precede
+     * `row_key`. Buffering the contents of all rows between two subsequent
+     * samples would require space roughly equal to the difference in their
+     * `offset_bytes` fields.
+     * 
+ * + * int64 offset_bytes = 2; + * + * @return This builder for chaining. + */ + public Builder clearOffsetBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + offsetBytes_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SampleRowKeysResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SampleRowKeysResponse) + private static final com.google.bigtable.v2.SampleRowKeysResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SampleRowKeysResponse(); + } + + public static com.google.bigtable.v2.SampleRowKeysResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SampleRowKeysResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SampleRowKeysResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java new file mode 100644 index 000000000000..92a7ba23854f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SampleRowKeysResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SampleRowKeysResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Sorted streamed sequence of sample row keys in the table. The table might
+   * have contents before the first row key in the list and after the last one,
+   * but a key containing the empty string indicates "end of table" and will be
+   * the last response given, if present.
+   * Note that row keys in this list may not have ever been written to or read
+   * from, and users should therefore not make any assumptions about the row key
+   * structure that are specific to their use case.
+   * 
+ * + * bytes row_key = 1; + * + * @return The rowKey. + */ + com.google.protobuf.ByteString getRowKey(); + + /** + * + * + *
+   * Approximate total storage space used by all rows in the table which precede
+   * `row_key`. Buffering the contents of all rows between two subsequent
+   * samples would require space roughly equal to the difference in their
+   * `offset_bytes` fields.
+   * 
+ * + * int64 offset_bytes = 2; + * + * @return The offsetBytes. + */ + long getOffsetBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java new file mode 100644 index 000000000000..36d01b61f516 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java @@ -0,0 +1,7243 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for the Session API. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration} + */ +@com.google.protobuf.Generated +public final class SessionClientConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration) + SessionClientConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionClientConfiguration"); + } + + // Use SessionClientConfiguration.newBuilder() to construct. + private SessionClientConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionClientConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.Builder.class); + } + + public interface ChannelPoolConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The minimum number of distcint servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at least this many
+     * distinct servers, but may have multiple channels connected to the same
+     * server (e.g. the client may have M channels on N machines, where M > N).
+     * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + int getMinServerCount(); + + /** + * + * + *
+     * The maximum number of distinct servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at most this many
+     * distinct servers.
+     * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + int getMaxServerCount(); + + /** + * + * + *
+     * Soft maximum for how many sessions are allowed per server. Normally, the
+     * client will ensure that it does not host more than this count of sessions
+     * per server, unless there are other limits encountered (e.g. the connected
+     * servers is already at max_servers).
+     * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + int getPerServerSessionCount(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + boolean hasDirectAccessWithFallback(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + boolean hasDirectAccessOnly(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly + getDirectAccessOnly(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + boolean hasCloudPathOnly(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + getCloudPathOnly(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder(); + + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.ModeCase + getModeCase(); + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration} + */ + public static final class ChannelPoolConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + ChannelPoolConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChannelPoolConfiguration"); + } + + // Use ChannelPoolConfiguration.newBuilder() to construct. + private ChannelPoolConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ChannelPoolConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + .class); + } + + public interface DirectAccessWithFallbackOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+       * The error rate is calculated based on a count of vRPCs with errors
+       * divided by a total count of vRPCs, over a rolling window of the past
+       * check_interval. If this ratio exceeds this threshold, the fallback to
+       * CloudPath is triggered. [0, 1].
+       * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + float getErrorRateThreshold(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + boolean hasCheckInterval(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + com.google.protobuf.Duration getCheckInterval(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder(); + } + + /** + * + * + *
+     * A channel mode which allows DirectAccess with a fallback to CloudPath if
+     * DirectAccess is unavailable.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback} + */ + public static final class DirectAccessWithFallback extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + DirectAccessWithFallbackOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DirectAccessWithFallback"); + } + + // Use DirectAccessWithFallback.newBuilder() to construct. + private DirectAccessWithFallback(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DirectAccessWithFallback() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder.class); + } + + private int bitField0_; + public static final int ERROR_RATE_THRESHOLD_FIELD_NUMBER = 1; + private float errorRateThreshold_ = 0F; + + /** + * + * + *
+       * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+       * The error rate is calculated based on a count of vRPCs with errors
+       * divided by a total count of vRPCs, over a rolling window of the past
+       * check_interval. If this ratio exceeds this threshold, the fallback to
+       * CloudPath is triggered. [0, 1].
+       * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + @java.lang.Override + public float getErrorRateThreshold() { + return errorRateThreshold_; + } + + public static final int CHECK_INTERVAL_FIELD_NUMBER = 2; + private com.google.protobuf.Duration checkInterval_; + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + @java.lang.Override + public boolean hasCheckInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getCheckInterval() { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder() { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + + 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 (java.lang.Float.floatToRawIntBits(errorRateThreshold_) != 0) { + output.writeFloat(1, errorRateThreshold_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCheckInterval()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(errorRateThreshold_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, errorRateThreshold_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCheckInterval()); + } + size += getUnknownFields().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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + obj; + + if (java.lang.Float.floatToIntBits(getErrorRateThreshold()) + != java.lang.Float.floatToIntBits(other.getErrorRateThreshold())) return false; + if (hasCheckInterval() != other.hasCheckInterval()) return false; + if (hasCheckInterval()) { + if (!getCheckInterval().equals(other.getCheckInterval())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ERROR_RATE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getErrorRateThreshold()); + if (hasCheckInterval()) { + hash = (37 * hash) + CHECK_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getCheckInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which allows DirectAccess with a fallback to CloudPath if
+       * DirectAccess is unavailable.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCheckIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + errorRateThreshold_ = 0F; + checkInterval_ = null; + if (checkIntervalBuilder_ != null) { + checkIntervalBuilder_.dispose(); + checkIntervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.errorRateThreshold_ = errorRateThreshold_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.checkInterval_ = + checkIntervalBuilder_ == null ? checkInterval_ : checkIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance()) return this; + if (java.lang.Float.floatToRawIntBits(other.getErrorRateThreshold()) != 0) { + setErrorRateThreshold(other.getErrorRateThreshold()); + } + if (other.hasCheckInterval()) { + mergeCheckInterval(other.getCheckInterval()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + errorRateThreshold_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + input.readMessage( + internalGetCheckIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float errorRateThreshold_; + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + @java.lang.Override + public float getErrorRateThreshold() { + return errorRateThreshold_; + } + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @param value The errorRateThreshold to set. + * @return This builder for chaining. + */ + public Builder setErrorRateThreshold(float value) { + + errorRateThreshold_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @return This builder for chaining. + */ + public Builder clearErrorRateThreshold() { + bitField0_ = (bitField0_ & ~0x00000001); + errorRateThreshold_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Duration checkInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + checkIntervalBuilder_; + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + public boolean hasCheckInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + public com.google.protobuf.Duration getCheckInterval() { + if (checkIntervalBuilder_ == null) { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } else { + return checkIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder setCheckInterval(com.google.protobuf.Duration value) { + if (checkIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checkInterval_ = value; + } else { + checkIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder setCheckInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (checkIntervalBuilder_ == null) { + checkInterval_ = builderForValue.build(); + } else { + checkIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder mergeCheckInterval(com.google.protobuf.Duration value) { + if (checkIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && checkInterval_ != null + && checkInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getCheckIntervalBuilder().mergeFrom(value); + } else { + checkInterval_ = value; + } + } else { + checkIntervalBuilder_.mergeFrom(value); + } + if (checkInterval_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder clearCheckInterval() { + bitField0_ = (bitField0_ & ~0x00000002); + checkInterval_ = null; + if (checkIntervalBuilder_ != null) { + checkIntervalBuilder_.dispose(); + checkIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public com.google.protobuf.Duration.Builder getCheckIntervalBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetCheckIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder() { + if (checkIntervalBuilder_ != null) { + return checkIntervalBuilder_.getMessageOrBuilder(); + } else { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetCheckIntervalFieldBuilder() { + if (checkIntervalBuilder_ == null) { + checkIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCheckInterval(), getParentForChildren(), isClean()); + checkInterval_ = null; + } + return checkIntervalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.DirectAccessWithFallback + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectAccessWithFallback parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DirectAccessOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * A channel mode which only allows DirectAccess.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly} + */ + public static final class DirectAccessOnly extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + DirectAccessOnlyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DirectAccessOnly"); + } + + // Use DirectAccessOnly.newBuilder() to construct. + private DirectAccessOnly(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DirectAccessOnly() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which only allows DirectAccess.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.DirectAccessOnly + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectAccessOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloudPathOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * A channel mode which only allows CloudPath.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly} + */ + public static final class CloudPathOnly extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + CloudPathOnlyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudPathOnly"); + } + + // Use CloudPathOnly.newBuilder() to construct. + private CloudPathOnly(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloudPathOnly() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + 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.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + 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.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which only allows CloudPath.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.CloudPathOnly + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudPathOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object mode_; + + public enum ModeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DIRECT_ACCESS_WITH_FALLBACK(4), + DIRECT_ACCESS_ONLY(5), + CLOUD_PATH_ONLY(6), + MODE_NOT_SET(0); + private final int value; + + private ModeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModeCase valueOf(int value) { + return forNumber(value); + } + + public static ModeCase forNumber(int value) { + switch (value) { + case 4: + return DIRECT_ACCESS_WITH_FALLBACK; + case 5: + return DIRECT_ACCESS_ONLY; + case 6: + return CLOUD_PATH_ONLY; + case 0: + return MODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public static final int MIN_SERVER_COUNT_FIELD_NUMBER = 1; + private int minServerCount_ = 0; + + /** + * + * + *
+     * The minimum number of distcint servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at least this many
+     * distinct servers, but may have multiple channels connected to the same
+     * server (e.g. the client may have M channels on N machines, where M > N).
+     * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + @java.lang.Override + public int getMinServerCount() { + return minServerCount_; + } + + public static final int MAX_SERVER_COUNT_FIELD_NUMBER = 2; + private int maxServerCount_ = 0; + + /** + * + * + *
+     * The maximum number of distinct servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at most this many
+     * distinct servers.
+     * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + @java.lang.Override + public int getMaxServerCount() { + return maxServerCount_; + } + + public static final int PER_SERVER_SESSION_COUNT_FIELD_NUMBER = 3; + private int perServerSessionCount_ = 0; + + /** + * + * + *
+     * Soft maximum for how many sessions are allowed per server. Normally, the
+     * client will ensure that it does not host more than this count of sessions
+     * per server, unless there are other limits encountered (e.g. the connected
+     * servers is already at max_servers).
+     * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + @java.lang.Override + public int getPerServerSessionCount() { + return perServerSessionCount_; + } + + public static final int DIRECT_ACCESS_WITH_FALLBACK_FIELD_NUMBER = 4; + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + @java.lang.Override + public boolean hasDirectAccessWithFallback() { + return modeCase_ == 4; + } + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback() { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder() { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + public static final int DIRECT_ACCESS_ONLY_FIELD_NUMBER = 5; + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + @java.lang.Override + public boolean hasDirectAccessOnly() { + return modeCase_ == 5; + } + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDirectAccessOnly() { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder() { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + public static final int CLOUD_PATH_ONLY_FIELD_NUMBER = 6; + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + @java.lang.Override + public boolean hasCloudPathOnly() { + return modeCase_ == 6; + } + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + getCloudPathOnly() { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder() { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + 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 (minServerCount_ != 0) { + output.writeInt32(1, minServerCount_); + } + if (maxServerCount_ != 0) { + output.writeInt32(2, maxServerCount_); + } + if (perServerSessionCount_ != 0) { + output.writeInt32(3, perServerSessionCount_); + } + if (modeCase_ == 4) { + output.writeMessage( + 4, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_); + } + if (modeCase_ == 5) { + output.writeMessage( + 5, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_); + } + if (modeCase_ == 6) { + output.writeMessage( + 6, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minServerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, minServerCount_); + } + if (maxServerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxServerCount_); + } + if (perServerSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, perServerSessionCount_); + } + if (modeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_); + } + if (modeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_); + } + if (modeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_); + } + size += getUnknownFields().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.SessionClientConfiguration.ChannelPoolConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) obj; + + if (getMinServerCount() != other.getMinServerCount()) return false; + if (getMaxServerCount() != other.getMaxServerCount()) return false; + if (getPerServerSessionCount() != other.getPerServerSessionCount()) return false; + if (!getModeCase().equals(other.getModeCase())) return false; + switch (modeCase_) { + case 4: + if (!getDirectAccessWithFallback().equals(other.getDirectAccessWithFallback())) + return false; + break; + case 5: + if (!getDirectAccessOnly().equals(other.getDirectAccessOnly())) return false; + break; + case 6: + if (!getCloudPathOnly().equals(other.getCloudPathOnly())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MIN_SERVER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinServerCount(); + hash = (37 * hash) + MAX_SERVER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxServerCount(); + hash = (37 * hash) + PER_SERVER_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPerServerSessionCount(); + switch (modeCase_) { + case 4: + hash = (37 * hash) + DIRECT_ACCESS_WITH_FALLBACK_FIELD_NUMBER; + hash = (53 * hash) + getDirectAccessWithFallback().hashCode(); + break; + case 5: + hash = (37 * hash) + DIRECT_ACCESS_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getDirectAccessOnly().hashCode(); + break; + case 6: + hash = (37 * hash) + CLOUD_PATH_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getCloudPathOnly().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + 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.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + 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.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration.ChannelPoolConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minServerCount_ = 0; + maxServerCount_ = 0; + perServerSessionCount_ = 0; + if (directAccessWithFallbackBuilder_ != null) { + directAccessWithFallbackBuilder_.clear(); + } + if (directAccessOnlyBuilder_ != null) { + directAccessOnlyBuilder_.clear(); + } + if (cloudPathOnlyBuilder_ != null) { + cloudPathOnlyBuilder_.clear(); + } + modeCase_ = 0; + mode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minServerCount_ = minServerCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxServerCount_ = maxServerCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.perServerSessionCount_ = perServerSessionCount_; + } + } + + private void buildPartialOneofs( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result) { + result.modeCase_ = modeCase_; + result.mode_ = this.mode_; + if (modeCase_ == 4 && directAccessWithFallbackBuilder_ != null) { + result.mode_ = directAccessWithFallbackBuilder_.build(); + } + if (modeCase_ == 5 && directAccessOnlyBuilder_ != null) { + result.mode_ = directAccessOnlyBuilder_.build(); + } + if (modeCase_ == 6 && cloudPathOnlyBuilder_ != null) { + result.mode_ = cloudPathOnlyBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance()) return this; + if (other.getMinServerCount() != 0) { + setMinServerCount(other.getMinServerCount()); + } + if (other.getMaxServerCount() != 0) { + setMaxServerCount(other.getMaxServerCount()); + } + if (other.getPerServerSessionCount() != 0) { + setPerServerSessionCount(other.getPerServerSessionCount()); + } + switch (other.getModeCase()) { + case DIRECT_ACCESS_WITH_FALLBACK: + { + mergeDirectAccessWithFallback(other.getDirectAccessWithFallback()); + break; + } + case DIRECT_ACCESS_ONLY: + { + mergeDirectAccessOnly(other.getDirectAccessOnly()); + break; + } + case CLOUD_PATH_ONLY: + { + mergeCloudPathOnly(other.getCloudPathOnly()); + break; + } + case MODE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + minServerCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxServerCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + perServerSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetDirectAccessWithFallbackFieldBuilder().getBuilder(), + extensionRegistry); + modeCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetDirectAccessOnlyFieldBuilder().getBuilder(), extensionRegistry); + modeCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetCloudPathOnlyFieldBuilder().getBuilder(), extensionRegistry); + modeCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int modeCase_ = 0; + private java.lang.Object mode_; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public Builder clearMode() { + modeCase_ = 0; + mode_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int minServerCount_; + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + @java.lang.Override + public int getMinServerCount() { + return minServerCount_; + } + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @param value The minServerCount to set. + * @return This builder for chaining. + */ + public Builder setMinServerCount(int value) { + + minServerCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinServerCount() { + bitField0_ = (bitField0_ & ~0x00000001); + minServerCount_ = 0; + onChanged(); + return this; + } + + private int maxServerCount_; + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + @java.lang.Override + public int getMaxServerCount() { + return maxServerCount_; + } + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @param value The maxServerCount to set. + * @return This builder for chaining. + */ + public Builder setMaxServerCount(int value) { + + maxServerCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxServerCount() { + bitField0_ = (bitField0_ & ~0x00000002); + maxServerCount_ = 0; + onChanged(); + return this; + } + + private int perServerSessionCount_; + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + @java.lang.Override + public int getPerServerSessionCount() { + return perServerSessionCount_; + } + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @param value The perServerSessionCount to set. + * @return This builder for chaining. + */ + public Builder setPerServerSessionCount(int value) { + + perServerSessionCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearPerServerSessionCount() { + bitField0_ = (bitField0_ & ~0x00000004); + perServerSessionCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder> + directAccessWithFallbackBuilder_; + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + @java.lang.Override + public boolean hasDirectAccessWithFallback() { + return modeCase_ == 4; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback() { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } else { + if (modeCase_ == 4) { + return directAccessWithFallbackBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder setDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + value) { + if (directAccessWithFallbackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + directAccessWithFallbackBuilder_.setMessage(value); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder setDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder + builderForValue) { + if (directAccessWithFallbackBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + directAccessWithFallbackBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder mergeDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + value) { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 4) { + directAccessWithFallbackBuilder_.mergeFrom(value); + } else { + directAccessWithFallbackBuilder_.setMessage(value); + } + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder clearDirectAccessWithFallback() { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + } + directAccessWithFallbackBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder + getDirectAccessWithFallbackBuilder() { + return internalGetDirectAccessWithFallbackFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder() { + if ((modeCase_ == 4) && (directAccessWithFallbackBuilder_ != null)) { + return directAccessWithFallbackBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder> + internalGetDirectAccessWithFallbackFieldBuilder() { + if (directAccessWithFallbackBuilder_ == null) { + if (!(modeCase_ == 4)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + directAccessWithFallbackBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 4; + onChanged(); + return directAccessWithFallbackBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder> + directAccessOnlyBuilder_; + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + @java.lang.Override + public boolean hasDirectAccessOnly() { + return modeCase_ == 5; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDirectAccessOnly() { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } else { + if (modeCase_ == 5) { + return directAccessOnlyBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder setDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + value) { + if (directAccessOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + directAccessOnlyBuilder_.setMessage(value); + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder setDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder + builderForValue) { + if (directAccessOnlyBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + directAccessOnlyBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder mergeDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + value) { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 5) { + directAccessOnlyBuilder_.mergeFrom(value); + } else { + directAccessOnlyBuilder_.setMessage(value); + } + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder clearDirectAccessOnly() { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 5) { + modeCase_ = 0; + mode_ = null; + } + directAccessOnlyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder + getDirectAccessOnlyBuilder() { + return internalGetDirectAccessOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder() { + if ((modeCase_ == 5) && (directAccessOnlyBuilder_ != null)) { + return directAccessOnlyBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder> + internalGetDirectAccessOnlyFieldBuilder() { + if (directAccessOnlyBuilder_ == null) { + if (!(modeCase_ == 5)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + directAccessOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 5; + onChanged(); + return directAccessOnlyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder> + cloudPathOnlyBuilder_; + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + @java.lang.Override + public boolean hasCloudPathOnly() { + return modeCase_ == 6; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getCloudPathOnly() { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } else { + if (modeCase_ == 6) { + return cloudPathOnlyBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder setCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + value) { + if (cloudPathOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + cloudPathOnlyBuilder_.setMessage(value); + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder setCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + .Builder + builderForValue) { + if (cloudPathOnlyBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + cloudPathOnlyBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder mergeCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + value) { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 6) { + cloudPathOnlyBuilder_.mergeFrom(value); + } else { + cloudPathOnlyBuilder_.setMessage(value); + } + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder clearCloudPathOnly() { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 6) { + modeCase_ = 0; + mode_ = null; + } + cloudPathOnlyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder + getCloudPathOnlyBuilder() { + return internalGetCloudPathOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder() { + if ((modeCase_ == 6) && (cloudPathOnlyBuilder_ != null)) { + return cloudPathOnlyBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder> + internalGetCloudPathOnlyFieldBuilder() { + if (cloudPathOnlyBuilder_ == null) { + if (!(modeCase_ == 6)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + cloudPathOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 6; + onChanged(); + return cloudPathOnlyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChannelPoolConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SessionPoolConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Fraction of idle sessions to keep in order to manage an increase in
+     * requests-in-flight. For example, a headroom of 0.5 will keep enough
+     * sessions to deal with a 50% increase in QPS.
+     * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + float getHeadroom(); + + /** + * + * + *
+     * The minimum number of sessions for a given scope.
+     * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + int getMinSessionCount(); + + /** + * + * + *
+     * The maximum number of sessions for a given scope.
+     * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + int getMaxSessionCount(); + + /** + * + * + *
+     * Number of vRPCs that can be queued per starting session.
+     * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + int getNewSessionQueueLength(); + + /** + * + * + *
+     * How many concurrent session establishments are allowed. The client will
+     * hold onto a count against this budget whenever it is establishing a new
+     * session, and release that count once the session is successfully
+     * established or failed to establish.
+     * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + int getNewSessionCreationBudget(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + boolean hasNewSessionCreationPenalty(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + com.google.protobuf.Duration getNewSessionCreationPenalty(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder(); + + /** + * + * + *
+     * A threshold for cancelling all pending vRPCs based on how many
+     * consecutive session establishment errors have been observed. The client
+     * will eagerly cancel queued vRPCs after this threshold is met to avoid
+     * them waiting their entire deadlines before terminating (while waiting for
+     * any session to establish to actually send the vRPC).
+     * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + int getConsecutiveSessionFailureThreshold(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + boolean hasLoadBalancingOptions(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder(); + } + + /** + * + * + *
+   * Configuration for the session pools. Session pools are tied to a scope
+   * like a table, an app profile, and a permission.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration} + */ + public static final class SessionPoolConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + SessionPoolConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionPoolConfiguration"); + } + + // Use SessionPoolConfiguration.newBuilder() to construct. + private SessionPoolConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionPoolConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + .class); + } + + private int bitField0_; + public static final int HEADROOM_FIELD_NUMBER = 1; + private float headroom_ = 0F; + + /** + * + * + *
+     * Fraction of idle sessions to keep in order to manage an increase in
+     * requests-in-flight. For example, a headroom of 0.5 will keep enough
+     * sessions to deal with a 50% increase in QPS.
+     * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + @java.lang.Override + public float getHeadroom() { + return headroom_; + } + + public static final int MIN_SESSION_COUNT_FIELD_NUMBER = 2; + private int minSessionCount_ = 0; + + /** + * + * + *
+     * The minimum number of sessions for a given scope.
+     * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + @java.lang.Override + public int getMinSessionCount() { + return minSessionCount_; + } + + public static final int MAX_SESSION_COUNT_FIELD_NUMBER = 3; + private int maxSessionCount_ = 0; + + /** + * + * + *
+     * The maximum number of sessions for a given scope.
+     * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + @java.lang.Override + public int getMaxSessionCount() { + return maxSessionCount_; + } + + public static final int NEW_SESSION_QUEUE_LENGTH_FIELD_NUMBER = 4; + private int newSessionQueueLength_ = 0; + + /** + * + * + *
+     * Number of vRPCs that can be queued per starting session.
+     * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + @java.lang.Override + public int getNewSessionQueueLength() { + return newSessionQueueLength_; + } + + public static final int NEW_SESSION_CREATION_BUDGET_FIELD_NUMBER = 5; + private int newSessionCreationBudget_ = 0; + + /** + * + * + *
+     * How many concurrent session establishments are allowed. The client will
+     * hold onto a count against this budget whenever it is establishing a new
+     * session, and release that count once the session is successfully
+     * established or failed to establish.
+     * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + @java.lang.Override + public int getNewSessionCreationBudget() { + return newSessionCreationBudget_; + } + + public static final int NEW_SESSION_CREATION_PENALTY_FIELD_NUMBER = 6; + private com.google.protobuf.Duration newSessionCreationPenalty_; + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + @java.lang.Override + public boolean hasNewSessionCreationPenalty() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + @java.lang.Override + public com.google.protobuf.Duration getNewSessionCreationPenalty() { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder() { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + + public static final int CONSECUTIVE_SESSION_FAILURE_THRESHOLD_FIELD_NUMBER = 8; + private int consecutiveSessionFailureThreshold_ = 0; + + /** + * + * + *
+     * A threshold for cancelling all pending vRPCs based on how many
+     * consecutive session establishment errors have been observed. The client
+     * will eagerly cancel queued vRPCs after this threshold is met to avoid
+     * them waiting their entire deadlines before terminating (while waiting for
+     * any session to establish to actually send the vRPC).
+     * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + @java.lang.Override + public int getConsecutiveSessionFailureThreshold() { + return consecutiveSessionFailureThreshold_; + } + + public static final int LOAD_BALANCING_OPTIONS_FIELD_NUMBER = 9; + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Override + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + 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 (java.lang.Float.floatToRawIntBits(headroom_) != 0) { + output.writeFloat(1, headroom_); + } + if (minSessionCount_ != 0) { + output.writeInt32(2, minSessionCount_); + } + if (maxSessionCount_ != 0) { + output.writeInt32(3, maxSessionCount_); + } + if (newSessionQueueLength_ != 0) { + output.writeInt32(4, newSessionQueueLength_); + } + if (newSessionCreationBudget_ != 0) { + output.writeInt32(5, newSessionCreationBudget_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getNewSessionCreationPenalty()); + } + if (consecutiveSessionFailureThreshold_ != 0) { + output.writeInt32(8, consecutiveSessionFailureThreshold_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getLoadBalancingOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(headroom_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, headroom_); + } + if (minSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minSessionCount_); + } + if (maxSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSessionCount_); + } + if (newSessionQueueLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, newSessionQueueLength_); + } + if (newSessionCreationBudget_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(5, newSessionCreationBudget_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, getNewSessionCreationPenalty()); + } + if (consecutiveSessionFailureThreshold_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 8, consecutiveSessionFailureThreshold_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getLoadBalancingOptions()); + } + size += getUnknownFields().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.SessionClientConfiguration.SessionPoolConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) obj; + + if (java.lang.Float.floatToIntBits(getHeadroom()) + != java.lang.Float.floatToIntBits(other.getHeadroom())) return false; + if (getMinSessionCount() != other.getMinSessionCount()) return false; + if (getMaxSessionCount() != other.getMaxSessionCount()) return false; + if (getNewSessionQueueLength() != other.getNewSessionQueueLength()) return false; + if (getNewSessionCreationBudget() != other.getNewSessionCreationBudget()) return false; + if (hasNewSessionCreationPenalty() != other.hasNewSessionCreationPenalty()) return false; + if (hasNewSessionCreationPenalty()) { + if (!getNewSessionCreationPenalty().equals(other.getNewSessionCreationPenalty())) + return false; + } + if (getConsecutiveSessionFailureThreshold() != other.getConsecutiveSessionFailureThreshold()) + return false; + if (hasLoadBalancingOptions() != other.hasLoadBalancingOptions()) return false; + if (hasLoadBalancingOptions()) { + if (!getLoadBalancingOptions().equals(other.getLoadBalancingOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HEADROOM_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getHeadroom()); + hash = (37 * hash) + MIN_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinSessionCount(); + hash = (37 * hash) + MAX_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSessionCount(); + hash = (37 * hash) + NEW_SESSION_QUEUE_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionQueueLength(); + hash = (37 * hash) + NEW_SESSION_CREATION_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionCreationBudget(); + if (hasNewSessionCreationPenalty()) { + hash = (37 * hash) + NEW_SESSION_CREATION_PENALTY_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionCreationPenalty().hashCode(); + } + hash = (37 * hash) + CONSECUTIVE_SESSION_FAILURE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getConsecutiveSessionFailureThreshold(); + if (hasLoadBalancingOptions()) { + hash = (37 * hash) + LOAD_BALANCING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getLoadBalancingOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + 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.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + 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.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration.SessionPoolConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Configuration for the session pools. Session pools are tied to a scope
+     * like a table, an app profile, and a permission.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetNewSessionCreationPenaltyFieldBuilder(); + internalGetLoadBalancingOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + headroom_ = 0F; + minSessionCount_ = 0; + maxSessionCount_ = 0; + newSessionQueueLength_ = 0; + newSessionCreationBudget_ = 0; + newSessionCreationPenalty_ = null; + if (newSessionCreationPenaltyBuilder_ != null) { + newSessionCreationPenaltyBuilder_.dispose(); + newSessionCreationPenaltyBuilder_ = null; + } + consecutiveSessionFailureThreshold_ = 0; + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.headroom_ = headroom_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minSessionCount_ = minSessionCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxSessionCount_ = maxSessionCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.newSessionQueueLength_ = newSessionQueueLength_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.newSessionCreationBudget_ = newSessionCreationBudget_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.newSessionCreationPenalty_ = + newSessionCreationPenaltyBuilder_ == null + ? newSessionCreationPenalty_ + : newSessionCreationPenaltyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.consecutiveSessionFailureThreshold_ = consecutiveSessionFailureThreshold_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.loadBalancingOptions_ = + loadBalancingOptionsBuilder_ == null + ? loadBalancingOptions_ + : loadBalancingOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance()) return this; + if (java.lang.Float.floatToRawIntBits(other.getHeadroom()) != 0) { + setHeadroom(other.getHeadroom()); + } + if (other.getMinSessionCount() != 0) { + setMinSessionCount(other.getMinSessionCount()); + } + if (other.getMaxSessionCount() != 0) { + setMaxSessionCount(other.getMaxSessionCount()); + } + if (other.getNewSessionQueueLength() != 0) { + setNewSessionQueueLength(other.getNewSessionQueueLength()); + } + if (other.getNewSessionCreationBudget() != 0) { + setNewSessionCreationBudget(other.getNewSessionCreationBudget()); + } + if (other.hasNewSessionCreationPenalty()) { + mergeNewSessionCreationPenalty(other.getNewSessionCreationPenalty()); + } + if (other.getConsecutiveSessionFailureThreshold() != 0) { + setConsecutiveSessionFailureThreshold(other.getConsecutiveSessionFailureThreshold()); + } + if (other.hasLoadBalancingOptions()) { + mergeLoadBalancingOptions(other.getLoadBalancingOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + headroom_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 16: + { + minSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + newSessionQueueLength_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + newSessionCreationBudget_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage( + internalGetNewSessionCreationPenaltyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 64: + { + consecutiveSessionFailureThreshold_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetLoadBalancingOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float headroom_; + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + @java.lang.Override + public float getHeadroom() { + return headroom_; + } + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @param value The headroom to set. + * @return This builder for chaining. + */ + public Builder setHeadroom(float value) { + + headroom_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @return This builder for chaining. + */ + public Builder clearHeadroom() { + bitField0_ = (bitField0_ & ~0x00000001); + headroom_ = 0F; + onChanged(); + return this; + } + + private int minSessionCount_; + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + @java.lang.Override + public int getMinSessionCount() { + return minSessionCount_; + } + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @param value The minSessionCount to set. + * @return This builder for chaining. + */ + public Builder setMinSessionCount(int value) { + + minSessionCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinSessionCount() { + bitField0_ = (bitField0_ & ~0x00000002); + minSessionCount_ = 0; + onChanged(); + return this; + } + + private int maxSessionCount_; + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + @java.lang.Override + public int getMaxSessionCount() { + return maxSessionCount_; + } + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @param value The maxSessionCount to set. + * @return This builder for chaining. + */ + public Builder setMaxSessionCount(int value) { + + maxSessionCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxSessionCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxSessionCount_ = 0; + onChanged(); + return this; + } + + private int newSessionQueueLength_; + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + @java.lang.Override + public int getNewSessionQueueLength() { + return newSessionQueueLength_; + } + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @param value The newSessionQueueLength to set. + * @return This builder for chaining. + */ + public Builder setNewSessionQueueLength(int value) { + + newSessionQueueLength_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearNewSessionQueueLength() { + bitField0_ = (bitField0_ & ~0x00000008); + newSessionQueueLength_ = 0; + onChanged(); + return this; + } + + private int newSessionCreationBudget_; + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + @java.lang.Override + public int getNewSessionCreationBudget() { + return newSessionCreationBudget_; + } + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @param value The newSessionCreationBudget to set. + * @return This builder for chaining. + */ + public Builder setNewSessionCreationBudget(int value) { + + newSessionCreationBudget_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return This builder for chaining. + */ + public Builder clearNewSessionCreationBudget() { + bitField0_ = (bitField0_ & ~0x00000010); + newSessionCreationBudget_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration newSessionCreationPenalty_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + newSessionCreationPenaltyBuilder_; + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + public boolean hasNewSessionCreationPenalty() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + public com.google.protobuf.Duration getNewSessionCreationPenalty() { + if (newSessionCreationPenaltyBuilder_ == null) { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } else { + return newSessionCreationPenaltyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder setNewSessionCreationPenalty(com.google.protobuf.Duration value) { + if (newSessionCreationPenaltyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newSessionCreationPenalty_ = value; + } else { + newSessionCreationPenaltyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder setNewSessionCreationPenalty( + com.google.protobuf.Duration.Builder builderForValue) { + if (newSessionCreationPenaltyBuilder_ == null) { + newSessionCreationPenalty_ = builderForValue.build(); + } else { + newSessionCreationPenaltyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder mergeNewSessionCreationPenalty(com.google.protobuf.Duration value) { + if (newSessionCreationPenaltyBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && newSessionCreationPenalty_ != null + && newSessionCreationPenalty_ != com.google.protobuf.Duration.getDefaultInstance()) { + getNewSessionCreationPenaltyBuilder().mergeFrom(value); + } else { + newSessionCreationPenalty_ = value; + } + } else { + newSessionCreationPenaltyBuilder_.mergeFrom(value); + } + if (newSessionCreationPenalty_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder clearNewSessionCreationPenalty() { + bitField0_ = (bitField0_ & ~0x00000020); + newSessionCreationPenalty_ = null; + if (newSessionCreationPenaltyBuilder_ != null) { + newSessionCreationPenaltyBuilder_.dispose(); + newSessionCreationPenaltyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public com.google.protobuf.Duration.Builder getNewSessionCreationPenaltyBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetNewSessionCreationPenaltyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder() { + if (newSessionCreationPenaltyBuilder_ != null) { + return newSessionCreationPenaltyBuilder_.getMessageOrBuilder(); + } else { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetNewSessionCreationPenaltyFieldBuilder() { + if (newSessionCreationPenaltyBuilder_ == null) { + newSessionCreationPenaltyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getNewSessionCreationPenalty(), getParentForChildren(), isClean()); + newSessionCreationPenalty_ = null; + } + return newSessionCreationPenaltyBuilder_; + } + + private int consecutiveSessionFailureThreshold_; + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + @java.lang.Override + public int getConsecutiveSessionFailureThreshold() { + return consecutiveSessionFailureThreshold_; + } + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @param value The consecutiveSessionFailureThreshold to set. + * @return This builder for chaining. + */ + public Builder setConsecutiveSessionFailureThreshold(int value) { + + consecutiveSessionFailureThreshold_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return This builder for chaining. + */ + public Builder clearConsecutiveSessionFailureThreshold() { + bitField0_ = (bitField0_ & ~0x00000040); + consecutiveSessionFailureThreshold_ = 0; + onChanged(); + return this; + } + + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + loadBalancingOptionsBuilder_; + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + if (loadBalancingOptionsBuilder_ == null) { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } else { + return loadBalancingOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder setLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingOptions_ = value; + } else { + loadBalancingOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder setLoadBalancingOptions( + com.google.bigtable.v2.LoadBalancingOptions.Builder builderForValue) { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptions_ = builderForValue.build(); + } else { + loadBalancingOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder mergeLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && loadBalancingOptions_ != null + && loadBalancingOptions_ + != com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) { + getLoadBalancingOptionsBuilder().mergeFrom(value); + } else { + loadBalancingOptions_ = value; + } + } else { + loadBalancingOptionsBuilder_.mergeFrom(value); + } + if (loadBalancingOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder clearLoadBalancingOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public com.google.bigtable.v2.LoadBalancingOptions.Builder getLoadBalancingOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetLoadBalancingOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder + getLoadBalancingOptionsOrBuilder() { + if (loadBalancingOptionsBuilder_ != null) { + return loadBalancingOptionsBuilder_.getMessageOrBuilder(); + } else { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + internalGetLoadBalancingOptionsFieldBuilder() { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder>( + getLoadBalancingOptions(), getParentForChildren(), isClean()); + loadBalancingOptions_ = null; + } + return loadBalancingOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionPoolConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int SESSION_LOAD_FIELD_NUMBER = 1; + private float sessionLoad_ = 0F; + + /** + * + * + *
+   * What share of requests should operate on a session, [0, 1]. The rest
+   * should operate on the old-style API.
+   * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + @java.lang.Override + public float getSessionLoad() { + return sessionLoad_; + } + + public static final int LOAD_BALANCING_OPTIONS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + public static final int CHANNEL_CONFIGURATION_FIELD_NUMBER = 3; + private com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + channelConfiguration_; + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + @java.lang.Override + public boolean hasChannelConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration() { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder() { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + + public static final int SESSION_POOL_CONFIGURATION_FIELD_NUMBER = 4; + private com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + sessionPoolConfiguration_; + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + @java.lang.Override + public boolean hasSessionPoolConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration() { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder() { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + + 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 (java.lang.Float.floatToRawIntBits(sessionLoad_) != 0) { + output.writeFloat(1, sessionLoad_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLoadBalancingOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getChannelConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getSessionPoolConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(sessionLoad_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, sessionLoad_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLoadBalancingOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getChannelConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getSessionPoolConfiguration()); + } + size += getUnknownFields().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.SessionClientConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration) obj; + + if (java.lang.Float.floatToIntBits(getSessionLoad()) + != java.lang.Float.floatToIntBits(other.getSessionLoad())) return false; + if (hasLoadBalancingOptions() != other.hasLoadBalancingOptions()) return false; + if (hasLoadBalancingOptions()) { + if (!getLoadBalancingOptions().equals(other.getLoadBalancingOptions())) return false; + } + if (hasChannelConfiguration() != other.hasChannelConfiguration()) return false; + if (hasChannelConfiguration()) { + if (!getChannelConfiguration().equals(other.getChannelConfiguration())) return false; + } + if (hasSessionPoolConfiguration() != other.hasSessionPoolConfiguration()) return false; + if (hasSessionPoolConfiguration()) { + if (!getSessionPoolConfiguration().equals(other.getSessionPoolConfiguration())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SESSION_LOAD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getSessionLoad()); + if (hasLoadBalancingOptions()) { + hash = (37 * hash) + LOAD_BALANCING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getLoadBalancingOptions().hashCode(); + } + if (hasChannelConfiguration()) { + hash = (37 * hash) + CHANNEL_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getChannelConfiguration().hashCode(); + } + if (hasSessionPoolConfiguration()) { + hash = (37 * hash) + SESSION_POOL_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getSessionPoolConfiguration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration 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.SessionClientConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration 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.SessionClientConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionClientConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for the Session API. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration) + com.google.bigtable.v2.SessionClientConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionClientConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLoadBalancingOptionsFieldBuilder(); + internalGetChannelConfigurationFieldBuilder(); + internalGetSessionPoolConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sessionLoad_ = 0F; + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + channelConfiguration_ = null; + if (channelConfigurationBuilder_ != null) { + channelConfigurationBuilder_.dispose(); + channelConfigurationBuilder_ = null; + } + sessionPoolConfiguration_ = null; + if (sessionPoolConfigurationBuilder_ != null) { + sessionPoolConfigurationBuilder_.dispose(); + sessionPoolConfigurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionClientConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sessionLoad_ = sessionLoad_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.loadBalancingOptions_ = + loadBalancingOptionsBuilder_ == null + ? loadBalancingOptions_ + : loadBalancingOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.channelConfiguration_ = + channelConfigurationBuilder_ == null + ? channelConfiguration_ + : channelConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sessionPoolConfiguration_ = + sessionPoolConfigurationBuilder_ == null + ? sessionPoolConfiguration_ + : sessionPoolConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionClientConfiguration) { + return mergeFrom((com.google.bigtable.v2.SessionClientConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionClientConfiguration other) { + if (other == com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance()) + return this; + if (java.lang.Float.floatToRawIntBits(other.getSessionLoad()) != 0) { + setSessionLoad(other.getSessionLoad()); + } + if (other.hasLoadBalancingOptions()) { + mergeLoadBalancingOptions(other.getLoadBalancingOptions()); + } + if (other.hasChannelConfiguration()) { + mergeChannelConfiguration(other.getChannelConfiguration()); + } + if (other.hasSessionPoolConfiguration()) { + mergeSessionPoolConfiguration(other.getSessionPoolConfiguration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + sessionLoad_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + input.readMessage( + internalGetLoadBalancingOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetChannelConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSessionPoolConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float sessionLoad_; + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + @java.lang.Override + public float getSessionLoad() { + return sessionLoad_; + } + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @param value The sessionLoad to set. + * @return This builder for chaining. + */ + public Builder setSessionLoad(float value) { + + sessionLoad_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @return This builder for chaining. + */ + public Builder clearSessionLoad() { + bitField0_ = (bitField0_ & ~0x00000001); + sessionLoad_ = 0F; + onChanged(); + return this; + } + + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + loadBalancingOptionsBuilder_; + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is + * deprecated. See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Deprecated + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is + * deprecated. See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + if (loadBalancingOptionsBuilder_ == null) { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } else { + return loadBalancingOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingOptions_ = value; + } else { + loadBalancingOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setLoadBalancingOptions( + com.google.bigtable.v2.LoadBalancingOptions.Builder builderForValue) { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptions_ = builderForValue.build(); + } else { + loadBalancingOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && loadBalancingOptions_ != null + && loadBalancingOptions_ + != com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) { + getLoadBalancingOptionsBuilder().mergeFrom(value); + } else { + loadBalancingOptions_ = value; + } + } else { + loadBalancingOptionsBuilder_.mergeFrom(value); + } + if (loadBalancingOptions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearLoadBalancingOptions() { + bitField0_ = (bitField0_ & ~0x00000002); + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions.Builder getLoadBalancingOptionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetLoadBalancingOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + if (loadBalancingOptionsBuilder_ != null) { + return loadBalancingOptionsBuilder_.getMessageOrBuilder(); + } else { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + internalGetLoadBalancingOptionsFieldBuilder() { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder>( + getLoadBalancingOptions(), getParentForChildren(), isClean()); + loadBalancingOptions_ = null; + } + return loadBalancingOptionsBuilder_; + } + + private com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + channelConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder> + channelConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + public boolean hasChannelConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration() { + if (channelConfigurationBuilder_ == null) { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } else { + return channelConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder setChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration value) { + if (channelConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + channelConfiguration_ = value; + } else { + channelConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder setChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + builderForValue) { + if (channelConfigurationBuilder_ == null) { + channelConfiguration_ = builderForValue.build(); + } else { + channelConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder mergeChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration value) { + if (channelConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && channelConfiguration_ != null + && channelConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance()) { + getChannelConfigurationBuilder().mergeFrom(value); + } else { + channelConfiguration_ = value; + } + } else { + channelConfigurationBuilder_.mergeFrom(value); + } + if (channelConfiguration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder clearChannelConfiguration() { + bitField0_ = (bitField0_ & ~0x00000004); + channelConfiguration_ = null; + if (channelConfigurationBuilder_ != null) { + channelConfigurationBuilder_.dispose(); + channelConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + getChannelConfigurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetChannelConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder() { + if (channelConfigurationBuilder_ != null) { + return channelConfigurationBuilder_.getMessageOrBuilder(); + } else { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder> + internalGetChannelConfigurationFieldBuilder() { + if (channelConfigurationBuilder_ == null) { + channelConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfigurationOrBuilder>( + getChannelConfiguration(), getParentForChildren(), isClean()); + channelConfiguration_ = null; + } + return channelConfigurationBuilder_; + } + + private com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + sessionPoolConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder> + sessionPoolConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + public boolean hasSessionPoolConfiguration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration() { + if (sessionPoolConfigurationBuilder_ == null) { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } else { + return sessionPoolConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder setSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration value) { + if (sessionPoolConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionPoolConfiguration_ = value; + } else { + sessionPoolConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder setSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + builderForValue) { + if (sessionPoolConfigurationBuilder_ == null) { + sessionPoolConfiguration_ = builderForValue.build(); + } else { + sessionPoolConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder mergeSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration value) { + if (sessionPoolConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && sessionPoolConfiguration_ != null + && sessionPoolConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance()) { + getSessionPoolConfigurationBuilder().mergeFrom(value); + } else { + sessionPoolConfiguration_ = value; + } + } else { + sessionPoolConfigurationBuilder_.mergeFrom(value); + } + if (sessionPoolConfiguration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder clearSessionPoolConfiguration() { + bitField0_ = (bitField0_ & ~0x00000008); + sessionPoolConfiguration_ = null; + if (sessionPoolConfigurationBuilder_ != null) { + sessionPoolConfigurationBuilder_.dispose(); + sessionPoolConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + getSessionPoolConfigurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSessionPoolConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder() { + if (sessionPoolConfigurationBuilder_ != null) { + return sessionPoolConfigurationBuilder_.getMessageOrBuilder(); + } else { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder> + internalGetSessionPoolConfigurationFieldBuilder() { + if (sessionPoolConfigurationBuilder_ == null) { + sessionPoolConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration + .SessionPoolConfigurationOrBuilder>( + getSessionPoolConfiguration(), getParentForChildren(), isClean()); + sessionPoolConfiguration_ = null; + } + return sessionPoolConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionClientConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionClientConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionClientConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java new file mode 100644 index 000000000000..aca5739fdfbe --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionClientConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * What share of requests should operate on a session, [0, 1]. The rest
+   * should operate on the old-style API.
+   * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + float getSessionLoad(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Deprecated + boolean hasLoadBalancingOptions(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Deprecated + com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + boolean hasChannelConfiguration(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + boolean hasSessionPoolConfiguration(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java new file mode 100644 index 000000000000..5dffbcbfa991 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java @@ -0,0 +1,810 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowRequest} + */ +@com.google.protobuf.Generated +public final class SessionMutateRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionMutateRowRequest) + SessionMutateRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionMutateRowRequest"); + } + + // Use SessionMutateRowRequest.newBuilder() to construct. + private SessionMutateRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionMutateRowRequest() { + key_ = com.google.protobuf.ByteString.EMPTY; + mutations_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowRequest.class, + com.google.bigtable.v2.SessionMutateRowRequest.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int MUTATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List mutations_; + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public java.util.List getMutationsList() { + return mutations_; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public java.util.List + getMutationsOrBuilderList() { + return mutations_; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public int getMutationsCount() { + return mutations_.size(); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getMutations(int index) { + return mutations_.get(index); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + return mutations_.get(index); + } + + 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 (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + for (int i = 0; i < mutations_.size(); i++) { + output.writeMessage(2, mutations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + for (int i = 0; i < mutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, mutations_.get(i)); + } + size += getUnknownFields().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.SessionMutateRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionMutateRowRequest other = + (com.google.bigtable.v2.SessionMutateRowRequest) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getMutationsList().equals(other.getMutationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getMutationsCount() > 0) { + hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getMutationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest 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.SessionMutateRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest 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.SessionMutateRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionMutateRowRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionMutateRowRequest) + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowRequest.class, + com.google.bigtable.v2.SessionMutateRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionMutateRowRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + } else { + mutations_ = null; + mutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest build() { + com.google.bigtable.v2.SessionMutateRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest buildPartial() { + com.google.bigtable.v2.SessionMutateRowRequest result = + new com.google.bigtable.v2.SessionMutateRowRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.SessionMutateRowRequest result) { + if (mutationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + mutations_ = java.util.Collections.unmodifiableList(mutations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.mutations_ = mutations_; + } else { + result.mutations_ = mutationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.SessionMutateRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionMutateRowRequest) { + return mergeFrom((com.google.bigtable.v2.SessionMutateRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionMutateRowRequest other) { + if (other == com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + if (mutationsBuilder_ == null) { + if (!other.mutations_.isEmpty()) { + if (mutations_.isEmpty()) { + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMutationsIsMutable(); + mutations_.addAll(other.mutations_); + } + onChanged(); + } + } else { + if (!other.mutations_.isEmpty()) { + if (mutationsBuilder_.isEmpty()) { + mutationsBuilder_.dispose(); + mutationsBuilder_ = null; + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + mutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() + : null; + } else { + mutationsBuilder_.addAllMessages(other.mutations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Mutation m = + input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(m); + } else { + mutationsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private java.util.List mutations_ = + java.util.Collections.emptyList(); + + private void ensureMutationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + mutations_ = new java.util.ArrayList(mutations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + mutationsBuilder_; + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List getMutationsList() { + if (mutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mutations_); + } else { + return mutationsBuilder_.getMessageList(); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public int getMutationsCount() { + if (mutationsBuilder_ == null) { + return mutations_.size(); + } else { + return mutationsBuilder_.getCount(); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation getMutations(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessage(index); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.set(index, value); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder setMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.set(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(value); + onChanged(); + } else { + mutationsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(index, value); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addAllMutations( + java.lang.Iterable values) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutations_); + onChanged(); + } else { + mutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder clearMutations() { + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + mutationsBuilder_.clear(); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder removeMutations(int index) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.remove(index); + onChanged(); + } else { + mutationsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder().getBuilder(index); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List + getMutationsOrBuilderList() { + if (mutationsBuilder_ != null) { + return mutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mutations_); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { + return internalGetMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List getMutationsBuilderList() { + return internalGetMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetMutationsFieldBuilder() { + if (mutationsBuilder_ == null) { + mutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + mutations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + mutations_ = null; + } + return mutationsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionMutateRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionMutateRowRequest) + private static final com.google.bigtable.v2.SessionMutateRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionMutateRowRequest(); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMutateRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionMutateRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java new file mode 100644 index 000000000000..c7f81edb4734 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionMutateRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionMutateRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + java.util.List getMutationsList(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + com.google.bigtable.v2.Mutation getMutations(int index); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + int getMutationsCount(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + java.util.List getMutationsOrBuilderList(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java new file mode 100644 index 000000000000..24953a9d987e --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowResponse} + */ +@com.google.protobuf.Generated +public final class SessionMutateRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionMutateRowResponse) + SessionMutateRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionMutateRowResponse"); + } + + // Use SessionMutateRowResponse.newBuilder() to construct. + private SessionMutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionMutateRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowResponse.class, + com.google.bigtable.v2.SessionMutateRowResponse.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.SessionMutateRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionMutateRowResponse other = + (com.google.bigtable.v2.SessionMutateRowResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse 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.SessionMutateRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse 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.SessionMutateRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionMutateRowResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionMutateRowResponse) + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowResponse.class, + com.google.bigtable.v2.SessionMutateRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionMutateRowResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse build() { + com.google.bigtable.v2.SessionMutateRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse buildPartial() { + com.google.bigtable.v2.SessionMutateRowResponse result = + new com.google.bigtable.v2.SessionMutateRowResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionMutateRowResponse) { + return mergeFrom((com.google.bigtable.v2.SessionMutateRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionMutateRowResponse other) { + if (other == com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionMutateRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionMutateRowResponse) + private static final com.google.bigtable.v2.SessionMutateRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionMutateRowResponse(); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMutateRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionMutateRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java new file mode 100644 index 000000000000..398282c8fa5d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionMutateRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionMutateRowResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java new file mode 100644 index 000000000000..885a9c69bd78 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java @@ -0,0 +1,750 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionParametersResponse} + */ +@com.google.protobuf.Generated +public final class SessionParametersResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionParametersResponse) + SessionParametersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionParametersResponse"); + } + + // Use SessionParametersResponse.newBuilder() to construct. + private SessionParametersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionParametersResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionParametersResponse.class, + com.google.bigtable.v2.SessionParametersResponse.Builder.class); + } + + private int bitField0_; + public static final int KEEP_ALIVE_FIELD_NUMBER = 1; + private com.google.protobuf.Duration keepAlive_; + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + @java.lang.Override + public boolean hasKeepAlive() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + @java.lang.Override + public com.google.protobuf.Duration getKeepAlive() { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder() { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getKeepAlive()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKeepAlive()); + } + size += getUnknownFields().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.SessionParametersResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionParametersResponse other = + (com.google.bigtable.v2.SessionParametersResponse) obj; + + if (hasKeepAlive() != other.hasKeepAlive()) return false; + if (hasKeepAlive()) { + if (!getKeepAlive().equals(other.getKeepAlive())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKeepAlive()) { + hash = (37 * hash) + KEEP_ALIVE_FIELD_NUMBER; + hash = (53 * hash) + getKeepAlive().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse 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.SessionParametersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse 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.SessionParametersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionParametersResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionParametersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionParametersResponse) + com.google.bigtable.v2.SessionParametersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionParametersResponse.class, + com.google.bigtable.v2.SessionParametersResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionParametersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeepAliveFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + keepAlive_ = null; + if (keepAliveBuilder_ != null) { + keepAliveBuilder_.dispose(); + keepAliveBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse build() { + com.google.bigtable.v2.SessionParametersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse buildPartial() { + com.google.bigtable.v2.SessionParametersResponse result = + new com.google.bigtable.v2.SessionParametersResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionParametersResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.keepAlive_ = keepAliveBuilder_ == null ? keepAlive_ : keepAliveBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionParametersResponse) { + return mergeFrom((com.google.bigtable.v2.SessionParametersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionParametersResponse other) { + if (other == com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance()) + return this; + if (other.hasKeepAlive()) { + mergeKeepAlive(other.getKeepAlive()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetKeepAliveFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration keepAlive_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + keepAliveBuilder_; + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + public boolean hasKeepAlive() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + public com.google.protobuf.Duration getKeepAlive() { + if (keepAliveBuilder_ == null) { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } else { + return keepAliveBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder setKeepAlive(com.google.protobuf.Duration value) { + if (keepAliveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keepAlive_ = value; + } else { + keepAliveBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder setKeepAlive(com.google.protobuf.Duration.Builder builderForValue) { + if (keepAliveBuilder_ == null) { + keepAlive_ = builderForValue.build(); + } else { + keepAliveBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder mergeKeepAlive(com.google.protobuf.Duration value) { + if (keepAliveBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && keepAlive_ != null + && keepAlive_ != com.google.protobuf.Duration.getDefaultInstance()) { + getKeepAliveBuilder().mergeFrom(value); + } else { + keepAlive_ = value; + } + } else { + keepAliveBuilder_.mergeFrom(value); + } + if (keepAlive_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder clearKeepAlive() { + bitField0_ = (bitField0_ & ~0x00000001); + keepAlive_ = null; + if (keepAliveBuilder_ != null) { + keepAliveBuilder_.dispose(); + keepAliveBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public com.google.protobuf.Duration.Builder getKeepAliveBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetKeepAliveFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder() { + if (keepAliveBuilder_ != null) { + return keepAliveBuilder_.getMessageOrBuilder(); + } else { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetKeepAliveFieldBuilder() { + if (keepAliveBuilder_ == null) { + keepAliveBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getKeepAlive(), getParentForChildren(), isClean()); + keepAlive_ = null; + } + return keepAliveBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionParametersResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionParametersResponse) + private static final com.google.bigtable.v2.SessionParametersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionParametersResponse(); + } + + public static com.google.bigtable.v2.SessionParametersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionParametersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionParametersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java new file mode 100644 index 000000000000..9dae3f5fd2ca --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionParametersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionParametersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + boolean hasKeepAlive(); + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + com.google.protobuf.Duration getKeepAlive(); + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java new file mode 100644 index 000000000000..e6ebe0ebf688 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java @@ -0,0 +1,997 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class SessionProto extends com.google.protobuf.GeneratedFile { + private SessionProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.bigtable.v2.SessionProto.openSessionType); + registry.add(com.google.bigtable.v2.SessionProto.vrpcSessionType); + registry.add(com.google.bigtable.v2.SessionProto.rpcSessionType); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int OPEN_SESSION_TYPE_FIELD_NUMBER = 138898474; + + /** + * + * + *
+   * Only OpenSessionRequest.payload's with a type matching rpc_session_type are
+   * accepted by the server, and only OpenSessionResponse.payload's with a type
+   * matching rpc_session_type are accepted by the client.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, com.google.bigtable.v2.SessionType> + openSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + public static final int VRPC_SESSION_TYPE_FIELD_NUMBER = 138899157; + + /** + * + * + *
+   * Only VirtualRpcRequest.payload's with a type matching rpc_session_type are
+   * accepted by the server, and only VirtualRpcResponse.payload's with a type
+   * matching rpc_session_type are accepted by the client.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.util.List> + vrpcSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + public static final int RPC_SESSION_TYPE_FIELD_NUMBER = 137964804; + + /** + * + * + *
+   * All session service methods must set this option to indicate which
+   * messages are permissible within the generic envelope.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, com.google.bigtable.v2.SessionType> + rpcSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClusterInformation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ErrorResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TableResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + " google/bigtable/v2/session.proto\022\022goog" + + "le.bigtable.v2\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032\035goog" + + "le/bigtable/v2/data.proto\032&google/bigtab" + + "le/v2/feature_flags.proto\032&google/bigtable/v2/request_stats.proto\032 google/protob" + + "uf/descriptor.proto\032\036google/protobuf/dur" + + "ation.proto\032\037google/protobuf/timestamp.p" + + "roto\032\036google/rpc/error_details.proto\032\027google/rpc/status.proto\"\202\001\n" + + "\035GetClientConfigurationRequest\022D\n\r" + + "instance_name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\033\n" + + "\016app_profile_id\030\002 \001(\tB\003\340A\001\"\356\002\n" + + "\024LoadBalancingOptions\022Q\n" + + "\017least_in_flight\030\001" + + " \001(\01326.google.bigtable.v2.LoadBalancingOptions.LeastInFlightH\000\022F\n" + + "\tpeak_ewma\030\002 \001(" + + "\01321.google.bigtable.v2.LoadBalancingOptions.PeakEwmaH\000\022A\n" + + "\006random\030\004 \001(\0132/.google." + + "bigtable.v2.LoadBalancingOptions.RandomH\000\032+\n\r" + + "LeastInFlight\022\032\n" + + "\022random_subset_size\030\001 \001(\003\032&\n" + + "\010PeakEwma\022\032\n" + + "\022random_subset_size\030\001 \001(\003\032\010\n" + + "\006RandomB\031\n" + + "\027load_balancing_strategy\"\274\n\n" + + "\032SessionClientConfiguration\022\024\n" + + "\014session_load\030\001 \001(\002\022L\n" + + "\026load_balancing_options\030\002" + + " \001(\0132(.google.bigtable.v2.LoadBalancingOptionsB\002\030\001\022f\n" + + "\025channel_configuration\030\003 \001(\0132G.google.bigtable.v2.SessionClient" + + "Configuration.ChannelPoolConfiguration\022k\n" + + "\032session_pool_configuration\030\004 \001(\0132G.goo" + + "gle.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration\032\376\004\n" + + "\030ChannelPoolConfiguration\022\030\n" + + "\020min_server_count\030\001 \001(\005\022\030\n" + + "\020max_server_count\030\002 \001(\005\022 \n" + + "\030per_server_session_count\030\003 \001(\005\022\207\001\n" + + "\033direct_access_with_fallback\030\004 \001(\0132`.google.bigtable.v" + + "2.SessionClientConfiguration.ChannelPool" + + "Configuration.DirectAccessWithFallbackH\000\022v\n" + + "\022direct_access_only\030\005 \001(\0132X.google.bi" + + "gtable.v2.SessionClientConfiguration.Cha" + + "nnelPoolConfiguration.DirectAccessOnlyH\000\022p\n" + + "\017cloud_path_only\030\006 \001(\0132U.google.bigta" + + "ble.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnlyH\000\032k\n" + + "\030DirectAccessWithFallback\022\034\n" + + "\024error_rate_threshold\030\001 \001(\002\0221\n" + + "\016check_interval\030\002 \001(\0132\031.google.protobuf.Duration\032\022\n" + + "\020DirectAccessOnly\032\017\n\r" + + "CloudPathOnlyB\006\n" + + "\004mode\032\343\002\n" + + "\030SessionPoolConfiguration\022\020\n" + + "\010headroom\030\001 \001(\002\022\031\n" + + "\021min_session_count\030\002 \001(\005\022\031\n" + + "\021max_session_count\030\003 \001(\005\022 \n" + + "\030new_session_queue_length\030\004 \001(\005\022#\n" + + "\033new_session_creation_budget\030\005 \001(\005\022?\n" + + "\034new_session_creation_penalty\030\006" + + " \001(\0132\031.google.protobuf.Duration\022-\n" + + "%consecutive_session_failure_threshold\030\010 \001(\005\022H\n" + + "\026load_balancing_options\030\t" + + " \001(\0132(.google.bigtable.v2.LoadBalancingOptions\"\255\001\n" + + "\026TelemetryConfiguration\022I\n" + + "\017debug_tag_level\030\001 \001(\01620" + + ".google.bigtable.v2.TelemetryConfiguration.Level\"H\n" + + "\005Level\022\025\n" + + "\021LEVEL_UNSPECIFIED\020\000\022\t\n" + + "\005DEBUG\020\001\022\010\n" + + "\004INFO\020\002\022\010\n" + + "\004WARN\020\003\022\t\n" + + "\005ERROR\020\004\"\217\004\n" + + "\023ClientConfiguration\022M\n" + + "\025session_configuration\030\002" + + " \001(\0132..google.bigtable.v2.SessionClientConfiguration\022\026\n" + + "\014stop_polling\030\003 \001(\010H\000\0229\n" + + "\020polling_interval\030\004" + + " \001(\0132\031.google.protobuf.DurationB\002\030\001H\000\022]\n" + + "\025polling_configuration\030\005 \001(\0132<.google.bigtable.v2" + + ".ClientConfiguration.PollingConfigurationH\000\022K\n" + + "\027telemetry_configuration\030\006 \001(\0132*.g" + + "oogle.bigtable.v2.TelemetryConfiguration\032\236\001\n" + + "\024PollingConfiguration\0223\n" + + "\020polling_interval\030\001 \001(\0132\031.google.protobuf.Duration\0224\n" + + "\021validity_duration\030\002 \001(\0132\031.google.protobuf.Duration\022\033\n" + + "\023max_rpc_retry_count\030\006 \001(\005B\t\n" + + "\007polling\"\333\001\n" + + "\016SessionRequest\022>\n" + + "\014open_session\030\001" + + " \001(\0132&.google.bigtable.v2.OpenSessionRequestH\000\022@\n\r" + + "close_session\030\002 \001(\0132\'.google.bigtable.v2.CloseSessionRequestH\000\022<\n" + + "\013virtual_rpc\030\003 \001(\0132%.google.bigtable.v2.VirtualRpcRequestH\000B\t\n" + + "\007payload\"\334\003\n" + + "\017SessionResponse\022?\n" + + "\014open_session\030\001 \001(\0132\'.g" + + "oogle.bigtable.v2.OpenSessionResponseH\000\022=\n" + + "\013virtual_rpc\030\002 \001(\0132&.google.bigtable.v2.VirtualRpcResponseH\000\0222\n" + + "\005error\030\003 \001(\0132!.google.bigtable.v2.ErrorResponseH\000\022K\n" + + "\022session_parameters\030\004" + + " \001(\0132-.google.bigtable.v2.SessionParametersResponseH\000\022:\n" + + "\theartbeat\030\005 \001(\0132%.google.bigtable.v2.HeartbeatResponseH\000\0225\n" + + "\007go_away\030\006 \001(\0132\".google.bigtable.v2.GoAwayResponseH\000\022J\n" + + "\026session_refresh_config\030\007" + + " \001(\0132(.google.bigtable.v2.SessionRefreshConfigH\000B\t\n" + + "\007payload\"\270\001\n" + + "\022OpenSessionRequest\022\030\n" + + "\020protocol_version\030\001 \001(\003\022/\n" + + "\005flags\030\002 \001(\0132 .google.bigtable.v2.FeatureFlags\022.\n" + + "&consecutive_failed_connection_attempts\030\003 \001(\003\022\026\n" + + "\016routing_cookie\030\004 \001(\014\022\017\n" + + "\007payload\030\005 \001(\014\"s\n" + + "\021BackendIdentifier\022\032\n" + + "\022google_frontend_id\030\001 \001(\003\022\037\n" + + "\027application_frontend_id\030\002 \001(\003\022!\n" + + "\031application_frontend_zone\030\003 \001(\t\"^\n" + + "\023OpenSessionResponse\0226\n" + + "\007backend\030\002 \001(\0132%.google.bigtable.v2.BackendIdentifier\022\017\n" + + "\007payload\030\001 \001(\014\"\333\002\n" + + "\023CloseSessionRequest\022J\n" + + "\006reason\030\001 \001(\0162:.goog" + + "le.bigtable.v2.CloseSessionRequest.CloseSessionReason\022\023\n" + + "\013description\030\002 \001(\t\"\342\001\n" + + "\022CloseSessionReason\022\036\n" + + "\032CLOSE_SESSION_REASON_UNSET\020\000\022\037\n" + + "\033CLOSE_SESSION_REASON_GOAWAY\020\001\022\036\n" + + "\032CLOSE_SESSION_REASON_ERROR\020\002\022\035\n" + + "\031CLOSE_SESSION_REASON_USER\020\003\022!\n" + + "\035CLOSE_SESSION_REASON_DOWNSIZE\020\004\022)\n" + + "%CLOSE_SESSION_REASON_MISSED_HEARTBEAT\020\005\"\365\001\n" + + "\020OpenTableRequest\022\022\n\n" + + "table_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022C\n\n" + + "permission\030\003 \001(\0162/.google.bigtable.v2.OpenTableRequest.Permission\"h\n" + + "\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001\022\024\n" + + "\020PERMISSION_WRITE\020\002\022\031\n" + + "\025PERMISSION_READ_WRITE\020\003:\006\320\302\355\221\004\001\"\033\n" + + "\021OpenTableResponse:\006\320\302\355\221\004\001\"\221\002\n" + + "\031OpenAuthorizedViewRequest\022\034\n" + + "\024authorized_view_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022L\n\n" + + "permission\030\003" + + " \001(\01628.google.bigtable.v2.OpenAuthorizedViewRequest.Permission\"h\n\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001\022\024\n" + + "\020PERMISSION_WRITE\020\002\022\031\n" + + "\025PERMISSION_READ_WRITE\020\003:\006\320\302\355\221\004\002\"$\n" + + "\032OpenAuthorizedViewResponse:\006\320\302\355\221\004\002\"\346\001\n" + + "\033OpenMaterializedViewRequest\022\036\n" + + "\026materialized_view_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022N\n\n" + + "permission\030\003 \001" + + "(\0162:.google.bigtable.v2.OpenMaterializedViewRequest.Permission\"7\n\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001:\006\320\302\355\221\004\003\"&\n" + + "\034OpenMaterializedViewResponse:\006\320\302\355\221\004\003\"\217\002\n" + + "\021VirtualRpcRequest\022\016\n" + + "\006rpc_id\030\001 \001(\003\022+\n" + + "\010deadline\030\002 \001(\0132\031.google.protobuf.Duration\022@\n" + + "\010metadata\030\003" + + " \001(\0132..google.bigtable.v2.VirtualRpcRequest.Metadata\022\017\n" + + "\007payload\030\004 \001(\014\032j\n" + + "\010Metadata\022\026\n" + + "\016attempt_number\030\001 \001(\003\0221\n\r" + + "attempt_start\030\002 \001(\0132\032.google.protobuf.Timestamp\022\023\n" + + "\013traceparent\030\003 \001(\t\"9\n" + + "\022ClusterInformation\022\022\n\n" + + "cluster_id\030\001 \001(\t\022\017\n" + + "\007zone_id\030\002 \001(\t\"I\n" + + "\023SessionRequestStats\0222\n" + + "\017backend_latency\030\001 \001(\0132\031.google.protobuf.Duration\"\253\001\n" + + "\022VirtualRpcResponse\022\016\n" + + "\006rpc_id\030\001 \001(\003\022<\n" + + "\014cluster_info\030\002 \001(\0132&.google.bigtable.v2.ClusterInformation\0226\n" + + "\005stats\030\004 \001(\0132\'.google.bigtable.v2.SessionRequestStats\022\017\n" + + "\007payload\030\003 \001(\014\"\254\001\n\r" + + "ErrorResponse\022\016\n" + + "\006rpc_id\030\001 \001(\003\022<\n" + + "\014cluster_info\030\002 \001(\0132&.google.bigtable.v2.ClusterInformation\022\"\n" + + "\006status\030\003 \001(\0132\022.google.rpc.Status\022)\n\n" + + "retry_info\030\004 \001(\0132\025.google.rpc.RetryInfo\"\244\001\n" + + "\014TableRequest\022=\n" + + "\010read_row\030\001 \001(\0132" + + ").google.bigtable.v2.SessionReadRowRequestH\000\022A\n\n" + + "mutate_row\030\002 \001(\0132+.google.bigtab" + + "le.v2.SessionMutateRowRequestH\000:\007\252\355\355\221\004\001\001B\t\n" + + "\007payload\"\247\001\n\r" + + "TableResponse\022>\n" + + "\010read_row\030\001" + + " \001(\0132*.google.bigtable.v2.SessionReadRowResponseH\000\022B\n\n" + + "mutate_row\030\002 \001(\0132,.goog" + + "le.bigtable.v2.SessionMutateRowResponseH\000:\007\252\355\355\221\004\001\001B\t\n" + + "\007payload\"\255\001\n" + + "\025AuthorizedViewRequest\022=\n" + + "\010read_row\030\001" + + " \001(\0132).google.bigtable.v2.SessionReadRowRequestH\000\022A\n\n" + + "mutate_row\030\002" + + " \001(\0132+.google.bigtable.v2.SessionMutateRowRequestH\000:\007\252\355\355\221\004\001\002B" + + "\t\n" + + "\007payload\"\260\001\n" + + "\026AuthorizedViewResponse\022>\n" + + "\010read_row\030\001 \001" + + "(\0132*.google.bigtable.v2.SessionReadRowResponseH\000\022B\n\n" + + "mutate_row\030\002 \001(\0132,.google.bi" + + "gtable.v2.SessionMutateRowResponseH\000:\007\252\355\355\221\004\001\002B\t\n" + + "\007payload\"l\n" + + "\027MaterializedViewRequest\022=\n" + + "\010read_row\030\001" + + " \001(\0132).google.bigtable.v2.SessionReadRowRequestH\000:\007\252\355\355\221\004\001\003B" + + "\t\n" + + "\007payload\"n\n" + + "\030MaterializedViewResponse\022>\n" + + "\010read_row\030\001" + + " \001(\0132*.google.bigtable.v2.SessionReadRowResponseH\000:\007\252\355\355\221\004\001\003B" + + "\t\n" + + "\007payload\"S\n" + + "\025SessionReadRowRequest\022\013\n" + + "\003key\030\001 \001(\014\022-\n" + + "\006filter\030\002 \001(\0132\035.google.bigtable.v2.RowFilter\"o\n" + + "\026SessionReadRowResponse\022$\n" + + "\003row\030\001 \001(\0132\027.google.bigtable.v2.Row\022/\n" + + "\005stats\030\002 \001(\0132 .google.bigtable.v2.RequestStats\"W\n" + + "\027SessionMutateRowRequest\022\013\n" + + "\003key\030\001 \001(\014\022/\n" + + "\tmutations\030\002 \003(\0132\034.google.bigtable.v2.Mutation\"\032\n" + + "\030SessionMutateRowResponse\"J\n" + + "\031SessionParametersResponse\022-\n\n" + + "keep_alive\030\001 \001(\0132\031.google.protobuf.Duration\"\023\n" + + "\021HeartbeatResponse\"S\n" + + "\016GoAwayResponse\022\016\n" + + "\006reason\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\034\n" + + "\024last_rpc_id_admitted\030\003 \001(\003\"\332\001\n" + + "\024SessionRefreshConfig\022F\n" + + "\026optimized_open_request\030\001" + + " \001(\0132&.google.bigtable.v2.OpenSessionRequest\022H\n" + + "\010metadata\030\002" + + " \003(\01321.google.bigtable.v2.SessionRefreshConfig.MetadataB\003\340A\003\0320\n" + + "\010Metadata\022\020\n" + + "\003key\030\001 \001(\tB\003\340A\003\022\022\n" + + "\005value\030\002 \001(\014B\003\340A\003*\233\001\n" + + "\013SessionType\022\026\n" + + "\022SESSION_TYPE_UNSET\020\000\022\026\n" + + "\022SESSION_TYPE_TABLE\020\001\022 \n" + + "\034SESSION_TYPE_AUTHORIZED_VIEW\020\002\022\"\n" + + "\036SESSION_TYPE_MATERIALIZED_VIEW\020\003\022\026\n" + + "\021SESSION_TYPE_TEST\020\217N:^\n" + + "\021open_session_type\022\037.google.protobuf.MessageOptions\030\252\330\235B" + + " \001(\0162\037.google.bigtable.v2.SessionType:^\n" + + "\021vrpc_session_type\022\037.google.protobuf.MessageOptions\030\325\335\235B" + + " \003(\0162\037.google.bigtable.v2.SessionType:\\\n" + + "\020rpc_session_type\022\036.google.protobuf.MethodOptions\030\204\332\344A" + + " \001(\0162\037.google.bigtable.v2.SessionTypeB\266\001\n" + + "\026com.google.bigtable.v2B\014SessionProtoP\001Z8cloud.google.com/go/bigtable/apiv2/" + + "bigtablepb;bigtablepb\252\002\030Google.Cloud.Big" + + "table.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Go" + + "ogle::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.bigtable.v2.DataProto.getDescriptor(), + com.google.bigtable.v2.FeatureFlagsProto.getDescriptor(), + com.google.bigtable.v2.RequestStatsProto.getDescriptor(), + com.google.protobuf.DescriptorProtos.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor, + new java.lang.String[] { + "InstanceName", "AppProfileId", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor, + new java.lang.String[] { + "LeastInFlight", "PeakEwma", "Random", "LoadBalancingStrategy", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor, + new java.lang.String[] { + "RandomSubsetSize", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor, + new java.lang.String[] { + "RandomSubsetSize", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor, + new java.lang.String[] { + "SessionLoad", + "LoadBalancingOptions", + "ChannelConfiguration", + "SessionPoolConfiguration", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor, + new java.lang.String[] { + "MinServerCount", + "MaxServerCount", + "PerServerSessionCount", + "DirectAccessWithFallback", + "DirectAccessOnly", + "CloudPathOnly", + "Mode", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(0); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor, + new java.lang.String[] { + "ErrorRateThreshold", "CheckInterval", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(1); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(2); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor, + new java.lang.String[] { + "Headroom", + "MinSessionCount", + "MaxSessionCount", + "NewSessionQueueLength", + "NewSessionCreationBudget", + "NewSessionCreationPenalty", + "ConsecutiveSessionFailureThreshold", + "LoadBalancingOptions", + }); + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor, + new java.lang.String[] { + "DebugTagLevel", + }); + internal_static_google_bigtable_v2_ClientConfiguration_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClientConfiguration_descriptor, + new java.lang.String[] { + "SessionConfiguration", + "StopPolling", + "PollingInterval", + "PollingConfiguration", + "TelemetryConfiguration", + "Polling", + }); + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor = + internal_static_google_bigtable_v2_ClientConfiguration_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor, + new java.lang.String[] { + "PollingInterval", "ValidityDuration", "MaxRpcRetryCount", + }); + internal_static_google_bigtable_v2_SessionRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRequest_descriptor, + new java.lang.String[] { + "OpenSession", "CloseSession", "VirtualRpc", "Payload", + }); + internal_static_google_bigtable_v2_SessionResponse_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionResponse_descriptor, + new java.lang.String[] { + "OpenSession", + "VirtualRpc", + "Error", + "SessionParameters", + "Heartbeat", + "GoAway", + "SessionRefreshConfig", + "Payload", + }); + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor, + new java.lang.String[] { + "ProtocolVersion", + "Flags", + "ConsecutiveFailedConnectionAttempts", + "RoutingCookie", + "Payload", + }); + internal_static_google_bigtable_v2_BackendIdentifier_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_BackendIdentifier_descriptor, + new java.lang.String[] { + "GoogleFrontendId", "ApplicationFrontendId", "ApplicationFrontendZone", + }); + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor, + new java.lang.String[] { + "Backend", "Payload", + }); + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor, + new java.lang.String[] { + "Reason", "Description", + }); + internal_static_google_bigtable_v2_OpenTableRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenTableRequest_descriptor, + new java.lang.String[] { + "TableName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenTableResponse_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenTableResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor, + new java.lang.String[] { + "AuthorizedViewName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor, + new java.lang.String[] { + "MaterializedViewName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor, + new java.lang.String[] { + "RpcId", "Deadline", "Metadata", "Payload", + }); + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor = + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor, + new java.lang.String[] { + "AttemptNumber", "AttemptStart", "Traceparent", + }); + internal_static_google_bigtable_v2_ClusterInformation_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClusterInformation_descriptor, + new java.lang.String[] { + "ClusterId", "ZoneId", + }); + internal_static_google_bigtable_v2_SessionRequestStats_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRequestStats_descriptor, + new java.lang.String[] { + "BackendLatency", + }); + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor, + new java.lang.String[] { + "RpcId", "ClusterInfo", "Stats", "Payload", + }); + internal_static_google_bigtable_v2_ErrorResponse_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ErrorResponse_descriptor, + new java.lang.String[] { + "RpcId", "ClusterInfo", "Status", "RetryInfo", + }); + internal_static_google_bigtable_v2_TableRequest_descriptor = getDescriptor().getMessageType(22); + internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TableRequest_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_TableResponse_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TableResponse_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor, + new java.lang.String[] { + "ReadRow", "Payload", + }); + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor = + getDescriptor().getMessageType(27); + internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor, + new java.lang.String[] { + "ReadRow", "Payload", + }); + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor = + getDescriptor().getMessageType(28); + internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor, + new java.lang.String[] { + "Key", "Filter", + }); + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor, + new java.lang.String[] { + "Row", "Stats", + }); + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor = + getDescriptor().getMessageType(30); + internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor, + new java.lang.String[] { + "Key", "Mutations", + }); + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor, + new java.lang.String[] { + "KeepAlive", + }); + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_GoAwayResponse_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GoAwayResponse_descriptor, + new java.lang.String[] { + "Reason", "Description", "LastRpcIdAdmitted", + }); + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor, + new java.lang.String[] { + "OptimizedOpenRequest", "Metadata", + }); + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor = + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + openSessionType.internalInit(descriptor.getExtension(0)); + vrpcSessionType.internalInit(descriptor.getExtension(1)); + rpcSessionType.internalInit(descriptor.getExtension(2)); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.bigtable.v2.DataProto.getDescriptor(); + com.google.bigtable.v2.FeatureFlagsProto.getDescriptor(); + com.google.bigtable.v2.RequestStatsProto.getDescriptor(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.bigtable.v2.SessionProto.openSessionType); + registry.add(com.google.bigtable.v2.SessionProto.vrpcSessionType); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java new file mode 100644 index 000000000000..1d9d877fc829 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java @@ -0,0 +1,677 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowRequest} + */ +@com.google.protobuf.Generated +public final class SessionReadRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionReadRowRequest) + SessionReadRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionReadRowRequest"); + } + + // Use SessionReadRowRequest.newBuilder() to construct. + private SessionReadRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionReadRowRequest() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowRequest.class, + com.google.bigtable.v2.SessionReadRowRequest.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int FILTER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RowFilter filter_; + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + @java.lang.Override + public boolean hasFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFilter() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + 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 (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFilter()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFilter()); + } + size += getUnknownFields().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.SessionReadRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionReadRowRequest other = + (com.google.bigtable.v2.SessionReadRowRequest) obj; + + if (!getKey().equals(other.getKey())) return false; + if (hasFilter() != other.hasFilter()) return false; + if (hasFilter()) { + if (!getFilter().equals(other.getFilter())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest 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.SessionReadRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest 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.SessionReadRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionReadRowRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionReadRowRequest) + com.google.bigtable.v2.SessionReadRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowRequest.class, + com.google.bigtable.v2.SessionReadRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionReadRowRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFilterFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest build() { + com.google.bigtable.v2.SessionReadRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest buildPartial() { + com.google.bigtable.v2.SessionReadRowRequest result = + new com.google.bigtable.v2.SessionReadRowRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionReadRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filterBuilder_ == null ? filter_ : filterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionReadRowRequest) { + return mergeFrom((com.google.bigtable.v2.SessionReadRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionReadRowRequest other) { + if (other == com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + if (other.hasFilter()) { + mergeFilter(other.getFilter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private com.google.bigtable.v2.RowFilter filter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + filterBuilder_; + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + public com.google.bigtable.v2.RowFilter getFilter() { + if (filterBuilder_ == null) { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } else { + return filterBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder setFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + } else { + filterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder setFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filterBuilder_ == null) { + filter_ = builderForValue.build(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder mergeFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && filter_ != null + && filter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); + } else { + filter_ = value; + } + } else { + filterBuilder_.mergeFrom(value); + } + if (filter_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public com.google.bigtable.v2.RowFilter.Builder getFilterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFilterFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + if (filterBuilder_ != null) { + return filterBuilder_.getMessageOrBuilder(); + } else { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFilterFieldBuilder() { + if (filterBuilder_ == null) { + filterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getFilter(), getParentForChildren(), isClean()); + filter_ = null; + } + return filterBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionReadRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionReadRowRequest) + private static final com.google.bigtable.v2.SessionReadRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionReadRowRequest(); + } + + public static com.google.bigtable.v2.SessionReadRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionReadRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionReadRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java new file mode 100644 index 000000000000..a540f77d715b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionReadRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionReadRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + boolean hasFilter(); + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + com.google.bigtable.v2.RowFilter getFilter(); + + /** .google.bigtable.v2.RowFilter filter = 2; */ + com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java new file mode 100644 index 000000000000..3c2570fec454 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java @@ -0,0 +1,783 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowResponse} + */ +@com.google.protobuf.Generated +public final class SessionReadRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionReadRowResponse) + SessionReadRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionReadRowResponse"); + } + + // Use SessionReadRowResponse.newBuilder() to construct. + private SessionReadRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionReadRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowResponse.class, + com.google.bigtable.v2.SessionReadRowResponse.Builder.class); + } + + private int bitField0_; + public static final int ROW_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Row row_; + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + @java.lang.Override + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + @java.lang.Override + public com.google.bigtable.v2.Row getRow() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + /** .google.bigtable.v2.Row row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + public static final int STATS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RequestStats stats_; + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + @java.lang.Override + public com.google.bigtable.v2.RequestStats getStats() { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + @java.lang.Override + public com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRow()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRow()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStats()); + } + size += getUnknownFields().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.SessionReadRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionReadRowResponse other = + (com.google.bigtable.v2.SessionReadRowResponse) obj; + + if (hasRow() != other.hasRow()) return false; + if (hasRow()) { + if (!getRow().equals(other.getRow())) return false; + } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRow()) { + hash = (37 * hash) + ROW_FIELD_NUMBER; + hash = (53 * hash) + getRow().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse 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.SessionReadRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse 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.SessionReadRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionReadRowResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionReadRowResponse) + com.google.bigtable.v2.SessionReadRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowResponse.class, + com.google.bigtable.v2.SessionReadRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionReadRowResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowFieldBuilder(); + internalGetStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse build() { + com.google.bigtable.v2.SessionReadRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse buildPartial() { + com.google.bigtable.v2.SessionReadRowResponse result = + new com.google.bigtable.v2.SessionReadRowResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionReadRowResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.row_ = rowBuilder_ == null ? row_ : rowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionReadRowResponse) { + return mergeFrom((com.google.bigtable.v2.SessionReadRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionReadRowResponse other) { + if (other == com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) return this; + if (other.hasRow()) { + mergeRow(other.getRow()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetRowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Row row_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + rowBuilder_; + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + public com.google.bigtable.v2.Row getRow() { + if (rowBuilder_ == null) { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } else { + return rowBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder setRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + row_ = value; + } else { + rowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder setRow(com.google.bigtable.v2.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + row_ = builderForValue.build(); + } else { + rowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder mergeRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && row_ != null + && row_ != com.google.bigtable.v2.Row.getDefaultInstance()) { + getRowBuilder().mergeFrom(value); + } else { + row_ = value; + } + } else { + rowBuilder_.mergeFrom(value); + } + if (row_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder clearRow() { + bitField0_ = (bitField0_ & ~0x00000001); + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public com.google.bigtable.v2.Row.Builder getRowBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.Row row = 1; */ + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + if (rowBuilder_ != null) { + return rowBuilder_.getMessageOrBuilder(); + } else { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + } + + /** .google.bigtable.v2.Row row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + internalGetRowFieldBuilder() { + if (rowBuilder_ == null) { + rowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder>(getRow(), getParentForChildren(), isClean()); + row_ = null; + } + return rowBuilder_; + } + + private com.google.bigtable.v2.RequestStats stats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + statsBuilder_; + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + public com.google.bigtable.v2.RequestStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder setStats(com.google.bigtable.v2.RequestStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder setStats(com.google.bigtable.v2.RequestStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder mergeStats(com.google.bigtable.v2.RequestStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stats_ != null + && stats_ != com.google.bigtable.v2.RequestStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000002); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public com.google.bigtable.v2.RequestStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStatsFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + internalGetStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionReadRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionReadRowResponse) + private static final com.google.bigtable.v2.SessionReadRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionReadRowResponse(); + } + + public static com.google.bigtable.v2.SessionReadRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionReadRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionReadRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java new file mode 100644 index 000000000000..b0ca2bf894eb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionReadRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionReadRowResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + boolean hasRow(); + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + com.google.bigtable.v2.Row getRow(); + + /** .google.bigtable.v2.Row row = 1; */ + com.google.bigtable.v2.RowOrBuilder getRowOrBuilder(); + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + com.google.bigtable.v2.RequestStats getStats(); + + /** .google.bigtable.v2.RequestStats stats = 2; */ + com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java new file mode 100644 index 000000000000..1cf129d259d1 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java @@ -0,0 +1,2023 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig} + */ +@com.google.protobuf.Generated +public final class SessionRefreshConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRefreshConfig) + SessionRefreshConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRefreshConfig"); + } + + // Use SessionRefreshConfig.newBuilder() to construct. + private SessionRefreshConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRefreshConfig() { + metadata_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.class, + com.google.bigtable.v2.SessionRefreshConfig.Builder.class); + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRefreshConfig.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + java.lang.String getKey(); + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * Output only. The value for the metadata entry.
+     * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + } + + /** + * + * + *
+   * Any additional metadata to include when reconnecting. Not a `map<>` type as
+   * this can be a multimap.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRefreshConfig.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() { + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.class, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Output only. The value for the metadata entry.
+     * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + 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.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); + } + if (!value_.isEmpty()) { + output.writeBytes(2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, value_); + } + size += getUnknownFields().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.SessionRefreshConfig.Metadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRefreshConfig.Metadata other = + (com.google.bigtable.v2.SessionRefreshConfig.Metadata) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata 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.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata 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.SessionRefreshConfig.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionRefreshConfig.Metadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Any additional metadata to include when reconnecting. Not a `map<>` type as
+     * this can be a multimap.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRefreshConfig.Metadata) + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.class, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRefreshConfig.Metadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata build() { + com.google.bigtable.v2.SessionRefreshConfig.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata buildPartial() { + com.google.bigtable.v2.SessionRefreshConfig.Metadata result = + new com.google.bigtable.v2.SessionRefreshConfig.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRefreshConfig.Metadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRefreshConfig.Metadata) { + return mergeFrom((com.google.bigtable.v2.SessionRefreshConfig.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRefreshConfig.Metadata other) { + if (other == com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRefreshConfig.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRefreshConfig.Metadata) + private static final com.google.bigtable.v2.SessionRefreshConfig.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRefreshConfig.Metadata(); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionRefreshConfig.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int OPTIMIZED_OPEN_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.v2.OpenSessionRequest optimizedOpenRequest_; + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + @java.lang.Override + public boolean hasOptimizedOpenRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest() { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder() { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + + public static final int METADATA_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List metadata_; + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getMetadataList() { + return metadata_; + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMetadataOrBuilderList() { + return metadata_; + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMetadataCount() { + return metadata_.size(); + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index) { + return metadata_.get(index); + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder( + int index) { + return metadata_.get(index); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOptimizedOpenRequest()); + } + for (int i = 0; i < metadata_.size(); i++) { + output.writeMessage(2, metadata_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOptimizedOpenRequest()); + } + for (int i = 0; i < metadata_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata_.get(i)); + } + size += getUnknownFields().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.SessionRefreshConfig)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRefreshConfig other = + (com.google.bigtable.v2.SessionRefreshConfig) obj; + + if (hasOptimizedOpenRequest() != other.hasOptimizedOpenRequest()) return false; + if (hasOptimizedOpenRequest()) { + if (!getOptimizedOpenRequest().equals(other.getOptimizedOpenRequest())) return false; + } + if (!getMetadataList().equals(other.getMetadataList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOptimizedOpenRequest()) { + hash = (37 * hash) + OPTIMIZED_OPEN_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOptimizedOpenRequest().hashCode(); + } + if (getMetadataCount() > 0) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig 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.SessionRefreshConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig 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.SessionRefreshConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionRefreshConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRefreshConfig) + com.google.bigtable.v2.SessionRefreshConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.class, + com.google.bigtable.v2.SessionRefreshConfig.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRefreshConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOptimizedOpenRequestFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optimizedOpenRequest_ = null; + if (optimizedOpenRequestBuilder_ != null) { + optimizedOpenRequestBuilder_.dispose(); + optimizedOpenRequestBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + } else { + metadata_ = null; + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig build() { + com.google.bigtable.v2.SessionRefreshConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig buildPartial() { + com.google.bigtable.v2.SessionRefreshConfig result = + new com.google.bigtable.v2.SessionRefreshConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.SessionRefreshConfig result) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + metadata_ = java.util.Collections.unmodifiableList(metadata_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.SessionRefreshConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.optimizedOpenRequest_ = + optimizedOpenRequestBuilder_ == null + ? optimizedOpenRequest_ + : optimizedOpenRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRefreshConfig) { + return mergeFrom((com.google.bigtable.v2.SessionRefreshConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRefreshConfig other) { + if (other == com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance()) return this; + if (other.hasOptimizedOpenRequest()) { + mergeOptimizedOpenRequest(other.getOptimizedOpenRequest()); + } + if (metadataBuilder_ == null) { + if (!other.metadata_.isEmpty()) { + if (metadata_.isEmpty()) { + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMetadataIsMutable(); + metadata_.addAll(other.metadata_); + } + onChanged(); + } + } else { + if (!other.metadata_.isEmpty()) { + if (metadataBuilder_.isEmpty()) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + metadataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMetadataFieldBuilder() + : null; + } else { + metadataBuilder_.addAllMessages(other.metadata_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOptimizedOpenRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.SessionRefreshConfig.Metadata m = + input.readMessage( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.parser(), + extensionRegistry); + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(m); + } else { + metadataBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.OpenSessionRequest optimizedOpenRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + optimizedOpenRequestBuilder_; + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + public boolean hasOptimizedOpenRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + public com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest() { + if (optimizedOpenRequestBuilder_ == null) { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } else { + return optimizedOpenRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder setOptimizedOpenRequest(com.google.bigtable.v2.OpenSessionRequest value) { + if (optimizedOpenRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + optimizedOpenRequest_ = value; + } else { + optimizedOpenRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder setOptimizedOpenRequest( + com.google.bigtable.v2.OpenSessionRequest.Builder builderForValue) { + if (optimizedOpenRequestBuilder_ == null) { + optimizedOpenRequest_ = builderForValue.build(); + } else { + optimizedOpenRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder mergeOptimizedOpenRequest(com.google.bigtable.v2.OpenSessionRequest value) { + if (optimizedOpenRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && optimizedOpenRequest_ != null + && optimizedOpenRequest_ + != com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) { + getOptimizedOpenRequestBuilder().mergeFrom(value); + } else { + optimizedOpenRequest_ = value; + } + } else { + optimizedOpenRequestBuilder_.mergeFrom(value); + } + if (optimizedOpenRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder clearOptimizedOpenRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + optimizedOpenRequest_ = null; + if (optimizedOpenRequestBuilder_ != null) { + optimizedOpenRequestBuilder_.dispose(); + optimizedOpenRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public com.google.bigtable.v2.OpenSessionRequest.Builder getOptimizedOpenRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOptimizedOpenRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder() { + if (optimizedOpenRequestBuilder_ != null) { + return optimizedOpenRequestBuilder_.getMessageOrBuilder(); + } else { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + internalGetOptimizedOpenRequestFieldBuilder() { + if (optimizedOpenRequestBuilder_ == null) { + optimizedOpenRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder>( + getOptimizedOpenRequest(), getParentForChildren(), isClean()); + optimizedOpenRequest_ = null; + } + return optimizedOpenRequestBuilder_; + } + + private java.util.List metadata_ = + java.util.Collections.emptyList(); + + private void ensureMetadataIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + metadata_ = + new java.util.ArrayList( + metadata_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getMetadataList() { + if (metadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(metadata_); + } else { + return metadataBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMetadataCount() { + if (metadataBuilder_ == null) { + return metadata_.size(); + } else { + return metadataBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.set(index, value); + onChanged(); + } else { + metadataBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.set(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata(com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(value); + onChanged(); + } else { + metadataBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(index, value); + onChanged(); + } else { + metadataBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMetadata( + java.lang.Iterable values) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadata_); + onChanged(); + } else { + metadataBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + metadataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMetadata(int index) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.remove(index); + onChanged(); + } else { + metadataBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder getMetadataBuilder( + int index) { + return internalGetMetadataFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder( + int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMetadataOrBuilderList() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metadata_); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder addMetadataBuilder() { + return internalGetMetadataFieldBuilder() + .addBuilder(com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder addMetadataBuilder( + int index) { + return internalGetMetadataFieldBuilder() + .addBuilder( + index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMetadataBuilderList() { + return internalGetMetadataFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder>( + metadata_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRefreshConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRefreshConfig) + private static final com.google.bigtable.v2.SessionRefreshConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRefreshConfig(); + } + + public static com.google.bigtable.v2.SessionRefreshConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRefreshConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionRefreshConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java new file mode 100644 index 000000000000..52d3a5f80368 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRefreshConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRefreshConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + boolean hasOptimizedOpenRequest(); + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest(); + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMetadataList(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMetadataCount(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMetadataOrBuilderList(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java new file mode 100644 index 000000000000..1c625a325cae --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java @@ -0,0 +1,1143 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequest} + */ +@com.google.protobuf.Generated +public final class SessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRequest) + SessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRequest"); + } + + // Use SessionRequest.newBuilder() to construct. + private SessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequest.class, + com.google.bigtable.v2.SessionRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPEN_SESSION(1), + CLOSE_SESSION(2), + VIRTUAL_RPC(3), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return OPEN_SESSION; + case 2: + return CLOSE_SESSION; + case 3: + return VIRTUAL_RPC; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int OPEN_SESSION_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOpenSession() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + public static final int CLOSE_SESSION_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + @java.lang.Override + public boolean hasCloseSession() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getCloseSession() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + public static final int VIRTUAL_RPC_FIELD_NUMBER = 3; + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.OpenSessionRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.CloseSessionRequest) payload_); + } + if (payloadCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.VirtualRpcRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.OpenSessionRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.CloseSessionRequest) payload_); + } + if (payloadCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.VirtualRpcRequest) payload_); + } + size += getUnknownFields().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.SessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRequest other = (com.google.bigtable.v2.SessionRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getOpenSession().equals(other.getOpenSession())) return false; + break; + case 2: + if (!getCloseSession().equals(other.getCloseSession())) return false; + break; + case 3: + if (!getVirtualRpc().equals(other.getVirtualRpc())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + OPEN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getOpenSession().hashCode(); + break; + case 2: + hash = (37 * hash) + CLOSE_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getCloseSession().hashCode(); + break; + case 3: + hash = (37 * hash) + VIRTUAL_RPC_FIELD_NUMBER; + hash = (53 * hash) + getVirtualRpc().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest 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.SessionRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest 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.SessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRequest) + com.google.bigtable.v2.SessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequest.class, + com.google.bigtable.v2.SessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (openSessionBuilder_ != null) { + openSessionBuilder_.clear(); + } + if (closeSessionBuilder_ != null) { + closeSessionBuilder_.clear(); + } + if (virtualRpcBuilder_ != null) { + virtualRpcBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest build() { + com.google.bigtable.v2.SessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest buildPartial() { + com.google.bigtable.v2.SessionRequest result = + new com.google.bigtable.v2.SessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.SessionRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && openSessionBuilder_ != null) { + result.payload_ = openSessionBuilder_.build(); + } + if (payloadCase_ == 2 && closeSessionBuilder_ != null) { + result.payload_ = closeSessionBuilder_.build(); + } + if (payloadCase_ == 3 && virtualRpcBuilder_ != null) { + result.payload_ = virtualRpcBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRequest) { + return mergeFrom((com.google.bigtable.v2.SessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRequest other) { + if (other == com.google.bigtable.v2.SessionRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case OPEN_SESSION: + { + mergeOpenSession(other.getOpenSession()); + break; + } + case CLOSE_SESSION: + { + mergeCloseSession(other.getCloseSession()); + break; + } + case VIRTUAL_RPC: + { + mergeVirtualRpc(other.getVirtualRpc()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOpenSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetCloseSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetVirtualRpcFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + openSessionBuilder_; + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return openSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder setOpenSession(com.google.bigtable.v2.OpenSessionRequest value) { + if (openSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + openSessionBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder setOpenSession( + com.google.bigtable.v2.OpenSessionRequest.Builder builderForValue) { + if (openSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + openSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder mergeOpenSession(com.google.bigtable.v2.OpenSessionRequest value) { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.OpenSessionRequest.newBuilder( + (com.google.bigtable.v2.OpenSessionRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + openSessionBuilder_.mergeFrom(value); + } else { + openSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder clearOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + openSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public com.google.bigtable.v2.OpenSessionRequest.Builder getOpenSessionBuilder() { + return internalGetOpenSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder() { + if ((payloadCase_ == 1) && (openSessionBuilder_ != null)) { + return openSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + internalGetOpenSessionFieldBuilder() { + if (openSessionBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + openSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder>( + (com.google.bigtable.v2.OpenSessionRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return openSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder> + closeSessionBuilder_; + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + @java.lang.Override + public boolean hasCloseSession() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getCloseSession() { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return closeSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder setCloseSession(com.google.bigtable.v2.CloseSessionRequest value) { + if (closeSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + closeSessionBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder setCloseSession( + com.google.bigtable.v2.CloseSessionRequest.Builder builderForValue) { + if (closeSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + closeSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder mergeCloseSession(com.google.bigtable.v2.CloseSessionRequest value) { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.CloseSessionRequest.newBuilder( + (com.google.bigtable.v2.CloseSessionRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + closeSessionBuilder_.mergeFrom(value); + } else { + closeSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder clearCloseSession() { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + closeSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public com.google.bigtable.v2.CloseSessionRequest.Builder getCloseSessionBuilder() { + return internalGetCloseSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder() { + if ((payloadCase_ == 2) && (closeSessionBuilder_ != null)) { + return closeSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder> + internalGetCloseSessionFieldBuilder() { + if (closeSessionBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + closeSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder>( + (com.google.bigtable.v2.CloseSessionRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return closeSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder> + virtualRpcBuilder_; + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 3) { + return virtualRpcBuilder_.getMessage(); + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest value) { + if (virtualRpcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + virtualRpcBuilder_.setMessage(value); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest.Builder builderForValue) { + if (virtualRpcBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + virtualRpcBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder mergeVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest value) { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3 + && payload_ != com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.VirtualRpcRequest.newBuilder( + (com.google.bigtable.v2.VirtualRpcRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 3) { + virtualRpcBuilder_.mergeFrom(value); + } else { + virtualRpcBuilder_.setMessage(value); + } + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder clearVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + } + virtualRpcBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public com.google.bigtable.v2.VirtualRpcRequest.Builder getVirtualRpcBuilder() { + return internalGetVirtualRpcFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder() { + if ((payloadCase_ == 3) && (virtualRpcBuilder_ != null)) { + return virtualRpcBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder> + internalGetVirtualRpcFieldBuilder() { + if (virtualRpcBuilder_ == null) { + if (!(payloadCase_ == 3)) { + payload_ = com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + virtualRpcBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder>( + (com.google.bigtable.v2.VirtualRpcRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 3; + onChanged(); + return virtualRpcBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRequest) + private static final com.google.bigtable.v2.SessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRequest(); + } + + public static com.google.bigtable.v2.SessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java new file mode 100644 index 000000000000..ed05d333fba7 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + boolean hasOpenSession(); + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + com.google.bigtable.v2.OpenSessionRequest getOpenSession(); + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder(); + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + boolean hasCloseSession(); + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + com.google.bigtable.v2.CloseSessionRequest getCloseSession(); + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder(); + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + boolean hasVirtualRpc(); + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc(); + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder(); + + com.google.bigtable.v2.SessionRequest.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java new file mode 100644 index 000000000000..7c0c962d5e0a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java @@ -0,0 +1,698 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequestStats} + */ +@com.google.protobuf.Generated +public final class SessionRequestStats extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRequestStats) + SessionRequestStatsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRequestStats"); + } + + // Use SessionRequestStats.newBuilder() to construct. + private SessionRequestStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRequestStats() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequestStats.class, + com.google.bigtable.v2.SessionRequestStats.Builder.class); + } + + private int bitField0_; + public static final int BACKEND_LATENCY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration backendLatency_; + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + @java.lang.Override + public boolean hasBackendLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + @java.lang.Override + public com.google.protobuf.Duration getBackendLatency() { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBackendLatency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackendLatency()); + } + size += getUnknownFields().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.SessionRequestStats)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRequestStats other = + (com.google.bigtable.v2.SessionRequestStats) obj; + + if (hasBackendLatency() != other.hasBackendLatency()) return false; + if (hasBackendLatency()) { + if (!getBackendLatency().equals(other.getBackendLatency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackendLatency()) { + hash = (37 * hash) + BACKEND_LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getBackendLatency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats 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.SessionRequestStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats 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.SessionRequestStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionRequestStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequestStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRequestStats) + com.google.bigtable.v2.SessionRequestStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequestStats.class, + com.google.bigtable.v2.SessionRequestStats.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRequestStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackendLatencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backendLatency_ = null; + if (backendLatencyBuilder_ != null) { + backendLatencyBuilder_.dispose(); + backendLatencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRequestStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats build() { + com.google.bigtable.v2.SessionRequestStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats buildPartial() { + com.google.bigtable.v2.SessionRequestStats result = + new com.google.bigtable.v2.SessionRequestStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRequestStats result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backendLatency_ = + backendLatencyBuilder_ == null ? backendLatency_ : backendLatencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRequestStats) { + return mergeFrom((com.google.bigtable.v2.SessionRequestStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRequestStats other) { + if (other == com.google.bigtable.v2.SessionRequestStats.getDefaultInstance()) return this; + if (other.hasBackendLatency()) { + mergeBackendLatency(other.getBackendLatency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBackendLatencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration backendLatency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + backendLatencyBuilder_; + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + public boolean hasBackendLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + public com.google.protobuf.Duration getBackendLatency() { + if (backendLatencyBuilder_ == null) { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } else { + return backendLatencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder setBackendLatency(com.google.protobuf.Duration value) { + if (backendLatencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backendLatency_ = value; + } else { + backendLatencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder setBackendLatency(com.google.protobuf.Duration.Builder builderForValue) { + if (backendLatencyBuilder_ == null) { + backendLatency_ = builderForValue.build(); + } else { + backendLatencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder mergeBackendLatency(com.google.protobuf.Duration value) { + if (backendLatencyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backendLatency_ != null + && backendLatency_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBackendLatencyBuilder().mergeFrom(value); + } else { + backendLatency_ = value; + } + } else { + backendLatencyBuilder_.mergeFrom(value); + } + if (backendLatency_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder clearBackendLatency() { + bitField0_ = (bitField0_ & ~0x00000001); + backendLatency_ = null; + if (backendLatencyBuilder_ != null) { + backendLatencyBuilder_.dispose(); + backendLatencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public com.google.protobuf.Duration.Builder getBackendLatencyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackendLatencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() { + if (backendLatencyBuilder_ != null) { + return backendLatencyBuilder_.getMessageOrBuilder(); + } else { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetBackendLatencyFieldBuilder() { + if (backendLatencyBuilder_ == null) { + backendLatencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBackendLatency(), getParentForChildren(), isClean()); + backendLatency_ = null; + } + return backendLatencyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRequestStats) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRequestStats) + private static final com.google.bigtable.v2.SessionRequestStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRequestStats(); + } + + public static com.google.bigtable.v2.SessionRequestStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRequestStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionRequestStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java new file mode 100644 index 000000000000..728993cf71ee --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRequestStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRequestStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + boolean hasBackendLatency(); + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + com.google.protobuf.Duration getBackendLatency(); + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java new file mode 100644 index 000000000000..9c4dfe078f60 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java @@ -0,0 +1,2131 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionResponse} + */ +@com.google.protobuf.Generated +public final class SessionResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionResponse) + SessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionResponse"); + } + + // Use SessionResponse.newBuilder() to construct. + private SessionResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionResponse.class, + com.google.bigtable.v2.SessionResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPEN_SESSION(1), + VIRTUAL_RPC(2), + ERROR(3), + SESSION_PARAMETERS(4), + HEARTBEAT(5), + GO_AWAY(6), + SESSION_REFRESH_CONFIG(7), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return OPEN_SESSION; + case 2: + return VIRTUAL_RPC; + case 3: + return ERROR; + case 4: + return SESSION_PARAMETERS; + case 5: + return HEARTBEAT; + case 6: + return GO_AWAY; + case 7: + return SESSION_REFRESH_CONFIG; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int OPEN_SESSION_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getOpenSession() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + public static final int VIRTUAL_RPC_FIELD_NUMBER = 2; + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 2; + } + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 3; + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getError() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + public static final int SESSION_PARAMETERS_FIELD_NUMBER = 4; + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + @java.lang.Override + public boolean hasSessionParameters() { + return payloadCase_ == 4; + } + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getSessionParameters() { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponseOrBuilder getSessionParametersOrBuilder() { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + public static final int HEARTBEAT_FIELD_NUMBER = 5; + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return payloadCase_ == 5; + } + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getHeartbeat() { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder() { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + public static final int GO_AWAY_FIELD_NUMBER = 6; + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + @java.lang.Override + public boolean hasGoAway() { + return payloadCase_ == 6; + } + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getGoAway() { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder() { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + public static final int SESSION_REFRESH_CONFIG_FIELD_NUMBER = 7; + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + @java.lang.Override + public boolean hasSessionRefreshConfig() { + return payloadCase_ == 7; + } + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig() { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder() { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.OpenSessionResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.VirtualRpcResponse) payload_); + } + if (payloadCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.ErrorResponse) payload_); + } + if (payloadCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.SessionParametersResponse) payload_); + } + if (payloadCase_ == 5) { + output.writeMessage(5, (com.google.bigtable.v2.HeartbeatResponse) payload_); + } + if (payloadCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.GoAwayResponse) payload_); + } + if (payloadCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.v2.SessionRefreshConfig) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.OpenSessionResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.VirtualRpcResponse) payload_); + } + if (payloadCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.ErrorResponse) payload_); + } + if (payloadCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.SessionParametersResponse) payload_); + } + if (payloadCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.HeartbeatResponse) payload_); + } + if (payloadCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.GoAwayResponse) payload_); + } + if (payloadCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.v2.SessionRefreshConfig) payload_); + } + size += getUnknownFields().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.SessionResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionResponse other = (com.google.bigtable.v2.SessionResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getOpenSession().equals(other.getOpenSession())) return false; + break; + case 2: + if (!getVirtualRpc().equals(other.getVirtualRpc())) return false; + break; + case 3: + if (!getError().equals(other.getError())) return false; + break; + case 4: + if (!getSessionParameters().equals(other.getSessionParameters())) return false; + break; + case 5: + if (!getHeartbeat().equals(other.getHeartbeat())) return false; + break; + case 6: + if (!getGoAway().equals(other.getGoAway())) return false; + break; + case 7: + if (!getSessionRefreshConfig().equals(other.getSessionRefreshConfig())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + OPEN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getOpenSession().hashCode(); + break; + case 2: + hash = (37 * hash) + VIRTUAL_RPC_FIELD_NUMBER; + hash = (53 * hash) + getVirtualRpc().hashCode(); + break; + case 3: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 4: + hash = (37 * hash) + SESSION_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getSessionParameters().hashCode(); + break; + case 5: + hash = (37 * hash) + HEARTBEAT_FIELD_NUMBER; + hash = (53 * hash) + getHeartbeat().hashCode(); + break; + case 6: + hash = (37 * hash) + GO_AWAY_FIELD_NUMBER; + hash = (53 * hash) + getGoAway().hashCode(); + break; + case 7: + hash = (37 * hash) + SESSION_REFRESH_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSessionRefreshConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse 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.SessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse 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.SessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.SessionResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionResponse) + com.google.bigtable.v2.SessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionResponse.class, + com.google.bigtable.v2.SessionResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (openSessionBuilder_ != null) { + openSessionBuilder_.clear(); + } + if (virtualRpcBuilder_ != null) { + virtualRpcBuilder_.clear(); + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (sessionParametersBuilder_ != null) { + sessionParametersBuilder_.clear(); + } + if (heartbeatBuilder_ != null) { + heartbeatBuilder_.clear(); + } + if (goAwayBuilder_ != null) { + goAwayBuilder_.clear(); + } + if (sessionRefreshConfigBuilder_ != null) { + sessionRefreshConfigBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse build() { + com.google.bigtable.v2.SessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse buildPartial() { + com.google.bigtable.v2.SessionResponse result = + new com.google.bigtable.v2.SessionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.SessionResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && openSessionBuilder_ != null) { + result.payload_ = openSessionBuilder_.build(); + } + if (payloadCase_ == 2 && virtualRpcBuilder_ != null) { + result.payload_ = virtualRpcBuilder_.build(); + } + if (payloadCase_ == 3 && errorBuilder_ != null) { + result.payload_ = errorBuilder_.build(); + } + if (payloadCase_ == 4 && sessionParametersBuilder_ != null) { + result.payload_ = sessionParametersBuilder_.build(); + } + if (payloadCase_ == 5 && heartbeatBuilder_ != null) { + result.payload_ = heartbeatBuilder_.build(); + } + if (payloadCase_ == 6 && goAwayBuilder_ != null) { + result.payload_ = goAwayBuilder_.build(); + } + if (payloadCase_ == 7 && sessionRefreshConfigBuilder_ != null) { + result.payload_ = sessionRefreshConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionResponse) { + return mergeFrom((com.google.bigtable.v2.SessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionResponse other) { + if (other == com.google.bigtable.v2.SessionResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case OPEN_SESSION: + { + mergeOpenSession(other.getOpenSession()); + break; + } + case VIRTUAL_RPC: + { + mergeVirtualRpc(other.getVirtualRpc()); + break; + } + case ERROR: + { + mergeError(other.getError()); + break; + } + case SESSION_PARAMETERS: + { + mergeSessionParameters(other.getSessionParameters()); + break; + } + case HEARTBEAT: + { + mergeHeartbeat(other.getHeartbeat()); + break; + } + case GO_AWAY: + { + mergeGoAway(other.getGoAway()); + break; + } + case SESSION_REFRESH_CONFIG: + { + mergeSessionRefreshConfig(other.getSessionRefreshConfig()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOpenSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetVirtualRpcFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSessionParametersFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetHeartbeatFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetGoAwayFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetSessionRefreshConfigFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder> + openSessionBuilder_; + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return openSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder setOpenSession(com.google.bigtable.v2.OpenSessionResponse value) { + if (openSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + openSessionBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder setOpenSession( + com.google.bigtable.v2.OpenSessionResponse.Builder builderForValue) { + if (openSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + openSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder mergeOpenSession(com.google.bigtable.v2.OpenSessionResponse value) { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.OpenSessionResponse.newBuilder( + (com.google.bigtable.v2.OpenSessionResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + openSessionBuilder_.mergeFrom(value); + } else { + openSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder clearOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + openSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public com.google.bigtable.v2.OpenSessionResponse.Builder getOpenSessionBuilder() { + return internalGetOpenSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder() { + if ((payloadCase_ == 1) && (openSessionBuilder_ != null)) { + return openSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder> + internalGetOpenSessionFieldBuilder() { + if (openSessionBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + openSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder>( + (com.google.bigtable.v2.OpenSessionResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return openSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder> + virtualRpcBuilder_; + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 2; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return virtualRpcBuilder_.getMessage(); + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcResponse value) { + if (virtualRpcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + virtualRpcBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder setVirtualRpc( + com.google.bigtable.v2.VirtualRpcResponse.Builder builderForValue) { + if (virtualRpcBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + virtualRpcBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder mergeVirtualRpc(com.google.bigtable.v2.VirtualRpcResponse value) { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.VirtualRpcResponse.newBuilder( + (com.google.bigtable.v2.VirtualRpcResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + virtualRpcBuilder_.mergeFrom(value); + } else { + virtualRpcBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder clearVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + virtualRpcBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public com.google.bigtable.v2.VirtualRpcResponse.Builder getVirtualRpcBuilder() { + return internalGetVirtualRpcFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder() { + if ((payloadCase_ == 2) && (virtualRpcBuilder_ != null)) { + return virtualRpcBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder> + internalGetVirtualRpcFieldBuilder() { + if (virtualRpcBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + virtualRpcBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder>( + (com.google.bigtable.v2.VirtualRpcResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return virtualRpcBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder> + errorBuilder_; + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getError() { + if (errorBuilder_ == null) { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 3) { + return errorBuilder_.getMessage(); + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder setError(com.google.bigtable.v2.ErrorResponse value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder setError(com.google.bigtable.v2.ErrorResponse.Builder builderForValue) { + if (errorBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder mergeError(com.google.bigtable.v2.ErrorResponse value) { + if (errorBuilder_ == null) { + if (payloadCase_ == 3 + && payload_ != com.google.bigtable.v2.ErrorResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.ErrorResponse.newBuilder( + (com.google.bigtable.v2.ErrorResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 3) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public com.google.bigtable.v2.ErrorResponse.Builder getErrorBuilder() { + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder() { + if ((payloadCase_ == 3) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(payloadCase_ == 3)) { + payload_ = com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder>( + (com.google.bigtable.v2.ErrorResponse) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 3; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder> + sessionParametersBuilder_; + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + @java.lang.Override + public boolean hasSessionParameters() { + return payloadCase_ == 4; + } + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getSessionParameters() { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 4) { + return sessionParametersBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder setSessionParameters(com.google.bigtable.v2.SessionParametersResponse value) { + if (sessionParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + sessionParametersBuilder_.setMessage(value); + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder setSessionParameters( + com.google.bigtable.v2.SessionParametersResponse.Builder builderForValue) { + if (sessionParametersBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + sessionParametersBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder mergeSessionParameters(com.google.bigtable.v2.SessionParametersResponse value) { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4 + && payload_ != com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionParametersResponse.newBuilder( + (com.google.bigtable.v2.SessionParametersResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 4) { + sessionParametersBuilder_.mergeFrom(value); + } else { + sessionParametersBuilder_.setMessage(value); + } + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder clearSessionParameters() { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + } + sessionParametersBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public com.google.bigtable.v2.SessionParametersResponse.Builder getSessionParametersBuilder() { + return internalGetSessionParametersFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponseOrBuilder + getSessionParametersOrBuilder() { + if ((payloadCase_ == 4) && (sessionParametersBuilder_ != null)) { + return sessionParametersBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder> + internalGetSessionParametersFieldBuilder() { + if (sessionParametersBuilder_ == null) { + if (!(payloadCase_ == 4)) { + payload_ = com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + sessionParametersBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder>( + (com.google.bigtable.v2.SessionParametersResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 4; + onChanged(); + return sessionParametersBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder> + heartbeatBuilder_; + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return payloadCase_ == 5; + } + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getHeartbeat() { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 5) { + return heartbeatBuilder_.getMessage(); + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder setHeartbeat(com.google.bigtable.v2.HeartbeatResponse value) { + if (heartbeatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + heartbeatBuilder_.setMessage(value); + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder setHeartbeat(com.google.bigtable.v2.HeartbeatResponse.Builder builderForValue) { + if (heartbeatBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + heartbeatBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder mergeHeartbeat(com.google.bigtable.v2.HeartbeatResponse value) { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5 + && payload_ != com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.HeartbeatResponse.newBuilder( + (com.google.bigtable.v2.HeartbeatResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 5) { + heartbeatBuilder_.mergeFrom(value); + } else { + heartbeatBuilder_.setMessage(value); + } + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder clearHeartbeat() { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 5) { + payloadCase_ = 0; + payload_ = null; + } + heartbeatBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public com.google.bigtable.v2.HeartbeatResponse.Builder getHeartbeatBuilder() { + return internalGetHeartbeatFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder() { + if ((payloadCase_ == 5) && (heartbeatBuilder_ != null)) { + return heartbeatBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder> + internalGetHeartbeatFieldBuilder() { + if (heartbeatBuilder_ == null) { + if (!(payloadCase_ == 5)) { + payload_ = com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + heartbeatBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder>( + (com.google.bigtable.v2.HeartbeatResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 5; + onChanged(); + return heartbeatBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder> + goAwayBuilder_; + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + @java.lang.Override + public boolean hasGoAway() { + return payloadCase_ == 6; + } + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getGoAway() { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 6) { + return goAwayBuilder_.getMessage(); + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder setGoAway(com.google.bigtable.v2.GoAwayResponse value) { + if (goAwayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + goAwayBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder setGoAway(com.google.bigtable.v2.GoAwayResponse.Builder builderForValue) { + if (goAwayBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + goAwayBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder mergeGoAway(com.google.bigtable.v2.GoAwayResponse value) { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6 + && payload_ != com.google.bigtable.v2.GoAwayResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.GoAwayResponse.newBuilder( + (com.google.bigtable.v2.GoAwayResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 6) { + goAwayBuilder_.mergeFrom(value); + } else { + goAwayBuilder_.setMessage(value); + } + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder clearGoAway() { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + } + goAwayBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public com.google.bigtable.v2.GoAwayResponse.Builder getGoAwayBuilder() { + return internalGetGoAwayFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder() { + if ((payloadCase_ == 6) && (goAwayBuilder_ != null)) { + return goAwayBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder> + internalGetGoAwayFieldBuilder() { + if (goAwayBuilder_ == null) { + if (!(payloadCase_ == 6)) { + payload_ = com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + goAwayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder>( + (com.google.bigtable.v2.GoAwayResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 6; + onChanged(); + return goAwayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder> + sessionRefreshConfigBuilder_; + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + @java.lang.Override + public boolean hasSessionRefreshConfig() { + return payloadCase_ == 7; + } + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig() { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } else { + if (payloadCase_ == 7) { + return sessionRefreshConfigBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder setSessionRefreshConfig(com.google.bigtable.v2.SessionRefreshConfig value) { + if (sessionRefreshConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + sessionRefreshConfigBuilder_.setMessage(value); + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder setSessionRefreshConfig( + com.google.bigtable.v2.SessionRefreshConfig.Builder builderForValue) { + if (sessionRefreshConfigBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + sessionRefreshConfigBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder mergeSessionRefreshConfig(com.google.bigtable.v2.SessionRefreshConfig value) { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7 + && payload_ != com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionRefreshConfig.newBuilder( + (com.google.bigtable.v2.SessionRefreshConfig) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 7) { + sessionRefreshConfigBuilder_.mergeFrom(value); + } else { + sessionRefreshConfigBuilder_.setMessage(value); + } + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder clearSessionRefreshConfig() { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 7) { + payloadCase_ = 0; + payload_ = null; + } + sessionRefreshConfigBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public com.google.bigtable.v2.SessionRefreshConfig.Builder getSessionRefreshConfigBuilder() { + return internalGetSessionRefreshConfigFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder() { + if ((payloadCase_ == 7) && (sessionRefreshConfigBuilder_ != null)) { + return sessionRefreshConfigBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder> + internalGetSessionRefreshConfigFieldBuilder() { + if (sessionRefreshConfigBuilder_ == null) { + if (!(payloadCase_ == 7)) { + payload_ = com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + sessionRefreshConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder>( + (com.google.bigtable.v2.SessionRefreshConfig) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 7; + onChanged(); + return sessionRefreshConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionResponse) + private static final com.google.bigtable.v2.SessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionResponse(); + } + + public static com.google.bigtable.v2.SessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java new file mode 100644 index 000000000000..492e52d89338 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + boolean hasOpenSession(); + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + com.google.bigtable.v2.OpenSessionResponse getOpenSession(); + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + boolean hasVirtualRpc(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder(); + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + com.google.bigtable.v2.ErrorResponse getError(); + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder(); + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + boolean hasSessionParameters(); + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + com.google.bigtable.v2.SessionParametersResponse getSessionParameters(); + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + com.google.bigtable.v2.SessionParametersResponseOrBuilder getSessionParametersOrBuilder(); + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + boolean hasHeartbeat(); + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + com.google.bigtable.v2.HeartbeatResponse getHeartbeat(); + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder(); + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + boolean hasGoAway(); + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + com.google.bigtable.v2.GoAwayResponse getGoAway(); + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder(); + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + boolean hasSessionRefreshConfig(); + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig(); + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder(); + + com.google.bigtable.v2.SessionResponse.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java new file mode 100644 index 000000000000..8d391eed3639 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java @@ -0,0 +1,173 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Supported session types.
+ * 
+ * + * Protobuf enum {@code google.bigtable.v2.SessionType} + */ +@com.google.protobuf.Generated +public enum SessionType implements com.google.protobuf.ProtocolMessageEnum { + /** SESSION_TYPE_UNSET = 0; */ + SESSION_TYPE_UNSET(0), + /** SESSION_TYPE_TABLE = 1; */ + SESSION_TYPE_TABLE(1), + /** SESSION_TYPE_AUTHORIZED_VIEW = 2; */ + SESSION_TYPE_AUTHORIZED_VIEW(2), + /** SESSION_TYPE_MATERIALIZED_VIEW = 3; */ + SESSION_TYPE_MATERIALIZED_VIEW(3), + /** + * + * + *
+   * For internal protocol testing only.
+   * 
+ * + * SESSION_TYPE_TEST = 9999; + */ + SESSION_TYPE_TEST(9999), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionType"); + } + + /** SESSION_TYPE_UNSET = 0; */ + public static final int SESSION_TYPE_UNSET_VALUE = 0; + + /** SESSION_TYPE_TABLE = 1; */ + public static final int SESSION_TYPE_TABLE_VALUE = 1; + + /** SESSION_TYPE_AUTHORIZED_VIEW = 2; */ + public static final int SESSION_TYPE_AUTHORIZED_VIEW_VALUE = 2; + + /** SESSION_TYPE_MATERIALIZED_VIEW = 3; */ + public static final int SESSION_TYPE_MATERIALIZED_VIEW_VALUE = 3; + + /** + * + * + *
+   * For internal protocol testing only.
+   * 
+ * + * SESSION_TYPE_TEST = 9999; + */ + public static final int SESSION_TYPE_TEST_VALUE = 9999; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SessionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SessionType forNumber(int value) { + switch (value) { + case 0: + return SESSION_TYPE_UNSET; + case 1: + return SESSION_TYPE_TABLE; + case 2: + return SESSION_TYPE_AUTHORIZED_VIEW; + case 3: + return SESSION_TYPE_MATERIALIZED_VIEW; + case 9999: + return SESSION_TYPE_TEST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SessionType findValueByNumber(int number) { + return SessionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SessionType[] VALUES = values(); + + public static SessionType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SessionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.SessionType) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java new file mode 100644 index 000000000000..3d9abfac89df --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java @@ -0,0 +1,891 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * The information required to continue reading the data from a
+ * `StreamPartition` from where a previous read left off.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamContinuationToken} + */ +@com.google.protobuf.Generated +public final class StreamContinuationToken extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamContinuationToken) + StreamContinuationTokenOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamContinuationToken"); + } + + // Use StreamContinuationToken.newBuilder() to construct. + private StreamContinuationToken(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamContinuationToken() { + token_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationToken_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationToken_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamContinuationToken.class, + com.google.bigtable.v2.StreamContinuationToken.Builder.class); + } + + private int bitField0_; + public static final int PARTITION_FIELD_NUMBER = 1; + private com.google.bigtable.v2.StreamPartition partition_; + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + @java.lang.Override + public boolean hasPartition() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartition getPartition() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + + public static final int TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + + /** + * + * + *
+   * An encoded position in the stream to restart reading from.
+   * 
+ * + * string token = 2; + * + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + 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(); + token_ = s; + return s; + } + } + + /** + * + * + *
+   * An encoded position in the stream to restart reading from.
+   * 
+ * + * string token = 2; + * + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPartition()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, token_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPartition()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, token_); + } + size += getUnknownFields().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.StreamContinuationToken)) { + return super.equals(obj); + } + com.google.bigtable.v2.StreamContinuationToken other = + (com.google.bigtable.v2.StreamContinuationToken) obj; + + if (hasPartition() != other.hasPartition()) return false; + if (hasPartition()) { + if (!getPartition().equals(other.getPartition())) return false; + } + if (!getToken().equals(other.getToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPartition()) { + hash = (37 * hash) + PARTITION_FIELD_NUMBER; + hash = (53 * hash) + getPartition().hashCode(); + } + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationToken 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.StreamContinuationToken parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationToken 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.StreamContinuationToken parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.StreamContinuationToken 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * The information required to continue reading the data from a
+   * `StreamPartition` from where a previous read left off.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamContinuationToken} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.StreamContinuationToken) + com.google.bigtable.v2.StreamContinuationTokenOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationToken_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationToken_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamContinuationToken.class, + com.google.bigtable.v2.StreamContinuationToken.Builder.class); + } + + // Construct using com.google.bigtable.v2.StreamContinuationToken.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPartitionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + token_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationToken_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken getDefaultInstanceForType() { + return com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken build() { + com.google.bigtable.v2.StreamContinuationToken result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken buildPartial() { + com.google.bigtable.v2.StreamContinuationToken result = + new com.google.bigtable.v2.StreamContinuationToken(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.StreamContinuationToken result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.partition_ = partitionBuilder_ == null ? partition_ : partitionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.token_ = token_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.StreamContinuationToken) { + return mergeFrom((com.google.bigtable.v2.StreamContinuationToken) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.StreamContinuationToken other) { + if (other == com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()) return this; + if (other.hasPartition()) { + mergePartition(other.getPartition()); + } + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetPartitionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.StreamPartition partition_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + partitionBuilder_; + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + public boolean hasPartition() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + public com.google.bigtable.v2.StreamPartition getPartition() { + if (partitionBuilder_ == null) { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } else { + return partitionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partition_ = value; + } else { + partitionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder setPartition(com.google.bigtable.v2.StreamPartition.Builder builderForValue) { + if (partitionBuilder_ == null) { + partition_ = builderForValue.build(); + } else { + partitionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder mergePartition(com.google.bigtable.v2.StreamPartition value) { + if (partitionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && partition_ != null + && partition_ != com.google.bigtable.v2.StreamPartition.getDefaultInstance()) { + getPartitionBuilder().mergeFrom(value); + } else { + partition_ = value; + } + } else { + partitionBuilder_.mergeFrom(value); + } + if (partition_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public Builder clearPartition() { + bitField0_ = (bitField0_ & ~0x00000001); + partition_ = null; + if (partitionBuilder_ != null) { + partitionBuilder_.dispose(); + partitionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public com.google.bigtable.v2.StreamPartition.Builder getPartitionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPartitionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + public com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder() { + if (partitionBuilder_ != null) { + return partitionBuilder_.getMessageOrBuilder(); + } else { + return partition_ == null + ? com.google.bigtable.v2.StreamPartition.getDefaultInstance() + : partition_; + } + } + + /** + * + * + *
+     * The partition that this token applies to.
+     * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + internalGetPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder>( + getPartition(), getParentForChildren(), isClean()); + partition_ = null; + } + return partitionBuilder_; + } + + private java.lang.Object token_ = ""; + + /** + * + * + *
+     * An encoded position in the stream to restart reading from.
+     * 
+ * + * string token = 2; + * + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * An encoded position in the stream to restart reading from.
+     * 
+ * + * string token = 2; + * + * @return The bytes for token. + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * An encoded position in the stream to restart reading from.
+     * 
+ * + * string token = 2; + * + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + token_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * An encoded position in the stream to restart reading from.
+     * 
+ * + * string token = 2; + * + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * An encoded position in the stream to restart reading from.
+     * 
+ * + * string token = 2; + * + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.StreamContinuationToken) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.StreamContinuationToken) + private static final com.google.bigtable.v2.StreamContinuationToken DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.StreamContinuationToken(); + } + + public static com.google.bigtable.v2.StreamContinuationToken getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamContinuationToken parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StreamContinuationToken getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java new file mode 100644 index 000000000000..ef484a692e9f --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface StreamContinuationTokenOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.StreamContinuationToken) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return Whether the partition field is set. + */ + boolean hasPartition(); + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + * + * @return The partition. + */ + com.google.bigtable.v2.StreamPartition getPartition(); + + /** + * + * + *
+   * The partition that this token applies to.
+   * 
+ * + * .google.bigtable.v2.StreamPartition partition = 1; + */ + com.google.bigtable.v2.StreamPartitionOrBuilder getPartitionOrBuilder(); + + /** + * + * + *
+   * An encoded position in the stream to restart reading from.
+   * 
+ * + * string token = 2; + * + * @return The token. + */ + java.lang.String getToken(); + + /** + * + * + *
+   * An encoded position in the stream to restart reading from.
+   * 
+ * + * string token = 2; + * + * @return The bytes for token. + */ + com.google.protobuf.ByteString getTokenBytes(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java new file mode 100644 index 000000000000..f1c15adfe778 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java @@ -0,0 +1,927 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * The information required to continue reading the data from multiple
+ * `StreamPartitions` from where a previous read left off.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamContinuationTokens} + */ +@com.google.protobuf.Generated +public final class StreamContinuationTokens extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamContinuationTokens) + StreamContinuationTokensOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamContinuationTokens"); + } + + // Use StreamContinuationTokens.newBuilder() to construct. + private StreamContinuationTokens(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamContinuationTokens() { + tokens_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationTokens_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamContinuationTokens.class, + com.google.bigtable.v2.StreamContinuationTokens.Builder.class); + } + + public static final int TOKENS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List tokens_; + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + @java.lang.Override + public java.util.List getTokensList() { + return tokens_; + } + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + @java.lang.Override + public java.util.List + getTokensOrBuilderList() { + return tokens_; + } + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + @java.lang.Override + public int getTokensCount() { + return tokens_.size(); + } + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationToken getTokens(int index) { + return tokens_.get(index); + } + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder getTokensOrBuilder(int index) { + return tokens_.get(index); + } + + 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 { + for (int i = 0; i < tokens_.size(); i++) { + output.writeMessage(1, tokens_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tokens_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tokens_.get(i)); + } + size += getUnknownFields().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.StreamContinuationTokens)) { + return super.equals(obj); + } + com.google.bigtable.v2.StreamContinuationTokens other = + (com.google.bigtable.v2.StreamContinuationTokens) obj; + + if (!getTokensList().equals(other.getTokensList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTokensCount() > 0) { + hash = (37 * hash) + TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getTokensList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationTokens 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.StreamContinuationTokens parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationTokens 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.StreamContinuationTokens parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.StreamContinuationTokens 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * The information required to continue reading the data from multiple
+   * `StreamPartitions` from where a previous read left off.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamContinuationTokens} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.StreamContinuationTokens) + com.google.bigtable.v2.StreamContinuationTokensOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationTokens_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamContinuationTokens.class, + com.google.bigtable.v2.StreamContinuationTokens.Builder.class); + } + + // Construct using com.google.bigtable.v2.StreamContinuationTokens.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (tokensBuilder_ == null) { + tokens_ = java.util.Collections.emptyList(); + } else { + tokens_ = null; + tokensBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokens getDefaultInstanceForType() { + return com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokens build() { + com.google.bigtable.v2.StreamContinuationTokens result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamContinuationTokens buildPartial() { + com.google.bigtable.v2.StreamContinuationTokens result = + new com.google.bigtable.v2.StreamContinuationTokens(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.StreamContinuationTokens result) { + if (tokensBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tokens_ = java.util.Collections.unmodifiableList(tokens_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tokens_ = tokens_; + } else { + result.tokens_ = tokensBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.StreamContinuationTokens result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.StreamContinuationTokens) { + return mergeFrom((com.google.bigtable.v2.StreamContinuationTokens) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.StreamContinuationTokens other) { + if (other == com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance()) + return this; + if (tokensBuilder_ == null) { + if (!other.tokens_.isEmpty()) { + if (tokens_.isEmpty()) { + tokens_ = other.tokens_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTokensIsMutable(); + tokens_.addAll(other.tokens_); + } + onChanged(); + } + } else { + if (!other.tokens_.isEmpty()) { + if (tokensBuilder_.isEmpty()) { + tokensBuilder_.dispose(); + tokensBuilder_ = null; + tokens_ = other.tokens_; + bitField0_ = (bitField0_ & ~0x00000001); + tokensBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTokensFieldBuilder() + : null; + } else { + tokensBuilder_.addAllMessages(other.tokens_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.StreamContinuationToken m = + input.readMessage( + com.google.bigtable.v2.StreamContinuationToken.parser(), extensionRegistry); + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(m); + } else { + tokensBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List tokens_ = + java.util.Collections.emptyList(); + + private void ensureTokensIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tokens_ = new java.util.ArrayList(tokens_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + tokensBuilder_; + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public java.util.List getTokensList() { + if (tokensBuilder_ == null) { + return java.util.Collections.unmodifiableList(tokens_); + } else { + return tokensBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public int getTokensCount() { + if (tokensBuilder_ == null) { + return tokens_.size(); + } else { + return tokensBuilder_.getCount(); + } + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public com.google.bigtable.v2.StreamContinuationToken getTokens(int index) { + if (tokensBuilder_ == null) { + return tokens_.get(index); + } else { + return tokensBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder setTokens(int index, com.google.bigtable.v2.StreamContinuationToken value) { + if (tokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokensIsMutable(); + tokens_.set(index, value); + onChanged(); + } else { + tokensBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder setTokens( + int index, com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.set(index, builderForValue.build()); + onChanged(); + } else { + tokensBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder addTokens(com.google.bigtable.v2.StreamContinuationToken value) { + if (tokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokensIsMutable(); + tokens_.add(value); + onChanged(); + } else { + tokensBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder addTokens(int index, com.google.bigtable.v2.StreamContinuationToken value) { + if (tokensBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTokensIsMutable(); + tokens_.add(index, value); + onChanged(); + } else { + tokensBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder addTokens( + com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(builderForValue.build()); + onChanged(); + } else { + tokensBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder addTokens( + int index, com.google.bigtable.v2.StreamContinuationToken.Builder builderForValue) { + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.add(index, builderForValue.build()); + onChanged(); + } else { + tokensBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder addAllTokens( + java.lang.Iterable values) { + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tokens_); + onChanged(); + } else { + tokensBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder clearTokens() { + if (tokensBuilder_ == null) { + tokens_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tokensBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public Builder removeTokens(int index) { + if (tokensBuilder_ == null) { + ensureTokensIsMutable(); + tokens_.remove(index); + onChanged(); + } else { + tokensBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder getTokensBuilder(int index) { + return internalGetTokensFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public com.google.bigtable.v2.StreamContinuationTokenOrBuilder getTokensOrBuilder(int index) { + if (tokensBuilder_ == null) { + return tokens_.get(index); + } else { + return tokensBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public java.util.List + getTokensOrBuilderList() { + if (tokensBuilder_ != null) { + return tokensBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tokens_); + } + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder addTokensBuilder() { + return internalGetTokensFieldBuilder() + .addBuilder(com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()); + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public com.google.bigtable.v2.StreamContinuationToken.Builder addTokensBuilder(int index) { + return internalGetTokensFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.StreamContinuationToken.getDefaultInstance()); + } + + /** + * + * + *
+     * List of continuation tokens.
+     * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + public java.util.List + getTokensBuilderList() { + return internalGetTokensFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + internalGetTokensFieldBuilder() { + if (tokensBuilder_ == null) { + tokensBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder>( + tokens_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tokens_ = null; + } + return tokensBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.StreamContinuationTokens) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.StreamContinuationTokens) + private static final com.google.bigtable.v2.StreamContinuationTokens DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.StreamContinuationTokens(); + } + + public static com.google.bigtable.v2.StreamContinuationTokens getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamContinuationTokens parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StreamContinuationTokens getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java new file mode 100644 index 000000000000..06af7a3e32a2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface StreamContinuationTokensOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.StreamContinuationTokens) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + java.util.List getTokensList(); + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + com.google.bigtable.v2.StreamContinuationToken getTokens(int index); + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + int getTokensCount(); + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + java.util.List + getTokensOrBuilderList(); + + /** + * + * + *
+   * List of continuation tokens.
+   * 
+ * + * repeated .google.bigtable.v2.StreamContinuationToken tokens = 1; + */ + com.google.bigtable.v2.StreamContinuationTokenOrBuilder getTokensOrBuilder(int index); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java new file mode 100644 index 000000000000..7422e1f6e06b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java @@ -0,0 +1,702 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+ * A partition of a change stream.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamPartition} + */ +@com.google.protobuf.Generated +public final class StreamPartition extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamPartition) + StreamPartitionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamPartition"); + } + + // Use StreamPartition.newBuilder() to construct. + private StreamPartition(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamPartition() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamPartition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamPartition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamPartition.class, + com.google.bigtable.v2.StreamPartition.Builder.class); + } + + private int bitField0_; + public static final int ROW_RANGE_FIELD_NUMBER = 1; + private com.google.bigtable.v2.RowRange rowRange_; + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return Whether the rowRange field is set. + */ + @java.lang.Override + public boolean hasRowRange() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return The rowRange. + */ + @java.lang.Override + public com.google.bigtable.v2.RowRange getRowRange() { + return rowRange_ == null ? com.google.bigtable.v2.RowRange.getDefaultInstance() : rowRange_; + } + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.RowRangeOrBuilder getRowRangeOrBuilder() { + return rowRange_ == null ? com.google.bigtable.v2.RowRange.getDefaultInstance() : rowRange_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRowRange()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRowRange()); + } + size += getUnknownFields().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.StreamPartition)) { + return super.equals(obj); + } + com.google.bigtable.v2.StreamPartition other = (com.google.bigtable.v2.StreamPartition) obj; + + if (hasRowRange() != other.hasRowRange()) return false; + if (hasRowRange()) { + if (!getRowRange().equals(other.getRowRange())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRowRange()) { + hash = (37 * hash) + ROW_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getRowRange().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.StreamPartition parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamPartition 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.StreamPartition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamPartition 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.StreamPartition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.StreamPartition parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamPartition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamPartition parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamPartition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamPartition parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamPartition parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.StreamPartition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.StreamPartition 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * NOTE: This API is intended to be used by Apache Beam BigtableIO.
+   * A partition of a change stream.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.StreamPartition} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.StreamPartition) + com.google.bigtable.v2.StreamPartitionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamPartition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamPartition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.StreamPartition.class, + com.google.bigtable.v2.StreamPartition.Builder.class); + } + + // Construct using com.google.bigtable.v2.StreamPartition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowRangeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rowRange_ = null; + if (rowRangeBuilder_ != null) { + rowRangeBuilder_.dispose(); + rowRangeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_StreamPartition_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamPartition getDefaultInstanceForType() { + return com.google.bigtable.v2.StreamPartition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.StreamPartition build() { + com.google.bigtable.v2.StreamPartition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.StreamPartition buildPartial() { + com.google.bigtable.v2.StreamPartition result = + new com.google.bigtable.v2.StreamPartition(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.StreamPartition result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowRange_ = rowRangeBuilder_ == null ? rowRange_ : rowRangeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.StreamPartition) { + return mergeFrom((com.google.bigtable.v2.StreamPartition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.StreamPartition other) { + if (other == com.google.bigtable.v2.StreamPartition.getDefaultInstance()) return this; + if (other.hasRowRange()) { + mergeRowRange(other.getRowRange()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetRowRangeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.RowRange rowRange_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder> + rowRangeBuilder_; + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return Whether the rowRange field is set. + */ + public boolean hasRowRange() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return The rowRange. + */ + public com.google.bigtable.v2.RowRange getRowRange() { + if (rowRangeBuilder_ == null) { + return rowRange_ == null ? com.google.bigtable.v2.RowRange.getDefaultInstance() : rowRange_; + } else { + return rowRangeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public Builder setRowRange(com.google.bigtable.v2.RowRange value) { + if (rowRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rowRange_ = value; + } else { + rowRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public Builder setRowRange(com.google.bigtable.v2.RowRange.Builder builderForValue) { + if (rowRangeBuilder_ == null) { + rowRange_ = builderForValue.build(); + } else { + rowRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public Builder mergeRowRange(com.google.bigtable.v2.RowRange value) { + if (rowRangeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && rowRange_ != null + && rowRange_ != com.google.bigtable.v2.RowRange.getDefaultInstance()) { + getRowRangeBuilder().mergeFrom(value); + } else { + rowRange_ = value; + } + } else { + rowRangeBuilder_.mergeFrom(value); + } + if (rowRange_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public Builder clearRowRange() { + bitField0_ = (bitField0_ & ~0x00000001); + rowRange_ = null; + if (rowRangeBuilder_ != null) { + rowRangeBuilder_.dispose(); + rowRangeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public com.google.bigtable.v2.RowRange.Builder getRowRangeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRowRangeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + public com.google.bigtable.v2.RowRangeOrBuilder getRowRangeOrBuilder() { + if (rowRangeBuilder_ != null) { + return rowRangeBuilder_.getMessageOrBuilder(); + } else { + return rowRange_ == null ? com.google.bigtable.v2.RowRange.getDefaultInstance() : rowRange_; + } + } + + /** + * + * + *
+     * The row range covered by this partition and is specified by
+     * [`start_key_closed`, `end_key_open`).
+     * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder> + internalGetRowRangeFieldBuilder() { + if (rowRangeBuilder_ == null) { + rowRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder>( + getRowRange(), getParentForChildren(), isClean()); + rowRange_ = null; + } + return rowRangeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.StreamPartition) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.StreamPartition) + private static final com.google.bigtable.v2.StreamPartition DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.StreamPartition(); + } + + public static com.google.bigtable.v2.StreamPartition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamPartition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StreamPartition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java new file mode 100644 index 000000000000..9b63bfee1b10 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface StreamPartitionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.StreamPartition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return Whether the rowRange field is set. + */ + boolean hasRowRange(); + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + * + * @return The rowRange. + */ + com.google.bigtable.v2.RowRange getRowRange(); + + /** + * + * + *
+   * The row range covered by this partition and is specified by
+   * [`start_key_closed`, `end_key_open`).
+   * 
+ * + * .google.bigtable.v2.RowRange row_range = 1; + */ + com.google.bigtable.v2.RowRangeOrBuilder getRowRangeOrBuilder(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java new file mode 100644 index 000000000000..b616cb8488fc --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2026 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 TableName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE_TABLE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/instances/{instance}/tables/{table}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + private final String table; + + @Deprecated + protected TableName() { + project = null; + instance = null; + table = null; + } + + private TableName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + table = Preconditions.checkNotNull(builder.getTable()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TableName of(String project, String instance, String table) { + return newBuilder().setProject(project).setInstance(instance).setTable(table).build(); + } + + public static String format(String project, String instance, String table) { + return newBuilder() + .setProject(project) + .setInstance(instance) + .setTable(table) + .build() + .toString(); + } + + public static TableName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE_TABLE.validatedMatch( + formattedString, "TableName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance"), matchMap.get("table")); + } + + 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 (TableName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE_TABLE.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); + } + if (table != null) { + fieldMapBuilder.put("table", table); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE_TABLE.instantiate( + "project", project, "instance", instance, "table", table); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + TableName that = ((TableName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.table, that.table); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(table); + return h; + } + + /** Builder for projects/{project}/instances/{instance}/tables/{table}. */ + public static class Builder { + private String project; + private String instance; + private String table; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public String getTable() { + return table; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + public Builder setTable(String table) { + this.table = table; + return this; + } + + private Builder(TableName tableName) { + this.project = tableName.project; + this.instance = tableName.instance; + this.table = tableName.table; + } + + public TableName build() { + return new TableName(this); + } + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java new file mode 100644 index 000000000000..a79a31a44354 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java @@ -0,0 +1,922 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TableRequest} + */ +@com.google.protobuf.Generated +public final class TableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TableRequest) + TableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableRequest"); + } + + // Use TableRequest.newBuilder() to construct. + private TableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TableRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableRequest.class, + com.google.bigtable.v2.TableRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + size += getUnknownFields().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.TableRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.TableRequest other = (com.google.bigtable.v2.TableRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest 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.TableRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest 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.TableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.TableRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TableRequest) + com.google.bigtable.v2.TableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableRequest.class, + com.google.bigtable.v2.TableRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.TableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.TableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest build() { + com.google.bigtable.v2.TableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest buildPartial() { + com.google.bigtable.v2.TableRequest result = new com.google.bigtable.v2.TableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TableRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.TableRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TableRequest) { + return mergeFrom((com.google.bigtable.v2.TableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TableRequest other) { + if (other == com.google.bigtable.v2.TableRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowRequest.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowRequest.newBuilder( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowRequest.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TableRequest) + private static final com.google.bigtable.v2.TableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TableRequest(); + } + + public static com.google.bigtable.v2.TableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java new file mode 100644 index 000000000000..46dd37288e9c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowRequest getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.TableRequest.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java new file mode 100644 index 000000000000..376919490ec6 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java @@ -0,0 +1,922 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TableResponse} + */ +@com.google.protobuf.Generated +public final class TableResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TableResponse) + TableResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableResponse"); + } + + // Use TableResponse.newBuilder() to construct. + private TableResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TableResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableResponse.class, + com.google.bigtable.v2.TableResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + size += getUnknownFields().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.TableResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.TableResponse other = (com.google.bigtable.v2.TableResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TableResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse 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.TableResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse 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.TableResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.TableResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TableResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TableResponse) + com.google.bigtable.v2.TableResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableResponse.class, + com.google.bigtable.v2.TableResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.TableResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.TableResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse build() { + com.google.bigtable.v2.TableResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse buildPartial() { + com.google.bigtable.v2.TableResponse result = new com.google.bigtable.v2.TableResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TableResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.TableResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TableResponse) { + return mergeFrom((com.google.bigtable.v2.TableResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TableResponse other) { + if (other == com.google.bigtable.v2.TableResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowResponse.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowResponse.newBuilder( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowResponse.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TableResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TableResponse) + private static final com.google.bigtable.v2.TableResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TableResponse(); + } + + public static com.google.bigtable.v2.TableResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TableResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java new file mode 100644 index 000000000000..e1b61b9d7141 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TableResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TableResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowResponse getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.TableResponse.PayloadCase getPayloadCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java new file mode 100644 index 000000000000..43fe07eeb18d --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java @@ -0,0 +1,784 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Server provided instructions for enabling finer grained observability on
+ * the client to help diagnose customer issues. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TelemetryConfiguration} + */ +@com.google.protobuf.Generated +public final class TelemetryConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TelemetryConfiguration) + TelemetryConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TelemetryConfiguration"); + } + + // Use TelemetryConfiguration.newBuilder() to construct. + private TelemetryConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TelemetryConfiguration() { + debugTagLevel_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TelemetryConfiguration.class, + com.google.bigtable.v2.TelemetryConfiguration.Builder.class); + } + + /** + * + * + *
+   * The level of detail of telemetry to be sent from the client.
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.TelemetryConfiguration.Level} + */ + public enum Level implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Server did not specify a level. Should disable all debug tag counters.
+     * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + LEVEL_UNSPECIFIED(0), + /** + * + * + *
+     * Enables all debug tag counter levels.
+     * 
+ * + * DEBUG = 1; + */ + DEBUG(1), + /** + * + * + *
+     * Eables all debug tag counters except for DEBUG.
+     * 
+ * + * INFO = 2; + */ + INFO(2), + /** + * + * + *
+     * Enables all debug tag counters except for DEBUG and INFO.
+     * 
+ * + * WARN = 3; + */ + WARN(3), + /** + * + * + *
+     * Enables only error debug tag counters.
+     * 
+ * + * ERROR = 4; + */ + ERROR(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Level"); + } + + /** + * + * + *
+     * Server did not specify a level. Should disable all debug tag counters.
+     * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + public static final int LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Enables all debug tag counter levels.
+     * 
+ * + * DEBUG = 1; + */ + public static final int DEBUG_VALUE = 1; + + /** + * + * + *
+     * Eables all debug tag counters except for DEBUG.
+     * 
+ * + * INFO = 2; + */ + public static final int INFO_VALUE = 2; + + /** + * + * + *
+     * Enables all debug tag counters except for DEBUG and INFO.
+     * 
+ * + * WARN = 3; + */ + public static final int WARN_VALUE = 3; + + /** + * + * + *
+     * Enables only error debug tag counters.
+     * 
+ * + * ERROR = 4; + */ + public static final int ERROR_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Level valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Level forNumber(int value) { + switch (value) { + case 0: + return LEVEL_UNSPECIFIED; + case 1: + return DEBUG; + case 2: + return INFO; + case 3: + return WARN; + case 4: + return ERROR; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Level findValueByNumber(int number) { + return Level.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.TelemetryConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final Level[] VALUES = values(); + + public static Level valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Level(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.TelemetryConfiguration.Level) + } + + public static final int DEBUG_TAG_LEVEL_FIELD_NUMBER = 1; + private int debugTagLevel_ = 0; + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + @java.lang.Override + public int getDebugTagLevelValue() { + return debugTagLevel_; + } + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel() { + com.google.bigtable.v2.TelemetryConfiguration.Level result = + com.google.bigtable.v2.TelemetryConfiguration.Level.forNumber(debugTagLevel_); + return result == null + ? com.google.bigtable.v2.TelemetryConfiguration.Level.UNRECOGNIZED + : result; + } + + 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 (debugTagLevel_ + != com.google.bigtable.v2.TelemetryConfiguration.Level.LEVEL_UNSPECIFIED.getNumber()) { + output.writeEnum(1, debugTagLevel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (debugTagLevel_ + != com.google.bigtable.v2.TelemetryConfiguration.Level.LEVEL_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, debugTagLevel_); + } + size += getUnknownFields().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.TelemetryConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.TelemetryConfiguration other = + (com.google.bigtable.v2.TelemetryConfiguration) obj; + + if (debugTagLevel_ != other.debugTagLevel_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEBUG_TAG_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + debugTagLevel_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration 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.TelemetryConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration 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.TelemetryConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.TelemetryConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Server provided instructions for enabling finer grained observability on
+   * the client to help diagnose customer issues. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TelemetryConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TelemetryConfiguration) + com.google.bigtable.v2.TelemetryConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TelemetryConfiguration.class, + com.google.bigtable.v2.TelemetryConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.TelemetryConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + debugTagLevel_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration build() { + com.google.bigtable.v2.TelemetryConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration buildPartial() { + com.google.bigtable.v2.TelemetryConfiguration result = + new com.google.bigtable.v2.TelemetryConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TelemetryConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.debugTagLevel_ = debugTagLevel_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TelemetryConfiguration) { + return mergeFrom((com.google.bigtable.v2.TelemetryConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TelemetryConfiguration other) { + if (other == com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance()) return this; + if (other.debugTagLevel_ != 0) { + setDebugTagLevelValue(other.getDebugTagLevelValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + debugTagLevel_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int debugTagLevel_ = 0; + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + @java.lang.Override + public int getDebugTagLevelValue() { + return debugTagLevel_; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @param value The enum numeric value on the wire for debugTagLevel to set. + * @return This builder for chaining. + */ + public Builder setDebugTagLevelValue(int value) { + debugTagLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel() { + com.google.bigtable.v2.TelemetryConfiguration.Level result = + com.google.bigtable.v2.TelemetryConfiguration.Level.forNumber(debugTagLevel_); + return result == null + ? com.google.bigtable.v2.TelemetryConfiguration.Level.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @param value The debugTagLevel to set. + * @return This builder for chaining. + */ + public Builder setDebugTagLevel(com.google.bigtable.v2.TelemetryConfiguration.Level value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + debugTagLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearDebugTagLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + debugTagLevel_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TelemetryConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TelemetryConfiguration) + private static final com.google.bigtable.v2.TelemetryConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TelemetryConfiguration(); + } + + public static com.google.bigtable.v2.TelemetryConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TelemetryConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TelemetryConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java new file mode 100644 index 000000000000..457c8e594c37 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TelemetryConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TelemetryConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + int getDebugTagLevelValue(); + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java new file mode 100644 index 000000000000..126781fa7189 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java @@ -0,0 +1,597 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specified a contiguous range of microsecond timestamps.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TimestampRange} + */ +@com.google.protobuf.Generated +public final class TimestampRange extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TimestampRange) + TimestampRangeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TimestampRange"); + } + + // Use TimestampRange.newBuilder() to construct. + private TimestampRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TimestampRange() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_TimestampRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TimestampRange.class, + com.google.bigtable.v2.TimestampRange.Builder.class); + } + + public static final int START_TIMESTAMP_MICROS_FIELD_NUMBER = 1; + private long startTimestampMicros_ = 0L; + + /** + * + * + *
+   * Inclusive lower bound. If left empty, interpreted as 0.
+   * 
+ * + * int64 start_timestamp_micros = 1; + * + * @return The startTimestampMicros. + */ + @java.lang.Override + public long getStartTimestampMicros() { + return startTimestampMicros_; + } + + public static final int END_TIMESTAMP_MICROS_FIELD_NUMBER = 2; + private long endTimestampMicros_ = 0L; + + /** + * + * + *
+   * Exclusive upper bound. If left empty, interpreted as infinity.
+   * 
+ * + * int64 end_timestamp_micros = 2; + * + * @return The endTimestampMicros. + */ + @java.lang.Override + public long getEndTimestampMicros() { + return endTimestampMicros_; + } + + 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 (startTimestampMicros_ != 0L) { + output.writeInt64(1, startTimestampMicros_); + } + if (endTimestampMicros_ != 0L) { + output.writeInt64(2, endTimestampMicros_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTimestampMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, startTimestampMicros_); + } + if (endTimestampMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, endTimestampMicros_); + } + size += getUnknownFields().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.TimestampRange)) { + return super.equals(obj); + } + com.google.bigtable.v2.TimestampRange other = (com.google.bigtable.v2.TimestampRange) obj; + + if (getStartTimestampMicros() != other.getStartTimestampMicros()) return false; + if (getEndTimestampMicros() != other.getEndTimestampMicros()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + START_TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStartTimestampMicros()); + hash = (37 * hash) + END_TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEndTimestampMicros()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TimestampRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TimestampRange 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.TimestampRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TimestampRange 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.TimestampRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TimestampRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TimestampRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TimestampRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TimestampRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TimestampRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TimestampRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TimestampRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.TimestampRange 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specified a contiguous range of microsecond timestamps.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TimestampRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TimestampRange) + com.google.bigtable.v2.TimestampRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_TimestampRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TimestampRange.class, + com.google.bigtable.v2.TimestampRange.Builder.class); + } + + // Construct using com.google.bigtable.v2.TimestampRange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTimestampMicros_ = 0L; + endTimestampMicros_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_TimestampRange_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TimestampRange getDefaultInstanceForType() { + return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TimestampRange build() { + com.google.bigtable.v2.TimestampRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TimestampRange buildPartial() { + com.google.bigtable.v2.TimestampRange result = + new com.google.bigtable.v2.TimestampRange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TimestampRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTimestampMicros_ = startTimestampMicros_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTimestampMicros_ = endTimestampMicros_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TimestampRange) { + return mergeFrom((com.google.bigtable.v2.TimestampRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TimestampRange other) { + if (other == com.google.bigtable.v2.TimestampRange.getDefaultInstance()) return this; + if (other.getStartTimestampMicros() != 0L) { + setStartTimestampMicros(other.getStartTimestampMicros()); + } + if (other.getEndTimestampMicros() != 0L) { + setEndTimestampMicros(other.getEndTimestampMicros()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + startTimestampMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + endTimestampMicros_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long startTimestampMicros_; + + /** + * + * + *
+     * Inclusive lower bound. If left empty, interpreted as 0.
+     * 
+ * + * int64 start_timestamp_micros = 1; + * + * @return The startTimestampMicros. + */ + @java.lang.Override + public long getStartTimestampMicros() { + return startTimestampMicros_; + } + + /** + * + * + *
+     * Inclusive lower bound. If left empty, interpreted as 0.
+     * 
+ * + * int64 start_timestamp_micros = 1; + * + * @param value The startTimestampMicros to set. + * @return This builder for chaining. + */ + public Builder setStartTimestampMicros(long value) { + + startTimestampMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Inclusive lower bound. If left empty, interpreted as 0.
+     * 
+ * + * int64 start_timestamp_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartTimestampMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + startTimestampMicros_ = 0L; + onChanged(); + return this; + } + + private long endTimestampMicros_; + + /** + * + * + *
+     * Exclusive upper bound. If left empty, interpreted as infinity.
+     * 
+ * + * int64 end_timestamp_micros = 2; + * + * @return The endTimestampMicros. + */ + @java.lang.Override + public long getEndTimestampMicros() { + return endTimestampMicros_; + } + + /** + * + * + *
+     * Exclusive upper bound. If left empty, interpreted as infinity.
+     * 
+ * + * int64 end_timestamp_micros = 2; + * + * @param value The endTimestampMicros to set. + * @return This builder for chaining. + */ + public Builder setEndTimestampMicros(long value) { + + endTimestampMicros_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Exclusive upper bound. If left empty, interpreted as infinity.
+     * 
+ * + * int64 end_timestamp_micros = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndTimestampMicros() { + bitField0_ = (bitField0_ & ~0x00000002); + endTimestampMicros_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TimestampRange) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TimestampRange) + private static final com.google.bigtable.v2.TimestampRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TimestampRange(); + } + + public static com.google.bigtable.v2.TimestampRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TimestampRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java new file mode 100644 index 000000000000..9cf786064378 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TimestampRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TimestampRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Inclusive lower bound. If left empty, interpreted as 0.
+   * 
+ * + * int64 start_timestamp_micros = 1; + * + * @return The startTimestampMicros. + */ + long getStartTimestampMicros(); + + /** + * + * + *
+   * Exclusive upper bound. If left empty, interpreted as infinity.
+   * 
+ * + * int64 end_timestamp_micros = 2; + * + * @return The endTimestampMicros. + */ + long getEndTimestampMicros(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java new file mode 100644 index 000000000000..74f0dda1dc00 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java @@ -0,0 +1,28896 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * `Type` represents the type of data that is written to, read from, or stored
+ * in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
+ * familiarity and consistency across products and features.
+ *
+ * For compatibility with Bigtable's existing untyped APIs, each `Type` includes
+ * an `Encoding` which describes how to convert to or from the underlying data.
+ *
+ * Each encoding can operate in one of two modes:
+ *
+ * - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
+ * if and only if `X <= Y`. This is useful anywhere sort order is important,
+ * for example when encoding keys.
+ * - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
+ * `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
+ * example, both `{'foo': '1', 'bar': '2'}` and `{'bar': '2', 'foo': '1'}`
+ * are valid encodings of the same JSON value.
+ *
+ * The API clearly documents which mode is used wherever an encoding can be
+ * configured. Each encoding also documents which values are supported in which
+ * modes. For example, when encoding INT64 as a numeric STRING, negative numbers
+ * cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
+ * `STRING("-00001") > STRING("00001")`.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Type} + */ +@com.google.protobuf.Generated +public final class Type extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type) + TypeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + // Use Type.newBuilder() to construct. + private Type(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Type() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto.internal_static_google_bigtable_v2_Type_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.class, com.google.bigtable.v2.Type.Builder.class); + } + + public interface BytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Bytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.v2.Type.Bytes.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Bytes
+   * Values of type `Bytes` are stored in `Value.bytes_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes} + */ + public static final class Bytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes) + BytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Bytes"); + } + + // Use Bytes.newBuilder() to construct. + private Bytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Bytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.class, + com.google.bigtable.v2.Type.Bytes.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Bytes.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + boolean hasRaw(); + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + com.google.bigtable.v2.Type.Bytes.Encoding.Raw getRaw(); + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder(); + + com.google.bigtable.v2.Type.Bytes.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.Encoding.class, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder.class); + } + + public interface RawOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Bytes.Encoding.Raw) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value which only contains the
+         * null byte `0x00`, has one more null byte appended.
+         * 
+ * + * bool escape_nulls = 1; + * + * @return The escapeNulls. + */ + boolean getEscapeNulls(); + } + + /** + * + * + *
+       * Leaves the value as-is.
+       *
+       * Sorted mode: all values are supported.
+       *
+       * Distinct mode: all values are supported.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Raw extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes.Encoding.Raw) + RawOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Raw"); + } + + // Use Raw.newBuilder() to construct. + private Raw(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Raw() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.class, + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder.class); + } + + public static final int ESCAPE_NULLS_FIELD_NUMBER = 1; + private boolean escapeNulls_ = false; + + /** + * + * + *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value which only contains the
+         * null byte `0x00`, has one more null byte appended.
+         * 
+ * + * bool escape_nulls = 1; + * + * @return The escapeNulls. + */ + @java.lang.Override + public boolean getEscapeNulls() { + return escapeNulls_; + } + + 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 (escapeNulls_ != false) { + output.writeBool(1, escapeNulls_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (escapeNulls_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, escapeNulls_); + } + size += getUnknownFields().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.Type.Bytes.Encoding.Raw)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Bytes.Encoding.Raw other = + (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) obj; + + if (getEscapeNulls() != other.getEscapeNulls()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ESCAPE_NULLS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEscapeNulls()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw 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.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw 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.Type.Bytes.Encoding.Raw parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Bytes.Encoding.Raw 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Leaves the value as-is.
+         *
+         * Sorted mode: all values are supported.
+         *
+         * Distinct mode: all values are supported.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Bytes.Encoding.Raw) + com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.class, + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Bytes.Encoding.Raw.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + escapeNulls_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw build() { + com.google.bigtable.v2.Type.Bytes.Encoding.Raw result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw buildPartial() { + com.google.bigtable.v2.Type.Bytes.Encoding.Raw result = + new com.google.bigtable.v2.Type.Bytes.Encoding.Raw(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Bytes.Encoding.Raw result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.escapeNulls_ = escapeNulls_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Bytes.Encoding.Raw) { + return mergeFrom((com.google.bigtable.v2.Type.Bytes.Encoding.Raw) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Bytes.Encoding.Raw other) { + if (other == com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) + return this; + if (other.getEscapeNulls() != false) { + setEscapeNulls(other.getEscapeNulls()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + escapeNulls_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean escapeNulls_; + + /** + * + * + *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value which only contains the
+           * null byte `0x00`, has one more null byte appended.
+           * 
+ * + * bool escape_nulls = 1; + * + * @return The escapeNulls. + */ + @java.lang.Override + public boolean getEscapeNulls() { + return escapeNulls_; + } + + /** + * + * + *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value which only contains the
+           * null byte `0x00`, has one more null byte appended.
+           * 
+ * + * bool escape_nulls = 1; + * + * @param value The escapeNulls to set. + * @return This builder for chaining. + */ + public Builder setEscapeNulls(boolean value) { + + escapeNulls_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value which only contains the
+           * null byte `0x00`, has one more null byte appended.
+           * 
+ * + * bool escape_nulls = 1; + * + * @return This builder for chaining. + */ + public Builder clearEscapeNulls() { + bitField0_ = (bitField0_ & ~0x00000001); + escapeNulls_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Bytes.Encoding.Raw) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Bytes.Encoding.Raw) + private static final com.google.bigtable.v2.Type.Bytes.Encoding.Raw DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Bytes.Encoding.Raw(); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding.Raw getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Raw parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Bytes.Encoding.Raw getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAW(1), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return RAW; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int RAW_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + @java.lang.Override + public boolean hasRaw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw getRaw() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Raw` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_); + } + size += getUnknownFields().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.Type.Bytes.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Bytes.Encoding other = + (com.google.bigtable.v2.Type.Bytes.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getRaw().equals(other.getRaw())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + RAW_FIELD_NUMBER; + hash = (53 * hash) + getRaw().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding 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.Type.Bytes.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding 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.Type.Bytes.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Bytes.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Bytes.Encoding) + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.Encoding.class, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Bytes.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rawBuilder_ != null) { + rawBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding build() { + com.google.bigtable.v2.Type.Bytes.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding buildPartial() { + com.google.bigtable.v2.Type.Bytes.Encoding result = + new com.google.bigtable.v2.Type.Bytes.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Bytes.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.Bytes.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && rawBuilder_ != null) { + result.encoding_ = rawBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Bytes.Encoding) { + return mergeFrom((com.google.bigtable.v2.Type.Bytes.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Bytes.Encoding other) { + if (other == com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance()) return this; + switch (other.getEncodingCase()) { + case RAW: + { + mergeRaw(other.getRaw()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetRawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder> + rawBuilder_; + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return Whether the raw field is set. + */ + @java.lang.Override + public boolean hasRaw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + * + * @return The raw. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw getRaw() { + if (rawBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return rawBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder setRaw(com.google.bigtable.v2.Type.Bytes.Encoding.Raw value) { + if (rawBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + rawBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder setRaw( + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder builderForValue) { + if (rawBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + rawBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder mergeRaw(com.google.bigtable.v2.Type.Bytes.Encoding.Raw value) { + if (rawBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.newBuilder( + (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + rawBuilder_.mergeFrom(value); + } else { + rawBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public Builder clearRaw() { + if (rawBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + rawBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + public com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder getRawBuilder() { + return internalGetRawFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder getRawOrBuilder() { + if ((encodingCase_ == 1) && (rawBuilder_ != null)) { + return rawBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_; + } + return com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Raw` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder> + internalGetRawFieldBuilder() { + if (rawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + rawBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding.Raw, + com.google.bigtable.v2.Type.Bytes.Encoding.Raw.Builder, + com.google.bigtable.v2.Type.Bytes.Encoding.RawOrBuilder>( + (com.google.bigtable.v2.Type.Bytes.Encoding.Raw) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return rawBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Bytes.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Bytes.Encoding) + private static final com.google.bigtable.v2.Type.Bytes.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Bytes.Encoding(); + } + + public static com.google.bigtable.v2.Type.Bytes.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Bytes.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type.Bytes.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.Type.Bytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Bytes other = (com.google.bigtable.v2.Type.Bytes) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes 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.Type.Bytes parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes 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.Type.Bytes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Bytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Bytes
+     * Values of type `Bytes` are stored in `Value.bytes_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bytes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Bytes) + com.google.bigtable.v2.Type.BytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bytes.class, + com.google.bigtable.v2.Type.Bytes.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Bytes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes build() { + com.google.bigtable.v2.Type.Bytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes buildPartial() { + com.google.bigtable.v2.Type.Bytes result = new com.google.bigtable.v2.Type.Bytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Bytes result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Bytes) { + return mergeFrom((com.google.bigtable.v2.Type.Bytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Bytes other) { + if (other == com.google.bigtable.v2.Type.Bytes.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type.Bytes.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.v2.Type.Bytes.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.v2.Type.Bytes.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.v2.Type.Bytes.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.v2.Type.Bytes.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ != com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Bytes.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.v2.Type.Bytes.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes.Encoding, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Bytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Bytes) + private static final com.google.bigtable.v2.Type.Bytes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Bytes(); + } + + public static com.google.bigtable.v2.Type.Bytes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Bytes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StringOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.String) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.v2.Type.String.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + com.google.bigtable.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * String
+   * Values of type `String` are stored in `Value.string_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String} + */ + public static final class String extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String) + StringOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "String"); + } + + // Use String.newBuilder() to construct. + private String(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private String() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.class, + com.google.bigtable.v2.Type.String.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.String.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Deprecated + boolean hasUtf8Raw(); + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return The utf8Raw. + */ + @java.lang.Deprecated + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw getUtf8Raw(); + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder getUtf8RawOrBuilder(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + boolean hasUtf8Bytes(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes(); + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder getUtf8BytesOrBuilder(); + + com.google.bigtable.v2.Type.String.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.class, + com.google.bigtable.v2.Type.String.Encoding.Builder.class); + } + + @java.lang.Deprecated + public interface Utf8RawOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Deprecated: prefer the equivalent `Utf8Bytes`.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding.Utf8Raw} + */ + @java.lang.Deprecated + public static final class Utf8Raw extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + Utf8RawOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Utf8Raw"); + } + + // Use Utf8Raw.newBuilder() to construct. + private Utf8Raw(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Utf8Raw() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.class, + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.String.Encoding.Utf8Raw)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw other = + (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw 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.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw 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.Type.String.Encoding.Utf8Raw parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.String.Encoding.Utf8Raw 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Deprecated: prefer the equivalent `Utf8Bytes`.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding.Utf8Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.class, + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw build() { + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw buildPartial() { + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw result = + new com.google.bigtable.v2.Type.String.Encoding.Utf8Raw(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) { + return mergeFrom((com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.String.Encoding.Utf8Raw other) { + if (other == com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + private static final com.google.bigtable.v2.Type.String.Encoding.Utf8Raw DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.String.Encoding.Utf8Raw(); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Raw getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Utf8Raw parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.String.Encoding.Utf8Raw getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Utf8BytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Single-character escape sequence used to support NULL values.
+         *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value where every character equals
+         * `null_escape_char`, has one more `null_escape_char` appended.
+         *
+         * If `null_escape_char` is set and does not equal the ASCII null
+         * character `0x00`, then the encoding will not support sorted mode.
+         *
+         * .
+         * 
+ * + * string null_escape_char = 1; + * + * @return The nullEscapeChar. + */ + java.lang.String getNullEscapeChar(); + + /** + * + * + *
+         * Single-character escape sequence used to support NULL values.
+         *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value where every character equals
+         * `null_escape_char`, has one more `null_escape_char` appended.
+         *
+         * If `null_escape_char` is set and does not equal the ASCII null
+         * character `0x00`, then the encoding will not support sorted mode.
+         *
+         * .
+         * 
+ * + * string null_escape_char = 1; + * + * @return The bytes for nullEscapeChar. + */ + com.google.protobuf.ByteString getNullEscapeCharBytes(); + } + + /** + * + * + *
+       * UTF-8 encoding.
+       *
+       * Sorted mode:
+       * - All values are supported.
+       * - Code point order is preserved.
+       *
+       * Distinct mode: all values are supported.
+       *
+       * Compatible with:
+       *
+       * - BigQuery `TEXT` encoding
+       * - HBase `Bytes.toBytes`
+       * - Java `String#getBytes(StandardCharsets.UTF_8)`
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding.Utf8Bytes} + */ + public static final class Utf8Bytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + Utf8BytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Utf8Bytes"); + } + + // Use Utf8Bytes.newBuilder() to construct. + private Utf8Bytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Utf8Bytes() { + nullEscapeChar_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.class, + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder.class); + } + + public static final int NULL_ESCAPE_CHAR_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object nullEscapeChar_ = ""; + + /** + * + * + *
+         * Single-character escape sequence used to support NULL values.
+         *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value where every character equals
+         * `null_escape_char`, has one more `null_escape_char` appended.
+         *
+         * If `null_escape_char` is set and does not equal the ASCII null
+         * character `0x00`, then the encoding will not support sorted mode.
+         *
+         * .
+         * 
+ * + * string null_escape_char = 1; + * + * @return The nullEscapeChar. + */ + @java.lang.Override + public java.lang.String getNullEscapeChar() { + java.lang.Object ref = nullEscapeChar_; + 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(); + nullEscapeChar_ = s; + return s; + } + } + + /** + * + * + *
+         * Single-character escape sequence used to support NULL values.
+         *
+         * If set, allows NULL values to be encoded as the empty string "".
+         *
+         * The actual empty string, or any value where every character equals
+         * `null_escape_char`, has one more `null_escape_char` appended.
+         *
+         * If `null_escape_char` is set and does not equal the ASCII null
+         * character `0x00`, then the encoding will not support sorted mode.
+         *
+         * .
+         * 
+ * + * string null_escape_char = 1; + * + * @return The bytes for nullEscapeChar. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNullEscapeCharBytes() { + java.lang.Object ref = nullEscapeChar_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nullEscapeChar_ = 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.GeneratedMessage.isStringEmpty(nullEscapeChar_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, nullEscapeChar_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nullEscapeChar_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, nullEscapeChar_); + } + size += getUnknownFields().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.Type.String.Encoding.Utf8Bytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes other = + (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) obj; + + if (!getNullEscapeChar().equals(other.getNullEscapeChar())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NULL_ESCAPE_CHAR_FIELD_NUMBER; + hash = (53 * hash) + getNullEscapeChar().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes 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.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes 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.Type.String.Encoding.Utf8Bytes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.String.Encoding.Utf8Bytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * UTF-8 encoding.
+         *
+         * Sorted mode:
+         * - All values are supported.
+         * - Code point order is preserved.
+         *
+         * Distinct mode: all values are supported.
+         *
+         * Compatible with:
+         *
+         * - BigQuery `TEXT` encoding
+         * - HBase `Bytes.toBytes`
+         * - Java `String#getBytes(StandardCharsets.UTF_8)`
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding.Utf8Bytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.class, + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nullEscapeChar_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes build() { + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes buildPartial() { + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes result = + new com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nullEscapeChar_ = nullEscapeChar_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) { + return mergeFrom((com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes other) { + if (other == com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance()) + return this; + if (!other.getNullEscapeChar().isEmpty()) { + nullEscapeChar_ = other.nullEscapeChar_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + nullEscapeChar_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object nullEscapeChar_ = ""; + + /** + * + * + *
+           * Single-character escape sequence used to support NULL values.
+           *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value where every character equals
+           * `null_escape_char`, has one more `null_escape_char` appended.
+           *
+           * If `null_escape_char` is set and does not equal the ASCII null
+           * character `0x00`, then the encoding will not support sorted mode.
+           *
+           * .
+           * 
+ * + * string null_escape_char = 1; + * + * @return The nullEscapeChar. + */ + public java.lang.String getNullEscapeChar() { + java.lang.Object ref = nullEscapeChar_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nullEscapeChar_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+           * Single-character escape sequence used to support NULL values.
+           *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value where every character equals
+           * `null_escape_char`, has one more `null_escape_char` appended.
+           *
+           * If `null_escape_char` is set and does not equal the ASCII null
+           * character `0x00`, then the encoding will not support sorted mode.
+           *
+           * .
+           * 
+ * + * string null_escape_char = 1; + * + * @return The bytes for nullEscapeChar. + */ + public com.google.protobuf.ByteString getNullEscapeCharBytes() { + java.lang.Object ref = nullEscapeChar_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nullEscapeChar_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+           * Single-character escape sequence used to support NULL values.
+           *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value where every character equals
+           * `null_escape_char`, has one more `null_escape_char` appended.
+           *
+           * If `null_escape_char` is set and does not equal the ASCII null
+           * character `0x00`, then the encoding will not support sorted mode.
+           *
+           * .
+           * 
+ * + * string null_escape_char = 1; + * + * @param value The nullEscapeChar to set. + * @return This builder for chaining. + */ + public Builder setNullEscapeChar(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nullEscapeChar_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Single-character escape sequence used to support NULL values.
+           *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value where every character equals
+           * `null_escape_char`, has one more `null_escape_char` appended.
+           *
+           * If `null_escape_char` is set and does not equal the ASCII null
+           * character `0x00`, then the encoding will not support sorted mode.
+           *
+           * .
+           * 
+ * + * string null_escape_char = 1; + * + * @return This builder for chaining. + */ + public Builder clearNullEscapeChar() { + nullEscapeChar_ = getDefaultInstance().getNullEscapeChar(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+           * Single-character escape sequence used to support NULL values.
+           *
+           * If set, allows NULL values to be encoded as the empty string "".
+           *
+           * The actual empty string, or any value where every character equals
+           * `null_escape_char`, has one more `null_escape_char` appended.
+           *
+           * If `null_escape_char` is set and does not equal the ASCII null
+           * character `0x00`, then the encoding will not support sorted mode.
+           *
+           * .
+           * 
+ * + * string null_escape_char = 1; + * + * @param value The bytes for nullEscapeChar to set. + * @return This builder for chaining. + */ + public Builder setNullEscapeCharBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nullEscapeChar_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + private static final com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes(); + } + + public static com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Utf8Bytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.String.Encoding.Utf8Bytes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + @java.lang.Deprecated + UTF8_RAW(1), + UTF8_BYTES(2), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return UTF8_RAW; + case 2: + return UTF8_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int UTF8_RAW_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasUtf8Raw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return The utf8Raw. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw getUtf8Raw() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + /** + * + * + *
+       * Deprecated: if set, converts to an empty `utf8_bytes`.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder getUtf8RawOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + + public static final int UTF8_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + @java.lang.Override + public boolean hasUtf8Bytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Utf8Bytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder + getUtf8BytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_); + } + size += getUnknownFields().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.Type.String.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.String.Encoding other = + (com.google.bigtable.v2.Type.String.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getUtf8Raw().equals(other.getUtf8Raw())) return false; + break; + case 2: + if (!getUtf8Bytes().equals(other.getUtf8Bytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + UTF8_RAW_FIELD_NUMBER; + hash = (53 * hash) + getUtf8Raw().hashCode(); + break; + case 2: + hash = (37 * hash) + UTF8_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getUtf8Bytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding 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.Type.String.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding 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.Type.String.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.String.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.String.Encoding) + com.google.bigtable.v2.Type.String.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.Encoding.class, + com.google.bigtable.v2.Type.String.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.String.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (utf8RawBuilder_ != null) { + utf8RawBuilder_.clear(); + } + if (utf8BytesBuilder_ != null) { + utf8BytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding build() { + com.google.bigtable.v2.Type.String.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding buildPartial() { + com.google.bigtable.v2.Type.String.Encoding result = + new com.google.bigtable.v2.Type.String.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.String.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.String.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && utf8RawBuilder_ != null) { + result.encoding_ = utf8RawBuilder_.build(); + } + if (encodingCase_ == 2 && utf8BytesBuilder_ != null) { + result.encoding_ = utf8BytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.String.Encoding) { + return mergeFrom((com.google.bigtable.v2.Type.String.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.String.Encoding other) { + if (other == com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case UTF8_RAW: + { + mergeUtf8Raw(other.getUtf8Raw()); + break; + } + case UTF8_BYTES: + { + mergeUtf8Bytes(other.getUtf8Bytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetUtf8RawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUtf8BytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder> + utf8RawBuilder_; + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return Whether the utf8Raw field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasUtf8Raw() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.Type.String.Encoding.utf8_raw is deprecated. See + * google/bigtable/v2/types.proto;l=121 + * @return The utf8Raw. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw getUtf8Raw() { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return utf8RawBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setUtf8Raw(com.google.bigtable.v2.Type.String.Encoding.Utf8Raw value) { + if (utf8RawBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + utf8RawBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setUtf8Raw( + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder builderForValue) { + if (utf8RawBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + utf8RawBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeUtf8Raw(com.google.bigtable.v2.Type.String.Encoding.Utf8Raw value) { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.newBuilder( + (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + utf8RawBuilder_.mergeFrom(value); + } else { + utf8RawBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearUtf8Raw() { + if (utf8RawBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + utf8RawBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder getUtf8RawBuilder() { + return internalGetUtf8RawFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder getUtf8RawOrBuilder() { + if ((encodingCase_ == 1) && (utf8RawBuilder_ != null)) { + return utf8RawBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Deprecated: if set, converts to an empty `utf8_bytes`.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Raw utf8_raw = 1 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder> + internalGetUtf8RawFieldBuilder() { + if (utf8RawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + utf8RawBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw, + com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8RawOrBuilder>( + (com.google.bigtable.v2.Type.String.Encoding.Utf8Raw) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return utf8RawBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder> + utf8BytesBuilder_; + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return Whether the utf8Bytes field is set. + */ + @java.lang.Override + public boolean hasUtf8Bytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + * + * @return The utf8Bytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes getUtf8Bytes() { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return utf8BytesBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder setUtf8Bytes(com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes value) { + if (utf8BytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + utf8BytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder setUtf8Bytes( + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder builderForValue) { + if (utf8BytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + utf8BytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder mergeUtf8Bytes(com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes value) { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.newBuilder( + (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + utf8BytesBuilder_.mergeFrom(value); + } else { + utf8BytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public Builder clearUtf8Bytes() { + if (utf8BytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + utf8BytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + public com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder getUtf8BytesBuilder() { + return internalGetUtf8BytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder + getUtf8BytesOrBuilder() { + if ((encodingCase_ == 2) && (utf8BytesBuilder_ != null)) { + return utf8BytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_; + } + return com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Utf8Bytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.String.Encoding.Utf8Bytes utf8_bytes = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder> + internalGetUtf8BytesFieldBuilder() { + if (utf8BytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + utf8BytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes, + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.Builder, + com.google.bigtable.v2.Type.String.Encoding.Utf8BytesOrBuilder>( + (com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return utf8BytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.String.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.String.Encoding) + private static final com.google.bigtable.v2.Type.String.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.String.Encoding(); + } + + public static com.google.bigtable.v2.Type.String.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.String.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type.String.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.Type.String)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.String other = (com.google.bigtable.v2.Type.String) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.String parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String 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.Type.String parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String 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.Type.String parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.String parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.String parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.String parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.String 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * String
+     * Values of type `String` are stored in `Value.string_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.String} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.String) + com.google.bigtable.v2.Type.StringOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.String.class, + com.google.bigtable.v2.Type.String.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.String.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_String_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String build() { + com.google.bigtable.v2.Type.String result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.String buildPartial() { + com.google.bigtable.v2.Type.String result = new com.google.bigtable.v2.Type.String(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.String result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.String) { + return mergeFrom((com.google.bigtable.v2.Type.String) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.String other) { + if (other == com.google.bigtable.v2.Type.String.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type.String.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding, + com.google.bigtable.v2.Type.String.Encoding.Builder, + com.google.bigtable.v2.Type.String.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.v2.Type.String.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.v2.Type.String.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.v2.Type.String.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.v2.Type.String.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ != com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.String.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.String.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.v2.Type.String.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding, + com.google.bigtable.v2.Type.String.Encoding.Builder, + com.google.bigtable.v2.Type.String.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String.Encoding, + com.google.bigtable.v2.Type.String.Encoding.Builder, + com.google.bigtable.v2.Type.String.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.String) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.String) + private static final com.google.bigtable.v2.Type.String DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.String(); + } + + public static com.google.bigtable.v2.Type.String getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public String parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.String getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Int64OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Int64) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.v2.Type.Int64.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Int64
+   * Values of type `Int64` are stored in `Value.int_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64} + */ + public static final class Int64 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64) + Int64OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Int64"); + } + + // Use Int64.newBuilder() to construct. + private Int64(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Int64() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.class, + com.google.bigtable.v2.Type.Int64.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Int64.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return Whether the bigEndianBytes field is set. + */ + boolean hasBigEndianBytes(); + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return The bigEndianBytes. + */ + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes(); + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + boolean hasOrderedCodeBytes(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes getOrderedCodeBytes(); + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder(); + + com.google.bigtable.v2.Type.Int64.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.class, + com.google.bigtable.v2.Type.Int64.Encoding.Builder.class); + } + + public interface BigEndianBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return Whether the bytesType field is set. + */ + @java.lang.Deprecated + boolean hasBytesType(); + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return The bytesType. + */ + @java.lang.Deprecated + com.google.bigtable.v2.Type.Bytes getBytesType(); + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + } + + /** + * + * + *
+       * Encodes the value as an 8-byte big-endian two's complement value.
+       *
+       * Sorted mode: non-negative values are supported.
+       *
+       * Distinct mode: all values are supported.
+       *
+       * Compatible with:
+       *
+       * - BigQuery `BINARY` encoding
+       * - HBase `Bytes.toBytes`
+       * - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} + */ + public static final class BigEndianBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + BigEndianBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BigEndianBytes"); + } + + // Use BigEndianBytes.newBuilder() to construct. + private BigEndianBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BigEndianBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.class, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder.class); + } + + private int bitField0_; + public static final int BYTES_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type.Bytes bytesType_; + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return Whether the bytesType field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return The bytesType. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.Bytes getBytesType() { + return bytesType_ == null + ? com.google.bigtable.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + + /** + * + * + *
+         * Deprecated: ignored if set.
+         * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + return bytesType_ == null + ? com.google.bigtable.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBytesType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBytesType()); + } + size += getUnknownFields().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.Type.Int64.Encoding.BigEndianBytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes other = + (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) obj; + + if (hasBytesType() != other.hasBytesType()) return false; + if (hasBytesType()) { + if (!getBytesType().equals(other.getBytesType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBytesType()) { + hash = (37 * hash) + BYTES_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes 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.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes 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.Type.Int64.Encoding.BigEndianBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Int64.Encoding.BigEndianBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Encodes the value as an 8-byte big-endian two's complement value.
+         *
+         * Sorted mode: non-negative values are supported.
+         *
+         * Distinct mode: all values are supported.
+         *
+         * Compatible with:
+         *
+         * - BigQuery `BINARY` encoding
+         * - HBase `Bytes.toBytes`
+         * - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN`
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.class, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBytesTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bytesType_ = null; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.dispose(); + bytesTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes build() { + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes buildPartial() { + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes result = + new com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bytesType_ = + bytesTypeBuilder_ == null ? bytesType_ : bytesTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) { + return mergeFrom((com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes other) { + if (other + == com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance()) + return this; + if (other.hasBytesType()) { + mergeBytesType(other.getBytesType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type.Bytes bytesType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + bytesTypeBuilder_; + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return Whether the bytesType field is set. + */ + @java.lang.Deprecated + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + * + * @deprecated google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.bytes_type is + * deprecated. See google/bigtable/v2/types.proto;l=150 + * @return The bytesType. + */ + @java.lang.Deprecated + public com.google.bigtable.v2.Type.Bytes getBytesType() { + if (bytesTypeBuilder_ == null) { + return bytesType_ == null + ? com.google.bigtable.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } else { + return bytesTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setBytesType(com.google.bigtable.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bytesType_ = value; + } else { + bytesTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setBytesType(com.google.bigtable.v2.Type.Bytes.Builder builderForValue) { + if (bytesTypeBuilder_ == null) { + bytesType_ = builderForValue.build(); + } else { + bytesTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergeBytesType(com.google.bigtable.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && bytesType_ != null + && bytesType_ != com.google.bigtable.v2.Type.Bytes.getDefaultInstance()) { + getBytesTypeBuilder().mergeFrom(value); + } else { + bytesType_ = value; + } + } else { + bytesTypeBuilder_.mergeFrom(value); + } + if (bytesType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearBytesType() { + bitField0_ = (bitField0_ & ~0x00000001); + bytesType_ = null; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.dispose(); + bytesTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.bigtable.v2.Type.Bytes.Builder getBytesTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBytesTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if (bytesTypeBuilder_ != null) { + return bytesTypeBuilder_.getMessageOrBuilder(); + } else { + return bytesType_ == null + ? com.google.bigtable.v2.Type.Bytes.getDefaultInstance() + : bytesType_; + } + } + + /** + * + * + *
+           * Deprecated: ignored if set.
+           * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + internalGetBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder>( + getBytesType(), getParentForChildren(), isClean()); + bytesType_ = null; + } + return bytesTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + private static final com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes(); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigEndianBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Int64.Encoding.BigEndianBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OrderedCodeBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Encodes the value in a variable length binary format of up to 10 bytes.
+       * Values that are closer to zero use fewer bytes.
+       *
+       * Sorted mode: all values are supported.
+       *
+       * Distinct mode: all values are supported.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} + */ + public static final class OrderedCodeBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + OrderedCodeBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OrderedCodeBytes"); + } + + // Use OrderedCodeBytes.newBuilder() to construct. + private OrderedCodeBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OrderedCodeBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.class, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Int64.Encoding.OrderedCodeBytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes other = + (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes 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.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes 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.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Int64.Encoding.OrderedCodeBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Encodes the value in a variable length binary format of up to 10 bytes.
+         * Values that are closer to zero use fewer bytes.
+         *
+         * Sorted mode: all values are supported.
+         *
+         * Distinct mode: all values are supported.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.class, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes build() { + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes buildPartial() { + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes result = + new com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) { + return mergeFrom((com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes other) { + if (other + == com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) + private static final com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes(); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrderedCodeBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Int64.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIG_ENDIAN_BYTES(1), + ORDERED_CODE_BYTES(2), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return BIG_ENDIAN_BYTES; + case 2: + return ORDERED_CODE_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int BIG_ENDIAN_BYTES_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return Whether the bigEndianBytes field is set. + */ + @java.lang.Override + public boolean hasBigEndianBytes() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return The bigEndianBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `BigEndianBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + + public static final int ORDERED_CODE_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes getOrderedCodeBytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_); + } + size += getUnknownFields().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.Type.Int64.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Int64.Encoding other = + (com.google.bigtable.v2.Type.Int64.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getBigEndianBytes().equals(other.getBigEndianBytes())) return false; + break; + case 2: + if (!getOrderedCodeBytes().equals(other.getOrderedCodeBytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + BIG_ENDIAN_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getBigEndianBytes().hashCode(); + break; + case 2: + hash = (37 * hash) + ORDERED_CODE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getOrderedCodeBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding 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.Type.Int64.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding 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.Type.Int64.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Int64.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Int64.Encoding) + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.Encoding.class, + com.google.bigtable.v2.Type.Int64.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Int64.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bigEndianBytesBuilder_ != null) { + bigEndianBytesBuilder_.clear(); + } + if (orderedCodeBytesBuilder_ != null) { + orderedCodeBytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding build() { + com.google.bigtable.v2.Type.Int64.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding buildPartial() { + com.google.bigtable.v2.Type.Int64.Encoding result = + new com.google.bigtable.v2.Type.Int64.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Int64.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.Int64.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && bigEndianBytesBuilder_ != null) { + result.encoding_ = bigEndianBytesBuilder_.build(); + } + if (encodingCase_ == 2 && orderedCodeBytesBuilder_ != null) { + result.encoding_ = orderedCodeBytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Int64.Encoding) { + return mergeFrom((com.google.bigtable.v2.Type.Int64.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Int64.Encoding other) { + if (other == com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance()) return this; + switch (other.getEncodingCase()) { + case BIG_ENDIAN_BYTES: + { + mergeBigEndianBytes(other.getBigEndianBytes()); + break; + } + case ORDERED_CODE_BYTES: + { + mergeOrderedCodeBytes(other.getOrderedCodeBytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBigEndianBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetOrderedCodeBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder> + bigEndianBytesBuilder_; + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return Whether the bigEndianBytes field is set. + */ + @java.lang.Override + public boolean hasBigEndianBytes() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + * + * @return The bigEndianBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes getBigEndianBytes() { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return bigEndianBytesBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + public Builder setBigEndianBytes( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes value) { + if (bigEndianBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + bigEndianBytesBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + public Builder setBigEndianBytes( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder builderForValue) { + if (bigEndianBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + bigEndianBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + public Builder mergeBigEndianBytes( + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes value) { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.newBuilder( + (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + bigEndianBytesBuilder_.mergeFrom(value); + } else { + bigEndianBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + public Builder clearBigEndianBytes() { + if (bigEndianBytesBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + bigEndianBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder + getBigEndianBytesBuilder() { + return internalGetBigEndianBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder + getBigEndianBytesOrBuilder() { + if ((encodingCase_ == 1) && (bigEndianBytesBuilder_ != null)) { + return bigEndianBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `BigEndianBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes big_endian_bytes = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder> + internalGetBigEndianBytesFieldBuilder() { + if (bigEndianBytesBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + bigEndianBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytesOrBuilder>( + (com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return bigEndianBytesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder> + orderedCodeBytesBuilder_; + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes getOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return orderedCodeBytesBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder builderForValue) { + if (orderedCodeBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder mergeOrderedCodeBytes( + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.newBuilder( + (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + orderedCodeBytesBuilder_.mergeFrom(value); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public Builder clearOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + orderedCodeBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder + getOrderedCodeBytesBuilder() { + return internalGetOrderedCodeBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if ((encodingCase_ == 2) && (orderedCodeBytesBuilder_ != null)) { + return orderedCodeBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes ordered_code_bytes = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder> + internalGetOrderedCodeBytesFieldBuilder() { + if (orderedCodeBytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + orderedCodeBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytesOrBuilder>( + (com.google.bigtable.v2.Type.Int64.Encoding.OrderedCodeBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return orderedCodeBytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Int64.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Int64.Encoding) + private static final com.google.bigtable.v2.Type.Int64.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Int64.Encoding(); + } + + public static com.google.bigtable.v2.Type.Int64.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Int64.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type.Int64.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.Type.Int64)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Int64 other = (com.google.bigtable.v2.Type.Int64) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64 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.Type.Int64 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64 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.Type.Int64 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Int64 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Int64 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Int64
+     * Values of type `Int64` are stored in `Value.int_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Int64} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Int64) + com.google.bigtable.v2.Type.Int64OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Int64.class, + com.google.bigtable.v2.Type.Int64.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Int64.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Int64_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64 getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64 build() { + com.google.bigtable.v2.Type.Int64 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Int64 buildPartial() { + com.google.bigtable.v2.Type.Int64 result = new com.google.bigtable.v2.Type.Int64(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Int64 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Int64) { + return mergeFrom((com.google.bigtable.v2.Type.Int64) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Int64 other) { + if (other == com.google.bigtable.v2.Type.Int64.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type.Int64.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.v2.Type.Int64.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.v2.Type.Int64.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.v2.Type.Int64.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.v2.Type.Int64.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ != com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Int64.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Int64) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Int64) + private static final com.google.bigtable.v2.Type.Int64 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Int64(); + } + + public static com.google.bigtable.v2.Type.Int64 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Int64 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoolOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Bool) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * bool
+   * Values of type `Bool` are stored in `Value.bool_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bool} + */ + public static final class Bool extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bool) + BoolOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Bool"); + } + + // Use Bool.newBuilder() to construct. + private Bool(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Bool() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bool.class, + com.google.bigtable.v2.Type.Bool.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Bool)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Bool other = (com.google.bigtable.v2.Type.Bool) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Bool parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bool 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.Type.Bool parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bool 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.Type.Bool parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Bool parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bool parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bool parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bool parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bool parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Bool parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Bool parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Bool 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * bool
+     * Values of type `Bool` are stored in `Value.bool_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Bool} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Bool) + com.google.bigtable.v2.Type.BoolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Bool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Bool.class, + com.google.bigtable.v2.Type.Bool.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Bool.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Bool_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bool getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bool build() { + com.google.bigtable.v2.Type.Bool result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Bool buildPartial() { + com.google.bigtable.v2.Type.Bool result = new com.google.bigtable.v2.Type.Bool(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Bool) { + return mergeFrom((com.google.bigtable.v2.Type.Bool) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Bool other) { + if (other == com.google.bigtable.v2.Type.Bool.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Bool) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Bool) + private static final com.google.bigtable.v2.Type.Bool DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Bool(); + } + + public static com.google.bigtable.v2.Type.Bool getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bool parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Bool getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Float32OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Float32) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Float32
+   * Values of type `Float32` are stored in `Value.float_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Float32} + */ + public static final class Float32 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Float32) + Float32OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Float32"); + } + + // Use Float32.newBuilder() to construct. + private Float32(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Float32() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float32_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float32_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Float32.class, + com.google.bigtable.v2.Type.Float32.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Float32)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Float32 other = (com.google.bigtable.v2.Type.Float32) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float32 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.Type.Float32 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float32 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.Type.Float32 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float32 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float32 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float32 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Float32 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Float32
+     * Values of type `Float32` are stored in `Value.float_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Float32} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Float32) + com.google.bigtable.v2.Type.Float32OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float32_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float32_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Float32.class, + com.google.bigtable.v2.Type.Float32.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Float32.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Float32_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float32 getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float32 build() { + com.google.bigtable.v2.Type.Float32 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float32 buildPartial() { + com.google.bigtable.v2.Type.Float32 result = new com.google.bigtable.v2.Type.Float32(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Float32) { + return mergeFrom((com.google.bigtable.v2.Type.Float32) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Float32 other) { + if (other == com.google.bigtable.v2.Type.Float32.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Float32) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Float32) + private static final com.google.bigtable.v2.Type.Float32 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Float32(); + } + + public static com.google.bigtable.v2.Type.Float32 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Float32 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Float32 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface Float64OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Float64) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Float64
+   * Values of type `Float64` are stored in `Value.float_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Float64} + */ + public static final class Float64 extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Float64) + Float64OrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Float64"); + } + + // Use Float64.newBuilder() to construct. + private Float64(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Float64() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Float64.class, + com.google.bigtable.v2.Type.Float64.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Float64)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Float64 other = (com.google.bigtable.v2.Type.Float64) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float64 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.Type.Float64 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float64 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.Type.Float64 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float64 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float64 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Float64 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Float64 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Float64
+     * Values of type `Float64` are stored in `Value.float_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Float64} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Float64) + com.google.bigtable.v2.Type.Float64OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float64_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Float64_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Float64.class, + com.google.bigtable.v2.Type.Float64.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Float64.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Float64_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float64 getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float64 build() { + com.google.bigtable.v2.Type.Float64 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Float64 buildPartial() { + com.google.bigtable.v2.Type.Float64 result = new com.google.bigtable.v2.Type.Float64(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Float64) { + return mergeFrom((com.google.bigtable.v2.Type.Float64) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Float64 other) { + if (other == com.google.bigtable.v2.Type.Float64.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Float64) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Float64) + private static final com.google.bigtable.v2.Type.Float64 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Float64(); + } + + public static com.google.bigtable.v2.Type.Float64 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Float64 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Float64 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimestampOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Timestamp) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + com.google.bigtable.v2.Type.Timestamp.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * Timestamp
+   * Values of type `Timestamp` are stored in `Value.timestamp_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Timestamp} + */ + public static final class Timestamp extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Timestamp) + TimestampOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Timestamp"); + } + + // Use Timestamp.newBuilder() to construct. + private Timestamp(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Timestamp() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Timestamp.class, + com.google.bigtable.v2.Type.Timestamp.Builder.class); + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Timestamp.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + boolean hasUnixMicrosInt64(); + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + com.google.bigtable.v2.Type.Int64.Encoding getUnixMicrosInt64(); + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getUnixMicrosInt64OrBuilder(); + + com.google.bigtable.v2.Type.Timestamp.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Timestamp.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Timestamp.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Timestamp.Encoding.class, + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder.class); + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UNIX_MICROS_INT64(1), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return UNIX_MICROS_INT64; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int UNIX_MICROS_INT64_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + @java.lang.Override + public boolean hasUnixMicrosInt64() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding getUnixMicrosInt64() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + /** + * + * + *
+       * Encodes the number of microseconds since the Unix epoch using the
+       * given `Int64` encoding. Values must be microsecond-aligned.
+       *
+       * Compatible with:
+       *
+       * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+       * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getUnixMicrosInt64OrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Type.Int64.Encoding) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.Int64.Encoding) encoding_); + } + size += getUnknownFields().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.Type.Timestamp.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Timestamp.Encoding other = + (com.google.bigtable.v2.Type.Timestamp.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getUnixMicrosInt64().equals(other.getUnixMicrosInt64())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + UNIX_MICROS_INT64_FIELD_NUMBER; + hash = (53 * hash) + getUnixMicrosInt64().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding 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.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding 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.Type.Timestamp.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Timestamp.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Timestamp.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Timestamp.Encoding) + com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Timestamp.Encoding.class, + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Timestamp.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (unixMicrosInt64Builder_ != null) { + unixMicrosInt64Builder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp.Encoding getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp.Encoding build() { + com.google.bigtable.v2.Type.Timestamp.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp.Encoding buildPartial() { + com.google.bigtable.v2.Type.Timestamp.Encoding result = + new com.google.bigtable.v2.Type.Timestamp.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Timestamp.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.Timestamp.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && unixMicrosInt64Builder_ != null) { + result.encoding_ = unixMicrosInt64Builder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Timestamp.Encoding) { + return mergeFrom((com.google.bigtable.v2.Type.Timestamp.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Timestamp.Encoding other) { + if (other == com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case UNIX_MICROS_INT64: + { + mergeUnixMicrosInt64(other.getUnixMicrosInt64()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetUnixMicrosInt64FieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder> + unixMicrosInt64Builder_; + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return Whether the unixMicrosInt64 field is set. + */ + @java.lang.Override + public boolean hasUnixMicrosInt64() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + * + * @return The unixMicrosInt64. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.Encoding getUnixMicrosInt64() { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return unixMicrosInt64Builder_.getMessage(); + } + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder setUnixMicrosInt64(com.google.bigtable.v2.Type.Int64.Encoding value) { + if (unixMicrosInt64Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + unixMicrosInt64Builder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder setUnixMicrosInt64( + com.google.bigtable.v2.Type.Int64.Encoding.Builder builderForValue) { + if (unixMicrosInt64Builder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + unixMicrosInt64Builder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder mergeUnixMicrosInt64(com.google.bigtable.v2.Type.Int64.Encoding value) { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1 + && encoding_ != com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.newBuilder( + (com.google.bigtable.v2.Type.Int64.Encoding) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + unixMicrosInt64Builder_.mergeFrom(value); + } else { + unixMicrosInt64Builder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public Builder clearUnixMicrosInt64() { + if (unixMicrosInt64Builder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + unixMicrosInt64Builder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + public com.google.bigtable.v2.Type.Int64.Encoding.Builder getUnixMicrosInt64Builder() { + return internalGetUnixMicrosInt64FieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64.EncodingOrBuilder getUnixMicrosInt64OrBuilder() { + if ((encodingCase_ == 1) && (unixMicrosInt64Builder_ != null)) { + return unixMicrosInt64Builder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Int64.Encoding) encoding_; + } + return com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Encodes the number of microseconds since the Unix epoch using the
+         * given `Int64` encoding. Values must be microsecond-aligned.
+         *
+         * Compatible with:
+         *
+         * - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS`
+         * 
+ * + * .google.bigtable.v2.Type.Int64.Encoding unix_micros_int64 = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder> + internalGetUnixMicrosInt64FieldBuilder() { + if (unixMicrosInt64Builder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.v2.Type.Int64.Encoding.getDefaultInstance(); + } + unixMicrosInt64Builder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder>( + (com.google.bigtable.v2.Type.Int64.Encoding) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return unixMicrosInt64Builder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Timestamp.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Timestamp.Encoding) + private static final com.google.bigtable.v2.Type.Timestamp.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Timestamp.Encoding(); + } + + public static com.google.bigtable.v2.Type.Timestamp.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Timestamp.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ENCODING_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type.Timestamp.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEncoding()); + } + size += getUnknownFields().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.Type.Timestamp)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Timestamp other = (com.google.bigtable.v2.Type.Timestamp) obj; + + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp 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.Type.Timestamp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp 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.Type.Timestamp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Timestamp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Timestamp 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Timestamp
+     * Values of type `Timestamp` are stored in `Value.timestamp_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Timestamp} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Timestamp) + com.google.bigtable.v2.Type.TimestampOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Timestamp.class, + com.google.bigtable.v2.Type.Timestamp.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Timestamp.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Timestamp_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp build() { + com.google.bigtable.v2.Type.Timestamp result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp buildPartial() { + com.google.bigtable.v2.Type.Timestamp result = + new com.google.bigtable.v2.Type.Timestamp(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Timestamp result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Timestamp) { + return mergeFrom((com.google.bigtable.v2.Type.Timestamp) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Timestamp other) { + if (other == com.google.bigtable.v2.Type.Timestamp.getDefaultInstance()) return this; + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type.Timestamp.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp.Encoding, + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + * + * @return The encoding. + */ + public com.google.bigtable.v2.Type.Timestamp.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder setEncoding(com.google.bigtable.v2.Type.Timestamp.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder setEncoding( + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder mergeEncoding(com.google.bigtable.v2.Type.Timestamp.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && encoding_ != null + && encoding_ != com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Timestamp.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + public com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.v2.Type.Timestamp.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Timestamp.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp.Encoding, + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp.Encoding, + com.google.bigtable.v2.Type.Timestamp.Encoding.Builder, + com.google.bigtable.v2.Type.Timestamp.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Timestamp) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Timestamp) + private static final com.google.bigtable.v2.Type.Timestamp DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Timestamp(); + } + + public static com.google.bigtable.v2.Type.Timestamp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Timestamp parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Timestamp getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Date) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Date
+   * Values of type `Date` are stored in `Value.date_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Date} + */ + public static final class Date extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Date) + DateOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Date"); + } + + // Use Date.newBuilder() to construct. + private Date(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Date() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Date_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Date_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Date.class, + com.google.bigtable.v2.Type.Date.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Date)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Date other = (com.google.bigtable.v2.Type.Date) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Date parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Date 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.Type.Date parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Date 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.Type.Date parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Date parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Date parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Date parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Date parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Date parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Date parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Date parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Date 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Date
+     * Values of type `Date` are stored in `Value.date_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Date} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Date) + com.google.bigtable.v2.Type.DateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Date_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Date_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Date.class, + com.google.bigtable.v2.Type.Date.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Date.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Date_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Date getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Date build() { + com.google.bigtable.v2.Type.Date result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Date buildPartial() { + com.google.bigtable.v2.Type.Date result = new com.google.bigtable.v2.Type.Date(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Date) { + return mergeFrom((com.google.bigtable.v2.Type.Date) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Date other) { + if (other == com.google.bigtable.v2.Type.Date.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Date) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Date) + private static final com.google.bigtable.v2.Type.Date DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Date(); + } + + public static com.google.bigtable.v2.Type.Date getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Date parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Date getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface StructOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + java.util.List getFieldsList(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + com.google.bigtable.v2.Type.Struct.Field getFields(int index); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + int getFieldsCount(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + java.util.List + getFieldsOrBuilderList(); + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + com.google.bigtable.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + boolean hasEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + com.google.bigtable.v2.Type.Struct.Encoding getEncoding(); + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + com.google.bigtable.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder(); + } + + /** + * + * + *
+   * A structured data value, consisting of fields which map to dynamically
+   * typed values.
+   * Values of type `Struct` are stored in `Value.array_value` where entries are
+   * in the same order and number as `field_types`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct} + */ + public static final class Struct extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct) + StructOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Struct"); + } + + // Use Struct.newBuilder() to construct. + private Struct(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Struct() { + fields_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.class, + com.google.bigtable.v2.Type.Struct.Builder.class); + } + + public interface FieldOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct.Field) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + java.lang.String getFieldName(); + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + com.google.protobuf.ByteString getFieldNameBytes(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + com.google.bigtable.v2.Type getType(); + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder(); + } + + /** + * + * + *
+     * A struct field and its type.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Field} + */ + public static final class Field extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Field"); + } + + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Field() { + fieldName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Field.class, + com.google.bigtable.v2.Type.Struct.Field.Builder.class); + } + + private int bitField0_; + public static final int FIELD_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldName_ = ""; + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + @java.lang.Override + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + 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(); + fieldName_ = s; + return s; + } + } + + /** + * + * + *
+       * The field name (optional). Fields without a `field_name` are considered
+       * anonymous and cannot be referenced by name.
+       * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Type type_; + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getType() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+       * The type of values in this field.
+       * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + 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.GeneratedMessage.isStringEmpty(fieldName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fieldName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fieldName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + size += getUnknownFields().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.Type.Struct.Field)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct.Field other = + (com.google.bigtable.v2.Type.Struct.Field) obj; + + if (!getFieldName().equals(other.getFieldName())) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FIELD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFieldName().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Field 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.Type.Struct.Field parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Field 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.Type.Struct.Field parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Field parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct.Field 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A struct field and its type.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Field} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct.Field) + com.google.bigtable.v2.Type.Struct.FieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Field.class, + com.google.bigtable.v2.Type.Struct.Field.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Struct.Field.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldName_ = ""; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Field_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Field getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.Field.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Field build() { + com.google.bigtable.v2.Type.Struct.Field result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Field buildPartial() { + com.google.bigtable.v2.Type.Struct.Field result = + new com.google.bigtable.v2.Type.Struct.Field(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Struct.Field result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldName_ = fieldName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct.Field) { + return mergeFrom((com.google.bigtable.v2.Type.Struct.Field) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Struct.Field other) { + if (other == com.google.bigtable.v2.Type.Struct.Field.getDefaultInstance()) return this; + if (!other.getFieldName().isEmpty()) { + fieldName_ = other.fieldName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasType()) { + mergeType(other.getType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + fieldName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object fieldName_ = ""; + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return The fieldName. + */ + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return The bytes for fieldName. + */ + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @param value The fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearFieldName() { + fieldName_ = getDefaultInstance().getFieldName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * The field name (optional). Fields without a `field_name` are considered
+         * anonymous and cannot be referenced by name.
+         * 
+ * + * string field_name = 1; + * + * @param value The bytes for fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.bigtable.v2.Type type_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + * + * @return The type. + */ + public com.google.bigtable.v2.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder setType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder mergeType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && type_ != null + && type_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public com.google.bigtable.v2.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+         * The type of values in this field.
+         * 
+ * + * .google.bigtable.v2.Type type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct.Field) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct.Field) + private static final com.google.bigtable.v2.Type.Struct.Field DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct.Field(); + } + + public static com.google.bigtable.v2.Type.Struct.Field getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Field parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct.Field getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EncodingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct.Encoding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + boolean hasSingleton(); + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + com.google.bigtable.v2.Type.Struct.Encoding.Singleton getSingleton(); + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder getSingletonOrBuilder(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return Whether the delimitedBytes field is set. + */ + boolean hasDelimitedBytes(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return The delimitedBytes. + */ + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes getDelimitedBytes(); + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + boolean hasOrderedCodeBytes(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes getOrderedCodeBytes(); + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder(); + + com.google.bigtable.v2.Type.Struct.Encoding.EncodingCase getEncodingCase(); + } + + /** + * + * + *
+     * Rules used to convert to or from lower level types.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Encoding"); + } + + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Encoding() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.class, + com.google.bigtable.v2.Type.Struct.Encoding.Builder.class); + } + + public interface SingletonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct.Encoding.Singleton) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Uses the encoding of `fields[0].type` as-is.
+       * Only valid if `fields.size == 1`.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.Singleton} + */ + public static final class Singleton extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Encoding.Singleton) + SingletonOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Singleton"); + } + + // Use Singleton.newBuilder() to construct. + private Singleton(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Singleton() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.class, + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Struct.Encoding.Singleton)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct.Encoding.Singleton other = + (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton 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.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton 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.Type.Struct.Encoding.Singleton parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct.Encoding.Singleton 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Uses the encoding of `fields[0].type` as-is.
+         * Only valid if `fields.size == 1`.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.Singleton} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct.Encoding.Singleton) + com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.class, + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Struct.Encoding.Singleton.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton build() { + com.google.bigtable.v2.Type.Struct.Encoding.Singleton result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton buildPartial() { + com.google.bigtable.v2.Type.Struct.Encoding.Singleton result = + new com.google.bigtable.v2.Type.Struct.Encoding.Singleton(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct.Encoding.Singleton) { + return mergeFrom((com.google.bigtable.v2.Type.Struct.Encoding.Singleton) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Struct.Encoding.Singleton other) { + if (other == com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct.Encoding.Singleton) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct.Encoding.Singleton) + private static final com.google.bigtable.v2.Type.Struct.Encoding.Singleton DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct.Encoding.Singleton(); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.Singleton getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Singleton parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct.Encoding.Singleton getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DelimitedBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Byte sequence used to delimit concatenated fields. The delimiter must
+         * contain at least 1 character and at most 50 characters.
+         * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + com.google.protobuf.ByteString getDelimiter(); + } + + /** + * + * + *
+       * Fields are encoded independently and concatenated with a configurable
+       * `delimiter` in between.
+       *
+       * A struct with no fields defined is encoded as a single `delimiter`.
+       *
+       * Sorted mode:
+       *
+       * - Fields are encoded in sorted mode.
+       * - Encoded field values must not contain any bytes <= `delimiter[0]`
+       * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+       * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+       *
+       * Distinct mode:
+       *
+       * - Fields are encoded in distinct mode.
+       * - Encoded field values must not contain `delimiter[0]`.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} + */ + public static final class DelimitedBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + DelimitedBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DelimitedBytes"); + } + + // Use DelimitedBytes.newBuilder() to construct. + private DelimitedBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DelimitedBytes() { + delimiter_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.class, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder.class); + } + + public static final int DELIMITER_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString delimiter_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+         * Byte sequence used to delimit concatenated fields. The delimiter must
+         * contain at least 1 character and at most 50 characters.
+         * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiter() { + return delimiter_; + } + + 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 (!delimiter_.isEmpty()) { + output.writeBytes(1, delimiter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!delimiter_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, delimiter_); + } + size += getUnknownFields().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.Type.Struct.Encoding.DelimitedBytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes other = + (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) obj; + + if (!getDelimiter().equals(other.getDelimiter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DELIMITER_FIELD_NUMBER; + hash = (53 * hash) + getDelimiter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes 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.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes 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.Type.Struct.Encoding.DelimitedBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct.Encoding.DelimitedBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Fields are encoded independently and concatenated with a configurable
+         * `delimiter` in between.
+         *
+         * A struct with no fields defined is encoded as a single `delimiter`.
+         *
+         * Sorted mode:
+         *
+         * - Fields are encoded in sorted mode.
+         * - Encoded field values must not contain any bytes <= `delimiter[0]`
+         * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+         * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+         *
+         * Distinct mode:
+         *
+         * - Fields are encoded in distinct mode.
+         * - Encoded field values must not contain `delimiter[0]`.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.class, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + delimiter_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes build() { + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes buildPartial() { + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes result = + new com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.delimiter_ = delimiter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) { + return mergeFrom((com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes other) { + if (other + == com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance()) + return this; + if (!other.getDelimiter().isEmpty()) { + setDelimiter(other.getDelimiter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + delimiter_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString delimiter_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @return The delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiter() { + return delimiter_; + } + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @param value The delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiter(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + delimiter_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+           * Byte sequence used to delimit concatenated fields. The delimiter must
+           * contain at least 1 character and at most 50 characters.
+           * 
+ * + * bytes delimiter = 1; + * + * @return This builder for chaining. + */ + public Builder clearDelimiter() { + bitField0_ = (bitField0_ & ~0x00000001); + delimiter_ = getDefaultInstance().getDelimiter(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) + private static final com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes(); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DelimitedBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct.Encoding.DelimitedBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OrderedCodeBytesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+       * Fields are encoded independently and concatenated with the fixed byte
+       * pair `{0x00, 0x01}` in between.
+       *
+       * Any null `(0x00)` byte in an encoded field is replaced by the fixed
+       * byte pair `{0x00, 0xFF}`.
+       *
+       * Fields that encode to the empty string "" have special handling:
+       *
+       * - If *every* field encodes to "", or if the STRUCT has no fields
+       * defined, then the STRUCT is encoded as the fixed byte pair
+       * `{0x00, 0x00}`.
+       * - Otherwise, the STRUCT only encodes until the last non-empty field,
+       * omitting any trailing empty fields. Any empty fields that aren't
+       * omitted are replaced with the fixed byte pair `{0x00, 0x00}`.
+       *
+       * Examples:
+       *
+       * ```
+       * - STRUCT()             -> "\00\00"
+       * - STRUCT("")           -> "\00\00"
+       * - STRUCT("", "")       -> "\00\00"
+       * - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
+       * - STRUCT("A", "")      -> "A"
+       * - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
+       * - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
+       * ```
+       *
+       *
+       * Since null bytes are always escaped, this encoding can cause size
+       * blowup for encodings like `Int64.BigEndianBytes` that are likely to
+       * produce many such bytes.
+       *
+       * Sorted mode:
+       *
+       * - Fields are encoded in sorted mode.
+       * - All values supported by the field encodings are allowed
+       * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+       * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+       *
+       * Distinct mode:
+       *
+       * - Fields are encoded in distinct mode.
+       * - All values supported by the field encodings are allowed.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} + */ + public static final class OrderedCodeBytes extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + OrderedCodeBytesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OrderedCodeBytes"); + } + + // Use OrderedCodeBytes.newBuilder() to construct. + private OrderedCodeBytes(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OrderedCodeBytes() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.class, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Struct.Encoding.OrderedCodeBytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes other = + (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes 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.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes 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.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct.Encoding.OrderedCodeBytes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * Fields are encoded independently and concatenated with the fixed byte
+         * pair `{0x00, 0x01}` in between.
+         *
+         * Any null `(0x00)` byte in an encoded field is replaced by the fixed
+         * byte pair `{0x00, 0xFF}`.
+         *
+         * Fields that encode to the empty string "" have special handling:
+         *
+         * - If *every* field encodes to "", or if the STRUCT has no fields
+         * defined, then the STRUCT is encoded as the fixed byte pair
+         * `{0x00, 0x00}`.
+         * - Otherwise, the STRUCT only encodes until the last non-empty field,
+         * omitting any trailing empty fields. Any empty fields that aren't
+         * omitted are replaced with the fixed byte pair `{0x00, 0x00}`.
+         *
+         * Examples:
+         *
+         * ```
+         * - STRUCT()             -> "\00\00"
+         * - STRUCT("")           -> "\00\00"
+         * - STRUCT("", "")       -> "\00\00"
+         * - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
+         * - STRUCT("A", "")      -> "A"
+         * - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
+         * - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
+         * ```
+         *
+         *
+         * Since null bytes are always escaped, this encoding can cause size
+         * blowup for encodings like `Int64.BigEndianBytes` that are likely to
+         * produce many such bytes.
+         *
+         * Sorted mode:
+         *
+         * - Fields are encoded in sorted mode.
+         * - All values supported by the field encodings are allowed
+         * - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
+         * `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
+         *
+         * Distinct mode:
+         *
+         * - Fields are encoded in distinct mode.
+         * - All values supported by the field encodings are allowed.
+         * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.class, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes build() { + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes buildPartial() { + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes result = + new com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) { + return mergeFrom( + (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes other) { + if (other + == com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) + private static final com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes(); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrderedCodeBytes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct.Encoding.OrderedCodeBytes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int encodingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object encoding_; + + public enum EncodingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SINGLETON(1), + DELIMITED_BYTES(2), + ORDERED_CODE_BYTES(3), + ENCODING_NOT_SET(0); + private final int value; + + private EncodingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: + return SINGLETON; + case 2: + return DELIMITED_BYTES; + case 3: + return ORDERED_CODE_BYTES; + case 0: + return ENCODING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public static final int SINGLETON_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + @java.lang.Override + public boolean hasSingleton() { + return encodingCase_ == 1; + } + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton getSingleton() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `Singleton` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder + getSingletonOrBuilder() { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + + public static final int DELIMITED_BYTES_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return Whether the delimitedBytes field is set. + */ + @java.lang.Override + public boolean hasDelimitedBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return The delimitedBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes getDelimitedBytes() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + + /** + * + * + *
+       * Use `DelimitedBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder() { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + + public static final int ORDERED_CODE_BYTES_FIELD_NUMBER = 3; + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 3; + } + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes getOrderedCodeBytes() { + if (encodingCase_ == 3) { + return (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + + /** + * + * + *
+       * User `OrderedCodeBytes` encoding.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if (encodingCase_ == 3) { + return (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + + 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 (encodingCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_); + } + if (encodingCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_); + } + if (encodingCase_ == 3) { + output.writeMessage( + 3, (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_); + } + if (encodingCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_); + } + if (encodingCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_); + } + size += getUnknownFields().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.Type.Struct.Encoding)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct.Encoding other = + (com.google.bigtable.v2.Type.Struct.Encoding) obj; + + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getSingleton().equals(other.getSingleton())) return false; + break; + case 2: + if (!getDelimitedBytes().equals(other.getDelimitedBytes())) return false; + break; + case 3: + if (!getOrderedCodeBytes().equals(other.getOrderedCodeBytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (encodingCase_) { + case 1: + hash = (37 * hash) + SINGLETON_FIELD_NUMBER; + hash = (53 * hash) + getSingleton().hashCode(); + break; + case 2: + hash = (37 * hash) + DELIMITED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getDelimitedBytes().hashCode(); + break; + case 3: + hash = (37 * hash) + ORDERED_CODE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getOrderedCodeBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding 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.Type.Struct.Encoding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding 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.Type.Struct.Encoding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct.Encoding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Rules used to convert to or from lower level types.
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct.Encoding) + com.google.bigtable.v2.Type.Struct.EncodingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.Encoding.class, + com.google.bigtable.v2.Type.Struct.Encoding.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Struct.Encoding.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (singletonBuilder_ != null) { + singletonBuilder_.clear(); + } + if (delimitedBytesBuilder_ != null) { + delimitedBytesBuilder_.clear(); + } + if (orderedCodeBytesBuilder_ != null) { + orderedCodeBytesBuilder_.clear(); + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding build() { + com.google.bigtable.v2.Type.Struct.Encoding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding buildPartial() { + com.google.bigtable.v2.Type.Struct.Encoding result = + new com.google.bigtable.v2.Type.Struct.Encoding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Struct.Encoding result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.Struct.Encoding result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 1 && singletonBuilder_ != null) { + result.encoding_ = singletonBuilder_.build(); + } + if (encodingCase_ == 2 && delimitedBytesBuilder_ != null) { + result.encoding_ = delimitedBytesBuilder_.build(); + } + if (encodingCase_ == 3 && orderedCodeBytesBuilder_ != null) { + result.encoding_ = orderedCodeBytesBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct.Encoding) { + return mergeFrom((com.google.bigtable.v2.Type.Struct.Encoding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Struct.Encoding other) { + if (other == com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance()) + return this; + switch (other.getEncodingCase()) { + case SINGLETON: + { + mergeSingleton(other.getSingleton()); + break; + } + case DELIMITED_BYTES: + { + mergeDelimitedBytes(other.getDelimitedBytes()); + break; + } + case ORDERED_CODE_BYTES: + { + mergeOrderedCodeBytes(other.getOrderedCodeBytes()); + break; + } + case ENCODING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetSingletonFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetDelimitedBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetOrderedCodeBytesFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int encodingCase_ = 0; + private java.lang.Object encoding_; + + public EncodingCase getEncodingCase() { + return EncodingCase.forNumber(encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder> + singletonBuilder_; + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return Whether the singleton field is set. + */ + @java.lang.Override + public boolean hasSingleton() { + return encodingCase_ == 1; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + * + * @return The singleton. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton getSingleton() { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } else { + if (encodingCase_ == 1) { + return singletonBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder setSingleton(com.google.bigtable.v2.Type.Struct.Encoding.Singleton value) { + if (singletonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + singletonBuilder_.setMessage(value); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder setSingleton( + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder builderForValue) { + if (singletonBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + singletonBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder mergeSingleton(com.google.bigtable.v2.Type.Struct.Encoding.Singleton value) { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1 + && encoding_ + != com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.newBuilder( + (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 1) { + singletonBuilder_.mergeFrom(value); + } else { + singletonBuilder_.setMessage(value); + } + } + encodingCase_ = 1; + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public Builder clearSingleton() { + if (singletonBuilder_ == null) { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + } + singletonBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + public com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder getSingletonBuilder() { + return internalGetSingletonFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder + getSingletonOrBuilder() { + if ((encodingCase_ == 1) && (singletonBuilder_ != null)) { + return singletonBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 1) { + return (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `Singleton` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.Singleton singleton = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder> + internalGetSingletonFieldBuilder() { + if (singletonBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.getDefaultInstance(); + } + singletonBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.Singleton, + com.google.bigtable.v2.Type.Struct.Encoding.Singleton.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.SingletonOrBuilder>( + (com.google.bigtable.v2.Type.Struct.Encoding.Singleton) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 1; + onChanged(); + return singletonBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder> + delimitedBytesBuilder_; + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return Whether the delimitedBytes field is set. + */ + @java.lang.Override + public boolean hasDelimitedBytes() { + return encodingCase_ == 2; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + * + * @return The delimitedBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes getDelimitedBytes() { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } else { + if (encodingCase_ == 2) { + return delimitedBytesBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + public Builder setDelimitedBytes( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes value) { + if (delimitedBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + delimitedBytesBuilder_.setMessage(value); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + public Builder setDelimitedBytes( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder builderForValue) { + if (delimitedBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + delimitedBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + public Builder mergeDelimitedBytes( + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes value) { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2 + && encoding_ + != com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.newBuilder( + (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 2) { + delimitedBytesBuilder_.mergeFrom(value); + } else { + delimitedBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 2; + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + public Builder clearDelimitedBytes() { + if (delimitedBytesBuilder_ == null) { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 2) { + encodingCase_ = 0; + encoding_ = null; + } + delimitedBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder + getDelimitedBytesBuilder() { + return internalGetDelimitedBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder + getDelimitedBytesOrBuilder() { + if ((encodingCase_ == 2) && (delimitedBytesBuilder_ != null)) { + return delimitedBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 2) { + return (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + } + + /** + * + * + *
+         * Use `DelimitedBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes delimited_bytes = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder> + internalGetDelimitedBytesFieldBuilder() { + if (delimitedBytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.getDefaultInstance(); + } + delimitedBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytesOrBuilder>( + (com.google.bigtable.v2.Type.Struct.Encoding.DelimitedBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 2; + onChanged(); + return delimitedBytesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder> + orderedCodeBytesBuilder_; + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return Whether the orderedCodeBytes field is set. + */ + @java.lang.Override + public boolean hasOrderedCodeBytes() { + return encodingCase_ == 3; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + * + * @return The orderedCodeBytes. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes getOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3) { + return (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } else { + if (encodingCase_ == 3) { + return orderedCodeBytesBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder setOrderedCodeBytes( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder builderForValue) { + if (orderedCodeBytesBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + orderedCodeBytesBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder mergeOrderedCodeBytes( + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes value) { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3 + && encoding_ + != com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance()) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.newBuilder( + (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_) + .mergeFrom(value) + .buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 3) { + orderedCodeBytesBuilder_.mergeFrom(value); + } else { + orderedCodeBytesBuilder_.setMessage(value); + } + } + encodingCase_ = 3; + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public Builder clearOrderedCodeBytes() { + if (orderedCodeBytesBuilder_ == null) { + if (encodingCase_ == 3) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 3) { + encodingCase_ = 0; + encoding_ = null; + } + orderedCodeBytesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder + getOrderedCodeBytesBuilder() { + return internalGetOrderedCodeBytesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder + getOrderedCodeBytesOrBuilder() { + if ((encodingCase_ == 3) && (orderedCodeBytesBuilder_ != null)) { + return orderedCodeBytesBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 3) { + return (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_; + } + return com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes + .getDefaultInstance(); + } + } + + /** + * + * + *
+         * User `OrderedCodeBytes` encoding.
+         * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes ordered_code_bytes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder> + internalGetOrderedCodeBytesFieldBuilder() { + if (orderedCodeBytesBuilder_ == null) { + if (!(encodingCase_ == 3)) { + encoding_ = + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.getDefaultInstance(); + } + orderedCodeBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes.Builder, + com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytesOrBuilder>( + (com.google.bigtable.v2.Type.Struct.Encoding.OrderedCodeBytes) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 3; + onChanged(); + return orderedCodeBytesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct.Encoding) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct.Encoding) + private static final com.google.bigtable.v2.Type.Struct.Encoding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct.Encoding(); + } + + public static com.google.bigtable.v2.Type.Struct.Encoding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encoding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct.Encoding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int FIELDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List fields_; + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public java.util.List getFieldsList() { + return fields_; + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public int getFieldsCount() { + return fields_.size(); + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Field getFields(int index) { + return fields_.get(index); + } + + /** + * + * + *
+     * The names and types of the fields in this struct.
+     * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index) { + return fields_.get(index); + } + + public static final int ENCODING_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Type.Struct.Encoding encoding_; + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + @java.lang.Override + public boolean hasEncoding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.Encoding getEncoding() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + + /** + * + * + *
+     * The encoding to use when converting to or from lower level types.
+     * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder() { + return encoding_ == null + ? com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + + 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 { + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(1, fields_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEncoding()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fields_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEncoding()); + } + size += getUnknownFields().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.Type.Struct)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Struct other = (com.google.bigtable.v2.Type.Struct) obj; + + if (!getFieldsList().equals(other.getFieldsList())) return false; + if (hasEncoding() != other.hasEncoding()) return false; + if (hasEncoding()) { + if (!getEncoding().equals(other.getEncoding())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + if (hasEncoding()) { + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getEncoding().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Struct parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct 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.Type.Struct parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct 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.Type.Struct parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Struct parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Struct parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Struct parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Struct 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A structured data value, consisting of fields which map to dynamically
+     * typed values.
+     * Values of type `Struct` are stored in `Value.array_value` where entries are
+     * in the same order and number as `field_types`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Struct} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Struct) + com.google.bigtable.v2.Type.StructOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Struct.class, + com.google.bigtable.v2.Type.Struct.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Struct.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFieldsFieldBuilder(); + internalGetEncodingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + } else { + fields_ = null; + fieldsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Struct_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct build() { + com.google.bigtable.v2.Type.Struct result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Struct buildPartial() { + com.google.bigtable.v2.Type.Struct result = new com.google.bigtable.v2.Type.Struct(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Type.Struct result) { + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.Type.Struct result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.encoding_ = encodingBuilder_ == null ? encoding_ : encodingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Struct) { + return mergeFrom((com.google.bigtable.v2.Type.Struct) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Struct other) { + if (other == com.google.bigtable.v2.Type.Struct.getDefaultInstance()) return this; + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + if (other.hasEncoding()) { + mergeEncoding(other.getEncoding()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.bigtable.v2.Type.Struct.Field m = + input.readMessage( + com.google.bigtable.v2.Type.Struct.Field.parser(), extensionRegistry); + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(m); + } else { + fieldsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetEncodingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List fields_ = + java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fields_ = new java.util.ArrayList(fields_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Type.Struct.Field, + com.google.bigtable.v2.Type.Struct.Field.Builder, + com.google.bigtable.v2.Type.Struct.FieldOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.v2.Type.Struct.Field getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder setFields(int index, com.google.bigtable.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder setFields( + int index, com.google.bigtable.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields(com.google.bigtable.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields(int index, com.google.bigtable.v2.Type.Struct.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields(com.google.bigtable.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder addFields( + int index, com.google.bigtable.v2.Type.Struct.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder addAllFields( + java.lang.Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.v2.Type.Struct.Field.Builder getFieldsBuilder(int index) { + return internalGetFieldsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.v2.Type.Struct.FieldOrBuilder getFieldsOrBuilder(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.v2.Type.Struct.Field.Builder addFieldsBuilder() { + return internalGetFieldsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Type.Struct.Field.getDefaultInstance()); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public com.google.bigtable.v2.Type.Struct.Field.Builder addFieldsBuilder(int index) { + return internalGetFieldsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Type.Struct.Field.getDefaultInstance()); + } + + /** + * + * + *
+       * The names and types of the fields in this struct.
+       * 
+ * + * repeated .google.bigtable.v2.Type.Struct.Field fields = 1; + */ + public java.util.List + getFieldsBuilderList() { + return internalGetFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Type.Struct.Field, + com.google.bigtable.v2.Type.Struct.Field.Builder, + com.google.bigtable.v2.Type.Struct.FieldOrBuilder> + internalGetFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Type.Struct.Field, + com.google.bigtable.v2.Type.Struct.Field.Builder, + com.google.bigtable.v2.Type.Struct.FieldOrBuilder>( + fields_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private com.google.bigtable.v2.Type.Struct.Encoding encoding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding, + com.google.bigtable.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.v2.Type.Struct.EncodingOrBuilder> + encodingBuilder_; + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return Whether the encoding field is set. + */ + public boolean hasEncoding() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + * + * @return The encoding. + */ + public com.google.bigtable.v2.Type.Struct.Encoding getEncoding() { + if (encodingBuilder_ == null) { + return encoding_ == null + ? com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } else { + return encodingBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder setEncoding(com.google.bigtable.v2.Type.Struct.Encoding value) { + if (encodingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + } else { + encodingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder setEncoding( + com.google.bigtable.v2.Type.Struct.Encoding.Builder builderForValue) { + if (encodingBuilder_ == null) { + encoding_ = builderForValue.build(); + } else { + encodingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder mergeEncoding(com.google.bigtable.v2.Type.Struct.Encoding value) { + if (encodingBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && encoding_ != null + && encoding_ != com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance()) { + getEncodingBuilder().mergeFrom(value); + } else { + encoding_ = value; + } + } else { + encodingBuilder_.mergeFrom(value); + } + if (encoding_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000002); + encoding_ = null; + if (encodingBuilder_ != null) { + encodingBuilder_.dispose(); + encodingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public com.google.bigtable.v2.Type.Struct.Encoding.Builder getEncodingBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEncodingFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + public com.google.bigtable.v2.Type.Struct.EncodingOrBuilder getEncodingOrBuilder() { + if (encodingBuilder_ != null) { + return encodingBuilder_.getMessageOrBuilder(); + } else { + return encoding_ == null + ? com.google.bigtable.v2.Type.Struct.Encoding.getDefaultInstance() + : encoding_; + } + } + + /** + * + * + *
+       * The encoding to use when converting to or from lower level types.
+       * 
+ * + * .google.bigtable.v2.Type.Struct.Encoding encoding = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding, + com.google.bigtable.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.v2.Type.Struct.EncodingOrBuilder> + internalGetEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct.Encoding, + com.google.bigtable.v2.Type.Struct.Encoding.Builder, + com.google.bigtable.v2.Type.Struct.EncodingOrBuilder>( + getEncoding(), getParentForChildren(), isClean()); + encoding_ = null; + } + return encodingBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Struct) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Struct) + private static final com.google.bigtable.v2.Type.Struct DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Struct(); + } + + public static com.google.bigtable.v2.Type.Struct getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Struct parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Struct getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ProtoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Proto) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + java.lang.String getSchemaBundleId(); + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + com.google.protobuf.ByteString getSchemaBundleIdBytes(); + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + java.lang.String getMessageName(); + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + com.google.protobuf.ByteString getMessageNameBytes(); + } + + /** + * + * + *
+   * A protobuf message type.
+   * Values of type `Proto` are stored in `Value.bytes_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Proto} + */ + public static final class Proto extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Proto) + ProtoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Proto"); + } + + // Use Proto.newBuilder() to construct. + private Proto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Proto() { + schemaBundleId_ = ""; + messageName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Proto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Proto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Proto.class, + com.google.bigtable.v2.Type.Proto.Builder.class); + } + + public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + @java.lang.Override + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + 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(); + schemaBundleId_ = s; + return s; + } + } + + /** + * + * + *
+     * The ID of the schema bundle that this proto is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object messageName_ = ""; + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + @java.lang.Override + public java.lang.String getMessageName() { + java.lang.Object ref = messageName_; + 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(); + messageName_ = s; + return s; + } + } + + /** + * + * + *
+     * The fully qualified name of the protobuf message, including package. In
+     * the format of "foo.bar.Message".
+     * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageNameBytes() { + java.lang.Object ref = messageName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + messageName_ = 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.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, messageName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, messageName_); + } + size += getUnknownFields().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.Type.Proto)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Proto other = (com.google.bigtable.v2.Type.Proto) obj; + + if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false; + if (!getMessageName().equals(other.getMessageName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SCHEMA_BUNDLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundleId().hashCode(); + hash = (37 * hash) + MESSAGE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMessageName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Proto parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Proto 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.Type.Proto parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Proto 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.Type.Proto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Proto parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Proto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Proto parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Proto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Proto parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Proto parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Proto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Proto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A protobuf message type.
+     * Values of type `Proto` are stored in `Value.bytes_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Proto} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Proto) + com.google.bigtable.v2.Type.ProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Proto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Proto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Proto.class, + com.google.bigtable.v2.Type.Proto.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Proto.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaBundleId_ = ""; + messageName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Proto_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Proto getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Proto build() { + com.google.bigtable.v2.Type.Proto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Proto buildPartial() { + com.google.bigtable.v2.Type.Proto result = new com.google.bigtable.v2.Type.Proto(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Proto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaBundleId_ = schemaBundleId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.messageName_ = messageName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Proto) { + return mergeFrom((com.google.bigtable.v2.Type.Proto) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Proto other) { + if (other == com.google.bigtable.v2.Type.Proto.getDefaultInstance()) return this; + if (!other.getSchemaBundleId().isEmpty()) { + schemaBundleId_ = other.schemaBundleId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMessageName().isEmpty()) { + messageName_ = other.messageName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + schemaBundleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + messageName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaBundleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchemaBundleId() { + schemaBundleId_ = getDefaultInstance().getSchemaBundleId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this proto is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The bytes for schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object messageName_ = ""; + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return The messageName. + */ + public java.lang.String getMessageName() { + java.lang.Object ref = messageName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + messageName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return The bytes for messageName. + */ + public com.google.protobuf.ByteString getMessageNameBytes() { + java.lang.Object ref = messageName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + messageName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @param value The messageName to set. + * @return This builder for chaining. + */ + public Builder setMessageName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + messageName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessageName() { + messageName_ = getDefaultInstance().getMessageName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf message, including package. In
+       * the format of "foo.bar.Message".
+       * 
+ * + * string message_name = 2; + * + * @param value The bytes for messageName to set. + * @return This builder for chaining. + */ + public Builder setMessageNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + messageName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Proto) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Proto) + private static final com.google.bigtable.v2.Type.Proto DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Proto(); + } + + public static com.google.bigtable.v2.Type.Proto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Proto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EnumOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Enum) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + java.lang.String getSchemaBundleId(); + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + com.google.protobuf.ByteString getSchemaBundleIdBytes(); + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + java.lang.String getEnumName(); + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + com.google.protobuf.ByteString getEnumNameBytes(); + } + + /** + * + * + *
+   * A protobuf enum type.
+   * Values of type `Enum` are stored in `Value.int_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Enum} + */ + public static final class Enum extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Enum) + EnumOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Enum"); + } + + // Use Enum.newBuilder() to construct. + private Enum(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Enum() { + schemaBundleId_ = ""; + enumName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Enum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Enum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Enum.class, + com.google.bigtable.v2.Type.Enum.Builder.class); + } + + public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + @java.lang.Override + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + 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(); + schemaBundleId_ = s; + return s; + } + } + + /** + * + * + *
+     * The ID of the schema bundle that this enum is defined in.
+     * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENUM_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object enumName_ = ""; + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + @java.lang.Override + public java.lang.String getEnumName() { + java.lang.Object ref = enumName_; + 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(); + enumName_ = s; + return s; + } + } + + /** + * + * + *
+     * The fully qualified name of the protobuf enum message, including package.
+     * In the format of "foo.bar.EnumMessage".
+     * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnumNameBytes() { + java.lang.Object ref = enumName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enumName_ = 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.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enumName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, enumName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(schemaBundleId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, schemaBundleId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enumName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, enumName_); + } + size += getUnknownFields().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.Type.Enum)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Enum other = (com.google.bigtable.v2.Type.Enum) obj; + + if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false; + if (!getEnumName().equals(other.getEnumName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SCHEMA_BUNDLE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaBundleId().hashCode(); + hash = (37 * hash) + ENUM_NAME_FIELD_NUMBER; + hash = (53 * hash) + getEnumName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Enum parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Enum 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.Type.Enum parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Enum 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.Type.Enum parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Enum parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Enum parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Enum parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Enum parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Enum parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Enum parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Enum parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Enum 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A protobuf enum type.
+     * Values of type `Enum` are stored in `Value.int_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Enum} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Enum) + com.google.bigtable.v2.Type.EnumOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Enum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Enum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Enum.class, + com.google.bigtable.v2.Type.Enum.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Enum.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaBundleId_ = ""; + enumName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Enum_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Enum getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Enum build() { + com.google.bigtable.v2.Type.Enum result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Enum buildPartial() { + com.google.bigtable.v2.Type.Enum result = new com.google.bigtable.v2.Type.Enum(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Enum result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaBundleId_ = schemaBundleId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enumName_ = enumName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Enum) { + return mergeFrom((com.google.bigtable.v2.Type.Enum) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Enum other) { + if (other == com.google.bigtable.v2.Type.Enum.getDefaultInstance()) return this; + if (!other.getSchemaBundleId().isEmpty()) { + schemaBundleId_ = other.schemaBundleId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEnumName().isEmpty()) { + enumName_ = other.enumName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + schemaBundleId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + enumName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object schemaBundleId_ = ""; + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The schemaBundleId. + */ + public java.lang.String getSchemaBundleId() { + java.lang.Object ref = schemaBundleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaBundleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return The bytes for schemaBundleId. + */ + public com.google.protobuf.ByteString getSchemaBundleIdBytes() { + java.lang.Object ref = schemaBundleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaBundleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchemaBundleId() { + schemaBundleId_ = getDefaultInstance().getSchemaBundleId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * The ID of the schema bundle that this enum is defined in.
+       * 
+ * + * string schema_bundle_id = 1; + * + * @param value The bytes for schemaBundleId to set. + * @return This builder for chaining. + */ + public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaBundleId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object enumName_ = ""; + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return The enumName. + */ + public java.lang.String getEnumName() { + java.lang.Object ref = enumName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enumName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return The bytes for enumName. + */ + public com.google.protobuf.ByteString getEnumNameBytes() { + java.lang.Object ref = enumName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enumName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @param value The enumName to set. + * @return This builder for chaining. + */ + public Builder setEnumName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + enumName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnumName() { + enumName_ = getDefaultInstance().getEnumName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * The fully qualified name of the protobuf enum message, including package.
+       * In the format of "foo.bar.EnumMessage".
+       * 
+ * + * string enum_name = 2; + * + * @param value The bytes for enumName to set. + * @return This builder for chaining. + */ + public Builder setEnumNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + enumName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Enum) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Enum) + private static final com.google.bigtable.v2.Type.Enum DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Enum(); + } + + public static com.google.bigtable.v2.Type.Enum getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Enum parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Enum getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Array) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + boolean hasElementType(); + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return The elementType. + */ + com.google.bigtable.v2.Type getElementType(); + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + com.google.bigtable.v2.TypeOrBuilder getElementTypeOrBuilder(); + } + + /** + * + * + *
+   * An ordered list of elements of a given type.
+   * Values of type `Array` are stored in `Value.array_value`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Array} + */ + public static final class Array extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Array) + ArrayOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Array"); + } + + // Use Array.newBuilder() to construct. + private Array(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Array() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Array.class, + com.google.bigtable.v2.Type.Array.Builder.class); + } + + private int bitField0_; + public static final int ELEMENT_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type elementType_; + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + @java.lang.Override + public boolean hasElementType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return The elementType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getElementType() { + return elementType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : elementType_; + } + + /** + * + * + *
+     * The type of the elements in the array. This must not be `Array`.
+     * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getElementTypeOrBuilder() { + return elementType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : elementType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getElementType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getElementType()); + } + size += getUnknownFields().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.Type.Array)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Array other = (com.google.bigtable.v2.Type.Array) obj; + + if (hasElementType() != other.hasElementType()) return false; + if (hasElementType()) { + if (!getElementType().equals(other.getElementType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasElementType()) { + hash = (37 * hash) + ELEMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getElementType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Array parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Array 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.Type.Array parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Array 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.Type.Array parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Array parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Array parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Array parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Array parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Array parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Array parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Array parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Array 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * An ordered list of elements of a given type.
+     * Values of type `Array` are stored in `Value.array_value`.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Array} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Array) + com.google.bigtable.v2.Type.ArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Array.class, + com.google.bigtable.v2.Type.Array.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Array.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetElementTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + elementType_ = null; + if (elementTypeBuilder_ != null) { + elementTypeBuilder_.dispose(); + elementTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Array_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Array getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Array build() { + com.google.bigtable.v2.Type.Array result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Array buildPartial() { + com.google.bigtable.v2.Type.Array result = new com.google.bigtable.v2.Type.Array(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Array result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.elementType_ = + elementTypeBuilder_ == null ? elementType_ : elementTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Array) { + return mergeFrom((com.google.bigtable.v2.Type.Array) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Array other) { + if (other == com.google.bigtable.v2.Type.Array.getDefaultInstance()) return this; + if (other.hasElementType()) { + mergeElementType(other.getElementType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetElementTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type elementType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + elementTypeBuilder_; + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return Whether the elementType field is set. + */ + public boolean hasElementType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + * + * @return The elementType. + */ + public com.google.bigtable.v2.Type getElementType() { + if (elementTypeBuilder_ == null) { + return elementType_ == null + ? com.google.bigtable.v2.Type.getDefaultInstance() + : elementType_; + } else { + return elementTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public Builder setElementType(com.google.bigtable.v2.Type value) { + if (elementTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + elementType_ = value; + } else { + elementTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public Builder setElementType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (elementTypeBuilder_ == null) { + elementType_ = builderForValue.build(); + } else { + elementTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public Builder mergeElementType(com.google.bigtable.v2.Type value) { + if (elementTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && elementType_ != null + && elementType_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getElementTypeBuilder().mergeFrom(value); + } else { + elementType_ = value; + } + } else { + elementTypeBuilder_.mergeFrom(value); + } + if (elementType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public Builder clearElementType() { + bitField0_ = (bitField0_ & ~0x00000001); + elementType_ = null; + if (elementTypeBuilder_ != null) { + elementTypeBuilder_.dispose(); + elementTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public com.google.bigtable.v2.Type.Builder getElementTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetElementTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + public com.google.bigtable.v2.TypeOrBuilder getElementTypeOrBuilder() { + if (elementTypeBuilder_ != null) { + return elementTypeBuilder_.getMessageOrBuilder(); + } else { + return elementType_ == null + ? com.google.bigtable.v2.Type.getDefaultInstance() + : elementType_; + } + } + + /** + * + * + *
+       * The type of the elements in the array. This must not be `Array`.
+       * 
+ * + * .google.bigtable.v2.Type element_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetElementTypeFieldBuilder() { + if (elementTypeBuilder_ == null) { + elementTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getElementType(), getParentForChildren(), isClean()); + elementType_ = null; + } + return elementTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Array) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Array) + private static final com.google.bigtable.v2.Type.Array DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Array(); + } + + public static com.google.bigtable.v2.Type.Array getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Array parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Array getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MapOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Map) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + boolean hasKeyType(); + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return The keyType. + */ + com.google.bigtable.v2.Type getKeyType(); + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + com.google.bigtable.v2.TypeOrBuilder getKeyTypeOrBuilder(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + boolean hasValueType(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return The valueType. + */ + com.google.bigtable.v2.Type getValueType(); + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + com.google.bigtable.v2.TypeOrBuilder getValueTypeOrBuilder(); + } + + /** + * + * + *
+   * A mapping of keys to values of a given type.
+   * Values of type `Map` are stored in a `Value.array_value` where each entry
+   * is another `Value.array_value` with two elements (the key and the value,
+   * in that order).
+   * Normally encoded Map values won't have repeated keys, however, clients are
+   * expected to handle the case in which they do. If the same key appears
+   * multiple times, the _last_ value takes precedence.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Map} + */ + public static final class Map extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Map) + MapOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Map"); + } + + // Use Map.newBuilder() to construct. + private Map(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Map() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Map_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Map_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Map.class, com.google.bigtable.v2.Type.Map.Builder.class); + } + + private int bitField0_; + public static final int KEY_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type keyType_; + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + @java.lang.Override + public boolean hasKeyType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return The keyType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getKeyType() { + return keyType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : keyType_; + } + + /** + * + * + *
+     * The type of a map key.
+     * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+     * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getKeyTypeOrBuilder() { + return keyType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : keyType_; + } + + public static final int VALUE_TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Type valueType_; + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + @java.lang.Override + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return The valueType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getValueType() { + return valueType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : valueType_; + } + + /** + * + * + *
+     * The type of the values in a map.
+     * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getValueTypeOrBuilder() { + return valueType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : valueType_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getKeyType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getValueType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKeyType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValueType()); + } + size += getUnknownFields().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.Type.Map)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Map other = (com.google.bigtable.v2.Type.Map) obj; + + if (hasKeyType() != other.hasKeyType()) return false; + if (hasKeyType()) { + if (!getKeyType().equals(other.getKeyType())) return false; + } + if (hasValueType() != other.hasValueType()) return false; + if (hasValueType()) { + if (!getValueType().equals(other.getValueType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKeyType()) { + hash = (37 * hash) + KEY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getKeyType().hashCode(); + } + if (hasValueType()) { + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Map parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Map 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.Type.Map parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Map 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.Type.Map parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Map parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Map parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Map parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Map parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Map parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Map parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Map parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Map 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A mapping of keys to values of a given type.
+     * Values of type `Map` are stored in a `Value.array_value` where each entry
+     * is another `Value.array_value` with two elements (the key and the value,
+     * in that order).
+     * Normally encoded Map values won't have repeated keys, however, clients are
+     * expected to handle the case in which they do. If the same key appears
+     * multiple times, the _last_ value takes precedence.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Map} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Map) + com.google.bigtable.v2.Type.MapOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Map_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Map_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Map.class, + com.google.bigtable.v2.Type.Map.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Map.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeyTypeFieldBuilder(); + internalGetValueTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + keyType_ = null; + if (keyTypeBuilder_ != null) { + keyTypeBuilder_.dispose(); + keyTypeBuilder_ = null; + } + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Map_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Map getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Map build() { + com.google.bigtable.v2.Type.Map result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Map buildPartial() { + com.google.bigtable.v2.Type.Map result = new com.google.bigtable.v2.Type.Map(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Map result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.keyType_ = keyTypeBuilder_ == null ? keyType_ : keyTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueType_ = valueTypeBuilder_ == null ? valueType_ : valueTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Map) { + return mergeFrom((com.google.bigtable.v2.Type.Map) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Map other) { + if (other == com.google.bigtable.v2.Type.Map.getDefaultInstance()) return this; + if (other.hasKeyType()) { + mergeKeyType(other.getKeyType()); + } + if (other.hasValueType()) { + mergeValueType(other.getValueType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetKeyTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetValueTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type keyType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + keyTypeBuilder_; + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return Whether the keyType field is set. + */ + public boolean hasKeyType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + * + * @return The keyType. + */ + public com.google.bigtable.v2.Type getKeyType() { + if (keyTypeBuilder_ == null) { + return keyType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : keyType_; + } else { + return keyTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public Builder setKeyType(com.google.bigtable.v2.Type value) { + if (keyTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keyType_ = value; + } else { + keyTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public Builder setKeyType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (keyTypeBuilder_ == null) { + keyType_ = builderForValue.build(); + } else { + keyTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public Builder mergeKeyType(com.google.bigtable.v2.Type value) { + if (keyTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && keyType_ != null + && keyType_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getKeyTypeBuilder().mergeFrom(value); + } else { + keyType_ = value; + } + } else { + keyTypeBuilder_.mergeFrom(value); + } + if (keyType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public Builder clearKeyType() { + bitField0_ = (bitField0_ & ~0x00000001); + keyType_ = null; + if (keyTypeBuilder_ != null) { + keyTypeBuilder_.dispose(); + keyTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public com.google.bigtable.v2.Type.Builder getKeyTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetKeyTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + public com.google.bigtable.v2.TypeOrBuilder getKeyTypeOrBuilder() { + if (keyTypeBuilder_ != null) { + return keyTypeBuilder_.getMessageOrBuilder(); + } else { + return keyType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : keyType_; + } + } + + /** + * + * + *
+       * The type of a map key.
+       * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+       * 
+ * + * .google.bigtable.v2.Type key_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetKeyTypeFieldBuilder() { + if (keyTypeBuilder_ == null) { + keyTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getKeyType(), getParentForChildren(), isClean()); + keyType_ = null; + } + return keyTypeBuilder_; + } + + private com.google.bigtable.v2.Type valueType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + valueTypeBuilder_; + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return Whether the valueType field is set. + */ + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + * + * @return The valueType. + */ + public com.google.bigtable.v2.Type getValueType() { + if (valueTypeBuilder_ == null) { + return valueType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : valueType_; + } else { + return valueTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public Builder setValueType(com.google.bigtable.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + } else { + valueTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public Builder setValueType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (valueTypeBuilder_ == null) { + valueType_ = builderForValue.build(); + } else { + valueTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public Builder mergeValueType(com.google.bigtable.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && valueType_ != null + && valueType_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getValueTypeBuilder().mergeFrom(value); + } else { + valueType_ = value; + } + } else { + valueTypeBuilder_.mergeFrom(value); + } + if (valueType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000002); + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public com.google.bigtable.v2.Type.Builder getValueTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetValueTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + public com.google.bigtable.v2.TypeOrBuilder getValueTypeOrBuilder() { + if (valueTypeBuilder_ != null) { + return valueTypeBuilder_.getMessageOrBuilder(); + } else { + return valueType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : valueType_; + } + } + + /** + * + * + *
+       * The type of the values in a map.
+       * 
+ * + * .google.bigtable.v2.Type value_type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getValueType(), getParentForChildren(), isClean()); + valueType_ = null; + } + return valueTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Map) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Map) + private static final com.google.bigtable.v2.Type.Map DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Map(); + } + + public static com.google.bigtable.v2.Type.Map getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Map parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Map getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AggregateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Aggregate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + boolean hasInputType(); + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return The inputType. + */ + com.google.bigtable.v2.Type getInputType(); + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + com.google.bigtable.v2.TypeOrBuilder getInputTypeOrBuilder(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + boolean hasStateType(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + com.google.bigtable.v2.Type getStateType(); + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.v2.TypeOrBuilder getStateTypeOrBuilder(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + boolean hasSum(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + com.google.bigtable.v2.Type.Aggregate.Sum getSum(); + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + boolean hasHllppUniqueCount(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount getHllppUniqueCount(); + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + boolean hasMax(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + com.google.bigtable.v2.Type.Aggregate.Max getMax(); + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + boolean hasMin(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + com.google.bigtable.v2.Type.Aggregate.Min getMin(); + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder(); + + com.google.bigtable.v2.Type.Aggregate.AggregatorCase getAggregatorCase(); + } + + /** + * + * + *
+   * A value that combines incremental updates into a summarized value.
+   *
+   * Data is never directly written or read using type `Aggregate`. Writes
+   * provide either the `input_type` or `state_type`, and reads always return
+   * the `state_type` .
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate} + */ + public static final class Aggregate extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate) + AggregateOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Aggregate"); + } + + // Use Aggregate.newBuilder() to construct. + private Aggregate(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Aggregate() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.class, + com.google.bigtable.v2.Type.Aggregate.Builder.class); + } + + public interface SumOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Aggregate.Sum) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the sum of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Sum} + */ + public static final class Sum extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Sum) + SumOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Sum"); + } + + // Use Sum.newBuilder() to construct. + private Sum(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Sum() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Sum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Sum.class, + com.google.bigtable.v2.Type.Aggregate.Sum.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Aggregate.Sum)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Aggregate.Sum other = + (com.google.bigtable.v2.Type.Aggregate.Sum) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum 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.Type.Aggregate.Sum parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum 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.Type.Aggregate.Sum parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Aggregate.Sum 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the sum of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Sum} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Aggregate.Sum) + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Sum_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Sum.class, + com.google.bigtable.v2.Type.Aggregate.Sum.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Aggregate.Sum.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Sum getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Sum build() { + com.google.bigtable.v2.Type.Aggregate.Sum result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Sum buildPartial() { + com.google.bigtable.v2.Type.Aggregate.Sum result = + new com.google.bigtable.v2.Type.Aggregate.Sum(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Aggregate.Sum) { + return mergeFrom((com.google.bigtable.v2.Type.Aggregate.Sum) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Aggregate.Sum other) { + if (other == com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Aggregate.Sum) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Aggregate.Sum) + private static final com.google.bigtable.v2.Type.Aggregate.Sum DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Aggregate.Sum(); + } + + public static com.google.bigtable.v2.Type.Aggregate.Sum getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sum parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Aggregate.Sum getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MaxOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Aggregate.Max) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the max of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Max} + */ + public static final class Max extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Max) + MaxOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Max"); + } + + // Use Max.newBuilder() to construct. + private Max(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Max() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Max_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Max.class, + com.google.bigtable.v2.Type.Aggregate.Max.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Aggregate.Max)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Aggregate.Max other = + (com.google.bigtable.v2.Type.Aggregate.Max) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max 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.Type.Aggregate.Max parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max 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.Type.Aggregate.Max parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Aggregate.Max 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the max of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Max} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Aggregate.Max) + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Max_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Max.class, + com.google.bigtable.v2.Type.Aggregate.Max.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Aggregate.Max.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Max getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Max build() { + com.google.bigtable.v2.Type.Aggregate.Max result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Max buildPartial() { + com.google.bigtable.v2.Type.Aggregate.Max result = + new com.google.bigtable.v2.Type.Aggregate.Max(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Aggregate.Max) { + return mergeFrom((com.google.bigtable.v2.Type.Aggregate.Max) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Aggregate.Max other) { + if (other == com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Aggregate.Max) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Aggregate.Max) + private static final com.google.bigtable.v2.Type.Aggregate.Max DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Aggregate.Max(); + } + + public static com.google.bigtable.v2.Type.Aggregate.Max getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Max parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Aggregate.Max getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MinOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Aggregate.Min) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes the min of the input values.
+     * Allowed input: `Int64`
+     * State: same as input
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Min} + */ + public static final class Min extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Min) + MinOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Min"); + } + + // Use Min.newBuilder() to construct. + private Min(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Min() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Min_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Min.class, + com.google.bigtable.v2.Type.Aggregate.Min.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Aggregate.Min)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Aggregate.Min other = + (com.google.bigtable.v2.Type.Aggregate.Min) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min 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.Type.Aggregate.Min parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min 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.Type.Aggregate.Min parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Aggregate.Min 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes the min of the input values.
+       * Allowed input: `Int64`
+       * State: same as input
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.Min} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Aggregate.Min) + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Min_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.Min.class, + com.google.bigtable.v2.Type.Aggregate.Min.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Aggregate.Min.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Min getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Min build() { + com.google.bigtable.v2.Type.Aggregate.Min result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Min buildPartial() { + com.google.bigtable.v2.Type.Aggregate.Min result = + new com.google.bigtable.v2.Type.Aggregate.Min(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Aggregate.Min) { + return mergeFrom((com.google.bigtable.v2.Type.Aggregate.Min) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Aggregate.Min other) { + if (other == com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Aggregate.Min) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Aggregate.Min) + private static final com.google.bigtable.v2.Type.Aggregate.Min DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Aggregate.Min(); + } + + public static com.google.bigtable.v2.Type.Aggregate.Min getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Min parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Aggregate.Min getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HyperLogLogPlusPlusUniqueCountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * Computes an approximate unique count over the input values. When using
+     * raw data as input, be careful to use a consistent encoding. Otherwise
+     * the same value encoded differently could count more than once, or two
+     * distinct values could count as identical.
+     * Input: Any, or omit for Raw
+     * State: TBD
+     * Special state conversions: `Int64` (the unique count estimate)
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} + */ + public static final class HyperLogLogPlusPlusUniqueCount + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + HyperLogLogPlusPlusUniqueCountOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HyperLogLogPlusPlusUniqueCount"); + } + + // Use HyperLogLogPlusPlusUniqueCount.newBuilder() to construct. + private HyperLogLogPlusPlusUniqueCount( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private HyperLogLogPlusPlusUniqueCount() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.class, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Type.Aggregate.HyperLogLogPlusPlusUniqueCount)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount other = + (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount 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.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount 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.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Aggregate.HyperLogLogPlusPlusUniqueCount 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Computes an approximate unique count over the input values. When using
+       * raw data as input, be careful to use a consistent encoding. Otherwise
+       * the same value encoded differently could count more than once, or two
+       * distinct values could count as identical.
+       * Input: Any, or omit for Raw
+       * State: TBD
+       * Special state conversions: `Int64` (the unique count estimate)
+       * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.class, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @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.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount build() { + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount buildPartial() { + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount result = + new com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) { + return mergeFrom( + (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount other) { + if (other + == com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + private static final com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount(); + } + + public static com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HyperLogLogPlusPlusUniqueCount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int aggregatorCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object aggregator_; + + public enum AggregatorCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SUM(4), + HLLPP_UNIQUE_COUNT(5), + MAX(6), + MIN(7), + AGGREGATOR_NOT_SET(0); + private final int value; + + private AggregatorCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AggregatorCase valueOf(int value) { + return forNumber(value); + } + + public static AggregatorCase forNumber(int value) { + switch (value) { + case 4: + return SUM; + case 5: + return HLLPP_UNIQUE_COUNT; + case 6: + return MAX; + case 7: + return MIN; + case 0: + return AGGREGATOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AggregatorCase getAggregatorCase() { + return AggregatorCase.forNumber(aggregatorCase_); + } + + public static final int INPUT_TYPE_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Type inputType_; + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + @java.lang.Override + public boolean hasInputType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return The inputType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getInputType() { + return inputType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : inputType_; + } + + /** + * + * + *
+     * Type of the inputs that are accumulated by this `Aggregate`.
+     * Use `AddInput` mutations to accumulate new inputs.
+     * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getInputTypeOrBuilder() { + return inputType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : inputType_; + } + + public static final int STATE_TYPE_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Type stateType_; + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + @java.lang.Override + public boolean hasStateType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getStateType() { + return stateType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : stateType_; + } + + /** + * + * + *
+     * Output only. Type that holds the internal accumulator state for the
+     * `Aggregate`. This is a function of the `input_type` and `aggregator`
+     * chosen.
+     * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getStateTypeOrBuilder() { + return stateType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : stateType_; + } + + public static final int SUM_FIELD_NUMBER = 4; + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + @java.lang.Override + public boolean hasSum() { + return aggregatorCase_ == 4; + } + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Sum getSum() { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + /** + * + * + *
+     * Sum aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder() { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + + public static final int HLLPP_UNIQUE_COUNT_FIELD_NUMBER = 5; + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + @java.lang.Override + public boolean hasHllppUniqueCount() { + return aggregatorCase_ == 5; + } + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getHllppUniqueCount() { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + /** + * + * + *
+     * HyperLogLogPlusPlusUniqueCount aggregator.
+     * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder() { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + + public static final int MAX_FIELD_NUMBER = 6; + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return aggregatorCase_ == 6; + } + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Max getMax() { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + /** + * + * + *
+     * Max aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder() { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + + public static final int MIN_FIELD_NUMBER = 7; + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + @java.lang.Override + public boolean hasMin() { + return aggregatorCase_ == 7; + } + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Min getMin() { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + /** + * + * + *
+     * Min aggregator.
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder() { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInputType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStateType()); + } + if (aggregatorCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_); + } + if (aggregatorCase_ == 5) { + output.writeMessage( + 5, (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) aggregator_); + } + if (aggregatorCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_); + } + if (aggregatorCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputType()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStateType()); + } + if (aggregatorCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_); + } + if (aggregatorCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) aggregator_); + } + if (aggregatorCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_); + } + if (aggregatorCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_); + } + size += getUnknownFields().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.Type.Aggregate)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Aggregate other = (com.google.bigtable.v2.Type.Aggregate) obj; + + if (hasInputType() != other.hasInputType()) return false; + if (hasInputType()) { + if (!getInputType().equals(other.getInputType())) return false; + } + if (hasStateType() != other.hasStateType()) return false; + if (hasStateType()) { + if (!getStateType().equals(other.getStateType())) return false; + } + if (!getAggregatorCase().equals(other.getAggregatorCase())) return false; + switch (aggregatorCase_) { + case 4: + if (!getSum().equals(other.getSum())) return false; + break; + case 5: + if (!getHllppUniqueCount().equals(other.getHllppUniqueCount())) return false; + break; + case 6: + if (!getMax().equals(other.getMax())) return false; + break; + case 7: + if (!getMin().equals(other.getMin())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputType()) { + hash = (37 * hash) + INPUT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInputType().hashCode(); + } + if (hasStateType()) { + hash = (37 * hash) + STATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStateType().hashCode(); + } + switch (aggregatorCase_) { + case 4: + hash = (37 * hash) + SUM_FIELD_NUMBER; + hash = (53 * hash) + getSum().hashCode(); + break; + case 5: + hash = (37 * hash) + HLLPP_UNIQUE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getHllppUniqueCount().hashCode(); + break; + case 6: + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + getMax().hashCode(); + break; + case 7: + hash = (37 * hash) + MIN_FIELD_NUMBER; + hash = (53 * hash) + getMin().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate 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.Type.Aggregate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate 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.Type.Aggregate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type.Aggregate 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A value that combines incremental updates into a summarized value.
+     *
+     * Data is never directly written or read using type `Aggregate`. Writes
+     * provide either the `input_type` or `state_type`, and reads always return
+     * the `state_type` .
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type.Aggregate) + com.google.bigtable.v2.Type.AggregateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.Aggregate.class, + com.google.bigtable.v2.Type.Aggregate.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.Aggregate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInputTypeFieldBuilder(); + internalGetStateTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputType_ = null; + if (inputTypeBuilder_ != null) { + inputTypeBuilder_.dispose(); + inputTypeBuilder_ = null; + } + stateType_ = null; + if (stateTypeBuilder_ != null) { + stateTypeBuilder_.dispose(); + stateTypeBuilder_ = null; + } + if (sumBuilder_ != null) { + sumBuilder_.clear(); + } + if (hllppUniqueCountBuilder_ != null) { + hllppUniqueCountBuilder_.clear(); + } + if (maxBuilder_ != null) { + maxBuilder_.clear(); + } + if (minBuilder_ != null) { + minBuilder_.clear(); + } + aggregatorCase_ = 0; + aggregator_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_Aggregate_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate build() { + com.google.bigtable.v2.Type.Aggregate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate buildPartial() { + com.google.bigtable.v2.Type.Aggregate result = + new com.google.bigtable.v2.Type.Aggregate(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type.Aggregate result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputType_ = inputTypeBuilder_ == null ? inputType_ : inputTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateType_ = stateTypeBuilder_ == null ? stateType_ : stateTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type.Aggregate result) { + result.aggregatorCase_ = aggregatorCase_; + result.aggregator_ = this.aggregator_; + if (aggregatorCase_ == 4 && sumBuilder_ != null) { + result.aggregator_ = sumBuilder_.build(); + } + if (aggregatorCase_ == 5 && hllppUniqueCountBuilder_ != null) { + result.aggregator_ = hllppUniqueCountBuilder_.build(); + } + if (aggregatorCase_ == 6 && maxBuilder_ != null) { + result.aggregator_ = maxBuilder_.build(); + } + if (aggregatorCase_ == 7 && minBuilder_ != null) { + result.aggregator_ = minBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type.Aggregate) { + return mergeFrom((com.google.bigtable.v2.Type.Aggregate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type.Aggregate other) { + if (other == com.google.bigtable.v2.Type.Aggregate.getDefaultInstance()) return this; + if (other.hasInputType()) { + mergeInputType(other.getInputType()); + } + if (other.hasStateType()) { + mergeStateType(other.getStateType()); + } + switch (other.getAggregatorCase()) { + case SUM: + { + mergeSum(other.getSum()); + break; + } + case HLLPP_UNIQUE_COUNT: + { + mergeHllppUniqueCount(other.getHllppUniqueCount()); + break; + } + case MAX: + { + mergeMax(other.getMax()); + break; + } + case MIN: + { + mergeMin(other.getMin()); + break; + } + case AGGREGATOR_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetInputTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStateTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(internalGetSumFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetHllppUniqueCountFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetMaxFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(internalGetMinFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int aggregatorCase_ = 0; + private java.lang.Object aggregator_; + + public AggregatorCase getAggregatorCase() { + return AggregatorCase.forNumber(aggregatorCase_); + } + + public Builder clearAggregator() { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type inputType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + inputTypeBuilder_; + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return Whether the inputType field is set. + */ + public boolean hasInputType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + * + * @return The inputType. + */ + public com.google.bigtable.v2.Type getInputType() { + if (inputTypeBuilder_ == null) { + return inputType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : inputType_; + } else { + return inputTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public Builder setInputType(com.google.bigtable.v2.Type value) { + if (inputTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputType_ = value; + } else { + inputTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public Builder setInputType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (inputTypeBuilder_ == null) { + inputType_ = builderForValue.build(); + } else { + inputTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public Builder mergeInputType(com.google.bigtable.v2.Type value) { + if (inputTypeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && inputType_ != null + && inputType_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getInputTypeBuilder().mergeFrom(value); + } else { + inputType_ = value; + } + } else { + inputTypeBuilder_.mergeFrom(value); + } + if (inputType_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public Builder clearInputType() { + bitField0_ = (bitField0_ & ~0x00000001); + inputType_ = null; + if (inputTypeBuilder_ != null) { + inputTypeBuilder_.dispose(); + inputTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public com.google.bigtable.v2.Type.Builder getInputTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetInputTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + public com.google.bigtable.v2.TypeOrBuilder getInputTypeOrBuilder() { + if (inputTypeBuilder_ != null) { + return inputTypeBuilder_.getMessageOrBuilder(); + } else { + return inputType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : inputType_; + } + } + + /** + * + * + *
+       * Type of the inputs that are accumulated by this `Aggregate`.
+       * Use `AddInput` mutations to accumulate new inputs.
+       * 
+ * + * .google.bigtable.v2.Type input_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetInputTypeFieldBuilder() { + if (inputTypeBuilder_ == null) { + inputTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getInputType(), getParentForChildren(), isClean()); + inputType_ = null; + } + return inputTypeBuilder_; + } + + private com.google.bigtable.v2.Type stateType_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + stateTypeBuilder_; + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateType field is set. + */ + public boolean hasStateType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateType. + */ + public com.google.bigtable.v2.Type getStateType() { + if (stateTypeBuilder_ == null) { + return stateType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : stateType_; + } else { + return stateTypeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateType(com.google.bigtable.v2.Type value) { + if (stateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateType_ = value; + } else { + stateTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (stateTypeBuilder_ == null) { + stateType_ = builderForValue.build(); + } else { + stateTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateType(com.google.bigtable.v2.Type value) { + if (stateTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stateType_ != null + && stateType_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getStateTypeBuilder().mergeFrom(value); + } else { + stateType_ = value; + } + } else { + stateTypeBuilder_.mergeFrom(value); + } + if (stateType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateType() { + bitField0_ = (bitField0_ & ~0x00000002); + stateType_ = null; + if (stateTypeBuilder_ != null) { + stateTypeBuilder_.dispose(); + stateTypeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.Type.Builder getStateTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.TypeOrBuilder getStateTypeOrBuilder() { + if (stateTypeBuilder_ != null) { + return stateTypeBuilder_.getMessageOrBuilder(); + } else { + return stateType_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : stateType_; + } + } + + /** + * + * + *
+       * Output only. Type that holds the internal accumulator state for the
+       * `Aggregate`. This is a function of the `input_type` and `aggregator`
+       * chosen.
+       * 
+ * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetStateTypeFieldBuilder() { + if (stateTypeBuilder_ == null) { + stateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getStateType(), getParentForChildren(), isClean()); + stateType_ = null; + } + return stateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Sum, + com.google.bigtable.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder> + sumBuilder_; + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return Whether the sum field is set. + */ + @java.lang.Override + public boolean hasSum() { + return aggregatorCase_ == 4; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + * + * @return The sum. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Sum getSum() { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } else { + if (aggregatorCase_ == 4) { + return sumBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder setSum(com.google.bigtable.v2.Type.Aggregate.Sum value) { + if (sumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + sumBuilder_.setMessage(value); + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder setSum(com.google.bigtable.v2.Type.Aggregate.Sum.Builder builderForValue) { + if (sumBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + sumBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder mergeSum(com.google.bigtable.v2.Type.Aggregate.Sum value) { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4 + && aggregator_ != com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.Sum.newBuilder( + (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 4) { + sumBuilder_.mergeFrom(value); + } else { + sumBuilder_.setMessage(value); + } + } + aggregatorCase_ = 4; + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + public Builder clearSum() { + if (sumBuilder_ == null) { + if (aggregatorCase_ == 4) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 4) { + aggregatorCase_ = 0; + aggregator_ = null; + } + sumBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + public com.google.bigtable.v2.Type.Aggregate.Sum.Builder getSumBuilder() { + return internalGetSumFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.SumOrBuilder getSumOrBuilder() { + if ((aggregatorCase_ == 4) && (sumBuilder_ != null)) { + return sumBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 4) { + return (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Sum aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Sum sum = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Sum, + com.google.bigtable.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder> + internalGetSumFieldBuilder() { + if (sumBuilder_ == null) { + if (!(aggregatorCase_ == 4)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + sumBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Sum, + com.google.bigtable.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder>( + (com.google.bigtable.v2.Type.Aggregate.Sum) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 4; + onChanged(); + return sumBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder> + hllppUniqueCountBuilder_; + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return Whether the hllppUniqueCount field is set. + */ + @java.lang.Override + public boolean hasHllppUniqueCount() { + return aggregatorCase_ == 5; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + * + * @return The hllppUniqueCount. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + getHllppUniqueCount() { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } else { + if (aggregatorCase_ == 5) { + return hllppUniqueCountBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder setHllppUniqueCount( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount value) { + if (hllppUniqueCountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + hllppUniqueCountBuilder_.setMessage(value); + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder setHllppUniqueCount( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + builderForValue) { + if (hllppUniqueCountBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + hllppUniqueCountBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder mergeHllppUniqueCount( + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount value) { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5 + && aggregator_ + != com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance()) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.newBuilder( + (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 5) { + hllppUniqueCountBuilder_.mergeFrom(value); + } else { + hllppUniqueCountBuilder_.setMessage(value); + } + } + aggregatorCase_ = 5; + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public Builder clearHllppUniqueCount() { + if (hllppUniqueCountBuilder_ == null) { + if (aggregatorCase_ == 5) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 5) { + aggregatorCase_ = 0; + aggregator_ = null; + } + hllppUniqueCountBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder + getHllppUniqueCountBuilder() { + return internalGetHllppUniqueCountFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder + getHllppUniqueCountOrBuilder() { + if ((aggregatorCase_ == 5) && (hllppUniqueCountBuilder_ != null)) { + return hllppUniqueCountBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 5) { + return (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * HyperLogLogPlusPlusUniqueCount aggregator.
+       * 
+ * + * + * .google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder> + internalGetHllppUniqueCountFieldBuilder() { + if (hllppUniqueCountBuilder_ == null) { + if (!(aggregatorCase_ == 5)) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + hllppUniqueCountBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder>( + (com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 5; + onChanged(); + return hllppUniqueCountBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Max, + com.google.bigtable.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder> + maxBuilder_; + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return Whether the max field is set. + */ + @java.lang.Override + public boolean hasMax() { + return aggregatorCase_ == 6; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + * + * @return The max. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Max getMax() { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } else { + if (aggregatorCase_ == 6) { + return maxBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + public Builder setMax(com.google.bigtable.v2.Type.Aggregate.Max value) { + if (maxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + maxBuilder_.setMessage(value); + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + public Builder setMax(com.google.bigtable.v2.Type.Aggregate.Max.Builder builderForValue) { + if (maxBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + maxBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + public Builder mergeMax(com.google.bigtable.v2.Type.Aggregate.Max value) { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6 + && aggregator_ != com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.Max.newBuilder( + (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 6) { + maxBuilder_.mergeFrom(value); + } else { + maxBuilder_.setMessage(value); + } + } + aggregatorCase_ = 6; + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + public Builder clearMax() { + if (maxBuilder_ == null) { + if (aggregatorCase_ == 6) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 6) { + aggregatorCase_ = 0; + aggregator_ = null; + } + maxBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + public com.google.bigtable.v2.Type.Aggregate.Max.Builder getMaxBuilder() { + return internalGetMaxFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder getMaxOrBuilder() { + if ((aggregatorCase_ == 6) && (maxBuilder_ != null)) { + return maxBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Max aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Max max = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Max, + com.google.bigtable.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder> + internalGetMaxFieldBuilder() { + if (maxBuilder_ == null) { + if (!(aggregatorCase_ == 6)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + maxBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Max, + com.google.bigtable.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder>( + (com.google.bigtable.v2.Type.Aggregate.Max) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 6; + onChanged(); + return maxBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Min, + com.google.bigtable.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder> + minBuilder_; + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return Whether the min field is set. + */ + @java.lang.Override + public boolean hasMin() { + return aggregatorCase_ == 7; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + * + * @return The min. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.Min getMin() { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } else { + if (aggregatorCase_ == 7) { + return minBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + public Builder setMin(com.google.bigtable.v2.Type.Aggregate.Min value) { + if (minBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregator_ = value; + onChanged(); + } else { + minBuilder_.setMessage(value); + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + public Builder setMin(com.google.bigtable.v2.Type.Aggregate.Min.Builder builderForValue) { + if (minBuilder_ == null) { + aggregator_ = builderForValue.build(); + onChanged(); + } else { + minBuilder_.setMessage(builderForValue.build()); + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + public Builder mergeMin(com.google.bigtable.v2.Type.Aggregate.Min value) { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7 + && aggregator_ != com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance()) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.Min.newBuilder( + (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregator_ = value; + } + onChanged(); + } else { + if (aggregatorCase_ == 7) { + minBuilder_.mergeFrom(value); + } else { + minBuilder_.setMessage(value); + } + } + aggregatorCase_ = 7; + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + public Builder clearMin() { + if (minBuilder_ == null) { + if (aggregatorCase_ == 7) { + aggregatorCase_ = 0; + aggregator_ = null; + onChanged(); + } + } else { + if (aggregatorCase_ == 7) { + aggregatorCase_ = 0; + aggregator_ = null; + } + minBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + public com.google.bigtable.v2.Type.Aggregate.Min.Builder getMinBuilder() { + return internalGetMinFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate.MinOrBuilder getMinOrBuilder() { + if ((aggregatorCase_ == 7) && (minBuilder_ != null)) { + return minBuilder_.getMessageOrBuilder(); + } else { + if (aggregatorCase_ == 7) { + return (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_; + } + return com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + } + + /** + * + * + *
+       * Min aggregator.
+       * 
+ * + * .google.bigtable.v2.Type.Aggregate.Min min = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Min, + com.google.bigtable.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder> + internalGetMinFieldBuilder() { + if (minBuilder_ == null) { + if (!(aggregatorCase_ == 7)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + minBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate.Min, + com.google.bigtable.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder>( + (com.google.bigtable.v2.Type.Aggregate.Min) aggregator_, + getParentForChildren(), + isClean()); + aggregator_ = null; + } + aggregatorCase_ = 7; + onChanged(); + return minBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type.Aggregate) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type.Aggregate) + private static final com.google.bigtable.v2.Type.Aggregate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type.Aggregate(); + } + + public static com.google.bigtable.v2.Type.Aggregate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Aggregate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type.Aggregate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int kindCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BYTES_TYPE(1), + STRING_TYPE(2), + INT64_TYPE(5), + FLOAT32_TYPE(12), + FLOAT64_TYPE(9), + BOOL_TYPE(8), + TIMESTAMP_TYPE(10), + DATE_TYPE(11), + AGGREGATE_TYPE(6), + STRUCT_TYPE(7), + ARRAY_TYPE(3), + MAP_TYPE(4), + PROTO_TYPE(13), + ENUM_TYPE(14), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: + return BYTES_TYPE; + case 2: + return STRING_TYPE; + case 5: + return INT64_TYPE; + case 12: + return FLOAT32_TYPE; + case 9: + return FLOAT64_TYPE; + case 8: + return BOOL_TYPE; + case 10: + return TIMESTAMP_TYPE; + case 11: + return DATE_TYPE; + case 6: + return AGGREGATE_TYPE; + case 7: + return STRUCT_TYPE; + case 3: + return ARRAY_TYPE; + case 4: + return MAP_TYPE; + case 13: + return PROTO_TYPE; + case 14: + return ENUM_TYPE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int BYTES_TYPE_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return kindCase_ == 1; + } + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes getBytesType() { + if (kindCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes) kind_; + } + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if (kindCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes) kind_; + } + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + + public static final int STRING_TYPE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return kindCase_ == 2; + } + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String getStringType() { + if (kindCase_ == 2) { + return (com.google.bigtable.v2.Type.String) kind_; + } + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.StringOrBuilder getStringTypeOrBuilder() { + if (kindCase_ == 2) { + return (com.google.bigtable.v2.Type.String) kind_; + } + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + + public static final int INT64_TYPE_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + @java.lang.Override + public boolean hasInt64Type() { + return kindCase_ == 5; + } + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64 getInt64Type() { + if (kindCase_ == 5) { + return (com.google.bigtable.v2.Type.Int64) kind_; + } + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64OrBuilder getInt64TypeOrBuilder() { + if (kindCase_ == 5) { + return (com.google.bigtable.v2.Type.Int64) kind_; + } + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + + public static final int FLOAT32_TYPE_FIELD_NUMBER = 12; + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + @java.lang.Override + public boolean hasFloat32Type() { + return kindCase_ == 12; + } + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float32 getFloat32Type() { + if (kindCase_ == 12) { + return (com.google.bigtable.v2.Type.Float32) kind_; + } + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder() { + if (kindCase_ == 12) { + return (com.google.bigtable.v2.Type.Float32) kind_; + } + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + + public static final int FLOAT64_TYPE_FIELD_NUMBER = 9; + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + @java.lang.Override + public boolean hasFloat64Type() { + return kindCase_ == 9; + } + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float64 getFloat64Type() { + if (kindCase_ == 9) { + return (com.google.bigtable.v2.Type.Float64) kind_; + } + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder() { + if (kindCase_ == 9) { + return (com.google.bigtable.v2.Type.Float64) kind_; + } + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + + public static final int BOOL_TYPE_FIELD_NUMBER = 8; + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + @java.lang.Override + public boolean hasBoolType() { + return kindCase_ == 8; + } + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bool getBoolType() { + if (kindCase_ == 8) { + return (com.google.bigtable.v2.Type.Bool) kind_; + } + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.BoolOrBuilder getBoolTypeOrBuilder() { + if (kindCase_ == 8) { + return (com.google.bigtable.v2.Type.Bool) kind_; + } + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + + public static final int TIMESTAMP_TYPE_FIELD_NUMBER = 10; + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + @java.lang.Override + public boolean hasTimestampType() { + return kindCase_ == 10; + } + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp getTimestampType() { + if (kindCase_ == 10) { + return (com.google.bigtable.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder() { + if (kindCase_ == 10) { + return (com.google.bigtable.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + + public static final int DATE_TYPE_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + @java.lang.Override + public boolean hasDateType() { + return kindCase_ == 11; + } + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Date getDateType() { + if (kindCase_ == 11) { + return (com.google.bigtable.v2.Type.Date) kind_; + } + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.DateOrBuilder getDateTypeOrBuilder() { + if (kindCase_ == 11) { + return (com.google.bigtable.v2.Type.Date) kind_; + } + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + + public static final int AGGREGATE_TYPE_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + @java.lang.Override + public boolean hasAggregateType() { + return kindCase_ == 6; + } + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate getAggregateType() { + if (kindCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder() { + if (kindCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + + public static final int STRUCT_TYPE_FIELD_NUMBER = 7; + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + @java.lang.Override + public boolean hasStructType() { + return kindCase_ == 7; + } + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct getStructType() { + if (kindCase_ == 7) { + return (com.google.bigtable.v2.Type.Struct) kind_; + } + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.StructOrBuilder getStructTypeOrBuilder() { + if (kindCase_ == 7) { + return (com.google.bigtable.v2.Type.Struct) kind_; + } + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + + public static final int ARRAY_TYPE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + @java.lang.Override + public boolean hasArrayType() { + return kindCase_ == 3; + } + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Array getArrayType() { + if (kindCase_ == 3) { + return (com.google.bigtable.v2.Type.Array) kind_; + } + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder() { + if (kindCase_ == 3) { + return (com.google.bigtable.v2.Type.Array) kind_; + } + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + + public static final int MAP_TYPE_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + @java.lang.Override + public boolean hasMapType() { + return kindCase_ == 4; + } + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Map getMapType() { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.Type.Map) kind_; + } + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.MapOrBuilder getMapTypeOrBuilder() { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.Type.Map) kind_; + } + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + + public static final int PROTO_TYPE_FIELD_NUMBER = 13; + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + @java.lang.Override + public boolean hasProtoType() { + return kindCase_ == 13; + } + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Proto getProtoType() { + if (kindCase_ == 13) { + return (com.google.bigtable.v2.Type.Proto) kind_; + } + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder() { + if (kindCase_ == 13) { + return (com.google.bigtable.v2.Type.Proto) kind_; + } + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + + public static final int ENUM_TYPE_FIELD_NUMBER = 14; + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + @java.lang.Override + public boolean hasEnumType() { + return kindCase_ == 14; + } + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Enum getEnumType() { + if (kindCase_ == 14) { + return (com.google.bigtable.v2.Type.Enum) kind_; + } + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.EnumOrBuilder getEnumTypeOrBuilder() { + if (kindCase_ == 14) { + return (com.google.bigtable.v2.Type.Enum) kind_; + } + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.Type.Bytes) kind_); + } + if (kindCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.Type.String) kind_); + } + if (kindCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.Type.Array) kind_); + } + if (kindCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.Type.Map) kind_); + } + if (kindCase_ == 5) { + output.writeMessage(5, (com.google.bigtable.v2.Type.Int64) kind_); + } + if (kindCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.Type.Aggregate) kind_); + } + if (kindCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.v2.Type.Struct) kind_); + } + if (kindCase_ == 8) { + output.writeMessage(8, (com.google.bigtable.v2.Type.Bool) kind_); + } + if (kindCase_ == 9) { + output.writeMessage(9, (com.google.bigtable.v2.Type.Float64) kind_); + } + if (kindCase_ == 10) { + output.writeMessage(10, (com.google.bigtable.v2.Type.Timestamp) kind_); + } + if (kindCase_ == 11) { + output.writeMessage(11, (com.google.bigtable.v2.Type.Date) kind_); + } + if (kindCase_ == 12) { + output.writeMessage(12, (com.google.bigtable.v2.Type.Float32) kind_); + } + if (kindCase_ == 13) { + output.writeMessage(13, (com.google.bigtable.v2.Type.Proto) kind_); + } + if (kindCase_ == 14) { + output.writeMessage(14, (com.google.bigtable.v2.Type.Enum) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.Type.Bytes) kind_); + } + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.Type.String) kind_); + } + if (kindCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.Type.Array) kind_); + } + if (kindCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.Type.Map) kind_); + } + if (kindCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.Type.Int64) kind_); + } + if (kindCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.Type.Aggregate) kind_); + } + if (kindCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.v2.Type.Struct) kind_); + } + if (kindCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.bigtable.v2.Type.Bool) kind_); + } + if (kindCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.bigtable.v2.Type.Float64) kind_); + } + if (kindCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.bigtable.v2.Type.Timestamp) kind_); + } + if (kindCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, (com.google.bigtable.v2.Type.Date) kind_); + } + if (kindCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.bigtable.v2.Type.Float32) kind_); + } + if (kindCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.bigtable.v2.Type.Proto) kind_); + } + if (kindCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, (com.google.bigtable.v2.Type.Enum) kind_); + } + size += getUnknownFields().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.Type)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type other = (com.google.bigtable.v2.Type) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getBytesType().equals(other.getBytesType())) return false; + break; + case 2: + if (!getStringType().equals(other.getStringType())) return false; + break; + case 5: + if (!getInt64Type().equals(other.getInt64Type())) return false; + break; + case 12: + if (!getFloat32Type().equals(other.getFloat32Type())) return false; + break; + case 9: + if (!getFloat64Type().equals(other.getFloat64Type())) return false; + break; + case 8: + if (!getBoolType().equals(other.getBoolType())) return false; + break; + case 10: + if (!getTimestampType().equals(other.getTimestampType())) return false; + break; + case 11: + if (!getDateType().equals(other.getDateType())) return false; + break; + case 6: + if (!getAggregateType().equals(other.getAggregateType())) return false; + break; + case 7: + if (!getStructType().equals(other.getStructType())) return false; + break; + case 3: + if (!getArrayType().equals(other.getArrayType())) return false; + break; + case 4: + if (!getMapType().equals(other.getMapType())) return false; + break; + case 13: + if (!getProtoType().equals(other.getProtoType())) return false; + break; + case 14: + if (!getEnumType().equals(other.getEnumType())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + BYTES_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + break; + case 2: + hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringType().hashCode(); + break; + case 5: + hash = (37 * hash) + INT64_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInt64Type().hashCode(); + break; + case 12: + hash = (37 * hash) + FLOAT32_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFloat32Type().hashCode(); + break; + case 9: + hash = (37 * hash) + FLOAT64_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFloat64Type().hashCode(); + break; + case 8: + hash = (37 * hash) + BOOL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBoolType().hashCode(); + break; + case 10: + hash = (37 * hash) + TIMESTAMP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampType().hashCode(); + break; + case 11: + hash = (37 * hash) + DATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDateType().hashCode(); + break; + case 6: + hash = (37 * hash) + AGGREGATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAggregateType().hashCode(); + break; + case 7: + hash = (37 * hash) + STRUCT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStructType().hashCode(); + break; + case 3: + hash = (37 * hash) + ARRAY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getArrayType().hashCode(); + break; + case 4: + hash = (37 * hash) + MAP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMapType().hashCode(); + break; + case 13: + hash = (37 * hash) + PROTO_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getProtoType().hashCode(); + break; + case 14: + hash = (37 * hash) + ENUM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEnumType().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Type parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type 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.Type parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type 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.Type parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Type parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Type parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Type parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Type 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * `Type` represents the type of data that is written to, read from, or stored
+   * in Bigtable. It is heavily based on the GoogleSQL standard to help maintain
+   * familiarity and consistency across products and features.
+   *
+   * For compatibility with Bigtable's existing untyped APIs, each `Type` includes
+   * an `Encoding` which describes how to convert to or from the underlying data.
+   *
+   * Each encoding can operate in one of two modes:
+   *
+   * - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)`
+   * if and only if `X <= Y`. This is useful anywhere sort order is important,
+   * for example when encoding keys.
+   * - Distinct: In this mode, Bigtable guarantees that if `X != Y` then
+   * `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For
+   * example, both `{'foo': '1', 'bar': '2'}` and `{'bar': '2', 'foo': '1'}`
+   * are valid encodings of the same JSON value.
+   *
+   * The API clearly documents which mode is used wherever an encoding can be
+   * configured. Each encoding also documents which values are supported in which
+   * modes. For example, when encoding INT64 as a numeric STRING, negative numbers
+   * cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but
+   * `STRING("-00001") > STRING("00001")`.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Type} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Type) + com.google.bigtable.v2.TypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.TypesProto.internal_static_google_bigtable_v2_Type_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.TypesProto + .internal_static_google_bigtable_v2_Type_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Type.class, com.google.bigtable.v2.Type.Builder.class); + } + + // Construct using com.google.bigtable.v2.Type.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bytesTypeBuilder_ != null) { + bytesTypeBuilder_.clear(); + } + if (stringTypeBuilder_ != null) { + stringTypeBuilder_.clear(); + } + if (int64TypeBuilder_ != null) { + int64TypeBuilder_.clear(); + } + if (float32TypeBuilder_ != null) { + float32TypeBuilder_.clear(); + } + if (float64TypeBuilder_ != null) { + float64TypeBuilder_.clear(); + } + if (boolTypeBuilder_ != null) { + boolTypeBuilder_.clear(); + } + if (timestampTypeBuilder_ != null) { + timestampTypeBuilder_.clear(); + } + if (dateTypeBuilder_ != null) { + dateTypeBuilder_.clear(); + } + if (aggregateTypeBuilder_ != null) { + aggregateTypeBuilder_.clear(); + } + if (structTypeBuilder_ != null) { + structTypeBuilder_.clear(); + } + if (arrayTypeBuilder_ != null) { + arrayTypeBuilder_.clear(); + } + if (mapTypeBuilder_ != null) { + mapTypeBuilder_.clear(); + } + if (protoTypeBuilder_ != null) { + protoTypeBuilder_.clear(); + } + if (enumTypeBuilder_ != null) { + enumTypeBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.TypesProto.internal_static_google_bigtable_v2_Type_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Type getDefaultInstanceForType() { + return com.google.bigtable.v2.Type.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Type build() { + com.google.bigtable.v2.Type result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Type buildPartial() { + com.google.bigtable.v2.Type result = new com.google.bigtable.v2.Type(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Type result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Type result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && bytesTypeBuilder_ != null) { + result.kind_ = bytesTypeBuilder_.build(); + } + if (kindCase_ == 2 && stringTypeBuilder_ != null) { + result.kind_ = stringTypeBuilder_.build(); + } + if (kindCase_ == 5 && int64TypeBuilder_ != null) { + result.kind_ = int64TypeBuilder_.build(); + } + if (kindCase_ == 12 && float32TypeBuilder_ != null) { + result.kind_ = float32TypeBuilder_.build(); + } + if (kindCase_ == 9 && float64TypeBuilder_ != null) { + result.kind_ = float64TypeBuilder_.build(); + } + if (kindCase_ == 8 && boolTypeBuilder_ != null) { + result.kind_ = boolTypeBuilder_.build(); + } + if (kindCase_ == 10 && timestampTypeBuilder_ != null) { + result.kind_ = timestampTypeBuilder_.build(); + } + if (kindCase_ == 11 && dateTypeBuilder_ != null) { + result.kind_ = dateTypeBuilder_.build(); + } + if (kindCase_ == 6 && aggregateTypeBuilder_ != null) { + result.kind_ = aggregateTypeBuilder_.build(); + } + if (kindCase_ == 7 && structTypeBuilder_ != null) { + result.kind_ = structTypeBuilder_.build(); + } + if (kindCase_ == 3 && arrayTypeBuilder_ != null) { + result.kind_ = arrayTypeBuilder_.build(); + } + if (kindCase_ == 4 && mapTypeBuilder_ != null) { + result.kind_ = mapTypeBuilder_.build(); + } + if (kindCase_ == 13 && protoTypeBuilder_ != null) { + result.kind_ = protoTypeBuilder_.build(); + } + if (kindCase_ == 14 && enumTypeBuilder_ != null) { + result.kind_ = enumTypeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Type) { + return mergeFrom((com.google.bigtable.v2.Type) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Type other) { + if (other == com.google.bigtable.v2.Type.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case BYTES_TYPE: + { + mergeBytesType(other.getBytesType()); + break; + } + case STRING_TYPE: + { + mergeStringType(other.getStringType()); + break; + } + case INT64_TYPE: + { + mergeInt64Type(other.getInt64Type()); + break; + } + case FLOAT32_TYPE: + { + mergeFloat32Type(other.getFloat32Type()); + break; + } + case FLOAT64_TYPE: + { + mergeFloat64Type(other.getFloat64Type()); + break; + } + case BOOL_TYPE: + { + mergeBoolType(other.getBoolType()); + break; + } + case TIMESTAMP_TYPE: + { + mergeTimestampType(other.getTimestampType()); + break; + } + case DATE_TYPE: + { + mergeDateType(other.getDateType()); + break; + } + case AGGREGATE_TYPE: + { + mergeAggregateType(other.getAggregateType()); + break; + } + case STRUCT_TYPE: + { + mergeStructType(other.getStructType()); + break; + } + case ARRAY_TYPE: + { + mergeArrayType(other.getArrayType()); + break; + } + case MAP_TYPE: + { + mergeMapType(other.getMapType()); + break; + } + case PROTO_TYPE: + { + mergeProtoType(other.getProtoType()); + break; + } + case ENUM_TYPE: + { + mergeEnumType(other.getEnumType()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetStringTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetArrayTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetMapTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetInt64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetAggregateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetStructTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetBoolTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetFloat64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetTimestampTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetDateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 11; + break; + } // case 90 + case 98: + { + input.readMessage( + internalGetFloat32TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetProtoTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 13; + break; + } // case 106 + case 114: + { + input.readMessage( + internalGetEnumTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 14; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + bytesTypeBuilder_; + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return kindCase_ == 1; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bytes getBytesType() { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes) kind_; + } + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return bytesTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + public Builder setBytesType(com.google.bigtable.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + bytesTypeBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + public Builder setBytesType(com.google.bigtable.v2.Type.Bytes.Builder builderForValue) { + if (bytesTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + bytesTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + public Builder mergeBytesType(com.google.bigtable.v2.Type.Bytes value) { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1 && kind_ != com.google.bigtable.v2.Type.Bytes.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Bytes.newBuilder( + (com.google.bigtable.v2.Type.Bytes) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + bytesTypeBuilder_.mergeFrom(value); + } else { + bytesTypeBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + public Builder clearBytesType() { + if (bytesTypeBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + bytesTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + public com.google.bigtable.v2.Type.Bytes.Builder getBytesTypeBuilder() { + return internalGetBytesTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder() { + if ((kindCase_ == 1) && (bytesTypeBuilder_ != null)) { + return bytesTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (com.google.bigtable.v2.Type.Bytes) kind_; + } + return com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bytes
+     * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + internalGetBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder>( + (com.google.bigtable.v2.Type.Bytes) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return bytesTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String, + com.google.bigtable.v2.Type.String.Builder, + com.google.bigtable.v2.Type.StringOrBuilder> + stringTypeBuilder_; + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return kindCase_ == 2; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.String getStringType() { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2) { + return (com.google.bigtable.v2.Type.String) kind_; + } + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } else { + if (kindCase_ == 2) { + return stringTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + public Builder setStringType(com.google.bigtable.v2.Type.String value) { + if (stringTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + stringTypeBuilder_.setMessage(value); + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + public Builder setStringType(com.google.bigtable.v2.Type.String.Builder builderForValue) { + if (stringTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + stringTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + public Builder mergeStringType(com.google.bigtable.v2.Type.String value) { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2 && kind_ != com.google.bigtable.v2.Type.String.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.String.newBuilder( + (com.google.bigtable.v2.Type.String) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 2) { + stringTypeBuilder_.mergeFrom(value); + } else { + stringTypeBuilder_.setMessage(value); + } + } + kindCase_ = 2; + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + public Builder clearStringType() { + if (stringTypeBuilder_ == null) { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + } + stringTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + public com.google.bigtable.v2.Type.String.Builder getStringTypeBuilder() { + return internalGetStringTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.StringOrBuilder getStringTypeOrBuilder() { + if ((kindCase_ == 2) && (stringTypeBuilder_ != null)) { + return stringTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 2) { + return (com.google.bigtable.v2.Type.String) kind_; + } + return com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + } + + /** + * + * + *
+     * String
+     * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String, + com.google.bigtable.v2.Type.String.Builder, + com.google.bigtable.v2.Type.StringOrBuilder> + internalGetStringTypeFieldBuilder() { + if (stringTypeBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + stringTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.String, + com.google.bigtable.v2.Type.String.Builder, + com.google.bigtable.v2.Type.StringOrBuilder>( + (com.google.bigtable.v2.Type.String) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 2; + onChanged(); + return stringTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64, + com.google.bigtable.v2.Type.Int64.Builder, + com.google.bigtable.v2.Type.Int64OrBuilder> + int64TypeBuilder_; + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + @java.lang.Override + public boolean hasInt64Type() { + return kindCase_ == 5; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64 getInt64Type() { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5) { + return (com.google.bigtable.v2.Type.Int64) kind_; + } + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } else { + if (kindCase_ == 5) { + return int64TypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + public Builder setInt64Type(com.google.bigtable.v2.Type.Int64 value) { + if (int64TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + int64TypeBuilder_.setMessage(value); + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + public Builder setInt64Type(com.google.bigtable.v2.Type.Int64.Builder builderForValue) { + if (int64TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + int64TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + public Builder mergeInt64Type(com.google.bigtable.v2.Type.Int64 value) { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5 && kind_ != com.google.bigtable.v2.Type.Int64.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Int64.newBuilder( + (com.google.bigtable.v2.Type.Int64) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 5) { + int64TypeBuilder_.mergeFrom(value); + } else { + int64TypeBuilder_.setMessage(value); + } + } + kindCase_ = 5; + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + public Builder clearInt64Type() { + if (int64TypeBuilder_ == null) { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + } + int64TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + public com.google.bigtable.v2.Type.Int64.Builder getInt64TypeBuilder() { + return internalGetInt64TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Int64OrBuilder getInt64TypeOrBuilder() { + if ((kindCase_ == 5) && (int64TypeBuilder_ != null)) { + return int64TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 5) { + return (com.google.bigtable.v2.Type.Int64) kind_; + } + return com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Int64
+     * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64, + com.google.bigtable.v2.Type.Int64.Builder, + com.google.bigtable.v2.Type.Int64OrBuilder> + internalGetInt64TypeFieldBuilder() { + if (int64TypeBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + int64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Int64, + com.google.bigtable.v2.Type.Int64.Builder, + com.google.bigtable.v2.Type.Int64OrBuilder>( + (com.google.bigtable.v2.Type.Int64) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 5; + onChanged(); + return int64TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float32, + com.google.bigtable.v2.Type.Float32.Builder, + com.google.bigtable.v2.Type.Float32OrBuilder> + float32TypeBuilder_; + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + @java.lang.Override + public boolean hasFloat32Type() { + return kindCase_ == 12; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float32 getFloat32Type() { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12) { + return (com.google.bigtable.v2.Type.Float32) kind_; + } + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } else { + if (kindCase_ == 12) { + return float32TypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + public Builder setFloat32Type(com.google.bigtable.v2.Type.Float32 value) { + if (float32TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + float32TypeBuilder_.setMessage(value); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + public Builder setFloat32Type(com.google.bigtable.v2.Type.Float32.Builder builderForValue) { + if (float32TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + float32TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + public Builder mergeFloat32Type(com.google.bigtable.v2.Type.Float32 value) { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12 && kind_ != com.google.bigtable.v2.Type.Float32.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Float32.newBuilder( + (com.google.bigtable.v2.Type.Float32) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 12) { + float32TypeBuilder_.mergeFrom(value); + } else { + float32TypeBuilder_.setMessage(value); + } + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + public Builder clearFloat32Type() { + if (float32TypeBuilder_ == null) { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + } + float32TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + public com.google.bigtable.v2.Type.Float32.Builder getFloat32TypeBuilder() { + return internalGetFloat32TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder() { + if ((kindCase_ == 12) && (float32TypeBuilder_ != null)) { + return float32TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 12) { + return (com.google.bigtable.v2.Type.Float32) kind_; + } + return com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float32
+     * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float32, + com.google.bigtable.v2.Type.Float32.Builder, + com.google.bigtable.v2.Type.Float32OrBuilder> + internalGetFloat32TypeFieldBuilder() { + if (float32TypeBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + float32TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float32, + com.google.bigtable.v2.Type.Float32.Builder, + com.google.bigtable.v2.Type.Float32OrBuilder>( + (com.google.bigtable.v2.Type.Float32) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 12; + onChanged(); + return float32TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float64, + com.google.bigtable.v2.Type.Float64.Builder, + com.google.bigtable.v2.Type.Float64OrBuilder> + float64TypeBuilder_; + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + @java.lang.Override + public boolean hasFloat64Type() { + return kindCase_ == 9; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float64 getFloat64Type() { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9) { + return (com.google.bigtable.v2.Type.Float64) kind_; + } + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } else { + if (kindCase_ == 9) { + return float64TypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + public Builder setFloat64Type(com.google.bigtable.v2.Type.Float64 value) { + if (float64TypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + float64TypeBuilder_.setMessage(value); + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + public Builder setFloat64Type(com.google.bigtable.v2.Type.Float64.Builder builderForValue) { + if (float64TypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + float64TypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + public Builder mergeFloat64Type(com.google.bigtable.v2.Type.Float64 value) { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9 && kind_ != com.google.bigtable.v2.Type.Float64.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Float64.newBuilder( + (com.google.bigtable.v2.Type.Float64) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 9) { + float64TypeBuilder_.mergeFrom(value); + } else { + float64TypeBuilder_.setMessage(value); + } + } + kindCase_ = 9; + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + public Builder clearFloat64Type() { + if (float64TypeBuilder_ == null) { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + } + float64TypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + public com.google.bigtable.v2.Type.Float64.Builder getFloat64TypeBuilder() { + return internalGetFloat64TypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder() { + if ((kindCase_ == 9) && (float64TypeBuilder_ != null)) { + return float64TypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 9) { + return (com.google.bigtable.v2.Type.Float64) kind_; + } + return com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Float64
+     * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float64, + com.google.bigtable.v2.Type.Float64.Builder, + com.google.bigtable.v2.Type.Float64OrBuilder> + internalGetFloat64TypeFieldBuilder() { + if (float64TypeBuilder_ == null) { + if (!(kindCase_ == 9)) { + kind_ = com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + float64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Float64, + com.google.bigtable.v2.Type.Float64.Builder, + com.google.bigtable.v2.Type.Float64OrBuilder>( + (com.google.bigtable.v2.Type.Float64) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 9; + onChanged(); + return float64TypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bool, + com.google.bigtable.v2.Type.Bool.Builder, + com.google.bigtable.v2.Type.BoolOrBuilder> + boolTypeBuilder_; + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + @java.lang.Override + public boolean hasBoolType() { + return kindCase_ == 8; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Bool getBoolType() { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8) { + return (com.google.bigtable.v2.Type.Bool) kind_; + } + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } else { + if (kindCase_ == 8) { + return boolTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + public Builder setBoolType(com.google.bigtable.v2.Type.Bool value) { + if (boolTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + boolTypeBuilder_.setMessage(value); + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + public Builder setBoolType(com.google.bigtable.v2.Type.Bool.Builder builderForValue) { + if (boolTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + boolTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + public Builder mergeBoolType(com.google.bigtable.v2.Type.Bool value) { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8 && kind_ != com.google.bigtable.v2.Type.Bool.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Bool.newBuilder((com.google.bigtable.v2.Type.Bool) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 8) { + boolTypeBuilder_.mergeFrom(value); + } else { + boolTypeBuilder_.setMessage(value); + } + } + kindCase_ = 8; + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + public Builder clearBoolType() { + if (boolTypeBuilder_ == null) { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + } + boolTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + public com.google.bigtable.v2.Type.Bool.Builder getBoolTypeBuilder() { + return internalGetBoolTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.BoolOrBuilder getBoolTypeOrBuilder() { + if ((kindCase_ == 8) && (boolTypeBuilder_ != null)) { + return boolTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 8) { + return (com.google.bigtable.v2.Type.Bool) kind_; + } + return com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Bool
+     * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bool, + com.google.bigtable.v2.Type.Bool.Builder, + com.google.bigtable.v2.Type.BoolOrBuilder> + internalGetBoolTypeFieldBuilder() { + if (boolTypeBuilder_ == null) { + if (!(kindCase_ == 8)) { + kind_ = com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + boolTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Bool, + com.google.bigtable.v2.Type.Bool.Builder, + com.google.bigtable.v2.Type.BoolOrBuilder>( + (com.google.bigtable.v2.Type.Bool) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 8; + onChanged(); + return boolTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp, + com.google.bigtable.v2.Type.Timestamp.Builder, + com.google.bigtable.v2.Type.TimestampOrBuilder> + timestampTypeBuilder_; + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + @java.lang.Override + public boolean hasTimestampType() { + return kindCase_ == 10; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Timestamp getTimestampType() { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10) { + return (com.google.bigtable.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } else { + if (kindCase_ == 10) { + return timestampTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder setTimestampType(com.google.bigtable.v2.Type.Timestamp value) { + if (timestampTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + timestampTypeBuilder_.setMessage(value); + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder setTimestampType(com.google.bigtable.v2.Type.Timestamp.Builder builderForValue) { + if (timestampTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + timestampTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder mergeTimestampType(com.google.bigtable.v2.Type.Timestamp value) { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10 + && kind_ != com.google.bigtable.v2.Type.Timestamp.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Timestamp.newBuilder( + (com.google.bigtable.v2.Type.Timestamp) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 10) { + timestampTypeBuilder_.mergeFrom(value); + } else { + timestampTypeBuilder_.setMessage(value); + } + } + kindCase_ = 10; + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + public Builder clearTimestampType() { + if (timestampTypeBuilder_ == null) { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + } + timestampTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + public com.google.bigtable.v2.Type.Timestamp.Builder getTimestampTypeBuilder() { + return internalGetTimestampTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder() { + if ((kindCase_ == 10) && (timestampTypeBuilder_ != null)) { + return timestampTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 10) { + return (com.google.bigtable.v2.Type.Timestamp) kind_; + } + return com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Timestamp
+     * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp, + com.google.bigtable.v2.Type.Timestamp.Builder, + com.google.bigtable.v2.Type.TimestampOrBuilder> + internalGetTimestampTypeFieldBuilder() { + if (timestampTypeBuilder_ == null) { + if (!(kindCase_ == 10)) { + kind_ = com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + timestampTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Timestamp, + com.google.bigtable.v2.Type.Timestamp.Builder, + com.google.bigtable.v2.Type.TimestampOrBuilder>( + (com.google.bigtable.v2.Type.Timestamp) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 10; + onChanged(); + return timestampTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Date, + com.google.bigtable.v2.Type.Date.Builder, + com.google.bigtable.v2.Type.DateOrBuilder> + dateTypeBuilder_; + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + @java.lang.Override + public boolean hasDateType() { + return kindCase_ == 11; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Date getDateType() { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11) { + return (com.google.bigtable.v2.Type.Date) kind_; + } + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } else { + if (kindCase_ == 11) { + return dateTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + public Builder setDateType(com.google.bigtable.v2.Type.Date value) { + if (dateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + dateTypeBuilder_.setMessage(value); + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + public Builder setDateType(com.google.bigtable.v2.Type.Date.Builder builderForValue) { + if (dateTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + dateTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + public Builder mergeDateType(com.google.bigtable.v2.Type.Date value) { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11 && kind_ != com.google.bigtable.v2.Type.Date.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Date.newBuilder((com.google.bigtable.v2.Type.Date) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 11) { + dateTypeBuilder_.mergeFrom(value); + } else { + dateTypeBuilder_.setMessage(value); + } + } + kindCase_ = 11; + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + public Builder clearDateType() { + if (dateTypeBuilder_ == null) { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + } + dateTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + public com.google.bigtable.v2.Type.Date.Builder getDateTypeBuilder() { + return internalGetDateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.DateOrBuilder getDateTypeOrBuilder() { + if ((kindCase_ == 11) && (dateTypeBuilder_ != null)) { + return dateTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 11) { + return (com.google.bigtable.v2.Type.Date) kind_; + } + return com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Date
+     * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Date, + com.google.bigtable.v2.Type.Date.Builder, + com.google.bigtable.v2.Type.DateOrBuilder> + internalGetDateTypeFieldBuilder() { + if (dateTypeBuilder_ == null) { + if (!(kindCase_ == 11)) { + kind_ = com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + dateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Date, + com.google.bigtable.v2.Type.Date.Builder, + com.google.bigtable.v2.Type.DateOrBuilder>( + (com.google.bigtable.v2.Type.Date) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 11; + onChanged(); + return dateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate, + com.google.bigtable.v2.Type.Aggregate.Builder, + com.google.bigtable.v2.Type.AggregateOrBuilder> + aggregateTypeBuilder_; + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + @java.lang.Override + public boolean hasAggregateType() { + return kindCase_ == 6; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Aggregate getAggregateType() { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } else { + if (kindCase_ == 6) { + return aggregateTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder setAggregateType(com.google.bigtable.v2.Type.Aggregate value) { + if (aggregateTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + aggregateTypeBuilder_.setMessage(value); + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder setAggregateType(com.google.bigtable.v2.Type.Aggregate.Builder builderForValue) { + if (aggregateTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + aggregateTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder mergeAggregateType(com.google.bigtable.v2.Type.Aggregate value) { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6 && kind_ != com.google.bigtable.v2.Type.Aggregate.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Aggregate.newBuilder( + (com.google.bigtable.v2.Type.Aggregate) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 6) { + aggregateTypeBuilder_.mergeFrom(value); + } else { + aggregateTypeBuilder_.setMessage(value); + } + } + kindCase_ = 6; + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + public Builder clearAggregateType() { + if (aggregateTypeBuilder_ == null) { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + } + aggregateTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + public com.google.bigtable.v2.Type.Aggregate.Builder getAggregateTypeBuilder() { + return internalGetAggregateTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder() { + if ((kindCase_ == 6) && (aggregateTypeBuilder_ != null)) { + return aggregateTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 6) { + return (com.google.bigtable.v2.Type.Aggregate) kind_; + } + return com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Aggregate
+     * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate, + com.google.bigtable.v2.Type.Aggregate.Builder, + com.google.bigtable.v2.Type.AggregateOrBuilder> + internalGetAggregateTypeFieldBuilder() { + if (aggregateTypeBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + aggregateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Aggregate, + com.google.bigtable.v2.Type.Aggregate.Builder, + com.google.bigtable.v2.Type.AggregateOrBuilder>( + (com.google.bigtable.v2.Type.Aggregate) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 6; + onChanged(); + return aggregateTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct, + com.google.bigtable.v2.Type.Struct.Builder, + com.google.bigtable.v2.Type.StructOrBuilder> + structTypeBuilder_; + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + @java.lang.Override + public boolean hasStructType() { + return kindCase_ == 7; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Struct getStructType() { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7) { + return (com.google.bigtable.v2.Type.Struct) kind_; + } + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } else { + if (kindCase_ == 7) { + return structTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + public Builder setStructType(com.google.bigtable.v2.Type.Struct value) { + if (structTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + structTypeBuilder_.setMessage(value); + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + public Builder setStructType(com.google.bigtable.v2.Type.Struct.Builder builderForValue) { + if (structTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + structTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + public Builder mergeStructType(com.google.bigtable.v2.Type.Struct value) { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7 && kind_ != com.google.bigtable.v2.Type.Struct.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Struct.newBuilder( + (com.google.bigtable.v2.Type.Struct) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 7) { + structTypeBuilder_.mergeFrom(value); + } else { + structTypeBuilder_.setMessage(value); + } + } + kindCase_ = 7; + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + public Builder clearStructType() { + if (structTypeBuilder_ == null) { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + } + structTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + public com.google.bigtable.v2.Type.Struct.Builder getStructTypeBuilder() { + return internalGetStructTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.StructOrBuilder getStructTypeOrBuilder() { + if ((kindCase_ == 7) && (structTypeBuilder_ != null)) { + return structTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 7) { + return (com.google.bigtable.v2.Type.Struct) kind_; + } + return com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Struct
+     * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct, + com.google.bigtable.v2.Type.Struct.Builder, + com.google.bigtable.v2.Type.StructOrBuilder> + internalGetStructTypeFieldBuilder() { + if (structTypeBuilder_ == null) { + if (!(kindCase_ == 7)) { + kind_ = com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + structTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Struct, + com.google.bigtable.v2.Type.Struct.Builder, + com.google.bigtable.v2.Type.StructOrBuilder>( + (com.google.bigtable.v2.Type.Struct) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 7; + onChanged(); + return structTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Array, + com.google.bigtable.v2.Type.Array.Builder, + com.google.bigtable.v2.Type.ArrayOrBuilder> + arrayTypeBuilder_; + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + @java.lang.Override + public boolean hasArrayType() { + return kindCase_ == 3; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Array getArrayType() { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3) { + return (com.google.bigtable.v2.Type.Array) kind_; + } + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } else { + if (kindCase_ == 3) { + return arrayTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + public Builder setArrayType(com.google.bigtable.v2.Type.Array value) { + if (arrayTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + arrayTypeBuilder_.setMessage(value); + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + public Builder setArrayType(com.google.bigtable.v2.Type.Array.Builder builderForValue) { + if (arrayTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + arrayTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + public Builder mergeArrayType(com.google.bigtable.v2.Type.Array value) { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3 && kind_ != com.google.bigtable.v2.Type.Array.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Array.newBuilder( + (com.google.bigtable.v2.Type.Array) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 3) { + arrayTypeBuilder_.mergeFrom(value); + } else { + arrayTypeBuilder_.setMessage(value); + } + } + kindCase_ = 3; + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + public Builder clearArrayType() { + if (arrayTypeBuilder_ == null) { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + } + arrayTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + public com.google.bigtable.v2.Type.Array.Builder getArrayTypeBuilder() { + return internalGetArrayTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder() { + if ((kindCase_ == 3) && (arrayTypeBuilder_ != null)) { + return arrayTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 3) { + return (com.google.bigtable.v2.Type.Array) kind_; + } + return com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Array
+     * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Array, + com.google.bigtable.v2.Type.Array.Builder, + com.google.bigtable.v2.Type.ArrayOrBuilder> + internalGetArrayTypeFieldBuilder() { + if (arrayTypeBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + arrayTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Array, + com.google.bigtable.v2.Type.Array.Builder, + com.google.bigtable.v2.Type.ArrayOrBuilder>( + (com.google.bigtable.v2.Type.Array) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 3; + onChanged(); + return arrayTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Map, + com.google.bigtable.v2.Type.Map.Builder, + com.google.bigtable.v2.Type.MapOrBuilder> + mapTypeBuilder_; + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + @java.lang.Override + public boolean hasMapType() { + return kindCase_ == 4; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Map getMapType() { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.Type.Map) kind_; + } + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return mapTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + public Builder setMapType(com.google.bigtable.v2.Type.Map value) { + if (mapTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + mapTypeBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + public Builder setMapType(com.google.bigtable.v2.Type.Map.Builder builderForValue) { + if (mapTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + mapTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + public Builder mergeMapType(com.google.bigtable.v2.Type.Map value) { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4 && kind_ != com.google.bigtable.v2.Type.Map.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Map.newBuilder((com.google.bigtable.v2.Type.Map) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + mapTypeBuilder_.mergeFrom(value); + } else { + mapTypeBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + public Builder clearMapType() { + if (mapTypeBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + mapTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + public com.google.bigtable.v2.Type.Map.Builder getMapTypeBuilder() { + return internalGetMapTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.MapOrBuilder getMapTypeOrBuilder() { + if ((kindCase_ == 4) && (mapTypeBuilder_ != null)) { + return mapTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.Type.Map) kind_; + } + return com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Map
+     * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Map, + com.google.bigtable.v2.Type.Map.Builder, + com.google.bigtable.v2.Type.MapOrBuilder> + internalGetMapTypeFieldBuilder() { + if (mapTypeBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + mapTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Map, + com.google.bigtable.v2.Type.Map.Builder, + com.google.bigtable.v2.Type.MapOrBuilder>( + (com.google.bigtable.v2.Type.Map) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + return mapTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Proto, + com.google.bigtable.v2.Type.Proto.Builder, + com.google.bigtable.v2.Type.ProtoOrBuilder> + protoTypeBuilder_; + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + @java.lang.Override + public boolean hasProtoType() { + return kindCase_ == 13; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Proto getProtoType() { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13) { + return (com.google.bigtable.v2.Type.Proto) kind_; + } + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } else { + if (kindCase_ == 13) { + return protoTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + public Builder setProtoType(com.google.bigtable.v2.Type.Proto value) { + if (protoTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + protoTypeBuilder_.setMessage(value); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + public Builder setProtoType(com.google.bigtable.v2.Type.Proto.Builder builderForValue) { + if (protoTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + protoTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + public Builder mergeProtoType(com.google.bigtable.v2.Type.Proto value) { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13 && kind_ != com.google.bigtable.v2.Type.Proto.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Proto.newBuilder( + (com.google.bigtable.v2.Type.Proto) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 13) { + protoTypeBuilder_.mergeFrom(value); + } else { + protoTypeBuilder_.setMessage(value); + } + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + public Builder clearProtoType() { + if (protoTypeBuilder_ == null) { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + } + protoTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + public com.google.bigtable.v2.Type.Proto.Builder getProtoTypeBuilder() { + return internalGetProtoTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder() { + if ((kindCase_ == 13) && (protoTypeBuilder_ != null)) { + return protoTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 13) { + return (com.google.bigtable.v2.Type.Proto) kind_; + } + return com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Proto
+     * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Proto, + com.google.bigtable.v2.Type.Proto.Builder, + com.google.bigtable.v2.Type.ProtoOrBuilder> + internalGetProtoTypeFieldBuilder() { + if (protoTypeBuilder_ == null) { + if (!(kindCase_ == 13)) { + kind_ = com.google.bigtable.v2.Type.Proto.getDefaultInstance(); + } + protoTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Proto, + com.google.bigtable.v2.Type.Proto.Builder, + com.google.bigtable.v2.Type.ProtoOrBuilder>( + (com.google.bigtable.v2.Type.Proto) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 13; + onChanged(); + return protoTypeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Enum, + com.google.bigtable.v2.Type.Enum.Builder, + com.google.bigtable.v2.Type.EnumOrBuilder> + enumTypeBuilder_; + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + @java.lang.Override + public boolean hasEnumType() { + return kindCase_ == 14; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + @java.lang.Override + public com.google.bigtable.v2.Type.Enum getEnumType() { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14) { + return (com.google.bigtable.v2.Type.Enum) kind_; + } + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } else { + if (kindCase_ == 14) { + return enumTypeBuilder_.getMessage(); + } + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + public Builder setEnumType(com.google.bigtable.v2.Type.Enum value) { + if (enumTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + enumTypeBuilder_.setMessage(value); + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + public Builder setEnumType(com.google.bigtable.v2.Type.Enum.Builder builderForValue) { + if (enumTypeBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + enumTypeBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + public Builder mergeEnumType(com.google.bigtable.v2.Type.Enum value) { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14 && kind_ != com.google.bigtable.v2.Type.Enum.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.Type.Enum.newBuilder((com.google.bigtable.v2.Type.Enum) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 14) { + enumTypeBuilder_.mergeFrom(value); + } else { + enumTypeBuilder_.setMessage(value); + } + } + kindCase_ = 14; + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + public Builder clearEnumType() { + if (enumTypeBuilder_ == null) { + if (kindCase_ == 14) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 14) { + kindCase_ = 0; + kind_ = null; + } + enumTypeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + public com.google.bigtable.v2.Type.Enum.Builder getEnumTypeBuilder() { + return internalGetEnumTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + @java.lang.Override + public com.google.bigtable.v2.Type.EnumOrBuilder getEnumTypeOrBuilder() { + if ((kindCase_ == 14) && (enumTypeBuilder_ != null)) { + return enumTypeBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 14) { + return (com.google.bigtable.v2.Type.Enum) kind_; + } + return com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Enum
+     * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Enum, + com.google.bigtable.v2.Type.Enum.Builder, + com.google.bigtable.v2.Type.EnumOrBuilder> + internalGetEnumTypeFieldBuilder() { + if (enumTypeBuilder_ == null) { + if (!(kindCase_ == 14)) { + kind_ = com.google.bigtable.v2.Type.Enum.getDefaultInstance(); + } + enumTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type.Enum, + com.google.bigtable.v2.Type.Enum.Builder, + com.google.bigtable.v2.Type.EnumOrBuilder>( + (com.google.bigtable.v2.Type.Enum) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 14; + onChanged(); + return enumTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Type) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Type) + private static final com.google.bigtable.v2.Type DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Type(); + } + + public static com.google.bigtable.v2.Type getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Type parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Type getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.java new file mode 100644 index 000000000000..9c8366ba78f5 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.java @@ -0,0 +1,548 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Type) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return Whether the bytesType field is set. + */ + boolean hasBytesType(); + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + com.google.bigtable.v2.Type.Bytes getBytesType(); + + /** + * + * + *
+   * Bytes
+   * 
+ * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return Whether the stringType field is set. + */ + boolean hasStringType(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + * + * @return The stringType. + */ + com.google.bigtable.v2.Type.String getStringType(); + + /** + * + * + *
+   * String
+   * 
+ * + * .google.bigtable.v2.Type.String string_type = 2; + */ + com.google.bigtable.v2.Type.StringOrBuilder getStringTypeOrBuilder(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return Whether the int64Type field is set. + */ + boolean hasInt64Type(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + * + * @return The int64Type. + */ + com.google.bigtable.v2.Type.Int64 getInt64Type(); + + /** + * + * + *
+   * Int64
+   * 
+ * + * .google.bigtable.v2.Type.Int64 int64_type = 5; + */ + com.google.bigtable.v2.Type.Int64OrBuilder getInt64TypeOrBuilder(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return Whether the float32Type field is set. + */ + boolean hasFloat32Type(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + * + * @return The float32Type. + */ + com.google.bigtable.v2.Type.Float32 getFloat32Type(); + + /** + * + * + *
+   * Float32
+   * 
+ * + * .google.bigtable.v2.Type.Float32 float32_type = 12; + */ + com.google.bigtable.v2.Type.Float32OrBuilder getFloat32TypeOrBuilder(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return Whether the float64Type field is set. + */ + boolean hasFloat64Type(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + * + * @return The float64Type. + */ + com.google.bigtable.v2.Type.Float64 getFloat64Type(); + + /** + * + * + *
+   * Float64
+   * 
+ * + * .google.bigtable.v2.Type.Float64 float64_type = 9; + */ + com.google.bigtable.v2.Type.Float64OrBuilder getFloat64TypeOrBuilder(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return Whether the boolType field is set. + */ + boolean hasBoolType(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + * + * @return The boolType. + */ + com.google.bigtable.v2.Type.Bool getBoolType(); + + /** + * + * + *
+   * Bool
+   * 
+ * + * .google.bigtable.v2.Type.Bool bool_type = 8; + */ + com.google.bigtable.v2.Type.BoolOrBuilder getBoolTypeOrBuilder(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return Whether the timestampType field is set. + */ + boolean hasTimestampType(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + * + * @return The timestampType. + */ + com.google.bigtable.v2.Type.Timestamp getTimestampType(); + + /** + * + * + *
+   * Timestamp
+   * 
+ * + * .google.bigtable.v2.Type.Timestamp timestamp_type = 10; + */ + com.google.bigtable.v2.Type.TimestampOrBuilder getTimestampTypeOrBuilder(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return Whether the dateType field is set. + */ + boolean hasDateType(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + * + * @return The dateType. + */ + com.google.bigtable.v2.Type.Date getDateType(); + + /** + * + * + *
+   * Date
+   * 
+ * + * .google.bigtable.v2.Type.Date date_type = 11; + */ + com.google.bigtable.v2.Type.DateOrBuilder getDateTypeOrBuilder(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return Whether the aggregateType field is set. + */ + boolean hasAggregateType(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + * + * @return The aggregateType. + */ + com.google.bigtable.v2.Type.Aggregate getAggregateType(); + + /** + * + * + *
+   * Aggregate
+   * 
+ * + * .google.bigtable.v2.Type.Aggregate aggregate_type = 6; + */ + com.google.bigtable.v2.Type.AggregateOrBuilder getAggregateTypeOrBuilder(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return Whether the structType field is set. + */ + boolean hasStructType(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + * + * @return The structType. + */ + com.google.bigtable.v2.Type.Struct getStructType(); + + /** + * + * + *
+   * Struct
+   * 
+ * + * .google.bigtable.v2.Type.Struct struct_type = 7; + */ + com.google.bigtable.v2.Type.StructOrBuilder getStructTypeOrBuilder(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return Whether the arrayType field is set. + */ + boolean hasArrayType(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + * + * @return The arrayType. + */ + com.google.bigtable.v2.Type.Array getArrayType(); + + /** + * + * + *
+   * Array
+   * 
+ * + * .google.bigtable.v2.Type.Array array_type = 3; + */ + com.google.bigtable.v2.Type.ArrayOrBuilder getArrayTypeOrBuilder(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return Whether the mapType field is set. + */ + boolean hasMapType(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + * + * @return The mapType. + */ + com.google.bigtable.v2.Type.Map getMapType(); + + /** + * + * + *
+   * Map
+   * 
+ * + * .google.bigtable.v2.Type.Map map_type = 4; + */ + com.google.bigtable.v2.Type.MapOrBuilder getMapTypeOrBuilder(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return Whether the protoType field is set. + */ + boolean hasProtoType(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + * + * @return The protoType. + */ + com.google.bigtable.v2.Type.Proto getProtoType(); + + /** + * + * + *
+   * Proto
+   * 
+ * + * .google.bigtable.v2.Type.Proto proto_type = 13; + */ + com.google.bigtable.v2.Type.ProtoOrBuilder getProtoTypeOrBuilder(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return Whether the enumType field is set. + */ + boolean hasEnumType(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + * + * @return The enumType. + */ + com.google.bigtable.v2.Type.Enum getEnumType(); + + /** + * + * + *
+   * Enum
+   * 
+ * + * .google.bigtable.v2.Type.Enum enum_type = 14; + */ + com.google.bigtable.v2.Type.EnumOrBuilder getEnumTypeOrBuilder(); + + com.google.bigtable.v2.Type.KindCase getKindCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.java new file mode 100644 index 000000000000..abb352ec7a24 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.java @@ -0,0 +1,534 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class TypesProto extends com.google.protobuf.GeneratedFile { + private TypesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TypesProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Bytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Bytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Bytes_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_String_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_String_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_String_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_String_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Int64_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Int64_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Int64_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Bool_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Bool_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Float32_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Float32_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Float64_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Float64_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Timestamp_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Timestamp_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Date_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Date_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_Field_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Encoding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Proto_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Proto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Enum_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Enum_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Array_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Array_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Map_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Map_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Aggregate_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Aggregate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Aggregate_Sum_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Aggregate_Max_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Aggregate_Min_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\036google/bigtable/v2/types.proto\022\022google" + + ".bigtable.v2\032\037google/api/field_behavior." + + "proto\"\207\030\n\004Type\0224\n\nbytes_type\030\001 \001(\0132\036.goo" + + "gle.bigtable.v2.Type.BytesH\000\0226\n\013string_t" + + "ype\030\002 \001(\0132\037.google.bigtable.v2.Type.Stri" + + "ngH\000\0224\n\nint64_type\030\005 \001(\0132\036.google.bigtab" + + "le.v2.Type.Int64H\000\0228\n\014float32_type\030\014 \001(\013" + + "2 .google.bigtable.v2.Type.Float32H\000\0228\n\014" + + "float64_type\030\t \001(\0132 .google.bigtable.v2." + + "Type.Float64H\000\0222\n\tbool_type\030\010 \001(\0132\035.goog" + + "le.bigtable.v2.Type.BoolH\000\022<\n\016timestamp_" + + "type\030\n \001(\0132\".google.bigtable.v2.Type.Tim" + + "estampH\000\0222\n\tdate_type\030\013 \001(\0132\035.google.big" + + "table.v2.Type.DateH\000\022<\n\016aggregate_type\030\006" + + " \001(\0132\".google.bigtable.v2.Type.Aggregate" + + "H\000\0226\n\013struct_type\030\007 \001(\0132\037.google.bigtabl" + + "e.v2.Type.StructH\000\0224\n\narray_type\030\003 \001(\0132\036" + + ".google.bigtable.v2.Type.ArrayH\000\0220\n\010map_" + + "type\030\004 \001(\0132\034.google.bigtable.v2.Type.Map" + + "H\000\0224\n\nproto_type\030\r \001(\0132\036.google.bigtable" + + ".v2.Type.ProtoH\000\0222\n\tenum_type\030\016 \001(\0132\035.go" + + "ogle.bigtable.v2.Type.EnumH\000\032\263\001\n\005Bytes\0229" + + "\n\010encoding\030\001 \001(\0132\'.google.bigtable.v2.Ty" + + "pe.Bytes.Encoding\032o\n\010Encoding\022:\n\003raw\030\001 \001" + + "(\0132+.google.bigtable.v2.Type.Bytes.Encod" + + "ing.RawH\000\032\033\n\003Raw\022\024\n\014escape_nulls\030\001 \001(\010B\n" + + "\n\010encoding\032\247\002\n\006String\022:\n\010encoding\030\001 \001(\0132" + + "(.google.bigtable.v2.Type.String.Encodin" + + "g\032\340\001\n\010Encoding\022H\n\010utf8_raw\030\001 \001(\01320.googl" + + "e.bigtable.v2.Type.String.Encoding.Utf8R" + + "awB\002\030\001H\000\022H\n\nutf8_bytes\030\002 \001(\01322.google.bi" + + "gtable.v2.Type.String.Encoding.Utf8Bytes" + + "H\000\032\r\n\007Utf8Raw:\002\030\001\032%\n\tUtf8Bytes\022\030\n\020null_e" + + "scape_char\030\001 \001(\tB\n\n\010encoding\032\345\002\n\005Int64\0229" + + "\n\010encoding\030\001 \001(\0132\'.google.bigtable.v2.Ty" + + "pe.Int64.Encoding\032\240\002\n\010Encoding\022R\n\020big_en" + + "dian_bytes\030\001 \001(\01326.google.bigtable.v2.Ty" + + "pe.Int64.Encoding.BigEndianBytesH\000\022V\n\022or" + + "dered_code_bytes\030\002 \001(\01328.google.bigtable" + + ".v2.Type.Int64.Encoding.OrderedCodeBytes" + + "H\000\032H\n\016BigEndianBytes\0226\n\nbytes_type\030\001 \001(\013" + + "2\036.google.bigtable.v2.Type.BytesB\002\030\001\032\022\n\020" + + "OrderedCodeBytesB\n\n\010encoding\032\006\n\004Bool\032\t\n\007" + + "Float32\032\t\n\007Float64\032\250\001\n\tTimestamp\022=\n\010enco" + + "ding\030\001 \001(\0132+.google.bigtable.v2.Type.Tim" + + "estamp.Encoding\032\\\n\010Encoding\022D\n\021unix_micr" + + "os_int64\030\001 \001(\0132\'.google.bigtable.v2.Type" + + ".Int64.EncodingH\000B\n\n\010encoding\032\006\n\004Date\032\225\004" + + "\n\006Struct\0225\n\006fields\030\001 \003(\0132%.google.bigtab" + + "le.v2.Type.Struct.Field\022:\n\010encoding\030\002 \001(" + + "\0132(.google.bigtable.v2.Type.Struct.Encod" + + "ing\032C\n\005Field\022\022\n\nfield_name\030\001 \001(\t\022&\n\004type" + + "\030\002 \001(\0132\030.google.bigtable.v2.Type\032\322\002\n\010Enc" + + "oding\022G\n\tsingleton\030\001 \001(\01322.google.bigtab" + + "le.v2.Type.Struct.Encoding.SingletonH\000\022R" + + "\n\017delimited_bytes\030\002 \001(\01327.google.bigtabl" + + "e.v2.Type.Struct.Encoding.DelimitedBytes" + + "H\000\022W\n\022ordered_code_bytes\030\003 \001(\01329.google." + + "bigtable.v2.Type.Struct.Encoding.Ordered" + + "CodeBytesH\000\032\013\n\tSingleton\032#\n\016DelimitedByt" + + "es\022\021\n\tdelimiter\030\001 \001(\014\032\022\n\020OrderedCodeByte" + + "sB\n\n\010encoding\0327\n\005Proto\022\030\n\020schema_bundle_" + + "id\030\001 \001(\t\022\024\n\014message_name\030\002 \001(\t\0323\n\004Enum\022\030" + + "\n\020schema_bundle_id\030\001 \001(\t\022\021\n\tenum_name\030\002 " + + "\001(\t\0327\n\005Array\022.\n\014element_type\030\001 \001(\0132\030.goo" + + "gle.bigtable.v2.Type\032_\n\003Map\022*\n\010key_type\030" + + "\001 \001(\0132\030.google.bigtable.v2.Type\022,\n\nvalue" + + "_type\030\002 \001(\0132\030.google.bigtable.v2.Type\032\267\003" + + "\n\tAggregate\022,\n\ninput_type\030\001 \001(\0132\030.google" + + ".bigtable.v2.Type\0221\n\nstate_type\030\002 \001(\0132\030." + + "google.bigtable.v2.TypeB\003\340A\003\0225\n\003sum\030\004 \001(" + + "\0132&.google.bigtable.v2.Type.Aggregate.Su" + + "mH\000\022_\n\022hllpp_unique_count\030\005 \001(\0132A.google" + + ".bigtable.v2.Type.Aggregate.HyperLogLogP" + + "lusPlusUniqueCountH\000\0225\n\003max\030\006 \001(\0132&.goog" + + "le.bigtable.v2.Type.Aggregate.MaxH\000\0225\n\003m" + + "in\030\007 \001(\0132&.google.bigtable.v2.Type.Aggre" + + "gate.MinH\000\032\005\n\003Sum\032\005\n\003Max\032\005\n\003Min\032 \n\036Hyper" + + "LogLogPlusPlusUniqueCountB\014\n\naggregatorB" + + "\006\n\004kindB\264\001\n\026com.google.bigtable.v2B\nType" + + "sProtoP\001Z8cloud.google.com/go/bigtable/a" + + "piv2/bigtablepb;bigtablepb\252\002\030Google.Clou" + + "d.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\V2" + + "\352\002\033Google::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_Type_descriptor = getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_Type_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_descriptor, + new java.lang.String[] { + "BytesType", + "StringType", + "Int64Type", + "Float32Type", + "Float64Type", + "BoolType", + "TimestampType", + "DateType", + "AggregateType", + "StructType", + "ArrayType", + "MapType", + "ProtoType", + "EnumType", + "Kind", + }); + internal_static_google_bigtable_v2_Type_Bytes_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Bytes_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor = + internal_static_google_bigtable_v2_Type_Bytes_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor, + new java.lang.String[] { + "Raw", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor = + internal_static_google_bigtable_v2_Type_Bytes_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor, + new java.lang.String[] { + "EscapeNulls", + }); + internal_static_google_bigtable_v2_Type_String_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_String_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_String_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_v2_Type_String_Encoding_descriptor = + internal_static_google_bigtable_v2_Type_String_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_String_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_String_Encoding_descriptor, + new java.lang.String[] { + "Utf8Raw", "Utf8Bytes", "Encoding", + }); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor = + internal_static_google_bigtable_v2_Type_String_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor = + internal_static_google_bigtable_v2_Type_String_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor, + new java.lang.String[] { + "NullEscapeChar", + }); + internal_static_google_bigtable_v2_Type_Int64_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_Type_Int64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor = + internal_static_google_bigtable_v2_Type_Int64_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Int64_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor, + new java.lang.String[] { + "BigEndianBytes", "OrderedCodeBytes", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor = + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor, + new java.lang.String[] { + "BytesType", + }); + internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor = + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_Encoding_OrderedCodeBytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Bool_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(3); + internal_static_google_bigtable_v2_Type_Bool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Bool_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Float32_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(4); + internal_static_google_bigtable_v2_Type_Float32_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Float32_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Float64_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(5); + internal_static_google_bigtable_v2_Type_Float64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Float64_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Timestamp_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(6); + internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Timestamp_descriptor, + new java.lang.String[] { + "Encoding", + }); + internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor = + internal_static_google_bigtable_v2_Type_Timestamp_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Timestamp_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Timestamp_Encoding_descriptor, + new java.lang.String[] { + "UnixMicrosInt64", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Date_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(7); + internal_static_google_bigtable_v2_Type_Date_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Date_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Struct_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(8); + internal_static_google_bigtable_v2_Type_Struct_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_descriptor, + new java.lang.String[] { + "Fields", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Struct_Field_descriptor = + internal_static_google_bigtable_v2_Type_Struct_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Field_descriptor, + new java.lang.String[] { + "FieldName", "Type", + }); + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor = + internal_static_google_bigtable_v2_Type_Struct_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_Struct_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor, + new java.lang.String[] { + "Singleton", "DelimitedBytes", "OrderedCodeBytes", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor = + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Encoding_Singleton_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor = + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Encoding_DelimitedBytes_descriptor, + new java.lang.String[] { + "Delimiter", + }); + internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor = + internal_static_google_bigtable_v2_Type_Struct_Encoding_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Encoding_OrderedCodeBytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Proto_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(9); + internal_static_google_bigtable_v2_Type_Proto_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Proto_descriptor, + new java.lang.String[] { + "SchemaBundleId", "MessageName", + }); + internal_static_google_bigtable_v2_Type_Enum_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(10); + internal_static_google_bigtable_v2_Type_Enum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Enum_descriptor, + new java.lang.String[] { + "SchemaBundleId", "EnumName", + }); + internal_static_google_bigtable_v2_Type_Array_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(11); + internal_static_google_bigtable_v2_Type_Array_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Array_descriptor, + new java.lang.String[] { + "ElementType", + }); + internal_static_google_bigtable_v2_Type_Map_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(12); + internal_static_google_bigtable_v2_Type_Map_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Map_descriptor, + new java.lang.String[] { + "KeyType", "ValueType", + }); + internal_static_google_bigtable_v2_Type_Aggregate_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedType(13); + internal_static_google_bigtable_v2_Type_Aggregate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_descriptor, + new java.lang.String[] { + "InputType", "StateType", "Sum", "HllppUniqueCount", "Max", "Min", "Aggregator", + }); + internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor = + internal_static_google_bigtable_v2_Type_Aggregate_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_Type_Aggregate_Sum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_Sum_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor = + internal_static_google_bigtable_v2_Type_Aggregate_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_Type_Aggregate_Max_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_Max_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor = + internal_static_google_bigtable_v2_Type_Aggregate_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_Type_Aggregate_Min_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_Min_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor = + internal_static_google_bigtable_v2_Type_Aggregate_descriptor.getNestedType(3); + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor, + new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java new file mode 100644 index 000000000000..060b7ea61e58 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java @@ -0,0 +1,2964 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * `Value` represents a dynamically typed value.
+ * The typed fields in `Value` are used as a transport encoding for the actual
+ * value (which may be of a more complex type). See the documentation of the
+ * `Type` message for more details.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.Value} + */ +@com.google.protobuf.Generated +public final class Value extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Value"); + } + + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Value() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Value.class, com.google.bigtable.v2.Value.Builder.class); + } + + private int bitField0_; + private int kindCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAW_VALUE(8), + RAW_TIMESTAMP_MICROS(9), + BYTES_VALUE(2), + STRING_VALUE(3), + INT_VALUE(6), + BOOL_VALUE(10), + FLOAT_VALUE(11), + TIMESTAMP_VALUE(12), + DATE_VALUE(13), + ARRAY_VALUE(4), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 8: + return RAW_VALUE; + case 9: + return RAW_TIMESTAMP_MICROS; + case 2: + return BYTES_VALUE; + case 3: + return STRING_VALUE; + case 6: + return INT_VALUE; + case 10: + return BOOL_VALUE; + case 11: + return FLOAT_VALUE; + case 12: + return TIMESTAMP_VALUE; + case 13: + return DATE_VALUE; + case 4: + return ARRAY_VALUE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int TYPE_FIELD_NUMBER = 7; + private com.google.bigtable.v2.Type type_; + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return The type. + */ + @java.lang.Override + public com.google.bigtable.v2.Type getType() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + @java.lang.Override + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + + public static final int RAW_VALUE_FIELD_NUMBER = 8; + + /** + * + * + *
+   * Represents a raw byte sequence with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * bytes raw_value = 8; + * + * @return Whether the rawValue field is set. + */ + @java.lang.Override + public boolean hasRawValue() { + return kindCase_ == 8; + } + + /** + * + * + *
+   * Represents a raw byte sequence with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * bytes raw_value = 8; + * + * @return The rawValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawValue() { + if (kindCase_ == 8) { + return (com.google.protobuf.ByteString) kind_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int RAW_TIMESTAMP_MICROS_FIELD_NUMBER = 9; + + /** + * + * + *
+   * Represents a raw cell timestamp with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return Whether the rawTimestampMicros field is set. + */ + @java.lang.Override + public boolean hasRawTimestampMicros() { + return kindCase_ == 9; + } + + /** + * + * + *
+   * Represents a raw cell timestamp with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return The rawTimestampMicros. + */ + @java.lang.Override + public long getRawTimestampMicros() { + if (kindCase_ == 9) { + return (java.lang.Long) kind_; + } + return 0L; + } + + public static final int BYTES_VALUE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Represents a typed value transported as a byte sequence.
+   * 
+ * + * bytes bytes_value = 2; + * + * @return Whether the bytesValue field is set. + */ + @java.lang.Override + public boolean hasBytesValue() { + return kindCase_ == 2; + } + + /** + * + * + *
+   * Represents a typed value transported as a byte sequence.
+   * 
+ * + * bytes bytes_value = 2; + * + * @return The bytesValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBytesValue() { + if (kindCase_ == 2) { + return (com.google.protobuf.ByteString) kind_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return kindCase_ == 3; + } + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + 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(); + if (kindCase_ == 3) { + kind_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (kindCase_ == 3) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INT_VALUE_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Represents a typed value transported as an integer.
+   * 
+ * + * int64 int_value = 6; + * + * @return Whether the intValue field is set. + */ + @java.lang.Override + public boolean hasIntValue() { + return kindCase_ == 6; + } + + /** + * + * + *
+   * Represents a typed value transported as an integer.
+   * 
+ * + * int64 int_value = 6; + * + * @return The intValue. + */ + @java.lang.Override + public long getIntValue() { + if (kindCase_ == 6) { + return (java.lang.Long) kind_; + } + return 0L; + } + + public static final int BOOL_VALUE_FIELD_NUMBER = 10; + + /** + * + * + *
+   * Represents a typed value transported as a boolean.
+   * 
+ * + * bool bool_value = 10; + * + * @return Whether the boolValue field is set. + */ + @java.lang.Override + public boolean hasBoolValue() { + return kindCase_ == 10; + } + + /** + * + * + *
+   * Represents a typed value transported as a boolean.
+   * 
+ * + * bool bool_value = 10; + * + * @return The boolValue. + */ + @java.lang.Override + public boolean getBoolValue() { + if (kindCase_ == 10) { + return (java.lang.Boolean) kind_; + } + return false; + } + + public static final int FLOAT_VALUE_FIELD_NUMBER = 11; + + /** + * + * + *
+   * Represents a typed value transported as a floating point number.
+   * Does not support NaN or infinities.
+   * 
+ * + * double float_value = 11; + * + * @return Whether the floatValue field is set. + */ + @java.lang.Override + public boolean hasFloatValue() { + return kindCase_ == 11; + } + + /** + * + * + *
+   * Represents a typed value transported as a floating point number.
+   * Does not support NaN or infinities.
+   * 
+ * + * double float_value = 11; + * + * @return The floatValue. + */ + @java.lang.Override + public double getFloatValue() { + if (kindCase_ == 11) { + return (java.lang.Double) kind_; + } + return 0D; + } + + public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 12; + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return kindCase_ == 12; + } + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestampValue() { + if (kindCase_ == 12) { + return (com.google.protobuf.Timestamp) kind_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if (kindCase_ == 12) { + return (com.google.protobuf.Timestamp) kind_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int DATE_VALUE_FIELD_NUMBER = 13; + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + * + * @return Whether the dateValue field is set. + */ + @java.lang.Override + public boolean hasDateValue() { + return kindCase_ == 13; + } + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + * + * @return The dateValue. + */ + @java.lang.Override + public com.google.type.Date getDateValue() { + if (kindCase_ == 13) { + return (com.google.type.Date) kind_; + } + return com.google.type.Date.getDefaultInstance(); + } + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getDateValueOrBuilder() { + if (kindCase_ == 13) { + return (com.google.type.Date) kind_; + } + return com.google.type.Date.getDefaultInstance(); + } + + public static final int ARRAY_VALUE_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return Whether the arrayValue field is set. + */ + @java.lang.Override + public boolean hasArrayValue() { + return kindCase_ == 4; + } + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return The arrayValue. + */ + @java.lang.Override + public com.google.bigtable.v2.ArrayValue getArrayValue() { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.ArrayValue) kind_; + } + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ArrayValueOrBuilder getArrayValueOrBuilder() { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.ArrayValue) kind_; + } + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + + 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 (kindCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) kind_); + } + if (kindCase_ == 3) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); + } + if (kindCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.ArrayValue) kind_); + } + if (kindCase_ == 6) { + output.writeInt64(6, (long) ((java.lang.Long) kind_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getType()); + } + if (kindCase_ == 8) { + output.writeBytes(8, (com.google.protobuf.ByteString) kind_); + } + if (kindCase_ == 9) { + output.writeInt64(9, (long) ((java.lang.Long) kind_)); + } + if (kindCase_ == 10) { + output.writeBool(10, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 11) { + output.writeDouble(11, (double) ((java.lang.Double) kind_)); + } + if (kindCase_ == 12) { + output.writeMessage(12, (com.google.protobuf.Timestamp) kind_); + } + if (kindCase_ == 13) { + output.writeMessage(13, (com.google.type.Date) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) kind_); + } + if (kindCase_ == 3) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); + } + if (kindCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.ArrayValue) kind_); + } + if (kindCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 6, (long) ((java.lang.Long) kind_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getType()); + } + if (kindCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 8, (com.google.protobuf.ByteString) kind_); + } + if (kindCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 9, (long) ((java.lang.Long) kind_)); + } + if (kindCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 10, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 11) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 11, (double) ((java.lang.Double) kind_)); + } + if (kindCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.protobuf.Timestamp) kind_); + } + if (kindCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.type.Date) kind_); + } + size += getUnknownFields().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.Value)) { + return super.equals(obj); + } + com.google.bigtable.v2.Value other = (com.google.bigtable.v2.Value) obj; + + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 8: + if (!getRawValue().equals(other.getRawValue())) return false; + break; + case 9: + if (getRawTimestampMicros() != other.getRawTimestampMicros()) return false; + break; + case 2: + if (!getBytesValue().equals(other.getBytesValue())) return false; + break; + case 3: + if (!getStringValue().equals(other.getStringValue())) return false; + break; + case 6: + if (getIntValue() != other.getIntValue()) return false; + break; + case 10: + if (getBoolValue() != other.getBoolValue()) return false; + break; + case 11: + if (java.lang.Double.doubleToLongBits(getFloatValue()) + != java.lang.Double.doubleToLongBits(other.getFloatValue())) return false; + break; + case 12: + if (!getTimestampValue().equals(other.getTimestampValue())) return false; + break; + case 13: + if (!getDateValue().equals(other.getDateValue())) return false; + break; + case 4: + if (!getArrayValue().equals(other.getArrayValue())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + switch (kindCase_) { + case 8: + hash = (37 * hash) + RAW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getRawValue().hashCode(); + break; + case 9: + hash = (37 * hash) + RAW_TIMESTAMP_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRawTimestampMicros()); + break; + case 2: + hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getBytesValue().hashCode(); + break; + case 3: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 6: + hash = (37 * hash) + INT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIntValue()); + break; + case 10: + hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBoolValue()); + break; + case 11: + hash = (37 * hash) + FLOAT_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFloatValue())); + break; + case 12: + hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTimestampValue().hashCode(); + break; + case 13: + hash = (37 * hash) + DATE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDateValue().hashCode(); + break; + case 4: + hash = (37 * hash) + ARRAY_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getArrayValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.Value parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Value 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.Value parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Value 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.Value parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.Value parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.Value parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Value parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Value parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Value parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.Value parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.Value 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * `Value` represents a dynamically typed value.
+   * The typed fields in `Value` are used as a transport encoding for the actual
+   * value (which may be of a more complex type). See the documentation of the
+   * `Type` message for more details.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.Value} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.Value) + com.google.bigtable.v2.ValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Value_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Value_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Value.class, com.google.bigtable.v2.Value.Builder.class); + } + + // Construct using com.google.bigtable.v2.Value.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + if (timestampValueBuilder_ != null) { + timestampValueBuilder_.clear(); + } + if (dateValueBuilder_ != null) { + dateValueBuilder_.clear(); + } + if (arrayValueBuilder_ != null) { + arrayValueBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Value_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Value getDefaultInstanceForType() { + return com.google.bigtable.v2.Value.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Value build() { + com.google.bigtable.v2.Value result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Value buildPartial() { + com.google.bigtable.v2.Value result = new com.google.bigtable.v2.Value(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Value result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Value result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 12 && timestampValueBuilder_ != null) { + result.kind_ = timestampValueBuilder_.build(); + } + if (kindCase_ == 13 && dateValueBuilder_ != null) { + result.kind_ = dateValueBuilder_.build(); + } + if (kindCase_ == 4 && arrayValueBuilder_ != null) { + result.kind_ = arrayValueBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.Value) { + return mergeFrom((com.google.bigtable.v2.Value) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.Value other) { + if (other == com.google.bigtable.v2.Value.getDefaultInstance()) return this; + if (other.hasType()) { + mergeType(other.getType()); + } + switch (other.getKindCase()) { + case RAW_VALUE: + { + setRawValue(other.getRawValue()); + break; + } + case RAW_TIMESTAMP_MICROS: + { + setRawTimestampMicros(other.getRawTimestampMicros()); + break; + } + case BYTES_VALUE: + { + setBytesValue(other.getBytesValue()); + break; + } + case STRING_VALUE: + { + kindCase_ = 3; + kind_ = other.kind_; + onChanged(); + break; + } + case INT_VALUE: + { + setIntValue(other.getIntValue()); + break; + } + case BOOL_VALUE: + { + setBoolValue(other.getBoolValue()); + break; + } + case FLOAT_VALUE: + { + setFloatValue(other.getFloatValue()); + break; + } + case TIMESTAMP_VALUE: + { + mergeTimestampValue(other.getTimestampValue()); + break; + } + case DATE_VALUE: + { + mergeDateValue(other.getDateValue()); + break; + } + case ARRAY_VALUE: + { + mergeArrayValue(other.getArrayValue()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + kind_ = input.readBytes(); + kindCase_ = 2; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + kindCase_ = 3; + kind_ = s; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetArrayValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 48: + { + kind_ = input.readInt64(); + kindCase_ = 6; + break; + } // case 48 + case 58: + { + input.readMessage(internalGetTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 58 + case 66: + { + kind_ = input.readBytes(); + kindCase_ = 8; + break; + } // case 66 + case 72: + { + kind_ = input.readInt64(); + kindCase_ = 9; + break; + } // case 72 + case 80: + { + kind_ = input.readBool(); + kindCase_ = 10; + break; + } // case 80 + case 89: + { + kind_ = input.readDouble(); + kindCase_ = 11; + break; + } // case 89 + case 98: + { + input.readMessage( + internalGetTimestampValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetDateValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 13; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Type type_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return The type. + */ + public com.google.bigtable.v2.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public Builder setType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public Builder setType(com.google.bigtable.v2.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public Builder mergeType(com.google.bigtable.v2.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && type_ != null + && type_ != com.google.bigtable.v2.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public com.google.bigtable.v2.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + public com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.bigtable.v2.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+     * The verified `Type` of this `Value`, if it cannot be inferred.
+     *
+     * Read results will never specify the encoding for `type` since the value
+     * will already have been decoded by the server. Furthermore, the `type` will
+     * be omitted entirely if it can be inferred from a previous response. The
+     * exact semantics for inferring `type` will vary, and are therefore
+     * documented separately for each read method.
+     *
+     * When using composite types (Struct, Array, Map) only the outermost `Value`
+     * will specify the `type`. This top-level `type` will define the types for
+     * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+     * If a nested `Value` provides a `type` on write, the request will be
+     * rejected with INVALID_ARGUMENT.
+     * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + internalGetTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + /** + * + * + *
+     * Represents a raw byte sequence with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * bytes raw_value = 8; + * + * @return Whether the rawValue field is set. + */ + public boolean hasRawValue() { + return kindCase_ == 8; + } + + /** + * + * + *
+     * Represents a raw byte sequence with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * bytes raw_value = 8; + * + * @return The rawValue. + */ + public com.google.protobuf.ByteString getRawValue() { + if (kindCase_ == 8) { + return (com.google.protobuf.ByteString) kind_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Represents a raw byte sequence with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * bytes raw_value = 8; + * + * @param value The rawValue to set. + * @return This builder for chaining. + */ + public Builder setRawValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + kindCase_ = 8; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a raw byte sequence with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * bytes raw_value = 8; + * + * @return This builder for chaining. + */ + public Builder clearRawValue() { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a raw cell timestamp with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return Whether the rawTimestampMicros field is set. + */ + public boolean hasRawTimestampMicros() { + return kindCase_ == 9; + } + + /** + * + * + *
+     * Represents a raw cell timestamp with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return The rawTimestampMicros. + */ + public long getRawTimestampMicros() { + if (kindCase_ == 9) { + return (java.lang.Long) kind_; + } + return 0L; + } + + /** + * + * + *
+     * Represents a raw cell timestamp with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @param value The rawTimestampMicros to set. + * @return This builder for chaining. + */ + public Builder setRawTimestampMicros(long value) { + + kindCase_ = 9; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a raw cell timestamp with no type information.
+     * The `type` field must be omitted.
+     * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return This builder for chaining. + */ + public Builder clearRawTimestampMicros() { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a byte sequence.
+     * 
+ * + * bytes bytes_value = 2; + * + * @return Whether the bytesValue field is set. + */ + public boolean hasBytesValue() { + return kindCase_ == 2; + } + + /** + * + * + *
+     * Represents a typed value transported as a byte sequence.
+     * 
+ * + * bytes bytes_value = 2; + * + * @return The bytesValue. + */ + public com.google.protobuf.ByteString getBytesValue() { + if (kindCase_ == 2) { + return (com.google.protobuf.ByteString) kind_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Represents a typed value transported as a byte sequence.
+     * 
+ * + * bytes bytes_value = 2; + * + * @param value The bytesValue to set. + * @return This builder for chaining. + */ + public Builder setBytesValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + kindCase_ = 2; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a byte sequence.
+     * 
+ * + * bytes bytes_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearBytesValue() { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return kindCase_ == 3; + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (kindCase_ == 3) { + kind_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 3) { + ref = kind_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (kindCase_ == 3) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kindCase_ = 3; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a string.
+     * 
+ * + * string string_value = 3; + * + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kindCase_ = 3; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as an integer.
+     * 
+ * + * int64 int_value = 6; + * + * @return Whether the intValue field is set. + */ + public boolean hasIntValue() { + return kindCase_ == 6; + } + + /** + * + * + *
+     * Represents a typed value transported as an integer.
+     * 
+ * + * int64 int_value = 6; + * + * @return The intValue. + */ + public long getIntValue() { + if (kindCase_ == 6) { + return (java.lang.Long) kind_; + } + return 0L; + } + + /** + * + * + *
+     * Represents a typed value transported as an integer.
+     * 
+ * + * int64 int_value = 6; + * + * @param value The intValue to set. + * @return This builder for chaining. + */ + public Builder setIntValue(long value) { + + kindCase_ = 6; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as an integer.
+     * 
+ * + * int64 int_value = 6; + * + * @return This builder for chaining. + */ + public Builder clearIntValue() { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a boolean.
+     * 
+ * + * bool bool_value = 10; + * + * @return Whether the boolValue field is set. + */ + public boolean hasBoolValue() { + return kindCase_ == 10; + } + + /** + * + * + *
+     * Represents a typed value transported as a boolean.
+     * 
+ * + * bool bool_value = 10; + * + * @return The boolValue. + */ + public boolean getBoolValue() { + if (kindCase_ == 10) { + return (java.lang.Boolean) kind_; + } + return false; + } + + /** + * + * + *
+     * Represents a typed value transported as a boolean.
+     * 
+ * + * bool bool_value = 10; + * + * @param value The boolValue to set. + * @return This builder for chaining. + */ + public Builder setBoolValue(boolean value) { + + kindCase_ = 10; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a boolean.
+     * 
+ * + * bool bool_value = 10; + * + * @return This builder for chaining. + */ + public Builder clearBoolValue() { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a floating point number.
+     * Does not support NaN or infinities.
+     * 
+ * + * double float_value = 11; + * + * @return Whether the floatValue field is set. + */ + public boolean hasFloatValue() { + return kindCase_ == 11; + } + + /** + * + * + *
+     * Represents a typed value transported as a floating point number.
+     * Does not support NaN or infinities.
+     * 
+ * + * double float_value = 11; + * + * @return The floatValue. + */ + public double getFloatValue() { + if (kindCase_ == 11) { + return (java.lang.Double) kind_; + } + return 0D; + } + + /** + * + * + *
+     * Represents a typed value transported as a floating point number.
+     * Does not support NaN or infinities.
+     * 
+ * + * double float_value = 11; + * + * @param value The floatValue to set. + * @return This builder for chaining. + */ + public Builder setFloatValue(double value) { + + kindCase_ = 11; + kind_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a floating point number.
+     * Does not support NaN or infinities.
+     * 
+ * + * double float_value = 11; + * + * @return This builder for chaining. + */ + public Builder clearFloatValue() { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampValueBuilder_; + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return Whether the timestampValue field is set. + */ + @java.lang.Override + public boolean hasTimestampValue() { + return kindCase_ == 12; + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return The timestampValue. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestampValue() { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 12) { + return (com.google.protobuf.Timestamp) kind_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (kindCase_ == 12) { + return timestampValueBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + timestampValueBuilder_.setMessage(value); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + public Builder setTimestampValue(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + timestampValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + public Builder mergeTimestampValue(com.google.protobuf.Timestamp value) { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 12 && kind_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + kind_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 12) { + timestampValueBuilder_.mergeFrom(value); + } else { + timestampValueBuilder_.setMessage(value); + } + } + kindCase_ = 12; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + public Builder clearTimestampValue() { + if (timestampValueBuilder_ == null) { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + } + timestampValueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + public com.google.protobuf.Timestamp.Builder getTimestampValueBuilder() { + return internalGetTimestampValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() { + if ((kindCase_ == 12) && (timestampValueBuilder_ != null)) { + return timestampValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 12) { + return (com.google.protobuf.Timestamp) kind_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a timestamp.
+     * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetTimestampValueFieldBuilder() { + if (timestampValueBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + timestampValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 12; + onChanged(); + return timestampValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + dateValueBuilder_; + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + * + * @return Whether the dateValue field is set. + */ + @java.lang.Override + public boolean hasDateValue() { + return kindCase_ == 13; + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + * + * @return The dateValue. + */ + @java.lang.Override + public com.google.type.Date getDateValue() { + if (dateValueBuilder_ == null) { + if (kindCase_ == 13) { + return (com.google.type.Date) kind_; + } + return com.google.type.Date.getDefaultInstance(); + } else { + if (kindCase_ == 13) { + return dateValueBuilder_.getMessage(); + } + return com.google.type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + public Builder setDateValue(com.google.type.Date value) { + if (dateValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + dateValueBuilder_.setMessage(value); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + public Builder setDateValue(com.google.type.Date.Builder builderForValue) { + if (dateValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + dateValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + public Builder mergeDateValue(com.google.type.Date value) { + if (dateValueBuilder_ == null) { + if (kindCase_ == 13 && kind_ != com.google.type.Date.getDefaultInstance()) { + kind_ = + com.google.type.Date.newBuilder((com.google.type.Date) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 13) { + dateValueBuilder_.mergeFrom(value); + } else { + dateValueBuilder_.setMessage(value); + } + } + kindCase_ = 13; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + public Builder clearDateValue() { + if (dateValueBuilder_ == null) { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + } + dateValueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + public com.google.type.Date.Builder getDateValueBuilder() { + return internalGetDateValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getDateValueOrBuilder() { + if ((kindCase_ == 13) && (dateValueBuilder_ != null)) { + return dateValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 13) { + return (com.google.type.Date) kind_; + } + return com.google.type.Date.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a date.
+     * 
+ * + * .google.type.Date date_value = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + internalGetDateValueFieldBuilder() { + if (dateValueBuilder_ == null) { + if (!(kindCase_ == 13)) { + kind_ = com.google.type.Date.getDefaultInstance(); + } + dateValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + (com.google.type.Date) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 13; + onChanged(); + return dateValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ArrayValue, + com.google.bigtable.v2.ArrayValue.Builder, + com.google.bigtable.v2.ArrayValueOrBuilder> + arrayValueBuilder_; + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return Whether the arrayValue field is set. + */ + @java.lang.Override + public boolean hasArrayValue() { + return kindCase_ == 4; + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return The arrayValue. + */ + @java.lang.Override + public com.google.bigtable.v2.ArrayValue getArrayValue() { + if (arrayValueBuilder_ == null) { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.ArrayValue) kind_; + } + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return arrayValueBuilder_.getMessage(); + } + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + public Builder setArrayValue(com.google.bigtable.v2.ArrayValue value) { + if (arrayValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + arrayValueBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + public Builder setArrayValue(com.google.bigtable.v2.ArrayValue.Builder builderForValue) { + if (arrayValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + arrayValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + public Builder mergeArrayValue(com.google.bigtable.v2.ArrayValue value) { + if (arrayValueBuilder_ == null) { + if (kindCase_ == 4 && kind_ != com.google.bigtable.v2.ArrayValue.getDefaultInstance()) { + kind_ = + com.google.bigtable.v2.ArrayValue.newBuilder( + (com.google.bigtable.v2.ArrayValue) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + arrayValueBuilder_.mergeFrom(value); + } else { + arrayValueBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + public Builder clearArrayValue() { + if (arrayValueBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + arrayValueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + public com.google.bigtable.v2.ArrayValue.Builder getArrayValueBuilder() { + return internalGetArrayValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ArrayValueOrBuilder getArrayValueOrBuilder() { + if ((kindCase_ == 4) && (arrayValueBuilder_ != null)) { + return arrayValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (com.google.bigtable.v2.ArrayValue) kind_; + } + return com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Represents a typed value transported as a sequence of values.
+     * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+     * `Value` must provide an explicit `type` on write. This `type` will
+     * apply recursively to the nested `Struct` fields, `Array` elements,
+     * or `Map` key/value pairs, which *must not* supply their own `type`.
+     * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ArrayValue, + com.google.bigtable.v2.ArrayValue.Builder, + com.google.bigtable.v2.ArrayValueOrBuilder> + internalGetArrayValueFieldBuilder() { + if (arrayValueBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + arrayValueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ArrayValue, + com.google.bigtable.v2.ArrayValue.Builder, + com.google.bigtable.v2.ArrayValueOrBuilder>( + (com.google.bigtable.v2.ArrayValue) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + return arrayValueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Value) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Value) + private static final com.google.bigtable.v2.Value DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Value(); + } + + public static com.google.bigtable.v2.Value getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Value parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Value getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmask.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmask.java new file mode 100644 index 000000000000..298515c4d7ac --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmask.java @@ -0,0 +1,515 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Restricts the output to cells whose values match the given bitmask.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ValueBitmask} + */ +@com.google.protobuf.Generated +public final class ValueBitmask extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ValueBitmask) + ValueBitmaskOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ValueBitmask"); + } + + // Use ValueBitmask.newBuilder() to construct. + private ValueBitmask(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ValueBitmask() { + mask_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueBitmask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueBitmask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ValueBitmask.class, + com.google.bigtable.v2.ValueBitmask.Builder.class); + } + + public static final int MASK_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString mask_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Required. Mask applied to the value.
+   * Evaluated as: `(value & mask) == mask`
+   * The mask length must exactly match the value length, otherwise the cell is
+   * not considered a match.
+   * 
+ * + * bytes mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mask. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMask() { + return mask_; + } + + 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 (!mask_.isEmpty()) { + output.writeBytes(1, mask_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!mask_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, mask_); + } + size += getUnknownFields().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.ValueBitmask)) { + return super.equals(obj); + } + com.google.bigtable.v2.ValueBitmask other = (com.google.bigtable.v2.ValueBitmask) obj; + + if (!getMask().equals(other.getMask())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MASK_FIELD_NUMBER; + hash = (53 * hash) + getMask().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueBitmask 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.ValueBitmask parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueBitmask 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.ValueBitmask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueBitmask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueBitmask parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueBitmask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ValueBitmask 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Restricts the output to cells whose values match the given bitmask.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ValueBitmask} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ValueBitmask) + com.google.bigtable.v2.ValueBitmaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueBitmask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueBitmask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ValueBitmask.class, + com.google.bigtable.v2.ValueBitmask.Builder.class); + } + + // Construct using com.google.bigtable.v2.ValueBitmask.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mask_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueBitmask_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ValueBitmask getDefaultInstanceForType() { + return com.google.bigtable.v2.ValueBitmask.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ValueBitmask build() { + com.google.bigtable.v2.ValueBitmask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ValueBitmask buildPartial() { + com.google.bigtable.v2.ValueBitmask result = new com.google.bigtable.v2.ValueBitmask(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ValueBitmask result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mask_ = mask_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ValueBitmask) { + return mergeFrom((com.google.bigtable.v2.ValueBitmask) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ValueBitmask other) { + if (other == com.google.bigtable.v2.ValueBitmask.getDefaultInstance()) return this; + if (!other.getMask().isEmpty()) { + setMask(other.getMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + mask_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString mask_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Required. Mask applied to the value.
+     * Evaluated as: `(value & mask) == mask`
+     * The mask length must exactly match the value length, otherwise the cell is
+     * not considered a match.
+     * 
+ * + * bytes mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mask. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMask() { + return mask_; + } + + /** + * + * + *
+     * Required. Mask applied to the value.
+     * Evaluated as: `(value & mask) == mask`
+     * The mask length must exactly match the value length, otherwise the cell is
+     * not considered a match.
+     * 
+ * + * bytes mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mask to set. + * @return This builder for chaining. + */ + public Builder setMask(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + mask_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Mask applied to the value.
+     * Evaluated as: `(value & mask) == mask`
+     * The mask length must exactly match the value length, otherwise the cell is
+     * not considered a match.
+     * 
+ * + * bytes mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMask() { + bitField0_ = (bitField0_ & ~0x00000001); + mask_ = getDefaultInstance().getMask(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ValueBitmask) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ValueBitmask) + private static final com.google.bigtable.v2.ValueBitmask DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ValueBitmask(); + } + + public static com.google.bigtable.v2.ValueBitmask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValueBitmask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ValueBitmask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmaskOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmaskOrBuilder.java new file mode 100644 index 000000000000..cc8cf8217949 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueBitmaskOrBuilder.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ValueBitmaskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ValueBitmask) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask applied to the value.
+   * Evaluated as: `(value & mask) == mask`
+   * The mask length must exactly match the value length, otherwise the cell is
+   * not considered a match.
+   * 
+ * + * bytes mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mask. + */ + com.google.protobuf.ByteString getMask(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java new file mode 100644 index 000000000000..be294593e7a4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java @@ -0,0 +1,427 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Value) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + * + * @return The type. + */ + com.google.bigtable.v2.Type getType(); + + /** + * + * + *
+   * The verified `Type` of this `Value`, if it cannot be inferred.
+   *
+   * Read results will never specify the encoding for `type` since the value
+   * will already have been decoded by the server. Furthermore, the `type` will
+   * be omitted entirely if it can be inferred from a previous response. The
+   * exact semantics for inferring `type` will vary, and are therefore
+   * documented separately for each read method.
+   *
+   * When using composite types (Struct, Array, Map) only the outermost `Value`
+   * will specify the `type`. This top-level `type` will define the types for
+   * any nested `Struct' fields, `Array` elements, or `Map` key/value pairs.
+   * If a nested `Value` provides a `type` on write, the request will be
+   * rejected with INVALID_ARGUMENT.
+   * 
+ * + * .google.bigtable.v2.Type type = 7; + */ + com.google.bigtable.v2.TypeOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * Represents a raw byte sequence with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * bytes raw_value = 8; + * + * @return Whether the rawValue field is set. + */ + boolean hasRawValue(); + + /** + * + * + *
+   * Represents a raw byte sequence with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * bytes raw_value = 8; + * + * @return The rawValue. + */ + com.google.protobuf.ByteString getRawValue(); + + /** + * + * + *
+   * Represents a raw cell timestamp with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return Whether the rawTimestampMicros field is set. + */ + boolean hasRawTimestampMicros(); + + /** + * + * + *
+   * Represents a raw cell timestamp with no type information.
+   * The `type` field must be omitted.
+   * 
+ * + * int64 raw_timestamp_micros = 9; + * + * @return The rawTimestampMicros. + */ + long getRawTimestampMicros(); + + /** + * + * + *
+   * Represents a typed value transported as a byte sequence.
+   * 
+ * + * bytes bytes_value = 2; + * + * @return Whether the bytesValue field is set. + */ + boolean hasBytesValue(); + + /** + * + * + *
+   * Represents a typed value transported as a byte sequence.
+   * 
+ * + * bytes bytes_value = 2; + * + * @return The bytesValue. + */ + com.google.protobuf.ByteString getBytesValue(); + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return The stringValue. + */ + java.lang.String getStringValue(); + + /** + * + * + *
+   * Represents a typed value transported as a string.
+   * 
+ * + * string string_value = 3; + * + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString getStringValueBytes(); + + /** + * + * + *
+   * Represents a typed value transported as an integer.
+   * 
+ * + * int64 int_value = 6; + * + * @return Whether the intValue field is set. + */ + boolean hasIntValue(); + + /** + * + * + *
+   * Represents a typed value transported as an integer.
+   * 
+ * + * int64 int_value = 6; + * + * @return The intValue. + */ + long getIntValue(); + + /** + * + * + *
+   * Represents a typed value transported as a boolean.
+   * 
+ * + * bool bool_value = 10; + * + * @return Whether the boolValue field is set. + */ + boolean hasBoolValue(); + + /** + * + * + *
+   * Represents a typed value transported as a boolean.
+   * 
+ * + * bool bool_value = 10; + * + * @return The boolValue. + */ + boolean getBoolValue(); + + /** + * + * + *
+   * Represents a typed value transported as a floating point number.
+   * Does not support NaN or infinities.
+   * 
+ * + * double float_value = 11; + * + * @return Whether the floatValue field is set. + */ + boolean hasFloatValue(); + + /** + * + * + *
+   * Represents a typed value transported as a floating point number.
+   * Does not support NaN or infinities.
+   * 
+ * + * double float_value = 11; + * + * @return The floatValue. + */ + double getFloatValue(); + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return Whether the timestampValue field is set. + */ + boolean hasTimestampValue(); + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + * + * @return The timestampValue. + */ + com.google.protobuf.Timestamp getTimestampValue(); + + /** + * + * + *
+   * Represents a typed value transported as a timestamp.
+   * 
+ * + * .google.protobuf.Timestamp timestamp_value = 12; + */ + com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder(); + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + * + * @return Whether the dateValue field is set. + */ + boolean hasDateValue(); + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + * + * @return The dateValue. + */ + com.google.type.Date getDateValue(); + + /** + * + * + *
+   * Represents a typed value transported as a date.
+   * 
+ * + * .google.type.Date date_value = 13; + */ + com.google.type.DateOrBuilder getDateValueOrBuilder(); + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return Whether the arrayValue field is set. + */ + boolean hasArrayValue(); + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + * + * @return The arrayValue. + */ + com.google.bigtable.v2.ArrayValue getArrayValue(); + + /** + * + * + *
+   * Represents a typed value transported as a sequence of values.
+   * To differentiate between `Struct`, `Array`, and `Map`, the outermost
+   * `Value` must provide an explicit `type` on write. This `type` will
+   * apply recursively to the nested `Struct` fields, `Array` elements,
+   * or `Map` key/value pairs, which *must not* supply their own `type`.
+   * 
+ * + * .google.bigtable.v2.ArrayValue array_value = 4; + */ + com.google.bigtable.v2.ArrayValueOrBuilder getArrayValueOrBuilder(); + + com.google.bigtable.v2.Value.KindCase getKindCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java new file mode 100644 index 000000000000..ae3f11b4f91a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Specifies a contiguous range of raw byte values.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ValueRange} + */ +@com.google.protobuf.Generated +public final class ValueRange extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ValueRange) + ValueRangeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ValueRange"); + } + + // Use ValueRange.newBuilder() to construct. + private ValueRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ValueRange() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ValueRange.class, + com.google.bigtable.v2.ValueRange.Builder.class); + } + + private int startValueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object startValue_; + + public enum StartValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + START_VALUE_CLOSED(1), + START_VALUE_OPEN(2), + STARTVALUE_NOT_SET(0); + private final int value; + + private StartValueCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StartValueCase valueOf(int value) { + return forNumber(value); + } + + public static StartValueCase forNumber(int value) { + switch (value) { + case 1: + return START_VALUE_CLOSED; + case 2: + return START_VALUE_OPEN; + case 0: + return STARTVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StartValueCase getStartValueCase() { + return StartValueCase.forNumber(startValueCase_); + } + + private int endValueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object endValue_; + + public enum EndValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_VALUE_CLOSED(3), + END_VALUE_OPEN(4), + ENDVALUE_NOT_SET(0); + private final int value; + + private EndValueCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndValueCase valueOf(int value) { + return forNumber(value); + } + + public static EndValueCase forNumber(int value) { + switch (value) { + case 3: + return END_VALUE_CLOSED; + case 4: + return END_VALUE_OPEN; + case 0: + return ENDVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndValueCase getEndValueCase() { + return EndValueCase.forNumber(endValueCase_); + } + + public static final int START_VALUE_CLOSED_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_value_closed = 1; + * + * @return Whether the startValueClosed field is set. + */ + @java.lang.Override + public boolean hasStartValueClosed() { + return startValueCase_ == 1; + } + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_value_closed = 1; + * + * @return The startValueClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartValueClosed() { + if (startValueCase_ == 1) { + return (com.google.protobuf.ByteString) startValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int START_VALUE_OPEN_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_value_open = 2; + * + * @return Whether the startValueOpen field is set. + */ + @java.lang.Override + public boolean hasStartValueOpen() { + return startValueCase_ == 2; + } + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_value_open = 2; + * + * @return The startValueOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartValueOpen() { + if (startValueCase_ == 2) { + return (com.google.protobuf.ByteString) startValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_VALUE_CLOSED_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_value_closed = 3; + * + * @return Whether the endValueClosed field is set. + */ + @java.lang.Override + public boolean hasEndValueClosed() { + return endValueCase_ == 3; + } + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_value_closed = 3; + * + * @return The endValueClosed. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndValueClosed() { + if (endValueCase_ == 3) { + return (com.google.protobuf.ByteString) endValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int END_VALUE_OPEN_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_value_open = 4; + * + * @return Whether the endValueOpen field is set. + */ + @java.lang.Override + public boolean hasEndValueOpen() { + return endValueCase_ == 4; + } + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_value_open = 4; + * + * @return The endValueOpen. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndValueOpen() { + if (endValueCase_ == 4) { + return (com.google.protobuf.ByteString) endValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + 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 (startValueCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) startValue_); + } + if (startValueCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) startValue_); + } + if (endValueCase_ == 3) { + output.writeBytes(3, (com.google.protobuf.ByteString) endValue_); + } + if (endValueCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) endValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startValueCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) startValue_); + } + if (startValueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) startValue_); + } + if (endValueCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 3, (com.google.protobuf.ByteString) endValue_); + } + if (endValueCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) endValue_); + } + size += getUnknownFields().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.ValueRange)) { + return super.equals(obj); + } + com.google.bigtable.v2.ValueRange other = (com.google.bigtable.v2.ValueRange) obj; + + if (!getStartValueCase().equals(other.getStartValueCase())) return false; + switch (startValueCase_) { + case 1: + if (!getStartValueClosed().equals(other.getStartValueClosed())) return false; + break; + case 2: + if (!getStartValueOpen().equals(other.getStartValueOpen())) return false; + break; + case 0: + default: + } + if (!getEndValueCase().equals(other.getEndValueCase())) return false; + switch (endValueCase_) { + case 3: + if (!getEndValueClosed().equals(other.getEndValueClosed())) return false; + break; + case 4: + if (!getEndValueOpen().equals(other.getEndValueOpen())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (startValueCase_) { + case 1: + hash = (37 * hash) + START_VALUE_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getStartValueClosed().hashCode(); + break; + case 2: + hash = (37 * hash) + START_VALUE_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getStartValueOpen().hashCode(); + break; + case 0: + default: + } + switch (endValueCase_) { + case 3: + hash = (37 * hash) + END_VALUE_CLOSED_FIELD_NUMBER; + hash = (53 * hash) + getEndValueClosed().hashCode(); + break; + case 4: + hash = (37 * hash) + END_VALUE_OPEN_FIELD_NUMBER; + hash = (53 * hash) + getEndValueOpen().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ValueRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueRange 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.ValueRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueRange 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.ValueRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ValueRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueRange parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueRange parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ValueRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ValueRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.ValueRange 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a contiguous range of raw byte values.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ValueRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ValueRange) + com.google.bigtable.v2.ValueRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ValueRange.class, + com.google.bigtable.v2.ValueRange.Builder.class); + } + + // Construct using com.google.bigtable.v2.ValueRange.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startValueCase_ = 0; + startValue_ = null; + endValueCase_ = 0; + endValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_ValueRange_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ValueRange getDefaultInstanceForType() { + return com.google.bigtable.v2.ValueRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ValueRange build() { + com.google.bigtable.v2.ValueRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ValueRange buildPartial() { + com.google.bigtable.v2.ValueRange result = new com.google.bigtable.v2.ValueRange(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ValueRange result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ValueRange result) { + result.startValueCase_ = startValueCase_; + result.startValue_ = this.startValue_; + result.endValueCase_ = endValueCase_; + result.endValue_ = this.endValue_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ValueRange) { + return mergeFrom((com.google.bigtable.v2.ValueRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ValueRange other) { + if (other == com.google.bigtable.v2.ValueRange.getDefaultInstance()) return this; + switch (other.getStartValueCase()) { + case START_VALUE_CLOSED: + { + setStartValueClosed(other.getStartValueClosed()); + break; + } + case START_VALUE_OPEN: + { + setStartValueOpen(other.getStartValueOpen()); + break; + } + case STARTVALUE_NOT_SET: + { + break; + } + } + switch (other.getEndValueCase()) { + case END_VALUE_CLOSED: + { + setEndValueClosed(other.getEndValueClosed()); + break; + } + case END_VALUE_OPEN: + { + setEndValueOpen(other.getEndValueOpen()); + break; + } + case ENDVALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + startValue_ = input.readBytes(); + startValueCase_ = 1; + break; + } // case 10 + case 18: + { + startValue_ = input.readBytes(); + startValueCase_ = 2; + break; + } // case 18 + case 26: + { + endValue_ = input.readBytes(); + endValueCase_ = 3; + break; + } // case 26 + case 34: + { + endValue_ = input.readBytes(); + endValueCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int startValueCase_ = 0; + private java.lang.Object startValue_; + + public StartValueCase getStartValueCase() { + return StartValueCase.forNumber(startValueCase_); + } + + public Builder clearStartValue() { + startValueCase_ = 0; + startValue_ = null; + onChanged(); + return this; + } + + private int endValueCase_ = 0; + private java.lang.Object endValue_; + + public EndValueCase getEndValueCase() { + return EndValueCase.forNumber(endValueCase_); + } + + public Builder clearEndValue() { + endValueCase_ = 0; + endValue_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_value_closed = 1; + * + * @return Whether the startValueClosed field is set. + */ + public boolean hasStartValueClosed() { + return startValueCase_ == 1; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_value_closed = 1; + * + * @return The startValueClosed. + */ + public com.google.protobuf.ByteString getStartValueClosed() { + if (startValueCase_ == 1) { + return (com.google.protobuf.ByteString) startValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_value_closed = 1; + * + * @param value The startValueClosed to set. + * @return This builder for chaining. + */ + public Builder setStartValueClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startValueCase_ = 1; + startValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive lower bound for the range.
+     * 
+ * + * bytes start_value_closed = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartValueClosed() { + if (startValueCase_ == 1) { + startValueCase_ = 0; + startValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_value_open = 2; + * + * @return Whether the startValueOpen field is set. + */ + public boolean hasStartValueOpen() { + return startValueCase_ == 2; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_value_open = 2; + * + * @return The startValueOpen. + */ + public com.google.protobuf.ByteString getStartValueOpen() { + if (startValueCase_ == 2) { + return (com.google.protobuf.ByteString) startValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_value_open = 2; + * + * @param value The startValueOpen to set. + * @return This builder for chaining. + */ + public Builder setStartValueOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startValueCase_ = 2; + startValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive lower bound for the range.
+     * 
+ * + * bytes start_value_open = 2; + * + * @return This builder for chaining. + */ + public Builder clearStartValueOpen() { + if (startValueCase_ == 2) { + startValueCase_ = 0; + startValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_value_closed = 3; + * + * @return Whether the endValueClosed field is set. + */ + public boolean hasEndValueClosed() { + return endValueCase_ == 3; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_value_closed = 3; + * + * @return The endValueClosed. + */ + public com.google.protobuf.ByteString getEndValueClosed() { + if (endValueCase_ == 3) { + return (com.google.protobuf.ByteString) endValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_value_closed = 3; + * + * @param value The endValueClosed to set. + * @return This builder for chaining. + */ + public Builder setEndValueClosed(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endValueCase_ = 3; + endValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an inclusive upper bound for the range.
+     * 
+ * + * bytes end_value_closed = 3; + * + * @return This builder for chaining. + */ + public Builder clearEndValueClosed() { + if (endValueCase_ == 3) { + endValueCase_ = 0; + endValue_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_value_open = 4; + * + * @return Whether the endValueOpen field is set. + */ + public boolean hasEndValueOpen() { + return endValueCase_ == 4; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_value_open = 4; + * + * @return The endValueOpen. + */ + public com.google.protobuf.ByteString getEndValueOpen() { + if (endValueCase_ == 4) { + return (com.google.protobuf.ByteString) endValue_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_value_open = 4; + * + * @param value The endValueOpen to set. + * @return This builder for chaining. + */ + public Builder setEndValueOpen(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + endValueCase_ = 4; + endValue_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used when giving an exclusive upper bound for the range.
+     * 
+ * + * bytes end_value_open = 4; + * + * @return This builder for chaining. + */ + public Builder clearEndValueOpen() { + if (endValueCase_ == 4) { + endValueCase_ = 0; + endValue_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ValueRange) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ValueRange) + private static final com.google.bigtable.v2.ValueRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ValueRange(); + } + + public static com.google.bigtable.v2.ValueRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValueRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ValueRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java new file mode 100644 index 000000000000..3576fd118774 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/data.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ValueRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ValueRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_value_closed = 1; + * + * @return Whether the startValueClosed field is set. + */ + boolean hasStartValueClosed(); + + /** + * + * + *
+   * Used when giving an inclusive lower bound for the range.
+   * 
+ * + * bytes start_value_closed = 1; + * + * @return The startValueClosed. + */ + com.google.protobuf.ByteString getStartValueClosed(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_value_open = 2; + * + * @return Whether the startValueOpen field is set. + */ + boolean hasStartValueOpen(); + + /** + * + * + *
+   * Used when giving an exclusive lower bound for the range.
+   * 
+ * + * bytes start_value_open = 2; + * + * @return The startValueOpen. + */ + com.google.protobuf.ByteString getStartValueOpen(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_value_closed = 3; + * + * @return Whether the endValueClosed field is set. + */ + boolean hasEndValueClosed(); + + /** + * + * + *
+   * Used when giving an inclusive upper bound for the range.
+   * 
+ * + * bytes end_value_closed = 3; + * + * @return The endValueClosed. + */ + com.google.protobuf.ByteString getEndValueClosed(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_value_open = 4; + * + * @return Whether the endValueOpen field is set. + */ + boolean hasEndValueOpen(); + + /** + * + * + *
+   * Used when giving an exclusive upper bound for the range.
+   * 
+ * + * bytes end_value_open = 4; + * + * @return The endValueOpen. + */ + com.google.protobuf.ByteString getEndValueOpen(); + + com.google.bigtable.v2.ValueRange.StartValueCase getStartValueCase(); + + com.google.bigtable.v2.ValueRange.EndValueCase getEndValueCase(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java new file mode 100644 index 000000000000..da34767643e3 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java @@ -0,0 +1,2298 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest} + */ +@com.google.protobuf.Generated +public final class VirtualRpcRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcRequest) + VirtualRpcRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VirtualRpcRequest"); + } + + // Use VirtualRpcRequest.newBuilder() to construct. + private VirtualRpcRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VirtualRpcRequest() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.class, + com.google.bigtable.v2.VirtualRpcRequest.Builder.class); + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcRequest.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Track retry attempts for this vRPC at the AFE.
+     * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + long getAttemptNumber(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + boolean hasAttemptStart(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + com.google.protobuf.Timestamp getAttemptStart(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder(); + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + java.lang.String getTraceparent(); + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + com.google.protobuf.ByteString getTraceparentBytes(); + } + + /** + * + * + *
+   * Container for all vRPC Metadata.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcRequest.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() { + traceparent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.class, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private long attemptNumber_ = 0L; + + /** + * + * + *
+     * Track retry attempts for this vRPC at the AFE.
+     * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public long getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_START_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptStart_; + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + @java.lang.Override + public boolean hasAttemptStart() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptStart() { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder() { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + + public static final int TRACEPARENT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object traceparent_ = ""; + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + @java.lang.Override + public java.lang.String getTraceparent() { + java.lang.Object ref = traceparent_; + 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(); + traceparent_ = s; + return s; + } + } + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTraceparentBytes() { + java.lang.Object ref = traceparent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceparent_ = 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 (attemptNumber_ != 0L) { + output.writeInt64(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptStart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(traceparent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, traceparent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptStart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(traceparent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, traceparent_); + } + size += getUnknownFields().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.VirtualRpcRequest.Metadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcRequest.Metadata other = + (com.google.bigtable.v2.VirtualRpcRequest.Metadata) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptStart() != other.hasAttemptStart()) return false; + if (hasAttemptStart()) { + if (!getAttemptStart().equals(other.getAttemptStart())) return false; + } + if (!getTraceparent().equals(other.getTraceparent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAttemptNumber()); + if (hasAttemptStart()) { + hash = (37 * hash) + ATTEMPT_START_FIELD_NUMBER; + hash = (53 * hash) + getAttemptStart().hashCode(); + } + hash = (37 * hash) + TRACEPARENT_FIELD_NUMBER; + hash = (53 * hash) + getTraceparent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata 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.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata 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.VirtualRpcRequest.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.VirtualRpcRequest.Metadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Container for all vRPC Metadata.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcRequest.Metadata) + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.class, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcRequest.Metadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAttemptStartFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0L; + attemptStart_ = null; + if (attemptStartBuilder_ != null) { + attemptStartBuilder_.dispose(); + attemptStartBuilder_ = null; + } + traceparent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata build() { + com.google.bigtable.v2.VirtualRpcRequest.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata buildPartial() { + com.google.bigtable.v2.VirtualRpcRequest.Metadata result = + new com.google.bigtable.v2.VirtualRpcRequest.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcRequest.Metadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptStart_ = + attemptStartBuilder_ == null ? attemptStart_ : attemptStartBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.traceparent_ = traceparent_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcRequest.Metadata) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcRequest.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcRequest.Metadata other) { + if (other == com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0L) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptStart()) { + mergeAttemptStart(other.getAttemptStart()); + } + if (!other.getTraceparent().isEmpty()) { + traceparent_ = other.traceparent_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + attemptNumber_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetAttemptStartFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + traceparent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long attemptNumber_; + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public long getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(long value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptStart_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptStartBuilder_; + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + public boolean hasAttemptStart() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + public com.google.protobuf.Timestamp getAttemptStart() { + if (attemptStartBuilder_ == null) { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } else { + return attemptStartBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder setAttemptStart(com.google.protobuf.Timestamp value) { + if (attemptStartBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptStart_ = value; + } else { + attemptStartBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder setAttemptStart(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptStartBuilder_ == null) { + attemptStart_ = builderForValue.build(); + } else { + attemptStartBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder mergeAttemptStart(com.google.protobuf.Timestamp value) { + if (attemptStartBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptStart_ != null + && attemptStart_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptStartBuilder().mergeFrom(value); + } else { + attemptStart_ = value; + } + } else { + attemptStartBuilder_.mergeFrom(value); + } + if (attemptStart_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder clearAttemptStart() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptStart_ = null; + if (attemptStartBuilder_ != null) { + attemptStartBuilder_.dispose(); + attemptStartBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptStartBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAttemptStartFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder() { + if (attemptStartBuilder_ != null) { + return attemptStartBuilder_.getMessageOrBuilder(); + } else { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetAttemptStartFieldBuilder() { + if (attemptStartBuilder_ == null) { + attemptStartBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptStart(), getParentForChildren(), isClean()); + attemptStart_ = null; + } + return attemptStartBuilder_; + } + + private java.lang.Object traceparent_ = ""; + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + public java.lang.String getTraceparent() { + java.lang.Object ref = traceparent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceparent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + public com.google.protobuf.ByteString getTraceparentBytes() { + java.lang.Object ref = traceparent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceparent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @param value The traceparent to set. + * @return This builder for chaining. + */ + public Builder setTraceparent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + traceparent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return This builder for chaining. + */ + public Builder clearTraceparent() { + traceparent_ = getDefaultInstance().getTraceparent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @param value The bytes for traceparent to set. + * @return This builder for chaining. + */ + public Builder setTraceparentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + traceparent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcRequest.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcRequest.Metadata) + private static final com.google.bigtable.v2.VirtualRpcRequest.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcRequest.Metadata(); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VirtualRpcRequest.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Client chosen, monotonically increasing identifier for the request.
+   * Must be unique within a session.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Duration deadline_; + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + @java.lang.Override + public boolean hasDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + @java.lang.Override + public com.google.protobuf.Duration getDeadline() { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder() { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.bigtable.v2.VirtualRpcRequest.Metadata metadata_; + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata() { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Could be TableRequest (or in post-V1, SqlRequest)
+   * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + 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 (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getMetadata()); + } + if (!payload_.isEmpty()) { + output.writeBytes(4, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, payload_); + } + size += getUnknownFields().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.VirtualRpcRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcRequest other = (com.google.bigtable.v2.VirtualRpcRequest) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasDeadline() != other.hasDeadline()) return false; + if (hasDeadline()) { + if (!getDeadline().equals(other.getDeadline())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasDeadline()) { + hash = (37 * hash) + DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getDeadline().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest 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.VirtualRpcRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest 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.VirtualRpcRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.VirtualRpcRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcRequest) + com.google.bigtable.v2.VirtualRpcRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.class, + com.google.bigtable.v2.VirtualRpcRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDeadlineFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + deadline_ = null; + if (deadlineBuilder_ != null) { + deadlineBuilder_.dispose(); + deadlineBuilder_ = null; + } + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest build() { + com.google.bigtable.v2.VirtualRpcRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest buildPartial() { + com.google.bigtable.v2.VirtualRpcRequest result = + new com.google.bigtable.v2.VirtualRpcRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deadline_ = deadlineBuilder_ == null ? deadline_ : deadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcRequest) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcRequest other) { + if (other == com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasDeadline()) { + mergeDeadline(other.getDeadline()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Duration deadline_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + deadlineBuilder_; + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + public boolean hasDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + public com.google.protobuf.Duration getDeadline() { + if (deadlineBuilder_ == null) { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } else { + return deadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder setDeadline(com.google.protobuf.Duration value) { + if (deadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deadline_ = value; + } else { + deadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder setDeadline(com.google.protobuf.Duration.Builder builderForValue) { + if (deadlineBuilder_ == null) { + deadline_ = builderForValue.build(); + } else { + deadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder mergeDeadline(com.google.protobuf.Duration value) { + if (deadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && deadline_ != null + && deadline_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDeadlineBuilder().mergeFrom(value); + } else { + deadline_ = value; + } + } else { + deadlineBuilder_.mergeFrom(value); + } + if (deadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder clearDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + deadline_ = null; + if (deadlineBuilder_ != null) { + deadlineBuilder_.dispose(); + deadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public com.google.protobuf.Duration.Builder getDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder() { + if (deadlineBuilder_ != null) { + return deadlineBuilder_.getMessageOrBuilder(); + } else { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDeadlineFieldBuilder() { + if (deadlineBuilder_ == null) { + deadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDeadline(), getParentForChildren(), isClean()); + deadline_ = null; + } + return deadlineBuilder_; + } + + private com.google.bigtable.v2.VirtualRpcRequest.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder setMetadata(com.google.bigtable.v2.VirtualRpcRequest.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder setMetadata( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder mergeMetadata(com.google.bigtable.v2.VirtualRpcRequest.Metadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && metadata_ != null + && metadata_ + != com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000004); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000008); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcRequest) + private static final com.google.bigtable.v2.VirtualRpcRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcRequest(); + } + + public static com.google.bigtable.v2.VirtualRpcRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VirtualRpcRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VirtualRpcRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java new file mode 100644 index 000000000000..2d18771f315c --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface VirtualRpcRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Client chosen, monotonically increasing identifier for the request.
+   * Must be unique within a session.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + boolean hasDeadline(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + com.google.protobuf.Duration getDeadline(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * Could be TableRequest (or in post-V1, SqlRequest)
+   * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java new file mode 100644 index 000000000000..c7a7d7e56acb --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java @@ -0,0 +1,1001 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcResponse} + */ +@com.google.protobuf.Generated +public final class VirtualRpcResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcResponse) + VirtualRpcResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VirtualRpcResponse"); + } + + // Use VirtualRpcResponse.newBuilder() to construct. + private VirtualRpcResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VirtualRpcResponse() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcResponse.class, + com.google.bigtable.v2.VirtualRpcResponse.Builder.class); + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int CLUSTER_INFO_FIELD_NUMBER = 2; + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + @java.lang.Override + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + public static final int STATS_FIELD_NUMBER = 4; + private com.google.bigtable.v2.SessionRequestStats stats_; + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats getStats() { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder() { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Could be TableResponse (or in post-V1, SqlResponse)
+   * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + 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 (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getClusterInfo()); + } + if (!payload_.isEmpty()) { + output.writeBytes(3, payload_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClusterInfo()); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, payload_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStats()); + } + size += getUnknownFields().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.VirtualRpcResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcResponse other = + (com.google.bigtable.v2.VirtualRpcResponse) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasClusterInfo() != other.hasClusterInfo()) return false; + if (hasClusterInfo()) { + if (!getClusterInfo().equals(other.getClusterInfo())) return false; + } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasClusterInfo()) { + hash = (37 * hash) + CLUSTER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getClusterInfo().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse 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.VirtualRpcResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse 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.VirtualRpcResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.VirtualRpcResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcResponse) + com.google.bigtable.v2.VirtualRpcResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcResponse.class, + com.google.bigtable.v2.VirtualRpcResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterInfoFieldBuilder(); + internalGetStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse build() { + com.google.bigtable.v2.VirtualRpcResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse buildPartial() { + com.google.bigtable.v2.VirtualRpcResponse result = + new com.google.bigtable.v2.VirtualRpcResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterInfo_ = + clusterInfoBuilder_ == null ? clusterInfo_ : clusterInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcResponse) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcResponse other) { + if (other == com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasClusterInfo()) { + mergeClusterInfo(other.getClusterInfo()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetClusterInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + clusterInfoBuilder_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + if (clusterInfoBuilder_ == null) { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } else { + return clusterInfoBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterInfo_ = value; + } else { + clusterInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo( + com.google.bigtable.v2.ClusterInformation.Builder builderForValue) { + if (clusterInfoBuilder_ == null) { + clusterInfo_ = builderForValue.build(); + } else { + clusterInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder mergeClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && clusterInfo_ != null + && clusterInfo_ != com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) { + getClusterInfoBuilder().mergeFrom(value); + } else { + clusterInfo_ = value; + } + } else { + clusterInfoBuilder_.mergeFrom(value); + } + if (clusterInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder clearClusterInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformation.Builder getClusterInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetClusterInfoFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + if (clusterInfoBuilder_ != null) { + return clusterInfoBuilder_.getMessageOrBuilder(); + } else { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + internalGetClusterInfoFieldBuilder() { + if (clusterInfoBuilder_ == null) { + clusterInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder>( + getClusterInfo(), getParentForChildren(), isClean()); + clusterInfo_ = null; + } + return clusterInfoBuilder_; + } + + private com.google.bigtable.v2.SessionRequestStats stats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder> + statsBuilder_; + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + public com.google.bigtable.v2.SessionRequestStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder setStats(com.google.bigtable.v2.SessionRequestStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder setStats(com.google.bigtable.v2.SessionRequestStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder mergeStats(com.google.bigtable.v2.SessionRequestStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && stats_ != null + && stats_ != com.google.bigtable.v2.SessionRequestStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000004); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public com.google.bigtable.v2.SessionRequestStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatsFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder> + internalGetStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000008); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcResponse) + private static final com.google.bigtable.v2.VirtualRpcResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcResponse(); + } + + public static com.google.bigtable.v2.VirtualRpcResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VirtualRpcResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VirtualRpcResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java new file mode 100644 index 000000000000..a4619c1118ba --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 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! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface VirtualRpcResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + boolean hasClusterInfo(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + com.google.bigtable.v2.ClusterInformation getClusterInfo(); + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder(); + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + com.google.bigtable.v2.SessionRequestStats getStats(); + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder(); + + /** + * + * + *
+   * Could be TableResponse (or in post-V1, SqlResponse)
+   * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto new file mode 100644 index 000000000000..1a2bb37cccc4 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto @@ -0,0 +1,1270 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +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/bigtable/v2/request_stats.proto"; +import "google/bigtable/v2/session.proto"; +import "google/bigtable/v2/types.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "BigtableProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; +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/AuthorizedView" + pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}" +}; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + pattern: "projects/{project}/instances/{instance}/materializedViews/{materialized_view}" +}; + +// Service for reading from and writing to existing Bigtable tables. +service Bigtable { + option (google.api.default_host) = "bigtable.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigtable.data," + "https://www.googleapis.com/auth/bigtable.data.readonly," + "https://www.googleapis.com/auth/cloud-bigtable.data," + "https://www.googleapis.com/auth/cloud-bigtable.data.readonly," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Streams back the contents of all requested rows in key order, optionally + // applying the same Reader filter to each. Depending on their size, + // rows and cells may be broken up across multiple responses, but + // atomicity of each row will still be preserved. See the + // ReadRowsResponse documentation for details. + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows" + body: "*" + } + additional_bindings { + post: "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:readRows" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + routing_parameters { + field: "materialized_view_name" + path_template: "{name=projects/*/instances/*}/**" + } + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Returns a sample of row keys in the table. The returned row keys will + // delimit contiguous sections of the table of approximately equal size, + // which can be used to break up the data for distributed tasks like + // mapreduces. + rpc SampleRowKeys(SampleRowKeysRequest) + returns (stream SampleRowKeysResponse) { + option (google.api.http) = { + get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys" + additional_bindings { + get: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:sampleRowKeys" + } + additional_bindings { + get: "/v2/{materialized_view_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + routing_parameters { + field: "materialized_view_name" + path_template: "{name=projects/*/instances/*}/**" + } + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Mutates a row atomically. Cells already present in the row are left + // unchanged unless explicitly changed by `mutation`. + rpc MutateRow(MutateRowRequest) returns (MutateRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,row_key,mutations"; + option (google.api.method_signature) = + "table_name,row_key,mutations,app_profile_id"; + } + + // Mutates multiple rows in a batch. Each individual row is mutated + // atomically as in MutateRow, but the entire batch is not executed + // atomically. + rpc MutateRows(MutateRowsRequest) returns (stream MutateRowsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:mutateRows" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,entries"; + option (google.api.method_signature) = "table_name,entries,app_profile_id"; + } + + // Mutates a row atomically based on the output of a predicate Reader filter. + rpc CheckAndMutateRow(CheckAndMutateRowRequest) + returns (CheckAndMutateRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + 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 + // timestamp is the greater of the existing timestamp or the current server + // time. The method returns the new contents of all modified cells. + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) + returns (ReadModifyWriteRowResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow" + body: "*" + additional_bindings { + post: "/v2/{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow" + body: "*" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { field: "app_profile_id" } + routing_parameters { + field: "authorized_view_name" + path_template: "{table_name=projects/*/instances/*/tables/*}/**" + } + }; + option (google.api.method_signature) = "table_name,row_key,rules"; + option (google.api.method_signature) = + "table_name,row_key,rules,app_profile_id"; + } + + // Returns the current list of partitions that make up the table's + // change stream. The union of partitions will cover the entire keyspace. + // Partitions can be read with `ReadChangeStream`. + // NOTE: This API is only intended to be used by Apache Beam BigtableIO. + rpc GenerateInitialChangeStreamPartitions( + GenerateInitialChangeStreamPartitionsRequest) + returns (stream GenerateInitialChangeStreamPartitionsResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions" + body: "*" + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Reads changes from a table's change stream. Changes will + // reflect both user-initiated mutations and mutations that are caused by + // garbage collection. + // NOTE: This API is only intended to be used by Apache Beam BigtableIO. + rpc ReadChangeStream(ReadChangeStreamRequest) + returns (stream ReadChangeStreamResponse) { + option (google.api.http) = { + post: "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream" + body: "*" + }; + option (google.api.method_signature) = "table_name"; + option (google.api.method_signature) = "table_name,app_profile_id"; + } + + // Prepares a GoogleSQL query for execution on a particular Bigtable instance. + rpc PrepareQuery(PrepareQueryRequest) returns (PrepareQueryResponse) { + option (google.api.http) = { + post: "/v2/{instance_name=projects/*/instances/*}:prepareQuery" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "instance_name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } + }; + option (google.api.method_signature) = "instance_name,query"; + option (google.api.method_signature) = "instance_name,query,app_profile_id"; + } + + // Executes a SQL query against a particular Bigtable instance. + rpc ExecuteQuery(ExecuteQueryRequest) returns (stream ExecuteQueryResponse) { + option (google.api.http) = { + post: "/v2/{instance_name=projects/*/instances/*}:executeQuery" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "instance_name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } + }; + option (google.api.method_signature) = "instance_name,query"; + option (google.api.method_signature) = "instance_name,query,app_profile_id"; + } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc GetClientConfiguration(GetClientConfigurationRequest) + returns (ClientConfiguration) {} + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenTable(stream SessionRequest) returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_TABLE; + } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenAuthorizedView(stream SessionRequest) + returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenMaterializedView(stream SessionRequest) + returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + } +} + +// Request message for Bigtable.ReadRows. +message ReadRowsRequest { + // The desired view into RequestStats that should be returned in the response. + // + // See also: RequestStats message. + enum RequestStatsView { + // The default / unset value. The API will default to the NONE option below. + REQUEST_STATS_VIEW_UNSPECIFIED = 0; + + // Do not include any RequestStats in the response. This will leave the + // RequestStats embedded message unset in the response. + REQUEST_STATS_NONE = 1; + + // Include the full set of available RequestStats in the response, + // applicable to this read. + REQUEST_STATS_FULL = 2; + } + + // Optional. The unique name of the table from which to read. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView from which to read. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The unique name of the MaterializedView from which to read. + // + // Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 5; + + // 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 stop after committing to N rows' worth of results. The + // default (zero) is to return all results. + int64 rows_limit = 4; + + // The view into RequestStats, as described above. + RequestStatsView request_stats_view = 6; + + // Experimental API - Please note that this API is currently experimental + // and can change in the future. + // + // Return rows in lexiographical descending order of the row keys. The row + // contents will not be affected by this flag. + // + // Example result set: + // + // [ + // {key: "k2", "f:col1": "v1", "f:col2": "v1"}, + // {key: "k1", "f:col1": "v2", "f:col2": "v2"} + // ] + bool reversed = 7; +} + +// Response message for Bigtable.ReadRows. +message ReadRowsResponse { + // Specifies a piece of a row's contents returned as part of the read + // response stream. + message CellChunk { + // The row key for this chunk of data. If the row key is empty, + // this CellChunk is a continuation of the same row as the previous + // CellChunk in the response stream, even if that CellChunk was in a + // previous ReadRowsResponse message. + bytes row_key = 1; + + // The column family name for this chunk of data. If this message + // is not present this CellChunk is a continuation of the same column + // family as the previous CellChunk. The empty string can occur as a + // column family name in a response so clients must check + // explicitly for the presence of this message, not just for + // `family_name.value` being non-empty. + google.protobuf.StringValue family_name = 2; + + // The column qualifier for this chunk of data. If this message + // is not present, this CellChunk is a continuation of the same column + // as the previous CellChunk. Column qualifiers may be empty so + // clients must check for the presence of this message, not just + // for `qualifier.value` being non-empty. + google.protobuf.BytesValue qualifier = 3; + + // The cell's stored timestamp, which also uniquely identifies it + // within its column. Values are always expressed in + // microseconds, but individual tables may set a coarser + // granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will + // only allow values of `timestamp_micros` which are multiples of + // 1000. Timestamps are only set in the first CellChunk per cell + // (for cells split into multiple chunks). + int64 timestamp_micros = 4; + + // Labels applied to the cell by a + // [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set + // on the first CellChunk per cell. + repeated string labels = 5; + + // The value stored in the cell. Cell values can be split across + // multiple CellChunks. In that case only the value field will be + // set in CellChunks after the first: the timestamp and labels + // will only be present in the first CellChunk, even if the first + // CellChunk came in a previous ReadRowsResponse. + bytes value = 6; + + // If this CellChunk is part of a chunked cell value and this is + // not the final chunk of that cell, value_size will be set to the + // total length of the cell value. The client can use this size + // to pre-allocate memory to hold the full cell value. + int32 value_size = 7; + + // Signals to the client concerning previous CellChunks received. + oneof row_status { + // Indicates that the client should drop all previous chunks for + // `row_key`, as it will be re-read from the beginning. + bool reset_row = 8; + + // Indicates that the client can safely process all previous chunks for + // `row_key`, as its data has been fully read. + bool commit_row = 9; + } + } + + // A collection of a row's contents as part of the read request. + repeated CellChunk chunks = 1; + + // Optionally the server might return the row key of the last row it + // has scanned. The client can use this to construct a more + // efficient retry request if needed: any row keys or portions of + // ranges less than this row key can be dropped from the request. + // This is primarily useful for cases where the server has read a + // lot of data that was filtered out since the last committed row + // key, allowing the client to skip that work on a retry. + bytes last_scanned_row_key = 2; + + // If requested, return enhanced query performance statistics. The field + // request_stats is empty in a streamed response unless the ReadRowsResponse + // message contains request_stats in the last message of the stream. Always + // returned when requested, even when the read request returns an empty + // response. + RequestStats request_stats = 3; +} + +// Request message for Bigtable.SampleRowKeys. +message SampleRowKeysRequest { + // Optional. The unique name of the table from which to sample row keys. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView from which to sample row + // keys. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // Optional. The unique name of the MaterializedView from which to read. + // + // Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/MaterializedView" + } + ]; + + // 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.SampleRowKeys. +message SampleRowKeysResponse { + // Sorted streamed sequence of sample row keys in the table. The table might + // have contents before the first row key in the list and after the last one, + // but a key containing the empty string indicates "end of table" and will be + // the last response given, if present. + // Note that row keys in this list may not have ever been written to or read + // from, and users should therefore not make any assumptions about the row key + // structure that are specific to their use case. + bytes row_key = 1; + + // Approximate total storage space used by all rows in the table which precede + // `row_key`. Buffering the contents of all rows between two subsequent + // samples would require space roughly equal to the difference in their + // `offset_bytes` fields. + int64 offset_bytes = 2; +} + +// Request message for Bigtable.MutateRow. +message MutateRowRequest { + // Optional. The unique name of the table to which the mutation should be + // applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the mutation + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 4; + + // Required. The key of the row to which the mutation should be applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Changes to be atomically applied to the specified row. Entries + // are applied in order, meaning that earlier mutations can be masked by later + // ones. Must contain at least one entry and at most 100000. + repeated Mutation mutations = 3 [(google.api.field_behavior) = REQUIRED]; + + // If set consistently across retries, prevents this mutation from being + // double applied to aggregate column families within a 15m window. + Idempotency idempotency = 8; +} + +// Response message for Bigtable.MutateRow. +message MutateRowResponse {} + +// Request message for BigtableService.MutateRows. +message MutateRowsRequest { + // A mutation for a given row. + message Entry { + // The key of the row to which the `mutations` should be applied. + bytes row_key = 1; + + // Required. Changes to be atomically applied to the specified row. + // Mutations are applied in order, meaning that earlier mutations can be + // masked by later ones. You must specify at least one mutation. + repeated Mutation mutations = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set consistently across retries, prevents this mutation from being + // double applied to aggregate column families within a 15m window. + Idempotency idempotency = 3; + } + + // Optional. The unique name of the table to which the mutations should be + // applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the mutations + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 3; + + // Required. The row keys and corresponding mutations to be applied in bulk. + // Each entry is applied as an atomic mutation, but the entries may be + // applied in arbitrary order (even between entries for the same row). + // At least one entry must be specified, and in total the entries can + // contain at most 100000 mutations. + repeated Entry entries = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for BigtableService.MutateRows. +message MutateRowsResponse { + // The result of applying a passed mutation in the original request. + message Entry { + // The index into the original request's `entries` list of the Entry + // for which a result is being reported. + int64 index = 1; + + // The result of the request Entry identified by `index`. + // Depending on how requests are batched during execution, it is possible + // for one Entry to fail due to an error with another Entry. In the event + // that this occurs, the same error will be reported for both entries. + google.rpc.Status status = 2; + } + + // One or more results for Entries from the batch request. + repeated Entry entries = 1; + + // Information about how client should limit the rate (QPS). Primirily used by + // supported official Cloud Bigtable clients. If unset, the rate limit info is + // not provided by the server. + optional RateLimitInfo rate_limit_info = 3; +} + +// Information about how client should adjust the load to Bigtable. +message RateLimitInfo { + // Time that clients should wait before adjusting the target rate again. + // If clients adjust rate too frequently, the impact of the previous + // adjustment may not have been taken into account and may + // over-throttle or under-throttle. If clients adjust rate too slowly, they + // will not be responsive to load changes on server side, and may + // over-throttle or under-throttle. + google.protobuf.Duration period = 1; + + // If it has been at least one `period` since the last load adjustment, the + // client should multiply the current load by this value to get the new target + // load. For example, if the current load is 100 and `factor` is 0.8, the new + // target load should be 80. After adjusting, the client should ignore + // `factor` until another `period` has passed. + // + // The client can measure its load using any unit that's comparable over time. + // For example, QPS can be used as long as each request involves a similar + // amount of work. + double factor = 2; +} + +// Request message for Bigtable.CheckAndMutateRow. +message CheckAndMutateRowRequest { + // Optional. The unique name of the table to which the conditional mutation + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the conditional + // mutation should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 7; + + // Required. The key of the row to which the conditional mutation should be + // applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The filter to be applied to the contents of the specified row. Depending + // on whether or not any results are yielded, either `true_mutations` or + // `false_mutations` will be executed. If unset, checks that the row contains + // any values at all. + RowFilter predicate_filter = 6; + + // Changes to be atomically applied to the specified row if `predicate_filter` + // yields at least one cell when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `false_mutations` is empty, and at most + // 100000. + repeated Mutation true_mutations = 4; + + // Changes to be atomically applied to the specified row if `predicate_filter` + // does not yield any cells when applied to `row_key`. Entries are applied in + // order, meaning that earlier mutations can be masked by later ones. + // Must contain at least one entry if `true_mutations` is empty, and at most + // 100000. + repeated Mutation false_mutations = 5; +} + +// Response message for Bigtable.CheckAndMutateRow. +message CheckAndMutateRowResponse { + // Whether or not the request's `predicate_filter` yielded any results for + // the specified row. + 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 { + // Optional. The unique name of the table to which the read/modify/write rules + // should be applied. + // + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // Optional. The unique name of the AuthorizedView to which the + // read/modify/write rules should be applied. + // + // Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 4; + + // Required. The key of the row to which the read/modify/write rules should be + // applied. + bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rules specifying how the specified row's contents are to be + // transformed into writes. Entries are applied in order, meaning that earlier + // rules will affect the results of later ones. At least one entry must be + // specified, and there can be at most 100000 rules. + repeated ReadModifyWriteRule rules = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.ReadModifyWriteRow. +message ReadModifyWriteRowResponse { + // A Row containing the new contents of all cells modified by the request. + Row row = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Request message for Bigtable.GenerateInitialChangeStreamPartitions. +message GenerateInitialChangeStreamPartitionsRequest { + // Required. The unique name of the table from which to get change stream + // partitions. Values are of the form + // `projects//instances//tables/
`. + // Change streaming must be enabled on the table. + string table_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + // Single cluster routing must be configured on the profile. + string app_profile_id = 2; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Response message for Bigtable.GenerateInitialChangeStreamPartitions. +message GenerateInitialChangeStreamPartitionsResponse { + // A partition of the change stream. + StreamPartition partition = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Request message for Bigtable.ReadChangeStream. +message ReadChangeStreamRequest { + // Required. The unique name of the table from which to read a change stream. + // Values are of the form + // `projects//instances//tables/
`. + // Change streaming must be enabled on the table. + string table_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Table" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + // Single cluster routing must be configured on the profile. + string app_profile_id = 2; + + // The partition to read changes from. + StreamPartition partition = 3; + + // Options for describing where we want to start reading from the stream. + oneof start_from { + // Start reading the stream at the specified timestamp. This timestamp must + // be within the change stream retention period, less than or equal to the + // current time, and after change stream creation, whichever is greater. + // This value is inclusive and will be truncated to microsecond granularity. + google.protobuf.Timestamp start_time = 4; + + // Tokens that describe how to resume reading a stream where reading + // previously left off. If specified, changes will be read starting at the + // the position. Tokens are delivered on the stream as part of `Heartbeat` + // and `CloseStream` messages. + // + // If a single token is provided, the token's partition must exactly match + // the request's partition. If multiple tokens are provided, as in the case + // of a partition merge, the union of the token partitions must exactly + // cover the request's partition. Otherwise, INVALID_ARGUMENT will be + // returned. + StreamContinuationTokens continuation_tokens = 6; + } + + // If specified, OK will be returned when the stream advances beyond + // this time. Otherwise, changes will be continuously delivered on the stream. + // This value is inclusive and will be truncated to microsecond granularity. + google.protobuf.Timestamp end_time = 5; + + // If specified, the duration between `Heartbeat` messages on the stream. + // Otherwise, defaults to 5 seconds. + google.protobuf.Duration heartbeat_duration = 7; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// Response message for Bigtable.ReadChangeStream. +message ReadChangeStreamResponse { + // A partial or complete mutation. + message MutationChunk { + // Information about the chunking of this mutation. + // Only `SetCell` mutations can be chunked, and all chunks for a `SetCell` + // will be delivered contiguously with no other mutation types interleaved. + message ChunkInfo { + // The total value size of all the chunks that make up the `SetCell`. + int32 chunked_value_size = 1; + + // The byte offset of this chunk into the total value size of the + // mutation. + int32 chunked_value_offset = 2; + + // When true, this is the last chunk of a chunked `SetCell`. + bool last_chunk = 3; + } + + // If set, then the mutation is a `SetCell` with a chunked value across + // multiple messages. + ChunkInfo chunk_info = 1; + + // If this is a continuation of a chunked message (`chunked_value_offset` > + // 0), ignore all fields except the `SetCell`'s value and merge it with + // the previous message by concatenating the value fields. + Mutation mutation = 2; + } + + // A message corresponding to one or more mutations to the partition + // being streamed. A single logical `DataChange` message may also be split + // across a sequence of multiple individual messages. Messages other than + // the first in a sequence will only have the `type` and `chunks` fields + // populated, with the final message in the sequence also containing `done` + // set to true. + message DataChange { + // The type of mutation. + enum Type { + // The type is unspecified. + TYPE_UNSPECIFIED = 0; + + // A user-initiated mutation. + USER = 1; + + // A system-initiated mutation as part of garbage collection. + // https://cloud.google.com/bigtable/docs/garbage-collection + GARBAGE_COLLECTION = 2; + + // This is a continuation of a multi-message change. + CONTINUATION = 3; + } + + // The type of the mutation. + Type type = 1; + + // The cluster where the mutation was applied. + // Not set when `type` is `GARBAGE_COLLECTION`. + string source_cluster_id = 2; + + // The row key for all mutations that are part of this `DataChange`. + // If the `DataChange` is chunked across multiple messages, then this field + // will only be set for the first message. + bytes row_key = 3; + + // The timestamp at which the mutation was applied on the Bigtable server. + google.protobuf.Timestamp commit_timestamp = 4; + + // A value that lets stream consumers reconstruct Bigtable's + // conflict resolution semantics. + // https://cloud.google.com/bigtable/docs/writes#conflict-resolution + // In the event that the same row key, column family, column qualifier, + // timestamp are modified on different clusters at the same + // `commit_timestamp`, the mutation with the larger `tiebreaker` will be the + // one chosen for the eventually consistent state of the system. + int32 tiebreaker = 5; + + // The mutations associated with this change to the partition. + // May contain complete mutations or chunks of a multi-message chunked + // `DataChange` record. + repeated MutationChunk chunks = 6; + + // When true, indicates that the entire `DataChange` has been read + // and the client can safely process the message. + bool done = 8; + + // An encoded position for this stream's partition to restart reading from. + // This token is for the StreamPartition from the request. + string token = 9; + + // An estimate of the commit timestamp that is usually lower than or equal + // to any timestamp for a record that will be delivered in the future on the + // stream. It is possible that, under particular circumstances that a future + // record has a timestamp that is lower than a previously seen timestamp. + // For an example usage see + // https://beam.apache.org/documentation/basics/#watermarks + google.protobuf.Timestamp estimated_low_watermark = 10; + } + + // A periodic message with information that can be used to checkpoint + // the state of a stream. + message Heartbeat { + // A token that can be provided to a subsequent `ReadChangeStream` call + // to pick up reading at the current stream position. + StreamContinuationToken continuation_token = 1; + + // An estimate of the commit timestamp that is usually lower than or equal + // to any timestamp for a record that will be delivered in the future on the + // stream. It is possible that, under particular circumstances that a future + // record has a timestamp that is lower than a previously seen timestamp. + // For an example usage see + // https://beam.apache.org/documentation/basics/#watermarks + google.protobuf.Timestamp estimated_low_watermark = 2; + } + + // A message indicating that the client should stop reading from the stream. + // If status is OK and `continuation_tokens` & `new_partitions` are empty, the + // stream has finished (for example if there was an `end_time` specified). + // If `continuation_tokens` & `new_partitions` are present, then a change in + // partitioning requires the client to open a new stream for each token to + // resume reading. Example: + // + // [B, D) ends + // | + // v + // new_partitions: [A, C) [C, E) + // continuation_tokens.partitions: [B,C) [C,D) + // ^---^ ^---^ + // ^ ^ + // | | + // | StreamContinuationToken 2 + // | + // StreamContinuationToken 1 + // + // To read the new partition [A,C), supply the continuation tokens whose + // ranges cover the new partition, for example ContinuationToken[A,B) & + // ContinuationToken[B,C). + message CloseStream { + // The status of the stream. + google.rpc.Status status = 1; + + // If non-empty, contains the information needed to resume reading their + // associated partitions. + repeated StreamContinuationToken continuation_tokens = 2; + + // If non-empty, contains the new partitions to start reading from, which + // are related to but not necessarily identical to the partitions for the + // above `continuation_tokens`. + repeated StreamPartition new_partitions = 3; + } + + // The data or control message on the stream. + oneof stream_record { + // A mutation to the partition. + DataChange data_change = 1; + + // A periodic heartbeat message. + Heartbeat heartbeat = 2; + + // An indication that the stream should be closed. + CloseStream close_stream = 3; + } +} + +// Request message for Bigtable.ExecuteQuery +message ExecuteQueryRequest { + // Required. The unique name of the instance against which the query should be + // executed. + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. This value specifies routing for replication. If not specified, + // the `default` application profile will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The query string. + // + // Exactly one of `query` and `prepared_query` is required. Setting both + // or neither is an `INVALID_ARGUMENT`. + string query = 3 [deprecated = true, (google.api.field_behavior) = REQUIRED]; + + // A prepared query that was returned from `PrepareQueryResponse`. + // + // Exactly one of `query` and `prepared_query` is required. Setting both + // or neither is an `INVALID_ARGUMENT`. + // + // Setting this field also places restrictions on several other fields: + // - `data_format` must be empty. + // - `validate_only` must be false. + // - `params` must match the `param_types` set in the `PrepareQueryRequest`. + bytes prepared_query = 9; + + // Requested data format for the response. + // + // If `prepared_query` is set, then the `data_format` is fixed by the + // `PrepareQueryRequest`, and a non-empty `data_format` in the + // `ExecuteQueryRequest` will be rejected with `INVALID_ARGUMENT`. + oneof data_format { + // Protocol buffer format as described by ProtoSchema and ProtoRows + // messages. + ProtoFormat proto_format = 4 [deprecated = true]; + } + + // Optional. If this request is resuming a previously interrupted query + // execution, `resume_token` should be copied from the last + // PartialResultSet yielded before the interruption. Doing this + // enables the query execution to resume where the last one left + // off. + // The rest of the request parameters must exactly match the + // request that yielded this token. Otherwise the request will fail. + bytes resume_token = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Required. params contains string type keys and Bigtable type values that + // bind to placeholders in the query string. In query string, a parameter + // placeholder consists of the + // `@` character followed by the parameter name (for example, `@firstName`) in + // the query string. + // + // For example, if + // `params["firstName"] = bytes_value: "foo" type {bytes_type {}}` + // then `@firstName` will be replaced with googlesql bytes value "foo" in the + // query string during query evaluation. + // + // If `Value.kind` is not set, the value is treated as a NULL value of the + // given type. For example, if + // `params["firstName"] = type {string_type {}}` + // then `@firstName` will be replaced with googlesql null string. + // + // If `query` is set, any empty `Value.type` in the map will be rejected with + // `INVALID_ARGUMENT`. + // + // If `prepared_query` is set, any empty `Value.type` in the map will be + // inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty + // `Value.type` must match the corresponding `param_types` entry, or be + // rejected with `INVALID_ARGUMENT`. + map params = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.ExecuteQuery +message ExecuteQueryResponse { + // The first response streamed from the server is of type `ResultSetMetadata` + // and includes information about the columns and types of the result set. + // From there on, we stream `PartialResultSet` messages with no additional + // information. `PartialResultSet` will contain `resume_token` to restart the + // response if query interrupts. In case of resumption with `resume_token`, + // the server will not resend the ResultSetMetadata. + oneof response { + // Structure of rows in this response stream. The first (and only the first) + // response streamed from the server will be of this type. + ResultSetMetadata metadata = 1; + + // A partial result set with row data potentially including additional + // instructions on how recent past and future partial responses should be + // interpreted. + PartialResultSet results = 2; + } +} + +// Request message for Bigtable.PrepareQuery +message PrepareQueryRequest { + // Required. The unique name of the instance against which the query should be + // executed. + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. This value specifies routing for preparing the query. Note that + // this `app_profile_id` is only used for preparing the query. The actual + // query execution will use the app profile specified in the + // `ExecuteQueryRequest`. If not specified, the `default` application profile + // will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The query string. + string query = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Requested data format for the response. Note that the selected + // data format is binding for all `ExecuteQuery` rpcs that use the prepared + // query. + oneof data_format { + // Protocol buffer format as described by ProtoSchema and ProtoRows + // messages. + ProtoFormat proto_format = 4; + } + + // Required. `param_types` is a map of parameter identifier strings to their + // `Type`s. + // + // In query string, a parameter placeholder consists of the + // `@` character followed by the parameter name (for example, `@firstName`) in + // the query string. + // + // For example, if param_types["firstName"] = Bytes then @firstName will be a + // query parameter of type Bytes. The specific `Value` to be used for the + // query execution must be sent in `ExecuteQueryRequest` in the `params` map. + map param_types = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for Bigtable.PrepareQueryResponse +message PrepareQueryResponse { + // Structure of rows in the response stream of `ExecuteQueryResponse` for the + // returned `prepared_query`. + ResultSetMetadata metadata = 1; + + // A serialized prepared query. Clients should treat this as an opaque + // blob of bytes to send in `ExecuteQueryRequest`. + bytes prepared_query = 2; + + // The time at which the prepared query token becomes invalid. + // A token may become invalid early due to changes in the data being read, but + // it provides a guideline to refresh query plans asynchronously. + google.protobuf.Timestamp valid_until = 3; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto new file mode 100644 index 000000000000..010637b0016a --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto @@ -0,0 +1,871 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +import "google/api/field_behavior.proto"; +import "google/bigtable/v2/types.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "DataProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Specifies the complete (requested) contents of a single row of a table. +// Rows which exceed 256MiB in size cannot be read in full. +message Row { + // The unique key which identifies this row within its table. This is the same + // key that's used to identify the row in, for example, a MutateRowRequest. + // May contain any non-empty byte string up to 4KiB in length. + bytes key = 1; + + // May be empty, but only if the entire row is empty. + // The mutual ordering of column families is not specified. + repeated Family families = 2; +} + +// Specifies (some of) the contents of a single row/column family intersection +// of a table. +message Family { + // The unique key which identifies this family within its row. This is the + // same key that's used to identify the family in, for example, a RowFilter + // which sets its "family_name_regex_filter" field. + // Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may + // produce cells in a sentinel family with an empty name. + // Must be no greater than 64 characters in length. + string name = 1; + + // Must not be empty. Sorted in order of increasing "qualifier". + repeated Column columns = 2; +} + +// Specifies (some of) the contents of a single row/column intersection of a +// table. +message Column { + // The unique key which identifies this column within its family. This is the + // same key that's used to identify the column in, for example, a RowFilter + // which sets its `column_qualifier_regex_filter` field. + // May contain any byte string, including the empty string, up to 16kiB in + // length. + bytes qualifier = 1; + + // Must not be empty. Sorted in order of decreasing "timestamp_micros". + repeated Cell cells = 2; +} + +// Specifies (some of) the contents of a single row/column/timestamp of a table. +message Cell { + // The cell's stored timestamp, which also uniquely identifies it within + // its column. + // Values are always expressed in microseconds, but individual tables may set + // a coarser granularity to further restrict the allowed values. For + // example, a table which specifies millisecond granularity will only allow + // values of `timestamp_micros` which are multiples of 1000. + int64 timestamp_micros = 1; + + // The value stored in the cell. + // May contain any byte string, including the empty string, up to 100MiB in + // length. + bytes value = 2; + + // Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. + repeated string labels = 3; +} + +// `Value` represents a dynamically typed value. +// The typed fields in `Value` are used as a transport encoding for the actual +// value (which may be of a more complex type). See the documentation of the +// `Type` message for more details. +message Value { + // The verified `Type` of this `Value`, if it cannot be inferred. + // + // Read results will never specify the encoding for `type` since the value + // will already have been decoded by the server. Furthermore, the `type` will + // be omitted entirely if it can be inferred from a previous response. The + // exact semantics for inferring `type` will vary, and are therefore + // documented separately for each read method. + // + // When using composite types (Struct, Array, Map) only the outermost `Value` + // will specify the `type`. This top-level `type` will define the types for + // any nested `Struct' fields, `Array` elements, or `Map` key/value pairs. + // If a nested `Value` provides a `type` on write, the request will be + // rejected with INVALID_ARGUMENT. + Type type = 7; + + // Options for transporting values within the protobuf type system. A given + // `kind` may support more than one `type` and vice versa. On write, this is + // roughly analogous to a GoogleSQL literal. + // + // The value is `NULL` if none of the fields in `kind` is set. If `type` is + // also omitted on write, we will infer it based on the schema. + oneof kind { + // Represents a raw byte sequence with no type information. + // The `type` field must be omitted. + bytes raw_value = 8; + + // Represents a raw cell timestamp with no type information. + // The `type` field must be omitted. + int64 raw_timestamp_micros = 9; + + // Represents a typed value transported as a byte sequence. + bytes bytes_value = 2; + + // Represents a typed value transported as a string. + string string_value = 3; + + // Represents a typed value transported as an integer. + int64 int_value = 6; + + // Represents a typed value transported as a boolean. + bool bool_value = 10; + + // Represents a typed value transported as a floating point number. + // Does not support NaN or infinities. + double float_value = 11; + + // Represents a typed value transported as a timestamp. + google.protobuf.Timestamp timestamp_value = 12; + + // Represents a typed value transported as a date. + google.type.Date date_value = 13; + + // Represents a typed value transported as a sequence of values. + // To differentiate between `Struct`, `Array`, and `Map`, the outermost + // `Value` must provide an explicit `type` on write. This `type` will + // apply recursively to the nested `Struct` fields, `Array` elements, + // or `Map` key/value pairs, which *must not* supply their own `type`. + ArrayValue array_value = 4; + } +} + +// `ArrayValue` is an ordered list of `Value`. +message ArrayValue { + // The ordered elements in the array. + repeated Value values = 1; +} + +// Specifies a contiguous range of rows. +message RowRange { + // The row key at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_key { + // Used when giving an inclusive lower bound for the range. + bytes start_key_closed = 1; + + // Used when giving an exclusive lower bound for the range. + bytes start_key_open = 2; + } + + // The row key at which to end the range. + // If neither field is set, interpreted as the infinite row key, exclusive. + oneof end_key { + // Used when giving an exclusive upper bound for the range. + bytes end_key_open = 3; + + // Used when giving an inclusive upper bound for the range. + bytes end_key_closed = 4; + } +} + +// Specifies a non-contiguous set of rows. +message RowSet { + // Single rows included in the set. + repeated bytes row_keys = 1; + + // Contiguous row ranges included in the set. + repeated RowRange row_ranges = 2; +} + +// Specifies a contiguous range of columns within a single column family. +// The range spans from <column_family>:<start_qualifier> to +// <column_family>:<end_qualifier>, where both bounds can be either +// inclusive or exclusive. +message ColumnRange { + // The name of the column family within which this range falls. + string family_name = 1; + + // The column qualifier at which to start the range (within `column_family`). + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_qualifier { + // Used when giving an inclusive lower bound for the range. + bytes start_qualifier_closed = 2; + + // Used when giving an exclusive lower bound for the range. + bytes start_qualifier_open = 3; + } + + // The column qualifier at which to end the range (within `column_family`). + // If neither field is set, interpreted as the infinite string, exclusive. + oneof end_qualifier { + // Used when giving an inclusive upper bound for the range. + bytes end_qualifier_closed = 4; + + // Used when giving an exclusive upper bound for the range. + bytes end_qualifier_open = 5; + } +} + +// Specified a contiguous range of microsecond timestamps. +message TimestampRange { + // Inclusive lower bound. If left empty, interpreted as 0. + int64 start_timestamp_micros = 1; + + // Exclusive upper bound. If left empty, interpreted as infinity. + int64 end_timestamp_micros = 2; +} + +// Specifies a contiguous range of raw byte values. +message ValueRange { + // The value at which to start the range. + // If neither field is set, interpreted as the empty string, inclusive. + oneof start_value { + // Used when giving an inclusive lower bound for the range. + bytes start_value_closed = 1; + + // Used when giving an exclusive lower bound for the range. + bytes start_value_open = 2; + } + + // The value at which to end the range. + // If neither field is set, interpreted as the infinite string, exclusive. + oneof end_value { + // Used when giving an inclusive upper bound for the range. + bytes end_value_closed = 3; + + // Used when giving an exclusive upper bound for the range. + bytes end_value_open = 4; + } +} + +// Restricts the output to cells whose values match the given bitmask. +message ValueBitmask { + // Required. Mask applied to the value. + // Evaluated as: `(value & mask) == mask` + // The mask length must exactly match the value length, otherwise the cell is + // not considered a match. + bytes mask = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Takes a row as input and produces an alternate view of the row based on +// specified rules. For example, a RowFilter might trim down a row to include +// just the cells from columns matching a given regular expression, or might +// return all the cells of a row but not their values. More complicated filters +// can be composed out of these components to express requests such as, "within +// every column of a particular family, give just the two most recent cells +// which are older than timestamp X." +// +// There are two broad categories of RowFilters (true filters and transformers), +// as well as two ways to compose simple filters into more complex ones +// (chains and interleaves). They work as follows: +// +// * True filters alter the input row by excluding some of its cells wholesale +// from the output row. An example of a true filter is the `value_regex_filter`, +// which excludes cells whose values don't match the specified pattern. All +// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) +// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An +// important point to keep in mind is that `RE2(.)` is equivalent by default to +// `RE2([^\n])`, meaning that it does not match newlines. When attempting to +// match an arbitrary byte, you should therefore use the escape sequence `\C`, +// which may need to be further escaped as `\\C` in your client language. +// +// * Transformers alter the input row by changing the values of some of its +// cells in the output, without excluding them completely. Currently, the only +// supported transformer is the `strip_value_transformer`, which replaces every +// cell's value with the empty string. +// +// * 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 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. + message Chain { + // The elements of "filters" are chained together to process the input row: + // in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row + // The full chain is executed atomically. + repeated RowFilter filters = 1; + } + + // A RowFilter which sends each row to each of several component + // RowFilters and interleaves the results. + message Interleave { + // The elements of "filters" all process a copy of the input row, and the + // results are pooled, sorted, and combined into a single output row. + // If multiple cells are produced with the same column and timestamp, + // they will all appear in the output row in an unspecified mutual order. + // Consider the following example, with three filters: + // + // input row + // | + // ----------------------------------------------------- + // | | | + // f(0) f(1) f(2) + // | | | + // 1: foo,bar,10,x foo,bar,10,z far,bar,7,a + // 2: foo,blah,11,z far,blah,5,x far,blah,5,x + // | | | + // ----------------------------------------------------- + // | + // 1: foo,bar,10,z // could have switched with #2 + // 2: foo,bar,10,x // could have switched with #1 + // 3: foo,blah,11,z + // 4: far,bar,7,a + // 5: far,blah,5,x // identical to #6 + // 6: far,blah,5,x // identical to #5 + // + // All interleaved filters are executed atomically. + repeated RowFilter filters = 1; + } + + // A RowFilter which evaluates one of two possible RowFilters, depending on + // whether or not a predicate RowFilter outputs any cells from the input row. + // + // IMPORTANT NOTE: The predicate filter does not execute atomically with the + // true and false filters, which may lead to inconsistent or unexpected + // results. Additionally, Condition filters have poor performance, especially + // when filters are set for the false condition. + message Condition { + // If `predicate_filter` outputs any cells, then `true_filter` will be + // evaluated on the input row. Otherwise, `false_filter` will be evaluated. + RowFilter predicate_filter = 1; + + // The filter to apply to the input row if `predicate_filter` returns any + // results. If not provided, no results will be returned in the true case. + RowFilter true_filter = 2; + + // The filter to apply to the input row if `predicate_filter` does not + // return any results. If not provided, no results will be returned in the + // false case. + RowFilter false_filter = 3; + } + + // Which of the possible RowFilter types to apply. If none are set, this + // RowFilter returns all cells in the input row. + oneof filter { + // Applies several RowFilters to the data in sequence, progressively + // narrowing the results. + Chain chain = 1; + + // Applies several RowFilters to the data in parallel and combines the + // results. + Interleave interleave = 2; + + // Applies one of two possible RowFilters to the data based on the output of + // a predicate RowFilter. + Condition condition = 3; + + // ADVANCED USE ONLY. + // Hook for introspection into the RowFilter. Outputs all cells directly to + // the output of the read rather than to any parent filter. Consider the + // following example: + // + // Chain( + // FamilyRegex("A"), + // Interleave( + // All(), + // Chain(Label("foo"), Sink()) + // ), + // QualifierRegex("B") + // ) + // + // A,A,1,w + // A,B,2,x + // B,B,4,z + // | + // FamilyRegex("A") + // | + // A,A,1,w + // A,B,2,x + // | + // +------------+-------------+ + // | | + // All() Label(foo) + // | | + // A,A,1,w A,A,1,w,labels:[foo] + // A,B,2,x A,B,2,x,labels:[foo] + // | | + // | Sink() --------------+ + // | | | + // +------------+ x------+ A,A,1,w,labels:[foo] + // | A,B,2,x,labels:[foo] + // A,A,1,w | + // A,B,2,x | + // | | + // QualifierRegex("B") | + // | | + // A,B,2,x | + // | | + // +--------------------------------+ + // | + // A,A,1,w,labels:[foo] + // A,B,2,x,labels:[foo] // could be switched + // A,B,2,x // could be switched + // + // Despite being excluded by the qualifier filter, a copy of every cell + // that reaches the sink is present in the final result. + // + // As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], + // duplicate cells are possible, and appear in an unspecified mutual order. + // In this case we have a duplicate with column "A:B" and timestamp 2, + // because one copy passed through the all filter while the other was + // passed through the label and sink. Note that one copy has label "foo", + // while the other does not. + // + // Cannot be used within the `predicate_filter`, `true_filter`, or + // `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. + bool sink = 16; + + // Matches all cells, regardless of input. Functionally equivalent to + // leaving `filter` unset, but included for completeness. + bool pass_all_filter = 17; + + // Does not match any cells, regardless of input. Useful for temporarily + // disabling just part of a filter. + bool block_all_filter = 18; + + // Matches only cells from rows whose keys satisfy the given RE2 regex. In + // other words, passes through the entire row when the key matches, and + // otherwise produces an empty row. + // Note that, since row keys can contain arbitrary bytes, the `\C` escape + // sequence must be used if a true wildcard is desired. The `.` character + // will not match the new line character `\n`, which may be present in a + // binary key. + bytes row_key_regex_filter = 4; + + // Matches all cells from a row with probability p, and matches no cells + // from the row with probability 1-p. + double row_sample_filter = 14; + + // Matches only cells from columns whose families satisfy the given RE2 + // regex. For technical reasons, the regex must not contain the `:` + // character, even if it is not being used as a literal. + // Note that, since column families cannot contain the new line character + // `\n`, it is sufficient to use `.` as a full wildcard when matching + // column family names. + string family_name_regex_filter = 5; + + // Matches only cells from columns whose qualifiers satisfy the given RE2 + // regex. + // Note that, since column qualifiers can contain arbitrary bytes, the `\C` + // escape sequence must be used if a true wildcard is desired. The `.` + // character will not match the new line character `\n`, which may be + // present in a binary qualifier. + bytes column_qualifier_regex_filter = 6; + + // Matches only cells from columns within the given range. + ColumnRange column_range_filter = 7; + + // Matches only cells with timestamps within the given range. + TimestampRange timestamp_range_filter = 8; + + // Matches only cells with values that satisfy the given regular expression. + // Note that, since cell values can contain arbitrary bytes, the `\C` escape + // sequence must be used if a true wildcard is desired. The `.` character + // will not match the new line character `\n`, which may be present in a + // binary value. + bytes value_regex_filter = 9; + + // Matches only cells with values that fall within the given range. + ValueRange value_range_filter = 15; + + // Skips the first N cells of each row, matching all subsequent cells. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_row_offset_filter = 10; + + // Matches only the first N cells of each row. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_row_limit_filter = 11; + + // Matches only the most recent N cells within each column. For example, + // if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, + // skip all earlier cells in `foo:bar`, and then begin matching again in + // column `foo:bar2`. + // If duplicate cells are present, as is possible when using an Interleave, + // each copy of the cell is counted separately. + int32 cells_per_column_limit_filter = 12; + + // Replaces each cell's value with the empty string. + bool strip_value_transformer = 13; + + // Applies the given label to all cells in the output row. This allows + // the client to determine which results were produced from which part of + // the filter. + // + // Values must be at most 15 characters in length, and match the RE2 + // pattern `[a-z0-9\\-]+` + // + // Due to a technical limitation, it is not currently possible to apply + // multiple labels to a cell. As a result, a Chain may have no more than + // one sub-filter which contains a `apply_label_transformer`. It is okay for + // an Interleave to contain multiple `apply_label_transformers`, as they + // will be applied to separate copies of the input. This may be relaxed in + // the future. + string apply_label_transformer = 19; + + // Matches only cells with values that satisfy the condition `(value & mask) + // == mask`. + // The mask length must exactly match the value length, otherwise the cell + // is not considered a match. + ValueBitmask value_bitmask_filter = 20; + } +} + +// Specifies a particular change to be made to the contents of a row. +message Mutation { + // A Mutation which sets the value of the specified cell. + message SetCell { + // The name of the family into which new data should be written. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be written. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The timestamp of the cell into which new data should be written. + // Use -1 for current Bigtable server time. + // Otherwise, the client should set this value itself, noting that the + // default value is a timestamp of zero if the field is left unspecified. + // Values must match the granularity of the table (e.g. micros, millis). + int64 timestamp_micros = 3; + + // The value to be written into the specified cell. + bytes value = 4; + } + + // A Mutation which incrementally updates a cell in an `Aggregate` family. + message AddToCell { + // The name of the `Aggregate` family into which new data should be added. + // This must be a family with a `value_type` of `Aggregate`. + // Format: `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be added. This + // must be a `raw_value`. + Value column_qualifier = 2; + + // The timestamp of the cell to which new data should be added. This must + // be a `raw_timestamp_micros` that matches the table's `granularity`. + Value timestamp = 3; + + // The input value to be accumulated into the specified cell. This must be + // compatible with the family's `value_type.input_type`. + Value input = 4; + } + + // A Mutation which merges accumulated state into a cell in an `Aggregate` + // family. + message MergeToCell { + // The name of the `Aggregate` family into which new data should be added. + // This must be a family with a `value_type` of `Aggregate`. + // Format: `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column into which new data should be added. This + // must be a `raw_value`. + Value column_qualifier = 2; + + // The timestamp of the cell to which new data should be added. This must + // be a `raw_timestamp_micros` that matches the table's `granularity`. + Value timestamp = 3; + + // The input value to be merged into the specified cell. This must be + // compatible with the family's `value_type.state_type`. Merging `NULL` is + // allowed, but has no effect. + Value input = 4; + } + + // A Mutation which deletes cells from the specified column, optionally + // restricting the deletions to a given timestamp range. + message DeleteFromColumn { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column from which cells should be deleted. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The range of timestamps within which cells should be deleted. + TimestampRange time_range = 3; + } + + // A Mutation which deletes all cells from the specified column family. + message DeleteFromFamily { + // The name of the family from which cells should be deleted. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + } + + // A Mutation which deletes all cells from the containing row. + message DeleteFromRow {} + + // Which of the possible Mutation types to apply. + oneof mutation { + // Set a cell's value. + SetCell set_cell = 1; + + // Incrementally updates an `Aggregate` cell. + AddToCell add_to_cell = 5; + + // Merges accumulated state to an `Aggregate` cell. + MergeToCell merge_to_cell = 6; + + // Deletes cells from a column. + DeleteFromColumn delete_from_column = 2; + + // Deletes cells from a column family. + DeleteFromFamily delete_from_family = 3; + + // Deletes cells from the entire row. + DeleteFromRow delete_from_row = 4; + } +} + +// Specifies an atomic read/modify/write operation on the latest value of the +// specified column. +message ReadModifyWriteRule { + // The name of the family to which the read/modify/write should be applied. + // Must match `[-_.a-zA-Z0-9]+` + string family_name = 1; + + // The qualifier of the column to which the read/modify/write should be + // applied. + // Can be any byte string, including the empty string. + bytes column_qualifier = 2; + + // The rule used to determine the column's new latest value from its current + // latest value. + oneof rule { + // Rule specifying that `append_value` be appended to the existing value. + // If the targeted cell is unset, it will be treated as containing the + // empty string. + bytes append_value = 3; + + // Rule specifying that `increment_amount` be added to the existing value. + // If the targeted cell is unset, it will be treated as containing a zero. + // Otherwise, the targeted cell must contain an 8-byte value (interpreted + // as a 64-bit big-endian signed integer), or the entire request will fail. + int64 increment_amount = 4; + } +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// A partition of a change stream. +message StreamPartition { + // The row range covered by this partition and is specified by + // [`start_key_closed`, `end_key_open`). + RowRange row_range = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// The information required to continue reading the data from multiple +// `StreamPartitions` from where a previous read left off. +message StreamContinuationTokens { + // List of continuation tokens. + repeated StreamContinuationToken tokens = 1; +} + +// NOTE: This API is intended to be used by Apache Beam BigtableIO. +// The information required to continue reading the data from a +// `StreamPartition` from where a previous read left off. +message StreamContinuationToken { + // The partition that this token applies to. + StreamPartition partition = 1; + + // An encoded position in the stream to restart reading from. + string token = 2; +} + +// Protocol buffers format descriptor, as described by Messages ProtoSchema and +// ProtoRows +message ProtoFormat {} + +// Describes a column in a Bigtable Query Language result set. +message ColumnMetadata { + // The name of the column. + string name = 1; + + // The type of the column. + Type type = 2; +} + +// ResultSet schema in proto format +message ProtoSchema { + // The columns in the result set. + repeated ColumnMetadata columns = 1; +} + +// Describes the structure of a Bigtable result set. +message ResultSetMetadata { + // The schema of the ResultSet, contains ordered list of column names + // with types + oneof schema { + // Schema in proto format + ProtoSchema proto_schema = 1; + } +} + +// Rows represented in proto format. +// +// This should be constructed by concatenating the `batch_data` from each +// of the relevant `ProtoRowsBatch` messages and parsing the result as a +// `ProtoRows` message. +message ProtoRows { + // A proto rows message consists of a list of values. Every N complete values + // defines a row, where N is equal to the number of entries in the + // `metadata.proto_schema.columns` value received in the first response. + repeated Value values = 2; +} + +// A part of a serialized `ProtoRows` message. +message ProtoRowsBatch { + // Part of a serialized `ProtoRows` message. + // A complete, parseable ProtoRows message is constructed by + // concatenating `batch_data` from multiple `ProtoRowsBatch` messages. The + // `PartialResultSet` that contains the last part has `complete_batch` set to + // `true`. + bytes batch_data = 1; +} + +// A partial result set from the streaming query API. +// Cloud Bigtable clients buffer partial results received in this message until +// a `resume_token` is received. +// +// The pseudocode below describes how to buffer and parse a stream of +// `PartialResultSet` messages. +// +// Having: +// - queue of row results waiting to be returned `queue` +// - extensible buffer of bytes `buffer` +// - a place to keep track of the most recent `resume_token` +// for each PartialResultSet `p` received { +// if p.reset { +// ensure `queue` is empty +// ensure `buffer` is empty +// } +// if p.estimated_batch_size != 0 { +// (optional) ensure `buffer` is sized to at least `p.estimated_batch_size` +// } +// if `p.proto_rows_batch` is set { +// append `p.proto_rows_batch.bytes` to `buffer` +// } +// if p.batch_checksum is set and `buffer` is not empty { +// validate the checksum matches the contents of `buffer` +// (see comments on `batch_checksum`) +// parse `buffer` as `ProtoRows` message, clearing `buffer` +// add parsed rows to end of `queue` +// } +// if p.resume_token is set { +// release results in `queue` +// save `p.resume_token` in `resume_token` +// } +// } +message PartialResultSet { + // Some rows of the result set in one of the supported formats. + // + // Multiple `PartialResultSet` messages may be sent to represent a complete + // response. The client should buffer data constructed from the fields in + // `partial_rows` until a non-empty `resume_token` is received. Each + // sub-message documents the appropriate way to combine results. + oneof partial_rows { + // Partial rows in serialized ProtoRows format. + ProtoRowsBatch proto_rows_batch = 3; + } + + // CRC32C checksum of concatenated `partial_rows` data for the current batch. + // + // When present, the buffered data from `partial_rows` forms a complete + // parseable message of the appropriate type. + // + // The client should mark the end of a parseable message and prepare to + // receive a new one starting from the next `PartialResultSet` message. + // Clients must verify the checksum of the serialized batch before yielding it + // to the caller. + // + // This does NOT mean the values can be yielded to the callers since a + // `resume_token` is required to safely do so. + // + // If `resume_token` is non-empty and any data has been received since the + // last one, this field is guaranteed to be non-empty. In other words, clients + // may assume that a batch will never cross a `resume_token` boundary. + optional uint32 batch_checksum = 6; + + // An opaque token sent by the server to allow query resumption and signal + // that the buffered values constructed from received `partial_rows` can be + // yielded to the caller. Clients can provide this token in a subsequent + // request to resume the result stream from the current point. + // + // When `resume_token` is non-empty, the buffered values received from + // `partial_rows` since the last non-empty `resume_token` can be yielded to + // the callers, provided that the client keeps the value of `resume_token` and + // uses it on subsequent retries. + // + // A `resume_token` may be sent without information in `partial_rows` to + // checkpoint the progress of a sparse query. Any previous `partial_rows` data + // should still be yielded in this case, and the new `resume_token` should be + // saved for future retries as normal. + // + // A `resume_token` will only be sent on a boundary where there is either no + // ongoing result batch, or `batch_checksum` is also populated. + // + // The server will also send a sentinel `resume_token` when last batch of + // `partial_rows` is sent. If the client retries the ExecuteQueryRequest with + // the sentinel `resume_token`, the server will emit it again without any + // data in `partial_rows`, then return OK. + bytes resume_token = 5; + + // If `true`, any data buffered since the last non-empty `resume_token` must + // be discarded before the other parts of this message, if any, are handled. + bool reset = 7; + + // Estimated size of the buffer required to hold the next batch of results. + // + // This value will be sent with the first `partial_rows` of a batch. That is, + // on the first `partial_rows` received in a stream, on the first message + // after a `batch_checksum` message, and any time `reset` is true. + // + // The client can use this estimate to allocate a buffer for the next batch of + // results. This helps minimize the number of allocations required, though the + // buffer size may still need to be increased if the estimate is too low. + int32 estimated_batch_size = 4; +} + +// Parameters on mutations where clients want to ensure idempotency (i.e. +// at-most-once semantics). This is currently only needed for certain aggregate +// types. +message Idempotency { + // Unique token used to identify replays of this mutation. + // Must be at least 8 bytes long. + bytes token = 1; + + // Client-assigned timestamp when the mutation's first attempt was sent. + // Used to reject mutations that arrive after idempotency protection may + // have expired. May cause spurious rejections if clock skew is too high. + // + // Leave unset or zero to always accept the mutation, at the risk of + // double counting if the protection for previous attempts has expired. + google.protobuf.Timestamp start_time = 2; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto new file mode 100644 index 000000000000..6cf9ca5b81ac --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto @@ -0,0 +1,79 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "FeatureFlagsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Feature flags supported or enabled by a client. +// This is intended to be sent as part of request metadata to assure the server +// that certain behaviors are safe to enable. This proto is meant to be +// serialized and websafe-base64 encoded under the `bigtable-features` metadata +// key. The value will remain constant for the lifetime of a client and due to +// HTTP2's HPACK compression, the request overhead will be tiny. +// This is an internal implementation detail and should not be used by end users +// directly. +message FeatureFlags { + // Notify the server that the client supports reverse scans. The server will + // reject ReadRowsRequests with the reverse bit set when this is absent. + bool reverse_scans = 1; + + // Notify the server that the client enables batch write flow control by + // requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + // this disables partial retries. + bool mutate_rows_rate_limit = 3; + + // Notify the server that the client enables batch write flow control by + // requesting RateLimitInfo from MutateRowsResponse. With partial retries + // enabled. + bool mutate_rows_rate_limit2 = 5; + + // Notify the server that the client supports the last_scanned_row field + // in ReadRowsResponse for long-running scans. + bool last_scanned_row_responses = 4; + + // Notify the server that the client supports using encoded routing cookie + // strings to retry requests with. + bool routing_cookie = 6; + + // Notify the server that the client supports using retry info back off + // durations to retry requests with. + bool retry_info = 7; + + // Notify the server that the client has client side metrics enabled. + bool client_side_metrics_enabled = 8; + + // Notify the server that the client using Traffic Director endpoint. + bool traffic_director_enabled = 9; + + // Notify the server that the client explicitly opted in for Direct Access. + bool direct_access_requested = 10; + + // If the client can support using BigtablePeerInfo. + bool peer_info = 11; + + // Indicates whether the client supports the Bigtable Sessions API. + bool sessions_compatible = 12; + + // Internal flag to force sessions for internal projects. + bool sessions_required = 13; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto new file mode 100644 index 000000000000..6a89fbf9ed59 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto @@ -0,0 +1,81 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "PeerInfoProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// PeerInfo contains information about the peer that the client is +// connecting to. +message PeerInfo { + // The transport type that the client used to connect to this peer. + enum TransportType { + // The transport type is unknown. + TRANSPORT_TYPE_UNKNOWN = 0; + + // The client connected to this peer via an external network + // (e.g. outside Google Coud). + TRANSPORT_TYPE_EXTERNAL = 1; + + // The client connected to this peer via CloudPath. + TRANSPORT_TYPE_CLOUD_PATH = 2; + + // The client connected to this peer via DirectAccess. + TRANSPORT_TYPE_DIRECT_ACCESS = 3; + + // The client connected to this peer via Bigtable Sessions using an unknown + // transport type. + TRANSPORT_TYPE_SESSION_UNKNOWN = 4; + + // The client connected to this peer via Bigtable Sessions on an external + // network (e.g. outside Google Cloud). + TRANSPORT_TYPE_SESSION_EXTERNAL = 5; + + // The client connected to this peer via Bigtable Sessions using CloudPath. + TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6; + + // The client connected to this peer via Bigtable Sessions using + // DirectAccess. + TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7; + } + + // An opaque identifier for the Google Frontend which serviced this request. + // Only set when not using DirectAccess. + int64 google_frontend_id = 1; + + // An opaque identifier for the application frontend which serviced this + // request. + int64 application_frontend_id = 2; + + // The Cloud region of the application frontend that served this request. + string application_frontend_region = 6; + + // The Cloud zone of the application frontend that served this request. + string application_frontend_zone = 3 [deprecated = true]; + + // The subzone of the application frontend that served this request, e.g. an + // identifier for where within a zone (within the reported region) the + // application frontend is. + string application_frontend_subzone = 4; + + TransportType transport_type = 5; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto new file mode 100644 index 000000000000..bcebc08e65a2 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto @@ -0,0 +1,112 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "RequestStatsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// +// Messages related to RequestStats, part of the Query Stats feature, that can +// help understand the performance of requests. +// +// The layout of requests below is as follows: +// * RequestStats serves as the top-level container for statistics and +// measures related to Bigtable requests. This common object is returned as +// part of methods in the Data API. +// * RequestStats contains multiple *views* of related data, chosen by an +// option in the source Data API method. The view that is returned is +// designed to have all submessages (and their submessages, and so on) +// filled-in, to provide a comprehensive selection of statistics and +// measures related to the requested view. + +// ReadIterationStats captures information about the iteration of rows or cells +// over the course of a read, e.g. how many results were scanned in a read +// operation versus the results returned. +message ReadIterationStats { + // The rows seen (scanned) as part of the request. This includes the count of + // rows returned, as captured below. + int64 rows_seen_count = 1; + + // The rows returned as part of the request. + int64 rows_returned_count = 2; + + // The cells seen (scanned) as part of the request. This includes the count of + // cells returned, as captured below. + int64 cells_seen_count = 3; + + // The cells returned as part of the request. + int64 cells_returned_count = 4; +} + +// RequestLatencyStats provides a measurement of the latency of the request as +// it interacts with different systems over its lifetime, e.g. how long the +// request took to execute within a frontend server. +message RequestLatencyStats { + // The latency measured by the frontend server handling this request, from + // when the request was received, to when this value is sent back in the + // response. For more context on the component that is measuring this latency, + // see: https://cloud.google.com/bigtable/docs/overview + // + // Note: This value may be slightly shorter than the value reported into + // aggregate latency metrics in Monitoring for this request + // (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value + // needs to be sent in the response before the latency measurement including + // that transmission is finalized. + // + // Note: This value includes the end-to-end latency of contacting nodes in + // the targeted cluster, e.g. measuring from when the first byte arrives at + // the frontend server, to when this value is sent back as the last value in + // the response, including any latency incurred by contacting nodes, waiting + // for results from nodes, and finally sending results from nodes back to the + // caller. + google.protobuf.Duration frontend_server_latency = 1; +} + +// FullReadStatsView captures all known information about a read. +message FullReadStatsView { + // Iteration stats describe how efficient the read is, e.g. comparing + // rows seen vs. rows returned or cells seen vs cells returned can provide an + // indication of read efficiency (the higher the ratio of seen to retuned the + // better). + ReadIterationStats read_iteration_stats = 1; + + // Request latency stats describe the time taken to complete a request, from + // the server side. + RequestLatencyStats request_latency_stats = 2; +} + +// RequestStats is the container for additional information pertaining to a +// single request, helpful for evaluating the performance of the sent request. +// Currently, the following method is supported: google.bigtable.v2.ReadRows +message RequestStats { + // Information pertaining to each request type received. The type is chosen + // based on the requested view. + // + // See the messages above for additional context. + oneof stats_view { + // Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL + // view, see package google.bigtable.v2. + FullReadStatsView full_read_stats_view = 1; + } +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto new file mode 100644 index 000000000000..9a48e2008f5b --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto @@ -0,0 +1,38 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "ResponseParamsProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// Response metadata proto +message ResponseParams { + // The cloud bigtable zone associated with the cluster. + optional string zone_id = 1; + + // Identifier for a cluster that represents set of + // bigtable resources. + optional string cluster_id = 2; + + // The AFE ID for the AFE that is served this request. + optional int64 afe_id = 3; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto new file mode 100644 index 000000000000..06faaf9dda71 --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto @@ -0,0 +1,706 @@ +// Copyright 2026 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/v2/data.proto"; +import "google/bigtable/v2/feature_flags.proto"; +import "google/bigtable/v2/request_stats.proto"; +import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/error_details.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +extend google.protobuf.MessageOptions { + // Only OpenSessionRequest.payload's with a type matching rpc_session_type are + // accepted by the server, and only OpenSessionResponse.payload's with a type + // matching rpc_session_type are accepted by the client. + google.bigtable.v2.SessionType open_session_type = 138898474; + + // Only VirtualRpcRequest.payload's with a type matching rpc_session_type are + // accepted by the server, and only VirtualRpcResponse.payload's with a type + // matching rpc_session_type are accepted by the client. + repeated google.bigtable.v2.SessionType vrpc_session_type = 138899157; +} + +extend google.protobuf.MethodOptions { + // All session service methods must set this option to indicate which + // messages are permissible within the generic envelope. + google.bigtable.v2.SessionType rpc_session_type = 137964804; +} + +// Supported session types. +enum SessionType { + SESSION_TYPE_UNSET = 0; + + SESSION_TYPE_TABLE = 1; + + SESSION_TYPE_AUTHORIZED_VIEW = 2; + + SESSION_TYPE_MATERIALIZED_VIEW = 3; + + // For internal protocol testing only. + SESSION_TYPE_TEST = 9999; +} + +// See GetClientConfiguration() RPC in bigtable.proto. Internal usage only. +message GetClientConfigurationRequest { + // Required. The unique name of the instance for which the client will target + // with Data API requests. + // + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. The name of the AppProfile which will be used by the client when + // sending requests in the Data API. + // + // If not specified, the `default` application profile will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how to balance vRPCs over sessions. Internal usage only. +message LoadBalancingOptions { + // Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the + // least number of active vRPCs. + message LeastInFlight { + // Of all connected AFEs, the size of the random subset to run the algorithm + // on. Zero implies all connected AFEs. + int64 random_subset_size = 1; + } + + // Balances vRPCs over backends, by maintaining a moving average of each AFE's + // round-trip time, weighted by the number of outstanding vRPCs, and + // distribute traffic to AFEs where that cost function is smallest. + // + // See: + // https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency + message PeakEwma { + // Of all connected AFEs, the size of the random subset to compare costs + // over. Zero implies all connected AFEs. + int64 random_subset_size = 1; + } + + // Balances vRPCs over backends, by randomly selecting a backend. + message Random {} + + oneof load_balancing_strategy { + LeastInFlight least_in_flight = 1; + + PeakEwma peak_ewma = 2; + + Random random = 4; + } +} + +// Configuration for the Session API. Internal usage only. +message SessionClientConfiguration { + // Configuration for the channel pool. + message ChannelPoolConfiguration { + // A channel mode which allows DirectAccess with a fallback to CloudPath if + // DirectAccess is unavailable. + message DirectAccessWithFallback { + // The threshold for errors on DirectAccess to trigger CloudPath fallback. + // The error rate is calculated based on a count of vRPCs with errors + // divided by a total count of vRPCs, over a rolling window of the past + // check_interval. If this ratio exceeds this threshold, the fallback to + // CloudPath is triggered. [0, 1]. + float error_rate_threshold = 1; + + // The interval to check the error rate over. + google.protobuf.Duration check_interval = 2; + } + + // A channel mode which only allows DirectAccess. + message DirectAccessOnly {} + + // A channel mode which only allows CloudPath. + message CloudPathOnly {} + + // The minimum number of distcint servers to connect to in the channel pool. + // The client will ensure that the channel pool will have at least this many + // distinct servers, but may have multiple channels connected to the same + // server (e.g. the client may have M channels on N machines, where M > N). + int32 min_server_count = 1; + + // The maximum number of distinct servers to connect to in the channel pool. + // The client will ensure that the channel pool will have at most this many + // distinct servers. + int32 max_server_count = 2; + + // Soft maximum for how many sessions are allowed per server. Normally, the + // client will ensure that it does not host more than this count of sessions + // per server, unless there are other limits encountered (e.g. the connected + // servers is already at max_servers). + int32 per_server_session_count = 3; + + // The fallback mode of the channel pool. + oneof mode { + // DirectAccess with a fallback to CloudPath. + DirectAccessWithFallback direct_access_with_fallback = 4; + + // DirectAccess only. + DirectAccessOnly direct_access_only = 5; + + // CloudPath only. + CloudPathOnly cloud_path_only = 6; + } + } + + // Configuration for the session pools. Session pools are tied to a scope + // like a table, an app profile, and a permission. + message SessionPoolConfiguration { + // Fraction of idle sessions to keep in order to manage an increase in + // requests-in-flight. For example, a headroom of 0.5 will keep enough + // sessions to deal with a 50% increase in QPS. + float headroom = 1; + + // The minimum number of sessions for a given scope. + int32 min_session_count = 2; + + // The maximum number of sessions for a given scope. + int32 max_session_count = 3; + + // Number of vRPCs that can be queued per starting session. + int32 new_session_queue_length = 4; + + // How many concurrent session establishments are allowed. The client will + // hold onto a count against this budget whenever it is establishing a new + // session, and release that count once the session is successfully + // established or failed to establish. + int32 new_session_creation_budget = 5; + + // How long to penalize the creation budget for a failed session creation + // attempt. + google.protobuf.Duration new_session_creation_penalty = 6; + + // A threshold for cancelling all pending vRPCs based on how many + // consecutive session establishment errors have been observed. The client + // will eagerly cancel queued vRPCs after this threshold is met to avoid + // them waiting their entire deadlines before terminating (while waiting for + // any session to establish to actually send the vRPC). + int32 consecutive_session_failure_threshold = 8; + + // How to balance vRPC load over connections to AFEs. + // Set only if session_load > 0. + LoadBalancingOptions load_balancing_options = 9; + } + + // What share of requests should operate on a session, [0, 1]. The rest + // should operate on the old-style API. + float session_load = 1; + + LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + + // Configuration for the channel pool. + ChannelPoolConfiguration channel_configuration = 3; + + // Configuration for the session pools. + SessionPoolConfiguration session_pool_configuration = 4; +} + +// Server provided instructions for enabling finer grained observability on +// the client to help diagnose customer issues. Internal usage only. +message TelemetryConfiguration { + // The level of detail of telemetry to be sent from the client. + enum Level { + // Server did not specify a level. Should disable all debug tag counters. + LEVEL_UNSPECIFIED = 0; + + // Enables all debug tag counter levels. + DEBUG = 1; + + // Eables all debug tag counters except for DEBUG. + INFO = 2; + + // Enables all debug tag counters except for DEBUG and INFO. + WARN = 3; + + // Enables only error debug tag counters. + ERROR = 4; + } + + // Selector for the debug counters that should be uploaded. + Level debug_tag_level = 1; +} + +// Configuration for the Session API. Internal usage only. +message ClientConfiguration { + message PollingConfiguration { + // A duration describing the time between GetClientConfiguration RPCs. + // Only strictly positive values are permissible. + google.protobuf.Duration polling_interval = 1; + + // How long the client should consider the configuration it receives from + // GetClientConfiguration valid for. Once this duration has passed, the + // client should consider the configuration invalid and must either: + // - Get a new configuration from GetClientConfiguration + // - Or if it cannot, use a sane default configuration + // + // This duration will be at least as long as the polling interval. + google.protobuf.Duration validity_duration = 2; + + // Number of times the client should retry a failed + // GetClientConfiguration RPC per polling interval before giving up. + int32 max_rpc_retry_count = 6; + } + + // The configuration for Bigtable Sessions. + SessionClientConfiguration session_configuration = 2; + + // How often the client should refresh this configuration. + oneof polling { + // If the client should cease to check for new configurations, e.g. a + // backstop to prevent excessive GetClientConfiguration RPCs. + bool stop_polling = 3; + + // Deprecated, prerfer polling_configuration. + // + // A duration describing the time between GetClientConfiguration RPCs. + // Only strictly positive values are permissible. + google.protobuf.Duration polling_interval = 4 [deprecated = true]; + + // If the client should continue to check for new configurations. + PollingConfiguration polling_configuration = 5; + } + + // Configuration for telemetry. + TelemetryConfiguration telemetry_configuration = 6; +} + +// Internal usage only. +message SessionRequest { + oneof payload { + OpenSessionRequest open_session = 1; + + CloseSessionRequest close_session = 2; + + VirtualRpcRequest virtual_rpc = 3; + } +} + +// Internal usage only. +message SessionResponse { + oneof payload { + OpenSessionResponse open_session = 1; + + // A vRPC can result in either a successful result or an error. + // Error results are separate to allow for multiple vRPC responses, + // e.g. for streaming calls like scans (post-V1). See Flow Control. + VirtualRpcResponse virtual_rpc = 2; + + ErrorResponse error = 3; + + SessionParametersResponse session_parameters = 4; + + HeartbeatResponse heartbeat = 5; + + GoAwayResponse go_away = 6; + + SessionRefreshConfig session_refresh_config = 7; + } +} + +// Internal usage only. +message OpenSessionRequest { + // A version indicator from the client stating its understanding of the + // protocol. This is to disambiguate client behavior amidst changes in + // semantic usage of the API, e.g. if the structure remains the same but + // behavior changes. + int64 protocol_version = 1; + + // Client settings, including a record of + FeatureFlags flags = 2; + + // Used for serverside observability. + int64 consecutive_failed_connection_attempts = 3; + + // How the request should be routed (if presented as part of a GOAWAY + // from a previous session). Post V1. + bytes routing_cookie = 4; + + // Can be Open{Table,AuthorizedView,MaterializedView}Request, + // (or in post-V1, PrepareSqlQueryRequest) + bytes payload = 5; +} + +// Information about the connected backends from a session client's +// perspective. This information may be used to make choices about session +// re-establishment en-masse for sessions with the same backend identifiers. +// Internal usage only. +message BackendIdentifier { + // An opaque identifier for the Google Frontend which serviced this request. + // Only set when not using DirectAccess. + int64 google_frontend_id = 1; + + // An opaque identifier for the application frontend which serviced this + // request. + int64 application_frontend_id = 2; + + // The zone of the application frontend that served this request. + string application_frontend_zone = 3; +} + +// Internal usage only. +message OpenSessionResponse { + // Information on the backend(s) that are hosting this session. + BackendIdentifier backend = 2; + + // Can be Open{Table,AuthorizedView,MaterializedView}Response, + // (or in post-V1, PrepareSqlQueryResponse) + bytes payload = 1; +} + +// Internal usage only. +message CloseSessionRequest { + // Client-generated reason for terminating the session, including a + // plain-text description of why. + // 'reason' may be used for metrics, while both may be logged (server-side). + enum CloseSessionReason { + CLOSE_SESSION_REASON_UNSET = 0; + + CLOSE_SESSION_REASON_GOAWAY = 1; + + CLOSE_SESSION_REASON_ERROR = 2; + + CLOSE_SESSION_REASON_USER = 3; + + CLOSE_SESSION_REASON_DOWNSIZE = 4; + + CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; + } + + CloseSessionReason reason = 1; + + string description = 2; +} + +// Internal usage only. +message OpenTableRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TABLE; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + + PERMISSION_WRITE = 2; + + PERMISSION_READ_WRITE = 3; + } + + string table_name = 1; + + string app_profile_id = 2; + + Permission permission = 3; +} + +// Internal usage only. +message OpenTableResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TABLE; +} + +// Open sessions for an AuthorizedView. Internal usage only. +message OpenAuthorizedViewRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + + PERMISSION_WRITE = 2; + + PERMISSION_READ_WRITE = 3; + } + + // The Authorized view name to read and write from. Values are of the form + // `projects//instances//tables/
/authorizedViews/`. + string authorized_view_name = 1; + + // The app profile id to use for the authorized view sessions. + string app_profile_id = 2; + + // Permission for the session. + Permission permission = 3; +} + +// Internal usage only. +message OpenAuthorizedViewResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; +} + +// Open sessions for a MaterializedView. Internal usage only. +message OpenMaterializedViewRequest { + option (google.bigtable.v2.open_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + } + + // The Materialized view name to read and write from. Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 1; + + // The app profile id to use for the materialized view sessions. + string app_profile_id = 2; + + // Permission for the session. + Permission permission = 3; +} + +// Internal usage only. +message OpenMaterializedViewResponse { + option (google.bigtable.v2.open_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; +} + +// Internal usage only. +message VirtualRpcRequest { + // Container for all vRPC Metadata. + message Metadata { + // Track retry attempts for this vRPC at the AFE. + int64 attempt_number = 1; + + // Track the client's known start time for the attempt. This is likely not + // easily compared with the server's time due to clock skew. + google.protobuf.Timestamp attempt_start = 2; + + // Link OpenTelemetry traces (e.g. Tapper). This can be used to link + // attempts together for the same logical operation (e.g. in logs / traces). + // + // Note, this may not be needed for V1, TBD. + string traceparent = 3; + } + + // Client chosen, monotonically increasing identifier for the request. + // Must be unique within a session. + int64 rpc_id = 1; + + // Attempt deadline. + // + // Note, this may not be needed for V1, TBD (e.g. operation vs attempt + // deadline). + google.protobuf.Duration deadline = 2; + + // vRPC metadata. + Metadata metadata = 3; + + // Could be TableRequest (or in post-V1, SqlRequest) + bytes payload = 4; +} + +// Information on which Cluster served a vRPC, e.g. for Client-Side metrics. +// Internal usage only. +message ClusterInformation { + string cluster_id = 1; + + string zone_id = 2; +} + +// Internal usage only. +message SessionRequestStats { + // Backend (critical section) latency for the request. + google.protobuf.Duration backend_latency = 1; +} + +// Internal usage only. +message VirtualRpcResponse { + // Which vRPC this response is for. + int64 rpc_id = 1; + + ClusterInformation cluster_info = 2; + + SessionRequestStats stats = 4; + + // Could be TableResponse (or in post-V1, SqlResponse) + bytes payload = 3; +} + +// Internal usage only. +message ErrorResponse { + // Which vRPC this response is for. + int64 rpc_id = 1; + + ClusterInformation cluster_info = 2; + + // The error from the vRPC and any retry information to consider. + google.rpc.Status status = 3; + + google.rpc.RetryInfo retry_info = 4; +} + +// Internal usage only. +message TableRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TABLE; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + + SessionMutateRowRequest mutate_row = 2; + } +} + +// Internal usage only. +message TableResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TABLE; + + oneof payload { + SessionReadRowResponse read_row = 1; + + SessionMutateRowResponse mutate_row = 2; + } +} + +// A request wrapper for operations on an authorized view. Internal usage only. +message AuthorizedViewRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + + SessionMutateRowRequest mutate_row = 2; + } +} + +// A response wrapper for operations on an authorized view. Internal usage only. +message AuthorizedViewResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowResponse read_row = 1; + + SessionMutateRowResponse mutate_row = 2; + } +} + +// A request wrapper for operations on a materialized view. Internal usage only. +message MaterializedViewRequest { + option (google.bigtable.v2.vrpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + } +} + +// A response wrapper for operations on a materialized view. Internal usage +// only. +message MaterializedViewResponse { + option (google.bigtable.v2.vrpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowResponse read_row = 1; + } +} + +// Internal usage only. +message SessionReadRowRequest { + bytes key = 1; + + RowFilter filter = 2; +} + +// Internal usage only. +message SessionReadRowResponse { + Row row = 1; + + RequestStats stats = 2; +} + +// Internal usage only. +message SessionMutateRowRequest { + bytes key = 1; + + repeated Mutation mutations = 2; +} + +// Internal usage only. +message SessionMutateRowResponse {} + +// Internal usage only. +message SessionParametersResponse { + // Maximum time between messages that the AFE will send to the client. The + // client may use this information to determine its control-flow in relation + // to pruning black-holed or otherwise non-responsive sessions. Must be set + // and positive. + // + // See also Heartbeats. + google.protobuf.Duration keep_alive = 1; +} + +// Internal usage only. +message HeartbeatResponse {} + +// Internal usage only. +message GoAwayResponse { + // Server-generated reason for GOAWAY, including a plain-text description of + // why. 'reason' may be used for CSM, while both may be logged. + string reason = 1; + + string description = 2; + + // The last vRPC which was admitted by the AFE. The client may expect the + // result from the vRPC on the stream before disconnecting, and should + // retry vRPCs beyond this boundary. + int64 last_rpc_id_admitted = 3; +} + +// Internal usage only. +message SessionRefreshConfig { + // Any additional metadata to include when reconnecting. Not a `map<>` type as + // this can be a multimap. + message Metadata { + // Output only. The key for the metadata entry. + string key = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value for the metadata entry. + bytes value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An optimized Open request that the session may use on a retry when + // establishing this session again. This can be sent from the AFE to + // avoid certain work e.g. encoding a query plan for BTQL. + OpenSessionRequest optimized_open_request = 1; + + // Output only. Any additional metadata to include when reconnecting. + repeated Metadata metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto new file mode 100644 index 000000000000..607cf2bea9de --- /dev/null +++ b/java-bigtable/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto @@ -0,0 +1,465 @@ +// Copyright 2025 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. + +syntax = "proto3"; + +package google.bigtable.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +// `Type` represents the type of data that is written to, read from, or stored +// in Bigtable. It is heavily based on the GoogleSQL standard to help maintain +// familiarity and consistency across products and features. +// +// For compatibility with Bigtable's existing untyped APIs, each `Type` includes +// an `Encoding` which describes how to convert to or from the underlying data. +// +// Each encoding can operate in one of two modes: +// +// - Sorted: In this mode, Bigtable guarantees that `Encode(X) <= Encode(Y)` +// if and only if `X <= Y`. This is useful anywhere sort order is important, +// for example when encoding keys. +// - Distinct: In this mode, Bigtable guarantees that if `X != Y` then +// `Encode(X) != Encode(Y)`. However, the converse is not guaranteed. For +// example, both `{'foo': '1', 'bar': '2'}` and `{'bar': '2', 'foo': '1'}` +// are valid encodings of the same JSON value. +// +// The API clearly documents which mode is used wherever an encoding can be +// configured. Each encoding also documents which values are supported in which +// modes. For example, when encoding INT64 as a numeric STRING, negative numbers +// cannot be encoded in sorted mode. This is because `INT64(1) > INT64(-1)`, but +// `STRING("-00001") > STRING("00001")`. +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to or from lower level types. + message Encoding { + // Leaves the value as-is. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message Raw { + // If set, allows NULL values to be encoded as the empty string "". + // + // The actual empty string, or any value which only contains the + // null byte `0x00`, has one more null byte appended. + bool escape_nulls = 1; + } + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // String + // Values of type `String` are stored in `Value.string_value`. + message String { + // Rules used to convert to or from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding. + // + // Sorted mode: + // - All values are supported. + // - Code point order is preserved. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `TEXT` encoding + // - HBase `Bytes.toBytes` + // - Java `String#getBytes(StandardCharsets.UTF_8)` + message Utf8Bytes { + // Single-character escape sequence used to support NULL values. + // + // If set, allows NULL values to be encoded as the empty string "". + // + // The actual empty string, or any value where every character equals + // `null_escape_char`, has one more `null_escape_char` appended. + // + // If `null_escape_char` is set and does not equal the ASCII null + // character `0x00`, then the encoding will not support sorted mode. + // + // . + string null_escape_char = 1; + } + + // Which encoding to use. + oneof encoding { + // Deprecated: if set, converts to an empty `utf8_bytes`. + Utf8Raw utf8_raw = 1 [deprecated = true]; + + // Use `Utf8Bytes` encoding. + Utf8Bytes utf8_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Int64 + // Values of type `Int64` are stored in `Value.int_value`. + message Int64 { + // Rules used to convert to or from lower level types. + message Encoding { + // Encodes the value as an 8-byte big-endian two's complement value. + // + // Sorted mode: non-negative values are supported. + // + // Distinct mode: all values are supported. + // + // Compatible with: + // + // - BigQuery `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1 [deprecated = true]; + } + + // Encodes the value in a variable length binary format of up to 10 bytes. + // Values that are closer to zero use fewer bytes. + // + // Sorted mode: all values are supported. + // + // Distinct mode: all values are supported. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + + // Use `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 2; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // bool + // Values of type `Bool` are stored in `Value.bool_value`. + message Bool {} + + // Float32 + // Values of type `Float32` are stored in `Value.float_value`. + message Float32 {} + + // Float64 + // Values of type `Float64` are stored in `Value.float_value`. + message Float64 {} + + // Timestamp + // Values of type `Timestamp` are stored in `Value.timestamp_value`. + message Timestamp { + // Rules used to convert to or from lower level types. + message Encoding { + // Which encoding to use. + oneof encoding { + // Encodes the number of microseconds since the Unix epoch using the + // given `Int64` encoding. Values must be microsecond-aligned. + // + // Compatible with: + // + // - Java `Instant.truncatedTo()` with `ChronoUnit.MICROS` + Int64.Encoding unix_micros_int64 = 1; + } + } + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 1; + } + + // Date + // Values of type `Date` are stored in `Value.date_value`. + message Date {} + + // A structured data value, consisting of fields which map to dynamically + // typed values. + // Values of type `Struct` are stored in `Value.array_value` where entries are + // in the same order and number as `field_types`. + message Struct { + // A struct field and its type. + message Field { + // The field name (optional). Fields without a `field_name` are considered + // anonymous and cannot be referenced by name. + string field_name = 1; + + // The type of values in this field. + Type type = 2; + } + + // Rules used to convert to or from lower level types. + message Encoding { + // Uses the encoding of `fields[0].type` as-is. + // Only valid if `fields.size == 1`. + message Singleton {} + + // Fields are encoded independently and concatenated with a configurable + // `delimiter` in between. + // + // A struct with no fields defined is encoded as a single `delimiter`. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - Encoded field values must not contain any bytes <= `delimiter[0]` + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - Encoded field values must not contain `delimiter[0]`. + message DelimitedBytes { + // Byte sequence used to delimit concatenated fields. The delimiter must + // contain at least 1 character and at most 50 characters. + bytes delimiter = 1; + } + + // Fields are encoded independently and concatenated with the fixed byte + // pair `{0x00, 0x01}` in between. + // + // Any null `(0x00)` byte in an encoded field is replaced by the fixed + // byte pair `{0x00, 0xFF}`. + // + // Fields that encode to the empty string "" have special handling: + // + // - If *every* field encodes to "", or if the STRUCT has no fields + // defined, then the STRUCT is encoded as the fixed byte pair + // `{0x00, 0x00}`. + // - Otherwise, the STRUCT only encodes until the last non-empty field, + // omitting any trailing empty fields. Any empty fields that aren't + // omitted are replaced with the fixed byte pair `{0x00, 0x00}`. + // + // Examples: + // + // ``` + // - STRUCT() -> "\00\00" + // - STRUCT("") -> "\00\00" + // - STRUCT("", "") -> "\00\00" + // - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "") -> "A" + // - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" + // - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C" + // ``` + // + // + // Since null bytes are always escaped, this encoding can cause size + // blowup for encodings like `Int64.BigEndianBytes` that are likely to + // produce many such bytes. + // + // Sorted mode: + // + // - Fields are encoded in sorted mode. + // - All values supported by the field encodings are allowed + // - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if + // `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first. + // + // Distinct mode: + // + // - Fields are encoded in distinct mode. + // - All values supported by the field encodings are allowed. + message OrderedCodeBytes {} + + // Which encoding to use. + oneof encoding { + // Use `Singleton` encoding. + Singleton singleton = 1; + + // Use `DelimitedBytes` encoding. + DelimitedBytes delimited_bytes = 2; + + // User `OrderedCodeBytes` encoding. + OrderedCodeBytes ordered_code_bytes = 3; + } + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + + // The encoding to use when converting to or from lower level types. + Encoding encoding = 2; + } + + // A protobuf message type. + // Values of type `Proto` are stored in `Value.bytes_value`. + message Proto { + // The ID of the schema bundle that this proto is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf message, including package. In + // the format of "foo.bar.Message". + string message_name = 2; + } + + // A protobuf enum type. + // Values of type `Enum` are stored in `Value.int_value`. + message Enum { + // The ID of the schema bundle that this enum is defined in. + string schema_bundle_id = 1; + + // The fully qualified name of the protobuf enum message, including package. + // In the format of "foo.bar.EnumMessage". + string enum_name = 2; + } + + // An ordered list of elements of a given type. + // Values of type `Array` are stored in `Value.array_value`. + message Array { + // The type of the elements in the array. This must not be `Array`. + Type element_type = 1; + } + + // A mapping of keys to values of a given type. + // Values of type `Map` are stored in a `Value.array_value` where each entry + // is another `Value.array_value` with two elements (the key and the value, + // in that order). + // Normally encoded Map values won't have repeated keys, however, clients are + // expected to handle the case in which they do. If the same key appears + // multiple times, the _last_ value takes precedence. + message Map { + // The type of a map key. + // Only `Bytes`, `String`, and `Int64` are allowed as key types. + Type key_type = 1; + + // The type of the values in a map. + Type value_type = 2; + } + + // A value that combines incremental updates into a summarized value. + // + // Data is never directly written or read using type `Aggregate`. Writes + // provide either the `input_type` or `state_type`, and reads always return + // the `state_type` . + message Aggregate { + // Computes the sum of the input values. + // Allowed input: `Int64` + // State: same as input + message Sum {} + + // Computes the max of the input values. + // Allowed input: `Int64` + // State: same as input + message Max {} + + // Computes the min of the input values. + // Allowed input: `Int64` + // State: same as input + message Min {} + + // Computes an approximate unique count over the input values. When using + // raw data as input, be careful to use a consistent encoding. Otherwise + // the same value encoded differently could count more than once, or two + // distinct values could count as identical. + // Input: Any, or omit for Raw + // State: TBD + // Special state conversions: `Int64` (the unique count estimate) + message HyperLogLogPlusPlusUniqueCount {} + + // Type of the inputs that are accumulated by this `Aggregate`. + // Use `AddInput` mutations to accumulate new inputs. + Type input_type = 1; + + // Output only. Type that holds the internal accumulator state for the + // `Aggregate`. This is a function of the `input_type` and `aggregator` + // chosen. + Type state_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Which aggregator function to use. The configured types must match. + oneof aggregator { + // Sum aggregator. + Sum sum = 4; + + // HyperLogLogPlusPlusUniqueCount aggregator. + HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5; + + // Max aggregator. + Max max = 6; + + // Min aggregator. + Min min = 7; + } + } + + // The kind of type that this represents. + oneof kind { + // Bytes + Bytes bytes_type = 1; + + // String + String string_type = 2; + + // Int64 + Int64 int64_type = 5; + + // Float32 + Float32 float32_type = 12; + + // Float64 + Float64 float64_type = 9; + + // Bool + Bool bool_type = 8; + + // Timestamp + Timestamp timestamp_type = 10; + + // Date + Date date_type = 11; + + // Aggregate + Aggregate aggregate_type = 6; + + // Struct + Struct struct_type = 7; + + // Array + Array array_type = 3; + + // Map + Map map_type = 4; + + // Proto + Proto proto_type = 13; + + // Enum + Enum enum_type = 14; + } +} diff --git a/java-bigtable/samples/install-without-bom/pom.xml b/java-bigtable/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..3abc0a6617b5 --- /dev/null +++ b/java-bigtable/samples/install-without-bom/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigtable-install-without-bom + jar + Google Cloud Bigtable Install Without Bom + https://github.com/googleapis/java-bigtable + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-bigtable + 2.67.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + + ../snippets/src/main/resources + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-bigtable/samples/pom.xml b/java-bigtable/samples/pom.xml new file mode 100644 index 000000000000..624ab90266a2 --- /dev/null +++ b/java-bigtable/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-google-cloud-bigtable-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Bigtable Samples Parent + https://github.com/googleapis/java-bigtable + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + + true + + + + + diff --git a/java-bigtable/samples/snapshot/pom.xml b/java-bigtable/samples/snapshot/pom.xml new file mode 100644 index 000000000000..b5225fae45d7 --- /dev/null +++ b/java-bigtable/samples/snapshot/pom.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigtable-snapshot + jar + Google Cloud Bigtable Snapshot Samples + https://github.com/googleapis/java-bigtable + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-bigtable + 2.77.2-SNAPSHOT + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + + ../snippets/src/main/resources + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/java-bigtable/samples/snippets/pom.xml b/java-bigtable/samples/snippets/pom.xml new file mode 100644 index 000000000000..41b35ec41d55 --- /dev/null +++ b/java-bigtable/samples/snippets/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigtable-snippets + jar + Google Cloud Bigtable Snippets + https://github.com/googleapis/java-bigtable + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + libraries-bom + 26.69.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + **/SingerProto.java + + + + + diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java new file mode 100644 index 000000000000..8f3047442bd6 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java @@ -0,0 +1,322 @@ +/* + * Copyright 2024 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.PermissionDeniedException; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.FamilySubsets; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +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.protobuf.ByteString; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class AuthorizedViewExample { + + private static final String COLUMN_FAMILY = "cf"; + private static final String COLUMN_QUALIFIER_GREETING = "greeting"; + private static final String COLUMN_QUALIFIER_NAME = "name"; + private static final String ROW_KEY_PREFIX = "rowKey"; + private final String tableId; + private final String authorizedViewId; + private final BigtableTableAdminClient adminClient; + private final BigtableDataClient dataClient; + + public static void main(String[] args) throws IOException { + + if (args.length != 2) { + System.out.println("Missing required project id or instance id"); + return; + } + String projectId = args[0]; + String instanceId = args[1]; + + AuthorizedViewExample authorizedViewExample = + new AuthorizedViewExample(projectId, instanceId, "test-table", "test-authorized-view"); + authorizedViewExample.run(); + } + + public AuthorizedViewExample( + String projectId, String instanceId, String tableId, String authorizedViewId) + throws IOException { + this.tableId = tableId; + this.authorizedViewId = authorizedViewId; + + // Creates the settings to configure a bigtable data client. + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + + // Creates a bigtable data client. + dataClient = BigtableDataClient.create(settings); + + // Creates the settings to configure a bigtable table admin client. + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + + // Creates a bigtable table admin client. + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + public void close() { + dataClient.close(); + adminClient.close(); + } + + public void run() { + createTable(); + createAuthorizedView(); + updateAuthorizedView(); + getAuthorizedView(); + listAllAuthorizedViews(); + writeToAuthorizedView(); + readSingleRowFromAuthorizedView(); + readRowsWithFilterFromAuthorizedView(); + deleteAuthorizedView(); + deleteTable(); + close(); + } + + public void createTable() { + // Checks if table exists, creates table if it does not exist. + if (!adminClient.exists(tableId)) { + System.out.println("Table does not exist, creating table: " + tableId); + CreateTableRequest createTableRequest = + CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY); + Table table = adminClient.createTable(createTableRequest); + System.out.printf("Table: %s created successfully%n", table.getId()); + } + } + + public void deleteTable() { + // Deletes the entire table. + System.out.println("\nDelete table: " + tableId); + try { + adminClient.deleteTable(tableId); + System.out.printf("Table: %s deleted successfully%n", tableId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent table: " + e.getMessage()); + } + } + + /** + * Demonstrates how to create an authorized view under a table with the specified configuration. + */ + public void createAuthorizedView() { + // Checks if the authorized view exists, creates it if it does not exist. + try { + adminClient.getAuthorizedView(tableId, authorizedViewId); + } catch (NotFoundException exception) { + System.out.printf("%nCreating authorized view %s in table %s%n", authorizedViewId, tableId); + // [START bigtable_create_authorized_view] + try { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(tableId, authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("") + .setFamilySubsets( + COLUMN_FAMILY, + FamilySubsets.create().addQualifierPrefix(COLUMN_QUALIFIER_NAME))); + AuthorizedView authorizedView = adminClient.createAuthorizedView(request); + System.out.printf("AuthorizedView: %s created successfully%n", authorizedView.getId()); + } catch (NotFoundException e) { + System.err.println( + "Failed to create an authorized view from a non-existent table: " + e.getMessage()); + } + // [END bigtable_create_authorized_view] + } + } + + /** Demonstrates how to modify an authorized view. */ + public void updateAuthorizedView() { + System.out.printf("%nUpdating authorized view %s in table %s%n", authorizedViewId, tableId); + // [START bigtable_update_authorized_view] + try { + // Update to an authorized view permitting everything. + UpdateAuthorizedViewRequest request = + UpdateAuthorizedViewRequest.of(tableId, authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("") + .setFamilySubsets( + COLUMN_FAMILY, FamilySubsets.create().addQualifierPrefix(""))); + AuthorizedView authorizedView = adminClient.updateAuthorizedView(request); + System.out.printf("AuthorizedView: %s updated successfully%n", authorizedView.getId()); + } catch (NotFoundException e) { + System.err.println("Failed to modify a non-existent authorized view: " + e.getMessage()); + } + // [END bigtable_update_authorized_view] + } + + /** Demonstrates how to get an authorized view's metadata. */ + public AuthorizedView getAuthorizedView() { + System.out.printf("%nGetting authorized view %s in table %s%n", authorizedViewId, tableId); + // [START bigtable_get_authorized_view] + AuthorizedView authorizedView = null; + try { + authorizedView = adminClient.getAuthorizedView(tableId, authorizedViewId); + SubsetView subsetView = (SubsetView) authorizedView.getAuthorizedViewType(); + + for (ByteString rowPrefix : subsetView.getRowPrefixes()) { + System.out.printf("Row Prefix: %s%n", rowPrefix.toStringUtf8()); + } + for (Map.Entry entry : subsetView.getFamilySubsets().entrySet()) { + for (ByteString qualifierPrefix : entry.getValue().getQualifierPrefixes()) { + System.out.printf( + "Column Family: %s, Qualifier Prefix: %s%n", + entry.getKey(), qualifierPrefix.toStringUtf8()); + } + for (ByteString qualifier : entry.getValue().getQualifiers()) { + System.out.printf( + "Column Family: %s, Qualifier: %s%n", entry.getKey(), qualifier.toStringUtf8()); + } + } + } catch (NotFoundException e) { + System.err.println( + "Failed to retrieve metadata from a non-existent authorized view: " + e.getMessage()); + } + // [END bigtable_get_authorized_view] + return authorizedView; + } + + /** Demonstrates how to list all authorized views within a table. */ + public List listAllAuthorizedViews() { + System.out.printf("%nListing authorized views in table %s%n", tableId); + // [START bigtable_list_authorized_views] + List authorizedViewIds = new ArrayList<>(); + try { + authorizedViewIds = adminClient.listAuthorizedViews(tableId); + for (String authorizedViewId : authorizedViewIds) { + System.out.println(authorizedViewId); + } + } catch (NotFoundException e) { + System.err.println( + "Failed to list authorized views from a non-existent table: " + e.getMessage()); + } + // [END bigtable_list_authorized_views] + return authorizedViewIds; + } + + /** Demonstrates how to delete an authorized view. */ + public void deleteAuthorizedView() { + System.out.printf("%nDeleting authorized view %s in table %s%n", authorizedViewId, tableId); + // [START bigtable_delete_authorized_view] + try { + adminClient.deleteAuthorizedView(tableId, authorizedViewId); + System.out.printf("AuthorizedView: %s deleted successfully%n", authorizedViewId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent authorized view: " + e.getMessage()); + } + // [END bigtable_delete_authorized_view] + } + + /** Demonstrates how to write some rows to an authorized view. */ + public void writeToAuthorizedView() { + // [START bigtable_authorized_view_write_rows] + try { + System.out.println("\nWriting to authorized view"); + String[] names = {"World", "Bigtable", "Java"}; + for (int i = 0; i < names.length; i++) { + String greeting = "Hello " + names[i] + "!"; + RowMutation rowMutation = + RowMutation.create(AuthorizedViewId.of(tableId, authorizedViewId), ROW_KEY_PREFIX + i) + .setCell(COLUMN_FAMILY, COLUMN_QUALIFIER_NAME, names[i]) + .setCell(COLUMN_FAMILY, COLUMN_QUALIFIER_GREETING, greeting); + dataClient.mutateRow(rowMutation); + System.out.println(greeting); + } + } catch (Exception e) { + if (e instanceof NotFoundException) { + System.err.println("Failed to write to non-existent authorized view: " + e.getMessage()); + } else if (e instanceof PermissionDeniedException) { + System.err.println( + "Failed to apply mutations outside of the authorized view: " + e.getMessage()); + } + } + // [END bigtable_authorized_view_write_rows] + } + + /** Demonstrates how to read a single row from an authorized view. */ + public Row readSingleRowFromAuthorizedView() { + // [START bigtable_authorized_view_get_by_key] + try { + System.out.println("\nReading a single row by row key from an authorized view"); + Row row = + dataClient.readRow(AuthorizedViewId.of(tableId, authorizedViewId), ROW_KEY_PREFIX + 0); + System.out.println("Row: " + row.getKey().toStringUtf8()); + for (RowCell cell : row.getCells()) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + return row; + } catch (NotFoundException e) { + System.err.println("Failed to read from a non-existent authorized view: " + e.getMessage()); + return null; + } + // [END bigtable_authorized_view_get_by_key] + } + + /** Demonstrates how to read rows from an authorized view with a filter. */ + public List readRowsWithFilterFromAuthorizedView() { + // [START bigtable_authorized_view_scan_with_filter] + try { + // A filter that matches only the most recent cell within each column + Filter filter = FILTERS.limit().cellsPerColumn(1); + System.out.println("\nScanning authorized view with filter"); + Query query = Query.create(AuthorizedViewId.of(tableId, authorizedViewId)).filter(filter); + ServerStream rowStream = dataClient.readRows(query); + List authorizedViewRows = new ArrayList<>(); + for (Row r : rowStream) { + System.out.println("Row Key: " + r.getKey().toStringUtf8()); + authorizedViewRows.add(r); + for (RowCell cell : r.getCells()) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + } + return authorizedViewRows; + } catch (NotFoundException e) { + System.err.println("Failed to read a non-existent authorized view: " + e.getMessage()); + return null; + } + // [END bigtable_authorized_view_scan_with_filter] + } +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java new file mode 100644 index 000000000000..f0c49875c425 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java @@ -0,0 +1,58 @@ +/* + * 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 + * + * 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. + */ + +package com.example.bigtable; + +// [START bigtable_configure_connection_pool] + +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import java.io.IOException; + +public class ConfigureConnectionPool { + + public static void configureConnectionPool(String projectId, String instanceId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + + BigtableDataSettings.Builder settingsBuilder = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId); + + settingsBuilder + .stubSettings() + .setTransportChannelProvider( + EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() + .setPoolSize(10) + .build()); + + BigtableDataSettings settings = settingsBuilder.build(); + try (BigtableDataClient dataClient = BigtableDataClient.create(settings)) { + InstantiatingGrpcChannelProvider provider = + (InstantiatingGrpcChannelProvider) + settings.getStubSettings().getTransportChannelProvider(); + + int poolSize = provider.toBuilder().getPoolSize(); + + System.out.println(String.format("Connected with pool size of %d", poolSize)); + } catch (IOException e) { + System.out.println("Error during ConfigureConnectionPool: \n" + e.toString()); + } + } +} + +// [END bigtable_configure_connection_pool] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Filters.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Filters.java new file mode 100644 index 000000000000..c8387c17a0ed --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Filters.java @@ -0,0 +1,417 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_filters_print] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +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.TableId; +import java.io.IOException; +import java.time.Instant; +import java.time.temporal.ChronoUnit; + +public class Filters { + + // Write your code here. + // [START_EXCLUDE] + // [START bigtable_filters_limit_row_sample] + public static void filterLimitRowSample() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitRowSample(projectId, instanceId, tableId); + } + + public static void filterLimitRowSample(String projectId, String instanceId, String tableId) { + // A filter that matches cells from a row with probability .75 + Filter filter = FILTERS.key().sample(.75); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_row_sample] + + // [START bigtable_filters_limit_row_regex] + public static void filterLimitRowRegex() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitRowRegex(projectId, instanceId, tableId); + } + + public static void filterLimitRowRegex(String projectId, String instanceId, String tableId) { + // A filter that matches cells from rows whose keys satisfy the given regex + Filter filter = FILTERS.key().regex(".*#20190501$"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_row_regex] + + // [START bigtable_filters_limit_cells_per_col] + public static void filterLimitCellsPerCol() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitCellsPerCol(projectId, instanceId, tableId); + } + + public static void filterLimitCellsPerCol(String projectId, String instanceId, String tableId) { + // A filter that matches only the most recent 2 cells within each column + Filter filter = FILTERS.limit().cellsPerColumn(2); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_cells_per_col] + + // [START bigtable_filters_limit_cells_per_row] + public static void filterLimitCellsPerRow() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitCellsPerRow(projectId, instanceId, tableId); + } + + public static void filterLimitCellsPerRow(String projectId, String instanceId, String tableId) { + // A filter that matches the first 2 cells of each row + Filter filter = FILTERS.limit().cellsPerRow(2); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_cells_per_row] + + // [START bigtable_filters_limit_cells_per_row_offset] + public static void filterLimitCellsPerRowOffset() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitCellsPerRowOffset(projectId, instanceId, tableId); + } + + public static void filterLimitCellsPerRowOffset( + String projectId, String instanceId, String tableId) { + // A filter that skips the first 2 cells per row + Filter filter = FILTERS.offset().cellsPerRow(2); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_cells_per_row_offset] + + // [START bigtable_filters_limit_col_family_regex] + public static void filterLimitColFamilyRegex() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitColFamilyRegex(projectId, instanceId, tableId); + } + + public static void filterLimitColFamilyRegex( + String projectId, String instanceId, String tableId) { + // A filter that matches cells whose column family satisfies the given regex + Filter filter = FILTERS.family().regex("stats_.*$"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_col_family_regex] + + // [START bigtable_filters_limit_col_qualifier_regex] + public static void filterLimitColQualifierRegex() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitColQualifierRegex(projectId, instanceId, tableId); + } + + public static void filterLimitColQualifierRegex( + String projectId, String instanceId, String tableId) { + // A filter that matches cells whose column qualifier satisfies the given regex + Filter filter = FILTERS.qualifier().regex("connected_.*$"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_col_qualifier_regex] + + // [START bigtable_filters_limit_col_range] + public static void filterLimitColRange() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitColRange(projectId, instanceId, tableId); + } + + public static void filterLimitColRange(String projectId, String instanceId, String tableId) { + // A filter that matches cells whose column qualifiers are between data_plan_01gb and + // data_plan_10gb in the column family cell_plan + Filter filter = + FILTERS + .qualifier() + .rangeWithinFamily("cell_plan") + .startClosed("data_plan_01gb") + .endOpen("data_plan_10gb"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_col_range] + + // [START bigtable_filters_limit_value_range] + public static void filterLimitValueRange() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitValueRange(projectId, instanceId, tableId); + } + + public static void filterLimitValueRange(String projectId, String instanceId, String tableId) { + // A filter that matches cells whose values are between the given values + Filter filter = FILTERS.value().range().startClosed("PQ2A.190405").endClosed("PQ2A.190406"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_value_range] + + // [START bigtable_filters_limit_value_regex] + public static void filterLimitValueRegex() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitValueRegex(projectId, instanceId, tableId); + } + + public static void filterLimitValueRegex(String projectId, String instanceId, String tableId) { + // A filter that matches cells whose value satisfies the given regex + Filter filter = FILTERS.value().regex("PQ2A.*$"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_value_regex] + + // [START bigtable_filters_limit_timestamp_range] + public static void filterLimitTimestampRange() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitTimestampRange(projectId, instanceId, tableId); + } + + public static void filterLimitTimestampRange( + String projectId, String instanceId, String tableId) { + // Get a time representing one hour ago + long timestamp = Instant.now().minus(1, ChronoUnit.HOURS).toEpochMilli() * 1000; + + // A filter that matches cells whose timestamp is from an hour ago or earlier + Filter filter = FILTERS.timestamp().range().startClosed(0L).endOpen(timestamp); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_timestamp_range] + + // [START bigtable_filters_limit_block_all] + public static void filterLimitBlockAll() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitBlockAll(projectId, instanceId, tableId); + } + + public static void filterLimitBlockAll(String projectId, String instanceId, String tableId) { + // A filter that does not match any cells + Filter filter = FILTERS.block(); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_block_all] + + // [START bigtable_filters_limit_pass_all] + public static void filterLimitPassAll() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterLimitPassAll(projectId, instanceId, tableId); + } + + public static void filterLimitPassAll(String projectId, String instanceId, String tableId) { + // A filter that matches all cells + Filter filter = FILTERS.pass(); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_limit_pass_all] + + // [START bigtable_filters_modify_strip_value] + public static void filterModifyStripValue() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterModifyStripValue(projectId, instanceId, tableId); + } + + public static void filterModifyStripValue(String projectId, String instanceId, String tableId) { + // A filter that replaces the outputted cell value with the empty string + Filter filter = FILTERS.value().strip(); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_modify_strip_value] + + // [START bigtable_filters_modify_apply_label] + public static void filterModifyApplyLabel() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterModifyApplyLabel(projectId, instanceId, tableId); + } + + public static void filterModifyApplyLabel(String projectId, String instanceId, String tableId) { + // A filter that applies the given label to the outputted cell + Filter filter = FILTERS.label("labelled"); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_modify_apply_label] + + // [START bigtable_filters_composing_chain] + public static void filterComposingChain() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterComposingChain(projectId, instanceId, tableId); + } + + public static void filterComposingChain(String projectId, String instanceId, String tableId) { + // A filter that selects one cell per column AND within the column family cell_plan + Filter filter = + FILTERS + .chain() + .filter(FILTERS.limit().cellsPerColumn(1)) + .filter(FILTERS.family().exactMatch("cell_plan")); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_composing_chain] + + // [START bigtable_filters_composing_interleave] + public static void filterComposingInterleave() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterComposingInterleave(projectId, instanceId, tableId); + } + + public static void filterComposingInterleave( + String projectId, String instanceId, String tableId) { + // A filter that matches cells with the value true OR with the column qualifier os_build + Filter filter = + FILTERS + .interleave() + .filter(FILTERS.value().exactMatch("true")) + .filter(FILTERS.qualifier().exactMatch("os_build")); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_composing_interleave] + + // [START bigtable_filters_composing_condition] + public static void filterComposingCondition() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + filterComposingCondition(projectId, instanceId, tableId); + } + + public static void filterComposingCondition(String projectId, String instanceId, String tableId) { + // A filter that applies the label passed-filter IF the cell has the column qualifier + // data_plan_10gb AND the value true, OTHERWISE applies the label filtered-out + Filter filter = + FILTERS + .condition( + FILTERS + .chain() + .filter(FILTERS.qualifier().exactMatch("data_plan_10gb")) + .filter(FILTERS.value().exactMatch("true"))) + .then(FILTERS.label("passed-filter")) + .otherwise(FILTERS.label("filtered-out")); + readFilter(projectId, instanceId, tableId, filter); + } + + // [END bigtable_filters_composing_condition] + // [END_EXCLUDE] + + private static void readFilter( + String projectId, String instanceId, String tableId, Filter filter) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = Query.create(TableId.of(tableId)).filter(filter); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + System.out.println("Table filter completed."); + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e); + } + } + + private static void printRow(Row row) { + if (row == null) { + return; + } + System.out.printf("Reading data for %s%n", row.getKey().toStringUtf8()); + String colFamily = ""; + for (RowCell cell : row.getCells()) { + if (!cell.getFamily().equals(colFamily)) { + colFamily = cell.getFamily(); + System.out.printf("Column Family %s%n", colFamily); + } + String labels = + cell.getLabels().size() == 0 ? "" : " [" + String.join(",", cell.getLabels()) + "]"; + System.out.printf( + "\t%s: %s @%s%s%n", + cell.getQualifier().toStringUtf8(), + cell.getValue().toStringUtf8(), + cell.getTimestamp(), + labels); + } + System.out.println(); + } +} +// [END bigtable_filters_print] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java new file mode 100644 index 000000000000..02a568f615ed --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java @@ -0,0 +1,305 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +// [START bigtable_hw_imports] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +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.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; + +// [END bigtable_hw_imports] + +/** + * An example of using Google Cloud Bigtable. + * + *

This example is a very simple "hello world" application, that illustrates how to create a new + * table, write to the table, read the data back, and delete the table. + * + *

    + *
  • create table + *
  • read single row + *
  • read table + *
  • delete table + *
+ */ +public class HelloWorld { + + private static final String COLUMN_FAMILY = "cf1"; + private static final String COLUMN_QUALIFIER_GREETING = "greeting"; + private static final String COLUMN_QUALIFIER_NAME = "name"; + private static final String ROW_KEY_PREFIX = "rowKey"; + private final String projectId; + private final String instanceId; + private final String tableId; + private final BigtableDataClient dataClient; + private final BigtableTableAdminClient adminClient; + + public static void main(String[] args) throws Exception { + + if (args.length != 2) { + System.out.println("Missing required project id or instance id"); + return; + } + String projectId = args[0]; + String instanceId = args[1]; + + HelloWorld helloWorld = new HelloWorld(projectId, instanceId, "test-table"); + helloWorld.run(); + } + + public HelloWorld(String projectId, String instanceId, String tableId) throws IOException { + this.projectId = projectId; + this.instanceId = instanceId; + this.tableId = tableId; + + // [START bigtable_hw_connect] + // Creates the settings to configure a bigtable data client. + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + + // Creates a bigtable data client. + dataClient = BigtableDataClient.create(settings); + + // Creates the settings to configure a bigtable table admin client. + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + + // Creates a bigtable table admin client. + adminClient = BigtableTableAdminClient.create(adminSettings); + // [END bigtable_hw_connect] + } + + public void run() throws Exception { + createTable(); + writeToTable(); + readSingleRow(); + readSpecificCells(); + readTable(); + filterLimitCellsPerCol(tableId); + deleteTable(); + close(); + } + + public void close() { + dataClient.close(); + adminClient.close(); + } + + /** Demonstrates how to create a table. */ + public void createTable() { + // [START bigtable_hw_create_table] + // Checks if table exists, creates table if does not exist. + if (!adminClient.exists(tableId)) { + System.out.println("Creating table: " + tableId); + String parent = "projects/" + projectId + "/instances/" + instanceId; + com.google.bigtable.admin.v2.CreateTableRequest request = + com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() + .setParent(parent) + .setTableId(tableId) + .setTable( + com.google.bigtable.admin.v2.Table.newBuilder() + .putColumnFamilies( + COLUMN_FAMILY, + com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()) + .build()) + .build(); + adminClient.getBaseClient().createTable(request); + System.out.printf("Table %s created successfully%n", tableId); + } + // [END bigtable_hw_create_table] + } + + /** Demonstrates how to write some rows to a table. */ + public void writeToTable() { + // [START bigtable_hw_write_rows] + try { + System.out.println("\nWriting some greetings to the table"); + String[] names = {"World", "Bigtable", "Java"}; + for (int i = 0; i < names.length; i++) { + String greeting = "Hello " + names[i] + "!"; + RowMutation rowMutation = + RowMutation.create(TableId.of(tableId), ROW_KEY_PREFIX + i) + .setCell(COLUMN_FAMILY, COLUMN_QUALIFIER_NAME, names[i]) + .setCell(COLUMN_FAMILY, COLUMN_QUALIFIER_GREETING, greeting); + dataClient.mutateRow(rowMutation); + System.out.println(greeting); + } + } catch (NotFoundException e) { + System.err.println("Failed to write to non-existent table: " + e.getMessage()); + } + // [END bigtable_hw_write_rows] + } + + /** Demonstrates how to read a single row from a table. */ + public Row readSingleRow() { + // [START bigtable_hw_get_by_key] + try { + System.out.println("\nReading a single row by row key"); + Row row = dataClient.readRow(TableId.of(tableId), ROW_KEY_PREFIX + 0); + System.out.println("Row: " + row.getKey().toStringUtf8()); + for (RowCell cell : row.getCells()) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + return row; + } catch (NotFoundException e) { + System.err.println("Failed to read from a non-existent table: " + e.getMessage()); + return null; + } + // [END bigtable_hw_get_by_key] + } + + /** Demonstrates how to access specific cells by family and qualifier. */ + public List readSpecificCells() { + // [START bigtable_hw_get_by_key] + try { + System.out.println("\nReading specific cells by family and qualifier"); + Row row = dataClient.readRow(TableId.of(tableId), ROW_KEY_PREFIX + 0); + System.out.println("Row: " + row.getKey().toStringUtf8()); + List cells = row.getCells(COLUMN_FAMILY, COLUMN_QUALIFIER_NAME); + for (RowCell cell : cells) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + return cells; + } catch (NotFoundException e) { + System.err.println("Failed to read from a non-existent table: " + e.getMessage()); + return null; + } + // [END bigtable_hw_get_by_key] + } + + /** Demonstrates how to read an entire table. */ + public List readTable() { + // [START bigtable_hw_scan_all] + try { + System.out.println("\nReading the entire table"); + Query query = Query.create(TableId.of(tableId)); + ServerStream rowStream = dataClient.readRows(query); + List tableRows = new ArrayList<>(); + for (Row r : rowStream) { + System.out.println("Row Key: " + r.getKey().toStringUtf8()); + tableRows.add(r); + for (RowCell cell : r.getCells()) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + } + return tableRows; + } catch (NotFoundException e) { + System.err.println("Failed to read a non-existent table: " + e.getMessage()); + return null; + } + // [END bigtable_hw_scan_all] + } + + // [START bigtable_hw_create_filter] + public void filterLimitCellsPerCol(String tableId) { + // A filter that matches only the most recent cell within each column + Filter filter = FILTERS.limit().cellsPerColumn(1); + readRowFilter(tableId, filter); + readFilter(tableId, filter); + } + + // [END bigtable_hw_create_filter] + + // [START bigtable_hw_get_with_filter] + private void readRowFilter(String tableId, Filter filter) { + String rowKey = + Base64.getEncoder().encodeToString("greeting0".getBytes(StandardCharsets.UTF_8)); + Row row = dataClient.readRow(TableId.of(tableId), rowKey, filter); + printRow(row); + System.out.println("Row filter completed."); + } + + // [END bigtable_hw_get_with_filter] + + // [START bigtable_hw_scan_with_filter] + private void readFilter(String tableId, Filter filter) { + Query query = Query.create(TableId.of(tableId)).filter(filter); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + System.out.println("Table filter completed."); + } + + // [END bigtable_hw_scan_with_filter] + + /** Demonstrates how to delete a table. */ + public void deleteTable() { + // [START bigtable_hw_delete_table] + System.out.println("\nDeleting table: " + tableId); + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + adminClient.getBaseClient().deleteTable(tableName); + System.out.printf("Table %s deleted successfully%n", tableId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent table: " + e.getMessage()); + } + // [END bigtable_hw_delete_table] + } + + // [START bigtable_print_row] + private static void printRow(Row row) { + if (row == null) { + return; + } + System.out.printf("Reading data for %s%n", row.getKey().toStringUtf8()); + String colFamily = ""; + for (RowCell cell : row.getCells()) { + if (!cell.getFamily().equals(colFamily)) { + colFamily = cell.getFamily(); + System.out.printf("Column Family %s%n", colFamily); + } + String labels = + cell.getLabels().size() == 0 ? "" : " [" + String.join(",", cell.getLabels()) + "]"; + System.out.printf( + "\t%s: %s @%s%s%n", + cell.getQualifier().toStringUtf8(), + cell.getValue().toStringUtf8(), + cell.getTimestamp(), + labels); + } + System.out.println(); + } + // [END bigtable_print_row] +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java new file mode 100644 index 000000000000..07ae1fe007e6 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java @@ -0,0 +1,258 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.bigtable.admin.v2.Cluster; +import com.google.bigtable.admin.v2.CreateClusterRequest; +import com.google.bigtable.admin.v2.CreateInstanceRequest; +import com.google.bigtable.admin.v2.DeleteClusterRequest; +import com.google.bigtable.admin.v2.DeleteInstanceRequest; +import com.google.bigtable.admin.v2.GetInstanceRequest; +import com.google.bigtable.admin.v2.Instance; +import com.google.bigtable.admin.v2.ListClustersRequest; +import com.google.bigtable.admin.v2.ListClustersResponse; +import com.google.bigtable.admin.v2.ListInstancesRequest; +import com.google.bigtable.admin.v2.ListInstancesResponse; +import com.google.bigtable.admin.v2.StorageType; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; +import java.io.IOException; +import java.util.Map; + +/** + * An example of using Google Cloud Bigtable. + * + *

This example demonstrates the usage of BigtableInstanceAdminClient to create, configure, and + * delete Cloud Bigtable Instances and Clusters. + * + *

    + *
  • creates production instance + *
  • lists instances + *
  • gets instance + *
  • lists clusters + *
  • adds cluster + *
  • deletes cluster + *
  • deletes instance + *
+ */ +public class InstanceAdminExample { + + private static final String CLUSTER = "cluster"; + private final String projectId; + private final String clusterId; + private final String instanceId; + private final BigtableInstanceAdminClient adminClient; + + public static void main(String[] args) throws IOException { + + if (args.length != 1) { + System.out.println("Missing required project id"); + return; + } + String projectId = args[0]; + + InstanceAdminExample instanceAdmin = + new InstanceAdminExample(projectId, "ssd-instance", "ssd-cluster"); + instanceAdmin.run(); + } + + public InstanceAdminExample(String projectId, String instanceId, String clusterId) + throws IOException { + this.projectId = projectId; + this.instanceId = instanceId; + this.clusterId = clusterId; + + // Creates the settings to configure a bigtable instance admin client. + BigtableInstanceAdminSettings instanceAdminSettings = + BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build(); + + // Creates a bigtable instance admin client. + adminClient = BigtableInstanceAdminClient.create(instanceAdminSettings); + } + + public void run() { + createProdInstance(); + listInstances(); + getInstance(); + listClusters(); + addCluster(); + deleteCluster(); + deleteInstance(); + close(); + } + + // Close the client + void close() { + adminClient.close(); + } + + /** Demonstrates how to create a Production instance within a provided project. */ + public void createProdInstance() { + // Checks if instance exists, creates instance if does not exists. + if (!adminClient.exists(instanceId)) { + System.out.println("Instance does not exist, creating a PRODUCTION instance"); + // [START bigtable_create_prod_instance] + // Creates a Production Instance with the ID "ssd-instance", + // cluster id "ssd-cluster", 3 nodes and location "us-central1-f". + String parent = "projects/" + projectId; + Instance instanceObj = + Instance.newBuilder() + .setDisplayName(instanceId) + .setType(Instance.Type.PRODUCTION) + .putLabels("department", "accounting") + .build(); + Cluster clusterObj = + Cluster.newBuilder() + .setLocation("projects/" + projectId + "/locations/us-central1-f") + .setServeNodes(3) + .setDefaultStorageType(StorageType.SSD) + .build(); + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstanceId(instanceId) + .setInstance(instanceObj) + .putClusters(clusterId, clusterObj) + .build(); + // Creates a production instance with the given request. + try { + Instance instance = adminClient.getBaseClient().createInstanceAsync(request).get(); + System.out.printf("PRODUCTION type instance %s created successfully%n", instance.getName()); + } catch (Exception e) { + System.err.println("Failed to create instance: " + e.getMessage()); + throw new RuntimeException(e); + } + // [END bigtable_create_prod_instance] + } + } + + /** Demonstrates how to list all instances within a project. */ + public void listInstances() { + System.out.println("\nListing Instances"); + // [START bigtable_list_instances] + try { + String parent = "projects/" + projectId; + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + ListInstancesResponse response = adminClient.getBaseClient().listInstances(request); + for (Instance instance : response.getInstancesList()) { + System.out.println(instance.getName()); + } + } catch (Exception e) { + System.err.println("Failed to list instances: " + e.getMessage()); + } + // [END bigtable_list_instances] + } + + /** Demonstrates how to get an instance. */ + public Instance getInstance() { + System.out.println("\nGet Instance"); + // [START bigtable_get_instance] + Instance instance = null; + try { + String name = "projects/" + projectId + "/instances/" + instanceId; + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + instance = adminClient.getBaseClient().getInstance(request); + System.out.println("Instance ID: " + instance.getName()); + System.out.println("Display Name: " + instance.getDisplayName()); + System.out.print("Labels: "); + Map labels = instance.getLabelsMap(); + for (String key : labels.keySet()) { + System.out.printf("%s - %s", key, labels.get(key)); + } + System.out.println("\nState: " + instance.getState()); + System.out.println("Type: " + instance.getType()); + } catch (NotFoundException e) { + System.err.println("Failed to get non-existent instance: " + e.getMessage()); + } + // [END bigtable_get_instance] + return instance; + } + + /** Demonstrates how to list clusters within an instance. */ + public void listClusters() { + System.out.println("\nListing Clusters"); + // [START bigtable_get_clusters] + try { + String parent = "projects/" + projectId + "/instances/" + instanceId; + ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); + ListClustersResponse response = adminClient.getBaseClient().listClusters(request); + for (Cluster cluster : response.getClustersList()) { + System.out.println(cluster.getName()); + } + } catch (NotFoundException e) { + System.err.println("Failed to list clusters from a non-existent instance: " + e.getMessage()); + } + // [END bigtable_get_clusters] + } + + /** Demonstrates how to delete an instance. */ + public void deleteInstance() { + System.out.println("\nDeleting Instance"); + // [START bigtable_delete_instance] + try { + String name = "projects/" + projectId + "/instances/" + instanceId; + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + adminClient.getBaseClient().deleteInstance(request); + System.out.println("Instance deleted: " + instanceId); + } catch (NotFoundException e) { + System.err.println("Failed to delete non-existent instance: " + e.getMessage()); + } + // [END bigtable_delete_instance] + } + + /** Demonstrates how to add a cluster to an instance. */ + public void addCluster() { + System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId); + // [START bigtable_create_cluster] + try { + String parent = "projects/" + projectId + "/instances/" + instanceId; + Cluster clusterObj = + Cluster.newBuilder() + .setLocation("projects/" + projectId + "/locations/us-central1-c") + .setServeNodes(3) + .setDefaultStorageType(StorageType.SSD) + .build(); + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(parent) + .setClusterId(CLUSTER) + .setCluster(clusterObj) + .build(); + adminClient.getBaseClient().createClusterAsync(request).get(); + System.out.printf("Cluster: %s created successfully%n", CLUSTER); + } catch (Exception e) { + System.err.println("Failed to add cluster: " + e.getMessage()); + } + // [END bigtable_create_cluster] + } + + /** Demonstrates how to delete a cluster from an instance. */ + public void deleteCluster() { + System.out.printf("%nDeleting cluster: %s from instance: %s%n", CLUSTER, instanceId); + // [START bigtable_delete_cluster] + try { + String name = "projects/" + projectId + "/instances/" + instanceId + "/clusters/" + CLUSTER; + DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); + adminClient.getBaseClient().deleteCluster(request); + System.out.printf("Cluster: %s deleted successfully%n", CLUSTER); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent cluster: " + e.getMessage()); + } + // [END bigtable_delete_cluster] + } +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java new file mode 100644 index 000000000000..436ab139a4e5 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +package com.example.bigtable; + +import com.google.api.core.ApiFuture; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +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.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + +public class KeySalting { + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + public static final int SALT_RANGE = 4; + + public static void writeSaltedRow( + String projectId, String instanceId, String tableId, String rowKey) throws IOException { + BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId); + String saltedRowKey = getSaltedRowKey(rowKey, SALT_RANGE); + RowMutation rowMutation = + RowMutation.create(TableId.of(tableId), saltedRowKey) + .setCell(COLUMN_FAMILY_NAME, "os_build", "PQ2A.190405.003"); + + dataClient.mutateRow(rowMutation); + System.out.printf("Successfully wrote row %s as %s\n", rowKey, saltedRowKey); + + dataClient.close(); + } + + public static void readSaltedRow( + String projectId, String instanceId, String tableId, String rowKey) throws IOException { + BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId); + Row row = dataClient.readRow(TableId.of(tableId), getSaltedRowKey(rowKey, SALT_RANGE)); + System.out.printf("Successfully read row %s\n", row.getKey().toStringUtf8()); + } + + public static void scanSaltedRows( + String projectId, String instanceId, String tableId, String prefix) + throws IOException, ExecutionException, InterruptedException { + BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId); + + List queries = new ArrayList<>(); + for (int i = 0; i < SALT_RANGE; i++) { + queries.add(Query.create(TableId.of(tableId)).prefix(i + "-" + prefix)); + } + + List>> futures = new ArrayList<>(); + for (Query q : queries) { + futures.add(dataClient.readRowsCallable().all().futureCall(q)); + } + + List rows = new ArrayList<>(); + for (ApiFuture> future : futures) { + rows.addAll(future.get()); + } + + System.out.printf("Successfully fetched %s rows\n", rows.size()); + for (Row row : rows) { + System.out.printf("Successfully read row %s\n", row.getKey().toStringUtf8()); + } + } + + /** + * Generates a salted version of the row key. + * + *

Some Bigtable schema designs will always have hot spots, and a salted row key breaks up + * individual rows and groups of rows that are hot. Row keys are stored in sorted order, so + * prepending a numeric prefix allows those hot rows to be stored in different locations. + * + *

The salted row key is created by hashing the existing row key and taking a modulo of how + * large a prefix range you want to create; then prepending the existing row key with that result. + * This produces a deterministic output, so each row key will always produce the same salted key. + */ + public static String getSaltedRowKey(String rowKey, int saltRange) { + int prefix = rowKey.hashCode() % saltRange; + return prefix + "-" + rowKey; + } +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java new file mode 100644 index 000000000000..4c0a415c6d65 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_quickstart] + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +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.TableId; + +public class Quickstart { + + public static void main(String... args) { + String projectId = args[0]; // my-gcp-project-id + String instanceId = args[1]; // my-bigtable-instance-id + String tableId = args[2]; // my-bigtable-table-id + + quickstart(projectId, instanceId, tableId); + } + + public static void quickstart(String projectId, String instanceId, String tableId) { + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(settings)) { + System.out.println("\nReading a single row by row key"); + Row row = dataClient.readRow(TableId.of(tableId), "r1"); + System.out.println("Row: " + row.getKey().toStringUtf8()); + for (RowCell cell : row.getCells()) { + System.out.printf( + "Family: %s Qualifier: %s Value: %s%n", + cell.getFamily(), cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8()); + } + } catch (NotFoundException e) { + System.err.println("Failed to read from a non-existent table: " + e.getMessage()); + } catch (Exception e) { + System.out.println("Error during quickstart: \n" + e.toString()); + } + } +} +// [END bigtable_quickstart] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Reads.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Reads.java new file mode 100644 index 000000000000..d1cca037f05d --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/Reads.java @@ -0,0 +1,289 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_reads_print] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Filters; +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.TableId; +import java.io.IOException; + +public class Reads { + + // Write your code here. + // [START_EXCLUDE] + // [START bigtable_reads_row] + public static void readRow() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRow(projectId, instanceId, tableId); + } + + public static void readRow(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + String rowkey = "phone#4c410523#20190501"; + + Row row = dataClient.readRow(TableId.of(tableId), rowkey); + printRow(row); + + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_row] + + // [START bigtable_reads_row_partial] + public static void readRowPartial() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRowPartial(projectId, instanceId, tableId); + } + + public static void readRowPartial(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + String rowkey = "phone#4c410523#20190501"; + Filters.Filter filter = + FILTERS + .chain() + .filter(FILTERS.family().exactMatch("stats_summary")) + .filter(FILTERS.qualifier().exactMatch("os_build")); + + Row row = dataClient.readRow(TableId.of(tableId), rowkey, filter); + printRow(row); + + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_row_partial] + + // [START bigtable_reads_rows] + public static void readRows() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRows(projectId, instanceId, tableId); + } + + public static void readRows(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = + Query.create(TableId.of(tableId)) + .rowKey("phone#4c410523#20190501") + .rowKey("phone#4c410523#20190502"); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_rows] + + // [START bigtable_reads_row_range] + public static void readRowRange() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRowRange(projectId, instanceId, tableId); + } + + public static void readRowRange(String projectId, String instanceId, String tableId) { + String start = "phone#4c410523#20190501"; + String end = "phone#4c410523#201906201"; + + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = Query.create(TableId.of(tableId)).range(start, end); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_row_range] + + // [START bigtable_reads_row_ranges] + public static void readRowRanges() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRowRanges(projectId, instanceId, tableId); + } + + public static void readRowRanges(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = + Query.create(TableId.of(tableId)) + .range("phone#4c410523#20190501", "phone#4c410523#20190601") + .range("phone#5c10102#20190501", "phone#5c10102#20190601"); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_row_ranges] + + // [START bigtable_reads_prefix] + public static void readPrefix() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readPrefix(projectId, instanceId, tableId); + } + + public static void readPrefix(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = Query.create(TableId.of(tableId)).prefix("phone"); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_prefix] + + // [START bigtable_reverse_scan] + public static void readRowsReversed() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readRowsReversed(projectId, instanceId, tableId); + } + + public static void readRowsReversed(String projectId, String instanceId, String tableId) { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = + Query.create(TableId.of(tableId)) + .reversed(true) + .limit(3) + .prefix("phone#4c410523") + .range("phone#5c10102", "phone#5c10103"); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reverse_scan] + + // [START bigtable_reads_filter] + public static void readFilter() { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String instanceId = "my-instance-id"; + String tableId = "mobile-time-series"; + readFilter(projectId, instanceId, tableId); + } + + public static void readFilter(String projectId, String instanceId, String tableId) { + Filters.Filter filter = FILTERS.value().regex("PQ2A.*"); + + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Query query = Query.create(TableId.of(tableId)).filter(filter); + ServerStream rows = dataClient.readRows(query); + for (Row row : rows) { + printRow(row); + } + } catch (IOException e) { + System.out.println( + "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + } + } + + // [END bigtable_reads_filter] + // [END_EXCLUDE] + + private static void printRow(Row row) { + System.out.printf("Reading data for %s%n", row.getKey().toStringUtf8()); + String colFamily = ""; + for (RowCell cell : row.getCells()) { + if (!cell.getFamily().equals(colFamily)) { + colFamily = cell.getFamily(); + System.out.printf("Column Family %s%n", colFamily); + } + System.out.printf( + "\t%s: %s @%s%n", + cell.getQualifier().toStringUtf8(), cell.getValue().toStringUtf8(), cell.getTimestamp()); + } + System.out.println(); + } +} +// [END bigtable_reads_print] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java new file mode 100644 index 000000000000..7ac0af3fcb1c --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java @@ -0,0 +1,232 @@ +/* + * Copyright 2025 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. + */ + +package com.example.bigtable; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateSchemaBundleRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.SchemaBundle; +import com.google.cloud.bigtable.admin.v2.models.Table; +import com.google.cloud.bigtable.admin.v2.models.UpdateSchemaBundleRequest; +import com.google.protobuf.ByteString; +import com.google.protobuf.DescriptorProtos; +import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * This example demonstrates the usage of BigtableTableAdminClient to create, configure and delete a + * Cloud Bigtable schema bundle. + * + *

The example follows these steps: + * + *

    + *
  1. Creates a Bigtable table. + *
  2. Creates a schema bundle. + *
  3. Updates a schema bundle. + *
  4. Gets the schema bundle. + *
  5. Lists all schema bundles for the table. + *
  6. Deletes the schema bundle. + *
  7. Deletes the table. + *
+ */ +public class SchemaBundleExample { + + private static final String COLUMN_FAMILY = "cf"; + private static final String PROTO_FILE_PATH = "com/example/bigtable/descriptors.pb"; + private final String tableId; + private final String schemaBundleId; + private final BigtableTableAdminClient adminClient; + + public static void main(String[] args) throws IOException { + if (args.length != 2) { + System.out.println("Missing required project id or instance id"); + return; + } + String projectId = args[0]; + String instanceId = args[1]; + + SchemaBundleExample example = + new SchemaBundleExample(projectId, instanceId, "test-table", "test-schema-bundle"); + example.run(); + } + + public SchemaBundleExample( + String projectId, String instanceId, String tableId, String schemaBundleId) + throws IOException { + this.tableId = tableId; + this.schemaBundleId = schemaBundleId; + + // Creates the settings to configure a bigtable table admin client. + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + + // Creates a bigtable table admin client. + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + public void close() { + adminClient.close(); + } + + public void run() { + createTable(); + createSchemaBundle(); + updateSchemaBundle(); + getSchemaBundle(); + listAllSchemaBundles(); + deleteSchemaBundle(); + deleteTable(); + close(); + } + + public void createTable() { + // Checks if table exists, creates table if it does not exist. + if (!adminClient.exists(tableId)) { + System.out.println("Table does not exist, creating table: " + tableId); + CreateTableRequest createTableRequest = + CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY); + Table table = adminClient.createTable(createTableRequest); + System.out.printf("Table: %s created successfully%n", table.getId()); + } + } + + public void deleteTable() { + // Deletes the entire table. + System.out.println("\nDelete table: " + tableId); + try { + adminClient.deleteTable(tableId); + System.out.printf("Table: %s deleted successfully%n", tableId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent table: " + e.getMessage()); + } + } + + /** Demonstrates how to create a schema bundle under a table with the specified schema. */ + public void createSchemaBundle() { + // Checks if the schema bundle exists, creates it if it does not exist. + try { + adminClient.getSchemaBundle(tableId, schemaBundleId); + } catch (NotFoundException exception) { + System.out.printf("%nCreating schema bundle %s in table %s%n", schemaBundleId, tableId); + // [START bigtable_create_schema_bundle] + try { + InputStream in = getClass().getClassLoader().getResourceAsStream(PROTO_FILE_PATH); + CreateSchemaBundleRequest request = + CreateSchemaBundleRequest.of(tableId, schemaBundleId) + .setProtoSchema(ByteString.readFrom(in)); + SchemaBundle schemaBundle = adminClient.createSchemaBundle(request); + System.out.printf("Schema bundle: %s created successfully%n", schemaBundle.getId()); + } catch (NotFoundException e) { + System.err.println( + "Failed to create a schema bundle from a non-existent table: " + e.getMessage()); + } catch (IOException e) { + throw new RuntimeException(e); + } + // [END bigtable_create_schema_bundle] + } + } + + /** Demonstrates how to modify a schema bundle. */ + public void updateSchemaBundle() { + System.out.printf("%nUpdating schema bundle %s in table %s%n", schemaBundleId, tableId); + // [START bigtable_update_schema_bundle] + try { + InputStream in = getClass().getClassLoader().getResourceAsStream(PROTO_FILE_PATH); + UpdateSchemaBundleRequest request = + UpdateSchemaBundleRequest.of(tableId, schemaBundleId) + .setProtoSchema(ByteString.readFrom(in)); + SchemaBundle schemaBundle = adminClient.updateSchemaBundle(request); + System.out.printf("Schema bundle: %s updated successfully%n", schemaBundle.getId()); + } catch (NotFoundException e) { + System.err.println("Failed to modify a non-existent schema bundle: " + e.getMessage()); + } catch (IOException e) { + throw new RuntimeException(e); + } + // [END bigtable_update_schema_bundle] + } + + /** Demonstrates how to get a schema bundle's definition. */ + public SchemaBundle getSchemaBundle() { + System.out.printf("%nGetting schema bundle %s in table %s%n", schemaBundleId, tableId); + // [START bigtable_get_schema_bundle] + SchemaBundle schemaBundle = null; + try { + schemaBundle = adminClient.getSchemaBundle(tableId, schemaBundleId); + // Deserialize and print the FileDescriptorSet + DescriptorProtos.FileDescriptorSet fileDescriptorSet = + DescriptorProtos.FileDescriptorSet.parseFrom(schemaBundle.getProtoSchema()); + + System.out.println("--------- Deserialized FileDescriptorSet ---------"); + for (DescriptorProtos.FileDescriptorProto fileDescriptorProto : + fileDescriptorSet.getFileList()) { + System.out.println("File: " + fileDescriptorProto.getName()); + System.out.println(" Package: " + fileDescriptorProto.getPackage()); + for (DescriptorProtos.DescriptorProto messageType : + fileDescriptorProto.getMessageTypeList()) { + System.out.println(" Message: " + messageType.getName()); + } + } + System.out.println("--------------------------------------------------"); + } catch (InvalidProtocolBufferException e) { + System.err.println("Failed to parse FileDescriptorSet: " + e.getMessage()); + } catch (NotFoundException e) { + System.err.println( + "Failed to retrieve metadata from a non-existent schema bundle: " + e.getMessage()); + } + // [END bigtable_get_schema_bundle] + return schemaBundle; + } + + /** Demonstrates how to list all schema bundles within a table. */ + public List listAllSchemaBundles() { + System.out.printf("%nListing schema bundles in table %s%n", tableId); + // [START bigtable_list_schema_bundles] + List schemaBundleIds = new ArrayList<>(); + try { + schemaBundleIds = adminClient.listSchemaBundles(tableId); + for (String schemaBundleId : schemaBundleIds) { + System.out.println(schemaBundleId); + } + } catch (NotFoundException e) { + System.err.println( + "Failed to list schema bundles from a non-existent table: " + e.getMessage()); + } + // [END bigtable_list_schema_bundles] + return schemaBundleIds; + } + + /** Demonstrates how to delete a schema bundle. */ + public void deleteSchemaBundle() { + System.out.printf("%nDeleting schema bundle %s in table %s%n", schemaBundleId, tableId); + // [START bigtable_delete_schema_bundle] + try { + adminClient.deleteSchemaBundle(tableId, schemaBundleId); + System.out.printf("SchemaBundle: %s deleted successfully%n", schemaBundleId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent schema bundle: " + e.getMessage()); + } + // [END bigtable_delete_schema_bundle] + } +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java new file mode 100644 index 000000000000..009fef39105a --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java @@ -0,0 +1,452 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import com.google.api.gax.rpc.AlreadyExistsException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.bigtable.admin.v2.ColumnFamily; +import com.google.bigtable.admin.v2.CreateTableRequest; +import com.google.bigtable.admin.v2.GcRule; +import com.google.bigtable.admin.v2.ListTablesRequest; +import com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest; +import com.google.bigtable.admin.v2.Table; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.GcRuleBuilder; +import java.io.IOException; +import java.time.Duration; + +/** + * An example of using Google Cloud Bigtable. + * + *

This example demonstrates the usage of BigtableTableAdminClient to create, configure and + * delete a Cloud Bigtable table. + * + *

    + *
  • creates table + *
  • lists all tables + *
  • gets table metadata + *
  • creates DurationRule + *
  • creates VersionRule + *
  • creates UnionRule + *
  • creates IntersectionRule + *
  • creates nested rule + *
  • lists column families + *
  • modifies column family rule + *
  • prints modified column family + *
  • deletes column family + *
  • deletes table + *
+ */ +public class TableAdminExample { + + private static final String COLUMN_FAMILY_1 = "cf1"; + private static final String COLUMN_FAMILY_2 = "cf2"; + private static final String COLUMN_FAMILY_3 = "cf3"; + private static final String COLUMN_FAMILY_4 = "cf4"; + private static final String COLUMN_FAMILY_5 = "cf5"; + private final String projectId; + private final String instanceId; + private final String tableId; + private final BigtableTableAdminClient adminClient; + + public static void main(String[] args) throws IOException { + + if (args.length != 2) { + System.out.println("Missing required project id or instance id"); + return; + } + String projectId = args[0]; + String instanceId = args[1]; + + TableAdminExample tableAdmin = new TableAdminExample(projectId, instanceId, "test-table"); + tableAdmin.run(); + } + + public TableAdminExample(String projectId, String instanceId, String tableId) throws IOException { + this.projectId = projectId; + this.instanceId = instanceId; + this.tableId = tableId; + + // Creates the settings to configure a bigtable table admin client. + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + + // Creates a bigtable table admin client. + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + public void run() { + createTable(); + listAllTables(); + getTableMeta(); + addFamilyWithMaxAgeRule(); + addFamilyWithMaxVersionsRule(); + addFamilyWithUnionRule(); + addFamilyWithIntersectionRule(); + addFamilyWithNestedRule(); + listColumnFamilies(); + modifyColumnFamilyRule(); + printModifiedColumnFamily(); + deleteColumnFamily(); + deleteTable(); + close(); + } + + // Close the client + void close() { + adminClient.close(); + } + + /** Demonstrates how to create a table with the specified configuration. */ + public void createTable() { + // [START bigtable_create_table] + // Checks if table exists, creates table if does not exist. + if (!adminClient.exists(tableId)) { + System.out.println("Table does not exist, creating table: " + tableId); + String parent = "projects/" + projectId + "/instances/" + instanceId; + CreateTableRequest createTableRequest = + CreateTableRequest.newBuilder() + .setParent(parent) + .setTableId(tableId) + .setTable( + Table.newBuilder() + .putColumnFamilies("cf", ColumnFamily.getDefaultInstance()) + .build()) + .build(); + Table table = adminClient.getBaseClient().createTable(createTableRequest); + System.out.printf("Table: %s created successfully%n", table.getName()); + } + // [END bigtable_create_table] + } + + /** Demonstrates how to list all tables within an instance. */ + public void listAllTables() { + System.out.println("\nListing tables in current instance"); + // [START bigtable_list_tables] + // Lists tables in the current instance. + try { + String parent = "projects/" + projectId + "/instances/" + instanceId; + ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build(); + for (Table table : adminClient.getBaseClient().listTables(request).iterateAll()) { + System.out.println(table.getName()); + } + } catch (NotFoundException e) { + System.err.println("Failed to list tables from a non-existent instance: " + e.getMessage()); + } + // [END bigtable_list_tables] + } + + /** Demonstrates how to get a table's metadata. */ + public void getTableMeta() { + System.out.println("\nPrinting table metadata"); + // [START bigtable_get_table_metadata] + // Gets table metadata, and applies a view to the table fields. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + Table table = adminClient.getBaseClient().getTable(tableName); + System.out.println("Table: " + table.getName()); + for (java.util.Map.Entry entry : + table.getColumnFamiliesMap().entrySet()) { + System.out.printf( + "Column family: %s%nGC Rule: %s%n", entry.getKey(), entry.getValue().getGcRule()); + } + } catch (NotFoundException e) { + System.err.println( + "Failed to retrieve table metadata for a non-existent table: " + e.getMessage()); + } + // [END bigtable_get_table_metadata] + } + + /** Demonstrates how to create a new instance of the DurationRule. */ + public void addFamilyWithMaxAgeRule() { + System.out.printf("%nCreating column family %s with max age GC rule%n", COLUMN_FAMILY_1); + // [START bigtable_create_family_gc_max_age] + // Creates a column family with GC policy : maximum age + // where age = current time minus cell timestamp + + // Defines the GC rule to retain data with max age of 5 days. + GcRule maxAgeRule = GcRuleBuilder.maxAge(Duration.ofDays(5)); + + // Creates column family with given GC rule. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_1) + .setCreate(ColumnFamily.newBuilder().setGcRule(maxAgeRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.println("Created column family: " + COLUMN_FAMILY_1); + } catch (AlreadyExistsException e) { + System.err.println( + "Failed to create column family with rule, already exists: " + e.getMessage()); + } + // [END bigtable_create_family_gc_max_age] + } + + /** Demonstrates how to create a new instance of the VersionRule. */ + public void addFamilyWithMaxVersionsRule() { + System.out.printf("%nCreating column family %s with max versions GC rule%n", COLUMN_FAMILY_2); + // [START bigtable_create_family_gc_max_versions] + // Creates a column family with GC policy : most recent N versions + // where 1 = most recent version + + // Defines the GC policy to retain only the most recent 2 versions. + GcRule versionRule = GcRuleBuilder.maxVersions(2); + + // Creates column family with given GC rule. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_2) + .setCreate(ColumnFamily.newBuilder().setGcRule(versionRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.println("Created column family: " + COLUMN_FAMILY_2); + } catch (AlreadyExistsException e) { + System.err.println( + "Failed to create column family with rule, already exists: " + e.getMessage()); + } + // [END bigtable_create_family_gc_max_versions] + } + + /** Demonstrates how to create a new instance of the UnionRule. */ + public void addFamilyWithUnionRule() { + System.out.printf("%nCreating column family %s with union GC rule%n", COLUMN_FAMILY_3); + // [START bigtable_create_family_gc_union] + // Creates a column family with GC policy to drop data that matches at least one condition. + + // Defines a list of GC rules to drop cells older than 5 days OR not the most recent + // version. + GcRule unionRule = + GcRuleBuilder.union() + .add(GcRuleBuilder.maxAge(Duration.ofDays(5))) + .add(GcRuleBuilder.maxVersions(1)) + .build(); + + // Creates column family with given GC rule. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_3) + .setCreate(ColumnFamily.newBuilder().setGcRule(unionRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.println("Created column family: " + COLUMN_FAMILY_3); + } catch (AlreadyExistsException e) { + System.err.println( + "Failed to create column family with rule, already exists: " + e.getMessage()); + } + // [END bigtable_create_family_gc_union] + } + + /** Demonstrates how to create a new instance of the IntersectionRule. */ + public void addFamilyWithIntersectionRule() { + System.out.printf("%nCreating column family %s with intersection GC rule%n", COLUMN_FAMILY_4); + // [START bigtable_create_family_gc_intersection] + // Creates a column family with GC policy to drop data that matches all conditions. + + // Defines a GC rule to drop cells older than 5 days AND older than the most recent 2 versions. + GcRule intersectionRule = + GcRuleBuilder.intersection() + .add(GcRuleBuilder.maxAge(Duration.ofDays(5))) + .add(GcRuleBuilder.maxVersions(2)) + .build(); + + // Creates column family with given GC rule. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_4) + .setCreate(ColumnFamily.newBuilder().setGcRule(intersectionRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.println("Created column family: " + COLUMN_FAMILY_4); + } catch (AlreadyExistsException e) { + System.err.println( + "Failed to create column family with rule, already exists: " + e.getMessage()); + } + // [END bigtable_create_family_gc_intersection] + } + + /** Demonstrates how to create a nested rule using the IntersectionRule and UnionRule. */ + public void addFamilyWithNestedRule() { + System.out.printf("%nCreating column family %s with a nested GC rule%n", COLUMN_FAMILY_5); + // [START bigtable_create_family_gc_nested] + // Creates a nested GC rule: + // Drop cells that are either older than the 10 recent versions + // OR + // Drop cells that are older than a month AND older than the 2 recent versions + GcRule intersectionRule = + GcRuleBuilder.intersection() + .add(GcRuleBuilder.maxAge(Duration.ofDays(30))) + .add(GcRuleBuilder.maxVersions(2)) + .build(); + GcRule unionRule = + GcRuleBuilder.union().add(intersectionRule).add(GcRuleBuilder.maxVersions(10)).build(); + + // Creates column family with given GC rule. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_5) + .setCreate(ColumnFamily.newBuilder().setGcRule(unionRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.println("Created column family: " + COLUMN_FAMILY_5); + } catch (AlreadyExistsException e) { + System.err.println( + "Failed to create column family with rule, already exists: " + e.getMessage()); + } + // [END bigtable_create_family_gc_nested] + } + + /** Demonstrates how to list a table's column families. */ + public void listColumnFamilies() { + System.out.println("\nPrinting ID and GC Rule for all column families"); + // [START bigtable_list_column_families] + // Lists all families in the table with GC rules. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + Table table = adminClient.getBaseClient().getTable(tableName); + for (java.util.Map.Entry entry : + table.getColumnFamiliesMap().entrySet()) { + System.out.printf( + "Column family: %s%nGC Rule: %s%n", entry.getKey(), entry.getValue().getGcRule()); + } + } catch (NotFoundException e) { + System.err.println( + "Failed to list column families from a non-existent table: " + e.getMessage()); + } + // [END bigtable_list_column_families] + } + + /** Demonstrates how to modify a column family's rule. */ + public void modifyColumnFamilyRule() { + System.out.printf("%nUpdating column family %s GC rule%n", COLUMN_FAMILY_1); + // [START bigtable_update_gc_rule] + // Updates the column family metadata to update the GC rule. + // Updates a column family GC rule. + GcRule versionRule = GcRuleBuilder.maxVersions(1); + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_1) + .setUpdate(ColumnFamily.newBuilder().setGcRule(versionRule))) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.printf("Column family %s GC rule updated%n", COLUMN_FAMILY_1); + } catch (NotFoundException e) { + System.err.println("Failed to modify a non-existent column family: " + e.getMessage()); + } + // [END bigtable_update_gc_rule] + } + + /** Demonstrates how to print the modified column family. */ + public void printModifiedColumnFamily() { + System.out.printf("%nPrint updated GC rule for column family %s%n", COLUMN_FAMILY_1); + // [START bigtable_family_get_gc_rule] + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + Table table = adminClient.getBaseClient().getTable(tableName); + if (table.containsColumnFamilies(COLUMN_FAMILY_1)) { + System.out.printf( + "Column family: %s%nGC Rule: %s%n", + COLUMN_FAMILY_1, table.getColumnFamiliesMap().get(COLUMN_FAMILY_1).getGcRule()); + } + } catch (NotFoundException e) { + System.err.println("Failed to print a non-existent column family: " + e.getMessage()); + } + // [END bigtable_family_get_gc_rule] + } + + /** Demonstrates how to delete a column family. */ + public void deleteColumnFamily() { + System.out.println("\nDelete column family: " + COLUMN_FAMILY_2); + // [START bigtable_delete_family] + // Deletes a column family. + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + ModifyColumnFamiliesRequest request = + ModifyColumnFamiliesRequest.newBuilder() + .setName(tableName) + .addModifications( + ModifyColumnFamiliesRequest.Modification.newBuilder() + .setId(COLUMN_FAMILY_2) + .setDrop(true)) + .build(); + adminClient.getBaseClient().modifyColumnFamilies(request); + System.out.printf("Column family %s deleted successfully%n", COLUMN_FAMILY_2); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent column family: " + e.getMessage()); + } + // [END bigtable_delete_family] + } + + /** Demonstrates how to delete a table. */ + public void deleteTable() { + // [START bigtable_delete_table] + // Deletes the entire table. + System.out.println("\nDelete table: " + tableId); + try { + String tableName = + "projects/" + projectId + "/instances/" + instanceId + "/tables/" + tableId; + adminClient.getBaseClient().deleteTable(tableName); + System.out.printf("Table: %s deleted successfully%n", tableId); + } catch (NotFoundException e) { + System.err.println("Failed to delete a non-existent table: " + e.getMessage()); + } + // [END bigtable_delete_table] + } +} diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java new file mode 100644 index 000000000000..b3e0b2005274 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java @@ -0,0 +1,91 @@ +/* + * Copyright 2024 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. + */ + +package com.example.bigtable; + +// [START bigtable_writes_aggregate] + +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.common.primitives.Longs; +import com.google.protobuf.ByteString; +import java.time.Instant; +import java.time.temporal.ChronoUnit; + +public class WriteAggregate { + private static final String COUNT_COLUMN_FAMILY_NAME = "view_count"; + private static final long MICROS_PER_MILLI = 1000; + + public static void writeAggregate(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "page-view-counter"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + + String rowKey = "page#index.html"; + Instant viewTimestamp = Instant.parse("2024-03-13T12:41:34.123Z"); + + // Bucket the views for an hour into a single count, giving us an hourly view count for a + // given page. + Instant hourlyBucket = viewTimestamp.truncatedTo(ChronoUnit.HOURS); + long hourlyBucketMicros = hourlyBucket.toEpochMilli() * MICROS_PER_MILLI; + + RowMutation rowMutation = + RowMutation.create(tableId, rowKey) + .addToCell(COUNT_COLUMN_FAMILY_NAME, "views", hourlyBucketMicros, 1); + + dataClient.mutateRow(rowMutation); + System.out.printf("Successfully wrote row %s", rowKey); + + } catch (Exception e) { + System.out.println("Error during WriteAggregate: \n" + e.toString()); + } + } + + public static void mergeAggregate(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "page-view-counter"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + + String rowKey = "page#index.html"; + Instant viewTimestamp = Instant.parse("2024-03-13T12:41:34.123Z"); + + // Bucket the views for an hour into a single count, giving us an hourly view count for a + // given page. + Instant hourlyBucket = viewTimestamp.truncatedTo(ChronoUnit.HOURS); + long hourlyBucketMicros = hourlyBucket.toEpochMilli() * MICROS_PER_MILLI; + + RowMutation rowMutation = + RowMutation.create(tableId, rowKey) + .mergeToCell( + COUNT_COLUMN_FAMILY_NAME, + "views", + hourlyBucketMicros, + ByteString.copyFrom(Longs.toByteArray(1L))); + + dataClient.mutateRow(rowMutation); + System.out.printf("Successfully wrote row %s", rowKey); + + } catch (Exception e) { + System.out.println("Error during mergeAggregate: \n" + e.toString()); + } + } +} + +// [END bigtable_writes_aggregate] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java new file mode 100644 index 000000000000..24e1000a2b3a --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_writes_batch] + +import com.google.api.core.ApiFuture; +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.batching.BatchingException; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + +public class WriteBatch { + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + + public static void writeBatch(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "mobile-time-series"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + List> batchFutures = new ArrayList<>(); + try (Batcher batcher = + dataClient.newBulkMutationBatcher(TableId.of(tableId))) { + long timestamp = System.currentTimeMillis() * 1000; + batchFutures.add( + batcher.add( + RowMutationEntry.create("tablet#a0b81f74#20190501") + .setCell( + COLUMN_FAMILY_NAME, ByteString.copyFromUtf8("connected_wifi"), timestamp, 1) + .setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc1"))); + batchFutures.add( + batcher.add( + RowMutationEntry.create("tablet#a0b81f74#20190502") + .setCell( + COLUMN_FAMILY_NAME, ByteString.copyFromUtf8("connected_wifi"), timestamp, 1) + .setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc6"))); + + // Blocks until mutations are applied on all submitted row entries. + // flush will be called automatically when a batch is full. + batcher.flush(); + // Before batcher is closed, all remaining (if any) mutations are applied. + } catch (BatchingException batchingException) { + System.out.println( + "At least one entry failed to apply. Summary of the errors: \n" + batchingException); + // get individual entry error details + for (ApiFuture future : batchFutures) { + try { + future.get(); + } catch (ExecutionException entryException) { + System.out.println("Entry failure: " + entryException.getCause()); + } catch (InterruptedException e) { + // handle interrupted exception + } + } + } + System.out.println("Successfully wrote 2 rows"); + } catch (Exception e) { + System.out.println("Error during WriteBatch: \n" + e); + } + } +} + +// [END bigtable_writes_batch] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java new file mode 100644 index 000000000000..82d5fbfaba0a --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_writes_conditional] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters.Filter; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.TableId; + +public class WriteConditionally { + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + + public static void writeConditionally(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "mobile-time-series"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + long timestamp = System.currentTimeMillis() * 1000; + + String rowkey = "phone#4c410523#20190501"; + + Mutation mutation = + Mutation.create().setCell(COLUMN_FAMILY_NAME, "os_name", timestamp, "android"); + + Filter filter = + FILTERS + .chain() + .filter(FILTERS.family().exactMatch(COLUMN_FAMILY_NAME)) + .filter(FILTERS.qualifier().exactMatch("os_build")) + .filter(FILTERS.value().regex("PQ2A\\..*")); + + ConditionalRowMutation conditionalRowMutation = + ConditionalRowMutation.create(TableId.of(tableId), rowkey) + .condition(filter) + .then(mutation); + + boolean success = dataClient.checkAndMutateRow(conditionalRowMutation); + + System.out.printf("Successfully updated row's os_name: %b", success); + + } catch (Exception e) { + System.out.println("Error during WriteConditionally: \n" + e.toString()); + e.printStackTrace(); + } + } +} + +// [END bigtable_writes_conditional] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java new file mode 100644 index 000000000000..4f832d5a9860 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_writes_increment] + +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.nio.charset.Charset; + +public class WriteIncrement { + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + + public static void writeIncrement(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "mobile-time-series"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + // Get an existing row that has a cell with an incrementable value. A value can be incremented + // if it is encoded as a 64-bit big-endian signed integer. + String rowkey = "phone#4c410523#20190501"; + ReadModifyWriteRow mutation = + ReadModifyWriteRow.create(TableId.of(tableId), rowkey) + .increment(COLUMN_FAMILY_NAME, "connected_cell", -1); + Row success = dataClient.readModifyWriteRow(mutation); + + System.out.printf( + "Successfully updated row %s", success.getKey().toString(Charset.defaultCharset())); + } catch (Exception e) { + System.out.println("Error during WriteIncrement: \n" + e.toString()); + } + } +} + +// [END bigtable_writes_increment] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java new file mode 100644 index 000000000000..f17670343284 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java @@ -0,0 +1,62 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +// [START bigtable_writes_simple] + +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.protobuf.ByteString; + +public class WriteSimple { + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + + public static void writeSimple(String projectId, String instanceId, String tableId) { + // String projectId = "my-project-id"; + // String instanceId = "my-instance-id"; + // String tableId = "mobile-time-series"; + + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + long timestamp = System.currentTimeMillis() * 1000; + + String rowkey = "phone#4c410523#20190501"; + + RowMutation rowMutation = + RowMutation.create(TableId.of(tableId), rowkey) + .setCell( + COLUMN_FAMILY_NAME, + ByteString.copyFrom("connected_cell".getBytes()), + timestamp, + 1) + .setCell( + COLUMN_FAMILY_NAME, + ByteString.copyFrom("connected_wifi".getBytes()), + timestamp, + 1) + .setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "PQ2A.190405.003"); + + dataClient.mutateRow(rowMutation); + System.out.printf("Successfully wrote row %s", rowkey); + + } catch (Exception e) { + System.out.println("Error during WriteSimple: \n" + e.toString()); + } + } +} + +// [END bigtable_writes_simple] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java new file mode 100644 index 000000000000..590a618f0bae --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_streaming_and_batching] +import com.google.api.gax.batching.Batcher; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +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.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; + +public class BatchDeleteExample { + public void batchDelete(String projectId, String instanceId, String tableId) + throws InterruptedException, IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + try (Batcher batcher = + dataClient.newBulkMutationBatcher(TableId.of(tableId))) { + ServerStream rows = dataClient.readRows(Query.create(TableId.of(tableId))); + for (Row row : rows) { + batcher.add( + RowMutationEntry.create(row.getKey()).deleteCells("cell_plan", "data_plan_05gb")); + } + // Blocks until mutations are applied on all submitted row entries. + batcher.flush(); + } + } + } +} +// [END bigtable_streaming_and_batching] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java new file mode 100644 index 000000000000..1da173321fcb --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_check_and_mutate] +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.Filters; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; + +public class ConditionalDeleteExample { + public void conditionalDelete(String projectId, String instanceId, String tableId) + throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Filters.Filter condition = Filters.FILTERS.value().exactMatch("PQ2A.190405.004"); + Mutation mutation = Mutation.create().deleteCells("stats_summary", "os_build"); + dataClient.checkAndMutateRow( + ConditionalRowMutation.create(TableId.of(tableId), "phone#4c410523#20190502") + .condition(condition) + .then(mutation)); + } + } +} +// [END bigtable_delete_check_and_mutate] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java new file mode 100644 index 000000000000..e3648fb0a13a --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java @@ -0,0 +1,35 @@ +/* + * Copyright 2023 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_column_family] +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest; +import java.io.IOException; + +public class DeleteColumnFamilyExample { + public void deleteColumnFamily( + String projectId, String instanceId, String tableId, String columnFamily) throws IOException { + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + ModifyColumnFamiliesRequest modifyColumnFamiliesRequest = + ModifyColumnFamiliesRequest.of(tableId).dropFamily(columnFamily); + tableAdminClient.modifyFamilies(modifyColumnFamiliesRequest); + } + } +} +// [END bigtable_delete_column_family] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java new file mode 100644 index 000000000000..0c68168902cf --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_from_column] +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; + +public class DeleteFromColumnExample { + public void deleteFromColumnCells(String projectId, String instanceId, String tableId) + throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Mutation mutation = Mutation.create().deleteCells("cell_plan", "data_plan_01gb"); + dataClient.mutateRow( + RowMutation.create(TableId.of(tableId), "phone#4c410523#20190501", mutation)); + } + } +} +// [END bigtable_delete_from_column] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java new file mode 100644 index 000000000000..64016a6ef0a6 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_from_column_family] +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; + +public class DeleteFromColumnFamilyExample { + public void deleteFromColumnFamily(String projectId, String instanceId, String tableId) + throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + dataClient.mutateRow( + RowMutation.create(TableId.of(tableId), "phone#5c10102#20190501") + .deleteFamily("stats_summary")); + } + } +} +// [END bigtable_delete_from_column_family] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java new file mode 100644 index 000000000000..f1d283722f7e --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_from_row] +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; + +public class DeleteFromRowExample { + public void deleteFromRow(String projectId, String instanceId, String tableId) + throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + Mutation mutation = Mutation.create().deleteRow(); + dataClient.mutateRow( + RowMutation.create(TableId.of(tableId), "phone#4c410523#20190501", mutation)); + } + } +} +// [END bigtable_delete_from_row] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java new file mode 100644 index 000000000000..bdded5fbefe8 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_delete_table] +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import java.io.IOException; + +public class DeleteTableExample { + public void deleteTable(String projectId, String instanceId, String tableId) throws IOException { + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + tableAdminClient.deleteTable(tableId); + } + } +} +// [END bigtable_delete_table] diff --git a/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java new file mode 100644 index 000000000000..0575fb38ec99 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +// [START bigtable_drop_row_range] +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import java.io.IOException; + +public class DropRowRangeExample { + public void dropRowRange(String projectId, String instanceId, String tableId) throws IOException { + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + tableAdminClient.dropRowRange(tableId, "phone#4c410523"); + } + } +} +// [END bigtable_drop_row_range] diff --git a/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/README.md b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/README.md new file mode 100644 index 000000000000..da219f2e6641 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/README.md @@ -0,0 +1,6 @@ +#### To generate SingerProto.java and descriptors.pb file from singer.proto using `protoc` +```shell +cd samples/snippets/src/main/resources/ +protoc --proto_path=com/example/bigtable/ --include_imports --descriptor_set_out=com/example/bigtable/descriptors.pb \ +--java_out=. com/example/bigtable/singer.proto +``` diff --git a/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/SingerProto.java b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/SingerProto.java new file mode 100644 index 000000000000..8f1ed90d1271 --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/SingerProto.java @@ -0,0 +1,1248 @@ +/* + * Copyright 2025 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. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: singer.proto +// Protobuf Java Version: 4.32.0 + +package com.example.bigtable; + +@com.google.protobuf.Generated +public final class SingerProto { + private SingerProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 32, + /* patch= */ 0, + /* suffix= */ "", + SingerProto.class.getName()); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** Protobuf enum {@code examples.bigtable.music.Genre} */ + public enum Genre implements com.google.protobuf.ProtocolMessageEnum { + /** POP = 0; */ + POP(0), + /** JAZZ = 1; */ + JAZZ(1), + /** FOLK = 2; */ + FOLK(2), + /** ROCK = 3; */ + ROCK(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 32, + /* patch= */ 0, + /* suffix= */ "", + Genre.class.getName()); + } + + /** POP = 0; */ + public static final int POP_VALUE = 0; + + /** JAZZ = 1; */ + public static final int JAZZ_VALUE = 1; + + /** FOLK = 2; */ + public static final int FOLK_VALUE = 2; + + /** ROCK = 3; */ + public static final int ROCK_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Genre valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Genre forNumber(int value) { + switch (value) { + case 0: + return POP; + case 1: + return JAZZ; + case 2: + return FOLK; + case 3: + return ROCK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Genre findValueByNumber(int number) { + return Genre.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.example.bigtable.SingerProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Genre[] VALUES = values(); + + public static Genre valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Genre(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:examples.bigtable.music.Genre) + } + + public interface SingerInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:examples.bigtable.music.SingerInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 singer_id = 1; + * + * @return Whether the singerId field is set. + */ + boolean hasSingerId(); + + /** + * optional int64 singer_id = 1; + * + * @return The singerId. + */ + long getSingerId(); + + /** + * optional string birth_date = 2; + * + * @return Whether the birthDate field is set. + */ + boolean hasBirthDate(); + + /** + * optional string birth_date = 2; + * + * @return The birthDate. + */ + java.lang.String getBirthDate(); + + /** + * optional string birth_date = 2; + * + * @return The bytes for birthDate. + */ + com.google.protobuf.ByteString getBirthDateBytes(); + + /** + * optional string nationality = 3; + * + * @return Whether the nationality field is set. + */ + boolean hasNationality(); + + /** + * optional string nationality = 3; + * + * @return The nationality. + */ + java.lang.String getNationality(); + + /** + * optional string nationality = 3; + * + * @return The bytes for nationality. + */ + com.google.protobuf.ByteString getNationalityBytes(); + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return Whether the genre field is set. + */ + boolean hasGenre(); + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The enum numeric value on the wire for genre. + */ + int getGenreValue(); + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The genre. + */ + com.example.bigtable.SingerProto.Genre getGenre(); + } + + /** Protobuf type {@code examples.bigtable.music.SingerInfo} */ + public static final class SingerInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:examples.bigtable.music.SingerInfo) + SingerInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 32, + /* patch= */ 0, + /* suffix= */ "", + SingerInfo.class.getName()); + } + + // Use SingerInfo.newBuilder() to construct. + private SingerInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SingerInfo() { + birthDate_ = ""; + nationality_ = ""; + genre_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.example.bigtable.SingerProto + .internal_static_examples_bigtable_music_SingerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.bigtable.SingerProto + .internal_static_examples_bigtable_music_SingerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.bigtable.SingerProto.SingerInfo.class, + com.example.bigtable.SingerProto.SingerInfo.Builder.class); + } + + private int bitField0_; + public static final int SINGER_ID_FIELD_NUMBER = 1; + private long singerId_ = 0L; + + /** + * optional int64 singer_id = 1; + * + * @return Whether the singerId field is set. + */ + @java.lang.Override + public boolean hasSingerId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional int64 singer_id = 1; + * + * @return The singerId. + */ + @java.lang.Override + public long getSingerId() { + return singerId_; + } + + public static final int BIRTH_DATE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object birthDate_ = ""; + + /** + * optional string birth_date = 2; + * + * @return Whether the birthDate field is set. + */ + @java.lang.Override + public boolean hasBirthDate() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string birth_date = 2; + * + * @return The birthDate. + */ + @java.lang.Override + public java.lang.String getBirthDate() { + java.lang.Object ref = birthDate_; + 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(); + birthDate_ = s; + return s; + } + } + + /** + * optional string birth_date = 2; + * + * @return The bytes for birthDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBirthDateBytes() { + java.lang.Object ref = birthDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + birthDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NATIONALITY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nationality_ = ""; + + /** + * optional string nationality = 3; + * + * @return Whether the nationality field is set. + */ + @java.lang.Override + public boolean hasNationality() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional string nationality = 3; + * + * @return The nationality. + */ + @java.lang.Override + public java.lang.String getNationality() { + java.lang.Object ref = nationality_; + 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(); + nationality_ = s; + return s; + } + } + + /** + * optional string nationality = 3; + * + * @return The bytes for nationality. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNationalityBytes() { + java.lang.Object ref = nationality_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nationality_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENRE_FIELD_NUMBER = 4; + private int genre_ = 0; + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return Whether the genre field is set. + */ + @java.lang.Override + public boolean hasGenre() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The enum numeric value on the wire for genre. + */ + @java.lang.Override + public int getGenreValue() { + return genre_; + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The genre. + */ + @java.lang.Override + public com.example.bigtable.SingerProto.Genre getGenre() { + com.example.bigtable.SingerProto.Genre result = + com.example.bigtable.SingerProto.Genre.forNumber(genre_); + return result == null ? com.example.bigtable.SingerProto.Genre.UNRECOGNIZED : result; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, singerId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, birthDate_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nationality_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeEnum(4, genre_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, singerId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, birthDate_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nationality_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, genre_); + } + size += getUnknownFields().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.example.bigtable.SingerProto.SingerInfo)) { + return super.equals(obj); + } + com.example.bigtable.SingerProto.SingerInfo other = + (com.example.bigtable.SingerProto.SingerInfo) obj; + + if (hasSingerId() != other.hasSingerId()) return false; + if (hasSingerId()) { + if (getSingerId() != other.getSingerId()) return false; + } + if (hasBirthDate() != other.hasBirthDate()) return false; + if (hasBirthDate()) { + if (!getBirthDate().equals(other.getBirthDate())) return false; + } + if (hasNationality() != other.hasNationality()) return false; + if (hasNationality()) { + if (!getNationality().equals(other.getNationality())) return false; + } + if (hasGenre() != other.hasGenre()) return false; + if (hasGenre()) { + if (genre_ != other.genre_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSingerId()) { + hash = (37 * hash) + SINGER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSingerId()); + } + if (hasBirthDate()) { + hash = (37 * hash) + BIRTH_DATE_FIELD_NUMBER; + hash = (53 * hash) + getBirthDate().hashCode(); + } + if (hasNationality()) { + hash = (37 * hash) + NATIONALITY_FIELD_NUMBER; + hash = (53 * hash) + getNationality().hashCode(); + } + if (hasGenre()) { + hash = (37 * hash) + GENRE_FIELD_NUMBER; + hash = (53 * hash) + genre_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.example.bigtable.SingerProto.SingerInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.example.bigtable.SingerProto.SingerInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code examples.bigtable.music.SingerInfo} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:examples.bigtable.music.SingerInfo) + com.example.bigtable.SingerProto.SingerInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.example.bigtable.SingerProto + .internal_static_examples_bigtable_music_SingerInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.bigtable.SingerProto + .internal_static_examples_bigtable_music_SingerInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.bigtable.SingerProto.SingerInfo.class, + com.example.bigtable.SingerProto.SingerInfo.Builder.class); + } + + // Construct using com.example.bigtable.SingerProto.SingerInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + singerId_ = 0L; + birthDate_ = ""; + nationality_ = ""; + genre_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.example.bigtable.SingerProto + .internal_static_examples_bigtable_music_SingerInfo_descriptor; + } + + @java.lang.Override + public com.example.bigtable.SingerProto.SingerInfo getDefaultInstanceForType() { + return com.example.bigtable.SingerProto.SingerInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.example.bigtable.SingerProto.SingerInfo build() { + com.example.bigtable.SingerProto.SingerInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.bigtable.SingerProto.SingerInfo buildPartial() { + com.example.bigtable.SingerProto.SingerInfo result = + new com.example.bigtable.SingerProto.SingerInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.bigtable.SingerProto.SingerInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.singerId_ = singerId_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.birthDate_ = birthDate_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nationality_ = nationality_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.genre_ = genre_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.bigtable.SingerProto.SingerInfo) { + return mergeFrom((com.example.bigtable.SingerProto.SingerInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.bigtable.SingerProto.SingerInfo other) { + if (other == com.example.bigtable.SingerProto.SingerInfo.getDefaultInstance()) return this; + if (other.hasSingerId()) { + setSingerId(other.getSingerId()); + } + if (other.hasBirthDate()) { + birthDate_ = other.birthDate_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasNationality()) { + nationality_ = other.nationality_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasGenre()) { + setGenreValue(other.getGenreValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + singerId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + birthDate_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + nationality_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + genre_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long singerId_; + + /** + * optional int64 singer_id = 1; + * + * @return Whether the singerId field is set. + */ + @java.lang.Override + public boolean hasSingerId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional int64 singer_id = 1; + * + * @return The singerId. + */ + @java.lang.Override + public long getSingerId() { + return singerId_; + } + + /** + * optional int64 singer_id = 1; + * + * @param value The singerId to set. + * @return This builder for chaining. + */ + public Builder setSingerId(long value) { + + singerId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * optional int64 singer_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearSingerId() { + bitField0_ = (bitField0_ & ~0x00000001); + singerId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object birthDate_ = ""; + + /** + * optional string birth_date = 2; + * + * @return Whether the birthDate field is set. + */ + public boolean hasBirthDate() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string birth_date = 2; + * + * @return The birthDate. + */ + public java.lang.String getBirthDate() { + java.lang.Object ref = birthDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + birthDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string birth_date = 2; + * + * @return The bytes for birthDate. + */ + public com.google.protobuf.ByteString getBirthDateBytes() { + java.lang.Object ref = birthDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + birthDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string birth_date = 2; + * + * @param value The birthDate to set. + * @return This builder for chaining. + */ + public Builder setBirthDate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + birthDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * optional string birth_date = 2; + * + * @return This builder for chaining. + */ + public Builder clearBirthDate() { + birthDate_ = getDefaultInstance().getBirthDate(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * optional string birth_date = 2; + * + * @param value The bytes for birthDate to set. + * @return This builder for chaining. + */ + public Builder setBirthDateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + birthDate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object nationality_ = ""; + + /** + * optional string nationality = 3; + * + * @return Whether the nationality field is set. + */ + public boolean hasNationality() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional string nationality = 3; + * + * @return The nationality. + */ + public java.lang.String getNationality() { + java.lang.Object ref = nationality_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nationality_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string nationality = 3; + * + * @return The bytes for nationality. + */ + public com.google.protobuf.ByteString getNationalityBytes() { + java.lang.Object ref = nationality_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nationality_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string nationality = 3; + * + * @param value The nationality to set. + * @return This builder for chaining. + */ + public Builder setNationality(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nationality_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * optional string nationality = 3; + * + * @return This builder for chaining. + */ + public Builder clearNationality() { + nationality_ = getDefaultInstance().getNationality(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * optional string nationality = 3; + * + * @param value The bytes for nationality to set. + * @return This builder for chaining. + */ + public Builder setNationalityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nationality_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int genre_ = 0; + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return Whether the genre field is set. + */ + @java.lang.Override + public boolean hasGenre() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The enum numeric value on the wire for genre. + */ + @java.lang.Override + public int getGenreValue() { + return genre_; + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @param value The enum numeric value on the wire for genre to set. + * @return This builder for chaining. + */ + public Builder setGenreValue(int value) { + genre_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return The genre. + */ + @java.lang.Override + public com.example.bigtable.SingerProto.Genre getGenre() { + com.example.bigtable.SingerProto.Genre result = + com.example.bigtable.SingerProto.Genre.forNumber(genre_); + return result == null ? com.example.bigtable.SingerProto.Genre.UNRECOGNIZED : result; + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @param value The genre to set. + * @return This builder for chaining. + */ + public Builder setGenre(com.example.bigtable.SingerProto.Genre value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + genre_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * optional .examples.bigtable.music.Genre genre = 4; + * + * @return This builder for chaining. + */ + public Builder clearGenre() { + bitField0_ = (bitField0_ & ~0x00000008); + genre_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:examples.bigtable.music.SingerInfo) + } + + // @@protoc_insertion_point(class_scope:examples.bigtable.music.SingerInfo) + private static final com.example.bigtable.SingerProto.SingerInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.example.bigtable.SingerProto.SingerInfo(); + } + + public static com.example.bigtable.SingerProto.SingerInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingerInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.example.bigtable.SingerProto.SingerInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_examples_bigtable_music_SingerInfo_descriptor; + private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_examples_bigtable_music_SingerInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "\014singer.proto\022\027examples.bigtable.music\"\302\001\n\n" + + "SingerInfo\022\026\n" + + "\tsinger_id\030\001 \001(\003H\000\210\001\001\022\027\n\n" + + "birth_date\030\002 \001(\tH\001\210\001\001\022\030\n" + + "\013nationality\030\003 \001(\tH\002\210\001\001\0222\n" + + "\005genre\030\004" + + " \001(\0162\036.examples.bigtable.music.GenreH\003\210\001\001B\014\n\n" + + "_singer_idB\r\n" + + "\013_birth_dateB\016\n" + + "\014_nationalityB\010\n" + + "\006_genre*.\n" + + "\005Genre\022\007\n" + + "\003POP\020\000\022\010\n" + + "\004JAZZ\020\001\022\010\n" + + "\004FOLK\020\002\022\010\n" + + "\004ROCK\020\003B%\n" + + "\024com.example.bigtableB\013SingerProtoP\000b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_examples_bigtable_music_SingerInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_examples_bigtable_music_SingerInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_examples_bigtable_music_SingerInfo_descriptor, + new java.lang.String[] { + "SingerId", "BirthDate", "Nationality", "Genre", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb new file mode 100644 index 000000000000..c8726c608485 Binary files /dev/null and b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb differ diff --git a/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/singer.proto b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/singer.proto new file mode 100644 index 000000000000..8d697fdfd9fe --- /dev/null +++ b/java-bigtable/samples/snippets/src/main/resources/com/example/bigtable/singer.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package examples.bigtable.music; + +option java_package = "com.example.bigtable"; +option java_outer_classname = "SingerProto"; +option java_multiple_files = false; + +message SingerInfo { + optional int64 singer_id = 1; + optional string birth_date = 2; + optional string nationality = 3; + optional Genre genre = 4; +} + +enum Genre { + POP = 0; + JAZZ = 1; + FOLK = 2; + ROCK = 3; +} \ No newline at end of file diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/AuthorizedViewExampleTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/AuthorizedViewExampleTest.java new file mode 100644 index 000000000000..5990d66107af --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/AuthorizedViewExampleTest.java @@ -0,0 +1,210 @@ +/* + * Copyright 2024 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.AuthorizedView; +import com.google.cloud.bigtable.admin.v2.models.CreateAuthorizedViewRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.FamilySubsets; +import com.google.cloud.bigtable.admin.v2.models.SubsetView; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class AuthorizedViewExampleTest extends BigtableBaseTest { + + private static final String TABLE_PREFIX = "table"; + private static final String AUTHORIZED_VIEW_PREFIX = "authorized-view"; + private static final String COLUMN_FAMILY = "cf"; + private String tableId; + private String authorizedViewId; + private static BigtableDataClient dataClient; + private static BigtableTableAdminClient adminClient; + private AuthorizedViewExample authorizedViewExample; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + dataClient = BigtableDataClient.create(settings); + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + @AfterClass + public static void afterClass() { + garbageCollect(); + dataClient.close(); + adminClient.close(); + } + + @Before + public void setup() throws IOException { + tableId = generateResourceId(TABLE_PREFIX); + authorizedViewId = generateResourceId(AUTHORIZED_VIEW_PREFIX); + authorizedViewExample = + new AuthorizedViewExample(projectId, instanceId, tableId, authorizedViewId); + adminClient.createTable(CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY)); + adminClient.createAuthorizedView( + CreateAuthorizedViewRequest.of(tableId, authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix("") + .setFamilySubsets( + COLUMN_FAMILY, FamilySubsets.create().addQualifierPrefix("")))); + } + + @After + public void after() { + if (adminClient.exists(tableId)) { + // Deleting a table also deletes all the authorized views inside it. + adminClient.deleteTable(tableId); + } + authorizedViewExample.close(); + } + + @Test + public void testRunDoesNotFail() { + authorizedViewExample.run(); + } + + @Test + public void testAuthorizedViewCreateUpdateDelete() throws IOException { + // Creates an authorized view. + String testAuthorizedViewId = generateResourceId(AUTHORIZED_VIEW_PREFIX); + AuthorizedViewExample testAuthorizedViewExample = + new AuthorizedViewExample(projectId, instanceId, tableId, testAuthorizedViewId); + testAuthorizedViewExample.createAuthorizedView(); + AuthorizedView authorizedView = adminClient.getAuthorizedView(tableId, testAuthorizedViewId); + assertEquals(authorizedView.getId(), testAuthorizedViewId); + + // Updates the authorized view. + testAuthorizedViewExample.updateAuthorizedView(); + AuthorizedView updatedAuthorizedView = + adminClient.getAuthorizedView(tableId, testAuthorizedViewId); + assertNotEquals(authorizedView, updatedAuthorizedView); + + // Deletes the authorized view. + testAuthorizedViewExample.deleteAuthorizedView(); + assertThrows( + NotFoundException.class, + () -> adminClient.getAuthorizedView(tableId, testAuthorizedViewId)); + + testAuthorizedViewExample.close(); + } + + @Test + public void testGetAuthorizedView() { + AuthorizedView authorizedView = authorizedViewExample.getAuthorizedView(); + assertNotNull(authorizedView); + assertEquals(authorizedView.getId(), authorizedViewId); + } + + @Test + public void testListAuthorizedView() { + List authorizedViewIds = authorizedViewExample.listAllAuthorizedViews(); + assertEquals(authorizedViewIds.size(), 1); + assertEquals(authorizedViewIds.get(0), authorizedViewId); + } + + @Test + public void testWriteToAuthorizedView() { + assertNull(dataClient.readRow(AuthorizedViewId.of(tableId, authorizedViewId), "rowKey0")); + authorizedViewExample.writeToAuthorizedView(); + assertNotNull(dataClient.readRow(AuthorizedViewId.of(tableId, authorizedViewId), "rowKey0")); + } + + @Test + public void testReadsFromAuthorizedView() { + authorizedViewExample.writeToAuthorizedView(); + + Row actualRow = authorizedViewExample.readSingleRowFromAuthorizedView(); + assertEquals("rowKey0", actualRow.getKey().toStringUtf8()); + assertEquals(2, actualRow.getCells().size()); + assertEquals("Hello World!", actualRow.getCells().get(0).getValue().toStringUtf8()); + assertEquals("World", actualRow.getCells().get(1).getValue().toStringUtf8()); + + List rows = authorizedViewExample.readRowsWithFilterFromAuthorizedView(); + List printedRows = new ArrayList<>(); + for (Row row : rows) { + for (RowCell cell : row.getCells()) { + printedRows.add( + String.format( + "%s_%s_%s:%s", + row.getKey().toStringUtf8(), + cell.getFamily(), + cell.getQualifier().toStringUtf8(), + cell.getValue().toStringUtf8())); + } + } + String[] expectedRows = + new String[] { + "rowKey0_cf_greeting:Hello World!", + "rowKey0_cf_name:World", + "rowKey1_cf_greeting:Hello Bigtable!", + "rowKey1_cf_name:Bigtable", + "rowKey2_cf_greeting:Hello Java!", + "rowKey2_cf_name:Java" + }; + assertEquals(printedRows, Arrays.asList(expectedRows)); + } + + private static void garbageCollect() { + Pattern timestampPattern = Pattern.compile(TABLE_PREFIX + "-([0-9a-f]+)-([0-9a-f]+)"); + for (String tableId : adminClient.listTables()) { + Matcher matcher = timestampPattern.matcher(tableId); + if (!matcher.matches()) { + continue; + } + String timestampStr = matcher.group(1); + long timestamp = Long.parseLong(timestampStr, 16); + if (System.currentTimeMillis() - timestamp < TimeUnit.MINUTES.toMillis(10)) { + continue; + } + System.out.println("\nGarbage collecting orphaned table: " + tableId); + adminClient.deleteTable(tableId); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java new file mode 100644 index 000000000000..5a4475e89891 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java @@ -0,0 +1,66 @@ +/* + * 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 + * + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; + +public class BigtableBaseTest { + + // Environment variables + public static String projectId; + public static String instanceId; + + // Test output stream + private static PrintStream originalOut; + public ByteArrayOutputStream bout; + + private static String requireEnv(String varName) { + String value = System.getenv(varName); + assertNotNull( + String.format("Environment variable '%s' is required to perform these tests.", varName), + value); + return value; + } + + @Before + public void setupStream() { + originalOut = System.out; + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + } + + @After + public void tearDown() { + System.setOut(originalOut); + bout.reset(); + } + + public static String generateResourceId(String prefix) { + return prefix + "-" + UUID.randomUUID().toString().substring(0, 20); + } + + public static void initializeVariables() { + projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); + instanceId = requireEnv("BIGTABLE_TESTING_INSTANCE"); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ConfigureConnectionPoolTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ConfigureConnectionPoolTest.java new file mode 100644 index 000000000000..5af6121a92ad --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ConfigureConnectionPoolTest.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertThat; + +import org.hamcrest.CoreMatchers; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class ConfigureConnectionPoolTest extends BigtableBaseTest { + + @BeforeClass + public static void beforeClass() { + initializeVariables(); + } + + @Test + public void testConfigureConnectionPool() { + ConfigureConnectionPool.configureConnectionPool(projectId, instanceId); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Connected with pool size of 10")); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java new file mode 100644 index 000000000000..f476fb1b2366 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java @@ -0,0 +1,622 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.IOException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class FiltersTest extends MobileTimeSeriesBaseTest { + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); + writeStatsData(); + writePlanData(); + } + + @AfterClass + public static void afterClass() throws IOException { + cleanupTable(); + } + + @Test + public void testFilterRowSample() { + Filters.filterLimitRowSample(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output).contains("Table filter completed."); + } + + @Test + public void testFilterRowRegex() { + Filters.filterLimitRowRegex(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_01gb: true @%2$s\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterCellsPerCol() { + Filters.filterLimitCellsPerCol(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_01gb: true @%2$s\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterCellsPerRow() { + Filters.filterLimitCellsPerRow(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_01gb: true @%2$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterLimitCellsPerRowOffset() { + Filters.filterLimitCellsPerRowOffset(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testFilterColFamilyRegex() { + Filters.filterLimitColFamilyRegex(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testFilterColQualifierRegex() { + Filters.filterLimitColQualifierRegex(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testFilterColRange() { + Filters.filterLimitColRange(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_01gb: true @%2$s\n" + + "\tdata_plan_05gb: true @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterValueRange() { + Filters.filterLimitValueRange(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.004 @%1$s", + TIMESTAMP)); + } + + @Test + public void testFilterValueRegex() { + Filters.filterLimitValueRegex(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testFilterTimestampRange() { + Filters.filterLimitTimestampRange(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: true @%s\n", + TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterBlockAll() { + Filters.filterLimitBlockAll(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output).doesNotContain("Reading data for"); + } + + @Test + public void testFilterPassAll() { + Filters.filterLimitPassAll(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_01gb: true @%2$s\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterStripValue() { + Filters.filterModifyStripValue(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: @%1$s\n" + + "\tdata_plan_01gb: @%2$s\n" + + "\tdata_plan_05gb: @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: @%1$s\n" + + "\tconnected_wifi: @%1$s\n" + + "\tos_build: @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: @%1$s\n" + + "\tconnected_wifi: @%1$s\n" + + "\tos_build: @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: @%1$s\n" + + "\tconnected_wifi: @%1$s\n" + + "\tos_build: @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: @%1$s\n" + + "\tconnected_wifi: @%1$s\n" + + "\tos_build: @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: @%1$s\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: @%1$s\n" + + "\tconnected_wifi: @%1$s\n" + + "\tos_build: @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterApplyLabel() { + Filters.filterModifyApplyLabel(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s [labelled]\n" + + "\tdata_plan_01gb: true @%2$s [labelled]\n" + + "\tdata_plan_05gb: true @%1$s [labelled]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tos_build: PQ2A.190405.003 @%1$s [labelled]\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s [labelled]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tos_build: PQ2A.190405.004 @%1$s [labelled]\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s [labelled]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s " + + "[labelled]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tos_build: PQ2A.190406.000 @%1$s [labelled]\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s [labelled]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tos_build: PQ2A.190401.002 @%1$s [labelled]\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s [labelled]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[labelled]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s " + + "[labelled]\n" + + "\tos_build: PQ2A.190406.000 @%1$s [labelled]", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterChain() { + Filters.filterComposingChain(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s\n" + + "\tdata_plan_05gb: true @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n", + TIMESTAMP)); + } + + @Test + public void testFilterInterleave() { + Filters.filterComposingInterleave(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: true @%2$s\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } + + @Test + public void testFilterCondition() { + Filters.filterComposingCondition(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_01gb: false @%1$s [filtered-out]\n" + + "\tdata_plan_01gb: true @%2$s [filtered-out]\n" + + "\tdata_plan_05gb: true @%1$s [filtered-out]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[filtered-out]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[filtered-out]\n" + + "\tos_build: PQ2A.190405.003 @%1$s [filtered-out]\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s [filtered-out]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[filtered-out]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[filtered-out]\n" + + "\tos_build: PQ2A.190405.004 @%1$s [filtered-out]\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family cell_plan\n" + + "\tdata_plan_05gb: true @%1$s [filtered-out]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s " + + "[filtered-out]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[filtered-out]\n" + + "\tos_build: PQ2A.190406.000 @%1$s [filtered-out]\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s [passed-filter]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[passed-filter]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[passed-filter]\n" + + "\tos_build: PQ2A.190401.002 @%1$s [passed-filter]\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family cell_plan\n" + + "\tdata_plan_10gb: true @%1$s [passed-filter]\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s " + + "[passed-filter]\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s " + + "[passed-filter]\n" + + "\tos_build: PQ2A.190406.000 @%1$s [passed-filter]", + TIMESTAMP, TIMESTAMP_MINUS_HR)); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java new file mode 100644 index 000000000000..ead4d6c3fde7 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java @@ -0,0 +1,144 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; +import java.util.Random; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** Integration tests for {@link HelloWorld} */ +public class HelloWorldTest extends BigtableBaseTest { + + private static final String TABLE_PREFIX = "table"; + private static String tableId; + private static BigtableDataClient dataClient; + private static BigtableTableAdminClient adminClient; + private HelloWorld helloWorld; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + BigtableDataSettings settings = + BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); + dataClient = BigtableDataClient.create(settings); + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + @AfterClass + public static void afterClass() throws Exception { + garbageCollect(); + dataClient.close(); + adminClient.close(); + } + + @Before + public void setup() throws IOException { + tableId = generateTableId(); + helloWorld = new HelloWorld(projectId, instanceId, tableId); + adminClient.createTable(CreateTableRequest.of(tableId).addFamily("cf1")); + } + + @After + public void teardown() { + if (adminClient.exists(tableId)) { + adminClient.deleteTable(tableId); + } + helloWorld.close(); + } + + @Test + public void testCreateAndDeleteTable() throws IOException { + // Creates a table. + String testTable = generateTableId(); + HelloWorld testHelloWorld = new HelloWorld(projectId, instanceId, testTable); + testHelloWorld.createTable(); + assertTrue(adminClient.exists(testTable)); + + // Deletes a table. + testHelloWorld.deleteTable(); + assertTrue(!adminClient.exists(testTable)); + testHelloWorld.close(); + } + + @Test + public void testWriteToTable() { + // Writes to a table. + assertNull(dataClient.readRow(TableId.of(tableId), "rowKey0")); + helloWorld.writeToTable(); + assertNotNull(dataClient.readRow(TableId.of(tableId), "rowKey0")); + } + + @Test + public void testReads() { + assertEquals(0, helloWorld.readTable().size()); + helloWorld.writeToTable(); + + assertEquals(2, helloWorld.readSingleRow().getCells().size()); + assertEquals(1, helloWorld.readSpecificCells().size()); + assertEquals(3, helloWorld.readTable().size()); + } + + @Test + public void testRunDoesNotFail() throws Exception { + helloWorld.run(); + } + + private String generateTableId() { + return String.format( + "%s-%016x-%x", TABLE_PREFIX, System.currentTimeMillis(), new Random().nextLong()); + } + + private static void garbageCollect() { + Pattern timestampPattern = Pattern.compile(TABLE_PREFIX + "-([0-9a-f]+)-([0-9a-f]+)"); + for (String tableId : adminClient.listTables()) { + Matcher matcher = timestampPattern.matcher(tableId); + if (!matcher.matches()) { + continue; + } + String timestampStr = matcher.group(1); + long timestamp = Long.parseLong(timestampStr, 16); + if (System.currentTimeMillis() - timestamp < TimeUnit.MINUTES.toMillis(15)) { + continue; + } + System.out.println("\nGarbage collecting orphaned table: " + tableId); + adminClient.deleteTable(tableId); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java new file mode 100644 index 000000000000..acab4fca7453 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java @@ -0,0 +1,144 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.Instance.Type; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import java.io.IOException; +import java.util.Random; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** Integration tests for {@link InstanceAdminExample} */ +public class InstanceAdminExampleTest extends BigtableBaseTest { + + private static final String ID_PREFIX = "instanceadmin"; + private static final String CLUSTER = "cluster"; + private static BigtableInstanceAdminClient adminClient; + private String clusterId; + private InstanceAdminExample instanceAdmin; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + BigtableInstanceAdminSettings instanceAdminSettings = + BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build(); + adminClient = BigtableInstanceAdminClient.create(instanceAdminSettings); + } + + @AfterClass + public static void afterClass() { + garbageCollect(); + adminClient.close(); + } + + @Before + public void setup() throws IOException { + instanceId = generateId(); + clusterId = generateId(); + instanceAdmin = new InstanceAdminExample(projectId, instanceId, clusterId); + adminClient.createInstance( + CreateInstanceRequest.of(instanceId) + .addCluster(clusterId, "us-central1-f", 3, StorageType.SSD) + .setType(Type.PRODUCTION) + .addLabel("example", "instance_admin")); + } + + @After + public void after() { + if (adminClient.exists(instanceId)) { + adminClient.deleteInstance(instanceId); + } + if (instanceAdmin != null) { + instanceAdmin.close(); + } + } + + @Test + public void testCreateAndDeleteInstance() throws IOException { + // Creates an instance. + String testInstance = generateId(); + String testCluster = generateId(); + InstanceAdminExample testInstanceAdmin = + new InstanceAdminExample(projectId, testInstance, testCluster); + testInstanceAdmin.createProdInstance(); + assertTrue(adminClient.exists(testInstance)); + + // Deletes an instance. + testInstanceAdmin.deleteInstance(); + assertFalse(adminClient.exists(testInstance)); + } + + @Test + public void testGetInstance() { + // Gets an instance. + com.google.bigtable.admin.v2.Instance instance = instanceAdmin.getInstance(); + assertNotNull(instance); + } + + @Test(expected = NotFoundException.class) + public void testAddAndDeleteCluster() { + // Adds a cluster. + instanceAdmin.addCluster(); + com.google.cloud.bigtable.admin.v2.models.Cluster cluster = + adminClient.getCluster(instanceId, CLUSTER); + assertNotNull(cluster); + + // Deletes a cluster. + instanceAdmin.deleteCluster(); + adminClient.getCluster(instanceId, CLUSTER); + } + + // TODO: add test for instanceAdmin.listInstances() + // TODO: and test for instanceAdmin.listClusters() + + @Test + public void testRunDoesNotFail() { + instanceAdmin.run(); + } + + private static String generateId() { + return String.format("%s-%x", ID_PREFIX, new Random().nextInt()); + } + + private static void garbageCollect() { + Pattern timestampPattern = Pattern.compile(ID_PREFIX + "-([0-9a-f]+)"); + System.out.println(); + for (com.google.cloud.bigtable.admin.v2.models.Instance instance : + adminClient.listInstances()) { + Matcher matcher = timestampPattern.matcher(instance.getId()); + if (!matcher.matches()) { + continue; + } + System.out.println("Garbage collecting orphaned table: " + instance); + adminClient.deleteInstance(instance.getId()); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/KeySaltingTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/KeySaltingTest.java new file mode 100644 index 000000000000..085d992cea9b --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/KeySaltingTest.java @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class KeySaltingTest extends MobileTimeSeriesBaseTest { + public static final String ROW_KEY = "phone#4c410523#20190501"; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); + } + + @AfterClass + public static void afterClass() throws IOException { + cleanupTable(); + } + + @Test + public void testWriteAndRead() throws IOException { + KeySalting.writeSaltedRow(projectId, instanceId, TABLE_ID, ROW_KEY); + KeySalting.readSaltedRow(projectId, instanceId, TABLE_ID, ROW_KEY); + + String output = bout.toString(); + assertEquals( + "Successfully wrote row phone#4c410523#20190501 as 0-phone#4c410523#20190501\n" + + "Successfully read row 0-phone#4c410523#20190501\n", + output); + } + + @Test + public void testScans() throws IOException, ExecutionException, InterruptedException { + String prefix = "abc-"; + for (int i = 0; i < 8; i++) { + KeySalting.writeSaltedRow(projectId, instanceId, TABLE_ID, prefix + i); + } + bout.reset(); + + KeySalting.scanSaltedRows(projectId, instanceId, TABLE_ID, prefix); + + String output = bout.toString(); + assertEquals( + "Successfully fetched 8 rows\n" + + "Successfully read row 0-abc-3\n" + + "Successfully read row 0-abc-7\n" + + "Successfully read row 1-abc-0\n" + + "Successfully read row 1-abc-4\n" + + "Successfully read row 2-abc-1\n" + + "Successfully read row 2-abc-5\n" + + "Successfully read row 3-abc-2\n" + + "Successfully read row 3-abc-6\n", + output); + } + + @Test + public void testKeySalting() { + Map exampleKeys = new HashMap(); + exampleKeys.put("abc-1", "2-abc-1"); + exampleKeys.put("abc-2", "3-abc-2"); + exampleKeys.put("abc-3", "0-abc-3"); + exampleKeys.put("abc-4", "1-abc-4"); + + exampleKeys.forEach((k, v) -> assertEquals(v, KeySalting.getSaltedRowKey(k, 4))); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java new file mode 100644 index 000000000000..f1a9ae5c01bf --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java @@ -0,0 +1,185 @@ +/* + * 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 + * + * 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. + */ + +package com.example.bigtable; + +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Type; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.Mutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.time.Instant; +import java.time.temporal.ChronoUnit; + +public class MobileTimeSeriesBaseTest extends BigtableBaseTest { + + public static final String TABLE_ID = generateResourceId("mobile-time-series"); + public static final String COLUMN_FAMILY_NAME_STATS = "stats_summary"; + public static final String COLUMN_FAMILY_NAME_PLAN = "cell_plan"; + public static final String COLUMN_FAMILY_NAME_VIEW_COUNT = "view_count"; + public static final Instant CURRENT_TIME = Instant.now(); + public static final long TIMESTAMP = CURRENT_TIME.toEpochMilli() * 1000; + public static final long TIMESTAMP_MINUS_HR = + CURRENT_TIME.minus(1, ChronoUnit.HOURS).toEpochMilli() * 1000; + + public static void createTable() throws IOException { + try (BigtableTableAdminClient adminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + CreateTableRequest createTableRequest = + CreateTableRequest.of(TABLE_ID) + .addFamily(COLUMN_FAMILY_NAME_STATS) + .addFamily(COLUMN_FAMILY_NAME_PLAN) + .addFamily(COLUMN_FAMILY_NAME_VIEW_COUNT, Type.int64Sum()); + adminClient.createTable(createTableRequest); + } catch (IOException e) { + System.out.println("Error during createTable: \n" + e.toString()); + throw (e); + } + } + + public static void writeStatsData() throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + BulkMutation bulkMutation = + BulkMutation.create(TableId.of(TABLE_ID)) + .add( + "phone#4c410523#20190501", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_cell".getBytes()), + TIMESTAMP, + 1) + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_wifi".getBytes()), + TIMESTAMP, + 1) + .setCell(COLUMN_FAMILY_NAME_STATS, "os_build", TIMESTAMP, "PQ2A.190405.003")) + .add( + "phone#4c410523#20190502", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_cell".getBytes()), + TIMESTAMP, + 1) + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_wifi".getBytes()), + TIMESTAMP, + 1) + .setCell(COLUMN_FAMILY_NAME_STATS, "os_build", TIMESTAMP, "PQ2A.190405.004")) + .add( + "phone#4c410523#20190505", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_cell".getBytes()), + TIMESTAMP, + 0) + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_wifi".getBytes()), + TIMESTAMP, + 1) + .setCell(COLUMN_FAMILY_NAME_STATS, "os_build", TIMESTAMP, "PQ2A.190406.000")) + .add( + "phone#5c10102#20190501", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_cell".getBytes()), + TIMESTAMP, + 1) + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_wifi".getBytes()), + TIMESTAMP, + 1) + .setCell(COLUMN_FAMILY_NAME_STATS, "os_build", TIMESTAMP, "PQ2A.190401.002")) + .add( + "phone#5c10102#20190502", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_cell".getBytes()), + TIMESTAMP, + 1) + .setCell( + COLUMN_FAMILY_NAME_STATS, + ByteString.copyFrom("connected_wifi".getBytes()), + TIMESTAMP, + 0) + .setCell(COLUMN_FAMILY_NAME_STATS, "os_build", TIMESTAMP, "PQ2A.190406.000")); + + dataClient.bulkMutateRows(bulkMutation); + } catch (IOException e) { + System.out.println("Error during writeTestData: \n" + e.toString()); + throw (e); + } + } + + public static void writePlanData() throws IOException { + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + BulkMutation bulkMutation = + BulkMutation.create(TableId.of(TABLE_ID)) + .add( + "phone#4c410523#20190501", + Mutation.create() + .setCell( + COLUMN_FAMILY_NAME_PLAN, "data_plan_01gb", TIMESTAMP_MINUS_HR, "true") + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_01gb", TIMESTAMP, "false") + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_05gb", TIMESTAMP, "true")) + .add( + "phone#4c410523#20190502", + Mutation.create() + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_05gb", TIMESTAMP, "true")) + .add( + "phone#4c410523#20190505", + Mutation.create() + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_05gb", TIMESTAMP, "true")) + .add( + "phone#5c10102#20190501", + Mutation.create() + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_10gb", TIMESTAMP, "true")) + .add( + "phone#5c10102#20190502", + Mutation.create() + .setCell(COLUMN_FAMILY_NAME_PLAN, "data_plan_10gb", TIMESTAMP, "true")); + + dataClient.bulkMutateRows(bulkMutation); + } catch (IOException e) { + System.out.println("Error during writeTestData: \n" + e.toString()); + throw (e); + } + } + + public static void cleanupTable() throws IOException { + try (BigtableTableAdminClient adminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + if (adminClient.exists(TABLE_ID)) { + adminClient.deleteTable(TABLE_ID); + } + } catch (Exception e) { + System.out.println("Error during afterClass: \n" + e.toString()); + throw (e); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java new file mode 100644 index 000000000000..b8271de50e89 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertThat; + +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import java.io.IOException; +import org.hamcrest.CoreMatchers; +import org.junit.BeforeClass; +import org.junit.Test; + +/** Integration tests for {@link Quickstart} */ +public class QuickstartTest extends BigtableBaseTest { + + private static final String TABLE_ID = "quickstart-table"; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + + // set up required table and row data if not present + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + String columnFamily = "cf1"; + if (!tableAdminClient.exists(TABLE_ID)) { + tableAdminClient.createTable(CreateTableRequest.of(TABLE_ID).addFamily(columnFamily)); + } + try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { + String rowKey = "r1"; + Row row = dataClient.readRow(TableId.of(TABLE_ID), rowKey); + if (row == null) { + dataClient.mutateRow( + RowMutation.create(TableId.of(TABLE_ID), rowKey) + .setCell(columnFamily, "c1", "quickstart")); + } + } + } + } + + @Test + public void testQuickstart() { + Quickstart.quickstart(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Reading a single row by row key")); + assertThat(output, CoreMatchers.containsString("Row: r1")); + assertThat( + output, CoreMatchers.containsString("Family: cf1 Qualifier: c1 Value: quickstart")); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java new file mode 100644 index 000000000000..a8955949799c --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java @@ -0,0 +1,240 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.IOException; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ReadsTest extends MobileTimeSeriesBaseTest { + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); + writeStatsData(); + } + + @AfterClass + public static void afterClass() throws IOException { + cleanupTable(); + } + + @Test + public void testReadRow() { + Reads.readRow(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadRowPartial() { + Reads.readRowPartial(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.003 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadRows() { + Reads.readRows(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadRowRange() { + Reads.readRowRange(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadRowRanges() { + Reads.readRowRanges(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadPrefix() { + Reads.readPrefix(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } + + @Test + public void testReadRowsReversed() { + Reads.readRowsReversed(projectId, instanceId, TABLE_ID); + String output = bout.toString(); + + assertThat(output) + .contains( + String.format( + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tconnected_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 @%1$s\n" + + "\tconnected_wifi: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @%1$s\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n", + TIMESTAMP)); + } + + @Test + public void testReadFilter() { + Reads.readFilter(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output) + .contains( + String.format( + "Reading data for phone#4c410523#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.003 @%1$s\n\n" + + "Reading data for phone#4c410523#20190502\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190405.004 @%1$s\n\n" + + "Reading data for phone#4c410523#20190505\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s\n\n" + + "Reading data for phone#5c10102#20190501\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190401.002 @%1$s\n\n" + + "Reading data for phone#5c10102#20190502\n" + + "Column Family stats_summary\n" + + "\tos_build: PQ2A.190406.000 @%1$s", + TIMESTAMP)); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/SchemaBundleExampleTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/SchemaBundleExampleTest.java new file mode 100644 index 000000000000..c76d1288eb1b --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/SchemaBundleExampleTest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2025 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.SchemaBundle; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class SchemaBundleExampleTest extends BigtableBaseTest { + + private static final String TABLE_PREFIX = "table"; + private static final String SCHEMA_BUNDLE_PREFIX = "schema-bundle"; + private static final String COLUMN_FAMILY = "cf"; + private String tableId; + private String schemaBundleId; + private static BigtableTableAdminClient adminClient; + private SchemaBundleExample schemaBundleExample; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .build(); + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + @AfterClass + public static void afterClass() { + garbageCollect(); + adminClient.close(); + } + + @Before + public void setup() throws IOException { + tableId = generateResourceId(TABLE_PREFIX); + schemaBundleId = generateResourceId(SCHEMA_BUNDLE_PREFIX); + schemaBundleExample = new SchemaBundleExample(projectId, instanceId, tableId, schemaBundleId); + adminClient.createTable(CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY)); + } + + @After + public void after() { + if (adminClient.exists(tableId)) { + adminClient.deleteTable(tableId); + } + schemaBundleExample.close(); + } + + @Test + public void testRunDoesNotFail() { + schemaBundleExample.run(); + } + + @Test + public void testSchemaBundleCreateUpdateDelete() throws IOException { + // Creates a schema bundle. + schemaBundleExample.createSchemaBundle(); + SchemaBundle schemaBundle = adminClient.getSchemaBundle(tableId, schemaBundleId); + assertEquals(schemaBundle.getId(), schemaBundleId); + + // Updates the schema bundle. + schemaBundleExample.updateSchemaBundle(); + SchemaBundle updatedSchemaBundle = adminClient.getSchemaBundle(tableId, schemaBundleId); + assertNotEquals(schemaBundle, updatedSchemaBundle); + + // Deletes the schema bundle. + schemaBundleExample.deleteSchemaBundle(); + assertThrows( + NotFoundException.class, () -> adminClient.getSchemaBundle(tableId, schemaBundleId)); + } + + @Test + public void testGetSchemaBundle() { + schemaBundleExample.createSchemaBundle(); + SchemaBundle schemaBundle = schemaBundleExample.getSchemaBundle(); + assertNotNull(schemaBundle); + assertEquals(schemaBundle.getId(), schemaBundleId); + } + + @Test + public void testListSchemaBundles() { + schemaBundleExample.createSchemaBundle(); + List schemaBundleIds = schemaBundleExample.listAllSchemaBundles(); + assertEquals(schemaBundleIds.size(), 1); + assertEquals(schemaBundleIds.get(0), schemaBundleId); + } + + private static void garbageCollect() { + Pattern timestampPattern = Pattern.compile(TABLE_PREFIX + "-([0-9a-f]+)-([0-9a-f]+)"); + for (String tableId : adminClient.listTables()) { + Matcher matcher = timestampPattern.matcher(tableId); + if (!matcher.matches()) { + continue; + } + String timestampStr = matcher.group(1); + long timestamp = Long.parseLong(timestampStr, 16); + if (System.currentTimeMillis() - timestamp < TimeUnit.MINUTES.toMillis(10)) { + continue; + } + System.out.println("\nGarbage collecting orphaned table: " + tableId); + adminClient.deleteTable(tableId); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java new file mode 100644 index 000000000000..d4fd4de3049f --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java @@ -0,0 +1,207 @@ +/* + * Copyright 2019 Google Inc. + * + * 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. + */ + +package com.example.bigtable; + +import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.ColumnFamily; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.GCRules.DurationRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.IntersectionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.UnionRule; +import com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** Integration tests for {@link TableAdminExample} */ +public class TableAdminExampleTest extends BigtableBaseTest { + + private static final String TABLE_PREFIX = "table"; + private static BigtableTableAdminClient adminClient; + private String tableId; + private TableAdminExample tableAdmin; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + BigtableTableAdminSettings adminSettings = + BigtableTableAdminSettings.newBuilder() + .setInstanceId(instanceId) + .setProjectId(projectId) + .build(); + adminClient = BigtableTableAdminClient.create(adminSettings); + } + + @AfterClass + public static void afterClass() { + garbageCollect(); + adminClient.close(); + } + + @Before + public void setup() throws IOException { + tableId = generateResourceId(TABLE_PREFIX); + tableAdmin = new TableAdminExample(projectId, instanceId, tableId); + adminClient.createTable(CreateTableRequest.of(tableId).addFamily("cf")); + } + + @After + public void after() { + if (adminClient.exists(tableId)) { + adminClient.deleteTable(tableId); + } + if (tableAdmin != null) { + tableAdmin.close(); + } + } + + @Test + public void testCreateAndDeleteTable() throws IOException { + // Creates a table. + String testTable = generateResourceId(TABLE_PREFIX); + TableAdminExample testTableAdmin = new TableAdminExample(projectId, instanceId, testTable); + testTableAdmin.createTable(); + assertTrue(adminClient.exists(testTable)); + + // Deletes a table. + testTableAdmin.deleteTable(); + assertFalse(adminClient.exists(testTable)); + } + + @Test + public void testCreateMaxAgeRuleAndModifyAndPrintColumnFamily() { + // Max age rule + tableAdmin.addFamilyWithMaxAgeRule(); + DurationRule maxAgeCondition = GCRULES.maxAge(5, TimeUnit.DAYS); + boolean maxAgeRule = ruleCheck(maxAgeCondition); + assertTrue(maxAgeRule); + + // Modifies cf1. + tableAdmin.modifyColumnFamilyRule(); + GCRule modifiedRule = GCRULES.maxVersions(1); + boolean maxVersionRule = ruleCheck(modifiedRule); + assertTrue(maxVersionRule); + } + + @Test + public void testCreateMaxVersionsRuleAndDeleteColumnFamily() { + // Max versions rule + tableAdmin.addFamilyWithMaxVersionsRule(); + VersionRule maxVersionCondition = GCRULES.maxVersions(2); + boolean maxVersionRule = ruleCheck(maxVersionCondition); + assertTrue(maxVersionRule); + + // Deletes cf2. + tableAdmin.deleteColumnFamily(); + boolean found = true; + List columnFamilies = adminClient.getTable(tableId).getColumnFamilies(); + for (ColumnFamily columnFamily : columnFamilies) { + if (columnFamily.equals("cf2")) { + found = false; + break; + } + } + assertTrue(found); + } + + @Test + public void testCreateUnionRule() { + // Union rule + tableAdmin.addFamilyWithUnionRule(); + DurationRule maxAgeRule = GCRULES.maxAge(5, TimeUnit.DAYS); + VersionRule versionRule = GCRULES.maxVersions(1); + UnionRule unionCondition = GCRULES.union().rule(maxAgeRule).rule(versionRule); + boolean unionRule = ruleCheck(unionCondition); + assertTrue(unionRule); + } + + @Test + public void testCreateIntersectionRule() { + // Intersection rule + tableAdmin.addFamilyWithIntersectionRule(); + DurationRule maxAgeRule = GCRULES.maxAge(5, TimeUnit.DAYS); + VersionRule versionRule = GCRULES.maxVersions(2); + IntersectionRule intersectionCondition = + GCRULES.intersection().rule(maxAgeRule).rule(versionRule); + boolean intersectionRule = ruleCheck(intersectionCondition); + assertTrue(intersectionRule); + } + + @Test + public void testCreateNestedRule() { + // Nested rule + tableAdmin.addFamilyWithNestedRule(); + VersionRule versionRule = GCRULES.maxVersions(10); + DurationRule maxAgeRule = GCRULES.maxAge(30, TimeUnit.DAYS); + VersionRule versionRule2 = GCRULES.maxVersions(2); + IntersectionRule intersectionRule = GCRULES.intersection().rule(maxAgeRule).rule(versionRule2); + UnionRule nestedCondition = GCRULES.union().rule(intersectionRule).rule(versionRule); + boolean nestedRule = ruleCheck(nestedCondition); + assertTrue(nestedRule); + } + + @Test + public void testRunDoesNotFail() { + tableAdmin.run(); + } + + // TODO: add test for tableAdmin.listAllTables() + // TODO: add test for tableAdmin.getTableMeta() + // TODO: add test for tableAdmin.listColumnFamilies() + + private boolean ruleCheck(GCRule condition) { + boolean found = false; + List columnFamilies = adminClient.getTable(tableId).getColumnFamilies(); + for (ColumnFamily columnFamily : columnFamilies) { + if (columnFamily.getGCRule().equals(condition)) { + found = true; + break; + } + } + return found; + } + + private static void garbageCollect() { + Pattern timestampPattern = Pattern.compile(TABLE_PREFIX + "-([0-9a-f]+)-([0-9a-f]+)"); + for (String tableId : adminClient.listTables()) { + Matcher matcher = timestampPattern.matcher(tableId); + if (!matcher.matches()) { + continue; + } + String timestampStr = matcher.group(1); + long timestamp = Long.parseLong(timestampStr, 16); + if (System.currentTimeMillis() - timestamp < TimeUnit.MINUTES.toMillis(10)) { + continue; + } + System.out.println("\nGarbage collecting orphaned table: " + tableId); + adminClient.deleteTable(tableId); + } + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java new file mode 100644 index 000000000000..ac6a09b4ef13 --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019 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. + */ + +package com.example.bigtable; + +import static org.junit.Assert.assertThat; + +import java.io.IOException; +import org.hamcrest.CoreMatchers; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class WritesTest extends MobileTimeSeriesBaseTest { + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); + } + + @AfterClass + public static void afterClass() throws IOException { + cleanupTable(); + } + + @Test + public void test1_WriteSimple() { + WriteSimple.writeSimple(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Successfully wrote row")); + } + + @Test + public void test2_WriteBatch() { + WriteBatch.writeBatch(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Successfully wrote 2 rows")); + } + + @Test + public void test3_WriteConditionally() { + WriteConditionally.writeConditionally(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Successfully updated row's os_name: true")); + } + + @Test + public void test4_WriteIncrement() { + WriteIncrement.writeIncrement(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString("Successfully updated row phone#4c410523#20190501")); + } + + @Test + public void test5_WriteAggregate() { + WriteAggregate.writeAggregate(projectId, instanceId, TABLE_ID); + + String output = bout.toString(); + assertThat(output, CoreMatchers.containsString("Successfully wrote row page#index.html")); + } +} diff --git a/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java new file mode 100644 index 000000000000..308607c891af --- /dev/null +++ b/java-bigtable/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java @@ -0,0 +1,197 @@ +/* + * 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. + */ + +package com.example.bigtable.deletes; + +import com.example.bigtable.MobileTimeSeriesBaseTest; +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.ColumnFamily; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +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.TableId; +import com.google.common.truth.Correspondence; +import com.google.common.truth.Truth; +import java.io.IOException; +import java.util.List; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/* + * These tests are order dependent because they delete rows and cells from a table. + * They are prefixed with `testN_` to signal the order in which they should run. + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class DeletesTest extends MobileTimeSeriesBaseTest { + private static final Correspondence COLUMN_FAMILY_ID_CORRESPONDENCE = + Correspondence.transforming(ColumnFamily::getId, "ColumnFamily id"); + public static BigtableDataClient bigtableDataClient; + + @BeforeClass + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); + writeStatsData(); + writePlanData(); + bigtableDataClient = BigtableDataClient.create(projectId, instanceId); + } + + @AfterClass + public static void afterClass() throws IOException { + cleanupTable(); + } + + @Test + public void test1_testDeleteFromColumn() throws IOException { + String rowKey = "phone#4c410523#20190501"; + Row row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + String qualifier = "data_plan_01gb"; + List cells = row.getCells(COLUMN_FAMILY_NAME_PLAN, qualifier); + + Truth.assertThat(cells).isNotEmpty(); + + DeleteFromColumnExample deleteFromColumnExample = new DeleteFromColumnExample(); + deleteFromColumnExample.deleteFromColumnCells(projectId, instanceId, TABLE_ID); + row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + List cellsAfterDelete = row.getCells(COLUMN_FAMILY_NAME_PLAN, qualifier); + + Truth.assertThat(cellsAfterDelete).isEmpty(); + } + + @Test + public void test2_testDeleteFromRow() throws IOException { + String rowKey = "phone#4c410523#20190501"; + Row row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + + Truth.assertThat(row).isNotNull(); + + DeleteFromRowExample deleteFromRowExample = new DeleteFromRowExample(); + deleteFromRowExample.deleteFromRow(projectId, instanceId, TABLE_ID); + row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + + Truth.assertThat(row).isNull(); + } + + @Test + public void test3_testStreamingAndBatching() throws IOException, InterruptedException { + String rowKey = "phone#4c410523#20190502"; + Row row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + String qualifier = "data_plan_05gb"; + List cells = row.getCells(COLUMN_FAMILY_NAME_PLAN, qualifier); + + Truth.assertThat(cells).isNotEmpty(); + + BatchDeleteExample batchDeleteExample = new BatchDeleteExample(); + batchDeleteExample.batchDelete(projectId, instanceId, TABLE_ID); + row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + List cellsAfterDelete = row.getCells(COLUMN_FAMILY_NAME_PLAN, qualifier); + + Truth.assertThat(cellsAfterDelete).isEmpty(); + } + + @Test + public void test4_testCheckAndMutate() throws IOException { + String rowKey = "phone#4c410523#20190502"; + Row row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + String qualifier = "os_build"; + List cells = row.getCells(COLUMN_FAMILY_NAME_STATS, qualifier); + + Truth.assertThat(cells).isNotEmpty(); + + ConditionalDeleteExample conditionalDeleteExample = new ConditionalDeleteExample(); + conditionalDeleteExample.conditionalDelete(projectId, instanceId, TABLE_ID); + row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + List cellsAfterDelete = row.getCells(COLUMN_FAMILY_NAME_STATS, qualifier); + + Truth.assertThat(cellsAfterDelete).isEmpty(); + } + + @Test + public void test5_testDropRowRange() throws IOException { + String rowPrefix = "phone#4c410523"; + Query query = Query.create(TableId.of(TABLE_ID)).prefix(rowPrefix); + ServerStream rows = bigtableDataClient.readRows(query); + int rowCount = 0; + for (Row ignored : rows) { + rowCount++; + } + + Truth.assertThat(rowCount).isGreaterThan(1); + + DropRowRangeExample dropRowRangeExample = new DropRowRangeExample(); + dropRowRangeExample.dropRowRange(projectId, instanceId, TABLE_ID); + rows = bigtableDataClient.readRows(query); + rowCount = 0; + for (Row ignored : rows) { + rowCount++; + } + + Truth.assertThat(rowCount).isEqualTo(0); + } + + @Test + public void test6_testDeleteFromColumnFamily() throws IOException { + String rowKey = "phone#5c10102#20190501"; + Row row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + List cells = row.getCells(COLUMN_FAMILY_NAME_STATS); + + Truth.assertThat(cells).isNotEmpty(); + + DeleteFromColumnFamilyExample deleteFromColumnFamilyExample = + new DeleteFromColumnFamilyExample(); + deleteFromColumnFamilyExample.deleteFromColumnFamily(projectId, instanceId, TABLE_ID); + row = bigtableDataClient.readRow(TableId.of(TABLE_ID), rowKey); + List cellsAfterDelete = row.getCells(COLUMN_FAMILY_NAME_STATS); + + Truth.assertThat(cellsAfterDelete).isEmpty(); + } + + @Test + public void test7_testDeleteColumnFamily() throws IOException { + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies()) + .comparingElementsUsing(COLUMN_FAMILY_ID_CORRESPONDENCE) + .contains(COLUMN_FAMILY_NAME_STATS); + + DeleteColumnFamilyExample deleteColumnFamilyExample = new DeleteColumnFamilyExample(); + deleteColumnFamilyExample.deleteColumnFamily( + projectId, instanceId, TABLE_ID, COLUMN_FAMILY_NAME_STATS); + + Truth.assertThat(tableAdminClient.getTable(TABLE_ID).getColumnFamilies()) + .comparingElementsUsing(COLUMN_FAMILY_ID_CORRESPONDENCE) + .doesNotContain(COLUMN_FAMILY_NAME_STATS); + } + } + + @Test + public void test8_testDeleteTable() throws IOException { + try (BigtableTableAdminClient tableAdminClient = + BigtableTableAdminClient.create(projectId, instanceId)) { + Truth.assertThat(tableAdminClient.exists(TABLE_ID)).isTrue(); + + DeleteTableExample deleteTableExample = new DeleteTableExample(); + deleteTableExample.deleteTable(projectId, instanceId, TABLE_ID); + + Truth.assertThat(tableAdminClient.exists(TABLE_ID)).isFalse(); + } + } +} diff --git a/java-bigtable/scripts/setup-test-table.sh b/java-bigtable/scripts/setup-test-table.sh new file mode 100755 index 000000000000..c8bb1e2a62a6 --- /dev/null +++ b/java-bigtable/scripts/setup-test-table.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# Set up a table to use for integration tests. + +set -e +set -u + +ADMIN_HOSTS=( + "bigtableadmin.googleapis.com:443" + "test-bigtableadmin.sandbox.googleapis.com:443" +) + +ZONE=us-central1-b +FAMILY=cf + +# Format: projects//instances//tables/ +TABLE_NAME=$1 + +if [[ ${TABLE_NAME} =~ projects\/([^/]+)\/instances\/([^/]+)\/tables\/([^/]+) ]]; then + PROJECT_ID=${BASH_REMATCH[1]} + INSTANCE_ID=${BASH_REMATCH[2]} + TABLE_ID=${BASH_REMATCH[3]} +else + echo "Invalid table name: $TABLE_NAME" 1>&2 + exit 1 +fi + +call_cbt() { + cbt -admin-endpoint="${ADMIN_HOST}" -project "${PROJECT_ID}" -instance "${INSTANCE_ID}" "$@" +} + +for ADMIN_HOST in "${ADMIN_HOSTS[@]}"; do + # Ensure that the instance exists. + if ! call_cbt listinstances | grep -q "${INSTANCE_ID}"; then + call_cbt createinstance "${INSTANCE_ID}" "${INSTANCE_ID}" "${INSTANCE_ID}-c0" "${ZONE}" 1 SSD + fi + + # Ensure that the table exists + if ! call_cbt -instance "$INSTANCE_ID" ls | grep -q "^${TABLE_ID}\$"; then + call_cbt createtable "$TABLE_ID" "families=$FAMILY:maxversions=1||maxage=1h" + fi +done diff --git a/java-bigtable/test-proxy/EnableAutoValue.txt b/java-bigtable/test-proxy/EnableAutoValue.txt new file mode 100644 index 000000000000..e8237e1cbc6d --- /dev/null +++ b/java-bigtable/test-proxy/EnableAutoValue.txt @@ -0,0 +1,2 @@ +This is a marker file to trigger auto-value injection into the annotation processor path +https://github.com/googleapis/java-shared-config/blob/51c9f68ff1736761b21c921f078ab2c8675ff268/pom.xml#L758 \ No newline at end of file diff --git a/java-bigtable/test-proxy/README.md b/java-bigtable/test-proxy/README.md new file mode 100644 index 000000000000..f87a3374cae2 --- /dev/null +++ b/java-bigtable/test-proxy/README.md @@ -0,0 +1,50 @@ +# CBT Java Test Proxy + +The CBT test proxy is intended for running conformance tests for Cloud Bigtable Java Client. + +## Set up + +If you have not already done so, [install golang](https://go.dev/doc/install), then clone the go test library: + +``` +git clone https://github.com/googleapis/cloud-bigtable-clients-test.git +``` + +## Start test proxy + +Build the proxy with the latest/head version of the client + +``` +cd java-bigtable +mvn clean install -DskipTests +cd test-proxy +mvn clean install -DskipTests +``` + +Start the proxy on default port 9999 + +``` +java -jar target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar +``` + +Start the proxy on a different port + +``` +java -Dport=1 -jar target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar +``` + +## Run the test cases + +``` +cd cloud-bigtable-clients-test/tests +go test -v -proxy_addr=:9999 +``` + +## Test a released client + +To do so, you need to build the proxy with the released version of the client. +Please download the source code +[here](https://github.com/googleapis/java-bigtable/releases), and repeat the +above steps. + +Note that Kokoro presubmit test doesn't use this route. diff --git a/java-bigtable/test-proxy/known_failures.txt b/java-bigtable/test-proxy/known_failures.txt new file mode 100644 index 000000000000..46d48c46f84d --- /dev/null +++ b/java-bigtable/test-proxy/known_failures.txt @@ -0,0 +1 @@ +TestFeatureGap/(traffic_director_enabled|direct_access_requested)|TestReadRows_Retry_WithRetryInfo_MultipleErrorResponse diff --git a/java-bigtable/test-proxy/pom.xml b/java-bigtable/test-proxy/pom.xml new file mode 100644 index 000000000000..bee7f162f9ea --- /dev/null +++ b/java-bigtable/test-proxy/pom.xml @@ -0,0 +1,172 @@ + + 4.0.0 + com.google.cloud + google-cloud-bigtable-test-proxy + 0.0.1-SNAPSHOT + jar + Google Cloud Bigtable Test Proxy + https://github.com/googleapis/java-bigtable + Cloud Bigtable Java Client test proxy for running conformance tests. + + + google-cloud-bigtable-parent + com.google.cloud + 2.77.2-SNAPSHOT + + + + 2.77.2-SNAPSHOT + + + + + + com.google.cloud + google-cloud-bigtable-bom + ${bigtable.client.version} + pom + import + + + com.google.cloud + google-cloud-bigtable-deps-bom + ${bigtable.client.version} + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable + + + io.grpc + grpc-netty + + + io.grpc + grpc-stub + + + com.google.protobuf + protobuf-java + + + + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.22.3:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.62.2:exe:${os.detected.classifier} + + + + + compile + compile-custom + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + true + + + + org.apache.maven.plugins + maven-site-plugin + + true + + + + org.apache.maven.plugins + maven-source-plugin + + true + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + org.apache.maven.plugins + maven-gpg-plugin + + true + + + + org.codehaus.mojo + clirr-maven-plugin + + true + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + com.google.cloud.bigtable.testproxy.CbtTestProxyMain + + + + + + + + + + + diff --git a/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java new file mode 100644 index 000000000000..43da147274f7 --- /dev/null +++ b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java @@ -0,0 +1,169 @@ +/* + * Copyright 2024 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.cloud.bigtable.testproxy; + +import com.google.bigtable.v2.Value; +import com.google.bigtable.v2.Value.KindCase; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.models.sql.BoundStatement; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.protobuf.Timestamp; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class BoundStatementDeserializer { + + static BoundStatement toBoundStatement( + PreparedStatement preparedStatement, ExecuteQueryRequest request) { + BoundStatement.Builder boundStatementBuilder = preparedStatement.bind(); + for (Map.Entry paramEntry : request.getRequest().getParamsMap().entrySet()) { + String name = paramEntry.getKey(); + Value value = paramEntry.getValue(); + switch (value.getType().getKindCase()) { + case BYTES_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setBytesParam(name, null); + } else if (value.getKindCase().equals(KindCase.BYTES_VALUE)) { + boundStatementBuilder.setBytesParam(name, value.getBytesValue()); + } else { + throw new IllegalArgumentException("Unexpected bytes value: " + value); + } + break; + case STRING_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setStringParam(name, null); + } else if (value.getKindCase().equals(KindCase.STRING_VALUE)) { + boundStatementBuilder.setStringParam(name, value.getStringValue()); + } else { + throw new IllegalArgumentException("Malformed string value: " + value); + } + break; + case INT64_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setLongParam(name, null); + } else if (value.getKindCase().equals(KindCase.INT_VALUE)) { + boundStatementBuilder.setLongParam(name, value.getIntValue()); + } else { + throw new IllegalArgumentException("Malformed int64 value: " + value); + } + break; + case FLOAT32_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setFloatParam(name, null); + } else if (value.getKindCase().equals(KindCase.FLOAT_VALUE)) { + boundStatementBuilder.setFloatParam(name, (float) value.getFloatValue()); + } else { + throw new IllegalArgumentException("Malformed float32 value: " + value); + } + break; + case FLOAT64_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setDoubleParam(name, null); + } else if (value.getKindCase().equals(KindCase.FLOAT_VALUE)) { + boundStatementBuilder.setDoubleParam(name, value.getFloatValue()); + } else { + throw new IllegalArgumentException("Malformed float64 value: " + value); + } + break; + case BOOL_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setBooleanParam(name, null); + } else if (value.getKindCase().equals(KindCase.BOOL_VALUE)) { + boundStatementBuilder.setBooleanParam(name, value.getBoolValue()); + } else { + throw new IllegalArgumentException("Malformed boolean value: " + value); + } + break; + case TIMESTAMP_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setTimestampParam(name, null); + } else if (value.getKindCase().equals(KindCase.TIMESTAMP_VALUE)) { + Timestamp ts = value.getTimestampValue(); + boundStatementBuilder.setTimestampParam(name, toInstant(ts)); + } else { + throw new IllegalArgumentException("Malformed timestamp value: " + value); + } + break; + case DATE_TYPE: + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setDateParam(name, null); + } else if (value.getKindCase().equals(KindCase.DATE_VALUE)) { + com.google.type.Date protoDate = value.getDateValue(); + boundStatementBuilder.setDateParam(name, fromProto(protoDate)); + } else { + throw new IllegalArgumentException("Malformed boolean value: " + value); + } + break; + case ARRAY_TYPE: + SqlType.Array sqlType = (SqlType.Array) SqlType.fromProto(value.getType()); + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + boundStatementBuilder.setListParam(name, null, sqlType); + } else if (value.getKindCase().equals(KindCase.ARRAY_VALUE)) { + List array = new ArrayList<>(); + for (Value elem : value.getArrayValue().getValuesList()) { + array.add(decodeArrayElement(elem, sqlType.getElementType())); + } + boundStatementBuilder.setListParam(name, array, sqlType); + } else { + throw new IllegalArgumentException("Malformed array value: " + value); + } + break; + default: + throw new IllegalArgumentException("Unexpected query param type in param: " + value); + } + } + return boundStatementBuilder.build(); + } + + static Object decodeArrayElement(Value value, SqlType elemType) { + if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) { + return null; + } + switch (elemType.getCode()) { + case BYTES: + return value.getBytesValue(); + case STRING: + return value.getStringValue(); + case INT64: + return value.getIntValue(); + case FLOAT64: + return value.getFloatValue(); + case FLOAT32: + // cast to float so we produce List, etc + return (float) value.getFloatValue(); + case BOOL: + return value.getBoolValue(); + case TIMESTAMP: + return toInstant(value.getTimestampValue()); + case DATE: + return fromProto(value.getDateValue()); + default: + // We should have already thrown an exception in the SqlRowMerger + throw new IllegalStateException("Unsupported array query param element type: " + elemType); + } + } + + private static Instant toInstant(Timestamp timestamp) { + return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); + } + + private static Date fromProto(com.google.type.Date proto) { + return Date.fromYearMonthDay(proto.getYear(), proto.getMonth(), proto.getDay()); + } +} diff --git a/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java new file mode 100644 index 000000000000..d2147e6167da --- /dev/null +++ b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java @@ -0,0 +1,818 @@ +/* + * Copyright 2024 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.cloud.bigtable.testproxy; + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; +import static java.nio.charset.StandardCharsets.UTF_8; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ServerStream; +import com.google.auth.oauth2.AccessToken; +import com.google.auth.oauth2.OAuth2Credentials; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.bigtable.v2.Row; +import com.google.bigtable.v2.Value; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.MutateRowsException; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.PreparedStatement; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import com.google.cloud.bigtable.testproxy.CloudBigtableV2TestProxyGrpc.CloudBigtableV2TestProxyImplBase; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Status; +import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; +import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; +import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; +import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; +import io.grpc.protobuf.StatusProto; +import io.grpc.stub.StreamObserver; +import java.io.ByteArrayInputStream; +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutionException; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** Java implementation of the CBT test proxy. Used to test the Java CBT client. */ +public class CbtTestProxy extends CloudBigtableV2TestProxyImplBase implements Closeable { + + /** + * Class that holds BigtableDataSettings and a BigtableDataClient created with those settings. + * Used so users can retrieve settings for a particular client. + */ + @AutoValue + abstract static class CbtClient { + static CbtClient create(BigtableDataSettings settings, BigtableDataClient dataClient) { + return new AutoValue_CbtTestProxy_CbtClient(settings, dataClient); + } + + abstract BigtableDataSettings settings(); + + abstract BigtableDataClient dataClient(); + } + + private static final Logger logger = Logger.getLogger(CbtTestProxy.class.getName()); + + private CbtTestProxy() { + this.idClientMap = new ConcurrentHashMap<>(); + } + + /** Factory method to return a proxy instance. */ + public static CbtTestProxy create() { + return new CbtTestProxy(); + } + + /** + * Helper method to override the timeout settings of data APIs. TODO(developer): per-attempt + * timeout may also be overridden, which will involve test harness update. + * + * @param settingsBuilder The Builder object of BigtableDataSettings. + * @param newTimeout The value that is used to set the timeout. + */ + private static BigtableDataSettings.Builder overrideTimeoutSetting( + Duration newTimeout, BigtableDataSettings.Builder settingsBuilder) { + + updateTimeout( + settingsBuilder.stubSettings().bulkMutateRowsSettings().retrySettings(), newTimeout); + updateTimeout(settingsBuilder.stubSettings().mutateRowSettings().retrySettings(), newTimeout); + updateTimeout(settingsBuilder.stubSettings().readRowSettings().retrySettings(), newTimeout); + updateTimeout(settingsBuilder.stubSettings().readRowsSettings().retrySettings(), newTimeout); + updateTimeout( + settingsBuilder.stubSettings().checkAndMutateRowSettings().retrySettings(), newTimeout); + updateTimeout( + settingsBuilder.stubSettings().readModifyWriteRowSettings().retrySettings(), newTimeout); + updateTimeout( + settingsBuilder.stubSettings().sampleRowKeysSettings().retrySettings(), newTimeout); + updateTimeout( + settingsBuilder.stubSettings().executeQuerySettings().retrySettings(), newTimeout); + updateTimeout( + settingsBuilder.stubSettings().prepareQuerySettings().retrySettings(), newTimeout); + + return settingsBuilder; + } + + private static void updateTimeout(RetrySettings.Builder settings, Duration newTimeout) { + Duration rpcTimeout = settings.getInitialRpcTimeoutDuration(); + + // TODO: this should happen in gax + // Clamp the rpcTimeout to the overall timeout + if (rpcTimeout != null && rpcTimeout.compareTo(newTimeout) > 0) { + settings.setInitialRpcTimeoutDuration(newTimeout).setMaxRpcTimeoutDuration(newTimeout); + } + + settings.setTotalTimeoutDuration(newTimeout); + } + + /** Helper method to get a client object by its id. */ + private CbtClient getClient(String id) throws StatusException { + CbtClient client = idClientMap.get(id); + if (client == null) { + throw Status.NOT_FOUND.withDescription("Client " + id + " not found.").asException(); + } + return client; + } + + @Override + public synchronized void createClient( + CreateClientRequest request, StreamObserver responseObserver) { + Preconditions.checkArgument(!request.getClientId().isEmpty(), "client id must be provided"); + Preconditions.checkArgument(!request.getProjectId().isEmpty(), "project id must be provided"); + Preconditions.checkArgument(!request.getInstanceId().isEmpty(), "instance id must be provided"); + Preconditions.checkArgument(!request.getDataTarget().isEmpty(), "data target must be provided"); + Preconditions.checkArgument( + !request.getSecurityOptions().getUseSsl() + || !request.getSecurityOptions().getSslRootCertsPemBytes().isEmpty(), + "security_options.ssl_root_certs_pem must be provided if security_options.use_ssl is true"); + + if (idClientMap.containsKey(request.getClientId())) { + responseObserver.onError( + Status.ALREADY_EXISTS + .withDescription("Client " + request.getClientId() + " already exists.") + .asException()); + return; + } + + // setRefreshingChannel is needed for now. + @SuppressWarnings("deprecation") + BigtableDataSettings.Builder settingsBuilder = + BigtableDataSettings.newBuilder() + // Disable channel refreshing when not using the real server + .setRefreshingChannel(false) + .setProjectId(request.getProjectId()) + .setInstanceId(request.getInstanceId()) + .setAppProfileId(request.getAppProfileId()); + + if (request.hasPerOperationTimeout()) { + Duration newTimeout = Duration.ofMillis(Durations.toMillis(request.getPerOperationTimeout())); + settingsBuilder = overrideTimeoutSetting(newTimeout, settingsBuilder); + logger.info( + String.format( + "Total timeout is set to %s for all the methods", + Durations.toString(request.getPerOperationTimeout()))); + } + + if (request.getOptionalFeatureConfig() + == OptionalFeatureConfig.OPTIONAL_FEATURE_CONFIG_ENABLE_ALL) { + logger.info("Enabling all the optional features"); + try { + BigtableDataSettings.enableBuiltinMetrics(); + } catch (IOException e) { + // Exception will be raised if Application Default Credentials is not found. + // We can ignore it as it doesn't impact the client correctness testing. + if (!e.getMessage().toUpperCase().contains("APPLICATION DEFAULT CREDENTIALS")) { + responseObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); + return; + } + } + settingsBuilder.stubSettings().bulkMutateRowsSettings().setServerInitiatedFlowControl(true); + settingsBuilder.stubSettings().setEnableRoutingCookie(true); + settingsBuilder.stubSettings().setEnableRetryInfo(true); + } + + // Create and store CbtClient for later use + try { + if (!request.getDataTarget().equals("emulator")) { + settingsBuilder + .stubSettings() + .setEndpoint(request.getDataTarget()) + .setTransportChannelProvider( + getTransportChannel( + request.getSecurityOptions().getUseSsl(), + request.getSecurityOptions().getSslRootCertsPem(), + request.getSecurityOptions().getSslEndpointOverride())) + .setCredentialsProvider( + getCredentialsProvider(request.getSecurityOptions().getAccessToken())); + } + BigtableDataSettings settings = settingsBuilder.build(); + BigtableDataClient client = BigtableDataClient.create(settings); + CbtClient cbtClient = CbtClient.create(settings, client); + idClientMap.put(request.getClientId(), cbtClient); + } catch (IOException e) { + responseObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); + return; + } + + responseObserver.onNext(CreateClientResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void closeClient( + CloseClientRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + client.dataClient().close(); + + responseObserver.onNext(CloseClientResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void removeClient( + RemoveClientRequest request, StreamObserver responseObserver) { + CbtClient client = idClientMap.remove(request.getClientId()); + if (client == null) { + responseObserver.onError( + Status.NOT_FOUND + .withDescription("Client " + request.getClientId() + " not found.") + .asException()); + return; + } + + responseObserver.onNext(RemoveClientResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } + + @Override + public void mutateRow( + MutateRowRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + RowMutation mutation = RowMutation.fromProto(request.getRequest()); + try { + // This response is empty. + client.dataClient().mutateRow(mutation); + } catch (ApiException e) { + responseObserver.onNext(MutateRowResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + MutateRowResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } + + responseObserver.onNext( + MutateRowResult.newBuilder().setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + responseObserver.onCompleted(); + } + + @Override + public void bulkMutateRows( + MutateRowsRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + BulkMutation batch = BulkMutation.fromProto(request.getRequest()); + try { + client.dataClient().bulkMutateRows(batch); + } catch (MutateRowsException e) { + MutateRowsResult.Builder resultBuilder = MutateRowsResult.newBuilder(); + for (MutateRowsException.FailedMutation failed : e.getFailedMutations()) { + resultBuilder + .addEntriesBuilder() + .setIndex(failed.getIndex()) + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(failed.getError().getStatusCode().getCode().ordinal()) + .setMessage(failed.getError().getMessage()) + .build()); + } + responseObserver.onNext( + resultBuilder + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } catch (ApiException e) { + responseObserver.onNext(MutateRowsResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + MutateRowsResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } + + responseObserver.onNext( + MutateRowsResult.newBuilder() + // Note that the default instance == OK + .setStatus(com.google.rpc.Status.getDefaultInstance()) + .build()); + responseObserver.onCompleted(); + } + + @Override + public void readRow(ReadRowRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + String tableId; + try { + tableId = extractTableIdFromTableName(request.getTableName()); + } catch (IllegalArgumentException e) { + responseObserver.onError( + Status.INVALID_ARGUMENT.withDescription(e.getMessage()).asException()); + return; + } + + com.google.cloud.bigtable.data.v2.models.Row row; + try { + row = + client + .dataClient() + .readRow(tableId, request.getRowKey(), FILTERS.fromProto(request.getFilter())); + if (row != null) { + RowResult.Builder resultBuilder = convertRowResult(row); + responseObserver.onNext( + // Note that the default instance == OK + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } else { + logger.info(String.format("readRow() did not find row: %s", request.getRowKey())); + } + } catch (ApiException e) { + responseObserver.onNext(RowResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + RowResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } catch (RuntimeException e) { + // If client encounters problem, don't return any row result. + responseObserver.onNext( + RowResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL.getNumber()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + responseObserver.onCompleted(); + } + + @Override + public void readRows(ReadRowsRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + ServerStream rows; + Query query = Query.fromProto(request.getRequest()); + try { + rows = client.dataClient().readRows(query); + int cancelAfterRows = request.getCancelAfterRows(); + RowsResult.Builder resultBuilder = convertRowsResult(rows, cancelAfterRows); + responseObserver.onNext( + // Note that the default instance == OK + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } catch (ApiException e) { + responseObserver.onNext(RowsResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + RowsResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } catch (RuntimeException e) { + // If client encounters problem, don't return any row result. + responseObserver.onNext( + RowsResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL.getNumber()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + responseObserver.onCompleted(); + } + + /** + * Helper method to convert row from type com.google.cloud.bigtable.data.v2.models.Row to type + * com.google.bigtable.v2.Row. After conversion, row cells within the same column and family are + * grouped and ordered; the ordering of qualifiers within the same family is preserved; but the + * ordering of families is not (the original order is not specified after all). + * + * @param row Logical row of type com.google.cloud.bigtable.data.v2.models.Row + * @return the converted row in RowResult Builder + */ + private static RowResult.Builder convertRowResult( + com.google.cloud.bigtable.data.v2.models.Row row) { + Row.Builder rowBuilder = Row.newBuilder(); + rowBuilder.setKey(row.getKey()); + + Map>> grouped = + row.getCells().stream() + .collect( + Collectors.groupingBy( + RowCell::getFamily, + Collectors.groupingBy( + RowCell::getQualifier, LinkedHashMap::new, Collectors.toList()))); + for (Map.Entry>> e : grouped.entrySet()) { + Family.Builder family = rowBuilder.addFamiliesBuilder().setName(e.getKey()); + + for (Map.Entry> e2 : e.getValue().entrySet()) { + Column.Builder column = family.addColumnsBuilder().setQualifier(e2.getKey()); + + for (RowCell rowCell : e2.getValue()) { + column + .addCellsBuilder() + .setTimestampMicros(rowCell.getTimestamp()) + .setValue(rowCell.getValue()) + .addAllLabels(rowCell.getLabels()); + } + } + } + + RowResult.Builder resultBuilder = RowResult.newBuilder(); + resultBuilder.setRow(rowBuilder.build()); + return resultBuilder; + } + + /** + * Helper method to convert rows from type com.google.cloud.bigtable.data.v2.models.Row to type + * com.google.bigtable.v2.Row. Row order is preserved. + * + * @param rows Logical rows in ServerStream + * @param cancelAfterRows Ignore the results after this row if set positive + * @return the converted rows in RowsResult Builder + */ + private static RowsResult.Builder convertRowsResult( + ServerStream rows, int cancelAfterRows) { + RowsResult.Builder resultBuilder = RowsResult.newBuilder(); + int rowCounter = 0; + for (com.google.cloud.bigtable.data.v2.models.Row row : rows) { + rowCounter++; + RowResult.Builder rowResultBuilder = convertRowResult(row); + resultBuilder.addRows(rowResultBuilder.getRow()); + + if (cancelAfterRows > 0 && rowCounter >= cancelAfterRows) { + logger.info( + String.format("Canceling ReadRows() to respect cancel_after_rows=%d", cancelAfterRows)); + break; + } + } + return resultBuilder; + } + + @Override + public void sampleRowKeys( + SampleRowKeysRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + String tableId; + try { + tableId = extractTableIdFromTableName(request.getRequest().getTableName()); + } catch (IllegalArgumentException e) { + responseObserver.onError( + Status.INVALID_ARGUMENT.withDescription(e.getMessage()).asException()); + return; + } + + List keyOffsets; + try { + keyOffsets = client.dataClient().sampleRowKeys(tableId); + } catch (ApiException e) { + responseObserver.onNext(SampleRowKeysResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + SampleRowKeysResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } + + SampleRowKeysResult.Builder resultBuilder = SampleRowKeysResult.newBuilder(); + for (KeyOffset keyOffset : keyOffsets) { + resultBuilder + .addSamplesBuilder() + .setRowKey(keyOffset.getKey()) + .setOffsetBytes(keyOffset.getOffsetBytes()); + } + responseObserver.onNext( + // Note that the default instance == OK + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + responseObserver.onCompleted(); + } + + @Override + public void checkAndMutateRow( + CheckAndMutateRowRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + ConditionalRowMutation mutation = ConditionalRowMutation.fromProto(request.getRequest()); + Boolean matched; + try { + matched = client.dataClient().checkAndMutateRow(mutation); + } catch (ApiException e) { + responseObserver.onNext( + CheckAndMutateRowResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + CheckAndMutateRowResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } + + CheckAndMutateRowResult.Builder resultBuilder = CheckAndMutateRowResult.newBuilder(); + resultBuilder.getResultBuilder().setPredicateMatched(matched); + responseObserver.onNext( + // Note that the default instance == OK + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + responseObserver.onCompleted(); + } + + @Override + public void readModifyWriteRow( + ReadModifyWriteRowRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + + com.google.cloud.bigtable.data.v2.models.Row row; + ReadModifyWriteRow mutation = ReadModifyWriteRow.fromProto(request.getRequest()); + try { + row = client.dataClient().readModifyWriteRow(mutation); + if (row != null) { + RowResult.Builder resultBuilder = convertRowResult(row); + responseObserver.onNext( + // Note that the default instance == OK + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } else { + logger.info( + String.format( + "readModifyWriteRow() did not find row: %s", request.getRequest().getRowKey())); + } + } catch (ApiException e) { + responseObserver.onNext(RowResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + RowResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } catch (RuntimeException e) { + // If client encounters problem, fail the whole operation. + responseObserver.onNext( + RowResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL.getNumber()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + responseObserver.onCompleted(); + } + + @Override + public void executeQuery( + ExecuteQueryRequest request, StreamObserver responseObserver) { + CbtClient client; + try { + client = getClient(request.getClientId()); + } catch (StatusException e) { + responseObserver.onError(e); + return; + } + ResultSet resultSet = null; + try { + Map> paramTypes = new HashMap<>(); + for (Map.Entry entry : request.getRequest().getParamsMap().entrySet()) { + paramTypes.put(entry.getKey(), SqlType.fromProto(entry.getValue().getType())); + } + PreparedStatement preparedStatement = + client.dataClient().prepareStatement(request.getRequest().getQuery(), paramTypes); + resultSet = + client + .dataClient() + .executeQuery( + BoundStatementDeserializer.toBoundStatement(preparedStatement, request)); + responseObserver.onNext( + new ResultSetSerializer(request.getProtoDescriptors()).toExecuteQueryResult(resultSet)); + } catch (InterruptedException e) { + responseObserver.onError(e); + return; + } catch (ExecutionException e) { + responseObserver.onError(e); + return; + } catch (ApiException e) { + responseObserver.onNext(ExecuteQueryResult.newBuilder().setStatus(convertStatus(e)).build()); + responseObserver.onCompleted(); + return; + } catch (StatusRuntimeException e) { + responseObserver.onNext( + ExecuteQueryResult.newBuilder().setStatus(StatusProto.fromThrowable(e)).build()); + responseObserver.onCompleted(); + return; + } catch (RuntimeException e) { + // If client encounters problem, don't return any results. + responseObserver.onNext( + ExecuteQueryResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL.getNumber()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } finally { + if (resultSet != null) { + resultSet.close(); + } + } + responseObserver.onCompleted(); + } + + @Override + public synchronized void close() { + Iterator> it = idClientMap.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry entry = it.next(); + entry.getValue().dataClient().close(); + it.remove(); + } + } + + private static String extractTableIdFromTableName(String fullTableName) + throws IllegalArgumentException { + Matcher matcher = tablePattern.matcher(fullTableName); + if (!matcher.matches()) { + throw new IllegalArgumentException("Invalid table name: " + fullTableName); + } + return matcher.group(3); + } + + @SuppressWarnings("rawtypes") + private InstantiatingGrpcChannelProvider getTransportChannel( + boolean encrypted, String rootCertsPem, String sslTarget) { + if (!encrypted) { + return EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build(); + } + + final SslContext sslContext; + if (rootCertsPem.isEmpty()) { + sslContext = null; + } else { + try { + sslContext = + GrpcSslContexts.forClient() + .trustManager(new ByteArrayInputStream(rootCertsPem.getBytes(UTF_8))) + .build(); + } catch (IOException e) { + throw new IllegalArgumentException(e); + } + } + + return EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator( + new ApiFunction() { + @Override + public ManagedChannelBuilder apply(ManagedChannelBuilder input) { + NettyChannelBuilder channelBuilder = (NettyChannelBuilder) input; + + // The default replaces long (several KiB) error messages with "http2 exception" + channelBuilder.maxInboundMetadataSize(Integer.MAX_VALUE); + + if (sslContext != null) { + channelBuilder.sslContext(sslContext); + } + + if (!sslTarget.isEmpty()) { + channelBuilder.overrideAuthority(sslTarget); + } + + return channelBuilder; + } + }) + .build(); + } + + // Cleanly forwards server errors through the test proxy. Internal client errors + // are wrapped in an UNKNOWN status. + private static com.google.rpc.Status convertStatus(ApiException e) { + com.google.rpc.Status status = StatusProto.fromThrowable(e); + if (status != null) { + return status; + } + + return com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build(); + } + + private CredentialsProvider getCredentialsProvider(String accessToken) { + if (accessToken.isEmpty()) { + return NoCredentialsProvider.create(); + } + + return FixedCredentialsProvider.create( + OAuth2Credentials.create(new AccessToken(accessToken, null))); + } + + private final ConcurrentHashMap idClientMap; + + private static final Pattern tablePattern = + Pattern.compile("projects/([^/]+)/instances/([^/]+)/tables/([^/]+)"); +} diff --git a/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.java b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.java new file mode 100644 index 000000000000..77a764f5512a --- /dev/null +++ b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.java @@ -0,0 +1,45 @@ +/* + * 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.google.cloud.bigtable.testproxy; + +import io.grpc.ServerBuilder; +import java.io.IOException; +import java.util.logging.Logger; + +/** Starts a CbtTestProxy server. */ +public final class CbtTestProxyMain { + + private CbtTestProxyMain() {} + + private static final Logger logger = Logger.getLogger(CbtTestProxyMain.class.getName()); + + public static void main(String[] args) throws InterruptedException, IOException { + int port = Integer.getInteger("port", 9999); + if (port <= 0) { + throw new IllegalArgumentException(String.format("Port %d is not > 0.", port)); + } + + CbtTestProxy cbtTestProxy = CbtTestProxy.create(); + logger.info(String.format("Test proxy starting on %d", port)); + ServerBuilder.forPort(port) + .addService(cbtTestProxy) + .maxInboundMessageSize(Integer.MAX_VALUE) + .maxInboundMetadataSize(Integer.MAX_VALUE) + .build() + .start() + .awaitTermination(); + } +} diff --git a/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/ResultSetSerializer.java b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/ResultSetSerializer.java new file mode 100644 index 000000000000..2467ce529967 --- /dev/null +++ b/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/ResultSetSerializer.java @@ -0,0 +1,390 @@ +/* + * Copyright 2024 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.cloud.bigtable.testproxy; + +import com.google.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.Type; +import com.google.bigtable.v2.Type.Array; +import com.google.bigtable.v2.Type.Bool; +import com.google.bigtable.v2.Type.Bytes; +import com.google.bigtable.v2.Type.Float32; +import com.google.bigtable.v2.Type.Float64; +import com.google.bigtable.v2.Type.Int64; +import com.google.bigtable.v2.Type.Map; +import com.google.bigtable.v2.Type.Proto; +import com.google.bigtable.v2.Type.Struct; +import com.google.bigtable.v2.Type.Timestamp; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.bigtable.common.Type.SchemalessEnum; +import com.google.cloud.bigtable.common.Type.SchemalessProto; +import com.google.cloud.bigtable.data.v2.models.sql.ColumnMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType; +import com.google.cloud.bigtable.data.v2.models.sql.StructReader; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.DescriptorProtos.FileDescriptorProto; +import com.google.protobuf.DescriptorProtos.FileDescriptorSet; +import com.google.protobuf.Descriptors.Descriptor; +import com.google.protobuf.Descriptors.DescriptorValidationException; +import com.google.protobuf.Descriptors.EnumDescriptor; +import com.google.protobuf.Descriptors.FileDescriptor; +import com.google.protobuf.DynamicMessage; +import com.google.protobuf.ProtocolMessageEnum; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; + +public class ResultSetSerializer { + + // This is a helper enum to satisfy the type constraints of {@link StructReader#getProtoEnum}. + private static class DummyEnum implements ProtocolMessageEnum { + + private final int value; + private final EnumDescriptor descriptor; + + private DummyEnum(int value, EnumDescriptor descriptor) { + this.value = value; + this.descriptor = descriptor; + } + + @Override + public int getNumber() { + return value; + } + + @Override + public com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return descriptor.findValueByNumber(value); + } + + @Override + public com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return descriptor; + } + } + + /** + * A map of all known message descriptors, keyed by their fully qualified name (e.g., + * "my.package.MyMessage"). + */ + private final java.util.Map messageDescriptorMap; + + /** + * A map of all known enum descriptors, keyed by their fully qualified name (e.g., + * "my.package.MyEnum"). + */ + private final java.util.Map enumDescriptorMap; + + /** + * Helper function to recursively adds a message descriptor and all its nested types to the map. + */ + private void populateDescriptorMapsRecursively(Descriptor descriptor) { + messageDescriptorMap.put(descriptor.getFullName(), descriptor); + + for (EnumDescriptor nestedEnum : descriptor.getEnumTypes()) { + enumDescriptorMap.put(nestedEnum.getFullName(), nestedEnum); + } + for (Descriptor nestedMessage : descriptor.getNestedTypes()) { + populateDescriptorMapsRecursively(nestedMessage); + } + } + + /** + * Creates a serializer with a descriptor cache built from the provided FileDescriptorSet. This is + * useful for handling PROTO or ENUM types that require schema lookup. + * + * @param descriptorSet A set containing one or more .proto file definitions and all their + * non-standard dependencies. All .proto file must be provided in dependency order. + * @throws IllegalArgumentException if the descriptorSet contains unresolvable dependencies. + */ + public ResultSetSerializer(FileDescriptorSet descriptorSet) throws IllegalArgumentException { + this.messageDescriptorMap = new HashMap<>(); + this.enumDescriptorMap = new HashMap<>(); + java.util.Map builtDescriptors = new HashMap<>(); + + for (FileDescriptorProto fileDescriptorProto : descriptorSet.getFileList()) { + // Collect dependencies. This code require files inside the descriptor set to be sorted + // according to the dependency order. + List dependencies = new ArrayList<>(); + for (String dependencyName : fileDescriptorProto.getDependencyList()) { + FileDescriptor dependency = builtDescriptors.get(dependencyName); + if (dependency != null) { + // Dependency is already built, add it. + dependencies.add(dependency); + } + // Dependency is not in our set. We assume it's a well-known type (e.g., + // google/protobuf/timestamp.proto) that buildFrom() can find and link automatically. + } + + try { + FileDescriptor fileDescriptor = + FileDescriptor.buildFrom( + fileDescriptorProto, dependencies.toArray(new FileDescriptor[0])); + builtDescriptors.put(fileDescriptor.getName(), fileDescriptor); + // Now, populate both message and enum maps with all messages/enums in this file. + for (EnumDescriptor enumDescriptor : fileDescriptor.getEnumTypes()) { + enumDescriptorMap.put(enumDescriptor.getFullName(), enumDescriptor); + } + for (Descriptor messageDescriptor : fileDescriptor.getMessageTypes()) { + populateDescriptorMapsRecursively(messageDescriptor); + } + } catch (DescriptorValidationException e) { + throw new IllegalArgumentException( + "Failed to build descriptor for " + fileDescriptorProto.getName(), e); + } + } + } + + public ExecuteQueryResult toExecuteQueryResult(ResultSet resultSet) + throws ExecutionException, InterruptedException { + ExecuteQueryResult.Builder resultBuilder = ExecuteQueryResult.newBuilder(); + for (ColumnMetadata columnMetadata : resultSet.getMetadata().getColumns()) { + resultBuilder + .getMetadataBuilder() + .addColumnsBuilder() + .setName(columnMetadata.name()) + .setType(toProtoType(columnMetadata.type())); + } + + while (resultSet.next()) { + SqlRow.Builder rowBuilder = resultBuilder.addRowsBuilder(); + + for (int i = 0; i < resultSet.getMetadata().getColumns().size(); i++) { + SqlType colType = resultSet.getMetadata().getColumnType(i); + rowBuilder.addValues(toProtoValue(getColumn(resultSet, i, colType), colType)); + } + } + + return resultBuilder.build(); + } + + private Value toProtoValue(Object value, SqlType type) { + if (value == null) { + return Value.getDefaultInstance(); + } + + Value.Builder valueBuilder = Value.newBuilder(); + switch (type.getCode()) { + case BYTES: + valueBuilder.setBytesValue((ByteString) value); + break; + case PROTO: + valueBuilder.setBytesValue(((AbstractMessage) value).toByteString()); + break; + case STRING: + valueBuilder.setStringValue((String) value); + break; + case INT64: + valueBuilder.setIntValue((Long) value); + break; + case ENUM: + valueBuilder.setIntValue(((ProtocolMessageEnum) value).getNumber()); + break; + case FLOAT32: + valueBuilder.setFloatValue((Float) value); + break; + case FLOAT64: + valueBuilder.setFloatValue((Double) value); + break; + case BOOL: + valueBuilder.setBoolValue((Boolean) value); + break; + case TIMESTAMP: + Instant ts = (Instant) value; + valueBuilder.setTimestampValue( + com.google.protobuf.Timestamp.newBuilder() + .setSeconds(ts.getEpochSecond()) + .setNanos(ts.getNano()) + .build()); + break; + case DATE: + Date date = (Date) value; + valueBuilder.setDateValue( + com.google.type.Date.newBuilder() + .setYear(date.getYear()) + .setMonth(date.getMonth()) + .setDay(date.getDayOfMonth()) + .build()); + break; + case ARRAY: + SqlType elementType = ((SqlType.Array) type).getElementType(); + ArrayValue.Builder arrayValue = ArrayValue.newBuilder(); + for (Object item : (List) value) { + arrayValue.addValues(toProtoValue(item, elementType)); + } + valueBuilder.setArrayValue(arrayValue.build()); + break; + case MAP: + SqlType.Map mapType = (SqlType.Map) type; + SqlType mapKeyType = mapType.getKeyType(); + SqlType mapValueType = mapType.getValueType(); + + ArrayValue.Builder mapArrayValue = ArrayValue.newBuilder(); + ((java.util.Map) value) + .forEach( + (k, v) -> + mapArrayValue.addValues( + Value.newBuilder() + .setArrayValue( + ArrayValue.newBuilder() + .addValues(toProtoValue(k, mapKeyType)) + .addValues(toProtoValue(v, mapValueType)) + .build()))); + valueBuilder.setArrayValue(mapArrayValue.build()); + break; + case STRUCT: + StructReader structValue = (StructReader) value; + SqlType.Struct structType = (SqlType.Struct) type; + ArrayValue.Builder structArrayValue = ArrayValue.newBuilder(); + for (int i = 0; i < structType.getFields().size(); ++i) { + SqlType fieldType = structType.getType(i); + structArrayValue.addValues(toProtoValue(getColumn(structValue, i, fieldType), fieldType)); + } + valueBuilder.setArrayValue(structArrayValue); + break; + default: + throw new IllegalStateException("Unexpected Type: " + type); + } + + return valueBuilder.build(); + } + + private Object getColumn(StructReader struct, int fieldIndex, SqlType fieldType) { + if (struct.isNull(fieldIndex)) { + return null; + } + + switch (fieldType.getCode()) { + case ARRAY: + return struct.getList(fieldIndex, (SqlType.Array) fieldType); + case BOOL: + return struct.getBoolean(fieldIndex); + case BYTES: + return struct.getBytes(fieldIndex); + case PROTO: + SchemalessProto protoType = (SchemalessProto) fieldType; + Descriptor descriptor = messageDescriptorMap.get(protoType.getMessageName()); + if (descriptor == null) { + throw new IllegalArgumentException( + "Descriptor for message " + protoType.getMessageName() + " could not be found"); + } + return struct.getProtoMessage(fieldIndex, DynamicMessage.getDefaultInstance(descriptor)); + case DATE: + return struct.getDate(fieldIndex); + case FLOAT32: + return struct.getFloat(fieldIndex); + case FLOAT64: + return struct.getDouble(fieldIndex); + case INT64: + return struct.getLong(fieldIndex); + case ENUM: + SchemalessEnum enumType = (SchemalessEnum) fieldType; + EnumDescriptor enumDescriptor = enumDescriptorMap.get(enumType.getEnumName()); + if (enumDescriptor == null) { + throw new IllegalArgumentException( + "Descriptor for enum " + enumType.getEnumName() + " could not be found"); + } + // We need to extract the integer value of the enum. `getProtoEnum` is the only + // available method, but it is designed for static enum types. To work around this, + // we can pass a lambda that constructs our DummyEnum with the captured integer value + // and the descriptor from the outer scope. + return struct.getProtoEnum(fieldIndex, number -> new DummyEnum(number, enumDescriptor)); + case MAP: + return struct.getMap(fieldIndex, (SqlType.Map) fieldType); + case STRING: + return struct.getString(fieldIndex); + case STRUCT: + return struct.getStruct(fieldIndex); + case TIMESTAMP: + return struct.getTimestamp(fieldIndex); + default: + throw new IllegalStateException("Unexpected Type: " + fieldType); + } + } + + private static Type toProtoType(SqlType type) { + switch (type.getCode()) { + case BYTES: + return Type.newBuilder().setBytesType(Bytes.getDefaultInstance()).build(); + case STRING: + return Type.newBuilder() + .setStringType(com.google.bigtable.v2.Type.String.getDefaultInstance()) + .build(); + case INT64: + return Type.newBuilder().setInt64Type(Int64.getDefaultInstance()).build(); + case FLOAT32: + return Type.newBuilder().setFloat32Type(Float32.getDefaultInstance()).build(); + case FLOAT64: + return Type.newBuilder().setFloat64Type(Float64.getDefaultInstance()).build(); + case BOOL: + return Type.newBuilder().setBoolType(Bool.getDefaultInstance()).build(); + case TIMESTAMP: + return Type.newBuilder().setTimestampType(Timestamp.getDefaultInstance()).build(); + case DATE: + return Type.newBuilder() + .setDateType(com.google.bigtable.v2.Type.Date.getDefaultInstance()) + .build(); + case ARRAY: + SqlType.Array arrayType = (SqlType.Array) type; + return Type.newBuilder() + .setArrayType( + Array.newBuilder().setElementType(toProtoType(arrayType.getElementType()))) + .build(); + case MAP: + SqlType.Map mapType = (SqlType.Map) type; + return Type.newBuilder() + .setMapType( + Map.newBuilder() + .setKeyType(toProtoType(mapType.getKeyType())) + .setValueType(toProtoType(mapType.getValueType()))) + .build(); + case STRUCT: + SqlType.Struct structType = (SqlType.Struct) type; + Struct.Builder structBuilder = Struct.newBuilder(); + for (SqlType.Struct.Field field : structType.getFields()) { + structBuilder + .addFieldsBuilder() + .setFieldName(field.name()) + .setType(toProtoType(field.type())); + } + return Type.newBuilder().setStructType(structBuilder.build()).build(); + case PROTO: + SchemalessProto protoType = (SchemalessProto) type; + return Type.newBuilder() + .setProtoType( + Proto.newBuilder() + .setMessageName(protoType.getMessageName()) + .setSchemaBundleId(protoType.schemaBundleId()) + .build()) + .build(); + case ENUM: + SchemalessEnum enumType = (SchemalessEnum) type; + return Type.newBuilder() + .setEnumType( + com.google.bigtable.v2.Type.Enum.newBuilder() + .setEnumName(enumType.getEnumName()) + .setSchemaBundleId(enumType.schemaBundleId()) + .build()) + .build(); + default: + throw new IllegalStateException("Unexpected Type: " + type); + } + } +} diff --git a/java-bigtable/test-proxy/src/main/proto/test_proxy.proto b/java-bigtable/test-proxy/src/main/proto/test_proxy.proto new file mode 100644 index 000000000000..34cf534425c2 --- /dev/null +++ b/java-bigtable/test-proxy/src/main/proto/test_proxy.proto @@ -0,0 +1,357 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.bigtable.testproxy; + +import "google/api/client.proto"; +import "google/bigtable/v2/bigtable.proto"; +import "google/bigtable/v2/data.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/descriptor.proto"; +import "google/rpc/status.proto"; + +option go_package = "./testproxypb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.bigtable.testproxy"; + +// A config flag that dictates how the optional features should be enabled +// during the client creation. The optional features customize how the client +// interacts with the server, and are defined in +// https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/feature_flags.proto +enum OptionalFeatureConfig { + OPTIONAL_FEATURE_CONFIG_DEFAULT = 0; + + OPTIONAL_FEATURE_CONFIG_ENABLE_ALL = 1; +} + +// Request to test proxy service to create a client object. +message CreateClientRequest { + message SecurityOptions { + // Access token to use for client credentials. If empty, the client will not + // use any call credentials. Certain implementations may require `use_ssl` + // to be set when using this. + string access_token = 1; + + // Whether to use SSL channel credentials when connecting to the data + // endpoint. + bool use_ssl = 2; + + // If using SSL channel credentials, override the SSL endpoint to match the + // host that is specified in the backend's certificate. Also sets the + // client's authority header value. + string ssl_endpoint_override = 3; + + // PEM encoding of the server root certificates. If not set, the default + // root certs will be used instead. The default can be overridden via the + // GRPC_DEFAULT_SSL_ROOTS_FILE_PATH env var. + string ssl_root_certs_pem = 4; + } + + // A unique ID associated with the client object to be created. + string client_id = 1; + + // The "host:port" address of the data API endpoint (i.e. the backend being + // proxied to). Example: 127.0.0.1:38543. If you want to connect to a local + // emulator via BIGTABLE_EMULATOR_HOST environment variable, you can use + // "emulator" instead of "host:port" for this field. + string data_target = 2; + + // The project for all calls on this client. + string project_id = 3; + + // The instance for all calls on this client. + string instance_id = 4; + + // Optional app profile for all calls on this client. + // Some client bindings allow specifying the app profile on a per-operation + // basis. We don't yet support this in the proxy API, but may in the future. + string app_profile_id = 5; + + // If provided, a custom timeout will be set for each API call conducted by + // the created client. Otherwise, the default timeout from the client library + // will be used. Note that the override applies to all the methods. + google.protobuf.Duration per_operation_timeout = 6; + + // Optional config that dictates how the optional features should be enabled + // during the client creation. Please check the enum type's docstring above. + OptionalFeatureConfig optional_feature_config = 7; + + // Options to allow connecting to backends with channel and/or call + // credentials. This is needed internally by Cloud Bigtable's own testing + // frameworks.It is not necessary to support these fields for client + // conformance testing. + // + // WARNING: this allows the proxy to connect to a real production + // CBT backend with the right options, however, the proxy itself is insecure + // so it is not recommended to use it with real credentials or outside testing + // contexts. + SecurityOptions security_options = 8; +} + +// Response from test proxy service for CreateClientRequest. +message CreateClientResponse {} + +// Request to test proxy service to close a client object. +message CloseClientRequest { + // The ID of the target client object. + string client_id = 1; +} + +// Response from test proxy service for CloseClientRequest. +message CloseClientResponse {} + +// Request to test proxy service to remove a client object. +message RemoveClientRequest { + // The ID of the target client object. + string client_id = 1; +} + +// Response from test proxy service for RemoveClientRequest. +message RemoveClientResponse {} + +// Request to test proxy service to read a row. +message ReadRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The unique name of the table from which to read the row. + // Values are of the form + // `projects//instances//tables/
`. + string table_name = 4; + + // The row key of the target row. + string row_key = 2; + + // The row filter to be applied to the target row. + google.bigtable.v2.RowFilter filter = 3; +} + +// Response from test proxy service for ReadRowRequest or +// ReadModifyWriteRowRequest. +message RowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The contents of a single row. + google.bigtable.v2.Row row = 2; +} + +// Request to test proxy service to read rows. +message ReadRowsRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ReadRowsRequest request = 2; + + // The streaming read can be canceled before all items are seen. + // Has no effect if non-positive. + int32 cancel_after_rows = 3; +} + +// Response from test proxy service for ReadRowsRequest. +message RowsResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The contents of rows. + repeated google.bigtable.v2.Row rows = 2; +} + +// Request to test proxy service to mutate a row. +message MutateRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.MutateRowRequest request = 2; +} + +// Response from test proxy service for MutateRowRequest. +message MutateRowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; +} + +// Request to test proxy service to mutate rows. +message MutateRowsRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.MutateRowsRequest request = 2; +} + +// Response from test proxy service for MutateRowsRequest. +message MutateRowsResult { + // The RPC status from the client binding, corresponding to the + // whole operation. + google.rpc.Status status = 1; + + // The results corresponding to the failed rows. + repeated google.bigtable.v2.MutateRowsResponse.Entry entries = 2; +} + +// Request to test proxy service to check and mutate a row. +message CheckAndMutateRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.CheckAndMutateRowRequest request = 2; +} + +// Response from test proxy service for CheckAndMutateRowRequest. +message CheckAndMutateRowResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The raw response from the Bigtable server. + google.bigtable.v2.CheckAndMutateRowResponse result = 2; +} + +// Request to test proxy service to sample row keys. +message SampleRowKeysRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.SampleRowKeysRequest request = 2; +} + +// Response from test proxy service for SampleRowKeysRequest. +message SampleRowKeysResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // The raw responses from the Bigtable server. + repeated google.bigtable.v2.SampleRowKeysResponse samples = 2; +} + +// Request to test proxy service to read modify write a row. +message ReadModifyWriteRowRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ReadModifyWriteRowRequest request = 2; +} + +// Request to test proxy service to execute a query. +message ExecuteQueryRequest { + // The ID of the target client object. + string client_id = 1; + + // The raw request to the Bigtable server. + google.bigtable.v2.ExecuteQueryRequest request = 2; + + // The file descriptor set for the query. + google.protobuf.FileDescriptorSet proto_descriptors = 3; +} + +// Response from test proxy service for ExecuteQueryRequest. +message ExecuteQueryResult { + // The RPC status from the client binding. + google.rpc.Status status = 1; + + // deprecated + google.bigtable.v2.ResultSetMetadata result_set_metadata = 2; + + // Name and type information for the query result. + ResultSetMetadata metadata = 4; + + // Encoded version of the ResultSet. Should not contain type information. + repeated SqlRow rows = 3; +} + +// Schema information for the query result. +message ResultSetMetadata { + // Column metadata for each column inthe query result. + repeated google.bigtable.v2.ColumnMetadata columns = 1; +} + +// Representation of a single row in the query result. +message SqlRow { + // Columnar values returned by the query. + repeated google.bigtable.v2.Value values = 1; +} + +// Note that all RPCs are unary, even when the equivalent client binding call +// may be streaming. This is an intentional simplification. +// +// Most methods have sync (default) and async variants. For async variants, +// the proxy is expected to perform the async operation, then wait for results +// before delivering them back to the driver client. +// +// Operations that may have interesting concurrency characteristics are +// represented explicitly in the API (see ReadRowsRequest.cancel_after_rows). +// We include such operations only when they can be meaningfully performed +// through client bindings. +// +// Users should generally avoid setting deadlines for requests to the Proxy +// because operations are not cancelable. If the deadline is set anyway, please +// understand that the underlying operation will continue to be executed even +// after the deadline expires. +service CloudBigtableV2TestProxy { + option (google.api.default_host) = + "bigtable-test-proxy-not-accessible.googleapis.com"; + + // Client management: + // + // Creates a client in the proxy. + // Each client has its own dedicated channel(s), and can be used concurrently + // and independently with other clients. + rpc CreateClient(CreateClientRequest) returns (CreateClientResponse) {} + + // Closes a client in the proxy, making it not accept new requests. + rpc CloseClient(CloseClientRequest) returns (CloseClientResponse) {} + + // Removes a client in the proxy, making it inaccessible. Client closing + // should be done by CloseClient() separately. + rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse) {} + + // Bigtable operations: for each operation, you should use the synchronous or + // asynchronous variant of the client method based on the `use_async_method` + // setting of the client instance. For starters, you can choose to implement + // one variant, and return UNIMPLEMENTED status for the other. + // + // Reads a row with the client instance. + // The result row may not be present in the response. + // Callers should check for it (e.g. calling has_row() in C++). + rpc ReadRow(ReadRowRequest) returns (RowResult) {} + + // Reads rows with the client instance. + rpc ReadRows(ReadRowsRequest) returns (RowsResult) {} + + // Writes a row with the client instance. + rpc MutateRow(MutateRowRequest) returns (MutateRowResult) {} + + // Writes multiple rows with the client instance. + rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult) {} + + // Performs a check-and-mutate-row operation with the client instance. + rpc CheckAndMutateRow(CheckAndMutateRowRequest) + returns (CheckAndMutateRowResult) {} + + // Obtains a row key sampling with the client instance. + rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult) {} + + // Performs a read-modify-write operation with the client. + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult) {} + + // Executes a BTQL query with the client. + rpc ExecuteQuery(ExecuteQueryRequest) returns (ExecuteQueryResult) {} +} diff --git a/java-health/owlbot.py b/java-health/owlbot.py index 6da47954339a..fbb37df70f1a 100644 --- a/java-health/owlbot.py +++ b/java-health/owlbot.py @@ -33,6 +33,5 @@ "java.header", "license-checks.xml", "renovate.json", - ".gitignore", - ], -) \ No newline at end of file + ".gitignore" +]) \ No newline at end of file diff --git a/pom.xml b/pom.xml index 00c347aafec9..3d195465e575 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ java-bigquerymigrationjava-bigqueryreservationjava-bigquerystorage + java-bigtablejava-billingjava-billingbudgetsjava-binary-authorization diff --git a/versions.txt b/versions.txt index 2bf23bdb3ff0..45e9a9fcdd64 100644 --- a/versions.txt +++ b/versions.txt @@ -1034,3 +1034,10 @@ proto-google-maps-mapmanagement-v2beta:0.1.0:0.1.0 grpc-google-maps-mapmanagement-v2beta:0.1.0:0.1.0 grpc-google-cloud-valkey-v1beta:0.38.0:0.38.0 grpc-google-cloud-valkey-v1:0.38.0:0.38.0 +google-cloud-bigtable:2.77.1:2.77.2-SNAPSHOT +grpc-google-cloud-bigtable-admin-v2:2.77.1:2.77.2-SNAPSHOT +grpc-google-cloud-bigtable-v2:2.77.1:2.77.2-SNAPSHOT +proto-google-cloud-bigtable-admin-v2:2.77.1:2.77.2-SNAPSHOT +proto-google-cloud-bigtable-v2:2.77.1:2.77.2-SNAPSHOT +google-cloud-bigtable-emulator:0.214.1:0.214.2-SNAPSHOT +google-cloud-bigtable-emulator-core:0.214.1:0.214.2-SNAPSHOT